Tutorial by Examples

Here is how to create a custom calendar. The example given is a french calendar -- so it provides many examples. from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, EasterMonday, Easter from pandas.tseries.offsets import Day, CustomBusinessDay class FrBusinessCalendar(AbstractH...
Here is how to use the custom calendar. Get the holidays between two dates import pandas as pd from datetime import date # Creating some boundaries year = 2016 start = date(year, 1, 1) end = start + pd.offsets.MonthEnd(12) # Creating a custom calendar cal = FrBusinessCalendar() # Getti...
COALESCE () Evaluates the arguments in order and returns the current value of the first expression that initially does not evaluate to NULL. DECLARE @MyInt int -- variable is null until it is set with value. DECLARE @MyInt2 int -- variable is null until it is set with value. DECLARE @MyInt3 int -...
Let's discuss with an example. From n items, in how many ways you can choose r items? You know it is denoted by . Now think of a single item. If you don't select the item, after that you have to take r items from remaining n-1 items, which is given by . If you select the item, after that you hav...
No matter how many problems you solve using dynamic programming(DP), it can still surprise you. But as everything else in life, practice makes you better. Keeping these in mind, we'll look at the process of constructing a solution for DP problems. Other examples on this topic will help you understan...
This attribute used t identify a method that is called once to perform setup before any child tests are run. For the new versions we are using OneTimeSetUp as the TestFixtureSetUp is obsolete. OneTimeSetUp [OneTimeSetUp] public void SetUp() { }
This attribute is used to identify a method that is called immediately after each tests, it will be called even if there is any error, this is the place we can dispose our objects. [TearDown] public void CleanAfterEveryTest() { }
A public gist can be almost anything. A simple example of a Javascript function: function randomInt(min, max) { return Math.floor((max - min + 1) * Math.random()) + min; }
A secret gist should be used for anything that you don't want to appear publicly on GitHub. Secret gists can be used when you don't want private keys to be accessible to the public, or for and private code in general. A simple example of JSON code that would be better fit for a secret gist: { &qu...
Minimum Vertex Cover is a classic graph problem. Let's say, in a city we have a few roads connecting a few points. Let's represent the roads using edges and the points using nodes. Let's take two example graphs: We want to set watchmen on some points. A watchman can guard all the roads connected ...
Controller is an entry point to our application. However, it’s not the only possible entry point. I would like to have my logic accessible from: Rake tasks background jobs console tests If I throw my logic into a controller it won’t be accessible from all these places. So let’s try “skinny ...
describe("Includes validations for index page", function () { });
it("Spy call for datepicker date validation", function () { });
describe("Includes validations for index page", function () { var indexPage; it("Check for null values", function () { // We are going to pass "" (null) value to the function var retVal = indexPage.isNullValue(""); exp...
since version 9.5 postgres offers UPSERT functionality with INSERT statement. Say you have a table called my_table, created in several previous examples. We insert a row, returning PK value of inserted row: b=# INSERT INTO my_table (name,contact_number) values ('one',333) RETURNING id; id ---- ...
Go to Tools -> Options. Go to Environment -> Keyboard -> Query Shortcuts On the right side you can see some shortcuts which are by default in SSMS. Now if you need to add a new one, just click on any column under Stored Procedure column. Click OK. Now please go to a query window and sel...
If you click on export icon, you will given options to choose like on which format you need to export the data. Just click on anything you wish. You can see that the data is being send to the server http://export.highcharts.com/ in the top left side. exporting: { chartOptions: { ...
You need to add a reference of the file called offline-exporting.js to make the client side exporting available. Please be noted this feature is not supported in browser IE 8, So if you load this chart in any unsupported browser, the module will fall back to the export server. This can be handled wi...
If you are using RVM(Ruby Version Manager) then using a gemset for each project is a good idea. A gemset is just a container you can use to keep gems separate from each other. Creating a gemset per project allows you to change gems (and gem versions) for one project without breaking all your other p...
Import the namespace System.Runtime.Caching(Make sure that you have added System.Runtime.Caching DLL to your project reference). Create an instance of MemoryCache class. MemoryCache memCache = MemoryCache.Default; Add values to MemoryCache public IQueryable<tblTag> GettblTags() ...

Page 1036 of 1336