Posts

Showing posts from October, 2014

Bootstrap Radio Button Css Code Example

Example 1: bootstrap radio < div class = " form-check form-check-inline " > < input class = " form-check-input " type = " radio " name = " inlineRadioOptions " id = " inlineRadio1 " value = " option1 " > < label class = " form-check-label " for = " inlineRadio1 " > 1 </ label > </ div > < div class = " form-check form-check-inline " > < input class = " form-check-input " type = " radio " name = " inlineRadioOptions " id = " inlineRadio2 " value = " option2 " > < label class = " form-check-label " for = " inlineRadio2 " > 2 </ label > </ div > < div class = " form-check form-check-inline " > < input class = " form-check-input " type = " radio " name = " inlineRadioOptions " id =

Check OS Version In Swift?

Answer : For iOS, try: var systemVersion = UIDevice.current.systemVersion For OS X, try: var systemVersion = NSProcessInfo.processInfo().operatingSystemVersion If you just want to check if the users is running at least a specific version, you can also use the following Swift 2 feature which works on iOS and OS X: if #available(iOS 9.0, *) { // use the feature only available in iOS 9 // for ex. UIStackView } else { // or use some work around } BUT it is not recommended to check the OS version. It is better to check if the feature you want to use is available on the device than comparing version numbers. For iOS, as mentioned above, you should check if it responds to a selector; eg.: if (self.respondsToSelector(Selector("showViewController"))) { self.showViewController(vc, sender: self) } else { // some work around } Update: Now you should use new availability checking introduced with Swift 2: e.g. To check for iOS 9.0 or later at

Clear Div Content Jquery Code Example

Example 1: delete all child elements jquery $ ( "div" ) . empty ( ) ; Example 2: jquery empty // Remove all child nodes of the set of matched elements from the DOM // This method does not accept any arguments. $ ( "div.parent" ) . empty ( ) ; Example 3: jquery clear text in div // removes only text, no changes to children $ ( '#YourDivId' ) . contents ( ) . filter ( ( _ , el ) => el . nodeType === 3 ) . remove ( ) ; Example 4: jquery if empty remove div //if empty remove parent $ ( '#id:empty' ) . parent ( ) . remove ( ) ; Example 5: remove text element jquery < ! doctype html > < html lang = "en" > < head > < meta charset = "utf-8" > < title > empty demo < / title > < style > p { background : yellow ; } < / style > < script src = "https://code.jquery.com/jquery-3.4.1.js" > < / script > < / head > <

Batch Not-equal (inequality) Operator

Answer : Try if NOT "asdf" == "fdas" echo asdf Use NEQ instead. if "asdf" NEQ "fdas" echo asdf I know this is quite out of date, but this might still be useful for those coming late to the party. (EDIT: updated since this still gets traffic and @Goozak has pointed out in the comments that my original analysis of the sample was incorrect as well.) I pulled this from the example code in your link: IF !%1==! GOTO VIEWDATA REM IF NO COMMAND-LINE ARG... FIND "%1" C:\BOZO\BOOKLIST.TXT GOTO EXIT0 REM PRINT LINE WITH STRING MATCH, THEN EXIT. :VIEWDATA TYPE C:\BOZO\BOOKLIST.TXT | MORE REM SHOW ENTIRE FILE, 1 PAGE AT A TIME. :EXIT0 !%1==! is simply an idiomatic use of == intended to verify that the thing on the left, that contains your variable, is different from the thing on the right, that does not. The ! in this case is just a character placeholder. It could be anything. If %1 has content, then the equality will be fals

Anime Dao Code Example

Example 1: anime Ah, I see you are a man of culture as well Example 2: anime "Whoever fights monsters should see to it that in the process he does not become a monster. And if you gaze long enough into an abyss, the abyss will gaze back into you."

Angular Material Form Example Swalne

Example 1: angular material input Html Favorite food Leave a comment TS import {Component} from '@angular/core'; /** * @title Basic Inputs */ @Component({ selector: 'input-overview-example', styleUrls: ['input-overview-example.css'], templateUrl: 'input-overview-example.html', }) export class InputOverviewExample {} CSS .example-form { min-width: 150px; max-width: 500px; width: 100%; } .example-full-width { width: 100%; } Example 2: stylin mat input //Standard .mat-form-field { .mat-input-element { color: slategray; } .mat-form-field-label { color: slategray; } .mat-form-field-underline { background-color: slategray; } .mat-form-field-ripple { background-color: slategray; } .mat-form-field-required-marker { color: slategray; } } //Focus .mat-form-field.mat-focused { .mat-form-field-label { color: #ff884d;

Coderbyte Sql Solutions Code Example

Example: coderbyte sql solutions In this MySQL challenge , your query should return all the people who report to either Jenny Richards or have a NULL value in ReportsTo . The rows should be ordered by Age . Your query should also add a column at the end with a title of Boss Title where the value is either None or CEO . Your output should look like the following table .

Alter Table Mysql Add Column After Code Example

