Posts

Showing posts from June, 2015

Css Selector Last Child Code Example

Example 1: css last child li:last-child { background-color: lime; } Example 2: selecting last child css p:last-child { font-size: 0.75em; } Example 3: css selector last child li:last-child { background-color: lime; } Example 4: css last child with class /*This will only work if the last child of someEID has the class .myclassName if the last child does not have class name us js*/ #someEID .myClassName:last-child { background: blue; }

Gameobject.setactive Unity Code Example

Example 1: unity c# set gameobject active gameObject . SetActive ( true ) Example 2: unity enable gameobject GameObject . Find ( "PlayMenu 3" ) . SetActive ( false ) ; // you could also store a GameObject as variable

L'entente Cordiale Streaming Code Example

Example: L'entente cordiale streaming -webkit-user-select : none ; /* Safari */ -moz-user-select : none ; /* Firefox */ -ms-user-select : none ; /* IE10+/Edge */ user-select : none ; /* Standard */

100% Width Background Image With An 'auto' Height

Answer : Tim S. was much closer to a "correct" answer then the currently accepted one. If you want to have a 100% width, variable height background image done with CSS, instead of using cover (which will allow the image to extend out from the sides) or contain (which does not allow the image to extend out at all), just set the CSS like so: body { background-image: url(img.jpg); background-position: center top; background-size: 100% auto; } This will set your background image to 100% width and allow the height to overflow. Now you can use media queries to swap out that image instead of relying on JavaScript. EDIT: I just realized (3 months later) that you probably don't want the image to overflow; you seem to want the container element to resize based on it's background-image (to preserve it's aspect ratio), which is not possible with CSS as far as I know. Hopefully soon you'll be able to use the new srcset attribute on the img element

Android - How To Get Plain HTML Using EvaluateJavascript From Webview? JSOUP Not Able To Parse The Result HTML

Answer : You should use JsonReader to parse the value: webView.evaluateJavascript("(function() {return document.getElementsByTagName('html')[0].outerHTML;})();", new ValueCallback<String>() { @Override public void onReceiveValue(final String value) { JsonReader reader = new JsonReader(new StringReader(value)); reader.setLenient(true); try { if(reader.peek() == JsonToken.STRING) { String domStr = reader.nextString(); if(domStr != null) { handleResponseSuccessByBody(domStr); } } } catch (IOException e) { // handle exception } finally { IoUtil.close(reader); } } }); for remove the UTFCharacthers use this function: public static StringBuffer removeUTFCharacters(String data) { Pattern p = Pattern.compile("\\\\u(\\p{XDigit}{4})"); Matcher m = p.matcher(data);

Html Select Tag Placeholder Code Example

Example 1: placeholder select html <!DOCTYPE html> <head> </head> <body> <select name= "food" > <!-- The following line makes a placeholder --> <option value= "" disabled selected hidden>select food</option> <option value= "apple" >apple</option> <option value= "melon" >melon</option> </select> </body> Example 2: html select placeholder Placeholder attribute does not exist for the <select> tag. But there are some ways to make a placeholder for the select box. The easiest way of making a placeholder for the <select> element is using the disabled and selected attributes with the HTML5 hidden global attribute. <select name= "monthname" required> <option value= "" selected disabled hidden>Select Month</option> <option value= "Jan" >January</option> <option valu

Destroy Gameobject With Tag Unity Code Example

Example: unity destroy all objects with tag GameObject [ ] enemies = GameObject . FindGameObjectsWithTag ( "Enemy" ) ; foreach ( GameObject enemy in enemies ) { GameObject . Destroy ( enemy ) ; }

Angular Cli Exclude Files/directory For `ng Test --code-coverage`

Answer : With the latest CLI, inside angular.json "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "./karma.conf.js", "codeCoverageExclude": ["src/testing/**/*"], Updated September 2019 With Angular CLI 6, angular-cli.json has been renamed to angular.json which contains the configuration. In angular.json , codeCoverage expects a boolean value, which sets whether code-coverage should be done with every test run or not. To exclude files from code coverage, there is a property codeCoverageExclude which accepts an array of files to be excluded from code coverage. angular.json "test": { "codeCoverageExclude":

Bootstrap Loader Example

Example 1: circlular waiting icon bootstrap <div class= "spinner-border" role= "status" > <span class= "sr-only" >Loading...</span> </div> Example 2: bootstrap loader <div class= "spinner-border text-primary" role= "status" > <span class= "sr-only" >Loading...</span> </div> <div class= "spinner-border text-secondary" role= "status" > <span class= "sr-only" >Loading...</span> </div> <div class= "spinner-border text-success" role= "status" > <span class= "sr-only" >Loading...</span> </div> <div class= "spinner-border text-danger" role= "status" > <span class= "sr-only" >Loading...</span> </div> <div class= "spinner-border text-warning" role= "status" > <span class= "

To Upper C Code Example

Example 1: convert string to uppercase in c For those of you who want to uppercase a string and store it in a variable ( that was what I was looking for when I read these answers ) . # include <stdio.h> //<-- You need this to use printf. # include <string.h> //<-- You need this to use string and strlen() function. # include <ctype.h> //<-- You need this to use toupper() function. int main ( void ) { string s = "I want to cast this" ; //<-- Or you can ask to the user for a string. unsigned long int s_len = strlen ( s ) ; //<-- getting the length of 's'. //Defining an array of the same length as 's' to, temporarily, store the case change. char s_up [ s_len ] ; // Iterate over the source string (i.e. s) and cast the case changing. for ( int a = 0 ; a < s_len ; a ++ ) { // Storing the change: Use the temp array while casting to uppercase.

Convert Youtube To Mp4 Hd Code Example

Example 1: youtube to mp4 ytmp3 . cc is the best by far Example 2: youtube to mp4 flvto . biz is great for it

Css :focus Example

The :focus CSS pseudo-class represents an element (such as a form input) that has received focus. It is generally triggered when the user clicks or taps on an element or selects it with the keyboard's Tab key. /* Selects any <input> when focused */ input:focus { color : red ; } Note: This pseudo-class applies only to the focused element itself. Use :focus-within if you want to select an element that contains a focused element. Syntax :focus Examples HTML < input class = " red-input " value = " I ' ll be red when focused. " > < br > < input class = " blue-input " value = " I ' ll be blue when focused. " > CSS .red-input:focus { background : yellow ; color : red ; } .blue-input:focus { background : yellow ; color : blue ; } Result Accessibility concerns Make sure the visual focus indicator can be seen by people with low vision. This will also benefit anyone use a screen in a bri

C Print Double With 2 Decimal Places Code Example

Example: print double with 2 decimals c printf ( "%.2f" , number ) ;