Posts

Showing posts from April, 2012

Clear Cache Pip Code Example

Example 1: ignore cache pip # Add --no-cache-dir before install pip --no-cache-dir install scipy Example 2: pip clear download cache pip cache dir

Angular Providers Code Example

Example 1: how to inject service in component angular 6 you can inject service in components constructor : constructor ( public anyService : Service ) { } Example 2: angular import service import { < service name > Service } from '../<service path>' ; Example 3: angular how to use service in class import { < service name > Service } from '../<service path>' ; you can inject service in components constructor : constructor ( public anyService : Service ) { }

Alert On Click In Html Code Example

Example: jquery onclick function $ ( " #other " ) .click ( function ( ) { $ ( "#target" ) . click ( ) ; } ) ;

Codeigniter Where In Query Code Example

Example 1: update in codeigniter query $data = array ( 'title' => $title , 'name' => $name , 'date' => $date ) ; $ this - > db - > where ( 'id' , $id ) ; $ this - > db - > update ( 'mytable' , $data ) ; // Produces: // // UPDATE mytable // SET title = '{$title}', name = '{$name}', date = '{$date}' // WHERE id = $id Example 2: where_in codeigniter $ this - > db - > select ( 'ae_users.employee_id, ae_users.emp_name, ae_users.emp_name2, ae_users.emp_name3' ) ; $ this - > db - > from ( 'ae_users' ) ; $ this - > db - > where_in ( 'ae_users.employee_id' , $employee_ids ) ; $query = $ this - > db - > get ( ) ; if ( $query - > num_rows ( ) ) { return $query - > result_array ( ) ; } else { return 0 ; } Example 3: codeigni

Check Real Size Of USB Thumb Drive

Answer : f3 - Fight Flash Fraud There is only one alternative I found, but I think this is even a better one than the original h2testw tool for MS Windows. Fortunately, it is really easy to use, even from command line. There are GUIs available, though. There is also a lot of information about the implementation and the problem with fake drives on the tools website. Main page (source code): Documentation QT GUI f3 offer two methods: f3probe method: Much faster h2testw method: Slower. Also test R/W performance. Probably more reliable. The f3probe method (recomended) f3probe is one way to test the drives, not as accurate but faster since it does not write on the whole drive. You can read more about it on the tools website. If you want to be 100% sure, better use the h2testw method. As the developer describes on the website: f3probe is the fastest way to identify fake drives and their real sizes. And: Finally, thanks to f3probe being free software, and once f3probe

Can't Connect To Localhost On SQL Server Express 2012 / 2016

Image
Answer : According to Aaron Bertand: You need to verify that the SQL Server service is running. You can do this by going to Start > Control Panel > Administrative Tools > Services , and checking that the service SQL Server ( SQLEXPRESS ) is running. If not, start it. While you're in the services applet, also make sure that the service SQL Browser is started. If not, start it. You need to make sure that SQL Server is allowed to use TCP/IP or named pipes. You can turn these on by opening the SQL Server Configuration Manager in Start > Programs > Microsoft SQL Server 2012 > Configuration Tools (or SQL Server Configuration Manager ), and make sure that TCP/IP and Named Pipes are enabled. If you don't find the SQL Server Configuration Manager in the Start Menu you can launch the MMC snap-in manually. Check SQL Server Configuration Manager for the path to the snap-in according to your version. Verify your SQL Server connection authentication mode matche

Ls Windows Command Prompt Code Example

Example 1: ls equivalent in CMD Use the command dir to list all the directories and files in a directory Example 2: use ls in windows echo @dir % * > % systemroot % \system32\ls . bat Make sure you are running cmd as admin

Best JavaScript Compressor

Answer : I recently released UglifyJS, a JavaScript compressor which is written in JavaScript (runs on the NodeJS Node.js platform, but it can be easily modified to run on any JavaScript engine, since it doesn't need any Node.js internals). It's a lot faster than both YUI Compressor and Google Closure, it compresses better than YUI on all scripts I tested it on, and it's safer than Closure (knows to deal with "eval" or "with"). Other than whitespace removal, UglifyJS also does the following: changes local variable names (usually to single characters) joins consecutive var declarations avoids inserting any unneeded brackets, parens and semicolons optimizes IFs (removes "else" when it detects that it's not needed, transforms IFs into the &&, || or ?/: operators when possible, etc.). transforms foo["bar"] into foo.bar where possible removes quotes from keys in object literals, where possible resolves simple

14 Cm To Inches Code Example

Example: cm to inch 1 cm = 0.3937 inch

Program To Implement Circular Queue Using Linked List. Code Example

