For all example code in this page, ospgrillage is imported as og
import ospgrillage as og
Defining loads¶
Loads are created with the interface function create_load()
.
Users pass argument for type= to specify the load type.
Available loads types include Point, Line, and Patch loads.
Each load type requires user to specify its load point(s).
This is achieved by create_load_vertex()
function.
This function creates a LoadPoint(x,y,z,p) where x,`y`,`z` are the coordinates of the load point and p is the magnitude of the vertical loading.
Note, p is a unit magnitude which is interpreted differently based on the load type - this will be later explained.
By default, y is 0 i.e. the grillage model plane.
point_load_location = og.create_load_vertices(x=5, z=2, p=20) # create load point
Depending on the load type, a minimum number of LoadPoint
namedTuple are required.
These are set to each load type’s point#= variable for the load type’s coordinate system, where # is a digit from 1 to 9.
Following sections will further elaborate the load vertices for each load type.
Loads are generally defined in the global coordinate system with respect to the created grillage model. However, a user-defined local coordinate system is required when defining Compound load later on.
Nodal loads¶
Nodal loads are load applied directly onto nodes of grillage model.
Nodal loads are defined using create_load()
, specifying type= "nodal"
.
There are six degrees-of-freedom (DOFs) for acting loads in each node of the grillage model.
Nodal loads do not require a load vertex, instead it requires a NodalForce(Fx,Fy,Fz,Mx,My,Mz) namedtuple. The following example creates a NodalForce namedtuple and a nodal load on Node 13 of a model, with 10 unit force in both transverse X and Y directions.
nodalforce = og.NodalForce(Fx=10,Fy=10)
node13force = og.create_load(type="nodal",name="nodal 13", node_force=nodalforce) # load values in other dofs default to 0
Note
Users only have to specify non-zero load values for the desire DOFs for NodalForce. Any non-specified component are defaulted to zero.
Point Loads¶
Point load is a force applied on a single infinitesimal point of the grillage model. Point loads are used represent a large range of loads, such as truck axle, or superimposed dead load on a deck.
Point loads are created using create_load()
, passing type = "point"
.
Point load takes only a single LoadPoint tuple. p in the tuple should have units of force (eg. N, kN, kips, etc)
- see Figure 2.
The following example code creates a 20 force unit point load located at (5,0,2) in the global coordinate system.
point_load_location = og.create_load_vertices(x=5, z=2, p=20) # create load point
point_load = og.create_load(type="point",name="single point", point1=point_load_location)
Line Loads¶
Line loads are loads exerted along a line. Line loads are useful to represent loads such as self weight of longitudinal beams or distributed load along beam elements.
Line loads are instantiated with create_load()
passing type = "line"
and required at least two LoadPoint`s (corresponds to the start and end of the line load) - see Figure 3.
Using more than two tuples allows a curve line loading profile.
`p in the LoadPoint
tuple should have units of force per distance (eg. kN/m, kips/ft, etc).
The following example code is a constant Two force per distance unit line load (UDL) in the global coordinate system from -1 to 11 distance units in the x-axis and along the position in the z-axis at 3 distance units.
barrier_point_1 = og.create_load_vertices(x=-1, z=3, p=2)
barrier_point_2 = og.create_load_vertices(x=11, z=3, p=2)
Barrier = og.create_load(type="line", name="Barrier curb", point1=barrier_point_1, point2=barrier_point_2)
Note
As of release 0.1.0, curved line loads are not available.
Patch loads¶
Patch loads are useful to represent loads distributed uniformly over a certain area such as traffic lanes.
Patch loads are instantiated create_load()
, specifying type = "patch"
.
Patch load requires at least four LoadPoint
tuple (corresponds to the vertices of the patch load) - see Figure 4.
Using eight tuples allows a curve surface loading profile.
p in the LoadPoint
tuple should have units of force per area.
The following example code creates a constant 5 force per area unit patch load in the global coordinate system.
lane_point_1 = og.create_load_vertices(x=0, z=3, p=5)
lane_point_2 = og.create_load_vertices(x=8, z=3, p=5)
lane_point_3 = og.create_load_vertices(x=8, z=5, p=5)
lane_point_4 = og.create_load_vertices(x=0, z=5, p=5)
Lane = og.create_load(type="patch",name="Lane 1", point1=lane_point_1, point2=lane_point_2, point3=lane_point_3, point4=lane_point_4)
Note
As of release 0.1.0, curved patch loads are not available.
Compound loads¶
Two or more of the basic load types can be combined to form a Compound load. All load types are applied in the direction of the global \(y\)-axis. Loads in other directions and applied moments are currently not supported.
To create a compound load, use the create_compound_load()
function.
This function creates a CompoundLoad
object.
Compound load are typically defined in a local coordinate system and then set to global coordinate system of the grillage. Figure 5 shows the relationship and process of mapping local to global system of a compound load.
The following code creates a point and line load which is to be assigned as a Compound load.
# components in a compound load
wheel_1 = og.create_load(type="point", point1= og.create_load_vertices(x=0, z=3, p=5)) # point load 1
wheel_2 = og.create_load(type="point", point1= og.create_load_vertices(x=0, z=3, p=5)) # point load 2
The following code creates a Compound load and adds the created Loads
objects (Point, Line, Patch) object to the Compound load object:
C_Load = og.create_compound_load(name = "Axle tandem") # constructor of compound load
C_Load.add_load(load_obj=wheel_1) # add wheel_1
C_Load.add_load(load_obj=wheel_2) # add wheel_2
After defining all required load objects, CompoundLoad
requires users to define the global coordinate to map the origin of user-defined local coordinates
to the global coordinate space.
This is done using set_global_coord()
function as seen in Figure 5, passing a `Point(x,y,z)`
namedTuple.
If not specified, the mapping’s reference point is default to the Origin of coordinate system i.e. (0,0,0).
The following example sets the local Origin of the compound load, including all load points for all load objects of C_load by x + 4, y + 0 , and z + 3.
C_Load.set_global_coord(Point(4,0,3))
Coordinate System
When adding each load object, the CompoundLoad
class allow users to input a load_coord=
keyword argument.
This relates to the load object - whether it was previously defined in the user-defined local or in the global coordinate system.
The following explains the various input conditions
Note
Compound loads require users to pay attention between basic and global coordinate system (see ModuleDoc for more information on coordinate systems)
At the current stage, the CompoundLoad
parses the load object within local coordinate system.
When pass as input into LoadCase
, the Compound load’s vertices / load points are automatically converted to global coordinates, based on the inputs of set_global_coord
function
Load cases¶
Load cases are a set of load types (Point, Line, Patch, Compound load) used to define a particular loading condition. Compound loads are treated as a single load group within a load case having same reference points (e.g. tandem axle) and properties (e.g. load factor)
After load type objects are created, users add the load objects to LoadCase
class objects.
First, users instantiates a LoadCase
class object and giving it its name.
DL = create_load_case(name="Dead Load")
Users then pass load objects as input parameters using add_load_groups()
function.
The following code line shows how the above load types are added to DL load case.
DL.add_load_groups(point_load) # each line adds individual load types to the load case
DL.add_load_groups(Barrier)
DL.add_load_groups(Lane)
After adding loads, the LoadCase
object is added to grillage model for analysis using the
add_load_case
. of OspGrillage
class.
Users repeat this step for any defined load cases.
example_bridge.add_load_case(DL) # adding this load case to grillage model
Moving load¶
For moving load analysis, users create moving load objects using MovingLoad
class.
The moving load class takes a load type object (Point, Line, Patch, Compound load) and moves the load through a path points described by a Path
object.
Figure 6 summarizes the relationship between moving loads, paths and the position of the loads on the grillage model.
Moving path¶
Path
object is created using create_moving_path()
.
Path
requires two namedTuple Point(x,y,z)
to describe its start and end position.
The following example creates a path from 2 to 4 distance units in the global coordinate system.
single_path = og.create_moving_path(start_point=og.Point(2,0,2), end_point= og.Point(4,0,2))
Creating moving load¶
The following example code creates a compound load consisting of two point loads moving along the defined single_path
# create components of compound load
front_wheel = og.create_load_vertices(x=0, z=0, p=6)
back_wheel = og.create_load_vertices(x=-1, z=0, p=6)
Line = og.create_load(type="line",point1=front_wheel,point2=back_wheel)
tandem = og.create_compound_load("Two wheel vehicle")
move_line = og.create_moving_load(name="Line Load moving") # moving load obj
move_line.set_path(single_path) # set path
move_line.add_loads(load_obj=Line) # add compound load to moving load
From here, use the add_load_case()
function of the OspGrillage
to add the moving load.
Here, the function automatically creates multiple incremental load cases each of which corresponds to the incremental load positions along the moving path.
example_bridge.add_load_case(move_point)
Advance usage¶
All basic load added to a MovingLoad
class via add_loads()
function
are assigned with a single common Path
object.
MovingLoad
allows a more advance usage whereby individual moving path can be set to each basic load within MovingLoad
.
For this, the setup for MovingLoad
requires definition of a global_increment
parameter which ensures each unique
Path
object of basic load has the same global_increment
.
Following, each basic load added via add_loads()
takes a second argument path_obj
, which is its corresponding Path
object.
Following example shows this procedure:
# create moving load with global increment of 20 for all unique moving path
moving_load_group = og.create_moving_load(name="Line Load moving",global_increment=20)
# add load + their respective path
move_load_group.add_loads(load_obj=truck_a,path_obj=path_a)
move_load_group.add_loads(load_obj=truck_b,path_obj=path_b)
Running analysis¶
Once all defined load cases (static and moving) have been added to the grillage object, analysis can be conducted.
To analyse load case(s), users run the class function analyze()
.
By default analyze()
will run all defined load cases.
If users wish to run only a specific set of load cases, pass a list of load case name str to loadcase=
keyword.
This will analyse all load cases of the list.
Following example shows the various options for analyze()
.
# analyze all
example_bridge.analyze()
# or a single str
example_bridge.analyze(load_case="DL")
# or a single element list
example_bridge.analyze(load_case=["DL"])
# or a list of multiple load cases
example_bridge.analyze(load_case=["DL","SDL"])


