Tutorial by Examples: ee

;;Recursively print the elements of a list (defun print-list (elements) (cond ((null elements) '()) ;; Base case: There are no elements that have yet to be printed. Don't do anything and return a null list. (t ;; Recursive case ;; Print the next elem...
Find div with id="article" and strip out all the inner script tags. #!/usr/bin/env stack -- stack --resolver lts-7.1 --install-ghc runghc --package text --package lens --package taggy-lens --package string-class --package classy-prelude {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE O...
HanlderManager providing: public class HandlerManagerProvider { private static HandlerManager handlerManager; private HandlerManagerProvider() { } public static HandlerManager get() { return handlerManager != null ? handlerManager : (handlerManager =...
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
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...
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 ...
Private Sub Get_Last_Used_Row_Index() Dim wS As Worksheet Set wS = ThisWorkbook.Sheets("Sheet1") Debug.Print LastRow_1(wS) Debug.Print LastRow_0(wS) End Sub You can choose between 2 options, regarding if you want to know if there is no data in the worksheet :...
The Memory Model is difficult to understand, and difficult to apply. It is useful if you need to reason about the correctness of multi-threaded code, but you do not want to have to do this reasoning for every multi-threaded application that you write. If you adopt the following principals when wri...
You can save the error if you want to use it in the rescue clause def divide(x, y) begin x/y rescue => e puts "There was a %s (%s)" % [e.class, e.message] puts e.backtrace end end > divide(10, 0) There was a ZeroDivisionError (divided by 0) from ...
select :start_value + level -1 n from dual connect by level <= :end_value - :start_value + 1
TERMINATE report-1 report-2 report-summary
This document explains how to display your GitHub feeds/timeline on your website. Example: A live example is available at: https://newtonjoshua.com GitHub timeline: GitHub provides the public timeline for any user in Atom format. You can view your timeline at: https://github.com/{{GitHub...
In the following example there are 2 Screens: SettingsScreen and MenuScreen Using the first button, on the current screen will change your screen to the other screen. Here is the code: from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import ScreenManager, Scr...
update <SCHEMA_NAME>.<TABLE_NAME_1> AS A SET <COLUMN_1> = True FROM <SCHEMA_NAME>.<TABLE_NAME_2> AS B WHERE A.<COLUMN_2> = B.<COLUMN_2> AND A.<COLUMN_3> = B.<COLUMN_3>
Monthwise difference between two dates(timestamp) select ( (DATE_PART('year', AgeonDate) - DATE_PART('year', tmpdate)) * 12 + (DATE_PART('month', AgeonDate) - DATE_PART('month', tmpdate)) ) from dbo."Table1" Yearwise difference between two dates...
<?php echo get_field('my_field_name'); ?> This will echo the value of the field "my_field_name" from the current post.
Lunch application for testing override func setUp() { super.setUp() let app = XCUIApplication() app.launch() } Terminating application func testStacOverFlowApp() { app.terminate() }
sample json to update { "student":{"name":"Rahul", "lastname":"sharma"}, "marks":{"maths":"88"} } To update the elements value in the json we need to assign the value and update. try { // Create a new in...

Page 37 of 54