Example: circular queue using linked list in c++ # include <iostream> # define SIZE 100 using namespace std ; class node { public : node ( ) { next = NULL ; } int data ; node * next ; } * front = NULL , * rear = NULL , * n , * temp , * temp1 ; class cqueue { public : void insertion ( ) ; void deletion ( ) ; void display ( ) ; } ; int main ( ) { cqueue cqobj ; int ch ; do { cout << "\n\n\tMain Menu" ; cout << "\n##########################" ; cout << "\n1. Insert\n2. Delete\n3. Display\n4. Exit\n\nEnter Your Choice: " ; cin >> ch ; switch ( ch ) { case 1 : cqobj . insertion ( ) ; cqobj . display ( ) ; break ; case 2 : cqobj . deletion ( ) ; break ; case 3 : cqobj . display ( ) ; break ; case 4

100 Dpi Mouse Sofrware Code Example

Example: what is dpi in mouse DPI is the standard used to measure the mouse sensitivity, expressed as the number of DPIs (dots per linear inch) that a device can detect. By changing the DPI, you can instantly adjust pointer speed for precision tasks, such as in-game targeting or photo editing.

Bloc Flutter Bloc Code Example

Example 1: bloc flutter dependencies: flutter_bloc: ^4.0.1 Example 2: bloc lib flutter class CounterCubit extends Cubit { CounterCubit() : super(0); void increment() => emit(state + 1); void decrement() => emit(state - 1); }

Carry Flag, Auxiliary Flag And Overflow Flag In Assembly

Answer : Carry Flag The rules for turning on the carry flag in binary/integer math are two: The carry flag is set if the addition of two numbers causes a carry out of the most significant (leftmost) bits added. 1111 + 0001 = 0000 (carry flag is turned on) The carry (borrow) flag is also set if the subtraction of two numbers requires a borrow into the most significant (leftmost) bits subtracted. 0000 - 0001 = 1111 (carry flag is turned on) Otherwise, the carry flag is turned off (zero). 0111 + 0001 = 1000 (carry flag is turned off [zero]) 1000 - 0001 = 0111 (carry flag is turned off [zero]) In unsigned arithmetic, watch the carry flag to detect errors. In signed arithmetic, the carry flag tells you nothing interesting. Overflow Flag The rules for turning on the overflow flag in binary/integer math are two: If the sum of two numbers with the sign bits off yields a result number with the sign bit on, the "overflow" flag is turned on. 0100 + 0100 = 1000

Android Studio : How To Uninstall APK (or Execute Adb Command) Automatically Before Run Or Debug?

Answer : adb uninstall <package_name> can be used to uninstall an app via your PC. If you want this to happen automatically every time you launch your app via Android Studio, you can do this: In Android Studio, click the drop down list to the left of Run button, and select Edit configurations... Click on app under Android Application, and in General Tab, find the heading 'Before Launch' Click the + button, select Run external tool, click the + button in the popup window. Give some name (Eg adb uninstall) and description, and type adb in Program: and uninstall <your-package-name> in Parameters:. Make sure that the new item is selected when you click Ok in the popup window. Note: If you do not have adb in your PATH environment variable, give the full path to adb in Program: field (eg /home/user/android/sdk/platform-tools/adb). example adb uninstall com.my.firstapp List the packages by: adb shell su 0 pm list packages Review which package you w

Broadcast Receiver Not Working For SMS

Answer : Try declaring your receiver as the following : <receiver android:name=".SmsReceiver" android:permission="android.permission.BROADCAST_SMS" android:exported="true"> <intent-filter android:priority="5822" > <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> this works just fine for me , I only added a flag to tell that this receiver is exported . Edit: I forgot to add the priority to the intent filter. use high number for the priority. Found a topic that answers my doubt: Suppress / Block BroadcastReceiver in another app. Even with the priority set to the maximum possible (999), if another app has the same priority, in this case the Handcent SMS app, the first application that will receive the broadcast is the one that was first installed by the user. In my case was the Handcent SMS and because it aborts the broadcast when re

Adding Custom Property To Marker (Google Map Android API V2)

Answer : You cannot directly extend Marker , because it is a final class, but you have some options: 0) As of Google Maps Android API v2 version 9.4.0, you can use Marker::getTag and Marker::setTag . This is most likely the preferred option. 1) Create a map to store all additional information: private Map<Marker, MyData> allMarkersMap = new HashMap<Marker, MyData>(); When creating a marker, add it to this map with your data: Marker marker = map.addMarker(...); allMarkersMap.put(marker, myDataObj); Later in your render function: MyData myDataObj = allMarkersMap.get(marker); if (myDataObj.customProp) { ... 2) Another way would be to use Marker.snippet to store all the info as a String and later parse it, but that's kinda ugly and unmaintainable solution. 3) Switch from plain Google Maps Android API v2 to Android Maps Extensions. This is very similar to point 1, but you can directly store MyData into marker, using marker.setData(myDataObj)