Posts

Showing posts from February, 2016

Array Length In Arduino Code Example

Example: length arduino String myString = "text"; //make a stirng int stringLength = myString.length(); //get length from string

Bash Check If String Is Empty Code Example

Example 1: bash if null or empty if [ -z "$variable" ]; then echo "$variable is null"; else echo "$variable is not null"; fi Example 2: bash check if variable is empty if [ -z "$var" ] #return true if $var is unset Example 3: bash script check empty string if [ -z "$var" ] then echo "\$var is empty" else echo "\$var is NOT empty" fi

Best Pubg Mobile Sensitivity Setting Code Example

Example: best pubg gyro sensitivity TPP with no scope: 95-100% FPP with no scope: 95-100% Red Dot, Holographic, Aim Assist: 90-95% 2x Scope: 120-125% 3x Scope: 60-65% 4x Scope, VSS: 50-55% 6x Scope: 40-45% 8x Scope: 30-35%

Bootstrap Class Name For Text Align Center Code Example

Example 1: centre text bootstrap < div class = " text-center " > < p > hello world </ p > </ div > Example 2: text align center bootstrap < p class = " text-left " > Left aligned text on all viewport sizes. </ p > < p class = " text-center " > Center aligned text on all viewport sizes. </ p > < p class = " text-right " > Right aligned text on all viewport sizes. </ p > < p class = " text-sm-left " > Left aligned text on viewports sized SM (small) or wider. </ p > < p class = " text-md-left " > Left aligned text on viewports sized MD (medium) or wider. </ p > < p class = " text-lg-left " > Left aligned text on viewports sized LG (large) or wider. </ p > < p class = " text-xl-left " > Left aligned text on viewports sized XL (extra-large) or wider. </ p >