Example 1: mysql alter table add column ALTER TABLE vendors ADD COLUMN phone VARCHAR ( 15 ) AFTER name ; Example 2: add column in mysq ALTER TABLE Table_name ADD Email varchar ( 255 ) ; Example 3: insert column after column mysql ALTER TABLE tbl_name ADD COLUMN new_column_name VARCHAR ( 15 ) AFTER existing_column_name ; Example 4: add column in mysq ALTER TABLE Table_name ADD name_column INT ( 255 ) ; Example 5: mysql alter table add column ALTER TABLE table ADD [ COLUMN ] column_name column_definition [ FIRST | AFTER existing_column ] ; Example 6: mysql alter table add column ALTER TABLE table ADD [ COLUMN ] column_name column_definition [ FIRST | AFTER existing_column ] ;

3w School Convert Number To String Code Example

Example 1: tostring js var num = 15; var n = num.toString(); /* now */ "15" Example 2: int to string javascript var number = 12; return numner.toString();

Bueno Ciao! Translation Code Example

Example: bella ciao lyrics E seppellire lassù in montagna O bella ciao , bella ciao , bella ciao , ciao , ciao E seppellire lassù in montagna Sotto l'ombra di un bel fior

@angular/material/index.d.ts' Is Not A Module

Answer : After upgrading to Angular 9 (released today), I ran into this issue as well and found that they made the breaking change mentioned in the answer. I can't find a reason for why they made this change. I have a material.module.ts file that I import / export all the material components (not the most efficient, but useful for quick development). I went through and updated all my imports to the individual material folders, although an index.ts barrel might be better. Again, not sure why they made this change, but I'm guessing it has to do with tree-shaking efficiencies. Including my material.module.ts below in case it helps anyone, it's inspired off other material modules I've found: NOTE : As other blog posts have mentioned and from my personal experience, be careful when using a shared module like below. I have 5~ different feature modules (lazy loaded) in my app that I imported my material module into. Out of curiosity, I stopped using the shared module and

Chrome Extension: Checking If Content Script Has Been Injected Or Not

Answer : is this safe enough to naively call chrome.tabs.executeScript every time the extension icon got clicked? In other words, is this idempotent? Yes, unless your content script modifies the page's DOM AND the extension is reloaded (either by reloading it via the settings page, via an update, etc.). In this scenario, your old content script will no longer run in the extension's context, so it cannot use extension APIs, nor communicate directly with your extension. is there a similar method for chrome.tabs.insertCSS ? No, there is no kind of inclusion guard for chrome.tabs.insertCSS . But inserting the same stylesheet again does not change the appearance of the page because all rules have the same CSS specificity, and the last stylesheet takes precedence in this case. But if the stylesheet is tightly coupled with your extension, then you can simply inject the script using executeScript, check whether it was injected for the first time, and if so, ins

Bootstrap Accordion With Arrows

Answer : Problem is in space between selectors: .panel-heading [data-toggle="collapse"]:after ^------- // remove this space to make this selector work Now you are selecting all elements having data-toggle attribute which are descendants of .panel-heading . It should be: .panel-heading[data-toggle="collapse"]:after .panel-heading { position: relative; } .panel-heading[data-toggle="collapse"]:after { font-family: 'Glyphicons Halflings'; content: "\e072"; /* "play" icon */ position: absolute; color: #b0c5d8; font-size: 18px; line-height: 22px; right: 20px; top: calc(50% - 10px); /* rotate "play" icon from > (right arrow) to down arrow */ -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg); -o-transform: rotate(-90deg); transform: rotate(-90deg); } .panel-heading[data-toggle="collapse"].c

What Is The Worst Case Time Complexity Of Merge Sort? * Code Example

Example: time complexity of merge sort O ( n * Log n ) : The time complexity of MergeSort is O ( n * Log n ) in all the 3 cases ( worst , average and best ) . As the mergesort always divides the array into two halves and takes linear time to merge two halves .

Array Typeof Javascript Code Example

Example 1: javascript typeof array Array . isArray ( arr ) Example 2: typeof array javascript //The method Array.isArray(A) checks if A is an array Array . isArray ( [ 1 , 2 , 3 ] ) ; // true Array . isArray ( 'foobar' ) ; // false for strings Array . isArray ( { foo : 123 } ) ; // false for objects Example 3: javascript typeof array Array . isArray ( obj )

Color Green Hex Code Example

Example 1: green hex code // Green Hex Code #00FF00 Example 2: color code green rgb(0,128,0) /*green*/ Hex #008000 Example 3: color green rgb(0,255,0) /*green*/ Hex #00FF00

11111 Binary To Decimal Code Example

Example 1: binary to decimal double binaryToDecimal ( char binary [ DIM ] ) { char binary2 [ DIM ] = "" , floa [ DIM ] = "" ; double decimal = 0 , negDec = 0 , flo = 0 ; int count = 0 , j = 0 , i = 0 , f = 0 , g = 0 , h = 0 , count1 = 0 , d = 0 , k = 0 ; while ( binary [ d ] != '\0' && binary [ d ] != '.' ) { d ++ ; } d -- ; if ( binary [ 0 ] == '-' ) { while ( binary [ k ] != '\0' ) { binary [ k ] = binary [ k + 1 ] ; k ++ ; } k = 0 ; while ( binary [ k ] == '0' ) { d -- ; k ++ ; } negDec = pot ( 2.000 , d * 1.000 , 1 ) ; } while ( binary [ i ] != '\0' && binary [ i ] != '.' ) { i ++ ; } i -- ; count = i ; h = i ; while ( binary [ h ] != '\0' ) { floa [ g ] = binary [ h + 2 ] ; g ++ ; h ++ ; } g -- ; count1 = g ; w