Tutorial by Examples: ect

Launch debug by clicking on the "beetle" icon: Debug window is now waiting instructions for next step: You can go to the next step by clicking F9 in the debug window or by clicking on the green arrow:
While being better in many regards, the new connection syntax in Qt5 has one big weakness: Connecting overloaded signals and slots. In order to let the compiler resolve the overloads we need to use static_casts to member function pointers, or (starting in Qt 5.7) qOverload and friends: #include &lt...
The axis offsets for drawing the marker that are specified by refX and refY are applied before the rotation specified by the orient parameter. Below you can see the effects of various combinations of orient and refX, refY to illustrate this. <svg width="800px" height="600px"&...
The default for drawing markers is to use the stroke width of the calling element, but you can explicitly specify that markers be drawn using the unit system for the element the marker is being applied to by specifying markerUnits="userSpaceOnUse". Markers are drawn into a 3x3 markerUnits ...
UISplitViewController needs to the root view controller of your app’s window AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] self.window.ba...
Raycasting means throwing a ray from the mouse position on the screen to the scene, this is how threejs determines what object you want to click on if you have implemented it. Threejs gets that information using an octree, but still in production you may not want to compute the result at each frame ...
Object picking using Raycasting might be a heavy task for your CPU depending on your setup (for example if you don't have an octree like setup) and number of objects in the scene. If you don't need the world coordinates under the mouse cursor but only to identify the object under it you can use GPU...
The igraph package for R is a wonderful tool that can be used to model networks, both real and virtual, with simplicity. This example is meant to demonstrate how to create two simple network graphs using the igraph package within R v.3.2.3. Non-Directed Network The network is created with this pie...
Pattern matching can be used effectively with awk as it controls the actions that follows it i.e. { pattern } { action }. One cool use of the pattern-matching is to select multiple between two patterns in a file say patternA and patternB $ awk '/patternA/,/patternB/' file Assume my file contents...
This trick helps you select an element using the ID as a value for an attribute selector to avoid the high specificity of the ID selector. HTML: <div id="element">...</div> CSS #element { ... } /* High specificity will override many selectors */ [id="element&quo...
Our first element directive will not do much: it will just calculate 2+2 and will be called in html like this: <my-calculator></my-calculator> Notice the name of the directive is myCalculator (in CamelCase), but in html it's used as my-calculator (in lisp-case). Since we want our di...
The DatePicker class has a property, SelectedDate, which enable you to get or set the selected date. If there is none selected, it means its value will be null. if (datePicker.SelectedDate == null) { // Do what you have to do }
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var result = IMongoCollectionExtensions .AsQueryable(collection) ...
Vaadin plug-in for eclipse provides a quick way to build vaadin project with Apache Ivy dependency manager. Vaadin's documentation explains how to create vaadin project with the help of Eclipse plugin. To install the plug-in just go to eclipse marketplace and search vaadin. Current version of the p...
The visitor Pattern can be used to traverse structures. class GraphVisitor; class Graph { public: class Node { using Link = std::set<Node>::iterator; std::set<Link> linkTo; public: void accept(GraphVisito...
Nesting is great for keeping related selectors together to make it easier for future developers to understand your code. The parent selector, represented by an ampersand ("&") can help do that in more complex situations. There are several ways its can be used. Create a new selector th...
Sometimes, if an action should be bind to a collection view's cell selection, you have to implement the UICollectionViewDelegate protocol. Let's say the collection view is inside a UIViewController MyViewController. Objective-C In your MyViewController.h declares that it implements the UICollecti...
First obtain the Microsoft.CodeAnalysis.CSharp.Workspaces nuget before continuing. var workspace = Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create(); var project = await workspace.OpenProjectAsync(projectFilePath); var compilation = await project.GetCompilationAsync(); foreach (var diag...
Any nullable type is a generic type. And any nullable type is a value type. There are some tricks which allow to effectively use the result of the Nullable.GetUnderlyingType method when creating code related to reflection/code-generation purposes: public static class TypesHelper { public stat...
NSArray *a = @[@1]; a = [a arrayByAddingObject:@2]; a = [a arrayByAddingObjectsFromArray:@[@3, @4, @5]]; These methods are optimized to recreate the new array very efficiently, usually without having to destroy the original array or even allocate more memory.

Page 50 of 99