Developed by Francisco Ramalho
LinkedIn | GitHub
This site was created to showcase the developer's skills and experience. The iSoda brand is a factitious brand and was created just for this demo site.


RANK ENGINE
ScotRail will dump human waste on tracks next year despite stopping the process two years ago
by Chris MussonUNDER-fire ScotRail will dump sewage onto tracks next year even though the practice should have been flushed out two years ago.
Nine old trains will drop human waste on lines in 2020 it emerged due to delays on carriages equipped with “retention tanks”.
Union bosses have slammed the firm over fears track workers could get sick from the poo.
ScotRail ended the process in 2017 but reintroduced old stock as a stop-gap due to a new fleet of refurbed InterCity trains being postponed.
The RMT union’s organiser Mick Hogg said: “We’re livid this promise has been broken.
“Why should our members be subjected to these disgusting conditions, being spra-yed by foul waste, as they do their work.”
All UK rail operators were meant to halt the practice by 2020 but ScotRail blamed suppliers after they admitted they will miss the deadline.
Tory Jamie Greene said: “It’s important we consider the impact this has on the track workers and the wider effects on the environment.”
The Dutch-based firm — who’ve got flak over delays, cancellations and service — was meant to have 26 renovated trains by December 2018. But only eight arrived.
ScotRail spokesman said: “We’re working with suppliers to ensure our fleet’s completed as soon as possible.”
Network Rail added: “There are a few companies given a bit more time. We are tracking their actions closely.”
We told last month how ScotRail bosses apologised after a passenger complained about "human zoo" toilets on the trains.
Scottish Labour said ScotRail had cancelled 75,000 trains since Abellio took over.
chris.musson@ the-sun.co.uk


Okinawa Marathon
Okinawa-shi JPN
Website: www.okinawa-marathon.com
Race Winners
(63 runnings)
19
Feb 2012 2:23:38 2:46:45 20 Feb
2011 2:25:53 2:46:55 07
Mar 2010 2:28:57 2:45:29 22 Feb
2009 2:24:05 2:49:22 2:48:46 25 Feb
2007
2:28:43
2:47:04
26 Feb
2006
2:21:19
2:50:51
27 Feb
2005
2:27:48
3:02:25
22 Feb
2004
2:24:14
3:03:23
16 Feb
2003
2:25:10
3:08:26
17 Feb
2002
2:26:44
2:56:45
18 Feb
2001
2:22:32
2:53:40
20 Feb
2000
2:23:21
2:57:38
21 Feb
1999
2:21:01
2:54:33
15 Feb
1998
2:23:23
2:53:36
16 Feb
1997
2:20:26
2:46:12
18 Feb
1996
2:21:08
2:42:17
19 Feb
1995
2:25:13
2:43:02 20 Feb
1994
2:24:27
2:44:49
07 Mar
1993
2:25:35
3:06:18 08 Mar
1992
2:36:20
24 Feb 1991
2:31:16
25 Feb
1990
2:29:32
21 Mar
1989
2:35:13
28 Feb
1988
2:33:04
22 Feb
1987
2:34:46
23 Feb
1986
2:28:12
24 Feb
1985
2:32:20
26 Feb
1984
2:26:19
27 Feb
1983
2:28:09
28 Feb
1982
2:30:36
01 Mar
1981
2:39:00
02 Mar
1980
2:28:55
25 Feb
1979
2:23:30.4
26 Feb 1978
2:29:19.8
20 Feb
1977
2:25:33.2
22 Feb
1976
2:23:39.6
23 Feb
1975
2:31:51.8
24 Feb
1974
2:32:06.4
25 Feb
1973
2:28:11.4
27 Feb
1972
2:22:03
07 Mar
1971
2:20:22
08 Mar
1970
2:21:35
09 Mar
1969
2:30:12
10 Mar
1968
2:29:49
05 Mar
1967
2:26:23
13 Mar
1966
2:31:45
21 Mar
1965
2:33:54
28 Mar
1964
2:34:43
24 Mar
1963
2:42:28
25 Mar
1962
2:28:22
15 Apr
1961
2:34:36
19 Mar
1960
2:42:12
22 Mar
1959
3:03:41
23 Feb
1958
2:37:09
24 Feb
1957
2:42:59
26 Feb
1956
3:39:19
27 Feb
1955 3:25:16
Notes: 1955 was the inaugural year. This race was known as the Shinpo Naha Marathon thru 1991. The venue for 1992
and earlier was Naha.
19
Feb 2017
2:27:09
Thomas Frazer (IRL)
2:47:40
Eri Suzuki (JPN)
21 Feb
2016
2:28:09
Rui Ueda (JPN)
2:47:51
Ayaka Fujimoto (JPN)
15 Feb
2015
2:25:19
Takahiko Onishi (JPN)
2:40:34
Chika Nakama (JPN)
16 Feb
2014
2:26:12
Takuro Nakanishi (JPN)
3:01:25
Ayano Ikehara (JPN)
17
Feb 2013
2:23:58
Tomonori Onitsuka (JPN)
3:03:35
Hisako Sasaki (JPN)
Takahiro Nakama-2
Takako Yamada (JPN)
Takahiro Nakama (JPN)
Mariko Asato-4
Nagamasa Taira (JPN)
Mariko Asato-3
Akira Kuboka-2
Mariko Asato-2
24 Feb
2008
2:25:12
Akira Kuboka (JPN)
Mariko Asato (JPN)
Ryuji Suematsu (JPN)
Chisato Washio-2
Ryo Murazato (JPN)
Chisato Washio (JPN)
Koji Koyanagi-3
Sayuri Kino (JPN)
Tomotsugu Yamauchi-2
Yayoi Taira-2
Tomotsugu Yamauchi (JPN)
Yayoi Taira (JPN)
Masaki Higa (JPN)
Yoriko Miyagi (JPN)
Hideto Yamashita (JPN)
Maya Otaguro (JPN)
Koji Koyanagi-2
Yukie Shimabukuro-2
Kazutaka Higuchi (JPN)
Yukie Shimabukuro (JPN)
Yuji Yanagibashi (JPN)
Aki Furuta (JPN)
Haruo Inoue (JPN)
Reiko Kakuta (JPN)
Koji Koyanagi (JPN)
Tomoko Kai (JPN)
Noboru Shimoda (JPN)
Riu-xia Zhu-2
Akira Zayasu (JPN)
Riu-xia Zhu (CHN)
Yoshitaka Yanagi (JPN)
Keiko Daimon (JPN)
Naoki Banba (JPN)
Kiyotake Hirata-2
Akira Miyazato (JPN)
Tokuhiro Uekado (JPN)
Michito Muroi-2
Tomoya Edakawa (JPN)
Kiyotake Hirata (JPN)
Michito Muroi (JPN)
Seiji Tateishi (JPN)
Toshiro Matsuo (JPN)
Takehiko Kikuchi (JPN)
Sachio Goto (JPN)
Kazunori Fukuoka (JPN)
Tadashi Matsumoto (JPN)
Kenichi Yamamoto (JPN)
Noriyasu Mizukami (JPN)
Yasushi Morita (JPN)
Tetsuo Shiroma (JPN)
Masami Nagano (JPN)
Akio Yoshida (JPN)
Shigeru Kawaida (JPN)
Yoshinobu Kitayama (JPN)
Yoshiaki Morita (JPN)
Morio Shigematsu (JPN)
Yoshitaka Masumitsu (JPN)
Masanao Haranishi (JPN)
Hidekuni Hiroshima (JPN)
Seiichi Inagaki (JPN)
Mitsuhiro Tamashiro (JPN)
Eizo Hirata (JPN)
Yoshikazu Funasako (JPN)
Hiroshi Uwa (JPN)
Toshio Hashiguchi (JPN)
Kenji Fujiki (JPN)
Tameo Tokishi (JPN)
Nagahito Ishigaki (JPN)
Takeshi Niigaki (JPN)
Nasayasu Tawada (JPN)
Most Wins
(1955-date)
Men
3
Koji Koyanagi (JPN)
1996,2000,2005
Women
4
Mariko Asato (JPN)
2008-11
Prize Money
(ADR qualified runners)
No information on prize money has been received for this race.
Race Time Bias
(sec/km)
Insufficient data to calculate the race time bias.
Competitive Level
(1990-date)
Insufficient data to calculate the competitive level.
Quality Performances
Men No men have run under 2:20 Women <2:42 1 <2:44 2 <2:46 5 <2:48 13 <2:50 15
Last Updated on
19 Feb 2017
Contributors: Shigenobu Ota (50), Klaas Loonstra (10), Juraj Gasparovic (1), Brett Larner (20)


{% extends "layout.html"%} {% block content %} {% block body%}
Highlights from my work
Radar interferometry analysis of 2020 Masbate Earthquake in the Philippines
Generated interactive web map to visualize traffic acicdent data mined from Twitter
Time-series of mechanical breakdowns in Metro Manila. Data mined from Twitter.
Network analysis of P2P bus routes in Metro Manila in May 2018
Wordcloud containing one hour of #duterte
Processing mined Twitter traffic accident data


I run a successful freelance design company. I love my work and my clients, and it’s been an incredible adventure.
But it’s time for a change. I am currently looking for work.


