Tutorial by Examples: ast

To illustrate how to use regr_slope(Y,X), I applied it to a real world problem. In Java, if you don't clean up memory properly, the garbage can get stuck and fill up the memory. You dump statistics every hour about memory utilization of different classes and load it into a postgres database for anal...
public async Task SetProductInactiveAsync(int productId) { using (IDbConnection con = new SqlConnection("myConnectionString")) { await con.ExecuteAsync("SetProductInactive", new { id = productId }, commandType: CommandType.StoredProcedure); ...
The module "struct" provides facility to pack python objects as contiguous chunk of bytes or dissemble a chunk of bytes to python structures. The pack function takes a format string and one or more arguments, and returns a binary string. This looks very much like you are formatting a stri...
If you don't want to extend Application and keep your toast messages thread safe, make sure you show them in the post execute section of your AsyncTasks. public class MyAsyncTask extends AsyncTask <Void, Void, Void> { @Override protected Void doInBackground(Void... params) { ...
import React, { Component } from 'react'; import { View, Text, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ red: { color: 'red' }, big: { fontSize: 30 } }); class Example extends Component { render() { return ( ...
Use dynamic_cast<>() as a function, which helps you to cast down through an inheritance hierarchy (main description). If you must do some non-polymorphic work on some derived classes B and C, but received the base class A, then write like this: class A { public: virtual ~A(){} }; class B...
A broadcast join copies the small data to the worker nodes which leads to a highly efficient and super-fast join. When we are joining two datasets and one of the datasets is much smaller than the other (e.g when the small dataset can fit into memory), then we should use a Broadcast Hash Join. The f...
If you have a stored DATE or DATETIME (in a column somewhere) it was stored with respect to some time zone, but in MySQL the time zone is not stored with the value. So, if you want to convert it to another time zone, you can, but you must know the original time zone. Using CONVERT_TZ() does the con...
data table; set table; label variable1 = 'label1' variable2 = 'label2' variable3 = 'label3'; run;
The implementation of ICloneable for a struct is not generally needed because structs do a memberwise copy with the assignment operator =. But the design might require the implementation of another interface that inherits from ICloneable. Another reason would be if the struct contains a reference t...
Use the quotestar register to copy/paste between Vim and system clipboard "*yy copies the current line into the system clipboard "*p pastes the content of the system clipboard into Vim
Open a raster that covers the globe and extract a subset of the raster. import gdal # Path to a tiff file covering the globe # http://visibleearth.nasa.gov/view.php?id=57752 tif_name = "/path_name/land_shallow_topo_21600.tif" # Open raster in read only mode ds = gdal.Open(tif_n...
In [1]: df = pd.DataFrame({'A': [1, 2, 3], 'B': [1.0, 2.0, 3.0], 'C': ['a', 'b', 'c'], 'D': [True, False, True]}) In [2]: df Out[2]: A B C D 0 1 1.0 a True 1 2 2.0 b False 2 3 3.0 c True Getting a python list from a series: In [3]: df['...
SampleViewModel.vb 'Import classes related to WPF for simplicity Imports System.Collections.ObjectModel Imports System.ComponentModel Public Class SampleViewModel Inherits DependencyObject 'A class acting as a ViewModel must inherit from DependencyObject 'A simple string p...
A data structure is a way of organizing and storing information. Let a "Hello, World!" string be the information that we need to organize and store in byte-addressable memory. Each ASCII character requires 7 bits of storage. Most systems reserve 8 bits (1 byte) for each character, so eac...
This is a sample Fastfile setup for a multi-flavor app. It gives you an option to build and deploy all flavors or a single flavor. After the deployment, it reports to Slack the status of the deployment, and sends a notification to testers in Beta by Crashlytics testers group. To build and deploy al...
//set the total value of cells in range A1 - A25 into A27 worksheet.Cells["A27"].Formula = "=SUM(A1:A25)"; //set the number of cells with content in range C1 - C25 into C27 worksheet.Cells["C27"].Formula = "=COUNT(C1:C25)"; //fill column K with the s...
Add this lane to your Fastfile and run fastlane installAll type:{BUILD_TYPE} in command line. Replace BUILD_TYPE with the build type you want to build. For example: fastlane installAll type:Debug This command will build all flavors of given type and install it to your device. Currently, it doesn't...
A std::tuple<T...> can be used to pass multiple values around. For example, it could be used to store a sequence of parameters into some form of a queue. When processing such a tuple its elements need to be turned into function call arguments: #include <array> #include <iostream>...
The following example shows how to apply custom fonts to a Navigation Bar and includes fixes for some quirky behaviors found in Xcode. One also may apply the custom fonts to any other UIControls such as UILabels, UIButtons, and more by using the attributes inspector after the custom font is added to...

Page 23 of 26