Tutorial by Examples: sin

In Insert mode, press <C-r> and then % to insert the filename. This technique is applicable to all registers. For e.g. if in insert mode, you want to paste the current search pattern, you can type <C-r> and then /.
To Copy Data from a CSV file to a table COPY <tablename> FROM '<filename with path>'; To insert into table user from a file named user_data.csv placed inside /home/user/: COPY user FROM '/home/user/user_data.csv'; To Copy data from pipe separated file to table COPY user FROM '/h...
To Copy table to standard o/p COPY <tablename> TO STDOUT (DELIMITER '|'); To export table user to Standard ouput: COPY user TO STDOUT (DELIMITER '|'); To Copy table to file COPY user FROM '/home/user/user_data' WITH DELIMITER '|'; To Copy the output of SQL statement to file COPY (sql st...
Data can be exported using copy command or by taking use of command line options of psql command. To Export csv data from table user to csv file: psql -p \<port> -U \<username> -d \<database> -A -F<delimiter> -c\<sql to execute> \> \<output filename with path&gt...
You can use using in order to set an alias for a namespace or type. More detail can be found in here. Syntax: using <identifier> = <namespace-or-type-name>; Example: using NewType = Dictionary<string, Dictionary<string,int>>; NewType multiDictionary = new NewType(); /...
Basically, the Scan object retrieves all the rows from the table, but what if you want to retrieve only the rows where the value of a given column is equal to something ? Let me introduce you the Filters, they work like the WHERE in SQL. Before starting using the filters, if you know how your row_k...
The available commands will be displayed, including a brief description, in tabular format. In Windows 10 the following commands are listed: CommandDescriptionASSOCDisplays or modifies file extension associations.ATTRIBDisplays or changes file attributes.BREAKSets or clears extended CTRL+C checkin...
root: build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle-experimental:0.8.0-alpha4' } } allprojects { repositories { jcenter() } } app: build.gradle apply plugin: 'com.andro...
<?php $ch = curl_init(); //curl handler init curl_setopt($ch,CURLOPT_URL,"http://www.google.com/search?q=curl"); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);// set optional params curl_setopt($ch,CURLOPT_HEADER, false); $result=curl_exec($ch); ...
myDebt := 9000 index := RegExMatch("You owe me $42", "\$(\d+)", dollars) if(index > 0) { ; indices are usually 1-based in AHK myDebt += dollars1 MsgBox, Current debt: %myDebt% } Result: Current debt: 9042
Due to the way the Tcl language parser works, braces in the code must be properly matched. This includes the braces in comments. proc hw {} { # this { code will fail puts {hello world} } A missing close-brace: possible unbalanced brace in comment error will be thrown. proc hw {} { ...
You can use the following code for going back and forward. if (!function_exists('codepoint_encode')) { function codepoint_encode($str) { return substr(json_encode($str), 1, -1); } } if (!function_exists('codepoint_decode')) { function codepoint_decode($str) { re...
You can use the following code for going back and forward. if (!function_exists('mb_internal_encoding')) { function mb_internal_encoding($encoding = NULL) { return ($from_encoding === NULL) ? iconv_get_encoding() : iconv_set_encoding($encoding); } } if (!function_exists('mb_c...
Optimizing by using the right data structures at the right time can change the time-complexity of the code. // This variant of stableUnique contains a complexity of N log(N) // N > number of elements in v // log(N) > insert complexity of std::set std::vector<std::string> stableUnique...
When storing JSON documents in SQL Server, We need to be able to efficiently filter and sort query results on properties of the JSON documents. CREATE TABLE JsonTable ( id int identity primary key, jsonInfo nvarchar(max), CONSTRAINT [Content should be formatted as JSON] CHECK...
Use a mutex to synchronise access to a variable which is accessed from multiple threads: counter = 0 counter_mutex = Mutex.new # Start three parallel threads and increment counter 3.times.map do |index| Thread.new do counter_mutex.synchronize { counter += 1 } end end.each(&:joi...
Single slots are used when a child component only defines one slot within its template. The page component above uses a single slot to distribute content. An example of the page component's template using a single slot is below: <html> <head> <title>Page Title</t...
Named slots work similarly to single slots but instead allow you to distribute content to different regions within your child component template. Take the page component from the previous example but modify it's template so it is as follows: <html> <head> <title>Pag...
Given these two CSV files: $ cat file1 1,line1 2,line2 3,line3 4,line4 $ cat file2 1,line3 2,line4 3,line5 4,line6 To print those lines in file2 whose second column occurs also in the first file we can say: $ awk -F, 'FNR==NR {lines[$2]; next} $2 in lines' file1 file2 1,line3 2,line4...
If your routes file is overwhelmingly big, you can put your routes in multiple files and include each of the files with Ruby’s require_relative method: config/routes.rb: YourAppName::Application.routes.draw do require_relative 'routes/admin_routes' require_relative 'routes/sidekiq_routes' ...

Page 72 of 161