| | |
Methods defined here:
- __check_block__(self, block)
- This returns true if the set of numbers contains 1-9 and is valid for the sudoku solution.
:param block:
:return:
- __check_column__(self, column)
- This function checks if the column is valid.
:param column:
:return:
- __check_row__(self, row)
- This function checks if the row is valid.
:param row:
:return:
- __check_square__(self, row, column)
- This function checks if the square is valid.
:param row:
:param column:
:return:
- __init__(self)
- When you create a SudokuGame instance. Use the SudokuBoard class to create a new random and valid sudoku board.
- check_win(self)
- This puzzle checks if the player has won. This is done with helper functions.
:return:
- new_game(self, remaining)
- This function creates a new board and fills in the start_puzzle.
The param remaining stands for the amount of numbers should be left on the board.
:param remaining:
:return:
- start(self)
- This puzzle fills in the game puzzle based on the given start_puzzle.
This is separated for further use of the starting puzzle.
:return:
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|


Navigating a QR image¶
Opening the fits file¶
odi-tools
utilizes the fits.io
module in the astropy
package to
open the multi-extension QR fits files:
>>> from astropy.io import fits
>>> img = '20140406T214040.2_GCPair-F1_odi_g.6183.fits'
>>> hdulist = fits.open(img)
Accessing the extensions¶
hdulist
is now an astropy
HDUlist where each element
cooresponds to an extension of the fits file.
>>> print hdulist.info()
Filename: 20140406T214040.2_GCPair-F1_odi_g.6183.fits
No. Name Type Cards Dimensions Format
0 PRIMARY PrimaryHDU 294 ()
1 OTA33.SCI ImageHDU 285 (4096, 4096) float32
2 OTA34.SCI ImageHDU 285 (4096, 4096) float32
3 OTA44.SCI ImageHDU 285 (4096, 4096) float32
4 OTA43.SCI ImageHDU 285 (4096, 4096) float32
5 OTA42.SCI ImageHDU 285 (4096, 4096) float32
6 OTA32.SCI ImageHDU 285 (4096, 4096) float32
7 OTA22.SCI ImageHDU 285 (4096, 4096) float32
8 OTA23.SCI ImageHDU 285 (4096, 4096) float32
9 OTA24.SCI ImageHDU 321 (4096, 4096) float32
10 CAT.2MASS BinTableHDU 15 680R x 2C [D, D]
11 CAT.ODI BinTableHDU 138 562R x 33C [D, D, E, E, E, E, E, I, I, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E]
12 CAT.ODI+2MASS BinTableHDU 31 165R x 5C [D, D, D, D, E]
13 CAT.PHOTCALIB BinTableHDU 172 251R x 36C [D, D, D, D, E, E, E, E, E, E, E, E, E, E, D, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E]
14 SKYLEVEL BinTableHDU 50 1663R x 7C [D, D, D, D, D, D, I]
15 ASSOCIATIONS BinTableHDU 17 16R x 3C [25A, 375A, 100A]
This particular image is from podi
meaning there are a total of 9 OTAs in
the focal plane. In the hdulist
the extensions for each of the OTAs are
given in rows 1-9 and have names with the following convention OTAxy.SCI
.
For a 5x6 ODI
image, there would be 30 of these extensions.
The hdulist
allows us to access each of the extensions by the its name
give in the Name column, or by its number. If, for example, we wanted to only
look at OTA33
we can do the following:
>>> hdu_ota = hdulist['OTA33.SCI']
# or using the number
>>> hdu_ota = hdulist[1]
Now that we have isolated this single OTA we can pick out its individual header and data:
>>> ota_header = hdu_ota.header
>>> ota_data = hdu_ota.data
ota_header
and ota_data
are now easily accessible to use in other
scripts and modules. It is also easy to access header
keywords:
>>> print ota_header['CRVAL1']
198.750082573
>>> print ota_header['CRVAL2']
18.4113084341
It is also convenient to pass individual OTAs to pyraf
tasks based on the
name of the extension. If we wanted to run daofind
on OTA33 we could do
the following:
>>> from pyraf import iraf
>>> img = '20140406T214040.2_GCPair-F1_odi_g.6183.fits'
>>> iraf.unlearn(iraf.apphot.daofind)
>>> iraf.datapars.setParam('fwhmpsf',fwhm,check=1)
>>> iraf.datapars.setParam('datamin',-900,check=1)
>>> iraf.datapars.setParam('datamax',60000,check=1)
>>> iraf.datapars.setParam('sigma',25.,check=1)
>>> iraf.findpars.setParam('threshold',2.5)
>>> iraf.apphot.daofind.setParam('output',output.txt)
>>> iraf.apphot.daofind(image=img+'['+'OTA33.SCI'+']', verbose="no", verify='no')
The odi-tools scheme¶
The modules in odi-tools
are designed to work over lists of images while
stepping through each of the OTA extensions in a given image. This will
discussed in further detail in other parts of the documentation. An pseudo
code of this scheme would be:
>>> imglist = ['img1.fits','img2.fits','img3.fits']
>>> ota_dictionary = {1:'OTA33.SCI',2: 'OTA34.SCI',3 :'OTA44.SCI',
... 4:'OTA43.SCI',5:'OTA42.SCI', 6:'OTA32.SCI',
... 7:'OTA22.SCI' ,8:'OTA23.SCI',9:'OTA24.SCI'}
>>> for img in imglist:
... for key in ota_dictionary:
... ota = ota_dictionary[key]
... perform tasks on img[ota]
The other extensions¶
In addition to the extensions for each OTA, the hdulist
also contains
extensions linking to fits tables with useful information. They are
CAT.2MASS
, CAT.ODI
, CAT.ODI+2MASS
, CAT.PHOTCATLIB
, SKYLEVEL
,
ASSOCIATIONS
. The header and data in each of these tables are easily accessed.
>>> photcat_data = hdulist['CAT.PHOTCATLIB'].data
>>> photcat_header = hdulist['CAT.PHOTCATLIB'].header
Some of the information in these tables is used by odi-tools
during the
image processing.


When you work with us, you are part of a team of collaborators.All aspect of our software development process are integreted,interactive and
agile
Our approach unifies design,development and project management to create exceptional products.
We start each project by understanding your bussiness goals, the user's needs and reqiurements.
Then we help them translate them into effective and elegent solutions.
Our design practice offers a full range of services
including brand strategy, interaction and visual design and
user experience testing.
Throughout your project, our designers create and
implement visual design and workflows, solicit user
feedback and work with you to make sure what gets built
is what is needed.
Planning and development is iterative.Because we are constantly
coding and testing, the products we build are
always ready to go live
This iterative process allows as business
reqiurements evolve.


---
title: Probabilistic and Differentiable Programming
ref: probabilistic-programming
image: data.png
description: This project consists of research on building efficient probabilistic solvers and applying existing probabilistic solvers to different practical application domains, such as security and computer networks.
---
Systems
{% include card.html
title="PSI solver"
output="vertical"
url="https://psisolver.org/"
image="/assets/systems/psi_logo.png"
description="PSI is a probabilistic solver that takes as input a probabilistic program and automatically computes the exact probability density function (PDF) represented by that program"
%}
{% include card.html
title="SPIRE"
output="vertical"
url="https://github.com/eth-sri/Spire"
image="/assets/systems/spire-logo.png"
description="SPIRE is a synthesis system that automatically transforms a program into one that complies with a given privacy policy"
%}
{% include card.html
title="DP-Finder"
output="vertical"
url="https://github.com/eth-sri/dp-finder"
image="/assets/systems/dpfinder-logo.png"
description="DP-Finder is a system that automatically derives lower bounds on the differential privacy enforced by algorithms"
%}
Publications
{% include get-publications.html filter="project" key="probabilistic-programming" %}


The Spry HTML Panel Widget is used to load and inject remote HTML content into a specific container on the page. The HTML Panel Widget can load a fragment file: a file with no HTML or BODY tags; just a small piece of HTML, or it can load the contents of an element with a specific id from a full HTML page.
The widget structure consists of a single container element, which can be any block or inline container, unless otherwise noted below. The widget container element can contain static markup/content, or contain no content at all. If widget container has static markup/content, this content will be discarded if the widget is told to load remote HTML content.
The following tags cannot be used for the panel, since InnerHTML is locked for these tags:
A basic example that uses an HTML panel would be:
Fragment-1

This is some static content within an HTMLPanel container. It will disappear once content is loaded into the panel via one of the links above.

In the example above, an HTML Panel widget is created an bound to the
 container element with the id of "samplePanel". If the user clicks on the link, it will trigger the HTML Panel to load some remote/external HTML content from a file named "frag-01.html".
Widget Constructors are small pieces of javascript that activate the markup into the working widget. These scripts must come AFTER the markup on the page, since the markup needs to exist before the constructor fires.

A basic constructor specifies the name of the widget and identifies the ID of the main markup container. The name of the widget is used to identify the widget for functions and methods.

Constructor options allow users to specify certain attributes of the widget.
Constructor options follow the ID parameter, wrapped in curly braces {}. Options are name:value pairs, separated by a colon (:).
| Option | Type | Default | Description |
|---|---|---|---|
| evalScripts | Boolean | true | Determines if
Recall that javascript is case sensitive.
| Notification | Description |
|---|---|
| onPreLoad | The HTML Panel is about to load a new HTML Fragment. An object that describes the load request will be passed to all observers. This object will have the following properties:
This object may also contain other optional properties specified by the user during the call to loadContent(), which may include:
It should be noted that observers are allowed to modify this object to alter the loading behavior. For example, observers can use this notification to tack on extra query parameters to the URL or postData, or even add username/password info. |
| onPostLoad | The HTML Panel has successfully loaded the new HTML Fragment. An object that describes the load request will be passed to all observers. This object will contain the same properties as those listed above for the onPreLoad notification, but will also contain the following properties:
|
| onPreUpdate | The content within the region container is about to be updated/replaced. An object with the following properties will be passed to all observers:
It should be noted that observers are allowed to modify the data in this object to alter the actual content that is inserted into the region container. |
| onPostUpdate | The content within the region container has been updated. The same object passed during the onPreUpdate notification is passed to the observers for this notification. |
| onLoadError | The request for the HTML Fragment failed. An object that describes the load request will be passed to all observers. This object contains the same properties as those listed for the onPreLoad notification, but will also contain the following properties:
|
| onLoadCancelled | The request for the HTML Fragment was canceled. An object that describes the load request will be passed to all observers. This object contains the same properties as those listed for the onPreLoad notification, but will also contain the following properties:
|
Adds an observer to the region. As with other components within Spry, the observer can be either an object or a function callback.
widgetName.addObserver(observer);

