Tutorial by Examples

class Hello < Hyperloop::Component # params (= react props) are declared using the param macro param :guest render do "Hello there #{params.guest}" end end # to "mount" Hello with guest = "Matz" say Hello(guest: 'Matz') # params can be giv...
# HTML tags are built in and are UPCASE class HTMLExample < Hyperloop::Component render do DIV do SPAN { "Hello There" } SPAN { "Welcome to the Machine!" } end end end
# Event handlers are attached using the 'on' method class ClickMe < Hyperloop::Component render do DIV do SPAN { "Hello There" } A { "Click Me" }.on(:click) { alert('you did it!' } end end end
# States are read using the 'state' method, and updated using 'mutate' # when states change they cause re-render of all dependent dom elements class StateExample < Hyperloop::Component state count: 0 # by default states are initialized to nil render do DIV do SPAN { "H...
# all react callbacks are supported using active-record-like syntax class SomeCallBacks < Hyperloop::Component before_mount do # initialize stuff - replaces normal class initialize method end after_mount do # any access to actual generated dom node, or window behaviors goes ...
In certain cases (e.g. logging) it might be useful to run task and do not await for the result. The following extension allows to run task and continue execution of the rest code: public static class TaskExtensions { public static async void RunAndForget( this Task task, Action<E...
To find your existing .cs files, right click on the project in your instance of Visual Studio, and click Open Folder in File Explorer. Visual Studio --> Your current project (Windows Form) --> Solution Explorer --> Project Name --> Right Click --> Add --> Existing Item --> ...
The TestProducerfrom this example produces Integerobjects in a given range and pushes them to its Subscriber. It extends the Flowable<Integer> class. For a new subscriber, it creates a Subscription object whose request(long) method is used to create and publish the Integer values. It is impor...
Detailed instructions on getting linked-list set up or installed.
Required External Jar: mysql-connector-java-5.1.40-bin.jar to connect to Data Base. Add this jar by right clicking the project -->Build Path--> Add external Archieve. Create the Flow as Flowing 2) Database Connector Configuration: Select MySQL as your database by double clicking the Data...
Step1 Message Flow: [![enter image description here][1]][1] Step 2: Databse Connector Configuration For this you need mysql-connector-java-5.1.40-bin.jar . Right click on Project -->build Path--> Add external archieve and add the jar(without jar it cannot be connected) Enter all the value...
Use Redirect to force users to connect to the secure URL. <VirtualHost *:80> ServerName example.com SSLProxyEngine on Redirect permanent / https://secure_example.com/ </VirtualHost> The rest of the configuration can be put in the ssl virtual host (port 443) since ever...
When designing a linked list, you can avoid all the special-cases (empty list, first node, last node, etc) by using a sentry node. Let's see how that is done: struct Node { Node* next; Node* prev; T data; }; // helper function to link 2 nodes void Link(Node* n1, Node* n2) { ...
class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b The most important function for dealing with monads is the bind operator >>=: (>>=) :: m a -> (a -> m b) -> m b Think of m a as "an action with an a result". ...
A simple SELECT query in Linq static void Main(string[] args) { string[] cars = { "VW Golf", "Opel Astra", "Audi A4", "Ford Focus", "Seat Leon&q...
xcrun simctl install booted *.app
Debugging starts with understanding the code you are trying to debug. Bad code: int main() { int value; std::vector<int> vectorToSort; vectorToSort.push_back(42); vectorToSort.push_back(13); for (int i = 52; i; i = i - 1) { vectorToSort.push_back(i *2); } ...
Static analysis is the technique in which on checks the code for patterns linked to known bugs. Using this technique is less time consuming than a code review, though, its checks are only limited to those programmed in the tool. Checks can include the incorrect semi-colon behind the if-statement (i...
In this example we use Tensorflow to count to 10. Yes this is total overkill, but it is a nice example to show an absolute minimal setup needed to use Tensorflow import tensorflow as tf # create a variable, refer to it as 'state' and set it to 0 state = tf.Variable(0) # set one to a constan...
#pragma strict import UnityEngine.Advertisements; #if !UNITY_ADS // If the Ads service is not enabled public var gameId : String; // Set this value from the inspector public var enableTestMode : boolean = true; // Enable this during development #endif function InitializeAds () // Example o...

Page 1231 of 1336