Posts

Showing posts from October, 2010

Android Foreground Service Notification Not Showing

Answer : It's because of Android O bg services restrictions. So now you need to call startForeground() only for services that were started with startForegroundService() and call it in first 5 seconds after service has been started. Here is the guide - https://developer.android.com/about/versions/oreo/background#services Like this: //Start service: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(new Intent(this, YourService.class)); } else { startService(new Intent(this, YourService.class)); } Then create and show notification (with channel as supposed earlier): private void createAndShowForegroundNotification(Service yourService, int notificationId) { final NotificationCompat.Builder builder = getNotificationBuilder(yourService, "com.example.your_app.notification.CHANNEL_ID_FOREGROUND", // Channel id NotificationManagerCompat.IMPORTANCE_LOW); //Low importance prevent visual appearance for this notifica

48inch In Cm Code Example

Example: inch to cm 1 inch = 2.54 cm

Remove Global Package Npm Code Example

Example 1: How to uninstall npm modules in node js? The command is simply npm uninstall <name> // Here are different options : // - removes the module from node_modules but // does NOT update package.json npm uninstall <name> // - removes it from dependencies in package.json aswell npm uninstall <name> --save // - removes it from devDependencies in package.json aswell npm uninstall <name> --save-dev // - also removes it globally npm uninstall -g <name> --save // If you're removing a global package , however , any applications // referencing it will crash. // A local install will be in the node_modules/ directory of your // application. This won't affect the application if a module remains // there with no references to it. // The Node.js documents https : //npmjs.org/doc/ have all the commands // that you need to know with npm. Example 2: how to uninstall global package npm npm uninstall -g <package-name> # example npm un

Getbuttondown Unity With UI Buttons Code Example

Example: input get button uibutton public void ButtonClick ( ) { //Do whatever you want here }

How To Update Node On Ubuntu Code Example

Example 1: updating node js ubuntu curl - sL https : //deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt - get install - y nodejs Example 2: update node ubuntu sudo npm cache clean - f sudo npm install - g n sudo n stable Example 3: upgrade node ubuntu sudo npm cache clean - f sudo npm install - g n sudo n stable Example 4: update npm ubuntu update npm ubuntu Example 5: upgrade nodejs ubuntu npm cache clean - f Example 6: ubuntu update nodejs # Using Ubuntu curl - sL https : //deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt - get install - y nodejs # Using Debian , as root curl - sL https : //deb.nodesource.com/setup_12.x | bash - apt - get install - y nodejs

Css Transition Background-color Code Example

Example 1: css transition all -webkit-transition : all .3 s ease-in-out ; -moz-transition : all .3 s ease-in-out ; -o-transition : all .3 s ease-in-out ; -ms-transition : all .3 s ease-in-out ; transition : all .3 s ease-in-out ; Example 2: css background color transition /* Answer to: "css background color transition" */ /* Transitions currently work in Safari, Chrome, Firefox, Opera and Internet Explorer 10+. The following should produce a fade effect for you on the browsers mentioned above: */ a { background-color : #FF0 ; } a :hover { background-color : #AD310B ; -webkit-transition : background-color 1000 ms linear ; -ms-transition : background-color 1000 ms linear ; transition : background-color 1000 ms linear ; } Example 3: css transform transition .selector { transition : transform 1 s ; }

Angular ViewChildren

decorator Parameter decorator that configures a view query. See more... Description Use to get the QueryList of elements or directives from the view DOM. Any time a child element is added, removed, or moved, the query list will be updated, and the changes observable of the query list will emit a new value. View queries are set before the ngAfterViewInit callback is called. Metadata Properties : selector - The directive type or the name used for querying. read - Used to read a different token from the queried elements. emitDistinctChangesOnly - The QueryList#changes observable will emit new values only if the QueryList result has changed. When false the changes observable might emit even if the QueryList has not changed. Note: * This config option is deprecated , it will be permanently set to true and removed in future versions of Angular. Further information available in the Usage Notes... Options Usage notes import {AfterViewInit, Component, Direct

Vscode Comment Lines Code Example

Example 1: vscode comment block of code html * * * * * * * * * * For Mac * * * * * * * * * * * * * * -> How to comment a block ? Command + K + C -> How to uncomment a block ? Command + K + U Example 2: toggle line comment vs code Ctrl + / - Toggle line comment ( default ) Example 3: how to comment selection in visual studio In Visual Studio : Ctrl + K + C will comment , Ctrl + K + U Will uncomment Example 4: commenting in vscode //To comment a block of code in one go, try Ctrl + K, and the Ctrl + C to //comment or Ctrl + U to uncomment. //Pro-Tip: You can also do it without unpressing Ctrl.

Html Comment Block Code Example

Example 1: commenting in html <!-- a comment in html --> Example 2: html comment <! --This is a comment in html.--> <! --You can put comments enywhere! It does not care if it is mid peice of code in a peice of code! You must put the ending arrows in or it will think everything is a comment! Note you can comment over multiple lines. Use a ! at the start arrow , this may not make sence as the rest of html uses tags where ! is at the ends.--> Example 3: comments in html <!-- This text is commented in html --> Example 4: how to create comments in html5 Insert a single-line , or multi-line comment. Comments are designated by the tags <! -- and --> Use the comment function to hide scripts on unsupported browsers . If you are programming in JavaScript or VBScript , you can use the comment function to hide the script on browsers that don't support it. Insert the comment at the start of the script , and end it with //--> to ensure that the script wo

If Is Nan Matlab Code Example

Example 1: if is nan matlab A ( isnan ( A ) ) = 1 ; Example 2: if is nan matlab if any ( isnan ( PMatrix ) , 'all' )

Convert String Int To Int Javascript Code Example

Example 1: how to convert string to int js let string = "1" ; let num = parseInt ( string ) ; //num will equal 1 as a int Example 2: javascript string to integer < script language = "JavaScript" type = "text/javascript" > var a = "3.3445" ; var c = parseInt ( a ) ; alert ( c ) ; < / script > Example 3: string to int javascript var text = '42px' ; var integer = parseInt ( text , 10 ) ; // returns 42