Cancels the currently loading content
widgetName.cancelLoad();
If a pending request is cancelled, this method will result in the following notifications:
Stop Loading
Disables the notification of observers.
widgetName.disableNotifications();
Disable Notifications
Enables observer notifications.
Notifications are enabled by default within an HTML Panel.
widgetName.enableNotifications();
Enable Notifications
Spry.Widget.HTMLPanel.evalScripts is a global variable that lets the developer decide whether all HTML Panel widgets will be able to execute script, embedded within HTML fragments, they load or not. The default value is false. This setting can be overridden for a specific HTML Panel by specifying the evalScripts constructor option when its constructor is invoked.
Spry.Widget.HTMLPanel.evalScripts

Loads a frag or part of a page into the widget.
widgetName.loadContent(url, options);
url: the path to the fragment or page to be loaded.
// Example of creating a header object the literal way: var header = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }; // Example of creating a header object manually: var header = new Object; header["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
Calling this method will result in the following notifications:
The notifications above are listed in the order that they should fire. Should the load fail, an onLoadError notification will be fired in place of an onPostLoad notification.
If the HTML Panel is in the midst of loading content when this method is called. The previous load request is cancelled prior to making the new request.
Load Frag 1 Load Frag 2 Load Products
Removes the specified observer from the widget's list of observers. The same observer function or object that was used for the addObserver() call must be used in a call to removeObserver().
widgetName.removeObserver(observer);

Removes any CSS Behavior class names from the region container element.
widgetName.removeStateClasses();
Reset Classes
Replaces the contents of the region container with the content in the specified html fragment string.
widgetName.setContent(htmlString, id);
Calling this method will result in the following notifications:
<input type="button" onclick="panelWidget.setContent('This is strong text');">
Copyright 2007, Adobe Systems Inc.


