Posts

Showing posts from April, 2014

Onlinegdb.com Cpp Code Example

Example: cpp online compiler Best Site With auto compile : https : //godbolt.org/z/nEo4j7

Concurrently Npm Run Typescript Code Example

Example 1: npm concurrently npm install -g concurrently Example 2: npm concurrently "start": "concurrently \"command1 arg\" \"command2 arg\""

Count Number Row Pandas Code Example

Example: get number of rows pandas number_of_rows = len(df)

Border Table Css Example

Example: table border css table, th, td { border: 1px solid black; }

Add Space In Math Mode Latex Code Example

Example 1: latex space in math mode \ ; - a thick space . \ : - a medium space . \ , - a thin space . \ ! - a negative thin space . Example 2: give space in latex Horizontal \hspace { 1 cm } spaces can be inserted manually . Useful to control the fine - tuning in the layout of pictures . Left Side \hfill Right Side

Absolute Value Matlab Code Example

Example: absolute value of a matix The absolute value sign in a matrix means the determinant (ad-bc)

Endline Html Code Example

Example 1: new line html <!-- Code by Scratchy --> <!-- Twitter : @S_cratchy--> Line 1 of text <br> Line 2 of text Example 2: how to make new line in html paragraph <p> Will Mateson<br /> Box 61 <br /> Cleveland , Ohio<br /> </p>

Not Last Child Css W3schools Code Example

Example 1: not last child css p :not ( :last-child ) { margin-bottom : 20 px } Example 2: selecting last child css p :last-child { font-size : 0.75 em ; }

Python Convert Binary To Image Code Example

Example 1: convert image to binary python img = cv2 . imread ( '<image path>' ) gray_img = cv2 . cvtColor ( img , cv2 . COLOR_BGR2GRAY ) Example 2: generate binay image python import numpy as np from numpy import random # Generating an image of values between 1 and 255. im_thresh = random . randint ( 1 , 256 , ( 64 , 64 ) ) # Set anything less than 255 to 0. Unnecessary if cv2 does this during threshold . # Must go before the operation below in order not to set all values to 0. im_thresh [ im_thresh < 255 ] = 0 # Set all values at indices where the array equals 255 to 1. im_thresh [ im_thresh == 255 ] = 1

Angular V8 - @ViewChild Static True Or False

Answer : Use { static: true } when you want to access the ViewChild in ngOnInit . Use { static: false } will be accessible only in ngAfterViewInit . This is also what you want to do for when you have a structural directive ( *ngIf etc.) in your template. In most cases { static: false } will work. import { Component, OnInit, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; @Component({ selector: 'example', templateUrl: './example.component.html', styleUrls: ['./example.component.scss'] }) export class ExampleComponent implements OnInit, AfterViewInit { @ViewChild('elementA', { static: true }) elementStatic: ElementRef<HTMLElement>; @ViewChild('elementB', { static: false }) elementDynamic: ElementRef<HTMLElement>; public ngOnInit(): void { this.elementStatic.nativeElement; // Ok this.elementDynamic.nativeElement; // ERROR TypeError: Cannot read property 'nativeElement&

Can Gulp Overwrite All Src Files?

Answer : I can think of two solutions: Add an option for base to your gulp.src like so: gulp.src([...files...], {base: './'}).pipe(...)... This will tell gulp to preserve the entire relative path. Then pass './' into gulp.dest() to overwrite the original files. (Note: this is untested, you should make sure you have a backup in case it doesn't work.) Use functions. Gulp's just JavaScript, so you can do this: [...files...].forEach(function(file) { var path = require('path'); gulp.src(file).pipe(rename(...)).pipe(gulp.dest(path.dirname(file))); } If you need to run these asynchronously, the first will be much easier, as you'll need to use something like event-stream.merge and map the streams into an array. It would look like var es = require('event-stream'); ... var streams = [...files...].map(function(file) { // the same function from above, with a return return gulp.src(file) ... }; return

Alter Table Drop Column Oracle Code Example

Example 1: delete column from table oracle PL SQL ALTER TABLE table_name DROP COLUMN column_name; Example 2: oracle drop column ALTER TABLE my_table DROP COLUMN my_col; -- To check if column exists before renaming it: DECLARE l_cnt INTEGER; BEGIN SELECT count(*) INTO l_cnt FROM dba_tab_columns -- or all_tab_columns (depending on grants) WHERE owner = 'my_schema' AND table_name = 'my_table' AND column_name = 'my_col'; IF (l_cnt = 1) THEN EXECUTE IMMEDIATE 'ALTER TABLE my_schema.my_table DROP COLUMN my_col'; END IF; END; Example 3: oracle alter table delete column alter table table_name drop column column_name; alter table table_name drop (column_name1, column_name2);

Height: 100vh Means In Css Code Example

Example: what is 100vh in css height : 100 vh = 100 % of the viewport height.