Tutorial by Examples

Extract all file contents of a zip file import zipfile with zipfile.ZipFile('zipfile.zip','r') as zfile: zfile.extractall('path') If you want extract single files use extract method, it takes name list and path as input parameter import zipfile f=open('zipfile.zip','rb') zfile=zipfile.Z...
The wxWidgets project has adopted the release model used by the Linux Kernel project where there are alternating sets of releases where one set are considered "stable" and the next set are considered "development." For wxWidgets "stable" and "development" do n...
If you are using UIViewControllerContainment there are a few other methods that are worth looking at. When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen in Swift class RootViewController: UIViewController { ...
Install serverless globally npm install serverless -g Create an AWS Lamdba function in Node.js serverless create --template aws-nodejs Example of a handler.js 'use strict'; // Your first function handler module.exports.hello = (event, context, cb) => cb(null, { message: 'Go Server...
This topic demonstrates how to use functions like withColumn, lead, lag, Level etc using Spark. Spark dataframe is an sql abstract layer on spark core functionalities. This enable user to write SQL on distributed data. Spark SQL supports hetrogenous file formats including JSON, XML, CSV , TSV etc. ...
Prerequisites: Apple Developers Account Setup GameCenter Leaderboards with iTunesConnect Setting up GameCenter Leaderboards: Sign in to iTunesConnect Go to My Apps. Create an app for your project then go to Features. Click on Game Center Click the plus sign next to Leaderboards. Choose...
This class holds predicate filters values. public class QueryFilter { public string PropertyName { get; set; } public string Value { get; set; } public Operator Operator { get; set; } // In the query {a => a.Name.Equals("Pedro")} // Property name to filter ...
public static Expression<Func<T, bool>> GetExpression<T>(IList<QueryFilter> filters) { Expression exp = null; // Represents a named parameter expression. {parm => parm.Name.Equals()}, it is the param part // To create a ParameterExpression need the ty...
For one filter: Here is where the query is created, it receives a expression parameter and a filter. private static Expression GetExpression<T>(ParameterExpression param, QueryFilter queryFilter) { // Represents accessing a field or property, so here we are accessing for example: ...
ConstantExpression must be the same type of the MemberExpression. The value in this example is a string, which is converted before creating the ConstantExpression instance. private static ConstantExpression GetConstant(Type type, string value) { // Discover the type, convert it, and create Co...
Collection filters = new List(); QueryFilter filter = new QueryFilter("Name", "Burger", Operator.StartsWith); filters.Add(filter); Expression<Func<Food, bool>> query = ExpressionBuilder.GetExpression<Food>(filters); In this case, it is a query against the...
In this very first example, a basic serial write operation is started from an Arduino device. void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.println("Hello World!"); dela...
/** *@NApiVersion 2.x *@NScriptType Suitelet */ define([],function() { // NetSuite's AMD pattern function onRequest_entry(context) { // Suitelet entry function receives a context obj context.response.write('Hello World'); // Write a response using the context obj } retu...
.after(delay, callback=None) is a method defined for all tkinter widgets. This method simply calls the function callback after the given delay in ms. If no function is given, it acts similar to time.sleep (but in milliseconds instead of seconds) Here is an example of how to create a simple timer us...
If you want to append a series of values [1,2] to the column of dataframe df, you will get NaNs: import pandas as pd series=pd.Series([1,2]) df=pd.DataFrame(index=[3,4]) df['col']=series df col 3 NaN 4 NaN because setting a new column automatically aligns the data by the inde...
The latest JVMs supports Garbage First GC ( G1 GC) and consists of set of regions which accumulate to make young and old generation. The JVM will have approximately 2048 reagions and set heap region size accordingly from 1 MB to 32 MB and power of 2 bounds. This is important parameter which decide ...
COMPUTE answer = 3*var-1 That is a reference to the variable var-1, and not var - 1. COMPUTE answer = 3 * var - 1 Recommended, opinion.
Luminus is a Clojure micro-framework based on a set of lightweight libraries. It aims to provide a robust, scalable, and easy to use platform. With Luminus you can focus on developing your app the way you want without any distractions. It also has very good documentation that covers some of the majo...
The simplest composite type is an immutable type. Instances of immutable types, like tuples, are values. Their fields cannot be changed after they are created. In many ways, an immutable type is like a Tuple with names for the type itself and for each field. Singleton types Composite types, by def...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...

Page 915 of 1336