Tutorial by Examples

Created this really bad program #include <stdio.h> #include <ctype.h> // forward declarations void bad_function() { int *test = 5; free(test); } int main(int argc, char *argv[]) { bad_function(); return 0; } gcc -g ex1.c ./a.out //or w...
In projects that feature several singleton classes (as is often the case), it can be clean and convenient to abstract the singleton behaviour to a base class: using UnityEngine; using System.Collections.Generic; using System; public abstract class MonoBehaviourSingleton<T> : MonoBehaviou...
Detailed instructions on getting anaconda set up or installed.
To quickly provide a matching color for links inside any alert, we can use the .alert-link utility class. <div class="alert alert-success"> You have won! Click <a href="#" class="alert-link">here</a> to claim your prize ... </div> <d...
The .cmdtree command allows to open a .txt file with predefined commands which you can simply double click to execute. How to create command file Create the file using this template windbg ANSI Command Tree 1.0 title {"Window title"} body {"Group Heading"} {"Name...
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audioManager.requestAudioFocus(audioListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); changedListener = new AudioManager.OnAudioFocusChangeListener() { @Override public void onAudioFocu...
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audioManager.requestAudioFocus(audioListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); changedListener = new AudioManager.OnAudioFocusChangeListener() { @Override public void onAudioFocusChange(in...
If you've got multiple implementations of the same interface, Spring needs to know which one it should autowire into a class. I'm going to use a Validator pattern in this example.1 Foo Class: public class Foo { private String name; private String emailAddress; private String erro...
If you've got an interface with a generic type parameter, Spring can use that to only autowire implementations that implement a type parameter you specify. Interface: public interface GenericValidator<T> { public T validate(T object); } Foo Validator Class: @Component public class...
WPF apps targeting .NET Framework 4.6.2 and later With WPF apps targeting .NET Framework 4.6.2 (and later), the soft keyboard is automatically invoked and dismissed without any additional steps required. WPF apps targeting .NET Framework 4.6.1 and earlier WPF is not primarily touch enabled, whi...
This example shows how to use fast enumeration in order to traverse through an NSArray. With this way you can also track current object's index while traversing. Suppose you have an array, NSArray *weekDays = @[@"Monday", @"Tuesday", @"Wednesday", @"Thursday&quot...
Create engaging user interfaces for Windows Desktop Applications with Blend for Visual Studio, the premier professional design tool for XAML applications. Build beautiful transitions and visualizations using Blend’s full suite of vector drawing tools, powerful template editing features, real-time an...
WPF Inspector is a utility that attaches to a running WPF application to troubleshoot common problems with layouting, databinding or styling. WPF Inspector allows you to explore a live view of the logical- and visual tree, read and edit property values of elements, watch the data context, debug trig...
Snoop is an open source tool available which allows you to browse the visual tree of a running WPF application without the need for a debugger and change properties. Download WPF Snoop from GitHub
The Windows SDK includes a suite of performance profiling tools for Windows Presentation Foundation (WPF) applications called the WPF Performance Suite. The WPF Performance Suite enables you to analyze the run-time behavior of your WPF applications and determine performance optimizations that you ca...
Several Qt Objects and Containers use a concept calles implicit sharing, which can also be refered to as copy-on-write. Implicit sharing means that the classes who use this concept share the same data on initialization. One of these classes to use the concept is QString. QString s1("Hello Wo...
import numpy as np import cv2 #access a video from your disk #to use the GIF in this example, convert to avi! cap = cv2.VideoCapture('eg_videoRead.avi') #we are going to read 10 frames #we store the frames in a numpy structure #then we'll generate a minimum projection of those frame...
Define parameters private static IMongoClient _client; private static IMongoDatabase _database; private static IMongoCollection< -collection class name- > _collection; Assign values to parameters _client = new MongoClient("mongodb://localhost:27017"); _database = _client.GetD...
Its common for datatables to have a checkbox to select multiple rows. If the data is spread across multiple pages, it could be difficult for the user to view the records he selected. To enable the user view all the selected records in one go, we usually use a hyperlink that when clicked displays onl...
Below is an example for implementing a Search input box that helps users to search the occurances of a particular value across the datatable. In the below example, #report is the div id of the div that contains the search input box. This function is called as soon as the user enters a value in this...

Page 925 of 1336