Tutorial by Examples: f

.gitignore and .git/info/exclude work only for untracked files. To set ignore flag on a tracked file, use the command update-index: git update-index --skip-worktree myfile.c To revert this, use: git update-index --no-skip-worktree myfile.c You can add this snippet to your global git config ...
[ContractClass(typeof(ValidationContract))] interface IValidation { string CustomerID{get;set;} string Password{get;set;} } [ContractClassFor(typeof(IValidation))] sealed class ValidationContract:IValidation { string IValidation.CustomerID { [Pure] get ...
Swift let isPushEnabled = UIApplication.sharedApplication().isRegisteredForRemoteNotifications()
The logic of registering for push notification is recommended to be added in AppDelegate.swift as the callback functions (success, failure) will be called their. To register just do the following: let application = UIApplication.sharedApplication() let settings = UIUserNotificationSettings(forType...
Once user clicks on a push notification, the following callback function will be called. You can parse the JSON to get any specific info sent from backend that will helps you in deep linking: Swift func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : ...
cURL is the name of the project which depicts: 'Client for URLs' and also be called as Client URL Request Library it combines two separate packages: curl and libcurl. curl is a command line tool used to get documents/files from or send documents to a server, using any of the supported protocol...
Displaying all the logs from the default buffer on the Command Line can be accomplished by: adb logcat This command will show you all the logs from the device's main buffer. Notice that if you use it for the first time, you'll get a lot of information, an enormous stream of data. So you may want...
git log --stat Example: commit 4ded994d7fc501451fa6e233361887a2365b91d1 Author: Manassés Souza <[email protected]> Date: Mon Jun 6 21:32:30 2016 -0300 MercadoLibre java-sdk dependency mltracking-poc/.gitignore | 1 + mltracking-poc/pom.xml | 14 ++++++++++++-- ...
This example is written with F# in mind but the ideas are applicable in all environments The first rule when optimizing for performance is to not to rely assumption; always Measure and Verify your assumptions. As we are not writing machine code directly it is hard to predict how the compiler an...
This linker error happens, if the linker can't find a used symbol. Most of the time, this happens if a used library is not linked against. qmake: LIBS += nameOfLib cmake: TARGET_LINK_LIBRARIES(target nameOfLib) g++ call: g++ -o main main.cpp -Llibrary/dir -lnameOfLib One might also for...
The compiler can't find a file (a source file uses #include "someFile.hpp"). qmake: INCLUDEPATH += dir/Of/File cmake: include_directories(dir/Of/File) g++ call: g++ -o main main.cpp -Idir/Of/File
An interesting but rather unknown usage of Active Patterns in F# is that they can be used to validate and transform function arguments. Consider the classic way to do argument validation: // val f : string option -> string option -> string let f v u = let v = defaultArg v "Hello&quo...
F# uses the type keyword to create different kind of types. Type aliases Discriminated union types Record types Interface types Class types Struct types Examples with equivalent C# code where possible: // Equivalent C#: // using IntAliasType = System.Int32; type IntAliasType = int // ...
A container will stop if no command is running on the foreground. Using the -t option will keep the container from stopping, even when detached with the -d option. docker run -t -d debian bash
eof returns true only after reading the end of file. It does NOT indicate that the next read will be the end of stream. while (!f.eof()) { // Everything is OK f >> buffer; // What if *only* now the eof / fail bit is set? /* Use `buffer` */ } You could correctly write: ...
You can specify different dependencies for each platforms: "net45": { "frameworkAssemblies": { "System.Linq": "4.1.0" } }, "netstandard1.3": { "dependencies": { "NETStandard.Library": "1.6....
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int i; for(i = 0; i < 10; i++) { printf("%d\n", arr[i]); }
int [] arr = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; for(int value : arr) { System.out.print(value); System.out.print("\n"); } *Note that the Java foreach is just a for loop with different syntax. Some languages do this and some such as C# use foreach.
var numbers = [1,2,3,4,5]; var squares = numbers.map(function(x) { return x*x; }); // squares is [1,4,9,16,25]
var arr = [1, 2, 3, 4, 5]; var sum = arr.reduce((prev, curr) => prev + curr); console.log(sum); // Output: 15 You can also specify an initial value var arr = [1, 2, 3, 4, 5]; var sum = arr.reduce(function (previousValue, currentValue, currentIndex, array) { return previousValue + cur...

Page 190 of 457