The hero has his back up against the wall. He's tied to the chair blindfolded, the firing squad is taking aim, the shark tank is sliding into position, the laser cannon/deathtrap is warming up, and his last cigarette is already half ash, you know the drill. By all accounts, his pooch is clearly about to be screwed.
And the Mad Scientist's Beautiful Daughter or The Baroness or the Femme Fatale moves in for that last lingering sadistic Last Kiss to resolve that pesky UST...
Cue the Downer Ending, right? Not so much; as it works out, during the kiss she slipped into his mouth the key to his shackles, or a lock pick or the appropriate piece of Phlebotinum, ensuring that our intrepid hero lives on to fight (and kiss) another day.
Examples:
- Eat-Man: Rain slipping Bolt the last piece of her gynormous BFS in the pick.
- In the manga Red River, Rusafa is framed for assaulting a nobleman's daughter and is placed out in the desert, his arms and legs all stretched out and tied with leather and is to be left there for five days. If he manages to escape or is alive when the five days are up, he can go free because 'the gods allowed him to live'. Yuri goes to him (accompanied by guards), kisses him, and passes him a sharp sliver of obsidian, which he somehow manages to spit out towards his hand, pick up and cut himself free with.
- Towards the end of 009-1, Mylene is captured by the Eastern Bloc. She manipulates the guard into kissing her. While their lips are locked, she tongues a Cyanide Pill into his mouth. After he falls over dead, she picks the locks to her restraints and escapes.
- A variation occurs in JoJo's Bizarre Adventure, wherein Jotaro frenches a possessed, rabid school nurse in order to force her mouth open, allowing Star Platinum to enter and pull out the enemy Stand controlling her with its teeth.
- In Banana Fish, Ash uses an empty medicine capsule and a kiss to pass important information to Eiji. It's implied to be Eiji's Sacred First Kiss, but he doesn't seem to mind giving it to Ash ...
- In the final arc of Assassination Classroom, Bitch-Sensei uses this to smuggle bomb components in to the students, who are in government custody.
- In Neon Genesis Evangelion, Kaji slips Misato a computer chip containing the intelligence he's gathered on SEELE the last time he kisses her shortly before he's assassinated.
- Batman: At the conclusion of "The Saga of Ra's al Ghul", Batman is stung by a scorpion while fighting a duel against Ra's. Talia lingers by the dying Batman, saying she wishes to give him one last kiss. However, she uses the kiss to give him an antidote to the scorpion venom, allowing him to recover hours later.
- Robin: When surrounded by Tvorakovich's heavily armed men Dava grabbed Robin and kissed him to share the Aramilla she has just sneakily taken.
 An enraged XIII grabs him by the lapel before being subdued by the guards and remains silent until he's back in his cell. Where he reveals that he ripped off the Mongoose's visitor badge, and more importantly the safety pin on it, so as to unlock his cuffs.
- In A Cure for Love Misa attempts to do this with a Forceful Kiss, trying to restore Light's Kira memories with a scrap of the Death Note she has hidden under her tongue, but it doesn't work and Light pushes her away.
- The 1979 film The Great Train Robbery, based on the Michael Crichton book of that name. (Scene's in the book, too.)
- Parodied in Austin Powers in Goldmember, where Frau Farbissina passes a key to Dr. Evil this way, as an excuse to slip in an excruciatingly long, wet, sloppy makeout scene between the two of them.
- In Our Man Flint, Gila commits to her High-HeelFace Turn by using this method to slip Flint his cigarette lighter while kissing him.
- In Æon Flux, Aeon receives a pill containing a message this way.
Mike Nelson: Man, there must be an easier way to get your vitamins.
- In The A-Team the team is being carted back to prison at the end when Face reveals that Sosa used their kiss goodbye to slip him the key to their cuffs.
- In The Adventures of Ford Fairlane, the titular character gives his girlfriend/secretary a sudden kiss at a dinner party to quickly get rid of a nasty-tasting hors-d'oeuvre. Since, you know, spitting it out on the ground would be rude...
- In the TV movie The Great Houdinis, Bess, his wife, traditionally kissed him (and passed the key to the handcuffs he was wearing) after Houdini was shackled naked before being placed inside the trick. Unfortunately, during one trick when he was underwater, she overhears one of the local police mention that he (the cop) had filled the handcuff lock with buckshot. She barely has time to stop the trick before he drowned.
- In Roger Zelazny's The Changing Land, the resurrected priestess Semirama does this (with considerable... emphasis) to slip a key to Dilvish (who happens to be the spitting image of his ancestor, who was her lover) when he's chained in the dungeon of the Castle Timeless.
- Played more or less straight in the climax of S.M. Stirling's Under the Yoke: the protagonist doesn't escape, but does manage to slip the microfilm to a supporting character who does.
- In Burndive a (female) dealer passed drugs this way to Ryan.
- In an example so inverted that it wraps around and makes a bizarre kind of perfect sense, in The Dresden Files, Harry Dresden, as per usual in the dregs of his psychic battery, gets Lara Raith to kiss him and uses the emotion inspired by her succubus's power to fuel one last, desperate spell.
- A rather funny scene in Swordhunt where Nveid passes Arrhae a MacGuffin this way, and she covers it by decking him for daring to kiss a senator without her permission.
- Allomancer Jak, the star of a pulp serial written in-universe during Wax and Wayne, claims this happened during one of his adventures. Jak is an Allomancer, someone whose magic powers run on ingested metals, in his case, tin enhances senses. When captured by a tribe of koloss, his girlfriend kisses him to pass him powdered tin.
- Angel:
- Played with when Doyle hands off his psychic whammy to Cordelia before he does the Heroic Sacrifice thing.
- Also done later when it was retconned that Cordelia gave Angel one of those psychic whammies so that he could end the series.
- In the Star Trek: Deep Space Nine episode "Our Man Bashir" a Genre Savvy Julian Bashir gets out of a pair of handcuffs in this manner via a holographic Bond Girl (who happens to be storing the genetic pattern of Jadzia Dax due to some Techno Babble plot occurrences, and so looks just like her). Complete with the actual former spy who is also tied up with him remarking that they never taught that particular trick ("kiss the girl, get the key") when he was in the service.
- Somewhat inverted in Jekyll. Claire (apparently) swallows the key to Hyde's chains to prevent him from escaping. Hyde, ever horny and homicidal, gives her a long, slow one. Result.
- Happens in an episode of Monk when the homicidal magician's stage assistant takes pity on the titular character. Being Monk, though, the very thought of swapping a plot device orally freaks him out enough to alert his captor.
- In Harper's Island, Abbey slips a key to Jimmy's handcuffs when she kisses him goodbye.
- In Lost Girl, Kenzi visits Bo in prison, pretending to be her girlfriend, then gives her a kiss that lasts a really long time before the guards get fed up and drag her out. It is then revealed that Kenzi had passed Bo a magic gem.
- In Da Vinci's Demons Lucrezia and Zoro are chained together and about to Walk the Plank (or at least get shoved off it).
- In the Australian mini-series Janus, a prison guard catches drugs being passed this way from a visiting girlfriend to an inmate and forces him to spit it out.
- Used in The Last Ship where a Fake-Out Reunion Kiss allows Dr. Scott to slip information of an extraction to CDR Chandler, while aboard the RFS Vyerni.
- Blake's 7. In "Ultraworld", Dayna and Tarrant use a Fake-Out Make-Out to remove a micro-grenade hidden in Dayna's tooth.
- The CSI episode "Abra-Cadaver" involved a magician whose mouth contained a "skin pocket" that he used to conceal small objects like keys.
- Kate Bush depicted Houdini's trick in her song "Houdini" and on the cover of her album The Dreaming◊. (Look at what's in her mouth.)
- At the end of Hitman: Blood Money Dianna slips 47 the antidote of the feign-death poison she injected into him earlier through her lipstick. Subverted in that if the player doesn't juggle the joysticks fast enough to get his heart rate up, he'll slowly be pushed into the giant crematorium oven
- Batman: The Animated Series: This is apparently foreplay for Talia and Bruce Wayne. In "Daughter of the Demon", she gives him a dose of scorpion venom antidote (a scene borrowed from the Batman comics). In another episode, she gives him a lock pick.
- Æon Flux:
- Trevor Goodchild does this to Aeon Flux, except he actually stores the microfilm into her false tooth and closes the lid. With his tongue. No wonder she's into him.
- Happens in the movie as well.
- Inverted in Rango. The titular character sneaks into the prison with a bullet hidden in his mouth. After ungagging Beans, she kisses him and accidentally takes (and swallows) the bullet.
- Turns out this is the trick behind a good deal of stage magic. In particular, Houdini's wife is said to have aided him in this fashion on several occasions.
- This is a favourite means of passing drugs to someone during a prison visit. Probably any prison show has depicted this at one time or another.