In this post, I want to explore an alternative motivation to the classical Newton's method in optimization. This post was inspired by Frostig et al.'s recent COLT paper, where they consider norms of the form $\| x \|_Q^2 := x^T Q x$, where $Q$ is a positive definite matrix (this paper actually has nothing to do with Newton's method; their choice of the $\| \cdot \|_Q$ norm is to aid in recovering tighter constants in their analysis).
Let me first motivate Newton's method classically. Suppose we want to minimize a twice-differentiable function $f : \mathbb{R}^{n} \longrightarrow \mathbb{R}$. Let us assume the Hessian is everywhere invertible (e.g. we can assume our function is strongly convex). Newton's method proceeds by iterating the mapping $$ x_{t+1} \gets x_{t} - \nabla^2 f(x_t)^{-1} \nabla f(x_t) \:. $$ The usual interpretation is that Newton's method is exactly minimizing a quadratic approximation to the function $f$. Specifically, by Taylor's theorem, we have that for all $x, y$, $$ f(y) = f(x) + \nabla f(x)^T (y - x) + \frac{1}{2} (y-x)^T \nabla^2 f(x) (y-x) + o(\| y-x \|^3) \:. $$ Putting $g(y)$ as $$ g(y) := f(x) + \nabla f(x)^T (y - x) + \frac{1}{2} (y-x)^T \nabla^2 f(x) (y-x) \:, $$ a simple calculation shows that $\arg\min_{y} g(y) = x - \nabla^2 f(x)^{-1} \nabla f(x)$, which is the same form as the Newton update.
Now, let us motivate Newton's method as a form of gradient descent in a particular Hilbert space. For any positive definite matrix $Q$, it is easy to check that $\langle x, y \rangle_Q := x^T Q y$ is a valid inner product. This inner product induces the norm $\| \cdot \|_Q$ defined above, and hence we can equip $\mathbb{R}^{n}$ with this inner product to define a Hilbert space. Now the natural question is, what does a gradient look like in this space? This is actually a fairly deep question, and bits of functional analysis and Riemannian geometry address this question rigorously. A good starting point is the Fréchet derivative, but I will not go into any detail because I am afraid of saying something wrong. Bug your local differential geometrist friend for more details :).
Instead, I will take the engineering approach here. From the Wikipedia page of gradient, we have that the gradient at a point $x$ is the unique vector field whose dot product with any vector $v$ is the directional derivative of $f$ along $v$ at $x$. That is, $\nabla f(x)^T v = D_v f(x)$. We will use this to infer what the gradient in our space is. A simple calculation yields $$ \nabla f(x)^T v = \nabla f(x)^T Q^{-1} Qv = (Q^{-1} \nabla f(x))^T Q v = \langle Q^{-1} \nabla f(x), v \rangle_Q \: $$ Hence, we will, very informally, call the gradient of $f$ at $x$ as $\text{grad} \: f(x) = Q^{-1} \nabla f(x)$, where we reserve $\nabla f(x)$ for the gradient in $\mathbb{R}^n$.
Everything stated so far was for an arbitrary positive definite $Q$. Which $Q$ should we pick? Recall from basic optimization theory that the functions for which gradient descent converges the fastest are functions where the Hessian is identity. In this case, the condition number of the problem is simply one. This motivates our choice for $Q$: let us pick a $Q$ which preconditions the Hessian of the problem in our particular Hilbert space to be as close to identity as possible. Now we simply have to answer, what does the Hessian look like in our space? We can do a similar calculation as above. By Taylor's theorem, for some $t \in [0, 1]$, we have $$ \begin{align*} f(y) &= f(x) + \nabla f(x)^T (y - x) + \frac{1}{2} (y-x)^T \nabla^2 f(tx + (1-t) y) (y-x) \\ &= f(x) + \langle Q^{-1} \nabla f(x), y - x \rangle_Q + \frac{1}{2} \langle y - x, Q^{-1} \nabla^2 f(t x + (1-t) y) (y - x) \rangle_Q \end{align*} $$ Hence, we will, once again very informally, call the Hessian of $f$ at $x$ as $\text{hess} \: f(x) = Q^{-1} \nabla^2 f(x)$, where we reserve $\nabla^2 f(x)$ for the Hessian in $\mathbb{R}^{n}$. Now, from this, the choice of $Q$ is immediate. We want to pick a $Q$ such that the Hessian is the identity, and hence we pick $Q = \nabla^2 f(x)$. Doing this exactly recovers the Newton iteration.


{% extends "includes/layout.html" %} {% block content %} {% include "includes/breadcrumbs.html" %} {% include "includes/title-subtitle.html" %} {% if rights === 'Manager' %} {% set Manager=true %} {% elseif rights === 'System Admin' %} {% set SystemAdmin=true %} {% elseif rights === 'Data Admin' %} {% set DataAdmin=true %} {% else %} {% set Staff=true %} {% endif %} {% include "includes/validation-error-messages.html" %} Which user rights would you like to give {{username}}? Data admin System admin Manager or Staff What is this user's name? For Example, John Smith {% if errors['fullname'][0] %} Error:{{ errors['fullname'][0] }} {% endif %} {% include "includes/csrf-hidden-input.html"%} {% endblock %}
Which user rights would you like to give {{username}}?


class: center, middle, inverse ![Scala](smooth-spiral.png "Scala") #Scala https://twitter.com/purijatin7 --- layout: false .left-column[ ## Overview ] .right-column[ Some Background: - Working primarily in Scala since 2012 - Minor contributor to Scala [Macros](http://scalamacros.org/paperstalks/2014-06-17-EasyMetaprogrammingForEveryone.pdf#page=62) - ~15k points on [Stackoverflow](http://stackoverflow.com/users/894565/jatin) primarily in Scala - Very Involved with community (SIP, SLIP, gitter channels, google groups etc) - Trainer/Consultant with Lightbend Inc - Authoring a book called [Scala Microservices](https://www.packtpub.com/application-development/scala-microservices) with Packt Publishers - Organizer of Scala Hyderabad Meetup [http://hyscala.in](http://hyscala.in) ] --- # Training Schedule 1. Introduction to Scala 2. Get Started 3. REPL 4. Data Types 5. Object Oriented with Scala 5. Imports & Modifiers 6. Singleton Objects 7. case classes 8. Scala Collections --- class: center, middle, inverse #Java is Platform Independent How does it achieve Platform Independence? --- class: center, middle ![Abstraction](ind.jpg "JVM Languages") --- class: center, middle ![Abstraction2](ind2.jpg "JVM Languages") [Java Opcodes- https://en.wikipedia.org/wiki/Java_bytecode_instruction_listings](https://en.wikipedia.org/wiki/Java_bytecode_instruction_listings) --- class: center, middle ![JVM Languages](jvm_lang.jpg "JVM Languages") Source of Image: [Slide Share](http://www.slideshare.net/rokon12/jvm-ecosystem-languages-and-the-future-of-jvm) --- .left-column[ ## Brief History ] .right-column[
- Martin Odersky is the author of Scala Programming Language - Professor at École Polytechnique Fédérale de Lausanne (EPFL) in Switzerland (also the heart of language) - Previously authored Generic Java (and Pizza before) - Author of Javac5. Implemented Generics implementation in javac ] --- .left-column[ ## Intro ] .right-column[ Elevator Pitch: - Its fun - Its fast - It runs on a great VM (JVM) - Commercially has done decent. Encouraging Signs - REPL
- Seamless interoperability with Java
- Scala.js - Brownie Points: Language synonymn for? ] --- .left-column[ ## Intro ## Scala? ] .right-column[ - Multi-Paradigm ([Grand Unified Theory](http://www.drdobbs.com/architecture-and-design/interview-with-scalas-martin-odersky/231001802)) * Pure-bred Object Oriented * Functional
] --- .left-column[ ## Intro ## Get Started ] .right-column[ REPL - Read Evaluate Print Loop ```scala jatin@puri:~$ scala Welcome to Scala 2.12.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_74). Type in expressions for evaluation. Or try :help. scala> 1 + 2 res0: Int = 3 scala> 2 / 3.0 res1: Double = 0.6666666666666666 ``` - To start repl: `scala` on command line (need to setup environment path before that) - REPL reads expressions at the prompt, wraps them in an executable template, and then compiles and executes the result. - Variable are available in scope ```scala scala> res0 res2: Int = 3 scala> res1 res3: Double = 0.6666666666666666 ``` ] --- .left-column[ ## Intro ## Get Started ] .right-column[ REPL - Read Evaluate Print Loop ```scala scala> "Hi Chennai" res4: String = Hi Chennai scala> "Hi" + "Chennai" res5: String = HiChennai scala> "Hi" + " - "+"Chennai" res6: String = Hi - Chennai scala> "Hi" + " - "+"Chennai " + (2 * 11) res7: String = Hi - Chennai 22 scala> ( 1 * 2) + (3+ (4 /6)) res8: Int = 5 scala> 1/2 res9: Int = 0 scala> 1/2.0 res10: Double = 0.5 ``` ] --- .left-column[ ## Intro ## Get Started ] .right-column[ REPL - Names can also be assigned to variables using `val` ```scala scala> val a = 1 a: Int = 1 scala> 2 res0: Int = 2 scala> val c = a * res0 c: Int = 2 ``` - Above `val` can also be thought of as `final` keyword in Java. It cannot be re-assigned ```scala scala> val c = 23 c: Int = 23 scala> c = c+1
:12: error: reassignment to val c = c+1 ``` - Also called Immutable variable ] --- .left-column[ ## Intro ## Get Started ] .right-column[ REPL - Reassign values with `var` ```scala scala> var a = 1 a: Int = 1 scala> a = a + 2 res0: Int = 3 scala> a = -1 c: Int = -1 ``` - Above `var` can be thought of as `non-final` keyword in Java - Also called Mutable Variable - Note just like Java, we can re-assign values but cannot change type ```scala scala> var a = 23 a: Int = 23 scala> a = "chennai"
:12: error: type mismatch; found : String("chennai") required: Int a = "chennai" ^ ``` ] --- .left-column[ ## Intro ## Get Started ] .right-column[ Type Inference ```scala scala> "hi" res11: String = hi scala> 1 res12: Int = 1 scala> 1.0 res13: Double = 1.0 scala> 1L res14: Long = 1 scala> res13 * res12 res15: Double = 1.0 ``` - If you observe, the compiler infers the type automatically and prints them ] --- .left-column[ ## Intro ## REPL ] .right-column[ - Though you can also manually specify type ```scala scala> val a = 23 a: Int = 23 scala> val b: Int = 23 b: Int = 23 ``` - Scala is statically typed. But yet it feels dynamically typed - Best of both worlds ] --- .left-column[ ## Intro ## REPL ] .right-column[ Other useful commands ``` scala> :help All commands can be abbreviated, e.g., :he instead of :help. :quit exit the interpreter :paste [-raw] [path] enter paste mode or paste a file :help [command] print this summary or command-specific help :history [num] show the history (optional num is commands to show) :h?
search the history :imports [name name ...] show import history, identifying sources of names :line
|
place line(s) at the end of history :power enable power user mode :load
interpret lines in a file :edit
|
edit history :replay [options] reset the repl and replay all previous commands :warnings show the suppressed warnings from the most recent line which had any ... ``` Other useful commands ``` use tab for completion. use :help for a list of commands. use :paste to enter a class and object as companions. use :paste -raw to specify a package (no template wrapper). use :javap to inspect class artifacts. use -Yrepl-outdir to inspect class artifacts with external tools. ``` ] --- .left-column[ ## Intro ## REPL ] .right-column[ #E in REPL - What is difference in between: ```java String isEven = (number > 0) ? "true" : "false"; ``` vs ```java String isEven; if(number > 0) isEven = "true"; else isEven = "false"; ``` - Or difference in between: ```java List
ls = new ArrayList
(); ls.add(1); ls.add(2); //vs List
ls = Arrays.asList(1,2); ``` ] --- .left-column[ ## Intro ## REPL ] .right-column[ ## Expression vs Statement - Expressions are some code that yields a result. You can also say that an expression evaluates to a result or results in a value. - Statements are some code that does some action. This action is also called as a side effect. They do not return anything. - In scala, many constructs like `code-blocks`, `if-else`, `method bodies` are expressions ```scala scala> val b = if (n == 0) true else false b: Boolean = false scala> val c = { | val i = 1 | val j = math.pow(2, 10) | i - j | } c: Double = -1023.0 ``` - Above `|` is a prefix by REPL for readability purpose. It is not actual scala code ] --- .left-column[ ## Intro ## REPL ] .right-column[ ## Expression - Expressions always return a value. - In blocks, the last statement of the `code-block` becomes the return value ```scala scala> val c = { | val i = 1 | val j = math.pow(2, 10) | i - j | } c: Double = -1023.0 ``` - Above `i - j` is the last statement, so it becomes the value of `c` - The type of the last statement becomes the type of the target variable ```scala scala> val sqr = { | val a = 1 | val b:Long = 23L | val hi = "hi" | true | } sqr: Boolean = true ``` - What if there are multiple probable statements? ] --- .left-column[ ## Intro ## REPL ] .right-column[ ## Multi Line Statements - `:paste` ```scala scala> :paste // Entering paste mode (ctrl-D to finish) var i = 23; while(i > 0) { if(i % 7 == 0) println(i) i = i - 1 } // Exiting paste mode, now interpreting. 21 14 7 i: Int = 0 ``` - If you observe there are no semi-colons ] --- .left-column[ ## Intro ## REPL ] .right-column[ # If - Else - Structure: ```scala if (simpleExpression) {expression} else {expression} ``` Example: ```scala scala> val num = 23 num: Int = 23 scala> val ans2 = if(num > 0){ | val i = 1 | val j = 2 | i + j | }else{ | val i = 1 | val j = 2 | i - j | } ans2: Int = 3 ``` - `if-else` is itself also an expression ] --- .left-column[ ## Intro ## REPL ] .right-column[ # If - Else Task: - create a val that is `double` by name `rand` - the value should be a random number in between 0 and 100 - you can use `math.random` to get random number between 0 and 1 - create another val `greaterThanFive` boolean. The value of this variable must be `true` if `rand` is greater than or equal to `5`. Else `false` - create another val `isBlue` that must be "blue" string if `greaterThanFive` is true. Else "red" ``` - `if-else` is itself also an expression ] --- .left-column[ ## Intro ## Data Types ] .right-column[ ## Some Basic Data Types ``` Byte 8-bit signed two's complement integer (-27 to 27 - 1, inclusive) Short 16-bit signed two's complement integer (-215 to 215 - 1, inclusive) Int 32-bit signed two's complement integer (-231 to 231 - 1, inclusive) Long 64-bit signed two's complement integer (-263 to 263 - 1, inclusive) Char 16-bit unsigned Unicode character (0 to 216 - 1, inclusive) String a sequence of Chars Float 32-bit IEEE 754 single-precision float Double 64-bit IEEE 754 double-precision float Boolean true or false ``` - Unless specified, it considers an integer as Int. Specify the type for anything specific: ```scala scala> val a = 23 a: Int = 23 scala> val b:Short = 23 b: Short = 23 ``` ] --- .left-column[ ## Intro ## Data Types ] .right-column[ - For Long, like java end value with `l` or `L` ```scala scala> val a = 23 a: Int = 23 scala> val b = 23L b: Long = 23 ``` - The way an integer literal begins indicates the base of the number - If the number begins with a 0x or 0X, it is hexadecimal (base 16), and may contain 0 through 9 as well as upper or lowercase digits A through F. ```scala scala> val hex = 0x5 hex: Int = 5 scala> val hex2 = 0x00FF hex2: Int = 255 scala> val magic = 0xcafebabe magic: Int = -889275714 scala> val prog = 0XCAFEBABEL prog: Long =<PHONE_NUMBER> ``` - Note that the Scala shell always prints integer values in base 10, no matter what literal form you may have used to initialize it. ] --- .left-column[ ## Intro ## Data Types ] .right-column[ Task - create val `a` that is an integer value `42` - create val `b` that is a long value `42` - create val `c` that is a float value `42.0` - create val `d` that is a double value as multiplication of a, b, c - create val `e` that is a short value `42.0` - create val `f` that is a byte value `42.0` - create val `g` that is a hex of number (42) in base 10 ] --- class: center, middle, inverse #Object Oriented with Scala --- .left-column[ ## Intro ## OO ] .right-column[ - Scala is an Object Oriented Language. (purely is debatable) - Every this is an object. There are no primitives - Every operation is a method call ```scala scala> 1 + 2 res1: Int = 3 scala> 1.+(2) res2: Int = 3 ``` - Building blocks are: `classes` and `traits` - Singleton objects are first class ] --- .left-column[ ## Intro ## OO ] .right-column[ # class (Move to Worksheet) - Syntax: ```scala scala> class Animal defined class Animal scala> val a = new Animal a: Animal = Animal@78b7f805 ``` - repl by default prints the `toString` value ] --- .left-column[ ## Intro ## OO ] .right-column[ #class Constructor - By default entire class body is a constructor. Called as `Primary Constructor` ```scala scala> class Animal{ | println("I am Animal") | | if(math.random > 0.5) | println("Iam Male") | else println("I am Female") | } defined class Animal scala> val a = new Animal I am Animal I am Female a: Animal = Animal@38bc5ac0 ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ #class Constructor - You can also provide constructor arguments. But `Primary Customer` always exists ```scala scala> class Animal(name: String, legs: Int) { | println("My name is: "+name+". My leg count: "+legs) | | val hasMoreLegs = legs > 4 | } defined class Animal scala> val a = new Animal("cow",4) My name is: cow. My leg count: 4 a: Animal = Animal@406ad6d5 scala> a.hasMoreLegs res3: Boolean = false ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Task - Create a class called `Fraction` - It must take two arguments: `numerator` and `denominator`. Both of type `Int` - In the constructor body: First print the numerator with text - Then print denominator with text - Then print the fraction part of it. First as string and later as Decimal Sample output on initializing variable: ``` numerator is 12 denominator is 3 Fraction: 12/3. Decimal: 4.0 ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Multiple Constructor - You can provide Multiple Constructors ```scala scala> class Animal(name: String, legs: Int) { | def this(name:String) = this(name, 4) | def this() = this("Animal", 4) | | println("name: "+name+". legs: "+legs) | } defined class Animal scala> scala> val a = new Animal() name: Animal. legs: 4 a: Animal = Animal@2f07930a scala> val a2 = new Animal("dog") name: dog. legs: 4 a2: Animal = Animal@6115846e scala> val a3 = new Animal("dog",4) name: dog. legs: 4 a3: Animal = Animal@aa0dbca ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Fields - Fields keep state - Immutable Fields ```scala scala> class Country{ | val planet = "earth" | } defined class Country scala> (new Country).planet res4: String = earth ``` - Mutable Fields ```scala scala> class Ocean{ | var waterColor = "blue" | } defined class Ocean scala> val ocean = new Ocean ocean: Ocean = Ocean@3a54638b scala> ocean.waterColor = "black" ocean.waterColor: String = black ``` ] .left-column[ ## Intro ## OO ] .right-column[ # Class Parameters - Class parameters are not fields. They are constructor arguments - So they can be used only in the class body. But not from outside ```scala scala> class City(name:String) defined class City scala> val city = new City("Madras") city: City = City@70c31b17 scala> city.name
:13: error: value name is not a member of City city.name ``` - To make class-parameters as fields, add `val` or `var` in front of them ```scala scala> class City(val name:String, var state:String) defined class City scala> val city = new City("Hyderabad", "Andhra Pradesh") city: City = City@66863941 scala> city.name res6: String = Hyderabad scala> city.state = "Telangana" city.state: String = Telangana ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ #require - require() is a pre-condition to be met ```scala scala> class Dog(legs: Int){ | require(legs > 1,"Legs cant be an invalid number") | } defined class Dog scala> new Dog(0) java.lang.IllegalArgumentException: requirement failed: Legs cant be an invalid number at scala.Predef$.require(Predef.scala:277) ... 28 elided ``` - `require` is different from `assert`. assert implies that program has reached an inconsistent state and there may be a problem if the program proceeds furhter - `require` means that the caller of the method is at fault and should fix it ] --- class: middle, inverse #Exercise - 1 - Create a class by name `Time` in `src/main/scala/hyscala/Time.scala` file - It must take 3 fields as constructors: Hours, Minutes, Seconds. It must fail if invalid values - The fields must be accessible from outside. - The values of above 3 arguments, must be valid - Class must be immutable - Add a field by name `minutesOfDay` that returns the number of minutes passed during the day - Access the class from sbt console --- .left-column[ ## Intro ## OO ] .right-column[ #Methods - Signature is of the sorts ```scala def methodName(arg: ArgType, arg2:ArgType2): ReturnType = {expression} ``` - Example: ```scala scala> def double(n:Int): Int = n * 2 double: (n: Int)Int scala> double(1) res15: Int = 2 ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ #Methods - Because the body of the method is an expression itself, there is no need to provide the return type - Compiler can infer the type automatically - Hence Return type is optional ```scala scala> def double(n:Int):Int = n * 2 double: (n: Int)Int scala> def double(n:Int) = n * 2 double: (n: Int)Int ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # class Methods ```scala scala> class Number(val i:Int){ | def add(num: Number) = new Number(i + num.i) | def minus(num: Number) = new Number(i - num.i) | } scala> (new Number(23)).add(new Number(-1)).i res18: Int = 22 ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ Task - In the existing `Fraction` class, override `toString` method - Create a new method `getFraction`. It does not take any parameter and returns double value. - Create the below methods - `+` takes input argument as `Fraction` and returns another Fraction object after adding this and that - `-` takes input argument as `Fraction` and returns another Fraction object after subtracting this and that - `/` takes input argument as `Fraction` and returns another Fraction object after dividing this and that - `*` takes input argument as `Fraction` and returns another Fraction object after multiplying this and that ] --- .left-column[ ## Intro ## OO ] .right-column[ # Default Arguments ```scala scala> class Time(val hours: Int, val minutes:Int = 0, val seconds: Int = 0) defined class Time scala> val time = new Time(23) time: Time = Time@15fe020d ``` - You can provide default arguments - You can try playing around on the pattern on initialization ```scala class Time(val hours: Int=0, val minutes:Int = 0, val seconds:Int) ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Named Arguments ```scala scala> class Time(val hours: Int, val minutes:Int = 0, val seconds: Int = 0) defined class Time scala> val time = new Time(hours = 23, minutes = 12) time: Time = Time@15fe020d ``` - Named arguments help with readability. Especially if there are too many arguments - It is not necessary to provide named arguments compulsorily for all variables. You can mix - Leading arguments can be ignored by giving trailing arguments by name ```scala class Time(val hours: Int=0, val minutes:Int = 0, val seconds:Int) ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Infix operators - Initially we mentioned that ```scala scala> 1 + 2 res22: Int = 3 scala> 1.+(2) res23: Int = 3 ``` - First is a representation of the second. The operator is infix ```scala scala> "#MAGA".charAt(0) res30: Char = # scala> "#MAGA" charAt 0 res31: Char = # ``` - You can omit `dot` and `brackets` - Methods with only one parameter can be used at infix position ] --- .left-column[ ## Intro ## OO ] .right-column[ # Postfix operators ```scala scala> "#MAGA" length res33: Int = 5 ``` - Methods with no parameter can be used at postfix position ] --- .left-column[ ## Intro ## OO ] .right-column[ # Prefix operators ```scala scala> ! true res34: Boolean = false ``` - `! true` gets converted to `true.unary_!`. This is a syntactic sugar - Other supported operators: +, - , ~, ! ] --- .left-column[ ## Intro ## OO ] .right-column[ # Equality ```scala scala> 1 == 2 res35: Boolean = false ``` - `==` is syntactic sugar for `equals()` in Java. ```scala scala> "abcd" == "abcd" res37: Boolean = true scala> "abcd".equals("abcd") res38: Boolean = true ``` - `!=` is nothing but `!equals()` - If you override `equals` class, `==` will automatically work for it - Sadly there is no type safety ] --- .left-column[ ## Intro ## OO ] .right-column[ # Equality - To check equality of references (pointer to same object. Or java equivalent of `==`), use `eq` ```scala scala> val a = "abcd" a: String = abcd scala> val b = new String("abcd") b: String = abcd scala> a eq b res0: Boolean = false ``` - `neq` is negation of `eq` - Works with `null` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Imports ```scala import java.io.File ``` - To import everything under a package, use `_` ```scala import java.io._ ``` - To import multiple classes from a package: ```scala import java.io.{File, IOException, FileNotFoundException} ``` - You can even give a alias name ```scala scala> import java.util.{Random => Hey} import java.util.{Random=>Hey} scala> new Hey res1: java.util.Random = java.util.Random@7f08caf ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Scoped Imports - You can limit scope of input within any block ```scala def getRandomBoolean:Boolean = { import java.util.Random val r = new Random r.nextBoolean() } ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Access Modifiers - Scala fields and methods are public by default - Scala lets you control method visibility in a more granular and powerful way - Scopes possible: - public - private - object-private scope - package - package-specific ] --- .left-column[ ## Intro ## OO ] .right-column[ # Access Modifiers ```scala class Hi{ private val message = "Hi" def same(other:Hi) = message == other.message } ``` - `message` is private to this class. ```scala class Hi2{ protected val message = "Hi" } ``` - The protected field `message` can be accessed either from `Hi2` or its `subclass` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Access Modifiers - You can limit scope of access ```scala package somepackage class Hi { private[somepackage] val message = "Hi" } ``` - Also for `this` object ```scala class Hi2{ private[this] val message = "Hi" def same(other:Hi) = message == other.message // compile failure } ``` - ] --- .left-column[ ## Intro ## OO ] .right-column[ # Singleton Objects - Scala provides provides a first class syntactic sugar for singleton classes - For singleton's, by definition there can only be one instance possible (classloader?) ```scala scala> object Hi{ | def sayHello(name:String) = "hello "+name | } defined object Hi scala> Hi.sayHello("India") res2: String = hello India ``` - In java terms it can be thought upon as a class with only static methods - `static` is not a keyword in scala. Instead, all members that would be static, including classes, should go in a singleton object instead. - `object` can then be used as a factory ] --- .left-column[ ## Intro ## OO ] .right-column[ # Singleton Objects - `main` method is implemented as part of singleton object ```scala object MainClass { def main(args: Array[String]): Unit = println("Hello World!") } ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # javap in REPL - javap can be used from repl ```scala scala> class Hi{ | var a = 23 | } defined class Hi warning: previously defined object Hi is not a companion to class Hi. Companions must be defined together; you may wish to use :paste mode for this. scala> :javap -p Hi Compiled from "
" public class $line16.$read$$iw$$iw$Hi { private int a; public int a(); public void a_$eq(int); public $line16.$read$$iw$$iw$Hi(); } ``` - Helps in understanding implementation of `val` and `var` - Scala believes in Grand Unified Theory. Accessing fields and methods of class should no make no difference in terms of usage ] --- .left-column[ ## Intro ## OO ] .right-column[ # Companion Objects - A companion object is an object with the same name as a class or trait and is defined in the same source file as the associated file or trait - A companion object differs from other objects as it has access rights to the class/trait that other objects do not - In particular it can access methods and fields that are private in the class/trait. ```scala object Hello { private val sayHello = "Hello!" } class Hello(message: String = Hello.sayHello) { println(message) } ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Companion Objects - Sample usage: ```scala class Animal(val name:String,val legs:Int) object Animal{ def copy(other:Animal) = new Animal(other.name, other.legs) } ``` - Use `:paste` in repl to suggest it that it is a companion object ] --- class: middle, inverse #Exercise - 2 - In existing file `src/main/scala/util/Time.scala`, add companion object to class `Time` - Create `apply` method that takes 3 arguments (hours, minutes, seconds) - Add another `apply` function. It must take an argument `totalSeconds` which represents total number of seconds during the day - It must returns instance of class `Time` - Add another function `fromMinutes` which must take an argument `totalMinutes` which represents total number of minutes during the day - It must returns instance of class `Time` --- .left-column[ ## Intro ## OO ] .right-column[ # apply methods ```scala scala> class Animal {} defined class Animal scala> object Animal { | def apply() = new Foo | } defined module Animal scala> val newFoo = Animal() scala> object AnimalMaker { | def apply() = new Foo | } defined module FooMaker scala> val newFoo = AnimalMaker() ``` - `Animal()` is an alias to `Animal.apply()` - Works with arguments as well ] --- .left-column[ ## Intro ## OO ] .right-column[ # apply methods - apply method are not restricted to companion objects but instances as well ```scala scala> class Animal(val name:String,val legs:Int){ | def apply() = new Animal(name+" applied", legs * 2) | } defined class Animal scala> val a = new Animal("cow", 4) a: Animal = Animal@563a89b5 scala> a() res0: Animal = Animal@1046498a scala> a().legs res1: Int = 8 ``` - `a()` is an alias to `a.apply()` - Works with arguments as well ] --- .left-column[ ## Intro ## OO ] .right-column[ # Equality Task - Create a class `Person` that has two constructor arguments `firstName` and `lastName` - Create two person objects with same `firstName` and `lastName` - do `==` in between the objects - Implement `equals` in `Person` - do `==` in between the objects ] --- .left-column[ ## Intro ## OO ] .right-column[ # Case Classes ```scala case class Person(name:String, num:Int) ``` - creates a companion object by itself ```scala scala> case class Person(name:String, num:Int) defined class Person scala> val p = Person("sachin", 23) p: Person = Person(sachin,23) ``` - Apart from companion object, gives us: public getters ```scala scala> p.name res2: String = sachin scala> p.num res3: Int = 23 ``` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Case Classes - Gives us: getters, hashcode, toString, equals, copy implemented ```scala case class Person(var name:String, var num:Int) ``` is equivalent to ```java public class Person { public Person(String, int); //constructor public String getName(); public String setName(String name); public String getNum(); public String setNum(int num); public int hashCode(); public String toString(); public boolean equals(Object); public Person copy(java.lang.String, int); //Person("Steven",1).copy(name = "Gerrard") //... } ``` - `val` is implicit - `-Xprint:typer` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Case Classes - create a case class `Car` that takes two mutable arguments: `brand` and `color` - create an instance `car` without using the keyword `new`. Arguments: `bmw` and `blue` - try accessing the brand field by doing `car.brand` - Create two `Car` instances with same `brand` and `color` - Do `==` across them - change the color from `blue` to `red` of the same object - Create a new object using `copy` by changing color to `black` ] --- .left-column[ ## Intro ## OO ] .right-column[ # Case Classes - `case class` is great. Then why not have it by default/ - Heavy weight. May not be needed all the time - Cannot inherit a case class from another case class - Service objects should not be case classes - Prefer case classes with objects with mutable state, private state or no state ] --- class: center, middle, inverse #Class Hierarchy --- class: center, middle ![Class Hierarchy](hierarchy.png "JVM Languages") --- .left-column[ ## Intro ## OO ] .right-column[ # class Hierarchy - Unlike Java, everything including numerical values and functions are objects - Since Scala is class-based, all values are instances of a class - `scala.Any` is super class of all classes - `scala.AnyVal` and `Scala.AnyRef` are its two subclasses - `Scala.AnyVal` represents: values classes - `scala.AnyRef` represents reference classes - If Scala is used in the context of a Java runtime environment, then scala.AnyRef corresponds to java.lang.Object - Nothing is subtype of every other type ] --- class: center, middle, inverse # Collections --- class: center, middle ![Collections](collections.png "Collections Hierarchy") --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Sequences - Sequences is a mapping from an index position to an element - The short-word used for `Sequences` is `Seq` - A sequence is a kind of iterable that has a length and whose elements have fixed index positions, starting from 0. ```scala scala> Seq(1,2) res4: Seq[Int] = List(1, 2) scala> Seq() res5: Seq[Nothing] = List() scala> Seq("hi", "hello" , "greetings") res6: Seq[String] = List(hi, hello, greetings) ``` - Trait Seq has two subtraits LinearSeq, and IndexedSeq. These do not add any new operations, but each offers different performance characteristics ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Linear Sequences - A linear sequence has efficient head and tail operation - Frequently used linear sequences are `scala.collection.immutable.List` and `scala.collection.immutable.Stream` # Indexed Sequences - An indexed sequence has efficient apply, length, and (if mutable) update operations - Frequently used indexed sequences are `scala.Array` and `scala.collection.mutable.ArrayBuffer` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Vector - The Vector class provides an interesting compromise between indexed and linear access. It has both effectively constant time indexing overhead and constant time linear access overhead ```scala scala> Vector(1,2,3) res18: scala.collection.immutable.Vector[Int] = Vector(1, 2, 3) scala> val a= Vector(1,2,3) a: scala.collection.immutable.Vector[Int] = Vector(1, 2, 3) scala> a(0) res19: Int = 1 ``` - Performance Statistics - [http://docs.scala-lang.org/overviews/collections/performance-characteristics.html](http://docs.scala-lang.org/overviews/collections/performance-characteristics.html) ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Syntactic Sugar - Each collection has a companion object with `apply` method ```scala scala> List(1,2,3) res7: List[Int] = List(1, 2, 3) scala> List.apply(1,2,3) res8: List[Int] = List(1, 2, 3) ``` - observe `[Int]` in `List[Int]`. ```scala scala> class Animal defined class Animal scala> class Dog extends Animal defined class Dog scala> class Cat extends Animal defined class Cat scala> List(new Cat, new Dog) res9: List[Animal] = List(Cat@5c141c7b, Dog@14f254f) ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Type Paramers - In Scala, type parameters are declared in `[]` instead of `<>` in Java - When we do: ```scala scala> List(1,2,3) res10: List[Int] = List(1, 2, 3) ``` It does not mean that we are not providing type parameters. The compiler is infering by itself - Type arguments can be inferred or given explicitly - In Scala, there are not raw types. This makes it difficult to be compatible with pre-java5 code ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Some useful collection methods: ```scala scala> val ls = List(1,2,3) ls: List[Int] = List(1, 2, 3) scala> ls.head res11: Int = 1 scala> ls.take(2) res12: List[Int] = List(1, 2) scala> ls.tail res13: List[Int] = List(2, 3) scala> ls.last res14: Int = 3 scala> ls.contains(7) res15: Boolean = false scala> ls.zip(List(4,5,6)) res16: List[(Int, Int)] = List((1,4), (2,5), (3,6)) ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Right binding operators - Scala has some special behavior for added syntactic sugar support - Operator ending with `:` binds to the right - instance and argument are swapped ```scala scala> val numbers = List(1,2,3) numbers: List[Int] = List(1, 2, 3) scala> 0 :: numbers res56: List[Int] = List(0, 1, 2, 3) scala> numbers.::(0) res57: List[Int] = List(0, 1, 2, 3) ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # List - create a list containing numbers from 1 to 10 - Get the first element of the list - Get the last element of the list - Get the size of the list - Get first 6 elements of the List - Get first 9 elements of the List - Get last 3 elements of the List - Get last 9 elements of the List - See if the list contains element: `7` - Get the element at index `4` - Add an element to the head of the List - Create another list of numbers from 10 to 15. Append the above list to this list in the front ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ ```scala val empty: List[Nothing] = List() // Two dimensional list val dim: List[List[Int]] = List( List(1, 0, 0), List(0, 1, 0), List(0, 0, 1) ) ``` val nums = 1 :: 2 :: 3 :: 4 :: Nil val empty = Nil nums.reverse val fruit = List.fill(3)("apples") List.range(1,10) ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Set - Set contains no duplicates ```scala scala> val set = Set(1,2,3,4,2,3,1) set: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4) scala> set.size res20: Int = 4 scala> set(2) res21: Boolean = true scala> set contains 2 res22: Boolean = true scala> set + 4 res23: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4) scala> set + 6 res24: scala.collection.immutable.Set[Int] = Set(1, 6, 2, 3, 4) ``` ] --- .right-column[ # Collection Implementations: - `scala.collection.immutable` package - `scala.collection.mutable` package - default `immutable` is used ```scala scala> val a = List(1,2,3) a: List[Int] = List(1, 2, 3) scala> :kind a scala.collection.immutable.List's kind is A ``` - Predef.scala ```scala type List[+A] = scala.collection.immutable.List[A] val List = scala.collection.immutable.List ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Immutable Collections - Also called persistent data structures Task: - Create a set containing numbers 1 to 5 - Add an element to the set - check the contents of the new set - check the contents of the original set ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Tuple - Pair is first class in scala ```scala scala> (1,2) res27: (Int, Int) = (1,2) scala> ("hi","hello","greetings") res28: (String, String, String) = (hi,hello,greetings) ``` - `List` is homogeneous. That is it contains all elements of same type - `Tuple` is heterogeneous. It preserves specific type: ```scala scala> (1, "hi", 3L) res29: (Int, String, Long) = (1,hi,3) ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Tuple ```scala scala> val a = (1,2) a: (Int, Int) = (1,2) scala> a._1 res30: Int = 1 scala> a._2 res31: Int = 2 ``` - Alternate syntax ```scala scala> ( 1 -> 2) res32: (Int, Int) = (1,2) ``` - Only works for arity 2 - Due to lack of runtime support, it is represented as instance of class `TupleN` at runtime - Tuple2 to Tuple22 ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Tuple Task - Create a tuple of arity 2. Values: 1,1 - Try accessing the first element - Try accessing the second element - Try accessing the third element - Create another tuple of arity 3. Values: 1, 1, 1 - Try doing all the above by using `->` syntax in creating tuples ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Map - Map is a collection of multiple key value pairs. - Keys have to be unique. ```scala scala> val map = Map(1 -> "a", 2 -> "b") map: Map[Int,String] = Map(1 -> a, 2 -> b) scala> map(1) res0: String = a scala> map.get(9) res1: Option[String] = None scala> map.getOrElse(1, "z") res2: String = a scala> map.getOrElse(9, "z") res3: String = z ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Map Task - Create a map of the integer corresponding to its string. i.e. Map of key: 1. value: "1" - Try getting the value by key `1` - Try getting the value for key `2` - Try converting map to List - Again add pair: (1, "2") to the map - Try getting the value by key `1` - Again add pair: (1, "1") to the map - Try converting map to Set ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Array - Java arrays in the background ```scala scala> val a = Array(1,2,3) a: Array[Int] = Array(1, 2, 3) scala> a.size res46: Int = 3 scala> a.length res47: Int = 3 scala> a(0) res48: Int = 1 scala> a(12) java.lang.ArrayIndexOutOfBoundsException: 12 ... 27 elided ``` - Arrays are mutable ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ #Array Task - Create an array of 5 strings. "1" "2" ... "5" - type must be `Array[String]` - access the first element - access the last element - get the size of the array - Try creating array of : 1, 2, "1", "2" - change the value at index 2 to "1 - new" ``` ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # Some useful collection methods: - isEmpty - map - filter - groupBy - toSet - drop - dropWhile - reverse - combinations - ++ ] --- .left-column[ ## Intro ## OO ## Collections ] .right-column[ # lazy val - `val` is executed when it is defined - `lazy val` is executed when it is accessed for the first time ```scala scala> val x = { println("x"); 1 } x x: Int = 15 scala> lazy val y = { println("y"); 2 } y: Int =
scala> x res1: Int = 1 scala> y y res2: Int = 2 scala> y res3: Int = 2 ``` ] --- layout: false #Specification .left-column[ Scala Spec ] .right-column[ 1. Scala can some times be daunting to predict the expected behavior 2. Bug or Feature? 3. [http://www.scala-lang.org/files/archive/spec/2.12/](http://www.scala-lang.org/files/archive/spec/2.12/) ] ---


{% extends "base.html" %} {% load static %} {% block body_container %}
Professional development events either held by or attended by the University of Canterbury Computer Science Education Research Group (creators of CS Unplugged and the CS Field Guide).
We also list related third party events that also offer professional development opportunities.
This website is still in development as we continue to add features and fix bugs, so please bear with us. We have released this website in an alpha state to allow you to easily view all events in one central place.
In the future we plan to add the ability for you to be able to register for events directly on this site with a login, and edit your registration as you wish.


Donald Trump comments on Roger Stone conviction
by Xeni JardinWell this is awkward.
Donald Trump, a very normal and innocent President of the United States, just tweeted:
So they now convict Roger Stone of lying and want to jail him for many years to come. Well, what about Crooked Hillary, Comey, Strzok, Page, McCabe, Brennan, Clapper, Shifty Schiff, Ohr & Nellie, Steele & all of the others, including even Mueller himself? Didn’t they lie?....
LOL.
Who is next?
PREVIOUSLY ON BOING BOING:


WikiLeaks<EMAIL_ADDRESS>leaked emails, 2009 mail archive
This message is part of a particular mailbox provided at WikiLeaks
and it should be discussed here.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
This is the first 5 pages of a total of 10 page newsletter called the Der Welcanschauung.Check it out.
Wish to talk? call me at<PHONE_NUMBER>
Associate Pastor
Marvin Gates
Entry for this page on WikiLeaks |
Discussion page on WikiLeaks |
wikileaks.org
Date Index |
Thread Index |
Author Index


Estimation, simulation, and forecasting using the HAR model from Corsi(2009) <doi:10.1093/jjfinec/nbp001>.
| Version: | 0.1 |
| Depends: | R (≥ 2.10), methods |
| Imports: | Rcpp (≥ 0.12.17) , xts, zoo, sandwich |
| LinkingTo: | Rcpp, RcppArmadillo |
| Published: | 2018-10-12 |
| Author: | Emil Sjoerup |
| Maintainer: | Emil Sjoerup <emilsjoerup at live.dk> |
| License: | GPL-3 |
| NeedsCompilation: | yes |
| CRAN checks: | HARModel results |
| Reference manual: | HARModel.pdf |
| Package source: | HARModel_0.1.tar.gz |
| Windows binaries: | r-devel: HARModel_0.1.zip, r-release: HARModel_0.1.zip, r-oldrel: HARModel_0.1.zip |
| OS X binaries: | r-release: HARModel_0.1.tgz, r-oldrel: HARModel_0.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=HARModel to link to this page.


Next: Macro Lambda Lists, Previous: Generic Function Lambda Lists, Up: Lambda Lists
A specialized lambda list is used to specialize a method for a particular signature and to describe how arguments matching that signature are received by the method. The defined names in Figure 3–15 use specialized lambda lists in some way; see the dictionary entry for each for information about how.
Figure 3–15: Standardized Operators that use Specialized Lambda Lists
A specialized lambda list can contain the lambda list keywords shown in Figure 3–16.
&allow-other-keys &key &rest &aux &optional
Figure 3–16: Lambda List Keywords used by Specialized Lambda Lists
A specialized lambda list is syntactically the same as an ordinary lambda list except that each required parameter may optionally be associated with a class or object for which that parameter is specialized.
lambda-list ::=({var | (var [specializer])}* [&optional {var | (var [init-form [supplied-p-parameter]])}*] [&rest var] [&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]] [&aux {var | (var [init-form])}*])


 Such as the name, bold and emphasis tag.
HTML ATTRIBUTES
HTML attributes provide additional information about and element. An example used was the anchor tag. Example below:
I am going to love learning from UDACITY. Other tags can also be attributes such as the image tag.
WHITESPACE
To have whitespace one can use the
br tag which stands for break to force multiple lines and is also a void tag which means that it does not need a closing tag. To enter multiple line breaks use the p tag. Although, this tag is not a void tag
therefore, it needs a closing tag. The difference between these two tags are that the
p tag is a block tag while p is inline.
Other block tags used are div and form . Inline used are a, span, br, img.
STUCTURE
The stucture of the document must consits of the:
- Doctype
- Opening tag
- Metadata (Head)
- Title
- Body (The content of the document)
Adding CSS Style to the HTML Structure
CSS is code written to control the "style" of the HTML element and allows programmers to avoid repetition.
There are different methods of adding CSS styling. One can write CSS in the Head of the HTML or add to the CSS file.
Box, Grids and Rules
Everything on a page is acutually in a box. The header, imaages, name and title, etc. Boxes are defined with
div tags.


‘Halo: Reach’ Launches For PC And Xbox One December 3rd
by Mike WilsonIt’s not Halo Infinite, but Microsoft’s X019 conference gave Halo fans something to cheer about. Halo: Reach will launch for Xbox One and PC via the Halo: The Master Chief Collection on December 3.
As was reported back in March, rather than release the six games in the collection all at once, Microsoft is opting for a staggered release. Halo: Reach comes to PC as the first installment. Optimized for PC, Halo: Reach will feature mouse and keyboard support, native PC features, up to 4K UHD and at least 60 FPS.


Class library
- TPS\TPS
- TPS\station
- TPS\library
Direct known subclasses
TPS\submissionTracking
public
|
|
public
array
|
|
public
array
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
array
|
|
public
string
|
|
public
boolean|array
|
|
public
boolean|array
|
|
public
boolean|array
|
#
searchLibrary( string $term, boolean $exact = False, $page = 1, $limit = 1000 )
More general search of the library that matches on any of the following columns: artist, album, note, Locale, or Genre |
public
|
|
public
boolean|array
|
|
public
string|array
|
|
public
array|boolean
|
#
GetFullAlbum( type $term )
Takes a RefCode and returns an array with all library information included |
getStations(),
sanitizePagination()
|
$db,
$mysqli,
$mysqliDriver,
$username
|