Tutorial by Examples: f

@IBAction func axisChange(sender: UISwitch) { UIView.animateWithDuration(1.0) { self.updateConstraintsForAxis() } } The updateConstraintForAxis function just sets the axis of the stack view containing the two image views: private func updateConstraintsForAxis() { if (axi...
To restore a file to the latest updated svn version, i.e. undo the local changes, you can use revert: svn revert file To restore a file to an older version (revision XXX) use update: svn update -r XXX file Warning: in both cases you will lose any local changes in the file because it will be ...
A shader program, in the OpenGL sense, contains a number of different shaders. Any shader program must have at least a vertex shader, that calculates the position of the points on the screen, and a fragment shader, that calculates the colour of each pixel. (Actually the story is longer and more co...
To create a new project use the following command (HelloWorld is the name of the project and play-java is the template) $ ~/activator-1.3.10-minimal/bin/activator new HelloWorld play-java You should get an output similar to this one Fetching the latest list of templates... OK, application &...
When we created our project, Activator told us how we can run our application To run "HelloWorld" from the command line, "cd HelloWorld" then: /home/YourUserName/HelloWorld/activator run There is a small pitfall here: activator executable is not in our project root, but ...
Calling the function string InvoiceHtml = myFunction.RenderPartialViewToString("PartialInvoiceCustomer", ToInvoice); // ToInvoice is a model, you can pass parameters if needed Function to generate HTML public static string RenderPartialViewToString(string viewName, object model) { ...
Recursive use of make means using make as a command within a makefile. This technique is useful when a large project contains sub-directories, each having their respective makefiles. The following example will help understand advantage of using .PHONY with recursive make. /main |_ Makefile ...
From the Control Flow tab in your SSIS package, look in the SSIS Toolbox in the common section for the File System Task, drag this onto your design surface where you want the file move to happen in your package. Once you've placed the task, double click to open it. From here you'll want to fir...
This sample demonstrates how to import the worksheet Azure Excel file blob to DB on the Azure SQL Server and how to export it from DB to Azure Excel blob. Prerequisites: Microsoft Visual Studio 2015 version Open XML SDK 2.5 for Microsoft Office An Azure storage account Azure SQL Server Add...
First and foremost you should be able to find the bottleneck of your script and note that no optimization can compensate for a poor choice in data structure or a flaw in your algorithm design. Secondly do not try to optimize too early in your coding process at the expense of readability/design/quali...
There are four primary useful functions for regular expressions, all of which take arguments in needle, haystack order. The terminology "needle" and "haystack" come from the English idiom "finding a needle in a haystack". In the context of regexes, the regex is the need...
In this example I define two custom function. 1 - countryFilter function get's the country short code as input and return the country full name. 2 - _countPrinterTasks is used to calculate the no of tasks assigned to a particular user. <?php namespace DashboardBundle\Twig\Extension; use ...
Assume having a method returning IEnumerable<T>, f.e. private IEnumerable<T> GetData() { try { // return results from database } catch(Exception exception) { throw; } } Creates an Observable and starts a method asynchronously. Sel...
Visual Studio (IDE) WPA (performance analyzer) WinDbg (debugger) IDA Pro (disassembler) dotPeek (decompiler for .NET) WinMerge (diff tool) HxD or 010 editor (hex editor) Speedcrunch (calculator) Firefox (browser) Rohitab API monitor (API call monitoring) SOS (a WinDbg extension for .NET)...
Auxilliary function that takes a seed and evaluates: uint wang_hash(uint seed) { seed = (seed ^ 61) ^ (seed >> 16); seed *= 9; seed = seed ^ (seed >> 4); seed *= 0x27d4eb2d; seed = seed ^ (seed >> 15); return seed; } anot...
profile_user_profile: path: /profile/{id} defaults: { _controller: ProfileBundle:Profile:profile } requirements: id: \d+ methods: [get, delete] If you decide to use Routing.yml instead of Annotations You can get better view of all routes and...
=QUERY(QUERY(A1:D6,"select C,SUM(D) group by C",1),"select Col2>0",1)
The getForObject and getForEntity methods of RestTemplate load the entire response in memory. This is not suitable for downloading large files since it can cause out of memory exceptions. This example shows how to stream the response of a GET request. RestTemplate restTemplate // = ...; // Optio...
get_template_part( 'foo/bar', 'page'); will require 'bar-page.php' from the directory 'foo'.
Phalcon uses db service by default to obtain connection to databases. Assuming you have an conguration file with database field set up, you can include or autoload following code to obtain connection with database for your project: $di->set('db', function () use ($config) { $dbconf = $conf...

Page 275 of 457