Tutorial by Examples

The protected keyword marks field, methods properties and nested classes for use inside the same class and derived classes only: public class Foo() { protected void SomeFooMethod() { //do something } protected class Thing { private string blah; ...
home_url() is used for retrieving the current site home url. <?php echo esc_url( home_url( '/' ) ) ); ?> Output http://www.example.com
function output = mymult(a, b) % MYMULT Multiply two numbers. % output = MYMULT(a, b) multiplies a and b. % % See also fft, foo, sin. % % For more information, see <a href="matlab:web('https://google.com')">Google</a>. output = a * b; end help mymult then p...
git clean -fX Will remove all ignored files from the current directory and all subdirectories. git clean -Xn Will preview all files that will be cleaned.
git clean -fd Will remove all untracked directories and the files within them. It will start at the current working directory and will iterate through all subdirectories. git clean -dn Will preview all directories that will be cleaned.
In addition to reading data with Eloquent, you can also use it to insert or update data with the save() method. If you have created a new model instance then the record will be inserted; otherwise, if you have retrieved a model from the database and set new values, it will be updated. In this exa...
You can delete data after writing it to the database. You can either delete a model instance if you have retrieved one, or specify conditions for which records to delete. To delete a model instance, retrieve it and call the delete() method: $user = User::find(1); $user->delete(); Alternat...
The padding property sets the padding space on all sides of an element. The padding area is the space between the content of the element and its border. Negative values are not allowed. You can specify a side individually: padding-top padding-right padding-bottom padding-left The following...
The padding property sets the padding space on all sides of an element. The padding area is the space between the content of the element and its border. Negative values are not allowed. To save adding padding to each side individually (using padding-top, padding-left etc) can you write it as a shor...
Implementations in classes, including abstract declarations, take precedence over all interface defaults. Abstract class method takes precedence over Interface Default Method. public interface Swim { default void backStroke() { System.out.println("Swim.backStroke"); ...
TODO: Maybe move the explanations to remarks and add examples separately FOOF In Common Lisp, there is a concept of Generalized References. They allow a programmer to setf values to various "places" as if they were variables. Macros that make use of this ability often have a F-postfix in...
An Anaphoric Macro is a macro that introduces a variable (often IT) that captures the result of a user-supplied form. A common example is the Anaphoric If, which is like a regular IF, but also defines the variable IT to refer to the result of the test-form. (defmacro aif (test-form then-form &o...
Macro expansion is the process of turning macros into actual code. This usually happens as part of the compilation process. The compiler will expand all macro forms before actually compiling code. Macro expansion also happens during interpretation of Lisp code. One can call MACROEXPAND manually to ...
Macros return code. Since code in Lisp consists of lists, one can use the regular list manipulation functions to generate it. ;; A pointless macro (defmacro echo (form) (list 'progn (list 'format t "Form: ~a~%" (list 'quote form)) form)) This is often very hard to...
The expansion of a macro often needs to use symbols that weren't passed as arguments by the user (as names for local variables, for example). One must make sure that such symbols cannot conflict with a symbol that the user is using in the surrounding code. This is usually achieved by using GENSYM, ...
json.Marshal from the package "encoding/json" encodes a value to JSON. The parameter is the value to encode. The returned values are an array of bytes representing the JSON-encoded input (on success), and an error (on failure). decodedValue := []string{"foo", "bar"} ...
json.Unmarshal from the package "encoding/json" decodes a JSON value into the value pointed by the given variable. The parameters are the value to decode in []bytes and a variable to use as a storage for the de-serialized value. The returned value is an error (on failure). encodedValue :...
After following the instructions above and installing Leiningen, start a new project by running: lein new <project-name> This will setup a Clojure project with the default Leiningen template within the <project-name> folder. There are several templates for Leiningen, which affect the...
Given some default routing such as {controller=Home}/{action=Index}/{id?} if you had the url https://stackoverflow.com/questions/1558902 This would go to the QuestionsController and the value 1558902 would be mapped to an id parameter of an index action, i.e. public ActionResult Index(int? id){ ...
To extend on the route binding say you had a url like https://stackoverflow.com/questions/1558902?sort=desc and routing like {controller=Home}/{action=Index}/{id?} public ActionResult Index(int? id, string sort){ //sort would bind to the value in the query string, i.e. "desc" } ...

Page 155 of 1336