Tutorial by Examples: a

For example, say below is the sample data in an Excel 'Test', Purchase_Date Customer_Name Price 05-05-2017 Adam 1075 06-05-2017 Noah 1093 07-05-2017 Peter 1072 08-05-2017 Louis 1101 09-05-2017 Zoe 1248 10-05-2017 Kevin 1045 11-05-2017 Messiah 1...
SSIS tasks required. Data Flow Task: As the script component is only available in the data flow. Script Component: Inside this we will use variables and play with there values. Steps There are two methods to access variables inside of script component First Method - Using this.Variables ...
Simple Codec Here to illustrate the working principle we can use simple encryption and decryption as follows. public static String encrypt(String input) { // Simple encryption, not very strong! return Base64.encodeToString(input.getBytes(), Base64.DEFAULT); } public static String dec...
This is project directory. A service endpoint interface First we will create a service endpoint interface. The javax.jws.WebService @WebService annotation defines the class as a web service endpoint. import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBi...
The example below uses the input statement to read a value from a source (in this case the string 123) into a both a character destination and a numeric destination. data test; source = '123'; numeric_destination = input(source, best.); character_destination = input(source, $3.); run; ...
Magics whose name begins with just one % take as argument the rest of the line and are called line magics. Magics that begin with a double percent sign %% take a multi-line argument and are called cell magics. A commonly used magic is %timeit, a wrapper around the Python's timeit.timeit function, f...
Crontab contains cron jobs, each related to a specific task. Cron jobs are composed of two parts, the cron expression, and a shell command to be run: * * * * * command/to/run Each field in the above expression * * * * * is an option for setting the schedule frequency. It is composed of minute,...
We have a Student table with SubjectId. Here the requirement is to concatenate based on subjectId. All SQL Server versions create table #yourstudent (subjectid int, studentname varchar(10)) insert into #yourstudent (subjectid, studentname) values ( 1 ,'Mary' ) ,( 1 ,'John' ...
In case of SQL Server 2017 or vnext we can use in-built STRING_AGG for this aggregation. For same student table, create table #yourstudent (subjectid int, studentname varchar(10)) insert into #yourstudent (subjectid, studentname) values ( 1 ,'Mary' ) ,( 1 ,'John' ) ,( 1 ...
import scalaz._ import Scalaz._ scala> Apply[Option].apply2(some(1), some(2))((a, b) => a + b) res0: Option[Int] = Some(3) scala> val intToString: Int => String = _.toString scala> Apply[Option].ap(1.some)(some(intToString)) res1: Option[String] = Some(1) scala> Appl...
import scalaz._ import Scalaz._ scala> val len: String => Int = _.length len: String => Int = $$Lambda$1164/969820333@7e758f40 scala> Functor[Option].map(Some("foo"))(len) res0: Option[Int] = Some(3) scala> Functor[Option].map(None)(len) res1: Option[Int] = None ...
import scalaz._ import Scalaz._ scala> val plus1 = (_: Int) + 1 plus1: Int => Int = $$Lambda$1167/1113119649@6a6bfd97 scala> val plus2 = (_: Int) + 2 plus2: Int => Int = $$Lambda$1168/924329548@6bbe050f scala> val rev = (_: String).reverse rev: String => String = $$Lambd...
Unary operators act on the object upon which they are called and have high precedence. (See Remarks) When used postfix, the action occurs only after the entire operation is evaluated, leading to some interesting arithmetics: int a = 1; ++a; // result: 2 a--; // result: 1 i...
A common need for random numbers it to generate a number that is X% of some max value. this can be done by treating the result of NextDouble() as a percentage: var rnd = new Random(); var maxValue = 5000; var percentage = rnd.NextDouble(); var result = maxValue * percentage; //suppose NextDoub...
apcu_store can be used to store, apcu_fetch to retrieve values: $key = 'Hello'; $value = 'World'; apcu_store($key, $value); print(apcu_fetch('Hello')); // 'World'
apcu_cache_info provides information about the store and its entries: print_r(apcu_cache_info()); Note that invoking apcu_cache_info() without limit will return the complete data currently stored. To only get the meta data, use apcu_cache_info(true). To get information about certain cache ...
The APCUIterator allows to iterate over entries in the cache: foreach (new APCUIterator() as $entry) { print_r($entry); } The iterator can be initialized with an optional regular expression to select only entries with matching keys: foreach (new APCUIterator($regex) as $entry) { pr...
When creating a std::unique_lock, there are three different locking strategies to choose from: std::try_to_lock, std::defer_lock and std::adopt_lock std::try_to_lock allows for trying a lock without blocking: { std::atomic_int temp {0}; std::mutex _mutex; std::thread t( [&...
/** * Set a custom add to cart URL to redirect to * @return string */ function custom_add_to_cart_redirect() { return 'http://www.yourdomain.com/your-page/'; } add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' );
Compress-Archive -Path C:\Documents\* -CompressionLevel Optimal -DestinationPath C:\Archives\Documents.zip This command: Compresses all files in C:\Documents Uses Optimal compression Save the resulting archive in C:\Archives\Documents.zip -DestinationPath will add .zipif not present. -Li...

Page 1018 of 1099