Tutorial by Examples: demo

class Program { static void Main(string[] args) { // Create 2 thread objects. We're using delegates because we need to pass // parameters to the threads. var thread1 = new Thread(new ThreadStart(() => PerformAction(1))); var thread2 = new Thread(...
class Program { static void Main(string[] args) { // Run 2 Tasks. var task1 = Task.Run(() => PerformAction(1))); var task2 = Task.Run(() => PerformAction(2))); // Wait (i.e. block this thread) until both Tasks are complete. Task.WaitA...
The nodemon package makes it possible to automatically reload your program when you modify any file in the source code. Installing nodemon globally npm install -g nodemon (or npm i -g nodemon) Installing nodemon locally In case you don't want to install it globally npm install --save-dev nodemo...
svc public class WCFRestfulService : IWCFRestfulService { public string GetServiceName(int Id) { return "This is a WCF Restful Service"; } } Interface [ServiceContract(Name = "WCRestfulService ")] public interface IWCFRestf...
Consider this simple class: class SmsUtil { public bool SendMessage(string from, string to, string message, int retryCount, object attachment) { // Some code } } Before C# 3.0 it was: var result = SmsUtil.SendMessage("Mehran", "Maryam", "Hello...
from datetime import datetime import pandas_datareader.data as wb stocklist = ['AAPL','GOOG','FB','AMZN','COP'] start = datetime(2016,6,8) end = datetime(2016,6,11) p = wb.DataReader(stocklist, 'yahoo',start,end) p - is a pandas panel, with which we can do funny things: let's see what...
Bean1 @ManagedBean @ViewScoped public class Bean1 implements Serializable { /** * Just takes the given param, sets it into flash context and redirects to * page2 * * @param inputValue * @return */ public String goPage2(String inputValue) { ...
;Sends the keystroke for the letter "a" every 3 seconds. #Persistent SetTimer, SendLetterA, 3000 return SendLetterA() { Send, a }
The UNICODE modifier, usually expressed as u (PHP, Python) or U (Java), makes the regex engine treat the pattern and the input string as Unicode strings and patterns, make the pattern shorthand classes like \w, \d, \s, etc. Unicode-aware. /\A\p{L}+\z/u is a PHP regex to match strings that consis...
<!doctype html> <html> <head> <style> body{ background-color:white; } #canvas{border:1px solid red; } </style> <script> window.onload=(function(){ var canvas = document.getElementById("canvas"); var ctx = canvas.getContext(&...
This example shows how to use the Firebase Cloud Messaging(FCM) platform. FCM is a successor of Google Cloud Messaging(GCM). It does not require C2D_MESSAGE permissions from the app users. Steps to integrate FCM are as follows. Create sample hello world project in Android Studio Your Android...
To promote a node or set of nodes, run docker node promote from a manager node: docker node promote node-3 node-2 Node node-3 promoted to a manager in the swarm. Node node-2 promoted to a manager in the swarm. To demote a node or set of nodes, run docker node demote from a manager node: doc...
<canvas id="c" width="400" height="400"></canvas> var canvas = new fabric.Canvas("c"); canvas.on('mouse:up', function () { console.log('Event mouse:up Triggered'); }); canvas.on('mouse:down', function () { console.log('Event mouse:d...
MSDN-GetObject Function Returns a reference to an object provided by an ActiveX component. Use the GetObject function when there is a current instance of the object or if you want to create the object with a file already loaded. If there is no current instance, and you don't want the object ...
app\Exceptions\Handler.php public function render($request, Exception $exception) { if ($exception instanceof ModelNotFoundException) { abort(404); } return parent::render($request, $exception); } You can catch / handle any exception that is thrown in Laravel.
This shows how to create the demo database used in big parts of Progress documentation: sports2000. This assumes you have installed the Progress products with at least one type of database license. Run proenv script/bat-file that will give you a prompt with all environment variables set. Create ...
A number of the demonstration macros within this part requires a function which I will explain later. For the moment, please just copy GetFldrNames() to a suitable module. I use this function frequently and keep it, and other like it that I use in many different macros, in a module named “ModGloba...
A key part of the Reader monad is the ask (https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Reader.html#v:ask) function, which is defined for illustrative purposes: import Control.Monad.Trans.Reader hiding (ask) import Control.Monad.Trans ask :: Monad m => ReaderT r m r ask ...
For example, imagine a screen with 3 sections, laid out like this: The blue box might be given a margin of 4,4,0,0. The green box might be given a margin of 4,4,4,0. The purple box margin would be 4,4,4,4. Here's the XAML: (I'm using a grid to achieve the layout; but this design principle applies...

Page 1 of 2