Over 175 million professionals use LinkedIn to exchange information, ideas and opportunities
- Start informed about your contacts and industry
- Find the people & knowledge you need to achieve your goals
- Control your professionals identity online
Search for someone by name:


My Powershell Journey
My Powershell Journey
I’ve met a handful of folks who, when I talk to them about automating the boring stuff, they tend to shrug it off and say “I don’t have time” or “I’m not a developer”. This blog is for you (or if you want to know my journey of how I changed my career by learning Powershell).
I’ve been in IT for over 5 years, and have specifically been using Powershell at work for the last 3 years, and meaningfully in the last 2 years.
A Powershell Noob
Two years ago, I was using powershell to run a handful of “one-liners”. Such as:
Get-ADUser -Identity jmoss
Which returned some interesting data. With this in mind, I would simply find the data I’m looking for, and paste it into notepad or an email to my boss. What I didn’t realize was this concept that properties should be treated as objects.
Once I realized that most of what I write in Powershell can be treated as an object, a light-bulb clicked. This happend about a year and a half ago, in early 2017. It was then where I realized that I had approached Powershell all wrong. It wasn’t just another prompt to view an IP Address or list a phone number of an Active Directory user, it was the glue to automating everything I need and exporting it to anything I want.
It was at this point when I started to really kick it into high gear and force myself to use Powershell daily, and not just to get information randomly.
Walking with Powershell
At an old company I used to work for, our IT department would receive html files from a vendor that included a bunch of tables with data in them, which needed to be exported to a txt file and finally imported into a SQL Server. The vendor had been sending us data in this format because their ERP only allowed for that (what year is it?!!??!?).
Our IT department was spending 1.5 hours a day parsing this data manually. There was clearly a problem that could be resolved with Powershell.
I used Powershell to parse the data in these HTML files using ImportExcel’s Get-HTMLTable
cmdlet, grab the data, store it in variables, and then export to a TXT file using Out-File
to a fileshare.
When all was said and done, I ended up creating a 50-60 line script that saved our department about 10 hours a week in manual work that was otherwise deemed “too difficult” to automate.
As far as I know, this code is still being used in production.
It was ugly code, but it worked, and gave me a ton of insight in how to use PSCustomobject’s and using Git to ensure my code was versioned-controlled.
Crawling with Powershell
Around the time, I continued to learn more and more about Powershell by attempting to automate other things at work, developed a git repository with VSTS and integrated it into VS Code, shared that code with a co-worker, and encouraged my co-worker to develop his own script and add it to the collection.
I continued developing scripts to deploy a virtual machine in our environment and copy files to 60 physical servers.
Running with Powershell
to be continued
Recap
To recap, here’s a few highlights of my journey and observations that I’ve made in the last 2 years:
- I’m nowhere close to “running with Powershell” but I intend to keep using Powershell to automate what I can.
- I’ve used Powershell almost daily at work for the last 2 years to automate business “tasks” and produce reports (mostly for myself or my team)
- Companies are hiring people who know Powershell. I’ve nearly doubled my Salary since first being exposed to Powershell about 3 years ago.
- Powershell can now be used on macOS, Linux, and Windows + it’s open-sourced, meaning it will continue to get better.
- Every software service that Microsoft publishes (AD, DNS, DHCP, Azure, O365, Sharepoint, etc) can be managed/automated using Powershell (and Powershell Core!).
Overall, don’t be afraid to just dive in and start solving a real problem at work with Powershell, and not just simply learn about the concepts (which is also extremely important).
Here are some ways to jump in and start growing in your career using Powershell:
- Join the Powershell Slack and read what others are doing with it.
- Go on Github and see what others are doing with Powershell.
- Go to the Powershell subreddit and read the posts where people talk about what they’ve done with Powershell each month (link here).


Innisfree Green Tea Balancing Cream
Claire's Cloud 9 Blanc De Whitening Cream
Tonymoly Pure Eco Snail Moisture Gel
Missha All Around Safe Block Sebum Zero Sun
Skin79 Fresh Garden Mask - Snail
Cosrx Advanced Snail 92 All in one Creams
Innisfree Canola Honey Mask
Scinic Honey Banana Cleansing Foam


A 12—column grid system for handling layout. The grid is responsive, mobile-first and built on flexbox.
Grids are composed of a Grid container and any number of GridColumn children whose widths total to 12 columns.
By default, grid columns have equal widths. Add any number of grid columns to a grid component and they will each assume an equal width.
You can define an explicit width for each column by appending the desired width to the GridColumn class. The combined column widths must total to 12.
If you define an explicit width for just one column, the other columns will automatically divide the remaining space between themselves.
Grid columns will automatically flow onto multiple rows. Just make sure the total column width per row adds up to 12.
You can define a different column width for each responsive breakpoint by using the 4 responsive class prefixes. Begin by defining the desired column width for mobile, then add classes for larger breakpoints as necessary.
You can set columns to be stacked initially, then span multiple rows at larger breakpoints.
Neutral buttons are the default and should account for almost all actions.
Neutral buttons are the default and should account for almost all actions.
Neutral buttons are the default and should account for almost all actions.
Neutral buttons are the default and should account for almost all actions.


| Class | Description |
|---|---|
| AppNameList |
This holds a list of appNames.
|
| ChangeSetList |
This holds a list of dataETag (changeSet) values.
|
| ClientVersionList |
This holds the list of odkClientVersion values available on the server.
|
| Column |
The XML document that represents a column.
|
| DataKeyValue |
Serialization:
Holds the key-value entry for one user-defined field of the row
|
| Error |
Error return type.
|
| OdkTablesFileManifest |
This holds a list of
OdkTablesFileManifestEntry . |
| OdkTablesFileManifestEntry |
This represents information about a file so that a phone running ODKTables
will be able to check to see if it has the most recent version of the file,
and if not will be able to download the file.
|
| PrivilegesInfo |
This contains the default group of the user and the list of
groups and roles to which the currently authenticated user is
assigned.
|
| PropertyEntryJson |
If you use the 'properties' API, please consider switching
to the put/get of the properties.csv.
|
| PropertyEntryJsonList |
This holds a list of
PropertyEntryJson . |
| PropertyEntryXml |
If you use the 'properties' API, please consider switching
to the put/get of the properties.csv.
|
| PropertyEntryXmlList |
This holds a list of
PropertyEntryXml . |
| Row | |
| RowFilterScope | |
| RowList |
This holds a list of
Row . |
| RowOutcome | |
| RowOutcomeList |
This holds a list of
Row . |
| RowResource | |
| RowResourceList |
This holds a list of
RowResource . |
| Scope | |
| TableAcl | |
| TableAclResource | |
| TableAclResourceList |
This holds a list of
TableAclResource . |
| TableDefinition |
Represents the XML format of a table definition.
|
| TableDefinitionResource | |
| TableEntry |
A TableEntry defines very only the tableId, the tableKey (for now), and ETags
for the data and the properties.
|
| TableResource | |
| TableResourceList |
This holds a list of
TableResource . |
| UserInfo |
Describes a user who can manipulate odkTables appName content.
|
| UserInfoList |
This holds the list of UserInfo structures describing
the users that can manipulate odkTables appName data.
|
| Enum | Description |
|---|---|
| Error.ErrorType | |
| RowFilterScope.Access |
Type of Filter.
|
| RowOutcome.OutcomeType |
Possible values:
UNKNOWN -- initial default value
SUCCESS -- rowETag, dataETagAtModification, filterScope updated
DENIED -- permission denied -- just the rowId is returned
IN_CONFLICT -- server record is returned (in full)
FAILED -- anonymous insert conflict (impossible?) or
delete of non-existent row -- just rowId is returned
|
| Scope.Type |
Type of Scope.
|
| TableRole | |
| TableRole.TablePermission | |
| TableType |
Copyright © 2019 Open Data Kit. All rights reserved.


