Tutorial by Examples: sin

<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body = "This is...
Basic Text Email <?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setTex...
<?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setText("This is a ...
Anonymous functions can be used for functional programming. The main problem to solve is that there is no native way for anchoring a recursion, but this can still be implemented in a single line: if_ = @(bool, tf) tf{2-bool}(); This function accepts a boolean value and a cell array of two functi...
package com.example.xml.adapters; import javax.xml.bind.annotation.adapters.XmlAdapter; public class StringTrimAdapter extends XmlAdapter<String, String> { @Override public String unmarshal(String v) throws Exception { if (v == null) return null; ...
<dom-module id="using-listeners-obj"> <template> <style> :host{ width: 220px; height: 100px; border: 1px solid black; display: block; } #inner{ width: calc(100% - 10px); height: 50px; ...
An array containing the full version information split into elements, much more convenient than $BASH_VERSION if you're just looking for the major version: ~> $ for ((i=0; i<=5; i++)); do echo "BASH_VERSINFO[$i] = ${BASH_VERSINFO[$i]}"; done BASH_VERSINFO[0] = 3 BASH_VERSINFO[1] =...
You can find description of the driver here. The quick example is: import psycopg2 db_host = 'postgres.server.com' db_port = '5432' db_un = 'user' db_pw = 'password' db_name = 'testdb' conn = psycopg2.connect("dbname={} host={} user={} password={}".format( ...
foo = ("bar", 1, "Hello!",) foo[1] = 2 # ERROR!! Second line would return an error since tuple members once created aren't assignable. Because of tuple's immutability.
You can set any function for debugging with debug. debug(mean) mean(1:3) All subsequent calls to the function will enter debugging mode. You can disable this behavior with undebug. undebug(mean) mean(1:3) If you know you only want to enter the debugging mode of a function once, consider t...
On systems using systemd, such as Fedora => 15, Ubuntu (Server and Desktop) >= 15.04, and RHEL/CentOS >= 7: systemctl status [servicename] ...where [servicename] is the service in question; for example, systemctl status sshd. This will show basic status information and any recent errors ...
What is an enter selection? In D3.js, when one binds data to DOM elements, three situations are possible: The number of elements and the number of data points are the same; There are more elements than data points; There are more data points than elements; In the situation #3, all the data ...
Subclassing also Subclasses Singleton Class class Example end Example.singleton_class #=> #<Class:Example> def Example.foo :example end class SubExample < Example end SubExample.foo #=> :example SubExample.singleton_class.superclass #=> #<Class:Example> ...
Instances never contain a method they only carry data. However we can define a singleton class for any object including an instance of a class. When a message is passed to an object (method is called) Ruby first checks if a singleton class is defined for that object and if it can reply to that mess...
There are three ways to reopen a Singleton Class Using class_eval on a singleton class. Using class << block. Using def to define a method on the object's singleton class directly class Example end Example.singleton_class.class_eval do def foo :foo end end Example.fo...
The revert command allows discarding unwanted uncommitted changes. Reverting changes to a single file. hg revert example.c Reverting all changes. This will discard all changes not just the current directory. hg revert --all hg will output which files were reverted. reverting exa...
During mousemove you get flooded with 30 mouse events per second. You might not be able to redraw your drawings at 30 times per second. Even if you can, you're probably wasting computing power by drawing when the browser is not ready to draw (wasted == across display refresh cycles). Therefore it m...
Intro The Graphics class allows you to draw onto java components such as a Jpanel, it can be used to draw strings, lines, shapes and images. This is done by overriding the paintComponent(Graphics g) method of the JComponent you are drawing on using the Graphics object received as argument to do the...
A common and task of someone using the Linux Command Line (shell) is to search for files/directories with a certain name or containing certain text. There are 2 commands you should familiarise yourself with in order to accomplish this: Find files by name find /var/www -name '*.css' This will...
UISplitViewController must be the rootViewController of your application. AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] i...

Page 79 of 161