Tutorial by Examples: c

Just use your local git repository as a normal git repo, with the normal git commands: git add FILE and git checkout -- FILE To stage/unstage a file git commit To save your changes. Those commits will be local and will not be "pushed" to the SVN repo, just like in a normal git reposito...
This simple CUDA program demonstrates how to write a function that will execute on the GPU (aka "device"). The CPU, or "host", creates CUDA threads by calling special functions called "kernels". CUDA programs are C++ programs with additional syntax. To see how it works...
Go to File -> Settings -> Editor -> Colors & Fonts -> Android Logcat Change the colors as you need: Choose the appropriate color:
Some basic types and classes in Java are fundamentally mutable. For example, all array types are mutable, and so are classes like java.util.Data. This can be awkward in situations where an immutable type is mandated. One way to deal with this is to create an immutable wrapper for the mutable type...
Func also supports Covariant & Contravariant // Simple hierarchy of classes. public class Person { } public class Employee : Person { } class Program { static Employee FindByTitle(String title) { // This is a stub for a method that returns // an employee that h...
This example shows how to use a request interceptor with OkHttp. This has numerous use cases such as: Adding universal header to the request. E.g. authenticating a request Debugging networked applications Retrieving raw response Logging network transaction etc. Set custom user agent Retrof...
Please see here: Pointer Arithmetic
An immutable object is an object whose state cannot be changed. An immutable class is a class whose instances are immutable by design, and implementation. The Java class which is most commonly presented as an example of immutability is java.lang.String. The following is a stereotypical example: ...
The double-colon syntax of names in the use statement looks similar to names used elsewhere in the code, but meaning of these paths is different. Names in the use statement by default are interpreted as absolute, starting at the crate root. Names elsewhere in the code are relative to the current mo...
In most cases, you may want to set I18n locale. One might want to set the locale for the current session, the current user, or based on a URL parameter This is easily achievable by implementing a before_action in one of your controllers, or in ApplicationController to have it in all of your controll...
Array.join(separator) can be used to output an array as a string, with a configurable separator. Default (separator = ","): ["a", "b", "c"].join() === "a,b,c" With a string separator: [1, 2, 3, 4].join(" + ") === "1 + 2 + 3 + 4&q...
Currency formatting, grouping digits and placing the currency symbol according to the localization. const usCurrencyFormat = new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD'}) const esCurrencyFormat = new Intl.NumberFormat('es-ES', {style: 'currency', currency: 'EUR'}) const u...
Add one common horizontal line for all categorical variables # sample data df <- data.frame(x=('A', 'B'), y = c(3, 4)) p1 <- ggplot(df, aes(x=x, y=y)) + geom_bar(position = "dodge", stat = 'identity') + theme_bw() p1 + geom_hline(aes(yintercept=5), colour=...
import 'dart:async'; Future main() async { var value = await _waitForValue(); print("Here is the value: $value"); //since _waitForValue() returns immediately if you un it without await you won't get the result var errorValue = "not finished yet"; _waitForValue()...
To convert decimal number to binary format use base 2 Int32 Number = 15; Console.WriteLine(Convert.ToString(Number, 2)); //OUTPUT : 1111 To convert decimal number to octal format use base 8 int Number = 15; Console.WriteLine(Convert.ToString(Number, 8)); //OUTPUT : 17 To conv...
The most feasible way is to use, the DateTime class. An example: <?php // Create a date time object, which has the value of ~ two years ago $twoYearsAgo = new DateTime("2014-01-18 20:05:56"); // Create a date time object, which has the value of ~ now $now = new DateTime("2016...
Specially useful for has_and_belongs_to_many relation, you can manually create a join table using the create_table method. Suppose you have two models Tags and Proyects, and you'd like to associate them using a has_and_belongs_to_many relation. You need a join table to associate instances of both c...
#define UNICODE #define _UNICODE #include <windows.h> #include <tchar.h> const TCHAR CLSNAME[] = TEXT("helloworldWClass"); LRESULT CALLBACK winproc(HWND hwnd, UINT wm, WPARAM wp, LPARAM lp); int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PTSTR cmdline, ...
Highchart by default puts a credits label in the lower right corner of the chart. This can be removed using credits option in your chart settings. credits: { enabled: false } Or credits: false will remove the highcharts.com logo.
CSS styles for the credits label. Defaults to: credits: { style: { cursor: 'pointer', color: '#909090', fontSize: '10px' } },

Page 217 of 826