The nuiHighlight
pipe is used to mark a portion of text. It will search the
provided text for the specified string and highlight it.
NuiCommonModule
This pipe can only be used with the innerHTML
attribute. It escapes all the characters by default, and highlights every match in the string.


|
OpenM++ runtime library (libopenm)
|
OpenM++ platform-specific utility functions. More...
Go to the source code of this file.
Namespaces | |
| openm | |
| openM++ namespace | |
Functions | |
| int64_t | openm::getMilliseconds (void) |
| return number of milliseconds since epoch to measure intervals | |
| const std::string | openm::getDefaultLocaleName (void) |
| get user prefered locale name: en-CA en-CA or empty "" string on error | |
| std::tuple< uint64_t, uint64_t > | openm::getProcessMemorySize (void) |
| return current process memory size and max peak memory size, in bytes. More... | |
OpenM++ platform-specific utility functions.


Navbar
Home
Logout
Create Article
All Articles
Are you sure you want to delete this article?
Article: ${title}
${content}
Created By: ${author}
Created On: ${createdOn}
Delete
Cancel


Symbol Index for ".Basis and Results of Activity"
Symbol Index for diagram
".Basis and Results of Activity"
Activity (Class)
activity for (Association)
Activity For Subject (Class)
Activity State (Class)
Activity Under Consideration (Class)
Activity/Direction (Generalization Node)
Activity/State (Generalization Node)
Actual Outcome (Class)
Actual Property (Class)
actual source of (Association)
Agent Accepted Intention (Class)
Completed Activity (Class)
Established Focus (Class)
FFA/State (Generalization Node)
focus for (Association)
focus for (Association)
Focus For Further Activity (Class)
Focus State (Class)
Intention (Class)
intention for (Association)
Intention State (Class)
Intention Under Consideration (Class)
Intention/State (Generalization Node)
property for (Association)
property for (Association)
PrQ/Association (Generalization Node)
Relevant Focus (Class)
source of (Association)
SPh/Essential Type (Generalization Node)
SPr/Time (Generalization Node)
subject (Association)
Subject (Class)
Subject Phenomenon (Class)
Subject Property (Class)
Subject Property Qualifier (Class)


Player 1
Player 2
Player 3
Player 4
8-Princess (1): Lose if discarded
7-Countess (1): Discard if caught with King or Prince
6-King (1): Trade hands
5-Prince (2): One player discards his or her hand
4-Handmaid (2): Protection until your next turn
3-Baron (2): Compare hands; lower hand is out
2-Priest (2): Look at a hand
1-Guard (5): Guess a player's hand


We only source the highest quality signed pieces from the leading designers in vintage costume jewellery from the 1940s to the 1980s. Totally unique!


Sign up Buyer Supplier First name Last name Email We'll never share your email with anyone else. Phone Create password Repeat password Register I agree with terms and contitions Name Address Line 1 Address Line 2 City State Zip Code Country Email We'll never share your email with anyone else. Phone Create password Repeat password Register I agree with terms and contitions Have an account? Log In {% endblock content%}


We Make The Best Technology Business Solution For Our Clients
EnkosiDigital Pty Ltd is a Data and IT company that is located in Lusikisiki and Mthatha , Eastern Cape in South Africa we offer businesses solutions in data analysis, business intelligence, software development, data warehousing, and data mining. We enable your business to grow using technology and data. We specialise in IT services, Data Analytics and Business intelligence solution. We provide innovative solution that helps business to improve, make informed decision and work in an efficient manner using technology and data. We use mathematics, statistical methods and computer science techniques to create solution which uses technology and data to solve real world problems.
We strive to, not only offer advanced technology solution for our clients, but to support upcoming innovators and ongoing changes in the industry due to the rapid changes in the technological world.
At EnkosiDigital, we continue to promote innovation by engaging ourselves in the latest technologies and patterns of the industry and ensuring our clients are always getting the best solutions. Our committed customer service team always guarantee first class service for our devoted clients. At EnkosiDigital we strive to help our clients grow their business, ensuring they always have the best and most efficient technology at their fingertips, every day.
Use data to understand customer behaviour by finding trends. Know what product customer want, when they want and what price they are willing to pay for the product.
We use data analytics to help businesses grow and have competitve advantage by understanding the industry and .
EnkosiDigital offers services to enable and empower our client's businesses, consulting , implementation and support in BI (Business Intelligence), Analytics.
Optimizing marketing campaigns by decrease attrition by accurately predicting customers most likely to leave and developing the right proactive campaigns to retain them.
Build data warehouse ,data lacks and databases that will allow you to easily store the right files on the right tiers and eliminate redundant or obsolete data to make more effective and intelligent use of tiered storage.
Implement governance regulation in align to POPI Act and GDRP . We do consulting for companies to ensure they are cooperating with POPI Act
It is our mission to create business solution through technology that will add value to business and improve services and products. EnkosiDigital strives to foster and maintain positive relationships with each and every client (internal, external, government or private), by providing cutting edge technology services at reasonable and competitive prices.
We offer support in IT, Software development ,web and mobile development , computer systems ,networking and computer supply and installation. We also give services and consultant in data analysis , BI analysis ,customer insights ,data visualization ,data storage and optimization and predictive analysi.


infectious diseases health {border-style px;} #ffffff;} global disease including EIDs areas emerging population diseases, increased px; {font-family font-size new public resources spread vaccines EIDs. Infectious countries double; human million people reemerging research Elsevier Emerging Global SARS bacteria, border-color border-width current diseases. diseases: emergence lead outbreak pathogens solid; trends viruses, {font-style {font-weight COVID- Disease Ebola HIV/AIDS Ontario, animals available bold care caused centre courier; deployment effective efforts em; estimated improved increasing issue largely major microorganisms parasites, populations prevalence pt;} resource resulted surveillance testing threats vectors vulnerable


Table Sorter Test Page
This is the test page for the Table Sorter script. Click the 'Make Sortable' button below to try it out.
Table with TR/TH and TR/TD structure
| Country |
Capital City |
Population |
Penetration |
| United Kingdom |
London |
59000000 |
12.4% |
| Czech Republic |
Prague |
10000000 |
23.9% |
| Vatican City |
12 |
8% |
| Antarctica |
None |
0 |
Table with THEAD/TR/TD and TBODY/TR/TD and TFOOT/TR/TD structure
| Country |
Capital City |
Population |
Penetration |
| United Kingdom |
London |
59000000 |
12.4% |
| Czech Republic |
Prague |
10000000 |
23.9% |
| Vatican City |
12 |
8% |
| Antarctica |
None |
0 |
| Country |
Capital City |
Population |
Penetration |
Table with cells that contain markup
| Country |
Capital City |
Population |
Penetration |
| United Kingdom |
London |
59000000 |
12.4% |
| Czech Republic |
|
10000000 |
23.9% |
|
12 |
8% |
| Antarctica |
None |
0 |


We visualize users!
- recontextualize virtual web-readiness
- synergize enterprise functionalities
- target robust niches
- expedite end-to-end architectures
- cultivate 24/365 users
- target one-to-one convergence
- reintermediate end-to-end content
- grow front-end web services
- repurpose killer vortals


