Tutorial by Examples: er

myfunc(){ echo "I will never be executed." } another_func(){ # this "redeclare" overwrites original function myfunc(){ echo "I am the one and only"; } } # myfunc will print "I will never be executed" myfunc # but if we call another_func fi...
By default, queries that return entity types are tracking This means you can make changes to those entity instances and have those changes persisted by SaveChanges() Example : The change to the book rating will be detected and persisted to the database during SaveChanges(). using (va...
No tracking queries are useful when the results are used in a read-only scenario They are quicker to execute because there is no need to setup change tracking information Example : using (var context = new BookContext()) { var books = context.Books.AsNoTracking().ToList(); } With ...
Usage To install a module (assuming cpanm is already installed): cpanm Data::Section cpanm ("cpanminus") strives to be less verbose than cpan but still captures all of the installation information in a log file in case it is needed. It also handles many "interactive questions&quo...
You can throw your own errors using error. Execution stops at uncaught errors. By default, the error message is "An error has occurred." with error number -2700. error error "An error has occurred." number -2700 from «script» to item You can pass a message with the error...
from __future__ import print_function import os, sys from PIL import Image for infile in sys.argv[1:]: f, e = os.path.splitext(infile) outfile = f + ".jpg" if infile != outfile: try: Image.open(infile).save(outfile) except IOError: ...
If the ORDER BY clause is specified in your update SQL statement, the rows are updated in the order that is specified. If LIMIT clause is specified in your SQL statement, that places a limit on the number of rows that can be updated. There is no limit, if LIMIT clause not specified. ORDER BY and L...
By default Controllers, ViewComponents and TagHelpers aren't registered and resolved via the dependency injection container. This results in the inability to do i.e. property injection when using a 3rd party Inversion of Control (IoC) container like AutoFac. In order to make ASP.NET Core MVC resolv...
dispatch_group_t preapreWaitingGroup = dispatch_group_create(); dispatch_group_enter(preapreWaitingGroup); [self doAsynchronousTaskWithComplete:^(id someResults, NSError *error) { // Notify that this task has been completed. dispatch_group_leave(preapreWaitingGroup); }] dispatch...
#include <ctype.h> #include <stdio.h> typedef struct { size_t space; size_t alnum; size_t punct; } chartypes; chartypes classify(FILE *f) { chartypes types = { 0, 0, 0 }; int ch; while ((ch = fgetc(f)) != EOF) { types.space += !!isspace(ch); types.al...
#include <ctype.h> #include <stddef.h> typedef struct { size_t space; size_t alnum; size_t punct; } chartypes; chartypes classify(const char *s) { chartypes types = { 0, 0, 0 }; const char *p; for (p= s; p != '\0'; p++) { types.space += !!isspace((unsigned ...
C++ #include "opencv2/objdetect/objdetect.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> using namespace std; using namespace cv; // Function Headers void detectAndDisp...
You can nest enumerations one inside an other, this allows you to structure hierarchical enums to be more organized and clear. enum Orchestra { enum Strings { case violin case viola case cello case doubleBasse } enum Keyboards { case...
This example has more tests available in unit testing. Employee.vb (Class Library) ''' <summary> ''' Employee Class ''' </summary> Public Class Employee ''' <summary> ''' First name of employee ''' </summary> Public Property FirstName As String = &q...
Many Flask applications are developed in a virtualenv to keep dependencies for each application separate from the system-wide Python installation. Make sure that mod-wsgi is installed in your virtualenv: pip install mod-wsgi Then create a wsgi wrapper for your Flask application. Usually it's kep...
The <header> element represents introductory content for its nearest ancestor sectioning content or sectioning root element. A <header> typically contains a group of introductory or navigational aids. Note: The header element is not sectioning content; it doesn’t introduce a new secti...
The <footer> element contains the footer part of the page. Here is an example for <footer> element that contain p paragraph tag. <footer> <p>All rights reserved</p> </footer>
In bash, you have to quote arguments in order to preserve white space: # bash function print_first_argument { echo "$1" } argument="has white space" print_first_argument "$argument" In Zsh, you don't need the quotes, because of different evaluation orde...
A pattern rule is indicated by a single % character in the target. The % matches a non-empty string called the stem. The stem is then substituted for every % that appears in the prerequisite list. For example, this rule: %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ Will match any target ending ...
If a target matches multiple pattern rules, make will use the one whose prerequisites exist or can be built. For example: %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ %.o: %.s $(AS) $(ASFLAGS) $< -o $@ Will compile foo.c to foo.o or assemble foo.s to foo.o, depending on which one of foo...

Page 293 of 417