Tutorial by Examples: c

Detailed instructions on getting openerp set up or installed in Debian/Ubuntu. To install from source code, we need Python 2.7, Git and a PostgreSQL database: $ sudo apt-get install git python-pip python2.7-dev -y $ sudo apt-get install postgresql -y $ sudo su -c "createuser -s $(whoami)&qu...
6.0 Since C# 6.0 it is possible to use string interpolation in place of String.Format. string name = "John"; string lastname = "Doe"; Console.WriteLine($"Hello {name} {lastname}!"); Hello John Doe! More examples for this under the topic C# 6.0 features: Stri...
The Flex compiler (mxmlc) is one of the most important parts of the Flex SDK. You can edit AS3 code in any text editor you like. Create a main class file that extends from DisplayObject. You can trigger builds at the command line as follows: mxmlc -source-path="." -default-size [width in...
Imagine the following XML: <root> <element>hello</element> <another> hello </another> <example>Hello, <nested> I am an example </nested>.</example> </root> The following XPath expression: //*[text() = 'hel...
To make a Haskell program executable you must provide a file with a main function of type IO () main :: IO () main = putStrLn "Hello world!" When Haskell is compiled it examines the IO data here and turns it into a executable. When we run this program it will print Hello world!. If y...
Output some information about a known remote: origin git remote show origin Print just the remote's URL: git config --get remote.origin.url With 2.7+, it is also possible to do, which is arguably better than the above one that uses the config command. git remote get-url origin
The static method Date.now returns the number of milliseconds that have elapsed since 1 January 1970 00:00:00 UTC. To get the number of milliseconds that have elapsed since that time using an instance of a Date object, use its getTime method. // get milliseconds using static method now of Date co...
Laravel allows access to a variety of classes called Services. Some services are available out of the box, but you can create them by yourself. A service can be used in multiple files of the application, like controllers. Let's imagine a Service OurService implementing a getNumber() method returnin...
In a Service Provider register method we can bind an interface to an implementation: public function register() { App::bind( UserRepositoryInterface::class, EloquentUserRepository::class ); } From now on, everytime the app will need an instance of UserRepositoryInterface, Larave...
We can use the Service Container as a Registry by binding an instance of an object in it and get it back when we'll need it: // Create an instance. $john = new User('John'); // Bind it to the service container. App::instance('the-user', $john); // ...somewhere and/or in another class... ...
We can bind a class as a Singleton: public function register() { App::singleton('my-database', function() { return new Database(); }); } This way, the first time an instance of 'my-database' will be requested to the service container, a new instance will be created. Al...
The Service Container is the main Application object. It can be used as a Dependency Injection Container, and a Registry for the application by defining bindings in the Service Providers Service Providers are classes where we define the way our service classes will be created through the applicatio...
Solution 1: $('#parent').prepend($('#child')); Solution 2: $('#child').prependTo($('#parent')); Both solutions are prepending the element #child (adding at the beginning) to the element #parent. Before: <div id="parent"> <span>other content</span> </di...
Solution 1: $('#parent').append($('#child')); Solution 2: $('#child').appendTo($('#parent')); Both solutions are appending the element #child (adding at the end) to the element #parent. Before: <div id="parent"> <span>other content</span> </div> <d...
Equality For basic equality testing, the equal operator == is used. For more comprehensive checks, use the identical operator ===. The identical operator works the same as the equal operator, requiring its operands have the same value, but also requires them to have the same data type. For exampl...
from pandas_datareader import data # Only get the adjusted close. aapl = data.DataReader("AAPL", start='2015-1-1', end='2015-12-31', data_source='yahoo')['Adj Close'] >>> aapl.plot(title='AAPL Adj. C...
chrome.runtime.getManifest() returns the extension's manifest in a form of a parsed object. This method works both on content scripts and all extension pages, it requires no permissions, Example, obtaining the extension's version string: var version = chrome.runtime.getManifest().version;
Using the Control.Invoke() method you may move the execution of a method or function from a background thread to the thread that the control was created on, which is usually the UI (User Interface) thread. By doing so your code will be queued to run on the control's thread instead, which removes the...
This method will work on modern versions of Arch, CentOS, CoreOS, Debian, Fedora, Mageia, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu, and others. This wide applicability makes it an ideal as a first approach, with fallback to other methods if you need to also identify o...
julia> sub2ind((3,3), 1, 1) 1 julia> sub2ind((3,3), 1, 2) 4 julia> sub2ind((3,3), 2, 1) 2 julia> sub2ind((3,3), [1,1,2], [1,2,1]) 3-element Array{Int64,1}: 1 4 2

Page 144 of 826