Tutorial by Examples: dp

DELIMITER $$ DROP PROCEDURE IF EXISTS sp_nested_loop$$ CREATE PROCEDURE sp_nested_loop(IN i INT, IN j INT, OUT x INT, OUT y INT, INOUT z INT) BEGIN DECLARE a INTEGER DEFAULT 0; DECLARE b INTEGER DEFAULT 0; DECLARE c INTEGER DEFAULT 0; WHILE a < i DO WHILE b <...
Shaded region below a line import matplotlib.pyplot as plt # Data x = [0,1,2,3,4,5,6,7,8,9] y1 = [10,20,40,55,58,55,50,40,20,10] # Shade the area between y1 and line y=0 plt.fill_between(x, y1, 0, facecolor="orange", # The fill color color='...
The command prompt comes pre-installed on all Windows NT, Windows CE, OS/2 and eComStation operating systems, and exists as cmd.exe, typically located in C:\Windows\system32\cmd.exe On Windows 7 the fastest ways to open the command prompt are: Press Win 𐌎, type "cmd" and then press ...
Since the Physical Address Extension (PAE) mode that was introduced in the Pentium Pro (and Pentum M) was such a change to the Operating System memory management subsystem, when Intel designed the Pentium II they decided to enhance the "normal" Page mode to support the new Physical Address...
Environment.ProcessorCount Gets the number of logical processors on the current machine. The CLR will then schedule each thread to a logical processor, this theoretically could mean each thread on a different logical processor, all threads on a single logical processor or some other combination...
// Remember to initialize your client as described in the Remarks section Awareness.SnapshotApi.getHeadphoneState(client) .setResultCallback(new ResultCallback<HeadphoneStateResult>() { @Override public void onResult(@NonNull HeadphoneStateResult headphoneStateResult) {...
Keeping a GUI responsive while running a lengthy process requires either some very elaborate "callbacks" to allow the GUI to process its message queue, or the use of (background) (worker) threads. Kicking off any number of threads to do some work usually isn't a problem. The fun starts wh...
Windows / Linux: Ctrl + P OS X / macOS: Cmd + P Shows what parameters a method and all of its overloads accepts.
dplyr introduces a grammar of data manipulation in R. It provides a consistent interface to work with data no matter where it is stored: data.frame, data.table, or a database. The key pieces of dplyr are written using Rcpp, which makes it very fast for working with in-memory data. dplyr's philosoph...
Client.java import java.io.*; import java.net.*; public class Client{ public static void main(String [] args) throws IOException{ DatagramSocket clientSocket = new DatagramSocket(); InetAddress address = InetAddress.getByName(args[0]); String ex = "He...
Command line You can use cpan to install modules directly from the command line: cpan install DBI This would be followed by possibly many pages of output describing exactly what it is doing to install the module. Depending on the modules being installed, it may pause and ask you questions. Int...
To take a photo, first we need to declare required permissions in AndroidManifest.xml. We need two permissions: Camera - to open camera app. If attribute required is set to true you will not be able to install this app if you don't have hardware camera. WRITE_EXTERNAL_STORAGE - This permission i...
Create new Jekyll Post To create a new Jekyll Post, create a new file on _posts directory with the format YYYY-MM-DD-title.MARKUP Replace MARKUP with the file extension for the language you want to use. This is usually Markdown(.md or .markdown) or HTML(.html). _posts/2017-01-01-hello-jekyll.m...
Locally created images can be pushed to Docker Hub or any other docker repo host, known as a registry. Use docker login to sign in to an existing docker hub account. docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https...
A common problem when working with Unity is when 2 or more developers are modifying a Unity scene or prefab (*.unity files). Git does not know how to merge them correctly out of the box. Thankfully the Unity team deployed a tool called SmartMerge which makes simple merge automatic. The first thing...
$ mkdir hello-world $ cd hello-world $ tns create hello-world --ng $ tns platform add android #You can only add ios on an OSX machine Then ensure you have a device connected or an emulator running (if you don't, the default emulator should start or an error will be raised. I would recommend ge...
db.posts.find().forEach(function(doc){ if(doc.commenters){ var firstCommenter = db.users.findOne({'_id': doc.commenters[0]._id }); db.clients.update({_id: doc._id}, {$set:{'firstPost': firstCommenter }}, false, true); var firstCommenter = db.users.findOne({'_id': do...
Add below entries in pom.xml. <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springfr...
survival is the most commonly used package for survival analysis in R. Using the built-in lung dataset we can get started with Survival Analysis by fitting a regression model with the survreg() function, creating a curve with survfit(), and plotting predicted survival curves by calling the predict m...
The diamond problem, or multiple inheritance, is handled by Scala using Traits, which are similar to Java interfaces. Traits are more flexible than interfaces and can include implemented methods. This makes traits similar to mixins in other languages. Scala does not support inheritance from multipl...

Page 7 of 21