Paths relative to default download directory. One path per line.
For example, the setting
.
images/dogs
images/cats
videos/cats
with a default download directory of ~/downloads
will create options to save media to the directories
~/downloads/
~/downloads/images/dogs
~/downloads/images/cats
~/downloads/videos/cats
Invalid paths (eg. ..
and /
) are ignored.
The web extensions API does not allow files to be saved outside of the default download directory. If you want to save the files outside the default download directory, use a symlink inside the default download directory. (Windows, OS X/Unix)


Formulas
ESRI-provided formulas
These formulas came from here.
Column = Floor((Point of interest X -Tile origin X) / width of a tile in map units)
Row = Floor((Tile origin Y - Point of interest Y) / height of a tile in map units)
Derived formulas
Xmin = column ∙ tile width in map units + tile origin X
Ymax = (row ∙ tile height in map units - tile origin Y) / -1
Xmax = Xmin + tile width in map units
Ymin = Ymax - tile width in map units


public class DatabaseProvider extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
allItemsFromTable(String tableName)
Prints out the columns of a given table followed by all the
items in that table.
|
void |
close()
|
boolean |
doesUserExist(String username)
Returns true if the given username exists in the database.
|
static DatabaseProvider
|
get()
Returns an instance of the database provider if one already
exists, otherwise create one then
return it.
|
List<Production>
|
getAllProductions()
Returns a list of all productions from the databse.
|
List<ProductionWithProduct> |
getAllProductionsWithItems()
Returns a list of productions with their associated items.
|
List<Product> |
getAllProducts()
Gets a list of all products storied in the database.
|
List<Employee> |
getAllUsers()
Get a list of all users registered in the database.
|
Employee
|
getCurrentEmployee()
|
Employee
|
getEmployeeById(int id)
Returns an employee given their id.
|
int |
getProductItemTypeCount(ItemType type)
Gets the number of products currently stored with the given
type.
|
boolean |
insertEmployee(Employee employee)
Adds the given employee to the database.
|
int |
insertProduct(Product product)
Adds a product to the database.
|
Employee
|
loginEmployee(String username,
String password)
Attempts to login as a user with a given username and
password.
|
void |
logoutEmployee()
|
void |
recordProductions(Product product,
int quantity,
LocalDateTime manufacturedTime)
Stores a given list of production records into the database.
|
Employee
|
registerEmployee(Employee employee)
Attempts to add a user to the database and log in as that
user.
|
void |
switchToDefaultUser()
|
public static DatabaseProvider get()
public void allItemsFromTable(String tableName) throws SQLException
tableName
- The name of the table whose items should be retrieved
SQLException
- when the
executed query results in an error.
public void close() throws SQLException
SQLException
public int insertProduct(Product product)
product
- The product to be insertedpublic List<Product> getAllProducts() throws SQLException
SQLException
- if there is
an issue with communicating with the database.
public void recordProductions(Product product, int quantity, LocalDateTime manufacturedTime)
public List<Production> getAllProductions() throws SQLException
SQLException
- if there is
an error communicating with the database.
public List<ProductionWithProduct> getAllProductionsWithItems() throws SQLException
SQLException
- if there is
an issue communicating with the database.
public int getProductItemTypeCount(ItemType type) throws SQLException
type
- The ItemType to countSQLException
public Employee registerEmployee(Employee employee)
employee
- The employee to try registering and logging in as.
public Employee getEmployeeById(int id)
id
- The id of the employee.public boolean doesUserExist(String username)
username
- The username to search the database for.public Employee loginEmployee(String username, String password)
username
- The username to attempt logging in with.password
- The password to attempt logging in with.public boolean insertEmployee(Employee employee)
employee
- The employee to insert.public Employee getCurrentEmployee()
public void logoutEmployee()
public List<Employee> getAllUsers()
public void switchToDefaultUser()


Form-O-Fill ships with two powerful libraries for creating test data.
To create random data you can use chance.js.
To create and manipulate dates, Form-O-Fill provides moment.js and if you are really into
math then math.js is also included.
The libraries are available as Libs.chance
, Libs.moment
and Libs.math
.
There is also a library accessible as Libs.h
which contains functions to use in your value function.
This is how to use the library functions:
| function | Purpose |
|---|---|
| Libs.chance.[ChanceJsFunction] | Calls chance.js function |
| Libs.moment().[MomentJsFunction] | Calls moment.js function |
| Libs.math.[MathJsFunction] | Calls math.js function |
| Libs.h.click | Click the element |
| Libs.h.copyValue(".some-selector") | Copy the current value of that element to this element |
| Libs.h.select | Select a radio or checkbox field |
| Libs.h.unselect | Unselect a radio or checkbox field |
| Libs.h.stripTags("SomeHTML") | Remove HTML tags from a string |
| Libs.h.screenshot("filename.png") | Save a screenshot |
Libs.h.click
to click that elementLibs.h.click
!
Libs.h.copyValue("#someselector")
to copy the value of that element at the time of invocation
input[type=radio]
or input[type=checkbox]
.
Libs.h.select
or Libs.h.unselect
to select or unselect fields. context.findHtml
.


-
Interface Summary
| Interface |
Description |
| EventToClientNotifier |
This interface contains the list of methods that the server could use to send different events to the client.
|
| EventToClientVisitor |
This interface contains the list of the event that the client could receive from the server.
|
-
Class Summary
| Class |
Description |
| EndGameToClient |
This class represents the end game event to send to the client.
|
| EventToClient |
This abstract class is used to generalize the event to sent from the server to the client.
|
| LorenzoActionToClient |
This class represents the event to send to the client for the notification of a Lorenzo action.
|
| NewTurnToClient |
This class represents the event to client for the notification of a new turn and for the update of information.
|
| NotifyToClient |
This class represents the event to send to client used for a notify.
|
| PingToClient |
This event represents the ping that verifies that the client is connected.
|
| SendArrayLeaderCardsToClient |
This class represents the event to send to the client for the leader card turn.
|
| SendInitialResourcesToClient |
This class represents the event to send to the client for the choice of the initial resources in the set up of the game.
|
| SendReorganizeDepositToClient |
This class represents the event to notify the client that has to reorganize the deposit.
|
| SendSpaceDevelopmentCardToClient |
This class represents the event to send to the client to choose the space in which put the development card bought by the player.
|
| TurnReselectionToClient |
This class represents the event to send to the client for the reselection of the turn.
|


beta
Passwords must be no shorter than 15 characters!
right click to generate 15 secure character password!


