Tutorial by Examples

Suppose there is a peak of normally (gaussian) distributed data (mean: 3.0, standard deviation: 0.3) in an exponentially decaying background. This distribution can be fitted with curve_fit within a few steps: 1.) Import the required libraries. 2.) Define the fit function that is to be fitted to th...
The volatile keyword tells the compiler that the value of the variable may change at any time as a result of external conditions, not only as a result of program control flow. The compiler will not optimize anything that has to do with the volatile variable. volatile int foo; /* Different ways to ...
The function EventEmitter.eventNames() will return an array containing the names of the events currently subscribed to. const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("message", function(){ //list...
To successfully create a sparkpost email api setup, add the below details to env file and your application will be good to start sending emails. MAIL_DRIVER=sparkpost SPARKPOST_SECRET= NOTE: The above details does not give you the code written in controller which has the business logic to send em...
Detailed instructions on getting shapeless set up or installed.
Here's an example on how to use the values in the registry to check for dotNET 4.5 or higher. I'd recommend putting this snippet of code somewhere like .OnInit as this will execute before anything else happens; this way it checks for .NET before any files get copied or registry changes take place. ...
Function dotNETCheck Alternatively you can use the function I wrote below. This one makes use of LogicLib.nsh. It should work out-of-the-box without having to know the .NET versions value from the Release key in the registry. As it is written right now it only checks for versions between 4.5–4.7. ...
To create AR applications on the web, you need to add a new library named AR.js. First you load A-frame followed by AR.js. Newt you must setup you scene using the A-frames a-scene-tag with the artoolkit-attribute added. The sourceType must be your webcam. The font-camera of your smartphone is also ...
We can call an action result in another action result. public ActionResult Action1() { ViewData["OutputMessage"] = "Hello World"; return RedirectToAction("Action2","ControllerName"); //this will go to second action; } public ActionResult...
Action result can return Json. 1.Returning Json to transmit json in ActionResult public class HomeController : Controller { public ActionResult HelloJson() { return Json(new {message1="Hello", message2 ="World"}); } } 2.Returning Content to transmit...
#= Regardless of architecture we're using just the following !define REGSVR `$SYSDIR\regsvr32.exe` #= define where RegSrv32 is !define DLL `$AppDirectory\App\MyLegalProgram\myLegit.dll` #= define the file to register ##= #= Command line usage is the same for both variants of RegSrv32 as foll...
##= # The variable $Bit will hold either 64 or 32 depending on system architecture # This is used with ${Register::DLL} and ${UnRegister::DLL} # Use this in the beginning of your code. # This snippet should only be used once. # Var Bit System::Call "kernel32::GetCurrentProcess()i.s&quot...
##= # The variable $Bit will hold either 64 or 32 depending on system architecture # This is used with ${Register::DLL} and ${UnRegister::DLL} # Use this in the beginning of your code. # This snippet should only be used once. # Var Bit System::Call "kernel32::GetCurrentProcess()i.s&quo...
If You have Role: +-----------------------------+ | roleId | name | discription | +-----------------------------+ Rights: +-----------------------------+ | rightId | name | discription| +-----------------------------+ rightrole +------------------+ | roleId | rightId | +----------...
I am assuming that you have aware about the some syntax of Kotlin and how to use, just add RecyclerView in activity_main.xml file and set with adapter class. class MainActivity : AppCompatActivity(){ lateinit var mRecyclerView : RecyclerView val mAdapter : RecyclerAdapter = ...
By creating multiple properties files for the different environments or use cases, its sometimes hard to manually change the active.profile value to the right one. But there is a way to set the active.profile in the application.properties file while building the application by using maven-profiles. ...
If you have: class MyExample(val i: Int) { operator fun <R> invoke(block: MyExample.() -> R) = block() fun Int.bigger() = this > i } you can write the following DSL-like code in your production code: fun main2(args: Array<String>) { val ex = MyExample(233) ex ...
ExpandoObject (the System.Dynamic namespace) is a class that was added to the .Net Framework 4.0. This class allows us to dynamically add and remove properties onto an object at runtime. By using Expando object we can add our model classes into dynamically created Expando object. Following example e...
Let y(x) = A * x^a, for example A=30 and a=3.5. Taking the natural logarithm (ln) of both sides yields (using the common rules for logarithms): ln(y) = ln(A * x^a) = ln(A) + ln(x^a) = ln(A) + a * ln(x). Thus, a plot with logarithmic axes for both x and y will be a linear curve. The slope of this c...
Nested prefabs are not avaible in Unity at the moment. You can drag one prefab to another, and apply that, but any changes on the child prefab will not be applied to nested one. But there is a simple workaround - You have to add to parent prefab a simple script, that will instantiate a child one. ...

Page 1271 of 1336