Tutorial by Examples: app

Basic HTTP calls don't provide code-reusability, however. And they can get confused with all the other features you're trying to implement. For those reasons, it's common to implement an API wrapper. Foo = { identify: function(input){ return Http.get('http://foo.net/api/identify/' + input...
After creating an API wrapper, it's likely that you may want to create an Atmosphere package to redistribute it and share it between applications. The files of your package will probably look something like this. packages/foo-api-wrapper/package.js packages/foo-api-wrapper/readme.md packages/foo-...
At this point, you're still building your package, so you'll need to add the package to your application: meteor add myaccount:foo And eventually publish it to Atmosphere: meteor publish myaccount:foo
Now that we have all those pieces put together, you should now be able to make calls like the following from within your app: Foo.identify('John'); Foo.record_action_on_item('view', "HackerNews'); Obviously you'll want to adjust function names, arguments, urls, and the like, to create the ...
If you have a list, and you want to use the elements of that list as the arguments to a function, what you want is apply: > (apply string-append (list "hello" " " "and hi" " " "are both words")) "hello and hi are both words" > (app...
There are use cases when you might want to rename your app directory to something else. In Laravel4 you could just change a config entry, here's one way to do it in Laravel5. In this example we'll be renaming the app directory to src. Override Application class The directories name app is hardcod...
Be careful, this approach might be considered as a bad design for angular apps, since it requires programmers to remember both where functions are placed in the scope tree, and to be aware of scope inheritance. In many cases it would be preferred to inject a service (Angular practice - using scope ...
CSS resets take separate approaches to browser defaults. Eric Meyer’s Reset CSS has been around for a while. His approach nullifies many of the browser elements that have been known to cause problems right off the back. The following is from his version (v2.0 | 20110126) CSS Reset. html, body, di...
Corner radius for all 4 edges: UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(x,y,width,height) cornerRadius: 11]; [UIColor.grayColor setFill]; [rectanglePath fill]; Corner radius for top-left edge: UIBezierPath* rectanglePath = [UIBezierPath bezierPat...
Consider a simple rectangle that is drawn by the bezier path. UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRect: CGRectMake(x,y,width,height)]; [UIColor.grayColor setFill]; [rectanglePath fill]; Basic Outer-fill shadow: CGContextRef context = UIGraphicsGetCurrentContext();...
This example demonstrates creating a basic application in ExtJS using Sencha Cmd to bootstrap the process - this method will automatically generate some code and a skeleton structure for the project. Open a console window and change the working directory to an appropriate space in which to work. ...
class Program { private static Lazy<ConnectionMultiplexer> _multiplexer = new Lazy<ConnectionMultiplexer>( () => ConnectionMultiplexer.Connect("localhost"), LazyThreadSafetyMode.ExecutionAndPublication); static void Main(string[] args...
This example will show you how to create a Windows Forms Application project in Visual Studio. Create Windows Forms Project Start Visual Studio. On the File menu, point to New, and then select Project. The New Project dialog box appears. In the Installed Templates pane, select "...
Open a text editor (like Notepad), and type the code below: using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace SampleApp { public class MainForm : Form { private Button btnHello; // The form's con...
Open a text editor (like Notepad), and type the code below: Imports System.ComponentModel Imports System.Drawing Imports System.Windows.Forms Namespace SampleApp Public Class MainForm : Inherits Form Private btnHello As Button ' The form's constructor: thi...
A very interesting type of JOIN is the LATERAL JOIN (new in PostgreSQL 9.3+), which is also known as CROSS APPLY/OUTER APPLY in SQL-Server & Oracle. The basic idea is that a table-valued function (or inline subquery) gets applied for every row you join. This makes it possible to, for example...
This demonstrates a non-trivial example of wrapping a C++ dll with Cython. It will cover the following main steps: Create an example DLL with C++ using Visual Studio. Wrap the DLL with Cython so that it may be called in Python. It is assumed that you have Cython installed and can successfully...
To install an APK file, use the following command: adb install path/to/apk/file.apk or if the app is existing and we want to reinstall adb install -r path/to/apk/file.apk To uninstall an application, we have to specify its package adb uninstall application.package.name Use the following...
A patch is a file that show the differences between two revisions or between your local repository and the last revision your repository is pointing. To share or save a patch of your local uncommitted changes either for peer review or to apply later, do: svn diff > new-feature.patch To get a...
Go to the (project folder) Then app -> src -> main. Create folder 'assets -> fonts' into the main folder. Put your 'fontfile.ttf' into the fonts folder.

Page 8 of 33