Tutorial by Examples

There are quite a number situations where one has huge amounts of data and using which he has to classify an object in to one of several known classes. Consider the following situations: Banking: When a bank receives a request from a customer for a bankcard, the bank has to decide whether to issue...
from datetime import datetime a = datetime(2016,10,06,0,0,0) b = datetime(2016,10,01,23,59,59) a-b # datetime.timedelta(4, 1) (a-b).days # 4 (a-b).total_seconds() # 518399.0
Uses C standard format codes. from datetime import datetime datetime_string = 'Oct 1 2016, 00:00:00' datetime_string_format = '%b %d %Y, %H:%M:%S' datetime.strptime(datetime_string, datetime_string_format) # datetime.datetime(2016, 10, 1, 0, 0)
Uses C standard format codes. from datetime import datetime datetime_for_string = datetime(2016,10,1,0,0) datetime_string_format = '%b %d %Y, %H:%M:%S' datetime.strftime(datetime_for_string,datetime_string_format) # Oct 01 2016, 00:00:00
malloc() often calls underlying operating system functions to obtain pages of memory. But there is nothing special about the function and it can be implemented in straight C by declaring a large static array and allocating from it (there is a slight difficulty in ensuring correct alignment, in pract...
Let's say we have 8 houses. We want to setup telephone lines between these houses. The edge between the houses represent the cost of setting line between two houses. Our task is to set up lines in such a way that all the houses are connected and the cost of setting up the whole connection is mini...
FullCalendar can be downloaded from it's website: https://fullcalendar.io/download/ from NPM: $ npm install fullcalendar from Bower: $ bower install fullcalendar or CDNJS: //cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.0.1/fullcalendar.min.js //cdnjs.cloudflare.com/ajax/libs/fullca...
Depending on your target machine, you need to choose a supported ROS Version (or vice-versa). Although ROS installation is well documented in the ROS wiki, It might be confusing to find them. So, here's a table of the ROS Version, target platforms & architecture and the links for the appropriate...
After enabling and creating migrations there might be a need to initially fill or migrate data in your database. There are several possibilities but for simple migrations you can use the method 'Seed()' in the file Configuration created after calling enable-migrations. The Seed() function retrieves...
class Program { static void Main(string[] args) { //Initialize a new container WindsorContainer container = new WindsorContainer(); //Register IService with a specific implementation and supply its dependencies container.Register(Component.For<ISer...
COBOL ***************************************************************** * Example of LINAGE File Descriptor * Tectonics: $ cocb -x linage.cob * $ ./linage <filename ["linage.cob"]> * $ cat -n mini-report ***********************...
IF lv_foo = 3. WRITE: / 'lv_foo is 3'. ELSEIF lv_foo = 5. WRITE: / 'lv_foo is 5'. ELSE. WRITE: / 'lv_foo is neither 3 nor 5'. ENDIF.
CASE lv_foo. WHEN 1. WRITE: / 'lv_foo is 1'. WHEN 2. WRITE: / 'lv_foo is 2'. WHEN 3. WRITE: / 'lv_foo is 3'. WHEN OTHERS. WRITE: / 'lv_foo is something else'. ENDCASE
CHECK is a simple statement that evaluates a logical expression and exits the current processing block if it is false. METHOD do_something. CHECK iv_input IS NOT INITIAL. "Exits method immediately if iv_input is initial "The rest of the method is only executed if iv_input is not i...
When run with no arguments, this program starts a TCP socket server that listens for connections to 127.0.0.1 on port 5000. The server handles each connection in a separate thread. When run with the -c argument, this program connects to the server, reads the client list, and prints it out. The clie...
Find f(n): nth Fibonacci number. The problem is quite easy when n is relatively small. We can use simple recursion, f(n) = f(n-1) + f(n-2), or we can use dynamic programming approach to avoid the calculation of same function over and over again. But what will you do if the problem says, Given 0 <...
Sometimes we want to use a where query on a a collection of records returned which is not ActiveRecord::Relation.Hence we get the above error as Where clause is know to ActiveRecord and not to Array. There is a precise solution for this by using Joins. EXAMPLE:- Suppose i need to find all user ...
Important: Be sure to set up the server-side implementation as per the instructions here, otherwise uploads will not work. To get started, create a new HTML document. Download the script as per the "Installation" example, and include it in your head tag like so (remebering to replace the ...
Consider the following Java classes: class Foo { private Bar bar; public void foo() { bar.baz(); } } As can be seen, the class Foo needs to call the method baz on an instance of another class Bar for its method foo to work successfully. Bar is said to be a dependency for Foo sin...
The same examples as shown above with XML configuration can be re-written with Java configuration as follows. Constructor injection @Configuration class AppConfig { @Bean public Bar bar() { return new Bar(); } @Bean public Foo foo() { return new Foo(bar()); } } Property in...

Page 972 of 1336