Contents
- A complete (internal) inter-point distance matrix.
- Distances may be in any number of dimensions, even 1-d.
- Or in very many dimensions.
- The default metric used to compute the distance is the 2-norm, or Euclidean norm.
- The 1-norm is also available as an option.
- The infinity norm is an option too.
- The 0-norm is not really a valid norm, but I've included it anyway.
- Inter-point distances may between two sets of points.
- You may only want some subset of the distances. The nearest neighbor is a common choice.
- You can return the result as a structure, or a 2-d array
- You can find the single largest distance.
- or the k largest distances (here, k = 3)
- Or the k smallest distances (here, k == 5)
- You can find only those distances above a specific limit.
- You can also limit the maximum distance found.
- Compute only the 1000 smallest distances between a large pair of arrays
- Nearest neighbour is quite efficient in one dimension
- ipdm uses bsxfun where that is possible.
%{ Demo for ipdm.m (Inter-Point Distance Matrix) John D'Errico e-mail<EMAIL_ADDRESS>%}
A complete (internal) inter-point distance matrix.
% Each point is taken as one row of the input, so each column is a % dimension. There will be a 5x5 array of interpoint distances between % the points in a 5x2 set of data. Note that the diagonal elements in % this matrix will be zero, since they describe the distance from a % point to itself. A = randn(5,2); d = ipdm(A)
d = 0 1.233 1.3493 1.1245 1.242 1.233 0 2.1708 2.135 1.1396 1.3493 2.1708 0 0.39941 1.2894 1.1245 2.135 0.39941 0 1.4422 1.242 1.1396 1.2894 1.4422 0
Distances may be in any number of dimensions, even 1-d.
A = rand(6,1); d = ipdm(A)
d = 0 0.85266 0.22332 0.37803 0.92072 0.03229 0.85266 0 0.62934 0.47463 0.068052 0.82038 0.22332 0.62934 0 0.15471 0.6974 0.19103 0.37803 0.47463 0.15471 0 0.54269 0.34574 0.92072 0.068052 0.6974 0.54269 0 0.88843 0.03229 0.82038 0.19103 0.34574 0.88843 0
Or in very many dimensions.
A = rand(5,1000); d = ipdm(A)
d = 0 12.479 12.882 12.559 12.855 12.479 0 12.49 12.723 12.513 12.882 12.49 0 12.666 12.515 12.559 12.723 12.666 0 12.759 12.855 12.513 12.515 12.759 0
The default metric used to compute the distance is the 2-norm, or Euclidean norm.
A = rand(3,2); d = ipdm(A)
d = 0 0.42608 0.53366 0.42608 0 0.10928 0.53366 0.10928 0
The 1-norm is also available as an option.
% The 1-norm is sometimes known as the city block norm. Of course, % the 1-norm is just the sum of absolute values, so it is the total % distance one would travel if constrained to move only along % "streets" parallel to the x and y axes. % Options are passed into ipdm using property/value pairs d = ipdm(A,'metric',1)
d = 0 0.50902 0.62075 0.50902 0 0.11173 0.62075 0.11173 0
The infinity norm is an option too.
% It is the maximum difference in any dimension. We can think % of the infinity norm as the limit of a p-norm as p --> inf d = ipdm(A,'metric',inf)
d = 0 0.41575 0.525 0.41575 0 0.10925 0.525 0.10925 0
The 0-norm is not really a valid norm, but I've included it anyway.
% Its the smallest difference in any dimension. Why is it not a valid % norm? You can have two widely distinct points with a "0-norm" of 0, % as long as they exactly match in any one dimension. You can also % look at the 0-norm as the limit of a p-norm, as p --> 0 from above. % Properties can be shortened, and capitalization is ignored. d = ipdm(A,'Met',0)
d = 0 0.093271 0.095754 0.093271 0 0.0024827 0.095754 0.0024827 0
Inter-point distances may between two sets of points.
% Of course, the diagonal elements will no longer be expected to be zero.
A = randn(10,2);
B = randn(3,2);
d = ipdm(A,B)
d = 0.46877 1.3268 1.0699 2.3371 2.6267 2.0068 0.18845 1.4021 1.4047 2.7392 1.5299 1.668 1.4282 2.1474 1.6604 0.53418 0.7202 0.7268 1.5636 0.37851 0.637 2.3509 2.9521 2.3854 2.1743 2.842 2.298 0.4548 1.6836 1.6509
You may only want some subset of the distances. The nearest neighbor is a common choice.
% Note that the result is a sparse matrix, to allow you to compute % interpoint distance matrices between very large sets of points. % When an array is returned, if that array is likely to be a sparse % one, I've chosen to generate the array in a sparse format. A = rand(7,3); B = rand(5,3); d = ipdm(A,B,'Subset','nearest')
d = (6,1) 0.51868 (2,3) 0.64675 (4,3) 0.21866 (7,4) 0.19648 (1,5) 0.81444 (3,5) 0.47079 (5,5) 0.63785
You can return the result as a structure, or a 2-d array
d = ipdm(A,B,'Subset','nearest','result','struct') % A structure as the output can sometimes be useful, if that is how you % will be using the results anyway. [d.rowindex,d.columnindex,d.distance]
d = rowindex: [7x1 double] columnindex: [7x1 double] distance: [7x1 double] ans = 1 5 0.81444 2 3 0.64675 3 5 0.47079 4 3 0.21866 5 5 0.63785 6 1 0.51868 7 4 0.19648
You can find the single largest distance.
A = randn(2000,2); B = randn(1000,2); % Logically, the result should be a sparse matrix. d = ipdm(A,B,'Subset','largestfew','limit',1)
d = (302,172) 7.2695
or the k largest distances (here, k = 3)
% find the k = 3 largest distances d = ipdm(A,B,'Subset','largestfew','limit',3)
d = (302,172) 7.2695 (484,495) 7.2272 (484,775) 7.2259
Or the k smallest distances (here, k == 5)
d = ipdm(A,B,'Subset','smallestfew','limit',5)
d = (1137,28) 0.0023937 (1862,164) 0.0022118 (405,485) 0.0025734 (1915,567) 0.0034096 (1479,809) 0.0036645
You can find only those distances above a specific limit.
A = sort(rand(7,1)); % If an array is returned, then I fill those below the limit with -inf d = ipdm(A,'Subset','Minimum','limit',0.5) % If a structure is returned, then only the pairs beyond the specified % limit are included. d = ipdm(A,'Subset','Minimum','limit',0.5,'result','struct')
d = Columns 1 through 6 -Inf -Inf -Inf -Inf -Inf 0.71402 -Inf -Inf -Inf -Inf -Inf 0.60806 -Inf -Inf -Inf -Inf -Inf 0.5177 -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.71402 0.60806 0.5177 -Inf -Inf -Inf 0.76805 0.66209 0.57173 -Inf -Inf -Inf Column 7 0.76805 0.66209 0.57173 -Inf -Inf -Inf -Inf d = rowindex: [12x1 double] columnindex: [12x1 double] distance: [12x1 double]
You can also limit the maximum distance found.
A = randn(10,2); B = randn(4,2); % Here the other elements are filled with +inf d = ipdm(A,B,'Subset','Max','limit',1.5,'metric',inf)
d = Inf 0.68246 0.38584 Inf Inf 0.57474 0.27811 Inf Inf 0.91444 0.61782 1.3555 1.2161 1.2027 Inf 0.17722 Inf Inf Inf 0.87028 Inf 0.65096 0.35434 Inf Inf 0.54434 0.24771 1.4889 Inf 0.53258 0.12555 Inf Inf 0.93034 1.0672 Inf Inf 1.3882 Inf 1.0678
Compute only the 1000 smallest distances between a large pair of arrays
When the arrays are too large, computing the entire array may not fit entirely into memory. ipdm is smart enough to break the problem up to accomplish the task anyway. In this example, the complete interpoint distance matrix would have required roughly 800 megabytes of RAM to store. This would have exceeded the RAM that I have available on this computer, yet I only wanted the 1000 smallest elements in the end.
A = rand(10000,2); B = rand(10000,2); d = ipdm(A,B,'sub','smallestfew','lim',1000,'res','a'); spy(d)
Nearest neighbour is quite efficient in one dimension
You don't want to compute the entire interpoint distance matrix, if you only need the nearest neighbors.
A = rand(100000,1); tic,d = ipdm(A,'subset','nearest','result','struct');toc d
Elapsed time is 0.476907 seconds. d = rowindex: [100000x1 double] columnindex: [100000x1 double] distance: [100000x1 double]
ipdm uses bsxfun where that is possible.
% Older releases of Matlab did not have bsxfun, so I check first to see % if this function exists. If it does exist in your release, ipdm can % run faster and be more efficient in its use of memory. % The ipdm code also attempts to use memory in an efficient way, so that % very large distance matrices are processed in chunks. I try to minimize % the creation of huge intermediate arrays when only a smaller subset of % the full distance matrix is desired. The user can control the size of % the chunks with the ChunkSize property. A = rand(5000,1); % The default ChunkSize is 2^25 tic,d = ipdm(A,'Subset','min','limit',0.99,'result','struct');toc % Here, only 1 megabyte chunks will be processed at any time. tic,d = ipdm(A,'Subset','min','limit',0.99,'result','struct','chunksize',2^20);toc
Elapsed time is 3.230474 seconds. Elapsed time is 3.332791 seconds.


{%- extends 'base.html' -%} {%- block content -%}
Whoops, we appear to have cocked something up. Sorry 'about that!
Care to browse our models, instead?


agt¶
The Alexa Gadgets Toolkit Python API allows you to build fun and delightful accessories that pair to compatible Echo devices via Classic Bluetooth or Bluetooth Low Energy. These accessories can extend Alexa’s capabilities to new modalities with motors, lights, sound chips, and more.
from agt import AlexaGadget
class MyFirstGadget(AlexaGadget):
def on_alexa_gadget_statelistener_stateupdate(self, directive):
print("STATE UPDATED: ", directive)
if __name__ == '__main__':
MyFirstGadget().main()
-
class
agt.
AlexaGadget
(gadget_config_path=None)[source]¶ An Alexa-connected accessory that interacts with an Amazon Echo device over Classic Bluetooth or Bluetooth Low Energy.
-
is_paired
()[source]¶ Return true if this gadget has a Echo device BT address in config and bonded, false otherwise
-
is_connected
()[source]¶ Return true if a Bluetooth connection to an Echo device is active, false otherwise
-
set_discoverable
(discoverable=True)[source]¶ Sets whether or not an Echo device can discover and pair to this Gadget
-
send_custom_event
(namespace, name, payload)[source]¶ Send a custom event to the skill
- Parameters
namespace – namespace of the custom event
name – name of the custom event
payload – JSON payload of the custom event
-
send_event
(event)[source]¶ Send an event to the Echo device
Depending on your the capabilities your gadget supports, you may call this method with one of the following events:
Alexa.Discovery.Discover.Response
-
on_connected
(device_addr)[source]¶ Called when the Gadget connects to the paired Echo device.
- Parameters
device_addr – the address of the device we connected to
-
on_disconnected
(device_addr)[source]¶ Called when the Gadget disconnects from the paired Echo device.
- Parameters
device_addr – the address of the device we disconnected from
-
on_directive
(directive)[source]¶ Called when the Gadget receives a directive from the connected Echo device.
By default, this method will call the appropriate callback method if it is defined.
Depending on your the capabilities your gadget supports, this method may be called with for the following directives:
Alexa.Gadget.StateListener.StateUpdate
callback:
on_alexa_gadget_statelistener_stateupdate(directive)
Notifications.SetIndicator
callback:
on_notifications_setindicator(directive)
Notifications.ClearIndicator
callback:
on_notifications_clearindicator(directive)
Alexa.Gadget.SpeechData.Speechmarks
callback:
on_alexa_gadget_speechdata_speechmarks(directive)
Alexa.Gadget.MusicData.Tempo
callback:
on_alexa_gadget_musicdata_tempo(directive)
Alerts.SetAlert
callback:
on_alerts_setalert(directive)
Alerts.DeleteAlert
callback:
on_alerts_deletealert(directive)
-


Try searching by ID (searching by title is not recommended because of duplicate names and case sensitivity).
Back to Search


ARM TWIST
Elyounoussi admits Armstrong helped him decide to join Celtic on loan
by Lindsay HerronNEW Celtic hero Mo Elyounoussi has revealed that Stuart Armstrong helped him decide to join the Hoops on loan.
The irony is that it seemed Armstrong couldn’t wait to get out of Parkhead and move to the Premier League.
He constantly stalled on a new Hoops deal and moved to Southampton for around £7million in the summer of 2018.
However, the Scotland star was gushing in his praise for his old club as he and Elyounoussi sat next to each other at the club’s Staplewood training base.
Elyounoussi also got advice from his Norway team-mate Kris Ajer and Fraser Forster — and he’s so glad he has made the switch.
Seven goals and five assists landed the Norwegian the Ladbrokes Player of the Month for October. And he said: “Stuart told me so many good things about Celtic.
“I had also spoken with Kris Ajer so I had a good knowledge of what I was coming into. I didn’t look at it as a step down. I needed to get minutes on the pitch.
“I feel Celtic have brought my confidence back. I am scoring goals and I’m really happy. I know the quality I have and I think the manager knows that as well.
“So with his belief and trust in me and the help of the coaches too, I feel I am bringing what I can to the team.”
Elyounoussi was sent home by the Norwegian national team with an injury last week. But he has revealed that it’s only a small knock on his foot.
He is a doubt for Livingston on Saturday but should be ready for Rennes in the Europa League next week.
The 25-year-old, who moved to Saints from Basel last year for £16million, said: “I actually picked up the injury against Hibs in the Betfred Cup semi-final.
“Then I had to go with the national team and it didn’t really have enough time to heal.
"So we had a look at it and it was decided I needed a rest. But I think it will be all right.”
Of course, Scotland could meet Norway in a winner-takes-all showdown for a place at Euro 2020, with Ajer and Elyounoussi on one side and Callum McGregor, James Forrest and Ryan Christie on the other.
He added: “It would be amazing. We have already been talking about that among the boys at Celtic.
"But we need to beat Serbia first in our semi-final then see what happens.”


When you see , hover over this icon for more information
Want to learn more about your Benefits?
Click below to open a new window and view the full summary of benefits.

Use when new victim application is regarding the same crime, is an immediate family member of the current applicant and living in the same home as certain information will be auto-populated from application to application (e.g. address, police information); however, all pre-populated fields are editable if needed.Use when new IFM application is regarding the same crime, is an immediate family member of the current applicant and living in the same home as certain information will be auto-populated from application to application (e.g. address, police information); however, all pre-populated fields are editable if needed.


Equity inflows into mutual funds dip to 41-month low
Exit load triggers outflow, but analysts see investors flocking back
by Suresh P IyengarInflows into equity schemes of mutual funds plunged 78 per cent to a 41-month low in November to ₹1,312 crore against the ₹6,026 crore logged in October, despite the markets hitting a new high.
Among equity schemes, multi-cap funds logged the biggest fall of 86 per cent to ₹181 crore from ₹1,312 crore, while mid-cap funds plummeted 26 per cent to ₹802 crore (₹1,091 crore), according to data released by the Association of Mutual Funds in India.
Large- and mid-cap funds saw an outflow of ₹252 crore against inflows of ₹510 crore in October, while sector-specific investments witnessed an outflow of ₹637 crore against inflows of ₹447 crore registered in October. Outflows from the value and contra fund deepened to ₹956 crore from ₹229 crore logged in October.
Exit load takes a toll
Inflows into debt-oriented schemes also slowed down sharply, by 58 per cent, to ₹51,428 crore (₹1.21- lakh crore) as inflows into liquid funds plunged 92 per cent to ₹6,938 crore (₹93,203 crore) due to SEBI’s introduction of an exit load.
However, inflows into overnight funds improved to ₹20,649 crore (₹5,748 crore). Outflow from credit risk fund touched ₹1,899 crore (₹1,382 crore). The overall inflow into debit-oriented schemes dipped 59 per cent to ₹54,419 crore (₹1.33 lakh crore).
However, the assets under management of the mutual fund industry improved 3 per cent to ₹27.04-lakh crore in November from ₹26.32-lakh crore, largely due to steady inflows through systematic investment plans and the run-up in the equity market.
SIP inflows touched a new high of ₹8,273 crore (₹8,246 crore) last month. The SIP AUM touched an all-time high of ₹3.12-lakh crore (₹3.03-lakh crore).
NS Venkatesh, CEO, AMFI, said that with markets touching a new high, some high-net-worth investors booked profits, leading to a slowdown in equity flows.
Expecting these investors to reinvest at the current level, he said they should take a call on reinvesting soon as the markets are poised to touch new highs with expectations from the Union Budget building up and the impact of government reforms kicking in.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here
Thank you for being a loyal user of Portfolio.
Portfolio will be a paid section hereon.
Please Subscribe to get access to one of our early bird packs. Or click on Free Trial to get 14 days free trial.
What You'll Get
-
Web + Mobile
Access exclusive content of the Hindu Businessline across desktops, tablet and mobile device.
-
Exclusive Portfolio and Investment Advice, Banking, Lifestyle and Specials
Get diverse set of perspectives from our trusted experts on Portfolio, Banking, Economy, Environment and others.
-
Ad free experience
Experience cleaner site with zero ads and faster load times.
-
Personalised dashboard
Customize your preference and get a personalized recommendation of stories based on your interest.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here


{exp:user:edit member_id="{embed:user_member_id}" dynamic="off"}
Accept User Email
Email
Username
Screen Name
Create a New Password?
Password Confirm
Current Password


(づ｡◕‿‿◕｡)づ
"I don't know what I don't know."
An average domain costs $10 - $15 a year
10/10 highly recommend
ᕦ(ò_óˇ)ᕤ
(Free)
xeniatay.wordpress.com
xeniatay.tumblr.com
xeniatay.github.io
xeniatay.github.io/WaterlUX-Web-Design-Talk
Note: this is for a fresh server
For use with a custom domain
ヽ(´ー｀)ノ
@xeniatay


Happy campers: Using machine learning to identify caravans in Zoopla data
Our Big Data team has published a report about collecting and using data from the property website Zoopla to identify the location of caravan homes. This information could help to make the census more efficient.
Caravan homes are important because they are recorded either inconsistently or not at all in different data sources. During the 2011 Census, when 85,000 such homes were counted, it was difficult to correctly count the number of people living in caravan parks, holiday sites and other leisure parks, and we spent a lot of time trying to establish the facts (such as whether the caravan park was for holiday or residential purposes).
Why use data from property websites?
Property websites such as Rightmove and Zoopla show a lot of information about properties including their location, number of bedrooms, type of property and descriptive information about the home. It could be useful for identifying a range of features such as whether the property is in a gated community (we may have difficulty in getting to the front door of properties) and caravan homes.
What did we do to identify the caravan homes?
A limited amount of data about properties for sale or rent can be collected from Zoopla for free, by writing some code to obtain data from their Application Programming Interface (API). We collected data about 36,000 properties, around 500 of which were caravan homes.
We built different machine learning models to try to identify caravans in the data using information such as the price (caravan homes tend to be cheaper), number of bedrooms and whether certain phrases (such as “static caravan”) are in the property description. Some interesting oddities arose, such as large properties for sale that included a static caravan on their land, but overall we were able to identify the location of caravan homes with good accuracy.
What’s next?
Since we did this piece of work ONS has acquired two much larger sets of Zoopla data. Using these, we’ll be redoing some of the above work (to make sure our model is robust). We will extend it to identify caravan homes used for holiday or residential purposes, gated communities and retirement properties.
Obtain the code we used
It is important for us to make as much code openly available as possible. The code used to extract property data from the Zoopla API and the machine learning code used in the report published (both written in Python) are available on the ONS Big Data team GitHub pages.
Contact us
We would also love to get your feedback on what we’ve done or for you to suggest further ways in which the methods or data could be used. Please do so by contacting Karen Gask or the Big Data team. We’ve also been working on using satellite imagery to identify the location of caravan homes so we’ll be writing a blog about that soon.
The following blog post is written by [Karen Gask][https://twitter.com/GaskyK], Data Scientist, and was originally posted in the ONS Digital blog


public interface Stopwatch extends Simon
start()
creates new Split
object.
On this object you can call Split.stop()
- this demarcates measured interval.
Alternatively method addSplit(Split)
can be used to add split to the stopwatch (Split.create(long)
can be used to create finished Split for any nanos value). Both ways effectively
updates usage times, increase usage counter by one and updates total time of the stopwatch.
Split object enables multiple time-splits to be measured in parallel.
Example:
Split split = SimonManager.getStopwatch("com.my.stopwatch").start(); //... here goes the measured code split.stop(); System.out.println("Result: " + split.getStopwatch()); // print will be probably somewhere elseThis can be used for simple micro-benchmarking, critical section monitoring, in web filter to measure request times, etc.
SimonManager
should always be used to get the stopwatch before using it,
because otherwise the code will not reflect enable/disable of the whole API.| Modifier and Type | Method and Description |
|---|---|
Stopwatch |
addSplit(Split split)
Adds
Split to the stopwatch which is useful for aggregation of splits created for other stopwatch. |
long |
getActive()
Returns current number of measured splits (concurrently running).
|
long |
getCounter()
Returns usage count of the stopwatch.
|
long |
getLast()
Returns value of the last added split - whether it was added directly or with stop method.
|
long |
getMax()
Returns maximal time split value in nanoseconds.
|
long |
getMaxActive()
Returns peek value of active concurrent splits.
|
long |
getMaxActiveTimestamp()
Returns ms timestamp when the last peek of the active split count occurred.
|
long |
getMaxTimestamp()
Returns ms timestamp when the max value was measured.
|
double |
getMean()
Returns mean value (average) of all measured values.
|
long |
getMin()
Returns minimal time split value in nanoseconds.
|
long |
getMinTimestamp()
Returns ms timestamp when the min value was measured.
|
double |
getStandardDeviation()
Returns unbiased estimate of standard deviation.
|
long |
getTotal()
Returns total sum of all split times in nanoseconds.
|
double |
getVariance()
Returns unbiased estimate of the population variance.
|
double |
getVarianceN()
Returns variance value of all measured values (entire population).
|
StopwatchSample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface.
|
StopwatchSample |
sampleIncrement(Object key)
Samples increment in Simon values since the previous call of this method with the
same key.
|
Split |
start()
Starts the new split for this stopwatch.
|
getChildren, getFirstUsage, getLastUsage, getManager, getName, getNote, getParent, getState, isEnabled, setNote, setState, stopIncrementalSampling
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, removeAttribute, setAttribute
Split start()
Split
object is collected, no leak occurs. However, active count is increased
and without stopping the split active count stays increased which may render that
information useless.Split.stop()
Stopwatch addSplit(Split split)
Split
to the stopwatch which is useful for aggregation of splits created for other stopwatch.
Split object should be stopped. Main difference is the callback method called as
Callback.onStopwatchAdd(Stopwatch, Split, StopwatchSample)
provides split object to the callback.
Usage examples:
Split split = Split.start(); // no stopwatch needed ... someStopwatch.addSplit(split.stop()); // you may omit stop(), if you does not use the split after this point
split
- split object (should be stopped)long getTotal()
long getLast()
long getCounter()
addTime
and
stop
- that means that it's updated every time the next time split is added.long getMax()
long getMin()
long getMaxTimestamp()
long getMinTimestamp()
long getActive()
long getMaxActive()
long getMaxActiveTimestamp()
double getMean()
getCounter()
is 0 it should return Double.NaN
, but for practical reasons returns 0.double getStandardDeviation()
getCounter()
is 0 returns Double.NaN
.
http://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviationdouble getVariance()
getCounter()
is 0 returns Double.NaN
.
http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variancedouble getVarianceN()
getCounter()
is 0 returns Double.NaN
.
http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_varianceStopwatchSample sample()
Simon
StopwatchSample sampleIncrement(Object key)
Simon
Simon.sample()
. Any subsequent calls with the key
provide increments.
Clients can use any sampling key (any Object) which enables safe access to their own increments.
Using String does not guarantee this as any client can potentially guess the key. This
may or may not be an issue.sampleIncrement
in interface Simon
key
- sampling key used to access incremental sampleSample
with value incrementsCopyright © 2014. All rights reserved.


This will demonstrate all the features that are implemented in the Wikcey yav integration
Type validation
Yav can check if the input is of kind "date" or "integer" or decimal "double". It uses for that the model bound to the component.
Date 1 ()
Uses the local on the wicket application to configure the date yav format. Please note that actually the yav library only supports any combination of the following (dd and MM and yyyy)
Date 2 ()
Custom Wicket message defined for this field and for DateConverter. See TestPage.properties
Integer
Double
Inline Validation
This is to show how to use Yav to display the message in front of the field instead of the feedback panel. A span needs to be added in front of the field with a specific id. errorsDiv + the input wicketId. in this case id="errorsDiv_typeBigDecimal"
BigDecimal
StringValidator
Testing all the Wicket default String validators
Max 10 char :
Min 10 char :
Exactly 10 char :
Between 10 and 20 :
Email :
Pattern *.com :
Uses new Model() and not the model defined on the form.
IFormValidator
Tests the validator specific to the form. Mainly EqualInputValidator
Date of Birth 1
Configured in YAV and taken from the App Server local :
Date of Birth 2
Should be equal to dateOfBirth1.
IValidator
Tests the validator specific to the form. Only RangeValidator ported to YAV for now, and not the Max, Min and CompoundValidator
Range long (10 -> 20):


@Path("/context")
@Controller
@RequestScoped
public class ContextController {
@GET
public String show() {
return "context.ftl";
}
}
28 December 2021
In April of this year (2021) I published a Blog Post about the integration of the Freemarker Template Engine into Jakarta MVC, the action-based Web UI framework under the hood of Jakarta EE. This Post adds some interesting features to this integration.
The Blog Post Jakarta MVC with FreeMarker demonstrated the integration of the FreeMarker Java Template Engine as ViewEngine into Jakarta EE MVC in a very basic way. Only the implementation of mandatory features have been included. Please have a look at linked article for more about Jakarta EE MVC in general and the integration approach taken.
Beside the mandatory features, the Jakarta MVC specification recommends the implementation of the following features:
The MvcConext
object should be available in the view engine’s templates
Named CDI beans should be resolved and made available for view templates
In this Blog Post we’ll have a look at these features and how they can be implemented with the Freemarker View Engine described in the previous article.
| The code snippets presented below are shortened to concentrate to the crucial parts. The complete sample code is hosted on code branch in Github repo. |
First we’ll have a look at the MvcContext
object and how to integrate it
into Freemarker templates.
Let’s start with the description of the expected behavior, i.e. with a the
specification of the requirement.
For demonstration purposes we create a simple page with endpoint /context
,
that displays the content of the MvcContext
of requests:
@Path("/context")
@Controller
@RequestScoped
public class ContextController {
@GET
public String show() {
return "context.ftl";
}
}
The MVC controller just serves as entry point to the /context
page. The
referenced Freemarker template will use the mvc
field of the template
model object to generate the HTML view:

<title>MVC Context</title>

MVC Context

Application's base path : ${mvc.basePath}
Local : ${mvc.locale}
URI (GreetController#hello) : ${mvc.uri("GreetController#hello")}
URI (GreetController#hi) : ${mvc.uri("GreetController#hi")}

Please note, that we do not only access plain properties of MvcContext
like basePath
or locale
, but also call the convenience method uri
to
generate the URI from a controller method’s reference.
To accomplish the described behavior we extend the FreeMarkerViewEngine
already described in the first article as follows:
public class FreeMarkerViewEngine implements ViewEngine {
@Inject
MvcContext mvcContext; (1)
...
@Override
public void processView(ViewEngineContext context) throws ViewEngineException {
Models models = context.getModels();
models.put("mvc", mvcContext); (2)
...
}
}
| 1 | Injection of MvcContext object which is to be made available in templates. |
| 2 | Adding injected MvcContext under key mvc to the MvcModel object. |
The MvcContext
is a request scoped CDI bean, which can be injected into
our Freemarker View Engine. Adding the context under key mvc
to the
MVC model makes the context available to the Freemarker template.
The MVC’s Model
object holds named substitutions to be used in templates.
This map-like object is passed into the Freemarker method to process templates.
Requesting the sample controller shown above renders in the Browser to:
This works fine because Freemarker wraps Java objects contained in the passed
in template model into TemplateModel
objects. The interface TemplateModel
founds the base of a hierarchy of objects, which can be used in Freemarker
templates to:
resolve simple scalar values
reference properties of Java beans
call any methods on wrapped Java objects
You’ll find more details in the Freemarker Reference.
The resolution of named CDI beans is more a bit of challenge. If we look at the standard view engine JSP, which is shipped with Jakarta MVC, named CDI beans are resolved by embedded Jakarta Expression Language (EL). However, Freemarker does not embed EL, but instead has its own powerful template language to evaluate expressions, whicj are eventually relying on Java functionality. Instead of extending Freemarker with the standard Expression Language, it’s a more natural choice to make named CDI beans available to the Freemarker Template Language.
Before diving into the implementation details of named CDI bean resolution for our Freemarker integration, we’re going to describe the expected behavior. This again is not a formal specification of the requirement, but rather a spec by example definition.
The entry point of our test page is a /hi
, whereby this the controller’s
method expects a name
query parameter denoting the person to greet:
...
@Path("hi")
@GET
public String hi(@QueryParam("name") String name) {
models.put("visitor", name);
return "randomGreeting.ftl";
}
...
The MVC controller forwards the request for rendering to the Freemarker
template randomGreeting.ftl
.
As the name suggests, the greeting returned to the user is not hard-coded,
but randomly selected from a list of available greetings. The selection
mechanism is actually provided by named CDI greetingGenerator
:
@Named("greetingGenerator")
public class GreetingGenerator {
private static final List<String> greetingTemplates
= Arrays.asList("Hi %s", "Hello %s", "Ciao %s");
public String select(String name) {
String greetingTemplate = greetingTemplates
.get(ThreadLocalRandom.current().nextInt(0, greetingTemplates.size()));
return String.format(greetingTemplate, name);
}
}
The select
method of this CDI bean takes the name of the person to greet
as argument and integrates the given name into a randomly selected greeting
pattern. With this program logic in place, we’re going to use the named CDI
bean in the Freemarker template, i.e. our view, as follows:

<title>Welcome!</title>

${named("greetingGenerator").select(visitor)}!

The named CDI bean is explicitly resolved by the named
function. On the
returned bean arbitrary methods, like the select
, can be called. But it’s
also possible to access plain and simple properties from those objects.
The implementation of the described feature is based on the fact, that the
Freemarker template engine can be extended by methods on demand. The named
method used in the sample template is such a method extension, which need
to be registered in the template model in the first place:
public class FreeMarkerViewEngine implements ViewEngine {
...
@Override
public void processView(ViewEngineContext context) throws ViewEngineException {
Models models = context.getModels();
models.put("named", new NamedBeanResolver());
...
}
....
}
This registration of the named
method is very much the same as we’ve already
seen with the mvc
context above. In this case the named
method is an
instance of the NamedBeanResolver
class, which implements a standard
extension pattern for the Freemarker template engine:
public class NamedBeanResolver implements TemplateMethodModelEx {
@Override
@SuppressWarnings("rawtypes")
public TemplateModel exec(List args) throws TemplateModelException {
if (args.size() != 1) {
throw new TemplateModelException("Wrong arguments");
}
SimpleScalar beanName = (SimpleScalar) args.get(0); (1)
Object namedBean = CDI.current().select(Object.class,
new NamedAnnotation(beanName.getAsString())).get(); (2)
DefaultObjectWrapper objectWrapper = new DefaultObjectWrapperBuilder(new Version("2.3.31")).build();
return objectWrapper.wrap(namedBean); (3)
}
}
| 1 | The first (and only) argument of the named method is of type
SimpleScalar , which should contain the name of the CDI bean to be resolved. |
| 2 | The CDI container is used to resolve the named bean. |
| 3 | The resolved CDI bean is eventually wrapped into a object, that can be consumed by Freemarker templates. |
The SimpleScalar object and the wrapped named bean are derived from
the earlier mentioned TemplateModel . Please have a look at the
Freemarker Reference for
more information about Freemarker, its capabilities and extensibility.
|
If we now several times navigate to out test page on endpoint
/hi?name=Gunther
times, a mix of the following three result pages are
shown in random order:
The displayed pages clearly indicates that the (random) output is actually
based on the named CDI bean greetingController
. The greetingController
is a dependent-scoped bean, but the named beans resolved by the
NamedBeanResolver
class can be of any scope, as long as the scope is
active during the processing of the view.
The demo project shows the ease of use of the Jakarta MVC view technology and the simplicity of integrating different template engines. The main reasons for this are mainly because Jakarta MVC is based on the well-known and mature technologies CDI and JAX/RS.
The introduced integration of Freemarker as view engine, in particular the named CDI bean resolution, also demonstrates the power of the Freemarker template engine.


2 Kings 21:14
And I will forsake the remnant of mine inheritance, and deliver them into the hand of their enemies; and they shall become a prey and a spoil to all their enemies;