Tutorial by Examples: sin

Generally you should always define all variable and parameters as NO-UNDO unless you really need to. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". DISPLAY cString.
Most of functions in D3.js accept an anonymous function as an argument. The common examples are .attr, .style, .text, .on and .data, but the list is way bigger than that. In such cases, the anonymous function is evaluated for each selected element, in order, being passed: The current datum (d) ...
Many ls() queries are intended to find a single object, but ls always returns a list (or, in older Mayas, a single None). This creates complicated error checking for a simple question. The easiest way to get a single value from an ls under any circumstances is result = (cmds.ls('your query here'...
Using LIKE you can base the definition of you variable on another variable or a field in a database or temp-table. Defining a variable LIKE a database field requiers the database to always be connected. This might not always be what you want. DEFINE VARIABLE i AS INTEGER NO-UNDO LABEL "Nr&quo...
In Swift, protocol extensions cannot have true properties. However, in practice you can use the "associated object" technique. The result is almost exactly like a "real" property. Here is the exact technique for adding an "associated object" to a protocol extension: ...
In this layer we will write the application business. It is recommended for each presentation screen, you create the business interface and implementation class that contain all required functions for the screen. Below we will write the business for product screen as example /// <summary> ...
In this example we will use the Business layer in Presentation layer. And we will use MVC as example of Presentation layer (but you can use any other Presentation layer). We need first to register the IoC (we will use Unity, but you can use any IoC), then write our Presentation layer 3-1 Register ...
Every application needed to store User Session or User related details inside application in UserDefaults.So we made whole logic inside a Class for managing UserDefaults better way. Swift 3 import Foundation public struct Session { fileprivate static let defaults = UserDefaults.standard ...
Combining change of character case with Enumeration_IO and using a text buffer for the image. The first character is manipulated in place. with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; procedure Main is type Fruit is (Banana, Pear, Orange, Me...
Python includes a profiler called cProfile. This is generally preferred over using timeit. It breaks down your entire script and for each method in your script it tells you: ncalls: The number of times a method was called tottime: Total time spent in the given function (excluding time made in c...
Write a CSV file from a dict or a DataFrame. import pandas as pd d = {'a': (1, 101), 'b': (2, 202), 'c': (3, 303)} pd.DataFrame.from_dict(d, orient="index") df.to_csv("data.csv") Read a CSV file as a DataFrame and convert it to a dict: df = pd.read_csv("data.csv&qu...
A common mistake MATLAB coders have, is using the length function for matrices (as opposed to vectors, for which it is intended). The length function, as mentioned in its documentation, "returns the length of the largest array dimension" of the input. For vectors, the return value of leng...
Once you have installed a library, you need to include it in your sketch in order to use it. Open the Sketch Menu > Include Library and click the Library you want to include. Now, the IDE has generated the required inclusion tags into your code. Now the Library is included in your ...
The Search API provides access to recent tweets*. This is as opposed to the Stream API, which provides search results in real-time. <example> *Note that "the Search API is focused on relevance and not completeness" - Twitter Search API
The Stream API provides access to tweets in real-time. Streams can be filtered based on keywords, language, location, and more. Here's a simple example to track mentions of the word "tweepy": #set up a new class using tweepy.StreamListener class SimpleListener(tweepy.StreamListener): ...
public void test() { Connection conn = null; Statement stmt = null; try { Context ctx = (Context) new InitialContext().lookup("java:comp/env"); conn = ((DataSource) ctx.lookup("jdbc/SomeDataSource")).getConnection(); stmt = conn.createS...
To create a Java lambda using the GUI, first make sure you have your distribution zip ready. You will also need an AWS account that can create lambdas. Switch to the AWS Lambda, dismiss the introduction screen (or read the Get Started documentation) and press the button Create a Lambda Function. ...
Django Model Form with Django Class Based view is a classic way of building pages to do create/update operations in django application quickly. Within the form we can put methods to execute tasks. Its a cleaner way to put tasks in forms rather than putting in views/models. To give an example using ...
Instances of Integer_IO have a settings variable Default_Width which the number of characters that each output number will take. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Integer is subtype Count is Integer range -1_000_000 .. 1_000_000; package Count_IO is new Integer_IO ...

Page 136 of 161