Tutorial by Examples

I common problem encounter when scrapping a web is how to enter a userid and password to log into a web site. In this example which I created to track my answers posted here to stack overflow. The overall flow is to login, go to a web page collect information, add it a dataframe and then move to t...
Attributes can be useful for denoting metadata on enums. Getting the value of this can be slow, so it is important to cache results. private static Dictionary<object, object> attributeCache = new Dictionary<object, object>(); public static T GetAttribute<T, V>(this V va...
In some cases you may want to change which notification you use based on a tag in the Alert keys. You can do this using the Lookup feature. Note: Lookup only works if you are using OpenTSDB and sending data to the Bosun to be indexed. For other backends or non-indexed data you have to use lookupSeri...
Xcode 8 will automatically recognize any images you’ve got in an Asset Catalog and offer them up as a suggestion inside of a UIImage initializer. So you could basically declare a new variable and then add an asset name that you have added to your asset catalog. For example let img = dog. img does n...
Small, simple csv files can be built using just a text editor, because a CSV file is simply text. If you have spreadsheet software available these are usually an easy way to open and save CSV files. Reading and writing them, or otherwise processing their contents is done more efficiently using the ...
The basic method to escape reserved words for SQL Server is the use of the square brackets ([ and ]). For example, Description and Name are reserved words; however, if there is an object using both as names, the syntax used is: SELECT [Description] FROM dbo.TableName WHERE [Name] = 'foo' T...
To enable Code First Migrations in entity framework, use the command Enable-Migrations on the Package Manager Console. You need to have a valid DbContext implementation containing your database objects managed by EF. In this example the database context will contain to objects BlogPost and Auth...
Weighted Job Scheduling Algorithm can also be denoted as Weighted Activity Selection Algorithm. The problem is, given certain jobs with their start time and end time, and a profit you make when you finish the job, what is the maximum profit you can make given no two jobs can be executed in parallel...
To store a graph, two methods are common: Adjacency Matrix Adjacency List An adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph. Adjacent means 'next to or adjoining something el...
The Assignment Operator is when you replace the data with an already existing(previously initialized) object with some other object's data. Lets take this as an example: // Assignment Operator #include <iostream> #include <string> using std::cout; using std::endl; class Foo { ...
Copy constructor on the other hand , is the complete opposite of the Assignment Constructor. This time, it is used to initialize an already nonexistent(or non-previously initialized) object. This means it copies all the data from the object you are assigning it to , without actually initializing the...
Ok we have briefly looked over what the copy constructor and assignment constructor are above and gave examples of each now let's see both of them in the same code. This code will be similar as above two. Let's take this : // Copy vs Assignment Constructor #include <iostream> #include <s...
After you've enabled migrations (please refer to this example) you are now able to create your first migration containing an initial creation of all database tables, indexes and connections. A migration can be created by using the command Add-Migration <migration-name> This command will c...
Note that the allowDiskUse: true option is optional but will help mitigate out of memory issues as this aggregation can be a memory intensive operation if your collection size is large - so i recommend to always use it. var duplicates = []; db.transactions.aggregate([ { $group: { _id: { c...
Here's a quick GIF to make the process as easy as it can be. Labels can be applied to issues and pull requests to signify priority, category, or any other information that you find useful. On GitHub, navigate to the main page of the repository. Under your repository name, click Issues or ...
There are several ways to implement a plugin system for a Java application. One of the simplest is to use URLClassLoader. The following example will involve a bit of JavaFX code. Suppose we have a module of a main application. This module is supposed to load plugins in form of Jars from 'plugins' f...
01 field-1 PIC X(80) BASED. ALLOCATE field-1 *> use field-1 FREE field-1 *> further use of field-1 will cause memory corruption
GO TO label GO TO label-1 label-2 label-3 DEPENDING ON identifier-1 GO TO label OF section GO. The last line example indicates that an ALTER statement is in play, and another part of the code will specify which actual label is the target of the jump.
Add a reference of AjaxToolkitControl.dll into your project. Then drag and drop Toolkit Script Manager and AjaxFileUpload Control from Visual Studio Toolbox window to your .aspx page like this : use this code on your aspx.cs file Make sure you have created folder named as Uploads in...

Page 960 of 1336