Posts

Showing posts from August, 2012

Add To Queue Java Code Example

Example: java queue import java . util . * ; Queue < Integer > queue = new LinkedList < Integer > ( ) ; // use non-primative types when constructing // to add a value to the back of queue: queue . add ( 7 ) ; // to remove and return front value: int next = queue . remove ( ) ; // to just return front value without removing: int peek = queue . peek ( ) ;

Angular Material 10 Mat Icons Not Showing Code Example

Example 1: properly import mat icon angular 10 // In Angular in style.css @import 'https://fonts.googleapis.com/icon?family=Material+Icons'; Example 2: mat icon not working @import url("https://fonts.googleapis.com/icon?family=Material+Icons");

7400 Series CMOS Vs 4000 Series Logic IC

Answer : The difference depends on your system definition. On the one hand, 74HC operates over a limited voltage range, with 6 volts specified as the maximum supply voltage. The CD4000 series, on the other hand, is rated to a maximum of 18 volts, so it may well be easier to use the CD4000 series in a battery-operated system. If the limited voltage range of the 74HC line is not a problem, the line is much faster. For instance, comparing the CD4011/74HC00 (Quad 2-input NAND gates) gives propagation delays at 5 volts of 90 nsec (typ) vs 7 nsec. For the CD4063 vs the 74HC85 (4-bit magnitude comparator) the numbers are 625 nsec (typ) vs. 63 nsec. The CD40192 4-bit up/down counter has a typical count frequency of 4 MHz, while the 74HC192 goes at 36 MHz. It's worth keeping in mind that both lines run faster at higher Vdd, so a CD4000 at 15 volts will do better than the numbers here, but the order of magnitude difference is not erased. And yes, the 74HC series is designed to rough

Add Badge Bootstrap To Every Odd Number Code Example

Example 1: bootstrap Badges Contextual variations Add any of the below mentioned modifier classes to change the appearance of a badge. <span class= "badge badge-primary" >Primary</span> <span class= "badge badge-secondary" >Secondary</span> <span class= "badge badge-success" >Success</span> <span class= "badge badge-danger" >Danger</span> <span class= "badge badge-warning" >Warning</span> <span class= "badge badge-info" >Info</span> <span class= "badge badge-light" >Light</span> <span class= "badge badge-dark" >Dark</span> Example 2: bootstrap badges Links Using the contextual .badge-* classes on an <a> element quickly provide actionable badges with hover and focus states. <a href= "#" class= "badge badge-primary" >Primary</a> <a href= "#" class= "

Make The Font Bold In Html Css Code Example

Example: css text bold font-weight : bold ;

-56f To C Code Example

Example: convert fahrenheit to celsius import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int far = sc . nextInt ( ) ; int cel = ( far - 32 ) * 5 / 9 ; System . out . printf ( "%d Fahrenheit is %d Celsius" , far , cel ) ; } }

Btrfs Snapshot To Non-btrfs Disk. Encryption, Read Acess

Answer : I will just add to Gilles' answer by saying that although you may use “ cp , rsync , etc.” to transfer your read-only subvolumes / snapshots, you may also send and store the subvolumes as btrfs streams using the btrfs send command. The btrfs Wiki mentions the following use: # btrfs subvolume snapshot -r / /my/snapshot-YYYY-MM-DD && sync # btrfs send /my/snapshot-YYYY-MM-DD | ssh user@host btrfs receive /my/backups # btrfs subvolume snapshot -r / /my/incremental-snapshot-YYYY-MM-DD && sync # btrfs send -p /my/snapshot-YYYY-MM-DD /my/incremental-snapshot-YYYY-MM-DD | ssh user@host btrfs receive /backup/home but you may also just save the streams for future use: # btrfs subvolume snapshot -r / /my/snapshot-YYYY-MM-DD && sync # btrfs send /my/snapshot-YYYY-MM-DD | ssh user@host 'cat >/backup/home/snapshot-YYYY-MM-DD.btrfs' # btrfs subvolume snapshot -r / /my/incremental-snapshot-YYYY-MM-DD && sync # btrfs send -p /my

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 }

Create Html Element With Jquery Vs Document.createelement Code Example

Example: code for adding new elements in javascriipt js < html > < head > < title > t1 < / title > < script type = "text/javascript" > function addNode ( ) { var newP = document . createElement ( "p" ) ; var textNode = document . createTextNode ( " This is a new text node" ) ; newP . appendChild ( textNode ) ; document . getElementById ( "firstP" ) . appendChild ( newP ) ; } < / script > < / head > < body > < p id = "firstP" > firstP < p > < / body > < / html >

