Tutorial by Examples: c

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...
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 ...
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...
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...
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() ...
Install the package: $ pip install pymssql import pymssql SERVER = "servername" USER = "username" PASSWORD = "password" DATABASE = "dbname" connection = pymssql.connect(server=SERVER, user=USER, password=PASSWORD, database=DATABASE...
Let's start with a simple algorithm to see how recursion could be implemented in Ruby. A bakery has products to sell. Products are in packs. It services orders in packs only. Packaging starts from the largest pack size and then the remaining quantities are filled by next pack sizes available. For ...
Email clients use different rendering engines to render HTML emails: Apple Mail, Outlook for Mac, Android Mail and iOS Mail use WebKit Outlook 2000/02/03 use Internet Explorer 6 Outlook 2007/10/13 use Microsoft Word Web clients use their browser’s respective engine (e.g. Safari uses WebKit, Ch...
XmlView: <mvc:View controllerName="sap.ui.demo.wt.controller.App" xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"> <App> <pages> <Page content="{path:'Tiles>/Tiles',fact...
DATA table-name; INFILE "file-path/file-name.csv" dsd; INPUT Name $ City $ Age; RUN;
InvocationExpression class allows invocation of other lambda expressions that are parts of the same Expression tree. You create them with static Expression.Invoke method. Problem We want to get on the items which have "car" in their description. We need to check it for null before searc...
Tables for Layout The structure of an HTML email file is similar to that of a web page: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Hello!</title> </head> <body> &...
The Content-Type meta tag is for telling the destination rendering engine how to process text and special characters. You should encode all special characters anyway (e.g., & becomes & for an ampersand) to be safe, but it’s worth keeping this line in there anyway. utf-8 works for most c...
Apple iOS 10 Mail doesn't always auto-scale non-responsive emails. The auto-scale meta tag can be used to disable auto-scale feature in iOS 10 Mail entirely. <meta name="x-apple-disable-message-reformatting">

Page 645 of 826