Tutorial by Examples: ecto

And, of course, you can mix these approaches, and use both packages and imports along side your application specific code. A mix-mode structure is most common in three situations: a franken-app, which is just sort of pulling a bit from here-and-there without any overall strategy; an app that's bei...
Using GNU grep grep -r 'pattern' <directory path> To also list line numbers of matches use -n option grep -rn 'pattern' <directory path> To search only files with particular glob pattern grep --include='*.txt' -r 'pattern' <directory path> Exclude file patterns or direc...
There are use cases when you might want to rename your app directory to something else. In Laravel4 you could just change a config entry, here's one way to do it in Laravel5. In this example we'll be renaming the app directory to src. Override Application class The directories name app is hardcod...
Named vector can be created in several ways. With c: xc <- c('a' = 5, 'b' = 6, 'c' = 7, 'd' = 8) which results in: > xc a b c d 5 6 7 8 with list: xl <- list('a' = 5, 'b' = 6, 'c' = 7, 'd' = 8) which results in: > xl $a [1] 5 $b [1] 6 $c [1] 7 $d [1] 8 Wi...
The dot function can also be used to compute vector dot products between two one-dimensional numpy arrays. >>> v = np.array([1,2]) >>> w = np.array([1,2]) >>> v.dot(w) 5 >>> np.dot(w,v) 5 >>> np.dot(v,w) 5
The rep function can be used to repeat a vector in a fairly flexible manner. # repeat counting numbers, 1 through 5 twice rep(1:5, 2) [1] 1 2 3 4 5 1 2 3 4 5 # repeat vector with incomplete recycling rep(1:5, 2, length.out=7) [1] 1 2 3 4 5 1 2 The each argument is especially useful for ex...
To find the largest or smallest element stored in a vector, you can use the methods std::max_element and std::min_element, respectively. These methods are defined in <algorithm> header. If several elements are equivalent to the greatest (smallest) element, the methods return the iterator to th...
if we want to change the Controllers directory we need: Move and/or rename the default Controllers directory where we want it. For example from app/Http/Controllers to app/Controllers Update all the namespaces of the files inside the Controllers folder, making they adhere to the new path, re...
R has a number of build in constants. The following constants are available: LETTERS: the 26 upper-case letters of the Roman alphabet letters: the 26 lower-case letters of the Roman alphabet month.abb: the three-letter abbreviations for the English month names month.name: the English names fo...
$ mkdir 20{09..11}-{01..12} Entering the ls command will show that the following directories were created: 2009-01 2009-04 2009-07 2009-10 2010-01 2010-04 2010-07 2010-10 2011-01 2011-04 2011-07 2011-10 2009-02 2009-05 2009-08 2009-11 2010-02 2010-05 2010-08 2010-11 2011-02 2011-05 2011-08 2011...
For server side debugging, you'll need to use a tool like Node Inspector. Before you get started, check out some of these useful tutorials. HowToNode - Debugging with Node Inspector Strongloop - Debugging Applications Easily Debugging Meteor.js Walkthrough with Screenshots of Using Node Inspecto...
On of the overloads of the Select extension methods also passes the index of the current item in the collection being selected. These are a few uses of it. Get the "row number" of the items var rowNumbers = collection.OrderBy(item => item.Property1) .ThenBy...
If you want to add all the JARs in directory to the classpath, you can do this concisely using classpath wildcard syntax; for example: someFolder/* This tells the JVM to add all JAR and ZIP files in the someFolder directory to the classpath. This syntax can be used in a -cp argument, a CLASSPA...
for /r command can be used to recursively visit all the directories in a directory tree and perform a command. @echo off rem start at the top of the tree to visit and loop though each directory for /r %%a in (.) do ( rem enter the directory pushd %%a echo In directory: cd rem leave...
The following uses a variable with a for loop to rename a group of files. SetLocal EnableDelayedExpansion for %%j in (*.*) do ( set filename=%%~nj set filename=!filename:old=new! set filename=Prefix !filename! set filename=!filename! Suffix ren "%%j" "!filename!%%~x...
Consider following html code <ul> <li id=“one” class=“main”>Item 1</li> <li id=“two” class=“main”>Item 2</li> <li id=“three” class=“main”>Item 3</li> <li id=“four”>Item 4</li> </ul> Following dom tree will be constructed ba...
For this example, we will use the vector: > x <- 11:20 > x [1] 11 12 13 14 15 16 17 18 19 20 R vectors are 1-indexed, so for example x[1] will return 11. We can also extract a sub-vector of x by passing a vector of indices to the bracket operator: > x[c(2,4,6)] [1] 12 14 16 ...
When one wishes to convert a list to a vector or data.frame object empty elements are typically dropped. This can be problematic which a list is created of a desired length are created with some empty values (e.g. a list with n elements is created to be added to an m x n matrix, data.frame, or data...
Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page. Often director...
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()); } } ...

Page 6 of 13