Tutorial by Examples: al

In previous example, Value.strdup_contents prints GLib.DateTime as pointer address. You can register functions that will transform value to desired type. First, create a function that will have this signature : static void datetime_to_string (Value src_value, ref Value dest_value) { DateTime ...
It is possible to add the attribute hreflang to the elements <a> and <area> that create hyperlinks. Such it specifies the language of the linked resource. The language defined must be a valid BCP 47[1] language tag. <p> <a href="example.org" hreflang="en&quo...
Install virtualenv via pip / (apt-get): pip install virtualenv OR apt-get install python-virtualenv Note: In case you are getting permission issues, use sudo.
If you look at the bin directory in your virtualenv, you’ll see easy_install which has been modified to put eggs and packages in the virtualenv’s site-packages directory. To install an app in your virtual environment: $ source test_project/bin/activate $ pip install flask At this time, you do...
lsvirtualenv : List all of the environments. cdvirtualenv : Navigate into the directory of the currently activated virtual environment, so you can browse its site-packages, for example. cdsitepackages : Like the above, but directly into site-packages directory. lssitepackages : Shows contents of ...
&& has precedence over ||, this means that parentheses are placed to evaluate what would be evaluated together. c++ uses short-circuit evaluation in && and || to not do unnecessary executions. If the left hand side of || returns true the right hand side does not need to be evaluate...
Service that is used for communication: import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() export class ComponentCommunicationService { private componentChangeSource = new Subject(); private newDateCreationSource = new Subject<Date&...
Installing lxml is very easy, had become an easy jobs since Python 2.7.9 (because it comes with an utility which helps developers to download install dependency in an easy manner like Maven for Java) at first you have to run the command then start coding. pip install lxml The second way is to in...
Introduction Julia uses the following syntax for dictionaries: Dict({k₁ => v₁, k₂ => v₂, …, kₙ₋₁ => vₙ₋₁, kₙ => vₙ) While Python and JSON looks like this: {k₁: v₁, k₂: v₂, …, kₙ₋₁: vₙ₋₁, kₙ: vₙ} For illustrative purposes we could also use this syntax in Julia and add new seman...
Signals are only available to GObject classes. They can only be public, which means that any part of the code can connect handlers and trigger them. public class Emitter : Object { // A signal is declared like a method, // but with the signal keyword. public signal void my_signal ();...
You can write detailed signals with the [Signal (detailed = true)] attribute. public class Emitter : Object { [Signal (detailed = true)] public signal void detailed_signal (); public void emit_with_detail (string detail) { this.detailed_signal[detail] (); } } void...
You can declare a UIFont as follows: var font: UIFont! UIFont has more init() methods: UIFont.init(descriptor: UIFontDescriptor, size: CGFloat) UIFont.init(name: String, size: CGFloat) Therefore, you can initialize a UIFont like this: let font = UIFont(name: "Helvetica Neue", s...
To change a label's text font, you need to access its font property: label.font = UIFont(name:"Helvetica Neue", size: 15) The code above will change the font of the label to Helvetica Neue, size 15. Beware that you must spell the font name correctly, otherwise it will throw this error,...
std::call_once ensures execution of a function exactly once by competing threads. It throws std::system_error in case it cannot complete its task. Used in conjunction with std::once_flag. #include <mutex> #include <iostream> std::once_flag flag; void do_something(){ std::ca...
Use top command to exam CPU time allocation between user space and kernel space. Explanation: 24.8 us (user space): 24.8% of CPU time is spent on user process. 0.5 sy (system): 0.5% of CPU time is spent on kernel space. ni (niceness): the ratio of CPU time spent on low priority processes. i...
Steps to copy heroku database to local database: 1. Run copy process in terminal: heroku pg:pull DATABASE_URL change_to_your_data_base_name --app change_to_your_app_name 2. Change db owner using this query: GRANT ALL PRIVILEGES ON DATABASE change_to_your_data_base_name to change_to_your_user; A...
Dim duplicateFruits = New List(Of String) From {"Grape", "Apple", "Grape", "Apple", "Grape"} 'At this point, duplicateFruits.Length = 5 Dim uniqueFruits = duplicateFruits.Distinct(); 'Now, uniqueFruits.Count() = 2 'If iterated over at this poin...
In this app i am directly opening InAppBrowser when the user tap the app icon instead of loading first page of app. So that would look like to user that they are viewing the app of the same website/webapp.
var a = 11, b = 22; a = a ^ b; b = a ^ b; a = a ^ b; console.log("a = " + a + "; b = " + b);// a is now 22 and b is now 11
We can create dynamic component and get the instances of component into an array and finally rendered it on template. For example, we can can consider two widget component, ChartWidget and PatientWidget which extended the class WidgetComponent that I wanted to add in the container. ChartWidget.ts ...

Page 247 of 269