`1234567890-=qwertyuioooooooooooooooooooop[]asdfghjkl;'#\zxcvbnm,./QWERTYUIOPASDFGHJKLZXCVBNM|?:@~}{+_)(*&^%$£"!1234567890 Code Example

Example 1: `1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>? You definitely indeed have a QWERTY keyboard. Example 2: `1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./ quit this tab/google search! go watch YOUTUBE! I feel so sorry for your boredom curse!

Youtube Playlist Downloader Mp3 Code Example

Example: youtube dl download playlist mp3 youtube - dl -- extract - audio -- audio - format mp3 - o "%(title)s.%(ext)s" < url to playlist >

C Printf Float Value Code Example

Example 1: format specifier fro float in printf printf ( "%0k.yf" float_variable_name ) Here k is the total number of characters you want to get printed . k = x + 1 + y ( + 1 for the dot ) and float_variable_name is the float variable that you want to get printed . Suppose you want to print x digits before the decimal point and y digits after it . Now , if the number of digits before float_variable_name is less than x , then it will automatically prepend that many zeroes before it . Example 2: printf c float printf ( "%.6f" , myFloat ) ; Example 3: c printf float value I want to print a float value which has 2 integer digits and 6 decimal digits after the comma . If I just use printf ( "%f" , myFloat ) I'm getting a truncated value . I don 't know if this always happens in C, or it' s just because I'm using C for microcontrollers ( CCS to be exact ) , but at the reference it tells that % f get just th

Bootstrap Colors: Map Example

Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too. Colors Colorize text with color utilities. If you want to colorize links, you can use the .link-* helper classes which have :hover and :focus states. < p class = " text-primary " > .text-primary </ p > < p class = " text-secondary " > .text-secondary </ p > < p class = " text-success " > .text-success </ p > < p class = " text-danger " > .text-danger </ p > < p class = " text-warning bg-dark " > .text-warning </ p > < p class = " text-info bg-dark " > .text-info </ p > < p class = " text-light bg-dark " > .text-light </ p > < p class = " text-dark " > .text-dark </ p > < p class = " text-body " > .text-body </ p > < p class = &

Bash If Elif Code Example

Example 1: else if statement bash syntax #!/bin/bash read -p "Enter your marks: " marks if [ $marks -ge 80 ] then echo "Very Good" elif [ $marks -ge 50 ] then echo "Good" elif [ $marks -ge 33 ] then echo "Just Satisfactory" else echo "Not OK" fi Example 2: if and if bash if [ "${STATUS}" != 200 ] && [ "${STRING}" != "${VALUE}" ]; then Example 3: bash else if if [ "$animal" == "penguin" ]; then echo "Hmmmmmm fish... Tux happy!" elif [ "$animal" == "dolphin" ]; then echo "Pweetpeettreetppeterdepweet!" else echo "*prrrrrrrt*" fi if TEST-COMMANDS; then CONSEQUENT-COMMANDS; elif MORE-TEST-COMMANDS; then MORE-CONSEQUENT-COMMANDS; else ALTERNATE-CONSEQUENT-COMMANDS; fi Example 4: bash if else if if [[ TEST-COMMAND ]] then STATEMENTS1 else STATEMENTS2 fi Example 5: if elif bqsh if [ &qu

200 PORT Command Successful. Consider Using PASV. 425 Failed To Establish Connection

Answer : Try using the passive command before using ls . From FTP client, to check if the FTP server supports passive mode, after login, type quote PASV . Following are connection examples to a vsftpd server with passive mode on and off vsftpd with pasv_enable=NO : # ftp localhost Connected to localhost.localdomain. 220 (vsFTPd 2.3.5) Name (localhost:john): anonymous 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> quote PASV 550 Permission denied. ftp> vsftpd with pasv_enable=YES : # ftp localhost Connected to localhost.localdomain. 220 (vsFTPd 2.3.5) Name (localhost:john): anonymous 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> quote PASV 227 Entering Passive Mode (127,0,0,1,173,104). ftp> You are using the FTP in an active mode. Setting up the FTP in the active mode can be cum

Queues And Stacks Hackerrank Solution In Java Code Example

Example: queue using two stacks hackerrank solution # include <stack> # include <iostream> using namespace std ; int main ( ) { stack < int > Front , Rear ; int Q ; cin >> Q ; while ( Q -- ) { int type , x ; cin >> type ; if ( type == 1 ) { cin >> x ; Rear . push ( x ) ; } else { if ( Front . empty ( ) ) { // move all the elements from "Rear" stack to "Front" stack while ( ! Rear . empty ( ) ) { Front . push ( Rear . top ( ) ) ; Rear . pop ( ) ; } } if ( ! Front . empty ( ) ) { if ( type == 2 ) Front . pop ( ) ; if ( type == 3 ) cout << Front . top ( ) << endl ; } }

Add Item Object Collection Laravel Code Example

Example: add to collection laravel $item = collect ( ) ; $item - > push ( $product ) ;

Arduino Serial Write Example

Example: arduino serial write /* Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Syntax Serial.write(val) Serial.write(str) Serial.write(buf, len) Parameters Serial: serial port object. val: a value to send as a single byte. str: a string to send as a series of bytes. buf: an array to send as a series of bytes. len: the number of bytes to be sent from the array. */

Font Size Latex Code Example

Example 1: latex text size \Huge \huge \LARGE \Large \large \normalsize \small \footnotesize \scriptsize \tiny Example 2: latex font sizes \Huge \huge \LARGE \Large \large \ normalsize ( default ) \small \footnotesize \scriptsize \tiny Example 3: latex font sizes Change global font size : \documentclass [ 12 pt ] { report } Example 4: latex default font size \documentclass [ 12 pt ] { book } Example 5: latex change size of text % Article \documentclass [ 9 pt ] { extarticle } % Report \documentclass [ 14 pt ] { extreport } Example 6: font size table latex \documentclass { article } \usepackage { graphicx } \begin { document } \begin { table } \resizebox { \textwidth } { ! } { % \begin { tabular } { cc } Knuth & Lamport \end { tabular } } \end { table } \end { document }

Angular Unit Test Error: No Component Factory Found For Component. Did You Add It To @NgModule.entryComponents

Answer : Testing is doubting. More seriously, let me answer you. In Angular, your components are handled by a module. When you use Material dialogs and snackers, you actually use a feature of the CDK, which is called Portal . This allow you to create your components dynamically. But when you do so, you have to add them to the entryComponents of your module. You did it in your module, so you should also do it in your tests. The syntax is TestBed .configureTestingModule(...) .overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [YourComponent] } }); there are two places at which this is supposed to be done....entry components and also at declarations(while configuring your testing module).... TestBed .configureTestingModule({ declarations: [YourComponent], }) .overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [YourComponent] } }); If someone struggling to find BrowserDynamicTestingModule just use BrowserModule

Online Youtube To Mp3 Y2mate Code Example

Example: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3