Count The Number Of Words In A PDF File

Answer : Quick Answer: pdftotext myfile.pdf - | wc -w Long Answer: If on Unix, you can use pdftotext : http://linux.about.com/od/commands/l/blcmdl1_pdftote.htm and then do the word count in the generated file. If on Unix, you can use: wc -w converted-pdf.txt to get the word count. Also, see the comment by frabjous - basically, you can do it in one step by piping to stdout instead to a temporary file: pdftotext myfile.pdf - | wc -w This is a hard task not not easy to solve. If you really want an exact result, copy paragraph by paragraph for your PDF viewer into a text file and check it with the wc -w tool. The reason why not to use pdftotext in that case is: mathematical formulas may get also into the output and regarded as "words". (Alternatively you could edit the output you get from pdftotext ). Another reason why this may fail are the headings: "4.3.2 Foo Bar" is counted as three words. A way around is only to count words starting with a char out of [A-Za-

Convert Pdf To Jpg Windows 10 Code Example

Example: pdf to jpg Best converter: https://www.online-convert.com/

Cp Algorithms Rabin Karp Code Example

Example: rabin karp cp algorithm vector < int > rabin_karp ( string const & s , string const & t ) { const int p = 31 ; const int m = 1e9 + 9 ; int S = s . size ( ) , T = t . size ( ) ; vector < long long > p_pow ( max ( S , T ) ) ; p_pow [ 0 ] = 1 ; for ( int i = 1 ; i < ( int ) p_pow . size ( ) ; i ++ ) p_pow [ i ] = ( p_pow [ i - 1 ] * p ) % m ; vector < long long > h ( T + 1 , 0 ) ; for ( int i = 0 ; i < T ; i ++ ) h [ i + 1 ] = ( h [ i ] + ( t [ i ] - 'a' + 1 ) * p_pow [ i ] ) % m ; long long h_s = 0 ; for ( int i = 0 ; i < S ; i ++ ) h_s = ( h_s + ( s [ i ] - 'a' + 1 ) * p_pow [ i ] ) % m ; vector < int > occurences ; for ( int i = 0 ; i + S - 1 < T ; i ++ ) { long long cur_h = ( h [ i + S ] + m - h [ i ] ) % m ; if ( cur_h ==

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

CSS Selector (id Contains Part Of Text)

Answer : Try this: a[id*='Some:Same'][id$='name'] This will get you all a elements with id containing Some:Same and have the id ending in name <div id='element_123_wrapper_text'>My sample DIV</div> The Operator ^ - Match elements that starts with given value div[id^="element_123"] { } The Operator $ - Match elements that ends with given value div[id$="wrapper_text"] { } The Operator * - Match elements that have an attribute containing a given value div[id*="wrapper_text"] { } The only selector I see is a[id$="name"] (all links with id finishing by "name") but it's not as restrictive as it should.

Bootstrap Range Slider Min Max Code Example

Example 1: price range slider bootstrap 4 < input type = "range" name = "range" step = "50000" min = "100000" max = "1000000" value = "" onchange = "rangePrimary.value=value" > < input type = "text" id = "rangePrimary" / > Example 2: bootstrap 3 min max price range slider < ! doctype html > < html lang = "en" > < head > < meta charset = "utf-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1" > < title > jQuery UI Slider - Range slider < / title > < link rel = "stylesheet" href = "//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" > < link rel = "stylesheet" href = "/resources/demos/style.css" > < script src = "https://code.jquery.com/jquery-1.12.4.js" > < / script

Android: R.java: Error Expected

Answer : It sounds like you have accidentally defined a menu item in your XML with an id of =action_setting . For example: <menu> <item android:id="@+id/=action_settings" /> </menu> Remove the = from your menu XML and you should be good to go. I had the same problem, because I defined a string without name in my resources. like: <string name="">some text</string>

Convert.tostring Python Code Example

Example 1: how to make an int into a string python int x = 10 string p = str ( x ) Example 2: how to convert to string in python str ( integer_value )

Cmath Pow Code Example

Example: pow c++ # include <iostream> # include <cmath> using namespace std ; int main ( ) { double base , exponent , result ; base = 3.4 ; exponent = 4.4 ; result = pow ( base , exponent ) ; cout << base << "^" << exponent << " = " << result ; return 0 ; }