Tutorial by Examples: dis

Let's use *norm as an example. From the documentation: dnorm(x, mean = 0, sd = 1, log = FALSE) pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rnorm(n, mean = 0, sd = 1) So if I wanted to know the value of a standard no...
This method will work on modern versions of Arch, CentOS, CoreOS, Debian, Fedora, Mageia, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu, and others. This wide applicability makes it an ideal as a first approach, with fallback to other methods if you need to also identify o...
When the destructor for std::thread is invoked, a call to either join() or detach() must have been made. If a thread has not been joined or detached, then by default std::terminate will be called. Using RAII, this is generally simple enough to accomplish: class thread_joiner { public: thre...
.NET Framework defines a interface for types requiring a tear-down method: public interface IDisposable { void Dispose(); } Dispose() is primarily used for cleaning up resources, like unmanaged references. However, it can also be useful to force the disposing of other resources even though ...
// *** Find Distinct object ids of array *** NSLog(@"Distinct id : %@",[array valueForKeyPath:@"@distinctUnionOfObjects.id"]);
package { import flash.events.EventDispatcher; public class AbstractDispatcher extends EventDispatcher { public function AbstractDispatcher(target:IEventDispatcher = null) { super(target); } } } To dispatch an event on an instance: var dispatcher:AbstractDispatcher =...
Draw samples from a normal (gaussian) distribution # Generate 5 random numbers from a standard normal distribution # (mean = 0, standard deviation = 1) np.random.randn(5) # Out: array([-0.84423086, 0.70564081, -0.39878617, -0.82719653, -0.4157447 ]) # This result can also be achieved with t...
Use the HTML or <audio> element to embed video/audio content in a document. The video/audio element contains one or more video/audio sources. To specify a source, use either the src attribute or the <source> element; the browser will choose the most suitable one. Audio tag example: &...
When SQL/Plus or SQL Developer display dates they will perform an implicit conversion to a string using the default date format model (see the Setting the Default Date Format Model example). You can change how a date is displayed by changing the NLS_DATE_FORMAT parameter.
package { import flash.text.TextField; import flash.display.Sprite; public class TextHello extends Sprite { public function TextHello() { var tf:TextField = new TextField(); tf.text = "Hello World!" tf.x = 50; tf...
Open the Settings or Preferences dialog: On Windows or Linux, select File > Settings from the main menu. On Mac OSX, select Android Studio > Preferences from the main menu. Navigate to Build, Execution, Deployment > Compiler. In the text field next to Command-line Options, enter...
If you want to display to your users meaningful errors instead of simple "sorry, something went wrong", Rails has a nice utility for the purpose. Open the file app/controllers/application_controller.rb and you should find something like this: class ApplicationController < ActionContro...
DROP INDEX ix_cars_employee_id ON Cars; We can use command DROP to delete our index. In this example we will DROP the index called ix_cars_employee_id on the table Cars. This deletes the index entirely, and if the index is clustered, will remove any clustering. It cannot be rebuilt without rec...
If you need to count distinct characters then, for the reasons explained in Remarks section, you can't simply use Length property because it's the length of the array of System.Char which are not characters but code-units (not Unicode code-points nor graphemes). If, for example, you simply write tex...
A single case discriminated union is like any other discriminated union except that it only has one case. // Define single-case discriminated union type. type OrderId = OrderId of int // Construct OrderId type. let order = OrderId 123 // Deconstruct using pattern matching. // Parentheses used...
/// <summary> /// Gets displayName from DataAnnotations attribute /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <pa...
In Index page change the following: error_reporting(E_ALL | E_STRICT); to error_reporting(E_ALL); Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true and uncomment this line (remove the #) #ini_set('display_errors', 1); You can also Set Dev Mode using SetEnv in your .htaccess file To make th...
Sometimes it is useful to create union types with only one case to implement record-like types: type Point = Point of float * float let point1 = Point(0.0, 3.0) let point2 = Point(-2.5, -4.0) These become very useful because they can be decomposed via pattern matching in the same way as tu...
Example : CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = 5; E.g. In the above example code above, location changes of less than 5 m...
var a:Number=0.123456789; trace(a); // 0.123456789 trace(a.toPrecision(4)); // 0.1235 trace(a.toFixed(4)); // 0.1235 trace(a.toExponential(4)); // 1.2345e-1 trace(a.toString(16)); // 0 - works for integer part only var b:Number=12345678.9876543; // a bigg...

Page 3 of 18