|
|
|
Lesson 2: An Introduction to TinyScript
Last modified: Thu Aug 26 18:53:27 PDT 2004
|
|
This lesson introduces the TinyScript
language. Using the VM from Lesson 1, you write a
series of increasingly complex programs, culminating
in one that sends a temperature reading when
filtered light readings go over a threshold.
|
|
Introduction
|
|
In Lesson 1, you installed a few scripts on
Bombilla motes. The scripts were in TinyScript,
which is a simple BASIC-like language. TinyScript is
imperative and dynamically typed. Every VM has a set
of events that it handles. Each event has a handler,
a piece of code that runs when that event
occurs. TinyScript has basic control structures,
such as loops and conditionals. Part of customizing
a VM is to include functions to support the sets of
operations an application needs.
|
|
TinyScript Structure and Variables
|
|
A TinyScript program two parts: variable
declarations and statements. All variables that a
program uses must be declared before any
statements. For example, this is CntToLeds from
Lesson 1:
| Variable Declarations |
|
private counter;
|
| Statements |
|
counter = counter +1;
led(counter % 8);
|
TinyScript has three kinds of variables: private,
shared, and buffer. Private variables are
local to a handler; only the handler that declares
the variable can access it. For example, if two
handlers both have a private variable named
counter, each one has its own, independent
variable.
In constrast, shared variables are not
unique to handlers: this allows two handlers to
share data. If two handlers both have a shared
variable named counter, it is a single
variable that they share. If one handler increments
it, the other handler will see the change.
Shared and private variables are dynamically
typed. TinyScript has two basic types: integers and
sensor readings. Sensor readings are further divided
into all of the types of sensors (a magnetometer
reading is distinct from a light
reading). "Dynamically typed" means that a program
dynamically determines the type of a variable as it
runs, rather than than a compiler or programmer
stating it at compile-time. For example:
private val;
val = 1; ! val is an integer
val = light(); ! val is now a light reading
val = magX(); ! val is now a magnetometer reading (x-axis)
Dynamic typing means that a variable can have "no
type." A variable with no type acts as the identity
(e.g., zero). For example, in the following program
the variable counter has never been used
before:
private counter; ! no type: never been used before; first execution
counter = counter + 1; ! counter takes type integer, with value 1
Types limit what operations on a variable are
valid. Sensor readings are immutable. You cannot add
an integer to a light reading, a light reading to a
temperature reading, or even two light readings. If
you want to process sensorn readings, you must turn
them into integers with the int() function.
For example:
private total;
private count;
private val;
val = light(); ! legal: val is now a light reading
val = light() / 2; ! error: cannot divide light reading by 2
val = light() + magX(); ! error: cannot add light and magX
val = light() + light(); ! error: cannot add two light readings
val = int(light()); ! legal: val is now an integer
total = total + val; ! legal: total was an int
count = count + 1; ! legal: count was an int
val = total/count; ! legal: average of readings
Finally, buffer variables are vectors of a
fixed maximum size, and are always shared. Just like
private and shared scalars, buffers are typed; a
buffer can only contain values of a single type. A
buffer's contents and type can be cleared with the
bclear() function. If a buffer has no type,
it takes the type of the first value put into
it.
buffer bufOne;
buffer bufTwo;
bclear(bufOne); ! clear bufferOne
bufOne[0] = 5; ! Put 5 in index 0: bufOne has size one, type integer
bufOne[] = id(); ! Append mote ID to bufOne, now has size two
bufOne[4] = 41; ! Put 41 in index 4; bufOne has size five,
! buf[2] and buf[3] are zero
bufOne[5] = light(); ! error: buffer is type integer, not light
bufOne[5] = int(light); ! legal: integer
bufTwo = bufOne; ! make bufTwo a copy of bufOne
|
|
Simple Sensing
|
|
To sample sensor readings, your mote must have a
sensor board. By default, Bombilla compiles for the
standard mica sensor board (micasb), and provides
sensors for light and temperature. If you have that
sensor board, it should work fine. If you are using
a different sensor board -- the mica weather board
(micawb), for example -- then you may need to rebuild and recompile
Bombilla.
As CntToLeds in Lesson 1 showed, periodic
programs in Maté usually have two scripts:
the first is what to do periodically, the second
starts the periodic execution. Instead of displaying
a counter, as in CntToLeds, the following timer
script samples the light sensor (or other sensor, if
you have a board besides micasb).
Open the "timer0.txt" file you wrote in lesson
one, and modify it to be
private reading;
reading = light();
led(reading / 128);
This displays the top three bits of the sensor
reading. Inject this with Scripter as before:
java net.tinyos.script.Scripter -comm tossim-serial timer0 timer0.txt
If Timer0 is already running (e.g., you kept your
mote on from last lesson), then this script will
start executing immediately. If you need to start
Timer0, inject "once.txt" from the previous lesson,
which calls settimer0().
You should see this error message appear at the
console:
Error received:
Context: TIMER0
Cause: TYPE_CHECK
Capsule: TIMER0
Instruction: 5
The led() function takes a value, but light()
returns a light reading: when Maté tried to
execute led() the parameter failed a type
check. When the VM encounters a run-time error, it
halts execution of all contexts, flashes the LEDs,
and periodically broadcasts an error message to the
radio and UART: the Scripter tool read it from the
UART and displayed the error. Installing new code
clears the VM from the error state (it
reboots). Change "timer0.txt" to be:
private reading;
reading = int(light());
led(reading / 128);
Inject it with Scripter. The top three bits of
the light sensor will properly display on the mote
LEDs.
|
|
Event Handlers and the Scripter GUI
|
|
All of the scripts so far have been for the Once
or Timer0 events, and only used a small number of
functions. The Bombilla VM has a wider range of
event handlers that you can use. To see the full set
of options, run Scripter with the -gui
option:
java net.tinyos.script.Scripter -gui
You should see a window similar to this:
The Scripter GUI has three major parts. The left
panel has a selection for which event handler you
which to program. The Bombilla VM has six event
handlers. They are:
- Broadcast: Runs when the
mote receives a packet broadcast by another mote
with the bcast() function.
- Once: Runs once, when it installs. You
used this event to start Timer0 in earlier parts
of the tutorial.
- Reboot: Runs after the VM reboots
(every time new code for any handler
arrives).
- Timer0: Runs when timer0 fires. The
function settimer0() sets the firing
rate.
- Timer1: Runs when timer1 fires. The
function settimer1() sets the firing
rate.
- Trigger: Runs when another handler
calls the trigger() function.
Below the handler selection is a list of all
current shared variables and buffers, and below that
is a button for injecting code.
The center panel is where you write program
text. The GUI currently limits programs to 99 lines.
The right panel displays the set of functions a VM
provides. Below the list is a text area that
displays a brief description of a function. So far,
you've used the light, id,
settimer0, and led functions.
You can load text files into the program text
area with the File menu's Load
element.
Select the Timer0 handler, enter this code in the
program window and inject it. It toggles the red
mote LED when it runs:
led(25);
Select the Timer0 handler, enter this code into
the program window and inject it. It toggles the green
mote LED when it runs:
led(26);
Finally, inject a Once handler that starts the
two Timers at different rates:
settimer0(1);
settimer1(8);
You should see the red and green LEDs blinking at
different frequencies. The description of the
led function describes how to set, turn on,
turn off, and toggle LEDs. When you're done playing
with the LEDs, inject a Once handler that stops the
timers (calls the settimer functions with zero as a
parameter).
|
|
Sensor Sampling
|
|
For the rest of the tutorial, you can either use
the Scripter GUI or its command line tool
invocation. The parameters to the command line are:
java net.tinyos.script.Scripter <handler name> <file name>
Handler name is case-insensitive (Once is
the same as once), but file name is
case-sensitive.
TinyScript has standard language control
structures, like loops and conditionals. For
example, this program puts light readings into a
buffer until it is full, the clears the
buffer. bfull returns true if a buffer is
full, false otherwise. bsize returns how
many elements are in a buffer. bclear
clears a buffer, emptying it and making it have no
type. Inject it as the Timer0 handler:
buffer data;
data[] = light(); ! This appends the reading
if bfull(data) then
bclear(data);
end if
Start Timer0 with a Once handler that calls
settimer0(2) (5 Hz). Another way to fill
the buffer (by directly indexing):
buffer data;
data[bsize(data)] = light(); ! This puts the reading at the first free element
if bfull(data) then
bclear(data);
end if
To make sure the program is doing what you think
it is, include an LED indicator of whether it's
cleared the buffer:
buffer data;
data[] = light();
if bfull(data) then
bclear(data);
led(2); ! Turn on LED 1
else
led(1); ! Turn on LED 2
end if
You should see the geen LED on, but every two
seconds it will briefly turn off and the red will
turn on.
This next script is a little more complex: when
the buffer is full, it uses a loop to pull the
highest value out of the buffer and display its top
three bits on the LEDs :
buffer data;
private i;
private size;
private max;
private val;
data[] = light();
if bfull(data) then
size = bsize(data);
max = 0;
for i=0 until i >= size ! Scan through values
val = int(data[i]);
if (val > max) then
max = val; ! Find the max
end if
next i
led(max / 128); ! Display max on LEDs
bclear(data);
else
led(0); ! Turn off the LEDs
end if
There are two basic kinds of loops in TinyScript
(as in BASIC): unconditional and conditional. The
above loop is conditional: is loops until the
condition i >= size is true. Loops can
also be unconditional, where they loop for a finite
number of steps. These loops take the form
for i=0 to x
...
next i
Where x is a constant (it cannot be a
variable). If you want to increment until a
variable, then you should use a conditional loop as
the above handler does.
By default the initialized variable (i in
the above example) increments by one on each
execution. You can change this with the
step qualifier. For example, this loops
counter from 0 to 100 in increments of
ten:
for counter=0 to 100 step 10
...
next counter
The above filtering handler is relatively long
and cumbersome: it compiles to fifty-one
bytes. Bombilla provides functions to support this
sort of processing. The functions bsorta
and bsortd sort the elements of a buffer in
ascending and descending order respectively. An
simpler version of the above program is:
buffer data;
private val;
data[] = light();
if bfull(data) then
bsortd(data); ! Sort in descending order (highest is first)
led(int(data[0]) / 128); ! Display max on LEDs
bclear(data);
else
led(0); ! Turn off the LEDs
end if
|
|
Transmitting Readings Over the UART
|
|
So far, all of the programs have been using the
LEDs to display what they're doing. Bombilla also
has functions that support communication. For
example, the uart function takes a buffer
as a parameter and sends that buffer over the mote
UART. This Timer0 handler is similar to the
filtering one above, but sends the mote ID and
reading to the UART in addition to displaying the
reading on the LEDs.
buffer data;
buffer sendBuffer;
private val;
data[] = light();
if bfull(data) then
bsortd(data);
val = int(data[0]);
bclear(sendBuffer); ! Clear out the send buffer
sendBuffer[0] = id(); ! Buffer has 2 elements: mote ID and value
sendBuffer[1] = val;
led(val / 128); ! Display top 3 bits of value
uart(sendBuffer); ! Send the buffer to the UART
bclear(data);
else
led(0);
end if
The uart function sends a TinyOS packet
containing a Maté data buffer. When you
compile a VM, it builds a Java class representing
this packet, called BufferUARTMsg. The
Maté toolchain has a tool for reading these
packets. It needs to connect to the mote, so if you
are using the Scripter GUI (which keeps its
connection open), you have to use a SerialForwarder
so both the GUI and packet reader can listen to mote
packets. That is, if you are using the GUI you
should not use -comm serial. Start the
reader with:
java net.tinyos.script.VMBufferReader
VMBufferReader has an optional -comm
parameter; by default it connects to SerialForwarder
on the local machine. If the above script is
running, you should soon see output like this:
We're connected to avrmote
Received UART buffer of type VALUE, size 2
[0][948]
Received UART buffer of type VALUE, size 2
[0][882]
Received UART buffer of type VALUE, size 2
[0][979]
Received UART buffer of type VALUE, size 2
[0][861]
Received UART buffer of type VALUE, size 2
[0][1016]
The first number (zero in the above output) is
the mote ID; the second is the sensor reading.
If you want to build your own GUIs or Java tools
on top of Maté, you'll probably be dealing
with data buffers. The source code of VMBufferReader
should be a good place to start on how to do so.
Of
course transmitting to the UART is only sort-of
useful; Maté can also send buffers up an
ad-hoc collection tree. T
|
|
Conditional Sensing
|
|
The Trigger context allows a handler to request
an asynchronous operation. When a handler calls the
trigger function (which takes a buffer as a
parameter), it triggers the Trigger handler to run
(hence its name). The passed buffer is copied to the
Trigger context, so the caller can continue
executing. Meanwhile, the Trigger handler will start
running in parallel.
We can use this behavior to write a program that
has two parts. The first is a handler that
periodically runs and filters light readings. When
the filtered value goes over a threshold, the
handler triggers the Trigger handler. The Trigger
handler then samples the temperature sensor and
sends a packet to the UART with the reading. The
periodic handler is essentially a condition ("when
filtered light is above x"), and the Trigger handler
is the action to take when the condition is
two. Putting them in separate handlers allows you to
reprogram the two individually.
Stop Timer0 and Timer1 by sending a Once handler
that calls the settimer functions with a
period of zero:
settimer0(0);
settimer1(0);
Next, install the Trigger handler. This program
samples the temperature sensor and sends a buffer
with the reading to the UART:
buffer buf;
bclear(buf);
buf[0] = temp();
led(26); ! Blink green
uart(buf);
Install a Timer0 handler that filters light
readings with an exponentially weighted moving
average (EWMA), and when that goes over a threshold
calls trigger():
private average;
buffer empty;
average = average + int(light());
average = average / 2;
led(25); ! Blink red
if (average > 600) then
trigger(empty);
end if
Finally, start Timer0 firing at 5Hz with a Once
handler:
settimer0(2);
The mote will blink its red LED on each light
sample, and blink the green LED when it sends a
temperature reading. If it isn't triggering, then
you can lower the threshold in the Timer0 handler
from 600; hopefully this should help. Note that in
the above program Trigger sends a buffer of type
TEMP (temperature readings).
This concludes Lesson 2. In the next lesson,
you'll start using the radio.
< Previous Lesson |
Next Lesson > |
Top
|
|
Incorporating Other Sensor Boards
|
|
If you have sensorboards other than the standard
mica sensor board (micasb), then you need to rebuild
and recompile Bombilla to support your board. This
requires modifying the VM specification file. Lesson 4 has details on
doing this, but here we'll just change it in a very
limited fashion.
Maté currently supports the mica sensor
board (micasb) and the basic sensor board
(basicsb). We hope to support additional boards in
the future. Lesson 5
shows how Maté can be extended to support
additional boards. Making Bombilla use a different
sensor board requires changing the VM specification
file.
Open the Bombilla VM specification file
bombilla.vmsf in a text editor. It resides
in the samples subdirectory of
lib/VM The fifth line of the file says
<LOAD FILE="../sensorboards/micasb.vmsf">
Depending on what board you want, the line to:
|
basic sensor board (basicsb):
|
<LOAD FILE="../sensorboards/basicsb.vmsf">
|
telos onboard sensors:
|
<LOAD FILE="../sensorboards/telos.vmsf">
|
Basically, change the name of the vmsf file to
the sensorboard. This will automatically include
functions for all of the sensorboard's sensors. If
this means that you have functions for sensors that
are not populated on your board (e.g., you do not
have a magnetometer on your micasb), don't worry
about it. In the long term -- say, you were
deploying a Maté network -- you may want to
not include them, but for the sake of the tutorial
it's not an issue.
Once you have made this change, rebuild
Bombilla. Remember that this must be done from
the samples directory:
java net.tinyos.script.VMBuilder -nw bombilla.vmsf
Then, go to apps/Bombilla and recompile
the VM for your hardware.
These are the sensors the various sensor boards
provide:
| micasb |
basicsb |
telos |
| accelX |
light |
photoactive |
| accelY |
temp |
totalsolar |
| light |
|
humidity |
| magX |
|
temperature |
| magY |
|
| mic |
|
| temp |
|
Note that some Telos motes do not have their
sensors populated. This causes the
totalsolar and photoactive sensors
to return bogus values: they are simple ADC
captures. In contrast, the humidity and
temperature functions interact with digital
sensors over a bus; if they are not populated, the
VM will enter an error state.
|
|


Since November there have been dozens of us working on
setting up venues for the Sexplanations Road Tour to
sex educate. We've sent messages to over 500 libraries, emailed and
called 100s of coffee shops, dozens of universities,
sex stores, bookstores, restaurants, and communities
centers.
The response has often been "we can't have that here"
or "that's too out of the box for us." So everyone
working on this has relied almost entirely on
connections made by fans onsite. And we've had to be
really creative. We've met with audiences in a back room of a theater,
the social area of a church, the parking lot at a
human rights memorial, a grocery store cafe, a mall,
and outside a police station. We're trying!
If there is a * next to the location listed below
this means a venue and time have not been determined.
We will still go to the city but there isn't an
official stop yet.
To know where we'll be or for any last minute changes,
check Twitter (
@elleteedee).
You're also welcome to make connections to safe spaces
by emailing
helpdrdoe@gmail.com.


We are Hadas Sasson and Shira Maximov, We are students of Information System, at the Academic College Tel Aviv-Jaffa.
We are in our last year, and this website is a product for WEB course.
Our products are high quality.
Free express shipping world wide
Our Designs are modern and up-to-date.
The secret ingredient of our designs - love
Tel Aviv, Isreal
Jerusalem, Isreal
London, UK
Questions? Thoughts? Feel free to contact us.Our store located in 23 Bazel st Tel Aviv.
073-7373737


Artifact explorer
Loading program...
This tool has not been fully updated for game version 1.21 yet. Hard facts (effects, crafting recipes, etc.) presented here are accurate, but empirical mission loot data may not reflect latest changes and dynamism in ship quality, capacity, and duration. These will be updated once (1) a reasonable amount of post-update data has been collected; and (2) I work out the UI changes necessary to adapt to the dynamism.
In the meantime, please consider submitting your mission loot data to ei.mikit.app (@mikit#7826's automated data collection program) to help expedite the process. Thank you.


{{/* This is Single.html for About. Please customize for yourself. data file -> data/about/about.toml */}} {{ partial "header.html" . }}
{{ .description_markdown | markdownify }}


| Modifier and Type | Constant Field | Value |
|---|---|---|
private static final long |
serialVersionUID |
1L |
| Modifier and Type | Constant Field | Value |
|---|---|---|
private static final long |
serialVersionUID |
1L |
| Modifier and Type | Constant Field | Value |
|---|---|---|
public static final java.lang.String |
CLOSE |
"CLOSE" |
public static final java.lang.String |
DROP |
"DROP" |
public static final java.lang.String |
OPEN |
"OPEN" |
public static final java.lang.String |
TAKE |
"TAKE" |
| Modifier and Type | Constant Field | Value |
|---|---|---|
public final int |
CLOSED |
1 |
public final int |
LOCKED |
2 |
public final int |
OPEN |
0 |
private static final long |
serialVersionUID |
1L |
| Modifier and Type | Constant Field | Value |
|---|---|---|
public static final int |
DOWN |
6 |
public static final int |
EAST |
3 |
public static final int |
IN |
11 |
public static final int |
NORTH |
1 |
public static final int |
NORTHEAST |
7 |
public static final int |
NORTHWEST |
8 |
public static final int |
OUT |
12 |
private static final long |
serialVersionUID |
1L |
public static final int |
SOUTH |
2 |
public static final int |
SOUTHEAST |
9 |
public static final int |
SOUTHWEST |
10 |
public static final int |
UNDEFINED |
0 |
public static final int |
UP |
5 |
public static final int |
WEST |
4 |
| Modifier and Type | Constant Field | Value |
|---|---|---|
private static final long |
serialVersionUID |
1L |
| Modifier and Type | Constant Field | Value |
|---|---|---|
private static final long |
serialVersionUID |
1L |
| Modifier and Type | Constant Field | Value |
|---|---|---|
private static final long |
serialVersionUID |
1L |


Power User
Persona
- Name:Chef Jon
- Age:33
- Gender: Male
- Height:6'1
- Weight:173lbs
- Personality Type:INTP
- Profession:Professional Chef
- Equipment:iPhone 6s (because it has a headphone jack) with 4G network, new dell 3000 series laptop with windows 7 pro.
- Technical Aptitude:Jon is a chef. He is fairly familiar with common operating systems and has a good understanding of technology from the standpoint of a user, but does not utlize the deeper features of most technologies.
- Attitudes and Behaviors:Calm, focused, and driven. In his profession for the food, not the money. Chef Jon gets all of his produce locally, and needs to creatively integrate unusual ingredients into his dishes.
- Frustrations and Needs:Chef Jon wants to be able to share his recipes with the world, and use key ingredients to find others' recipes as well.
- Goals:Utilize scraexitrps-to-scrumptious to share and find recipes.

- Jon clicks on "add to my cookbook"
- He is first prompted to add his ingredients (separated by commas), and then prompted to type the rest of the recipe
- The Chef clicks on "finished" and the recipe is added to his cookbook.
User Story:
As a power user, I want to search for others' recipes based on specific ingredients.
User Interaction Flow
Preconditions: Jon has an account with scraps-to-scrumptious and is logged in
Postconditions:Jon finds the perfect orc meat recipe.
- Jon navigates back to the home page and locates the "find a recipe" search bar.
- He then types "orc meat" into the search bar and is shown the top recipes with the requested ingredient.
- He selects the recipe that will best suit his needs, and saves it to his cookbook for future use.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.njkremer.Sqlite.SqlStatement
public class SqlStatement
The main way to interact with the database. This is designed to work with POJOs (Plain Old Java Objects) that "map" to tables in a SQLite Database. This class is really only used to start an statement to work with the database. A SqlExecutor is used to write out the rest of the statement.
Typically a SqlExecutor isn't created on it's own to interact with the database since this class creates a new instance of a SqlExecutor that is returned by all of the methods of this class.
| Constructor Summary | |
|---|---|
SqlStatement()
Deprecated. As of 8/13/2012 the creation of a SqlStatement is deprecated in favor of using the static methods off of the SqlStatement class. The methods will continue to work but you will get compiler warnings to access the methods
in a static way. |
| Method Summary | ||
|---|---|---|
static
|
delete(java.lang.Class<T> clazz)
Returns a new instance of SqlExecutor to be used for deleting an record in the database. |
|
static
|
delete(T databaseObject)
Returns a new instance of SqlExecutor to be used for deleting an Object in the database. |
|
static
|
insert(T databaseObject)
Returns a new instance of SqlExecutor to be used for inserting an Object into the database. |
|
static
|
select(java.lang.Class<T> clazz)
Returns a new instance of SqlExecutor to be used for retrieving an Object out of the database. |
|
static
|
update(T databaseObject)
Returns a new instance of SqlExecutor to be used for updating an Object in the database. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated public SqlStatement()
SqlStatement
class. The methods will continue to work but you will get compiler warnings to access the methods
in a static way.
| Method Detail |
|---|
public static <T> SqlExecutor<T> select(java.lang.Class<T> clazz) throws DataConnectionException
clazz
- A reference to the Object.class that you are retrieving from the database.
DataConnectionException
public static <T> SqlExecutor<T> update(T databaseObject) throws DataConnectionException
If you specify a PrimaryKey on your POJO then a "where clause" is not needed when updating an object instead it will use the PrimaryKey to auto generate a where clause.
databaseObject
- An object that was queried from the database that has been updated.
DataConnectionException
public static <T> SqlExecutor<T> insert(T databaseObject) throws DataConnectionException
Note that the values that are set on the passed in POJO will be used for creating the record in the database. If a value isn't set on the POJO than the default Java value will be used (e.g. 0 for int, null for an Object, etc).
databaseObject
- An object that is to be input into the database.
DataConnectionException
public static <T> SqlExecutor<T> delete(java.lang.Class<T> clazz) throws DataConnectionException
clazz
- A reference to the Object.class that you are deleting from the database.
DataConnectionException
public static <T> SqlExecutor<T> delete(T databaseObject) throws DataConnectionException
If you specify a PrimaryKey on your POJO then a "where clause" is not needed when deleting an object instead it will use the PrimaryKey to auto generate a where clause.
databaseObject
- An object that should be deleted from the database.
DataConnectionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


About
The Guillotine two-cut knapsack problem is a type of packing problem that is well studied and common in industry. The goal is to minimize the source material used when cutting a set of smaller rectangle shapes. The main restriction is that cuts must run completely from one side to another. The problem is N-P hard, but there are many algorithms to find an approximate solution.
Cutting and Knapsack problems
Linear Programming


Personal Summary
I'm a software engineer with a background in Android development. Recently I have been heavily involved in projects focusing
on mobile augmented reality, graphics programming, and audio/video processing.
I'm driven by my co-workers, and like the opportunity to iterate quickly and collaborate closely with my team members. I enjoy learning new skills, and pushing myself to get better at what I do.
I'm driven by my co-workers, and like the opportunity to iterate quickly and collaborate closely with my team members. I enjoy learning new skills, and pushing myself to get better at what I do.
Professional History
8i
Lead Android Developer
2016-2017
As the lead Android developer at 8i I was accountable for the delivery of Android projects. This involved working closely
with designers, iOS developers, and the other members of the Android team to ensure that project milestones were met,
and key deliverables went out on time.
I have worked on several projects in this role, all focused on mobile augmented reality. The development work in this role was an interesting blend of traditional Android development coupled with lower level work involving graphics and audio/video processing.
Outside of these main projects, I have also contributed to several other areas of the business. This includes 8i's Unity plugin, exploration of mobile virtual reality, research into augmented reality scene integration, and other small exploration/research based projects.
I have worked on several projects in this role, all focused on mobile augmented reality. The development work in this role was an interesting blend of traditional Android development coupled with lower level work involving graphics and audio/video processing.
Outside of these main projects, I have also contributed to several other areas of the business. This includes 8i's Unity plugin, exploration of mobile virtual reality, research into augmented reality scene integration, and other small exploration/research based projects.
Golden Micro Solutions
Software Engineer
2013-2016
Golden Micro Solutions is a bespoke software development business based in Blenheim, with clients throughout New Zealand.
In this role I was responsible for working directly with clients to develop software solutions to their business problems.
I worked on a wide range of projects, involving Android development, CRM/database development, and web development.
Technical Skills
Android
Java
Kotlin
Unity
Augmented Reality
OpenGL/GLSL
Java
Kotlin
Unity
Augmented Reality
OpenGL/GLSL
Other Experience
FreeAgent
2014-2016
Mobile Developer (Contract)
Clocktower Games
2014-2015
Software Engineer & Gameplay Designer
Massey University
2013
Software Engineering Peer Mentor
Golden Micro Solutions
2012-2013
Software Engineering Intern
Education
Massey University
Bachelor of Information Science
(Computer Science) 2012-2014
(Computer Science) 2012-2014
Recognised for academic excellence


The progress bar gives an immediate, real-time visualisation of the current task completion status.
A value of 0 reflects an initial state, with zero progress.
Any value between 0 and 100 reflects a loading state.
A value of 100 reflects a completed state.
To fill the entire width of the container, use the progress-bar--fluid modifier.
Use the buttons below to see an example of the progress bar value being animated.


Many different lists (itemize/unordered, enumerate/ordered, checklist, description) with support for nested lists, using ASCII and UTF characters for labels. The lists allows for various degrees of flexibility for labels, nested lists, indentation (with auto-indentation for nested lists), and styles for list labels.
This blog post explains how to get UTF-8 support in the whole tool chain. Updates will be at the SKB Wiki on UTF-8.


Poems and Limericks of Edward Lear
by Edward Lear
“The Jumblies”
Additional Information
- Year Published: 0
- Language: English
- Country of Origin: England
- Source: Stedman, E. C. (1895). A Victorian Anthology. Cambridge: Riverside Press.
-
Readability:
- Flesch–Kincaid Level: 3.1
- Word Count: 780
- Genre: Poetry
- Keywords: fairy tale, journey, myth
- ✎ Cite This
Downloads
They went to sea in a sieve, they did;
In a sieve they went to sea:
In spite of all their friends could say,
On a winter’s morn, on a stormy day,
In a sieve they went to sea.
And when the sieve turned round and round,
And every one cried, “You’ll all be drowned!”

Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.
They sailed away in a sieve, they did,
In a sieve they sailed so fast,
With only a beautiful pea-green veil
Tied with a ribbon, by way of a sail,
To a small tobacco-pipe mast.
And every one said who saw them go,
“Oh! won’t they be soon upset, you know?
For the sky is dark, and the voyage is long;
And happen what may, it’s extremely wrong
In a sieve to sail so fast.”
Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.
The water it soon came in, it did;
The water it soon came in:
So, to keep them dry, they wrapped their feet
In a pinky paper all folded neat;
And they fastened it down with a pin.
And they passed the night in a crockery-jar;
And each of them said, “How wise we are!
Though the night be dark, and the voyage be long,
Yet we never can think we were rash or wrong,
While round in our sieve we spin.”
Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.
And all night long they sailed away;
And when the sun went down,
They whistled and warbled a moony song
To the echoing sound of a coppery gong,
In the shade of the mountains brown.
“O Timballo! How happy we are
When we live in a sieve and a crockery jar!
And all night long, in the moonlight pale,
We sail away with a pea-green sail
In the shade of the mountains brown.”
Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.

Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.
And in twenty years they all came back,—
In twenty years or more;
And every one said, “How tall they’ve grown!
For they’ve been to the Lakes, and the Torrible Zone,
And the hills of the Chankly Bore.”
And they drank their health, and gave them a feast
Of dumplings made of beautiful yeast;
And every one said, “If we only live,
We, too, will go to sea in a sieve,
To the hills of the Chankly Bore.”
Far and few, far and few,
Are the lands where the Jumblies live:
Their heads are green, and their hands are blue;
And they went to sea in a sieve.


The most important thing is to learn how programming works and not any one particular language. However, this website was created by a beggining developer in the early stages of his career in order to alleviate some of the stresses that you are going through now. Fill out the form below to see what languages might best fit you!


genomicDensity.Rd
Calculate genomic region density
genomicDensity( region, window.size = 1e7, n.window = NULL, overlap = TRUE, count_by = c("percent", "number"), chr.len = NULL)
| region | Genomic positions. It can be a data frame with two columns which are start positions and end positions on a single chromosome. It can also be a bed-format data frame which contains the chromosome column. |
|---|---|
| window.size | Window size to calculate genomic density |
| n.window | number of windows, if it is specified, |
| overlap | Whether two neighbouring windows have half overlap |
| count_by | How to count the value for each window, |
| chr.len | the chromosome length. The value should be named vector |
It calculate the percent of each genomic windows that is covered by the input regions.
If the input is a two-column data frame, the function returns a data frame with three columns:
start position, end position and the overlapping (value depends on the count_by
argument). And if the input is a bed-format
data frame, there will be an additionally chromosome name column.
#> chr start end value #> 1 chr1 1 10000000 0.5174489 #> 2 chr1 5000001 15000000 0.5550511 #> 3 chr1 10000001 20000000 0.5354743 #> 4 chr1 15000001 25000000 0.5258289 #> 5 chr1 20000001 30000000 0.4530591 #> 6 chr1 25000001 35000000 0.5215807#> chr start end value #> 1 chr1 1 10000000 22 #> 2 chr1 5000001 15000000 28 #> 3 chr1 10000001 20000000 36 #> 4 chr1 15000001 25000000 36 #> 5 chr1 20000001 30000000 35 #> 6 chr1 25000001 35000000 32


%
Hadoop streaming is a utility that comes with the Hadoop distribution. The utility allows you to create and run Map/Reduce jobs with any executable or script as the mapper and/or the reducer. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -input myInputDirs \ -output myOutputDir \ -mapper /bin/cat \ -reducer /usr/bin/wc
In the above example, both the mapper and the reducer are executables that read the input from stdin (line by line) and emit the output to stdout. The utility will create a Map/Reduce job, submit the job to an appropriate cluster, and monitor the progress of the job until it completes.
When an executable is specified for mappers, each mapper task will launch the executable as a separate process when the mapper is initialized. As the mapper task runs, it converts its inputs into lines and feed the lines to the stdin of the process. In the meantime, the mapper collects the line oriented outputs from the stdout of the process and converts each line into a key/value pair, which is collected as the output of the mapper. By default, the prefix of a line up to the first tab character is the key and the rest of the line (excluding the tab character) will be the value. If there is no tab character in the line, then entire line is considered as key and the value is null. However, this can be customized by setting -inputformat command option, as discussed later.
When an executable is specified for reducers, each reducer task will launch the executable as a separate process then the reducer is initialized. As the reducer task runs, it converts its input key/values pairs into lines and feeds the lines to the stdin of the process. In the meantime, the reducer collects the line oriented outputs from the stdout of the process, converts each line into a key/value pair, which is collected as the output of the reducer. By default, the prefix of a line up to the first tab character is the key and the rest of the line (excluding the tab character) is the value. However, this can be customized by setting -outputformat command option, as discussed later.
This is the basis for the communication protocol between the Map/Reduce framework and the streaming mapper/reducer.
User can specify stream.non.zero.exit.is.failure as true or false to make a streaming task that exits with a non-zero status to be Failure or Success respectively. By default, streaming tasks exiting with non-zero status are considered to be failed tasks.
Streaming supports streaming command options as well as generic command options. The general command line syntax is shown below.
Note: Be sure to place the generic options before the streaming options, otherwise the command will fail. For an example, see Making Archives Available to Tasks.
hadoop command [genericOptions] [streamingOptions]
The Hadoop streaming command options are listed here:
| Parameter | Optional/Required | Description |
|---|---|---|
| -input directoryname or filename | Required | Input location for mapper |
| -output directoryname | Required | Output location for reducer |
| -mapper executable or JavaClassName | Required | Mapper executable |
| -reducer executable or JavaClassName | Required | Reducer executable |
| -file filename | Optional | Make the mapper, reducer, or combiner executable available locally on the compute nodes |
| -inputformat JavaClassName | Optional | Class you supply should return key/value pairs of Text class. If not specified, TextInputFormat is used as the default |
| -outputformat JavaClassName | Optional | Class you supply should take key/value pairs of Text class. If not specified, TextOutputformat is used as the default |
| -partitioner JavaClassName | Optional | Class that determines which reduce a key is sent to |
| -combiner streamingCommand or JavaClassName | Optional | Combiner executable for map output |
| -cmdenv name=value | Optional | Pass environment variable to streaming commands |
| -inputreader | Optional | For backwards-compatibility: specifies a record reader class (instead of an input format class) |
| -verbose | Optional | Verbose output |
| -lazyOutput | Optional | Create output lazily. For example, if the output format is based on FileOutputFormat, the output file is created only on the first call to Context.write |
| -numReduceTasks | Optional | Specify the number of reducers |
| -mapdebug | Optional | Script to call when map task fails |
| -reducedebug | Optional | Script to call when reduce task fails |
You can supply a Java class as the mapper and/or the reducer.
hadoop jar hadoop-streaming-2.7.5.jar \ -input myInputDirs \ -output myOutputDir \ -inputformat org.apache.hadoop.mapred.KeyValueTextInputFormat \ -mapper org.apache.hadoop.mapred.lib.IdentityMapper \ -reducer /usr/bin/wc
You can specify stream.non.zero.exit.is.failure as true or false to make a streaming task that exits with a non-zero status to be Failure or Success respectively. By default, streaming tasks exiting with non-zero status are considered to be failed tasks.
You can specify any executable as the mapper and/or the reducer. The executables do not need to pre-exist on the machines in the cluster; however, if they don’t, you will need to use “-file” option to tell the framework to pack your executable files as a part of job submission. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -input myInputDirs \ -output myOutputDir \ -mapper myPythonScript.py \ -reducer /usr/bin/wc \ -file myPythonScript.py
The above example specifies a user defined Python executable as the mapper. The option “-file myPythonScript.py” causes the python executable shipped to the cluster machines as a part of job submission.
In addition to executable files, you can also package other auxiliary files (such as dictionaries, configuration files, etc) that may be used by the mapper and/or the reducer. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -input myInputDirs \ -output myOutputDir \ -mapper myPythonScript.py \ -reducer /usr/bin/wc \ -file myPythonScript.py \ -file myDictionary.txt
Just as with a normal Map/Reduce job, you can specify other plugins for a streaming job:
-inputformat JavaClassName -outputformat JavaClassName -partitioner JavaClassName -combiner streamingCommand or JavaClassName
The class you supply for the input format should return key/value pairs of Text class. If you do not specify an input format class, the TextInputFormat is used as the default. Since the TextInputFormat returns keys of LongWritable class, which are actually not part of the input data, the keys will be discarded; only the values will be piped to the streaming mapper.
The class you supply for the output format is expected to take key/value pairs of Text class. If you do not specify an output format class, the TextOutputFormat is used as the default.
Streaming supports streaming command options as well as generic command options. The general command line syntax is shown below.
Note: Be sure to place the generic options before the streaming options, otherwise the command will fail. For an example, see Making Archives Available to Tasks.
hadoop command [genericOptions] [streamingOptions]
The Hadoop generic command options you can use with streaming are listed here:
| Parameter | Optional/Required | Description |
|---|---|---|
| -conf configuration_file | Optional | Specify an application configuration file |
| -D property=value | Optional | Use value for given property |
| -fs host:port or local | Optional | Specify a namenode |
| -files | Optional | Specify comma-separated files to be copied to the Map/Reduce cluster |
| -libjars | Optional | Specify comma-separated jar files to include in the classpath |
| -archives | Optional | Specify comma-separated archives to be unarchived on the compute machines |
You can specify additional configuration variables by using “-D <property>=<value>”.
To change the local temp directory use:
-D dfs.data.dir=/tmp
To specify additional local temp directories use:
-D mapred.local.dir=/tmp/local -D mapred.system.dir=/tmp/system -D mapred.temp.dir=/tmp/temp
Note: For more details on job configuration parameters see: mapred-default.xml
Often, you may want to process input data using a map function only. To do this, simply set mapreduce.job.reduces to zero. The Map/Reduce framework will not create any reducer tasks. Rather, the outputs of the mapper tasks will be the final output of the job.
-D mapreduce.job.reduces=0
To be backward compatible, Hadoop Streaming also supports the “-reducer NONE” option, which is equivalent to “-D mapreduce.job.reduces=0”.
To specify the number of reducers, for example two, use:
hadoop jar hadoop-streaming-2.7.5.jar \ -D mapreduce.job.reduces=2 \ -input myInputDirs \ -output myOutputDir \ -mapper /bin/cat \ -reducer /usr/bin/wc
As noted earlier, when the Map/Reduce framework reads a line from the stdout of the mapper, it splits the line into a key/value pair. By default, the prefix of the line up to the first tab character is the key and the rest of the line (excluding the tab character) is the value.
However, you can customize this default. You can specify a field separator other than the tab character (the default), and you can specify the nth (n >= 1) character rather than the first character in a line (the default) as the separator between the key and value. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -D stream.map.output.field.separator=. \ -D stream.num.map.output.key.fields=4 \ -input myInputDirs \ -output myOutputDir \ -mapper /bin/cat \ -reducer /bin/cat
In the above example, “-D stream.map.output.field.separator=.” specifies “.” as the field separator for the map outputs, and the prefix up to the fourth “.” in a line will be the key and the rest of the line (excluding the fourth “.”) will be the value. If a line has less than four “.”s, then the whole line will be the key and the value will be an empty Text object (like the one created by new Text("")).
Similarly, you can use “-D stream.reduce.output.field.separator=SEP” and “-D stream.num.reduce.output.fields=NUM” to specify the nth field separator in a line of the reduce outputs as the separator between the key and the value.
Similarly, you can specify “stream.map.input.field.separator” and “stream.reduce.input.field.separator” as the input separator for Map/Reduce inputs. By default the separator is the tab character.
The -files and -archives options allow you to make files and archives available to the tasks. The argument is a URI to the file or archive that you have already uploaded to HDFS. These files and archives are cached across jobs. You can retrieve the host and fs_port values from the fs.default.name config variable.
Note: The -files and -archives options are generic options. Be sure to place the generic options before the command options, otherwise the command will fail.
The -files option creates a symlink in the current working directory of the tasks that points to the local copy of the file.
In this example, Hadoop automatically creates a symlink named testfile.txt in the current working directory of the tasks. This symlink points to the local copy of testfile.txt.
-files hdfs://host:fs_port/user/testfile.txt
User can specify a different symlink name for -files using #.
-files hdfs://host:fs_port/user/testfile.txt#testfile
Multiple entries can be specified like this:
-files hdfs://host:fs_port/user/testfile1.txt,hdfs://host:fs_port/user/testfile2.txt
The -archives option allows you to copy jars locally to the current working directory of tasks and automatically unjar the files.
In this example, Hadoop automatically creates a symlink named testfile.jar in the current working directory of tasks. This symlink points to the directory that stores the unjarred contents of the uploaded jar file.
-archives hdfs://host:fs_port/user/testfile.jar
User can specify a different symlink name for -archives using #.
-archives hdfs://host:fs_port/user/testfile.tgz#tgzdir
In this example, the input.txt file has two lines specifying the names of the two files: cachedir.jar/cache.txt and cachedir.jar/cache2.txt. “cachedir.jar” is a symlink to the archived directory, which has the files “cache.txt” and “cache2.txt”.
hadoop jar hadoop-streaming-2.7.5.jar \ -archives 'hdfs://hadoop-nn1.example.com/user/me/samples/cachefile/cachedir.jar' \ -D mapreduce.job.maps=1 \ -D mapreduce.job.reduces=1 \ -D mapreduce.job.name="Experiment" \ -input "/user/me/samples/cachefile/input.txt" \ -output "/user/me/samples/cachefile/out" \ -mapper "xargs cat" \ -reducer "cat" $ ls test_jar/ cache.txt cache2.txt $ jar cvf cachedir.jar -C test_jar/ . added manifest adding: cache.txt(in = 30) (out= 29)(deflated 3%) adding: cache2.txt(in = 37) (out= 35)(deflated 5%) $ hdfs dfs -put cachedir.jar samples/cachefile $ hdfs dfs -cat /user/me/samples/cachefile/input.txt cachedir.jar/cache.txt cachedir.jar/cache2.txt $ cat test_jar/cache.txt This is just the cache string $ cat test_jar/cache2.txt This is just the second cache string $ hdfs dfs -ls /user/me/samples/cachefile/out Found 2 items -rw-r--r-* 1 me supergroup 0 2013-11-14 17:00 /user/me/samples/cachefile/out/_SUCCESS -rw-r--r-* 1 me supergroup 69 2013-11-14 17:00 /user/me/samples/cachefile/out/part-00000 $ hdfs dfs -cat /user/me/samples/cachefile/out/part-00000 This is just the cache string This is just the second cache string
Hadoop has a library class, KeyFieldBasedPartitioner, that is useful for many applications. This class allows the Map/Reduce framework to partition the map outputs based on certain key fields, not the whole keys. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -D stream.map.output.field.separator=. \ -D stream.num.map.output.key.fields=4 \ -D map.output.key.field.separator=.  The two variables are used by streaming to identify the key/value pair of mapper.
The map output keys of the above Map/Reduce job normally have four fields separated by “.”. However, the Map/Reduce framework will partition the map outputs by the first two fields of the keys using the -D mapred.text.key.partitioner.options=-k1,2 option. Here, -D map.output.key.field.separator=. specifies the separator for the partition. This guarantees that all the key/value pairs with the same first two fields in the keys will be partitioned into the same reducer.
This is effectively equivalent to specifying the first two fields as the primary key and the next two fields as the secondary. The primary key is used for partitioning, and the combination of the primary and secondary keys is used for sorting. A simple illustration is shown here:
Output of map (the keys)
<IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS>
Partition into 3 reducers (the first 2 fields are used as keys for partition)
<IP_ADDRESS> ----------- <IP_ADDRESS> <IP_ADDRESS> ----------- <IP_ADDRESS> <IP_ADDRESS>
Sorting within each partition for the reducer(all 4 fields used for sorting)
<IP_ADDRESS> ----------- <IP_ADDRESS> <IP_ADDRESS> ----------- <IP_ADDRESS> <IP_ADDRESS>
Hadoop has a library class, KeyFieldBasedComparator, that is useful for many applications. This class provides a subset of features provided by the Unix/GNU Sort. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -D mapreduce.job.output.key.comparator.class=org.apache.hadoop.mapreduce.lib.partition.KeyFieldBasedComparator \ -D stream.map.output.field.separator=. \ -D stream.num.map.output.key.fields=4 \ -D mapreduce.map.output.key.field.separator=. \ -D mapreduce.partition.keycomparator.options=-k2,2nr \ -D mapreduce.job.reduces=1 \ -input myInputDirs \ -output myOutputDir \ -mapper /bin/cat \ -reducer /bin/cat
The map output keys of the above Map/Reduce job normally have four fields separated by “.”. However, the Map/Reduce framework will sort the outputs by the second field of the keys using the -D mapreduce.partition.keycomparator.options=-k2,2nr option. Here, -n specifies that the sorting is numerical sorting and -r specifies that the result should be reversed. A simple illustration is shown below:
Output of map (the keys)
<IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS>
Sorting output for the reducer (where second field used for sorting)
<IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS> <IP_ADDRESS>
Hadoop has a library package called Aggregate. Aggregate provides a special reducer class and a special combiner class, and a list of simple aggregators that perform aggregations such as “sum”, “max”, “min” and so on over a sequence of values. Aggregate allows you to define a mapper plugin class that is expected to generate “aggregatable items” for each input key/value pair of the mappers. The combiner/reducer will aggregate those aggregatable items by invoking the appropriate aggregators.
To use Aggregate, simply specify “-reducer aggregate”:
hadoop jar hadoop-streaming-2.7.5.jar \ -input myInputDirs \ -output myOutputDir \ -mapper myAggregatorForKeyCount.py \ -reducer aggregate \ -file myAggregatorForKeyCount.py \
The python program myAggregatorForKeyCount.py looks like:
#!/usr/bin/python import sys; def generateLongCountToken(id): return "LongValueSum:" + id + "\t" + "1" def main(argv): line = sys.stdin.readline(); try: while line: line = line[:-1]; fields = line.split("\t"); print generateLongCountToken(fields[0]); line = sys.stdin.readline(); except "end of file": return None if __name__ == "__main__": main(sys.argv)
Hadoop has a library class, FieldSelectionMapReduce, that effectively allows you to process text data like the unix “cut” utility. The map function defined in the class treats each input key/value pair as a list of fields. You can specify the field separator (the default is the tab character). You can select an arbitrary list of fields as the map output key, and an arbitrary list of fields as the map output value. Similarly, the reduce function defined in the class treats each input key/value pair as a list of fields. You can select an arbitrary list of fields as the reduce output key, and an arbitrary list of fields as the reduce output value. For example:
hadoop jar hadoop-streaming-2.7.5.jar \ -D mapreduce.map.output.key.field.separator=. \ -D mapreduce.partition.keypartitioner.options=-k1,2 \ -D mapreduce.fieldsel.data.field.separator=. \ -D mapreduce.fieldsel.map.output.key.value.fields.spec=6,5,1-3:0- \ -D mapreduce.fieldsel.reduce.output.key.value.fields.spec=0-2:5- \ -D mapreduce.map.output.key.class=org.apache.hadoop.io.Text \ -D mapreduce.job.reduces=12 \ -input myInputDirs \ -output myOutputDir \ -mapper org.apache.hadoop.mapred.lib.FieldSelectionMapReduce \ -reducer org.apache.hadoop.mapred.lib.FieldSelectionMapReduce \ -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner
The option “-D mapreduce.fieldsel.map.output.key.value.fields.spec=6,5,1-3:0-” specifies key/value selection for the map outputs. Key selection spec and value selection spec are separated by “:”. In this case, the map output key will consist of fields 6, 5, 1, 2, and 3. The map output value will consist of all fields (0- means field 0 and all the subsequent fields).
The option “-D mapreduce.fieldsel.reduce.output.key.value.fields.spec=0-2:5-” specifies key/value selection for the reduce outputs. In this case, the reduce output key will consist of fields 0, 1, 2 (corresponding to the original fields 6, 5, 1). The reduce output value will consist of all fields starting from field 5 (corresponding to all the original fields).
Often you do not need the full power of Map Reduce, but only need to run multiple instances of the same program - either on different parts of the data, or on the same data, but with different parameters. You can use Hadoop Streaming to do this.
As an example, consider the problem of zipping (compressing) a set of files across the hadoop cluster. You can achieve this by using Hadoop Streaming and custom mapper script:
Generate a file containing the full HDFS path of the input files. Each map task would get one file name as input.
Create a mapper script which, given a filename, will get the file to local disk, gzip the file and put it back in the desired output directory.
See MapReduce Tutorial for details: Reducer
For example, say I do: alias c1=‘cut -f1’. Will -mapper “c1” work?
Using an alias will not work, but variable substitution is allowed as shown in this example:
$ hdfs dfs -cat /user/me/samples/student_marks alice 50 bruce 70 charlie 80 dan 75 $ c2='cut -f2'; hadoop jar hadoop-streaming-2.7.5.jar \ -D mapreduce.job.name='Experiment' \ -input /user/me/samples/student_marks \ -output /user/me/samples/student_out \ -mapper "$c2" -reducer 'cat' $ hdfs dfs -cat /user/me/samples/student_out/part-00000 50 70 75 80
For example, will -mapper “cut -f1 | sed s/foo/bar/g” work?
Currently this does not work and gives an “java.io.IOException: Broken pipe” error. This is probably a bug that needs to be investigated.
For example, when I run a streaming job by distributing large executables (for example, 3.6G) through the -file option, I get a “No space left on device” error.
The jar packaging happens in a directory pointed to by the configuration variable stream.tmpdir. The default value of stream.tmpdir is /tmp. Set the value to a directory with more space:
-D stream.tmpdir=/export/bigspace/…
You can specify multiple input directories with multiple ‘-input’ options:
hadoop jar hadoop-streaming-2.7.5.jar \ -input '/user/foo/dir1' -input '/user/foo/dir2' \ (rest of the command)
Instead of plain text files, you can generate gzip files as your generated output. Pass ‘-D mapreduce.output.fileoutputformat.compress=true -D mapreduce.output.fileoutputformat.compress.codec=org.apache.hadoop.io.compress.GzipCodec’ as option to your streaming job.
You can specify your own custom class by packing them and putting the custom jar to $HADOOP_CLASSPATH.
You can use the record reader StreamXmlRecordReader to process XML documents.
hadoop jar hadoop-streaming-2.7.5.jar \ -inputreader "StreamXmlRecord,begin=BEGIN_STRING,end=END_STRING" \ (rest of the command)
Anything found between BEGIN_STRING and END_STRING would be treated as one record for map tasks.
A streaming process can use the stderr to emit counter information. reporter:counter:<group>,<counter>,<amount> should be sent to stderr to update the counter.
A streaming process can use the stderr to emit status information. To set a status, reporter:status:<message> should be sent to stderr.
See Configured Parameters. During the execution of a streaming job, the names of the “mapred” parameters are transformed. The dots ( . ) become underscores ( _ ). For example, mapreduce.job.id becomes mapreduce_job_id and mapreduce.job.jar becomes mapreduce_job_jar. In your code, use the parameter names with the underscores.


|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectstyle.cayenne.ObjectId | +--org.objectstyle.cayenne.FlattenedObjectId
A FlattenedObjectId is a class that uniquely identifies an object that is the destination of a flattened relationship that is defined by a series of toOne relationships.
It encapsulates enough information (relationship, source object pk etc.) in order for DataContext to fetch the appropriate row when the object is touched
| Field Summary | |
protected java.lang.String |
relationshipName
Deprecated. |
protected DataObject |
sourceObject
Deprecated. |
| Fields inherited from class org.objectstyle.cayenne.ObjectId |
objectClass, objectIdKeys, replacementId |
| Constructor Summary | |
FlattenedObjectId(java.lang.Class objClass,
DataObject aSourceObject,
java.lang.String aRelationshipName)
Deprecated. Constructs a FlattenedObjectId. |
| Method Summary | |
boolean |
equals(java.lang.Object object)
Deprecated. |
java.lang.String |
getRelationshipName()
Deprecated. Returns the name of the flattened relationship from the source object (identified by sourceIdSnapshot) that leads to the object that this id represents |
DataObject |
getSourceObject()
Deprecated. Returns the id snapshot of the source object |
int |
hashCode()
Deprecated. |
boolean |
isTemporary()
Deprecated. Always returns false . |
| Methods inherited from class org.objectstyle.cayenne.ObjectId |
getIdSnapshot, getObjClass, getReplacementId, getValueForAttribute, setIdKeys, setReplacementId, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String relationshipName
protected DataObject sourceObject
| Constructor Detail |
public FlattenedObjectId(java.lang.Class objClass, DataObject aSourceObject, java.lang.String aRelationshipName)
| Method Detail |
public boolean equals(java.lang.Object object)
equals
in class ObjectId
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class ObjectId
Object.hashCode()
public boolean isTemporary()
ObjectId
false
.
isTemporary
in class ObjectId
ObjectId.isTemporary()
public java.lang.String getRelationshipName()
public DataObject getSourceObject()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Please follow the chapter on the 'jBPM installer' in the User Guide at http://docs.jboss.org/jbpm/v6.3/userguide/ch03.html


UK Gamers Can Get Their Hands On Pokémon Sword And Shield Early Thanks To GAME's Midnight Launch
65 stores taking part
by Damien McFerranBased in the UK? Itching to get your hands on Pokémon Sword and Shield? Well, you'll be pleased to know that high street chain GAME is conducting a series of midnight openings on Thursday night/Friday morning across 65 of its stores, which means you can get your grubby hands on the latest title in the series a few hours earlier than planned.
The 65 stores are:
- Manchester (Denton)
- Manchester (Arndale)
- Manchester (Trafford Centre)
- Shrewsbury
- Wigan
- Cheshire Oaks
- Birmingham Bullring
- Liverpool (Lord St)
- Warrington
- Bradford
- Harrogate
- Hull (Prospect Centre)
- Leeds (Headrow Centre)
- Leeds (White Rose)
- Gateshead (Metro)
- Middlesbrough
- Monks Cross
- Scarborough
- Sunderland
- Teesside
- York
- Spalding
- Doncaster
- Derby
- Wakefield
- Sheffield (The Moor)
- Sheffield (Meadowhall)
- Lincoln
- Nottingham (Victoria)
- Chesterfield
- Scunthorpe
- Newark
- Long Eaton
- Leicester
- Banbury
- Coventry
- Coventry (Arena Park)
- Watford
- Reading
- Kingston
- London (White City)
- London (Wardour Street)
- Milton Keynes
- Stratford (Belong)
- Basingstoke
- Bracknell
- Hinckley
- Colchester
- Worthing
- Westwood Cross
- Clacton On Sea
- Peterborough (Serpentine)
- Swansea
- Bath (Southgate)
- Aberystwyth
- Portsmouth
- Yeovil
- Bognor Regis
- Worcester
- Pontypridd
- Waterlooville
- Stirling
- Inverness
- Glasgow Fort
- Belfast
Will you be popping along to any of these stores? Let us know with a comment.


// Example: void make_random_shape(CMesh& mesh, float radius) { // Probably not the most optimized way to do this. ;) CBrush brush; CVector origin; // Origin = (0.0, 0.0, 0.0). for (int i = 0; i < 3; i++) { CPlane* plane = brush.add(new CPlane); // Make a random normal. for (int j = 0; j < 3; j++) plane->normal[j] = (rand() & 1023) / 1023.0 - 0.5; plane.normal.normalize(); // Offset plane from origin. plane->distance = radius; // Make sure every plane's normal points away from origin. if (plane * origin > 0.0) plane = - plane; } // Convert brush to mesh, and move polygons to output mesh. CMesh* tmp = brush.mesh(); tmp->move(mesh); delete tmp; }
Definition at line 72 of file CBrush.h.
Public Member Functions | |
| CPlane * | add (CPlane *plane) |
| CPlane * | addHead (CPlane *plane) |
| CPlane * | addTail (CPlane *plane) |
| void | remove (CPlane *plane) |
| CPlane * | unlink (CPlane *plane) |
| void | clear () |
| bool | convex () |
| Returns true if this is a convex brush. | |
| CPoly * | initial (CPlane *plane) |
| CPoly * | poly (CPlane *plane) |
| CMesh * | mesh () |
| CEdge * | points () |
| CBrush * | copy () |
| Returns a copy of the brush. | |
| CBrush * | clip (CPlane *plane) |
| Clips the brush, returning the resulting brush. | |
| CBrush * | unlink () |
Public Attributes | |
| CPlane * | planeHead |
| First plane in DLL. | |
| CPlane * | planeTail |
| Last plane in DLL. | |
| int | planeCount |
| Number of planes in DLL. | |
| void * | data |
| Custom data field. | |
| CBrush * | prev |
| CBrush * | next |
|
|
Creates an "initial" polygon. An initial polygon is a polygon that has a very large size and lies on the specified plane. This "initial" polygon will be used further to clip against the brush's other planes to create one of the brush's side faces.
|
|
|
Creates a polygon (brush side) for the given plane.
|
|
|
Convert the brush to a mesh. |
|
|
Return the corner points of the brush converted to wireframe. This will NOT remove duplicate points. |


SBI lowers MCLR based lending rates by 10 bps
by PTICountry's largest lender State Bank of India on Monday announced the reduction in its marginal cost of fund-based lending rate (MCLR) by 10 basis points across all one-year products, effective Tuesday.
This is the eighth consecutive cut in MCLR by the lender this fiscal.
"To pass on the benefit of our falling cost of funds to customers, we have reduced MCLR by 10 bps across all tenors," a statement from the bank said.
The new one-year MCLR has been cut to 7.90 per cent from 8 per cent.
The reduction comes as the Reserve Bank in a surprise move left the key policy rates unchanged last Thursday at 5.15 per cent.


In here i can have any html.
In this example, i only have 1 image.
The CSS in the parent document will affect the HTML in this document, it's not running in any form of frame.


{% autoescape true %}
×
{{ message }}
Welcome in Romain Amuat's
Wine Cave
Country
Region
Variety
Winery
Year
Category
{% for wine in wines %}
{{ wine.wine_country }}
{{ wine.wine_region }}
{{ wine.wine_region }}
{{ wine.wine_winery }}
{{ wine.wine_year }}
{{ wine.wine_type }}
Add to cart
{% endfor %}
{% endautoescape %}


Databases
The database connection manager provides a simple way of handling database connections in your application.
Connections
Basics
Creating a database connection is done using the ConnectionManager::connection
method.
// Returns connection object using the "default" database configuration defined in the config file
$connection = $this->database->connection();
// Returns connection object using the "mydb" database configuration defined in the config file
$connection = $this->database->connection('mydb');
The Connection::query
method lets you execute a query. It returns TRUE
on success and FALSE
on failure.
$connection->query('INSERT INTO `foo` (`bar`, `baz`) VALUES (?, ?)', ['fruit', 'banana']);
The Connection::all
method executes a query and returns an array containing all of the result set rows.
$rows = $connection->all('SELECT * FROM `foo` WHERE `bar` = ?', [$bar]);
// There's also a handy syntax for assigning arrays for use in "IN" clauses
$rows = $connection->all('SELECT * FROM `foo` WHERE `bar` IN ([?])', [['banana', 'apple']]);
The Connection::first
method executes a query and returns the first row of the result set.
$row = $connection->first('SELECT * FROM `foo` WHERE `bar` = ?', [$bar]);
The Connection::column
method executes a query and returns the value of the first column of the first row of the result set.
$email = $connection->column('SELECT `email` FROM `users` WHERE `id` = ?', [1]);
The Connection::queryAndCound
method will return the number of rows modified by the query.
$count = $connection->queryAndCound('UPDATE `users` SET `email` = ?', ['foo@example.org']);
$count = $connection->queryAndCound('DELETE FROM `users`');
Transactions
Transactions only work if the storage engine you're using supports them.
The Connection::transaction
method provides a handy shortcut for performing database transactions. Any failed queries in the closure will automatically roll back the transaction.
$connection->transaction(function($connection)
{
$connection->builder()->table('accounts')->where('user_id', '=', 10)->decrement('cash', 100);
$connection->builder()->table('accounts')->where('user_id', '=', 20)->increment('cash', 100);
});
You can also begin a transaction using the Connection::beginTransaction
method.
$connection->beginTransaction();
Committing the transaction is done using the Connection::commitTransaction
method.
$connection->commitTransaction();
Rolling back the transaction is done using the Connection::rollBackTransaction
method.
$connection->rollBackTransaction();
You can get the transaction nesting level using the Connection::getTransactionNestingLevel
method.
$nestingLevel = $connection->getTransactionNestingLevel();
You can check whether or not you're already in a transaction using the Connection::inTransaction
method.
$inTransaction = $connection->inTransaction();
Connection status
You can check if a connection is still alive using the Connection::isAlive()
method. It will return TRUE if it is and FALSE if not.
$isConnectionAlive = $connection->isAlive();
You can attempt to reconnect using the Connection::reconnect()
method.
$connection->reconnect();
You can configure the connection to automatically reconnect in the
app/config/database.php
configuration file. Note that Mako will not attempt to automatically reconnect if the connection was lost during a transaction.
Magic shortcut
You can access the default database connection directly without having to go through the connection
method thanks to the magic __call
method.
$this->database->query('INSERT INTO `foo` (`bar`, `baz`) VALUES (?, ?)', ['fruit', 'banana']);
Query builder
The Connection::builder()
method returns an instance of the query builder.
$rows = $connection->builder()->table('foo')->where('bar', '=', $bar)->all();
You can also use the Connection::table()
convenience method if you want to skip the call to the Connection::builder()
method.
$rows = $connection->table('foo')->where('bar', '=', $bar)->all();
Accessing the underlying PDO instance
You can also access the PDO object directly when needed.
$serverVersion = $connection->getPDO()->getAttribute(PDO::ATTR_SERVER_VERSION);


Manipulating the Document Object Model with pure JavaScript
click on a button to hide or show the related square.
be gone


Scope and Puppet as of 2.7
Puppet 2.7 issues deprecation warnings for dynamic variable lookup. Find out why, and learn how to adapt your Puppet code for the future!
What’s Changing?
Dynamic scope will be removed from the Puppet language in a future version. This will be a major and backwards-incompatible change. Currently, if an unqualified variable isn’t defined in the local scope, Puppet looks it up along an unlimited chain of parent scopes, eventually ending at top scope. In the future, Puppet will only examine the local, inherited, node, and top scopes when resolving an unqualified variable; intervening scopes will be ignored. In effect, all variables will one of the following:
- Local
- Inherited from a base class
- Node-level
- Global
To ease the transition, Puppet 2.7 issues deprecation warnings whenever dynamic variable lookup occurs. You should strongly consider refactoring your code to eliminate these warnings.
An example of dynamic lookup
include dynamic
class dynamic {
$var = "from dynamic"
include included
}
class included {
notify { $var: } # dynamic lookup will end up finding "from dynamic"
# this will change to being undefined
}
Why?
Dynamic scope is confusing and dangerous, and often causes unexpected behavior. Although dynamic scoping allows many powerful features, even if you’re being good, it can step in to “help” at inopportune moments. Dynamic scope interacts really badly with class inheritance, and it makes the boundaries between classes a lot more porous than good programming practice demands. It turns out that dynamic scoping is not needed since there are already better methods for accomplishing everything dynamic scope currently allows.
Thus, it’s time to bid it a fond farewell.
Making the Switch
So you’ve installed Puppet 2.7 and are ready to start going after those deprecation warnings. What do you do?
Qualify Your Variables!
Whenever you need to refer to a variable in another class, give the variable an explicit namespace: instead of simply referring to $packagelist
, use $git::core::packagelist
. This is a win in readability — any casual observer can tell exactly where the variable is being set, without having to model your code in their head — and it saves you from accidentally getting the value of some completely unrelated $packagelist
variable. For complete clarity and consistency you will probably want to do this even when it isn’t absolutely neccessary.
include parent::child
class parent {
$var = "from parent"
}
class parent::child inherits parent {
$local_var = "from parent::child"
notify { $parent::var: } # will be "from parent".
notify { $var: } # will be "from parent", as well. Avoid using this form.
notify { $local_var: } # will be "from parent::child". The unqualified form is fine here.
}
When referring to a variable in another class that is not a parent of the current class, then you will always need to fully qualify the variable name.
class other {
$var = "from other"
}
class example {
include other
notify { $other::var: } # will be "from other"
}
If you’re referring explicitly to a top-scope variable, use the empty namespace (e.g. $::packagelist
) for extra clarity.
$var = "from topscope"
node default {
$var = "from node"
include lookup_example
}
class lookup_example {
notify { $var: } # will be "from node"
notify { $::var: } # will be "from topscope"
}
Declare Resource Defaults Per-File!
Although resource defaults are not being changed, they will still be affected by dynamic scope; for consistency and clarity you’ll want to follow these rules for them, as well.
Using your resource defaults without dynamic scope means one thing: you’ll have to repeat yourself in each file that the defaults apply to.
But this is not a bad thing! Resource defaults are usually just code compression, used to make a single file of Puppet code more concise. By making sure your defaults are always on the same page as the resources they apply to, you’ll make your code more legible and predictable.
In cases where you need site-wide resource defaults, you can still set them at top scope in your primary site manifest. If you need the resource defaults in a class to change depending on where the class is being declared, you need parameterized classes.
All told, it’s more likely that defaults have been traveling through scopes without your knowledge, and following these guidelines will just make them act like you thought they were acting.
Use Parameterized Classes!
If you need a class to dynamically change its behavior depending on where and how you declare it, it should be rewritten as a parameterized class; see our guide to using parameterized classes for more details.
Appendix: How Scope Works in Puppet ≤ 2.7.x
(Note that nodes defined in the Puppet DSL function identically to classes.)
- Classes, nodes, and instances of defined types introduce new scopes.
- When you declare a variable in a scope, it is local to that scope.
- Every scope has one and only one “parent scope.”
- If it’s a class that inherits from a base class, its parent scope is the base class.
- Otherwise, its parent scope is the FIRST scope where that class was declared. (If you are declaring classes in multiple places with
include
, this can be unpredictable. Furthermore, declaring a derived class will implicitly declare the base class in that same scope.)
- If you try to resolve a variable that doesn’t exist in the current local scope, lookup proceeds through the chain of parent scopes — its parent, the parent’s parent, and so on, stopping at the first place it finds that variable.
These rules seem simple enough, so an example is in order:
# manifests/site.pp
$nodetype = "base"
node "base" {
include postfix
...snip...
}
node "www01", "www02", ... , "www10" inherits "base" {
$nodetype = "wwwnode"
include postfix::custom
}
# modules/postfix/manifests/init.pp
# (Template stored in modules/postfix/templates/main.cf.erb)
class postfix {
package {"postfix": ensure => installed}
file {"/etc/postfix/main.cf":
content => template("postfix/main.cf.erb")
}
}
# modules/postfix/manifests/custom.pp
class postfix::custom inherits postfix {
File ["/etc/postfix/main.cf"] {
content => undef,
source => [ "puppet:///files/$hostname/main.cf",
"puppet:///files/$nodetype/main.cf" ]
}
}
When nodes www01 through www10 connect to the puppet master, $nodetype
will always be set to “base” and main.cf will always be served from files/base/. This is because postfix::custom
’s chain of parent scopes is postfix::custom < postfix < base < top-scope
; the combination of inheritance and dynamic scope causes lookup of the $nodetype
variable to bypass node 01-10
entirely.
Thanks to Ben Beuchler for contributing this example.


Bug summary:
no expected things happened
Observed Behavior (a description of what happened with the app):
no tokens defined
Expected Behavior (a description of what you expected to happen):
a token should appear
Steps to Reproduce (the steps to reproduce the problem):
1. enter "test"
2. click 'next'
3. see what happen
Additional information:
Attachments:


help home
Input image: open
Showing:
Choose rotational symmetries:
sum of angles =
Tiling:
View:
Output image: save
Map data: save Precision:
Output image size:
Quality:


| public class | Application |
| public class | Button |
| public class | ButtonCreateParams |
| public class | Clipboard |
| public class | CloseEventArgs |
| public abstract class | Component |
| public class | ConcreteMessageFactoryFunction<T> |
| public class | Container |
| public class | ContainerControl |
| public class | Control |
| public class | ControlCreateParams |
| public class | DirectoryItem |
| public class | DirectoryItemLess |
| public class | Editor |
| public class | EditorCreateParams |
| public class | EmptyEventArgs |
| public class | Event<Handler, Args> |
| public class | FileDialog |
| public class | FileDialogCreateParams |
| public class | InvalidateGuard |
| public class | KeyEventArgs |
| public class | KeyPressedMessage |
| public class | Label |
| public class | LabelCreateParams |
| public class | ListBox |
| public class | ListBoxCreateParams |
| public class | MenuBar |
| public class | MenuControl |
| public class | MenuControlCreateParams |
| public class | MenuItem |
| public abstract class | Message |
| public class | MessageBox |
| public class | MessageBoxCreateParams |
| public class | MessageFactory |
| public abstract class | MessageFactoryFunction |
| public class | Point |
| public class | QuitMessage |
| public class | Rect |
| public abstract class | SelectAction |
| public class | Selection |
| public class | SelectionData |
| public class | ShowDialogGuard |
| public class | Size |
| public class | StatusBar |
| public class | StatusBarCreateParams |
| public abstract class | StatusBarItem |
| public class | StatusBarSpringItem |
| public class | StatusBarTextItem |
| public class | TextBox |
| public class | TextBoxCreateParams |
| public class | TimerEventArgs |
| public class | TimerMessage |
| public class | Window |
| public class | WindowManager |
| public class | WriteScreenEventArgs |
| public class | WriteScreenMessage |
| public void | Clear(const Rect& rect, ConsoleColor foreColor, ConsoleColor backColor) |
| String<char> | MakeApplicationMessageQueueName() |
| public DirectoryItem | MakeItem(const String<char>& directory, const DirectoryEntry& entry) |
| public Message* | ReadMessage(byte* messageData, int messageSize) |
| public void | RegisterMessage<T>(int messageId) |
| public List<String<uchar>> | SplitIntoLines(const String<uchar>& text, int width) |
| public void | WriteBox(const Rect& rect, ConsoleColor foreColor, ConsoleColor backColor) |
| public nothrow bool | operator==(const Point& left, const Point& right) |
| public nothrow bool | operator==(const Rect& left, const Rect& right) |
| public nothrow bool | operator==(const Size& left, const Size& right) |
| public class delegate void | ChangedEventHandler() |
| public class delegate void | CloseEventHandler(CloseEventArgs & closeEventArgs) |
| public class delegate void | FocusEventHandler() |
| public class delegate void | KeyEventHandler(KeyEventArgs & keyEventArgs) |
| public class delegate void | PressedEventHandler() |
| public class delegate void | SelectEventHandler() |
| public class delegate void | TimerEventHandler(TimerEventArgs & args) |
| public class delegate void | WriteScreenEventHandler(WriteScreenEventArgs & writeScreenEventArgs) |
| public enum | ButtonFlags |
| public enum | ControlFlags |
| public enum | DialogResult |
| public enum | EditorFlags |
| public enum | FileDialogKind |
| public enum | InvalidateKind |
| public enum | MenuControlFlags |
| public enum | MenuItemFlags |
| public enum | MenuItemState |
| public enum | MessageBoxButtons |
| public enum | StatusBarFlags |
| public enum | WindowFlags |
| public const uchar | boxHorizontal = cast |
| public const uchar | boxLeftBottom = cast |
| public const uchar | boxLeftTop = cast |
| public const uchar | boxRightBottom = cast |
| public const uchar | boxRightTop = cast |
| public const uchar | boxVertical = cast |
| public const byte | defaultFocusedControlBackColor = ConsoleColor.blue |
| public const byte | defaultFocusedControlForeColor = ConsoleColor.white |
| public const uchar | emptyDocumentSymbol = cast |
| public const uchar | folderSymbol = cast |
| const int | tabSize = 4 |
| T |


---
layout: post
title: If You Want a Job, Wake Up and Smell the Coffee
date: 2014-07-28 19:41:29.000000000 -05:00
type: post
published: true
status: publish
categories:
- Ruby on Rails
tags: []
meta:
_publicize_pending: '1'
publicize_twitter_user: bobr_az
is_reblog: '1'
post_id: '621'
blog_id: '34610005'
reblog_snapshot: "O:8:\"stdClass\":8:{s:5:\"title\";s:47:\"If You Want a Job, Wake
Up and Smell the Coffee\";s:4:\"type\";s:4:\"post\";s:9:\"mime_type\";s:0:\"\";s:6:\"format\";b:0;s:12:\"modified_gmt\";s:19:\"2014-07-25
13:43:10\";s:9:\"permalink\";s:96:\"http://joblinkofmaryland.wordpress.com/2014/07/24/if-you-want-a-job-wake-up-and-smell-the-coffee\";s:7:\"content\";s:12542:\"
\n\n
\r\n\r\nI must confess.Â Although I like gadgets, I am
not a techie per se.Â Many of us enjoy technology and believe that we are well
versed in it.Â But, I would call that the End-User Syndrome.Â That is, we enjoy
the benefits of our smart phones and mobile devices.Â We love to be able to do
all sorts of things online, including looking up answers quickly, making purchases,
and paying bills (OK, thatâ\x80\x99s not so much fun).Â However, few of us would
ever be interested in assembling hardware or even writing the code which drives
the Internet or the apps we use.\r\n\r\nToday, I had an opportunity to meet with
recruiters Alexa and Lee at a technology recruiting company in my area.Â Following
an explanation of what I do, I asked them about their staffing needs.Â I also
asked them what areas were hard-to-find and therefore represent
opportunities
for current and future job seekers in our community.Â They replied, practically
in stereo, â\x80\x9C
Javaâ\x80\x9D!Â And they did not mean the
kind from Starbucks or Dunkin Donuts.Â I then asked them to list other areas
of IT and we came up with the list which appears below.\r\n\r\nCaveat:Â I mentioned
that I am not a techie, right?Â So, I cannot say that I am conversant with these
languages or platforms.Â I canâ\x80\x99t say that I fully understand the descriptions
which I gathered from my research.Â But, what I can say is that based on this
recent meeting and the information I have gleaned from other IT professionals,
these represent current, imminent, and future skill areas which are in demand.Â
The Baltimore-Washington corridor is full of government employers, contractors,
and commercial technology companies who are starving for these skill sets.Â There
are many quality jobs out there which are ripe for the taking, if people would
have these skills.Â Within Information Technology (â\x80\x9CITâ\x80\x9D) the
unemployment rates range from less than 1% to just over 3%, which is
half
of the national rates.Â See
this
graphic.\r\n\r\nIt would therefore be important for parents of young people
to pay attention to what is out there by way of available jobs and those skills
which will be needed for kids to achieve gainful employment.Â Peruse job descriptions
and titles.Â Look at the experiential and education requirements.Â Young people
should be encouraged to learn these areas early and often, in school and at home.\r\n\r\nSo
in that spirit, I am presenting some areas which came up during my meeting, starting
with the coffee (which they did offer me, by the way), or more importantly Java.\r\n\r\n
Java
(not to be confused with Java Script) is a programming language that is concurrent,
class-based, object-oriented, and specifically designed to have as few implementation
dependencies as possible. It is intended to let application developers \"write
once, run anywhere\" (WORA), meaning that code that runs on one platform does
not need to be recompiled to run on another. Java applications are typically compiled
to bytecode (class file) that can run on any Java virtual machine (JVM) regardless
of computer architecture. Java is, as of 2014, one of the most popular programming
languages in use, particularly for client-server web applications, with a reported
9 million developers. The language derives much of its origins from C and C++,
but it has fewer low-level facilities than either of them.\r\n\r\n
Ruby
on Rails (or â\x80\x9C
Railsâ\x80\x9D) is an open source
full-stack web application framework written in the Ruby Programming Language.
Rails is capable of gathering information using pages and applications from the
web server and can interact with a database and can retrieve information from
the database. Rails works as routing system that works independently from the
underlying web server. Rails is designed to make building web applications simpler
by utilizing convention over configuration. In doing so Rails greatly simplifies
the creation of certain applications while complicating the creation of others.\r\n\r\n
Python
is a widely used general-purpose, high-level programming language. Its
design philosophy emphasizes code readability, and its syntax allows programmers
to express concepts in fewer lines of code than would be possible in languages
such as C. The language provides constructs intended to enable clear programs
on both a small and large scale.\r\n\r\n
Extensible Markup Language
(or â\x80\x9C
XMLâ\x80\x9D) is a markup language that defines
a set of rules for encoding documents in a format that is both human-readable
and machine-readable. It is defined in the XML 1.0 Specification produced by the
W3C, and several other related specifications, all free open standards.\r\n\r\n
Cloud
computing is the delivery of computing as a service rather than a product, whereby
shared resources, software, and information are provided to computers and other
devices as a utility (like the electricity grid) over a network (typically the
Internet). Clouds can be classified as public, private or hybrid.Â The term \"moving
to cloud\" also refers to an organization moving away from a traditional CAPEX
model (buy the dedicated hardware and depreciate it over a period of time) to
the OPEX model (use a shared cloud infrastructure and pay as one uses it).\r\n\r\n
MapReduce
is a programming model and an associated implementation for processing and generating
large data sets with a parallel, distributed algorithm on a cluster.Â A MapReduce
program is composed of a Map procedure that performs filtering and sorting (such
as sorting students by first name into queues, one queue for each name) and a
Reduce procedure that performs a summary operation (such as counting the number
of students in each queue, yielding name frequencies). The \"MapReduce System\"
(also called \"infrastructure\" or \"framework\") orchestrates the processing
by marshalling the distributed servers, running the various tasks in parallel,
managing all communications and data transfers between the various parts of the
system, and providing for redundancy and fault tolerance.\r\n\r\n
Apache
HTTP Server (or â\x80\x9C
Apacheâ\x80\x9D) is a web server
application notable for playing a key role in the initial growth of the World
Wide Web.[3] Originally based on the NCSA HTTPd server, development of Apache
began in early 1995 after work on the NCSA code stalled. Apache quickly overtook
NCSA HTTPd as the dominant HTTP server, and has remained the most popular HTTP
server in use since April 1996. In 2009, it became the first web server software
to serve more than 100 million websites.\r\n\r\n
Apache Hadoop
is an open-source software framework for storage and large-scale processing of
data-sets on clusters of commodity hardware. Hadoop is an Apache top-level project
being built and used by a global community of contributors and users.Â It is
licensed under the Apache License 2.0.\r\n\r\n
Pig Script (or
â\x80\x9C
Pigâ\x80\x9D) is a high-level platform for creating
MapReduce programs used with Hadoop. The language for this platform is called
Pig Latin. Pig Latin abstracts the programming from the Java MapReduce idiom into
a notation which makes MapReduce programming high level, similar to that of SQL
for RDBMS systems. Pig Latin can be extended using UDF (User Defined Functions)
which the user can write in Java, Python, JavaScript, Ruby or Groovy and then
call directly from the language.\r\n\r\n \r\n\r\nThe $64,000 question is from
where and how skills in these areas are to be obtained?Â Well, a first step is
to get our youth interested in IT fields such as
programming
(or â\x80\x9C
codingâ\x80\x9D).Â Here are some helpful resources
for parents.Â For parents of younger children, see
here.Â
For older children, there are a bunch of often
free online tutorials
which can be accessed
here,
here,
and
here.Â For information on the
up-and-coming specialization of
robotics, please see
here.\r\n\r\nAnother
step is to encourage local educational entities to get on board in terms of added
focus and classes.Â Our middle and high schools, colleges, and experiential training
environments need to be encouraged to offer classes these areas.Â These classes
will serve to expose students to as well as hopefully cultivate interest in IT
(I have previously expressed the same for all of STEM fields.)Â Given the current
and emerging opportunities in the Baltimore-Washington area, this would serve
to align our youth with a path towards gainful employment.\r\n\r\nAnother step
is to seek out training opportunities.Â These might come in the form of experiential
scenarios like internships and entry-level jobs in IT.Â Since much of what goes
on in IT is gained on the job, exposure to current and emerging technologies might
be more important than what could be taught in a classroom.Â This does not obviate
the need to consider degree programs or industry recognized certifications in
various technologies.Â For some jobs, an IT degree is required and will often
be critical to career growth to management or higher-level positions.\r\n\r\nOne
comment which I frequently get from parents and young people is â\x80\x9Cif the
technology is constantly changing, what I learn or train on today will be obsolete
by the time I will be looking for a jobâ\x80\x9D.Â While that might sound logically
true, it is in fact erroneous.Â What a person learns today will provide the foundation
of the fundamentals for how things work within IT.Â Therefore, exposure and experience
today will lay the groundwork for the future.\r\n\r\nIn closing, I will add a
few points:\r\n
\n- Qualified IT professionals are in very high demand, and
will be, for the foreseeable future. There are many vacancies and recruiters struggle
to find suitable people to fill them.Â However, not all credentials are the same.Â
Degrees from accredited, recognized, and respected institutions will always garner
significantly more interest from employers than certifications from dubious ones.
\r\n\t- IT
degrees are a great investment. To earn such a credential requires much less investment
of time than the training required in obtaining comparable levels of employment
and compensation.Â A solid Bachelorâ\x80\x99s degree in IT will usually result
in positive job prospects upon graduation.
\r\n\t- The Baltimore-DC area
has many government bureaus, security agencies, and contractors. Because many
such employers require U.S. Citizenship as a requirement, people born in the U.S.
are often at an advantage, if they are qualified technically.Â Furthermore, those
born in this country may have an easier time being issued a Security Clearance,
which is also required for many well-paying IT positions.Â So, the combination
of technical training, skills and being from this area will make for a very compelling
resume.
\r\n\t- The incredible popularity of portable computing made possible
by smart phones and mobile devices will only increase as new devices and technologies
are introduced. Consequently the skills listed above will be even more marketable.
\r\n
\r\nThe
world is rapidly changing and so is IT, perhaps even more so.Â In a very different
context during my years in summer camp, we were told that â\x80\x9Clearning never
endsâ\x80¦clean-up begins right nowâ\x80\x9D.Â For IT as well, this is so true.Â
The proper perspective is to not only gain skills at the entry-level but maintain
currency.Â This requires a mindset of continuous learning and adaptability to
whatever comes down the pike.\r\n\r\n \r\n\r\n[Blogger's note: I wish to thank
Alexa, Lee, and Sam for their helpful technical inputÂ in preparing this, as well
as Wikipedia for translating many of the technical terms into plainer English.]
\";s:15:\"images_mirrored\";i:1;}"
publicize_twitter_url: http://t.co/Owa1RCdl7l
_wpas_done_7641025: '1'
_publicize_done_external: a:1:{s:7:"twitter";a:1:{i:2516516912;b:1;}}
publicize_linkedin_url: http://www.linkedin.com/updates?discuss=&scope=336165323&stype=M&topic=5899715128001060864&type=U&a=LFKo
_wpas_done_7777887: '1'
author:
login: broberts65
email<EMAIL_ADDRESS>display_name: Bob Roberts
first_name: ''
last_name: ''
---
As a Rails Developer and one that hires developers, I can attest to "the unemployment rates range from less than 1% to just over 3%"


<EMAIL_ADDRESS>ReplyTo<EMAIL_ADDRESS>To<EMAIL_ADDRESS>What is your loan purpose?
First Name
Middle Name
Last Name
Mobile Number
Date of Birth
Your residential adress
Suburb
City
Are you a New Zealand Resident?
ID Confimation
Drivers License Number(5a)
Version(5b)
Drivers licence expiry
Company Name
Company Address
Job Title
Employed Since
Income After Tax
Bank Name
Branch
Branch Address
Your bank account details - for Direct Debit payments
Your Email Address
User Indicator


#* The server renders this HTML page in an end-user's browser when needed authentication credentials may be obtained via HTTP Basic Authentication or an HTML form. Velocity variables (identified by the $ character) are generated at runtime by the server. The following variables are available on this page, but not used by default: $entityId - The entity ID (connection ID) of the SP Connection used in this SSO transaction $connectionName - The name of the SP Connection used in this SSO transaction $client_id - The ID of the OAuth client used in this transaction $spAdapterId - The SP Adapter ID used in this transaction It is recommended to sanitize the values that are displayed using $escape.escape() for example $escape.escape($client_id). Change text or formatting as needed. Modifying Velocity statements is not recommended as it may interfere with expected server behavior. *# #set( $messageKeyPrefix = "html.form.login.template." ) #set ($enableCheckboxByDefault = false) #if($rememberUsernameCookieExists) #set ($rememberUsernameChecked = "checked") #else #if($enableCheckboxByDefault) #set ($rememberUsernameChecked = "checked") #else #set ($rememberUsernameChecked = "") #end #end


QUESTION PAPER
Semester 2
THEORY
English Language & Technical Communication-II [HU201]
Physics-II [PH201]
Mathematics-II [M201]
Basic Electrical & Electronic Engineering-II [ES201]
Engineering Thermodynamics & Fluid Mechanics [ME201]
Principles of Computer Programming-II [CS201]
PRACTICAL
Physics-II [PH291]
Basic Electrical & Electronic Engineering-II [ES291]
Workshop Practice [ME291]
Engineering Drawing & Computer Graphics [ME292]
Principles of Computer Programming-II [CS291]
SESSIONAL
Language Laboratory-II [HU281]


#include <serializablecompressordecoder.h>
List of all members.
Definition at line 17 of file serializablecompressordecoder.h.
The decoded object.
Definition at line 20 of file serializablecompressordecoder.h.
The presentation time stamp.
Definition at line 23 of file serializablecompressordecoder.h.


[§421C-18] Removal of officers. Section 421-16, relating to the removal of an officer of an agricultural association, shall apply to associations formed under this chapter. [L 1982, c 97, pt of §2]


Bones is a bare-bones responsive grid similar to bootstrap and very similar (and loosely based on) skeleton. It is written in LESS and gives the developer 100% fine grained control over everything. If your're a type-A control freak, you'll love Bones. What are the benefits of Bones other than sharing names with an awesome show?
Implementing bones is fairly straightforward, but because it is written in LESS it requires some additional tools in order compile the LESS file into a CSS. Find more information on LESS on their website. If you are developing in windows, I would like to suggest WinLESS to pre-compile you LESS files into CSS prior publish. I do not recommend compiling the LESS file on the client via the JavaScript plugin.
You can find the full documentation on my webpage as well as links to download the framework.