Tutorial by Examples: df

Some times application must have panes that docked not to the main frame, but to the child frame. Usually it's MDI application. In MFC Feature pack such child frame is inherited from CMDIChildWndEx class and as main frame (inherited from CMDIFrameWndEx) have all required code for such docking. But ...
We use ExecutorService to assign threads from the internal thread pool or create them on-demand to perform tasks. Each ExecutorService has an ThreadFactory, but The ExecutorService will use always a default one if we don't set a custom one. Why we should do this? To set a more descriptive thread...
The default way to find installed packages with CMake is the use the find_package function in conjunction with a Find<package>.cmake file. The purpose of the file is to define the search rules for the package and set different variables, such as <package>_FOUND, <package>_INCLUDE_D...
This simple function will execute the specified Select SQL command and return the result as data set. Public Function ReadFromDatabase(ByVal DBConnectionString As String, ByVal SQL As String) As DataTable Dim dtReturn As New DataTable Try 'Open the connection using the connection...
int fakeMalloc(__local int * addrCounter,int size) { // lock addrCounter // adds size to addrCounter's pointed cell value // unlock // return old value of addrCounter's pointed cell // serial between all threads visiting -> slow ret...
Files compressed by gzip can be directly concatenated into larger gzipped files. cat file1.gz file2.gz file3.gz > combined.gz This is a property of gzip that is less efficient than concatenating the input files and gzipping the result: cat file1 file2 file3 | gzip > combined.gz A compl...
You can set a character set both per table, as well as per individual field using the CHARACTER SET and CHARSET statements: CREATE TABLE Address ( `AddressID` INTEGER NOT NULL PRIMARY KEY, `Street` VARCHAR(80) CHARACTER SET ASCII, `City` VARCHAR(80), `Country` ...
We need only one thing in order to delete an item from the Keychain: a CFDictionary with attributes describing the items to be deleted. Any items that match the query dictionary will be deleted permanently, so if you are only intending to delete a single item be sure to be specific with your query. ...
#include <ctype.h> #include <stdio.h> typedef struct { size_t space; size_t alnum; size_t punct; } chartypes; chartypes classify(FILE *f) { chartypes types = { 0, 0, 0 }; int ch; while ((ch = fgetc(f)) != EOF) { types.space += !!isspace(ch); types.al...
Writing a gzipped file To write a gzipped file, use the module IO::Compress::Gzip and create a filehandle by creating a new instance of IO::Compress::Gzip for the desired output file: use strict; use warnings; use open qw( :encoding(UTF-8) :std ); # Make UTF-8 default encoding use IO::Compres...
You can attach an image in a texture to a framebuffer, so that you can render directly to that texture. glGenFramebuffers (1, &framebuffer); glBindFramebuffer (GL_FRAMEBUFFER, framebuffer); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, ...
This example will create an EC2 instance of t2.micro type in N.Virginia region running Amazon Linux. During the execution, it will ask to select the KeyPair to use and an I.P. CIDR from where you can SSH to the instance, use default to make SSH open to the internet { "AWSTemplateFormatVersion"...
One implementation of the io.Reader interface can be found in the bytes package. It allows a byte slice to be used as the source for a Reader. In this example the byte slice is taken from a string, but is more likely to have been read from a file or network connection. message := []byte("Hello...
CloudFormer template translates the existing AWS entities to a generate new CloudFormation template to accelerate the time to recreate the environment. The CloudFormer launches in a default VPC which might not be suitable in the cases where the default VPC is deleted. This code base is fork from the...
Keychain.h #import <Foundation/Foundation.h> typedef void (^KeychainOperationBlock)(BOOL successfulOperation, NSData *data, OSStatus status); @interface Keychain : NSObject -(id) initWithService:(NSString *) service_ withGroup:(NSString*)group_; -(void)insertKey:(NSString *)key with...
Consider a base class Vehicle and its derived class Car as follows: #import <Foundation/Foundation.h> @interface Vehicle : NSObject { NSString *vehicleName; NSInteger vehicleModelNo; } - (id)initWithName:(NSString *)name andModel:(NSInteger)modelno; - (void)print; @end ...
From an action controller: $this->getLayout()->getBlock('head')->getTemplate(); /** * Get specified tab grid */ public function gridOnlyAction() { $this->_initProduct(); $this->getResponse()->setBody( $this->getLayout()->createBlock('adminhtml/catalog_product_edit_...
Objective-C Import the following to your ViewController #import <CoreImage/CoreImage.h> #import <CoreImage/CoreImage.h> #import <QuartzCore/QuartzCore.h> Call the function [self faceDetector]; Function definition: -(void)faceDetector { // Load the picture for face...
Advanced functions behave the in the same way as cmdlets. The PowerShell ISE includes two skeletons of advanced functions. Access these via the menu, edit, code snippets, or by Ctrl+J. (As of PS 3.0, later versions may differ) Key things that advanced functions include are, built-in, customiz...
Yu can define format of the file that will be imported using FORMATFILE option: INSERT INTO mytable SELECT a.* FROM OPENROWSET(BULK 'c:\test\values.txt', FORMATFILE = 'c:\test\values.fmt') AS a; The format file, format_file.fmt, describes the columns in values.txt: 9.0 2 1 SQ...

Page 15 of 21