Tutorial by Examples: er

My.Computer.Network.UploadFile("example.txt", "ftp://server.my/server_example.txt") This command upload example.txt file from working directory (you could specify absolute path if you want) to server named server.my. File stored on the server will be named server_example.txt. ...
My.Computer.Network.UploadFile("doc.txt", "ftp://server.my/on_server.txt", "Peter", "1234") This command upload doc.txt file from working directory (you could specify absolute path if you want) to server named server.my. File stored on the server will be na...
Remember to create folder for upload (uploads in example). install multer npm i -S multer server.js: var express = require("express"); var multer = require('multer'); var app = express(); var fs = require('fs'); app.get('/',function(req,res){ res.sendFil...
--dataset schemas must be identical SELECT 'Data1' as 'Column' UNION ALL SELECT 'Data2' as 'Column' UNION ALL SELECT 'Data3' as 'Column' UNION ALL SELECT 'Data4' as 'Column' UNION ALL SELECT 'Data5' as 'Column' EXCEPT SELECT 'Data3' as 'Column' --Returns Data1, Data2, Data4, and Data5
Ruby hashes use the methods hash and eql? to perform the hash operation and assign objects stored in the hash to internal hash bins. The default implementation of hash in Ruby is the murmur hash function over all member fields of the hashed object. To override this behavior it is possible to overrid...
Counting references on strings is thread-safe. Locks and exception handlers are used to safeguard the process. Consider the following code, with comments indicating where the compiler inserts code at compile time to manage reference counts: procedure PassWithNoModifier(S: string); // prologue: Inc...
Package reproducibility is a very common issue in reproducing some R code. When various packages get updated, some interconnections between them may break. The ideal solution for the problem is to reproduce the image of the R code writer's machine on your computer at the date when the code was writt...
Setting up key value observing. In this case, we want to observe the contentOffset on an object that our observer owns // // Class to observe // @interface XYZScrollView: NSObject @property (nonatomic, assign) CGPoint contentOffset; @end @implementation XYZScrollView @end // // Clas...
public void iterate(final String dirPath) throws IOException { final DirectoryStream<Path> paths = Files.newDirectoryStream(Paths.get(dirPath)); for (final Path path : paths) { if (Files.isDirectory(path)) { System.out.println(path.getFileName()); } } ...
The easiest way to install and manage various versions of Ruby with rbenv is to use the ruby-build plugin. First clone the rbenv repository to your home directory: $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv Then clone the ruby-build plugin: $ git clone https://github.com/rbenv/rub...
// This iterates through a range between two DateTimes // with the given iterator (any of the Add methods) DateTime start = new DateTime(2016, 01, 01); DateTime until = new DateTime(2016, 02, 01); // NOTICE: As the add methods return a new DateTime you have // to overwrite dt in the itera...
Suppose the make fails: $ make Launch it instead with make VERBOSE=1 to see the commands executed. Then directly run the linker or compiler command that you'll see. Try to make it work by adding necessary flags or libraries. Then figure out what to change, so CMake itself can pass correct argum...
Example: Invoke different constructors by passing relevant parameters import java.lang.reflect.*; class NewInstanceWithReflection{ public NewInstanceWithReflection(){ System.out.println("Default constructor"); } public NewInstanceWithReflection( String a){ ...
var baseType = typeof(List<>); var genericType = baseType.MakeGenericType(typeof(String)); var instance = Activator.CreateInstance(genericType); var method = genericType.GetMethod("GetHashCode"); var result = method.Invoke(instance, new object[] { });
This iterates from 4 to 13 (inclusive). for i in 4..13 puts "this is #{i}.th number" end We can also iterate over arrays using for names = ['Siva', 'Charan', 'Naresh', 'Manish'] for name in names puts name end
The Java language provides three operator for performing bitwise shifting on 32 and 64 bit integer values. These are all binary operators with the first operand being the value to be shifted, and the second operand saying how far to shift. The << or left shift operator shifts the value g...
public class InsertIntoConcurrentHashMap { public static void main(String[] args) { ConcurrentHashMap<Integer, SomeObject> concurrentHashMap = new ConcurrentHashMap<>(); SomeObject value = new SomeObject(); Integer key = 1; SomeObject ...
import java.io.FileReader; import java.io.IOException; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class InterfaceImplementationExample { public static interface Pet { public void eat(); } p...
Let's say you have this line of code: printf("Hello, world!\n"); Now say you want to change the text to "Program exiting." CommandBufferMnemonicci"printf("¦");change in the ".Program exiting.\n<esc>printf("Program exiting.\n");
This can be easily accomplished by calling Enumerable#to_a on a Range object: (1..10).to_a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (a..b) means that it will include all numbers between a and b. To exclude the last number, use a...b a_range = 1...5 a_range.to_a #=> [1, 2, 3, 4] or...

Page 174 of 417