Tutorial by Examples: ad

You can also add same custom created taxonomy into post type page using below code. function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'genre', 'page' ); } add_action( 'init', 'add_taxonomies_to_pages' ); Add above code into your theme's functions.php file. Same way...
#include <stdio.h> #include <pthread.h> void *thread_func(void *arg) { printf("I am thread #%d\n", *(int *)arg); return NULL; } int main(int argc, char *argv[]) { pthread_t t1, t2; int i = 1; int j = 2; /* Create 2 threads t1 and t2 wit...
/** * Apply a radial mask (vignette, i.e. fading to black at the borders) to a bitmap * @param imageToApplyMaskTo Bitmap to modify */ public static void radialMask(final Bitmap imageToApplyMaskTo) { Canvas canvas = new Canvas(imageToApplyMaskTo); final float centerX = imageToApply...
To specify Contact and Address info for an Employee, you should always invoke Select() method on the Contact and Address data views prior to assigning any field values. It is also recommended to assign the result of Select() method to the Contact and Address data views' Current property to guarantee...
When you need to override Bill-To Contact and Bill-To Address info for a Customer, the very first step is to set correct values for the IsBillContSameAsMain and IsBillSameAsMain properties of the Customer DAC. Don't forget to invoke Update() method on the Customer cache right after you updated IsBil...
To specify Bill-To Contact and Bill-To Address info for a Sales Order, you should always first invoke Select() method on the Billing_Contact and Billing_Address data views prior to assigning any field values. It is also recommended to assign the result of Select() method to the Billing_Contact and B...
kern_thread.c #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/kthread.h> #include <linux/sched.h> #define AUTHOR "Nachiket Kulkarni" #define DESCRIPTION "Simple module that demonstrates creati...
A simple OGL 4.0 GLSL shader program that shows the use of geometry shaders. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. In this example, the entire geometry (a cylinder) is generated in the geometry shader. Vertex shader geo.vert #vers...
A simple OGL 4.0 GLSL shader program that shows that shows how to add details with tessellation shader to the geometry. The program is executed with a python script. To run the script, PyOpenGL and NumPy must be installed. The basic mesh in this example is an icosahedron that consists of 20 triang...
Spread dot operator can be used instead of collect method (1..10)*.multiply(2) // equivalent to (1..10).collect{ it *2 } d = ["hello", "world"] d*.size() // d.collect{ it.size() }
app.store.ts import {InjectionToken} from '@angular/core'; import {createStore, Store, compose, StoreEnhancer} from 'redux'; import {AppState, default as reducer} from "../app.reducer"; export const AppStore = new InjectionToken('App.store'); const devtools: ...
Set the token on <head> of your default.blade.php. <meta name="csrf-token" content="{{csrf_token()}}"> Add ajaxSetup on the top of your script, that will be accessible to everywhere. This will set headers on each ajax call $.ajaxSetup({ headers: { '...
I get the file path from document directory and read that file in chunks of 1024 and save (append) to NSMutableData object or you can directly write to socket. // MARK: - Get file data as chunks Methode. func getFileDataInChunks() { let doumentDirectoryPath = NSSearchPathForDirectoriesI...
You can add comment and status to order. Get order : $orderid = 12345; $order = Mage::getModel('sales/order')->load($orderid); And add comment: //$isNotify means you want to notify customer or not. $order->addStatusToHistory($status, $message, $isNotify); $order->save()
Developers often need to design web sites that allow users to upload a CSV file. Usually there is no reason to save the actual CSV file since the data will processed and/or stored in a database once uploaded. However, many if not most, PYTHON methods of parsing CSV data requires the data to be rea...
Use Nuget to find the Web Api Package. You can do that either by using the Manage Nuget Packages and searching for the Web Api package or use Nuget Package Manager and type PM> Install-Package Microsoft.AspNet.WebApi Add WebApiConfig.cs to the App_Start/ folder The config file should contain...
There is a limitation in Acumatica's SOAP Contract-Based API allowing to download attachments only for a top-level entity. Any attempt to use the GetFiles() method to get the attachments of a detail entity will, unfortunately, result in the error "Entity without screen binding cannot be used as...
def versionPropsFile = file('version.properties') def versionBuild /*Setting default value for versionBuild which is the last incremented value stored in the file */ if (versionPropsFile.canRead()) { def Properties versionProps = new Properties() versionProps.load(new FileInputStream(ve...
#include <opencv2/opencv.hpp> #include using namespace cv; using namespace std; int main(int argc, char** argv) { Mat image; image = imread("C:\Users\Development\Documents\Visual Studio 2013\Projects\ImageIn.bmp", CV_LOAD_IMAGE_GRAYSCALE); // Read the file if (!image.data)...
Suppose this struct is defined and compiled with a 32 bit compiler: struct test_32 { int a; // 4 byte short b; // 2 byte int c; // 4 byte } str_32; We might expect this struct to occupy only 10 bytes of memory, but by printing sizeof(str_32) we see it uses 12 by...

Page 111 of 114