Posts

Showing posts from November, 2000

Apk Location In New Android Studio

Image
Answer : To help people who might search for answer to this same question, it is important to know what type of projects you are using in Studio. Gradle The default project type when creating new project, and the recommended one in general is Gradle. For a new project called "Foo", the structure under the main folder will be Foo/ settings.gradle Foo/ build.gradle build/ Where the internal "Foo" folder is the main module (this structure allows you to create more modules later on in the same structure without changes). In this setup, the location of the generated APK will be under Foo/Foo/build/apk/... Note that each module can generate its own output, so the true output is more Foo/*/build/apk/... EDIT On the newest version of the Android Studio location path for generated output is Foo/*/build/outputs/apk/... IntelliJ If you are a user of IntelliJ before switching to Studio, and are importing your IntelliJ projec

C# DataGridView Not Updated When Datasource Is Changed

Answer : Quick and dirty solution : dataGridView.DataSource = null; dataGridView.DataSource = phase3Results; Clean and correct solution : Use a BindingList<T> instead of List<T> as your DataSource. List<T> does not fire events when its collection changes. Also, if you additionally implement INotifyPropertyChanged for T , BindingList<T> automatically subscribes to property changes for each T in the collection and lets the view know about the change. Try using a BindingList<> instead of List<> and (as already suggested by Daniel), implement INotifyPropertyChanged. However, I think you can also call .Refesh() if you didn't want to implement the INotifyPropertyChanged interface. Here's an example ripped from here public class Car : INotifyPropertyChanged { private string _make; private string _model; private int _year; public event PropertyChangedEventHandler PropertyChanged; public Car(string make, string m

Team Fortress Classic System Requirements Code Example

Example 1: team fortress classic Good Ending You Changed To Team Fortress Classic Only Because You Are Done With The Bots Example 2: team fortress classic The bots piss you off so change to classic mode good ending

10 Digit Mobile Number Validation In Javascript Regex Code Example

Example: 10 digit mobile number validation pattern in javascript \(?\d+\)?[-.\s]?\d+[-.\s]?\d+

Apache ZooKeeper WEB-UI

Answer : Yes there is. ZooNavigator is a web app that enables you to browse and edit data in ZooKeeper. The upcoming Zookeeper 3.5.0 will have a built in "Admin Server" interface at localhost:8080. You may have to enable or configure it to get it running. As of 2017-01-30 the current/stable version is 3.4.9 and 3.5.0 is labeled as being "alpha". Update: as of 2018-02-20 this feature still has't been released. It's now in 3.5.3 beta. The links have been updated but they may not remain active as the version number changes. Admin Server Documentation Admin Server Configuration zk-web is a git project that will help you. Check below link for more zk-web

Can I Edit A Google Chrome Theme?

Answer : A theme is a special kind of extension that changes the way the browser looks. Themes are packaged like regular extensions, but they don't contain JavaScript or HTML code. You can download any theme and modify it by editing the manifest.json file. Colors are in RGB format. To find the strings you can use within the "colors" field, look for kColor* strings in theme_service.cc. Image resources use paths relative to the root of the extension. You can override any of the images that are specified by kThemeableImages in theme_service.cc. Just remove the "IDR_" and convert the remaining characters to lowercase. Reference: https://developer.chrome.com/extensions/themes As was mentioned, you can find it in appdata folder, e.g.: C:\Users\mizer\AppData\Local\Google\Chrome\User Data\Default\Extensions\ Hint: Sort folders by date and you can easily find the one you want :) You can find it in your appdata folders. Mine was located at: C:\Users\home\AppD

Class Constructor Javascript Code Example

Example 1: es6 class example < script > class Student { constructor ( rno , fname , lname ) { this . rno = rno this . fname = fname this . lname = lname console . log ( 'inside constructor' ) } set rollno ( newRollno ) { console . log ( "inside setter" ) this . rno = newRollno } } let s1 = new Student ( 101 , 'Sachin' , 'Tendulkar' ) console . log ( s1 ) //setter is called s1 . rollno = 201 console . log ( s1 ) < / script > Example 2: javascript class constructor class Person { constructor ( name , age ) { this . name = name ; this . age = age ; } } const person = new Person ( "John Doe" , 23 ) ; console . log ( person . name ) ; // expected output: "John Doe" Example 3: constructor in js A constructor is a function that creates an instance of a clas

Android Resource Compilation Failed In V3.2

Answer : I was facing this issue today after updating gradle from 3.1.4 to 3.2.0 . I don't know why, but the build started to throw that exception. i deleted the build folder, and deleted the gradle caches folder but nothing worked, so i looked at the merged values.xml and turns out that my ids.xml was defining a wrong id that was being merged to the values.xml : <?xml version="1.0" encoding="utf-8"?> <resources> <item name="downloading_package" type="id">Baixando pacote de sincronização</item> </resources> And apparently this was working before the update... for my case i deleted the ids.xml file (it was useless in the project) I wish i could know why before the update everything was working the <item> in values.xml at line 900 ...might be of resource-type id . the correct syntax would be (just as the error message tells): <?xml version="1.0" encoding="utf-8&q

Angular Formgroup Code Example

Example 1: formgroup addcontrol let form : FormGroup = new FormGroup ( { } ) ; form . addControl ( field_name , new FormControl ( '' , Validators . required ) ) ; Example 2: update formgroup value angular To set all FormGroup values use , setValue : this . myFormGroup . setValue ( { formControlName1 : myValue1 , formControlName2 : myValue2 } ) ; To set only some values , use patchValue : this . myFormGroup . patchValue ( { formControlName1 : myValue1 , // formControlName2: myValue2 (can be omitted) } ) ; Example 3: formgroup reset values import { FormGroup } from '@angular/forms' ; class XComponent { form : FormGroup ; whateverMethod ( ) { //...reset this . form . reset ( ) ; } } Example 4: angular add formgroup to formgroup this . myForm = this . fb . group ( { name : [ '' , [ Validators . required ] ] , contacts : this . fb . group ( { email : [ '' , [ Valida

Chart Js Legend Color Code Example

Example 1: chartjs line color backgroundColor : '' , borderColor : '' Example 2: legend on click use default chartjs // How to implement a custom behaviour when clicking on a legend element var original = Chart . defaults . global . legend . onClick ; Chart . defaults . global . legend . onClick = function ( e , legendItem ) { /* do custom stuff here */ original . call ( this , e , legendItem ) ; } ;

C# - Get Switch Value If In Default Case

Answer : Is there a way to get the switch value from inside a case? The only (proper) way is actually to store the result of MyFoo() in a variable. var fooResult = MyFoo(); switch (fooResult) { case 0: ... break; ... default: handleOthersCase(fooResult); break; } This code is readable and understandable and have no extra cost (As @SheldonNeilson says: It's on the stack anyway). Also, the MSDN first example about switch totally look like this. You can also find informations int the language specification. You also can make your own switch based on a dictionary, but the only advantage I see is that you can use it for complex cases (any kind of object instead of string/int/...). Performance is a drawback. It may look like this: public class MySwitch<T> : Dictionary<T, Action<T>> { private Action<T> _defaultAction; public void TryInvoke(T value) { Action<T> action;

Can I Use Two 7805 ICs In Parallel To Get Double Current Capacity?

Image
Answer : As others have already said, paralleling multiple linear voltage regulators is a bad idea. However here is a way to effectively increase the current capability of a single linear regulator: At low currents, there is little voltage across R1. This keeps Q1 off, and things work as before. When the current builds up to around 700 mA, there will be enough voltage across R1 to start turning on Q1. This dumps some current onto the output. The regulator now needs to pass less current itself. Most additional current demand will be taken up by the transistor, not the regulator. The regulator still provides the regulation and acts as the voltage reference for the circuit to work. The drawback of this is the extra voltage drop across R1. This might be 750 mV or so at full output current of the combined regulator circuit. If IC1 has a minimum input voltage of 7.5 V, then IN must now be at 8.3 V or so minimum. A Better Way Use a buck regulator already! Consider the

Adb Server Is Out Of Date. Killing... Cannot Bind 'tcp:5037' ADB Server Didn't ACK * Failed To Start Daemon * In Ubuntu 14.04 LTS

Answer : You need to set the path of your SDK's adb into Genymotion. By default, Genymotion uses its own ADB tool (for many reasons). If the both binaries are not compatible (if your Android SDK platform tools or Genymotion has not been updated for a while) this problem happens. To solve it you can define a specific one from the Android SDK. To specify a custom ADB tool: Open Genymotion > Settings > ADB. Check Use custom Android SDK tools. Specify the path to the Android SDK by clicking Browse. Click OK. update the adb to 1.0.32 if you have 1.0.31 or lower adb version Android Debug Bridge version 1.0.31 wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb sudo mv adb /usr/bin/adb sudo chmod +x /usr/bin/adb adb version Android Debug Bridge version 1.0.32 for me the problem was that I am trying to use 2 adb processes sudo apt-get remove adb android-tools-adb and