Nest can be installed from the pearhub PEAR repository.
pear channel-discover pearhub.org pear install pearhub/HTML_Template_Nest
You can also download and install a tarball from the sourceforge page.
To upgrade to the latest version you can use pear upgrade.
pear upgrade pearhub/HTML_Template_Nest


We can fit a model of evolution - for example, Brownian motion or an Mk model - to comparative data, estimating model parameters and assessing model fit. For example, if we were interested in the evolution of body size among mammals (snakes and lizards), we could fit a variety of models. For each model, we could estimate the model parameters that best fit the data. We could also compare the fit of the models and use model selection to select the best of them.
Fitting models of trait evolution requires:
There are two functions to fit models of trait evolution in Arbor Workflows:
From the docs page, get anolis.phy and anolis.csv. Load these files into Arbor, and use them as inputs to the fitDiscrete function (choose the “ecomorph” character).
TBA
Harmon, L. J., J. B. Losos, J. Davies, R. G. Gillespie, J. L. Gittleman, W. B. Jennings, K. Kozak, M. A. McPeek, F. Moreno-Roark, T. J. Near, A. Purvis, R. E. Ricklefs, D. Schluter, J. A. Schulte II, O. Seehausen, B. Sidlauskas, O. Torres-Carvajal, J. T. Weir, & A. Ø. Mooers. 2010. Early bursts of body size and shape evolution are rare in comparative data. Evolution 64: 2385.
Lewis, P.O. 2001. A likelihood approach to estimating phylogeny from discrete morphological character data. Systematic Biology 50:913-925.
Pennell, M. W., J. M. Eastman, G. J. Slater, J. W. Brown, J. C. Uyeda, R. G. Fitzjohn, M. E. Alfaro, and L. J. Harmon. 2014. geiger v2.0: an expanded suite of methods for fitting macroevolutionary models to phylogenetic trees. Bioinformatics 30: 2216-2218.


michael-h.dk
Multimedia Designer and Web Developer
Multimedia Designer and Web Developer
Working with code in JavaScript, there are a lot of possibilities to make mistakes, and some times it could be your own fault.
One of the areas there are likely to make some errors in your code, is when you are changing the values in variables. It is not always that logical, but I will try to make it a little easier to understand.
I know that I have learned a lot just by making this page.
JavaScript strings are used for storing and manipulating text.
JavaScript has only one type of number. Numbers can be written with or without decimals.
A JavaScript Boolean represents one of two values: true or false.
When you make a copy, and change the value of the first variable, the copy still keep that value.
const firstName = "Michael";
const age = 51;
const pi = 3.14;
const isRich = false;
| Declare a variable with var, let or const: | let firstName; |
| Value |
|
| Give the variable a value | firstName = "Michael"; |
| Value |
|
| Make a copy of firstName | let firstName2 = firstname; |
| Value |
|
| Change firstName | firstName = "Mike"; |
| Value |
|
The Array object is used to store multiple values in a single variable.
Array indexes are zero-based: The first element in the array is 0, the second is 1, and so on.
If you make a copy of an array like we did with the variable, and change an element in the array, both arrays will change.
If you want to copy an array, without having them affect eachother, there are some ways to do that:
const beatles = ["John", "Paul", "George", "Pete"];
| Create an array: | let beatles = ["John", "Paul", "George", "Pete"]; |
| Value |
|
| Copy the array | let betterBeatles = beatles; |
| Value |
|
| Change an element in the original array | beatles[3] = "Ringo"; |
| Value |
|
As you can see both arrays changed their value. If your want to make a copy, that won't change values with the first, you have a few options.
1. You can use the slice() function:
The slice() method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.
let betterBeatles = beatles.slice()
2. You can use the concat() function:
The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.
let betterBeatles = [].concat(beatles);
3. You can use the new spread operator:
Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
| Make the first array | let newBeatles = ["John", "Paul", "George", "Pete"] |
| Value |
|
| Copy the array | let oldBeatles = [...newBeatles]; |
| Value |
|
| Change an element in the first array | newBeatles[3] = "Ringo"; |
| Value |
|
All defenitions are copied from MDM Web Docs at Mozilla.
JavaScript is designed on a simple object-based paradigm. An object is a collection of properties, and a property is an association between a name (or key) and a value. A property's value can be a function, in which case the property is known as a method. In addition to objects that are predefined in the browser, you can define your own objects. This chapter describes how to use objects, properties, functions, and methods, and how to create your own objects.
The same problem with copying an array, are also applying to copieng an object, but right now there are only one way to make a copy of an object that won't change value, when the original are changed.
const michael = {name: "Michael", age: 50, socialMedia: {facebook:
"michael.houmann", twitter: "@MichaelHoumann"}};
| Create an object: | const michael = {name: "Michael", age: 50, socialMedia: {facebook:
"michael.houmann", twitter: "@MichaelHoumann"}}; |
| Value |
|
| Copy the object | let michael2 = michael; |
| Value |
|
| Change an element in the original object | michael.age = 51; |
| Value |
|
| The right way to copy an object | const michael3 = Object.assign({}, michael, {age: 50}); |
| Value |
|
All defenitions are copied from MDM Web Docs at Mozilla.


GET /repos/:owner/:repo/pages
(:read)
POST /repos/:owner/:repo/pages
(:write)
PUT /repos/:owner/:repo/pages
(:write)
DELETE /repos/:owner/:repo/pages
(:write)
POST /repos/:owner/:repo/pages/builds
(:write)GET /repos/:owner/:repo/pages/builds/:build_id
(:read)GET /repos/:owner/:repo/pages/builds/latest
(:read)


pw-record --list-targets- Record a sample recording using the default target:
pw-record path/to/file.wav- Record a sample recording at a different volume level:
pw-record --volume=0.1 path/to/file.wav- Record a sample recording using a different sample rate:
pw-record --rate=6000 path/to/file.wav


Blog Archive 2012 WTF Jan 06 2012 Another Year Jan 05 2012 2011 NGINX and Unicorn Jan 19 2011 Full Circle Jan 19 2011 2010 Old Business Models Die Hard Nov 20 2010 Brand New MacBook Air Nov 18 2010 How to set up new DASD (disk) for use with VM/370 under hercules Nov 16 2010 Playing With Technology Nov 15 2010 Fotki Amongst Others Apr 18 2010 For The Love Of Ruby Apr 17 2010


Summary
I designed a new set of brand guidelines tailored for SMB (Small to mid-size business) customers, within the SAP Brand.
Goals
The goal was to make the SAP SMB brand more approachable, to help connect with SMB customers, as well as empower marketers to create better materials, quicker. Along with working within the new SAP Brand Guidelines, we also designed unique templates and materials for the three products within SAP SMB: SAP Business One, SAP ByDesign and SAP Anywhere.
Research
I collaborated with the marketing, leadership and analytics teams to get insight into how SMB (Small-Midsize Businesses) viewed SAP as a brand. I interviewed the SAP Global brand team, the SMB leadership team and interviewed customers as well as marketers who would use the design system. This was the design team's first project and the jumping off point for our internal design agency.
Right: SMB Factsheet
Outcome
We spent 3 months doing the redesign, and another 3 months of brand training for all teams. We created a basic design system by establishing guidelines, components, assets and then templates including icons, emails, presentations, posters, and webpages. We tested the use of the colors, icons and templates and reiterated based on feedback, making more changes as we went along. Ultimately, the templates were used more frequently than the generic SAP Branding templates and we received positive feedback on their use.
Additionally, this project gave visibility to our internal design agency and we worked on creating unique pieces, from email newsletters to for the SAP SMB marketing team.
Left: Flyer for SAP ByDesign
Some samples from the SAP SMB Brand Guidelines (Internal Only)


A few years ago, my dad was prescribed Vicoprofen (7.5/200) for his frozen shoulder, which was pretty much cured by physical therapy before his prescription ran out. I was hunting for ibuprofen one day when I found the unfinished bottle in the medicine cupboard, and there were 9 pills left that hadn't been touched since 2002. I saw this as a perfect opportunity to try a new drug, so I looked quickly online to see what was in it so I knew what I was taking. It was really my first experiment with any drug besides cannabis or alcohol.
I skipped breakfast and popped three with my coffee one morning and went to school. On the bus, I started to feel light-headed and dreamy, but looking out the bus window made me feel a little carsick. Walking into school, I felt like I was floating but my stomach was aching and I was dizzy when I stood up. Every time I took a step my stomach would cringe, but as soon as I stopped it would be ok and I could concentrate on how different I felt.
Unfortunately, at the time I had several short classes so I had to walk around a lot during the day. After less than two hours of almost constant motion, I felt so sick I had to run to the bathroom because I was sure I would puke. I dry heaved in the bathroom stall for a few minutes, then decided it'd be better to lay down and wait for the nausea and dizziness to pass.   She gave me some crackers and I took a nap for an hour or so. Afterwards my stomach had settled, and I wasn't dizzy but I still felt a little weird, like reality was a little fuzzy around the edges. I made it to the end of the school day and looked up more about vicoprofen when I got home. That crappy day wasn't going to discourage me, the bottle wasn't gone yet.
I found that taking Vicoprofen on an empty stomach can cause nausea, and the typical dizziness is made much worse by moving around a lot. That would have been nice to know beforehand. I knew I could avoid a bad experience like that by eating and just chilling all day, so I decided to try again when I didn't have school.
Well the weekend came and I still had six pills left. I took them to my boyfriend's house, and we each popped three. We both ate breakfast and laid on his bed to chill and wait for the pills to kick in. I think being with him helped make the trip what it was that day, I'm always happy spending time with him. I was scared my stomach would start to ache again, but a kind of fuzzy, drifting, floating feeling seeped into my body -- and my stomach was silent. I was reassured that I could relax and not worry about getting sick. I felt noticeably different. When I tried to stand up, I instantly got too dizzy and my legs buckled, so I got comfortable on the bed and stayed there. It felt like I was moving and spinning and floating verrrry slowly and dreamily when I laid still. When I closed my eyes, it felt like the world disappeared and I was floating through blackness.
Suddenly I realized I felt heavy, like gravity had gotten stronger. I tried to lift my arm, and it seemed like it took a monstrous effort to do it -- but when I had finally lifted it, it felt like I wasn't controlling it anymore, my hand was floating in the air and it was weightless. When I got used to the new reality I had found after ten minutes or so, my boyfriend and I just chilled in each other's arms and talked for hours about the meanings of life and love and existence. I've never had such deep, meaningful conversation in my life. Reality seemed like it had shifted - everything was different, but in a great way. The world was perfect and everything I saw and touched made me happy, especially my boyfriend. We were -- and still are -- so in love, that kind of love that makes you feel high when no drugs are involved. When this particular drug got involved, I felt love for him in a deeper, more meaningful way. When we hugged, it felt like our souls touched.
After a few hours, the floating feeling started to fade but I still felt euphoric, everything was right with the world and suddenly I had all this pent-up energy. I had to move. We put on music we both loved, and danced and sang together around his bedroom for awhile, until all the extra energy was gone. Then we just held each other, suddenly deeply in love again as the last bits of the dreamy drug-induced state dissipated and my feet finally touched the ground a solid.
Quite an intense drug, in a strangely mellow way. It was an excellent experience I would love to repeat alone someday, so I could get lost in my mind and just think to myself. I can see how painkillers can be habit-forming. It was a profound experience for me. I would probably do it more, but I don't want to kill my liver with ibuprofen or acetaminophen.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Use your arrow keys to move
Press space to shoot (unlocked in the shop)
Return to base to access shop
Your Name:


| Department Attributes | Value |
|---|---|
| Department number | {{ ctrl.result.dept_no }} |
| Department name |
{{ ctrl.result.dept_name }}
|
| Manager | |
| Manager Name | {{ ctrl.result.manager_id ? ctrl.result.manager_name + " (ID: " + ctrl.result.manager_id + ")" : "No manager found." }} |
| Years served | {{ ctrl.result.manager_id ? ctrl.result.manager_from + " to " + ctrl.result.manager_to : "--" }} |


The Game is a project-based, social innovation learning experience by the Institute for Leadership Education in Engineering at the University of Toronto. Students work in teams and pick issues they would like to address. The focus is on encouraging students to work with ambiguity, be open to diverse perspectives and experience what it takes to effect social change. Each team is assigned a mentor from the community to help guide them on this journey. One of the main questions this initiative challenges participants to figure out is: How do I work with myself and others using effective tools and frameworks to create meaningful change?
My team and I are taking a look at stigma related to mental health and access to resources on campus specifically for international students whose first language is not english. We initially had a scope of looking at stigma on the university level and then after interviewing students and members from the Health & Wellness team at the University we found the above niche that we concluded was an area that had not been looked into a lot. The picture above is from our midpoint presentation where we presented our journey thus far using poetry and physical expressions. The project continues on into the 2017 winter semester.


CATS DON'T DANCE A film review by Scott Renshaw Copyright 1997 Scott Renshaw
(Warner Bros.) Starring: Voices of Scott Bakula, Jasmine Guy, Natalie Cole, Ashley Peldon, Kathy Najimy, John Rhys-Davies, Matthew Herried, Mark Dindal. Screenplay: Roberts Gannaway, Theresa Pettengill, Cliff Ruby and Elana Lesser. Producers: David Kirschner and Paul Gertz. Director: Mark Dindal. MPAA Rating: G Running Time: 73 minutes, plus 7 minute Foghorn Leghorn short. Reviewed by Scott Renshaw.
Ten years ago, feature film animation was on the endangered species list. Industry leader Disney had all but given up on animation, and no one else believed that G-rated cartoons could be anything but box-office poison. That was before the booming family video sell-through market made the risk seem less risky, and before a succession of Disney features -- THE LITTLE MERMAID, BEAUTY AND THE BEAST, ALADDIN, THE LION KING -- put the luster back on animation to the tune of over $2 billion in profits including merchandise and ancillary sales. Suddenly everyone wanted a piece of the action: chief rival Universal (home of the AMERICAN TAIL and LAND BEFORE TIME films), Fox (the upcoming ANASTASIA with Meg Ryan) and now Warner Bros. I'm not sure the contenders for Disney's throne have learned a key lesson, though: story is king. Cute critters and peppy tunes, like those in Warner's CATS DON'T DANCE, aren't enough to support a flimsy script and simplistic animation.
CATS DON'T DANCE is set in Hollywood circa 1940, where a cat named Danny (voice of Scott Bakula) has just arrived from Kokomo, Indiana with dreams of fame and fortune. Unfortunately, song-and-dance cat Danny is about to learn a hard truth from animal agent Farley Wink (Frank Welker): the movies don't want cats who sing and dance, they want cats who go "meow." After invoking the wrath of child star Darla Dimple (Ashley Peldon) by upstaging her in one of her movies, Danny is ready to join the ranks of disappointed animal performers like Tillie Hippo (Kathy Najimy), Mammoth Studios mascot Woolie (John Rhys-Davies) and lovely Persian cat Sawyer (spoken by Jasmine Guy, sung by Natalie Cole). But Danny is determined to fulfill his dream, and tries to rally his new friends to put on the show of their lives.
That plot is the perfect set-up for an animated film, giving animals plenty of chances to break into song, and indeed CATS DON'T DANCE is a fairly lively endeavor. Unfortunately, there is little focus to all that energy. The film barrels along for a tidy 73 minutes, cranking out Randy Newman musical numbers which seem to peter out after about a dozen bars; even the show-stopping production number "Big and Loud" is over practically before you realize it's supposed to be the show-stopping production number. The over-riding philosophy of CATS DON'T DANCE seems to be that if you blast through everything at a breakneck pace, perhaps no one will have time to notice the lack of attention to detail.
No such luck. CATS DON'T DANCE doesn't just feel rushed -- it looks rushed, like the result of a deadline coming up a bit too fast. The background animation is frequently sketchy and drab, a pale imitation of the vibrant land and cityscapes characteristic of Disney's features, while the character animation relies on Hirschfeld-style celebrity caricatures and animals who seem to be recycled from Warner's afternoon "Animaniacs" series. Even the most interesting character, the psychotically egotistical Darla Dimple, is a gloss on "Tiny Toon Adventures"' wee she-demon Elmyra. At least Darla, a wicked poke at celebrity petulance, is entertaining to watch, as is her monstrous bodyguard Max (voiced by director Mark Dindal). Most of the other characters are overly familiar -- Kathy Najimy's jovial hippo is a re-tread of her jovial nun from the SISTER ACT films, and adorable little penguin Pudge (Matthew Herried) is THE LITTLE MERMAID's Flounder with wings -- or a waste of the voice talent. There's little excuse for lining up Hal Holbrook or the legendary Betty Lou Gerson (the original Cruella DeVil) and giving them four or five lines each.
That probably won't mean very much to kids, who will likely be amused by the high-spirited goings-on, but that's just not enough after the way Disney has raised the bar in the last several years. The House of the Mouse has been smart enough to hitch its wagon to timeless stories, resonant themes and memorable characters. CATS DON'T DANCE is lightweight stuff, a simple "naive kid makes good" story as much _from_ the 1940s as _about_ the 1940s, and that's not necessarily a bad thing. In order to be more than a diversion, however, a film like CATS DON'T DANCE needs something more: a song you'll be humming for the rest of the day, a visual style which keeps you enthralled, a character you wouldn't mind seeing turn up in a direct-to-video sequel. There's not much of a creative spark to CATS DON'T DANCE, especially after it opens with a Foghorn Leghorn short which won't make anyone forget Chuck Jones' Warner Bros. glory days. It's something to fill a family-friendly spot on the spring break release schedule, good business but not a very good film.
On the Renshaw scale of 0 to 10 fe-line dancers: 4.
Visit Scott Renshaw's MoviePage http://www-leland.stanford.edu/~srenshaw Subscribe to receive reviews directly via email See details on the MoviePage
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


speechmatics-python¶
speechmatics-python provides API wrapper and CLI to access the Speechmatics Realtime and Batch API v2.
Example library usage¶
The example below illustrates a waveform audio file being opened and transcribed with Realtime.
import speechmatics
LANGUAGE = "en"
AUDIO_FILE_PATH = "/path/to/file"
CONNECTION_URL = f"wss://eu2.rt.speechmatics.com/v2/{LANGUAGE}"
AUTH_TOKEN = "add token here"
# Create a transcription client
ws = speechmatics.client.WebsocketClient(
speechmatics.models.ConnectionSettings(
url=CONNECTION_URL,
auth_token=AUTH_TOKEN,
generate_temp_token=True, # Enterprise customers don't need to provide this parameter
)
)
# Define an event handler to print the partial transcript
def print_partial_transcript(msg):
print(f"(PART) {msg['metadata']['transcript']}")
# Define an event handler to print the full transcript
def print_transcript(msg):
print(f"(FULL) {msg['metadata']['transcript']}")
# Register the event handler for partial transcript
ws.add_event_handler(
event_name=speechmatics.models.ServerMessageType.AddPartialTranscript,
event_handler=print_partial_transcript,
)
# Register the event handler for full transcript
ws.add_event_handler(
event_name=speechmatics.models.ServerMessageType.AddTranscript,
event_handler=print_transcript,
)
settings = speechmatics.models.AudioSettings()
# Define transcription parameters
conf = speechmatics.models.TranscriptionConfig(
language=LANGUAGE,
enable_partials=True,
)
with open("example.wav", 'rb') as file:
ws.run_synchronously(file, conf, settings)
Command-line usage¶
Please see the GitHub readme.


button
This example provides a menu of actions for changing the state in a web application.
Link that precedes button Actions Last Action:


class: center, middle, background # Building Your First Voice Experience .center[![alexa](alexa_logo.png)] .img-circle[![me](profile.jpg)] ### @ardenstone ### Jan, 15, 2020 --- class: center ## Agenda ### What is Alexa? -- ### The Alexa Skills Kit -- ### Best Pratices -- ### Demo --- ## What is Alexa? .full[![alexa](alexa_devices.png)] --- ## What is Alexa? .full[![alexa](alexa-user-interaction-flow.png)] --- class: center, middle, background ## The Alexa Skills Kit https://developer.amazon.com/alexa --- ## Demo: Tools needed -- Visual Studio Code https://code.visualstudio.com/ NodeJS https://nodejs.org/en/ Alexa Developer Console https://developer.amazon.com/alexa Alexa Skill Kit CLI ```shell npm install -g ask-cli ``` Recommended: Node Version Manager https://github.com/nvm-sh/nvm --- class: center, middle, background # Best Pratices --- class: center, middle, background # Questions


Soak it up
We should do this s’more
Like walking, but outside
Look at some trees
Sleep in this cozy shack
Hang out with this furry guy


D3
: Data Driven Documents, Resources
D3
Info Files
https://github.com/mbostock/d3/zipball/master
D3
: Basically everything!
http://github.com/mbostock/d3/wiki/API-Reference
D3
: How things work.
http://vis.stanford.edu/papers/d3
Motivation for
D3
, Design Document.
http://vis.stanford.edu/files/2011-D3-InfoVis.pdf
Prior to
D3
was
InfoVis
.
Alternative Technologies
http://processing.org/
Processing.js
: A programming language for artists.
http://paperjs.org/
Paper.js
: Beautiful website.
http://raphaeljs.com/
Raphaël
: Vector graphics, friendly syntax.
Built on
D3
http://nvd3.org/
NVD3
: Reusable charts, beautiful examples.
Authors/Books
Scott Murray
,
Interactive Data Visualization for the Web
Mike Dewar
,
Getting Started with
D3
(O'Reilly, 2012)


WITNESS LIST
County Affairs Committee
June 10, 2016 - 10:00 AM
1115 Transformation Waiver
For:
Beck, Steve (Covenant Health)
On:
Arledge, Nicholas (Seminole Hospital District)
Farmer, Drue (StarCare)
Hrncirik, Bobbye (University Medical Center)
Valderaz, Leonard (StarCare - 1115 Transformation Waiver)
Child Protective Services
For:
Burt, Neal (Lubbock County Criminal District Attorney's Office and Matt Powell, District
Attorney)
Hill, Jennie (CASA of the South Plains)
Ward, Deidre (Lubbock County District Attorney)
On:
Alexander, Pam (Lubbock County Child Welfare Board)
Childre, Stu (Self)
Gilliam, Camille (Dept. of Family and Protective Services)
Rogers, Robert (Self)
County cybersecurity policies and programs
On:
Alexander, Phillip (UMC Health System)
Johnston, Mark (Lubbock County IT)
Mental health outreach programs
For:
Lewis, David (Self; VetStar)
Wischkaemper, Philip (Lubbock Private Defenders Office)
On:
Boatwright, Nicky (Board Member of the Private Defenders Office, Mental Health Authority)
Farmer, Drue (Lubbock Co.)
Ray, Hailey (Self; Lubbock Private Defenders' Office)
Private roadways in counties with population of less than 7,500
For:
Norman, John Lee (Garza County)
Public dissemination of mug shots and criminal histories
On:
Rowe, Kelly (Sheriff's Association of Texas)
1
WITNESS LIST
Sheriff and Constable fee schedule and cost recovery
For:
Hanna, Paul (Lubbock County Constable 1)
Read, Dwain (Chiltree County Constables Office; Justice of Peace and Constable Association
of Texas)
Texas Commission on Jail Standards
On:
Gilbreath, Larry (Terry Co. Sheriff's Office)
Kraft, Bernard (Law Enforcement Agency Head)
Mickle, Carla (Self)
Moffitt, Bryan (Self)
Rowe, Kelly (Sheriff's Association of Texas)
Wood, Brandon (Tx Commission on Jail Standards)
2


The far-Right 'weirdo' who stored bomb cache in his camper van: Machinist, 42, is caught with home-made explosives, 85 knives, an axe and three SWORDS
by Alex Ward For The Daily Mail- Simon Flint arrested after stopped by police in his campervan in Middlesbrough
- An army bomb disposal operation was later carried out near Riverside Stadium
- At Teesside Crown Court he admitted getting and modifying parts to build IEDs
- The 42-year-old pleaded guilty to charges of having explosive substance in June
A far-Right activist found in possession of bombs plus more than 100 knives and swords has pleaded guilty to explosives offences.
Simon Flint, 42, admitted having explosive substances and threatening unlawful violence at Teesside Crown Court yesterday.
He had been arrested after threatening a group of teenagers and a man with a crossbow in County Durham, on June 28 this year.
Flint, from Stockton-on-Tees, was later found to have 85 knives, 29 locking knives, three swords, two crossbow bolts with razor blades inserted, an axe and a knife disguised as a credit card.
Explosives including 'black powder' and bomb-making chemicals were found in his camper van. Drilled plastic pipes, used as the containers for homemade bombs, were also discovered along with a copy of the Koran and Britain First documents.
Police carried out controlled explosions at a shipping container which Flint had rented close to Middlesbrough Football Club's Riverside stadium.
Prosecutor Jolyon Perks told the court: 'He accepts that he engaged in the acquisition and modifications of component parts for the construction of improvised explosive devices. The defendant had no intent of damage to property or cause harm to a person. Such activities stemmed from curiosity.
'He accepts that such activity cannot amount to a lawful object. The use for the devices were demonstrated in a series of videos where he destroys fruit and damages a laptop computer through the use of improvised explosive devices.'
Mr Perks said Flint's 'stockpiling of weapons stems from a skewed sense that he needed to defend himself'.
Social media posts showed off Flint's weapons and he even dressed as a crusading knight, brandishing a two-foot long broadsword at the camera.
Other photos showed Flint shaking the hand of English Defence League founder Tommy Robinson and posing with a far-Right book dressed in Britain First clothes. A person who worked near Flint's container said: 'He was, for want of a better word, a weirdo. He would go down on marches and rallies in London with his mates.'
The former precision machinist, set up a vigilante group to recruit members to carry out 'operations' against Muslims. In a series of encrypted messages, seen by the Daily Mail, Flint shared online links to articles along with anti-Muslim messages to members of the Strategic Defence Initiative, a group he founded.
Its purpose was to 'get together a small team' for an 'anti-Jihad citizens' police service'. In response to a message claiming Asian men had tried to kidnap four girls, Flint posted of the 'need to make an example of them'.
He also said a man involved in an alleged hit and run should be 'snagged and bagged', accompanying the message with a Muslim slur.
Flint pleaded guilty to affray and two counts of having an explosive substance. He had already admitted possession of prohibited and offensive weapons. Sentencing was adjourned.


Significant Salmons in History
Our Story
Back Home
Salmon cookie info
Add a store
Store location
Minimum customers per hour
Maximum customers per hour
Average cookies sold per customer
Generate Store


NimiqClient
public class NimiqClient
Nimiq JSONRPC Client
-
Number in the sequence for the next request.
Declaration
Swift
public var id: Int
-
Client initialization from a Config structure using shared URLSession. When no parameter is given, it uses de default configuration in the server (
http://:@<IP_ADDRESS>:8648
).Declaration
Swift
public convenience init(config: Config? = nil)
Parameters
config
Options used for the configuration.
-
Client initialization.
Declaration
Swift
public init(scheme: String = "http", user: String = "", password: String = "", host: String = "<IP_ADDRESS>", port: Int = 8648)
Parameters
scheme
Protocol squeme,
"http"
or"https"
.user
Authorized user.
password
Password for the authorized user.
host
Host IP address.
port
Host port.
session
Used to make all requests. If ommited the shared URLSession is used.
-
Returns a list of addresses owned by client.
Declaration
Swift
public func accounts() throws -> [Any]?
Return Value
Array of Accounts owned by the client.
-
Returns the height of most recent block.
Declaration
Swift
public func blockNumber() throws -> Int?
Return Value
The current block height the client is on.
-
Returns information on the current consensus state.
Declaration
Swift
public func consensus() throws -> ConsensusState?
Return Value
Consensus state.
established
is the value for a good state, other values indicate bad. -
Returns the value of the constant.
Declaration
Swift
public func constant(_ constant: String) throws -> Int?
Parameters
constant
The class and name of the constant (format should be
Class.CONSTANT
).Return Value
The value of the constant.
-
Overrides the value of a constant. It sets the constant to the given value. To reset the constant use
resetConstant()
instead.Declaration
Swift
public func setConstant(_ constant: String, to value: Int) throws -> Int?
Parameters
constant
The class and name of the constant (format should be
Class.CONSTANT
).value
The new value of the constant.
Return Value
The new value of the constant.
-
Creates a new account and stores its private key in the client store.
Declaration
Swift
public func createAccount() throws -> Wallet?
Return Value
Information on the wallet that was created using the command.
-
Creates and signs a transaction without sending it. The transaction can then be send via
sendRawTransaction()
without accidentally replaying it.Declaration
Swift
public func createRawTransaction(from transaction: OutgoingTransaction) throws -> String?
Parameters
transaction
The transaction object.
Return Value
Hex-encoded transaction.
-
Returns details for the account of given address.
Declaration
Swift
public func getAccount(forAddress address: String) throws -> Any?
Parameters
address
Address to get account details.
Return Value
Details about the account. Returns the default empty basic account for non-existing accounts.
-
Returns the balance of the account of given address.
Declaration
Swift
public func getBalance(forAddress address: String) throws -> Int?
Parameters
address
Address to check for balance.
Return Value
The current balance at the specified address (in smalest unit).
-
Returns information about a block by hash.
Declaration
Swift
public func getBlock(forHash hash: String, withTransactions: Bool? = nil) throws -> Block?
Parameters
hash
Hash of the block to gather information on.
withTransactions
If
true
it returns the full transaction objects, iffalse
only the hashes of the transactions.Return Value
A block object or
nil
when no block was found. -
Returns information about a block by block number.
Declaration
Swift
public func getBlock(atHeight height: Int, withTransactions: Bool? = nil) throws -> Block?
Parameters
height
The height of the block to gather information on.
withTransactions
If
true
it returns the full transaction objects, iffalse
only the hashes of the transactions.Return Value
A block object or
nil
when no block was found. -
Returns a template to build the next block for mining. This will consider pool instructions when connected to a pool. If
address
andextraData
are provided the values are overriden.Declaration
Swift
public func getBlockTemplate(forAddress address: String? = nil, withExtraData extraData: String = "") throws -> BlockTemplate?
Parameters
address
The address to use as a miner for this block. This overrides the address provided during startup or from the pool.
extraData
Hex-encoded value for the extra data field. This overrides the extra data provided during startup or from the pool.
Return Value
A block template object.
-
Returns the number of transactions in a block from a block matching the given block hash.
Declaration
Swift
public func getBlockTransactionCount(forHash hash: String) throws -> Int?
Parameters
hash
Hash of the block.
Return Value
Number of transactions in the block found, or
nil
, when no block was found. -
Returns the number of transactions in a block matching the given block number.
Declaration
Swift
public func getBlockTransactionCount(atHeight height: Int) throws -> Int?
Parameters
height
Height of the block.
Return Value
Number of transactions in the block found, or
nil
, when no block was found. -
Returns information about a transaction by block hash and transaction index position.
Declaration
Swift
public func getTransactionInBlock(forHash hash: String, index: Int) throws -> Transaction?
Parameters
hash
Hash of the block containing the transaction.
index
Index of the transaction in the block.
Return Value
A transaction object or
nil
when no transaction was found. -
Returns information about a transaction by block number and transaction index position.
Declaration
Swift
public func getTransactionInBlock(atHeight height: Int, index: Int) throws -> Transaction?
Parameters
height
Height of the block containing the transaction.
index
Index of the transaction in the block.
Return Value
A transaction object or
nil
when no transaction was found. -
Returns the information about a transaction requested by transaction hash.
Declaration
Swift
public func getTransaction(forHash hash: String) throws -> Transaction?
Parameters
hash
Hash of a transaction.
Return Value
A transaction object or
nil
when no transaction was found. -
Returns the receipt of a transaction by transaction hash.
Declaration
Swift
public func getTransactionReceipt(forHash hash: String) throws -> TransactionReceipt?
Parameters
hash
Hash of a transaction.
Return Value
A transaction receipt object, or
nil
when no receipt was found. -
Returns the latest transactions successfully performed by or for an address. Note that this information might change when blocks are rewinded on the local state due to forks.
Declaration
Swift
public func getTransactions(forAddress address: String, numberOfTransactions: Int? = nil) throws -> [Transaction]?
Parameters
address
Address of which transactions should be gathered.
numberOfTransactions
Number of transactions that shall be returned.
Return Value
Array of transactions linked to the requested address.
-
Returns instructions to mine the next block. This will consider pool instructions when connected to a pool.
Declaration
Swift
public func getWork(forAddress address: String? = nil, withExtraData extraData: String = "") throws -> WorkInstructions?
Parameters
address
The address to use as a miner for this block. This overrides the address provided during startup or from the pool.
extraData
Hex-encoded value for the extra data field. This overrides the extra data provided during startup or from the pool.
Return Value
Mining work instructions.
-
Returns the number of hashes per second that the node is mining with.
Declaration
Swift
public func hashrate() throws -> Float?
Return Value
Number of hashes per second.
-
Sets the log level of the node.
Declaration
Swift
public func setLog(tag: String, to level: LogLevel) throws -> Bool?
Parameters
tag
Tag: If
"*"
the log level is set globally, otherwise the log level is applied only on this tag.level
Minimum log level to display.
Return Value
true
if the log level was changed,false
otherwise. -
Returns information on the current mempool situation. This will provide an overview of the number of transactions sorted into buckets based on their fee per byte (in smallest unit).
Declaration
Swift
public func mempool() throws -> MempoolInfo?
Return Value
Mempool information.
-
Returns transactions that are currently in the mempool.
Declaration
Swift
public func mempoolContent(withTransactions: Bool? = nil) throws -> [Any]?
Parameters
withTransactions
If
true
includes full transactions, iffalse
includes only transaction hashes.Return Value
Array of transactions (either represented by the transaction hash or a transaction object).
-
Returns the miner address.
Declaration
Swift
public func minerAddress() throws -> String?
Return Value
The miner address configured on the node.
-
Returns the number of CPU threads for the miner.
Declaration
Swift
public func minerThreads() throws -> Int?
Return Value
The number of threads allocated for mining.
-
Sets the number of CPU threads for the miner.
Declaration
Swift
public func setMinerThreads(to threads: Int) throws -> Int?
Parameters
threads
The number of threads to allocate for mining.
Return Value
The new number of threads allocated for mining.
-
Returns the minimum fee per byte.
Declaration
Swift
public func minFeePerByte() throws -> Int?
Return Value
The new minimum fee per byte.
-
Sets the minimum fee per byte.
Declaration
Swift
public func setMinFeePerByte(to fee: Int) throws -> Int?
Parameters
fee
The new minimum fee per byte.
Return Value
The new minimum fee per byte.
-
Returns true if client is actively mining new blocks.
Declaration
Swift
public func isMining() throws -> Bool?
Return Value
true
if the client is mining, otherwisefalse
. -
Sets the client mining state.
Declaration
Swift
public func setMining(to state: Bool) throws -> Bool?
Parameters
state
The state to be set.
Return Value
true
if the client is mining, otherwisefalse
. -
Returns number of peers currently connected to the client.
Declaration
Swift
public func peerCount() throws -> Int?
Return Value
Number of connected peers.
-
Returns list of peers known to the client.
Declaration
Swift
public func peerList() throws -> [Peer]?
Return Value
The list of peers.
-
Returns the state of the peer.
Declaration
Swift
public func peerState(forAddress address: String) throws -> Peer?
Parameters
address
The address of the peer.
Return Value
The current state of the peer.
-
Sets the state of the peer.
Declaration
Swift
public func setPeerState(forAddress address: String, to command: PeerStateCommand) throws -> Peer?
Parameters
address
The address of the peer.
command
The command to send.
Return Value
The new state of the peer.
-
Returns the mining pool.
Declaration
Swift
public func pool() throws -> String?
Return Value
The mining pool connection string, or
nil
if not enabled. -
Sets the mining pool.
Declaration
Swift
public func setPool(toAddress address: Any) throws -> String?
Parameters
address
The mining pool connection string (
url:port
) or boolean to enable/disable pool mining.Return Value
The new mining pool connection string, or
nil
if not enabled. -
Returns the confirmed mining pool balance.
Declaration
Swift
public func poolConfirmedBalance() throws -> Int?
Return Value
The confirmed mining pool balance (in smallest unit).
-
Returns the connection state to mining pool.
Declaration
Swift
public func poolConnectionState() throws -> PoolConnectionState?
Return Value
The mining pool connection state.
-
Sends a signed message call transaction or a contract creation, if the data field contains code.
Declaration
Swift
public func sendRawTransaction(_ transaction: String) throws -> String?
Parameters
transaction
The hex encoded signed transaction
Return Value
The Hex-encoded transaction hash.
-
Creates new message call transaction or a contract creation, if the data field contains code.
Declaration
Swift
public func sendTransaction(_ transaction: OutgoingTransaction) throws -> String?
Parameters
transaction
The hex encoded signed transaction
Return Value
The Hex-encoded transaction hash.
-
Submits a block to the node. When the block is valid, the node will forward it to other nodes in the network.
Declaration
Swift
@discardableResult public func submitBlock(_ block: String) throws -> String?
Parameters
block
Hex-encoded full block (including header, interlink and body). When submitting work from getWork, remember to include the suffix.
Return Value
Always
nil
. -
Returns an object with data about the sync status or
false
.Declaration
Swift
public func syncing() throws -> Any?
Return Value
An object with sync status data or
false
, when not syncing. -
Deserializes hex-encoded transaction and returns a transaction object.
Declaration
Swift
public func getRawTransactionInfo(from transaction: String) throws -> Transaction?
Parameters
transaction
The hex encoded signed transaction.
Return Value
The transaction object.
-
Resets the constant to default value.
Declaration
Swift
public func resetConstant(_ constant: String) throws -> Int?
Parameters
constant
Name of the constant.
Return Value
The new value of the constant.


You know the story - you spend hours manually copying and pasting Excel cells from one sheet to another.
You remember the days when the promise of computers was they would actually save us time. So much for that.
I'll make you tools and workflows to automate your workflows and save all this wasted time.
"I need to SSH into the PHP server to deliver some CSS from the Cloudfronted server over HTTPS." Huh?
English - it's that mother tongue we all know and love. Let's use it! I can train your staff in plain English.
Is there a series of manual steps in your company that you'd like to automate away?
Can you not bear the thought of all that wasted time and money any more?
Well, book a call now.


What happens next?
Maybe something like this:
1. The user "expresses an interest" in the standard and provider - offline or online. They provide some details to the provider - number of apprentices, contact info etc
2. A negotiation happens offline - price, start dates etc
3. When they agree that they want to go forward. A "formal" quote comes back into the "DAS" system - linked to the employers account so that we have a record of this. At this stage it may or may not contain named apprentices
4. Named apprentices can be assigned to this "quote" - where do they come from? piped in from another source or typed into this page on the DAS?
5. The "quote" is accepted into the DAS system and is then used to set up payments etc. Other things would have to happen offline before this can happen


I have know many people in this world. But l’ve a few to understand and truly love me. One of them is you.You ‘ve made my routine days become more meaning.
When I feel happy, I dare to laugh among people. But when I feel blue I’ve just to cried with you Because you’re the only one who understand me.
More than the greatest love the world has know This is the love I’ll give to you alone More than the simple words I try to say I only live to love you more each day.
 It’s you, so sweet and true.
Wedding Planner & Catering by @WeddingCatering BrownSugar
Mellow Garden Wine&Dine Restaurant
Swissotel Nai Lert Park Bangkok
Just click button CHECK IT!


Sign out
orders
add food-item
Welcome Admin
Boluwatife!
Iyan and Egusi
N200
modify
delete
Iyan and Egusi
N200
modify
delete
Iyan and Egusi
N200
modify
delete
Iyan and Egusi
N200
modify
delete


{% extends 'layout.html' %} {% block title %}Error: No Javascript Enabled{% endblock %} {% block body %}
You have disabled JavaScript in your browser. The feature you tried to use however requires that JavaScript is available. Please make sure to enable it for this website and hit the back button.


Power BI may very well be one of the most aptly named tools ever developed by Microsoft, giving analysts and developers a powerful business intelligence and analytics playground while still packaging it in a surprisingly lightweight application. Using Microsoft Power BI, the processes of data discovery, data modeling, data visualization, and sharing are made elegantly simple using a single product. These processes are so commonplace when developing Power BI solutions that this book has adopted sections that follow this pattern. However, from your perspective, the really exciting thing may be that development problems that would previously take you weeks to solve in a corporate BI solution can now be accomplished in only hours.
Power BI is a Software as a Service (SaaS) offering in the Azure cloud and, as such, the Microsoft product team follows a strategy of cloud first as they develop and add new features to the product. However, this does not mean that Power BI is only available in the cloud. Microsoft presents two options for sharing your results with others. The first, most often-utilized, method is the cloud-hosted Power BI service, which is available to users for a low monthly subscription fee. The second option is the on-premises Power BI Report Server, which can be obtained through either your SQL Server Enterprise licensing with Software Assurance or a subscription level known as Power BI Premium. Both solutions require a development tool called Power BI Desktop, which is available for free, and is where you must start to design your solutions.
Using the Power BI Desktop application enables you to define your data discovery and data preparation steps, organize your data model, and design engaging data visualizations based on your reports. In this first chapter, the development environment will be introduced, and the data discovery process will be explored in depth. The topics detailed in this chapter include the following:
- [ ] Getting started
- [ ] Importing data
Let’s first start by learning about what you need on your machine to get started.
Getting started
Power BI Desktop is available for free and can be found via a direct download link at Power BI (https://powerbi.microsoft.com/), or by installing it as an app from Microsoft Store. There are several benefits of using the Microsoft Store Power BI app, including automatic updates, no requirement for admin privileges, and making it easier for planned IT rollout of Power BI.
Once you’ve downloaded, installed, and launched Power BI Desktop, you will likely be welcomed by the start up screen, which is designed to help new users find their way. Close this start up screen so that we can review some of the most commonly used features of the application:
Figure 1.1: First view of Power BI Desktop
Following the preceding screenshot, let’s learn the names and purposes of some of the most important features in Power BI Desktop:
- Get data: Used for selecting data connectors and configuring data source details.
- Transform data: Launches the Power Query Editor, which is used to apply data transformations to incoming data.
- Report view: Report canvas used for designing data visualizations. This is the default view that’s open when Power BI Desktop is launched.
- Data view: Provides a view of the data in your model. This looks similar to a typical Excel spreadsheet, but it is read-only.
- Model view: Primarily used when your data model has multiple tables and relationships that need to be defined between them.
Now that you have a little familiarity with the basic controls within Power BI Desktop, let’s learn about the options you have for connecting to your various data sources.


Websphere, Domino and Java insights
When you are a LotusScript buff and make your first baby steps in Java and Domino, there are a few things quite different. Working on DominoWebDAV I learned a few lessons I'd like to share:
- Get yourself a copy of this. It is still the best transition from your sound knowledge of Lotus Script Domino Objects to Java Domino Objects
- Domino comes with an entitlement of a Websphere server, so this can be a good starting point. One caveat: Websphere likes to have EAR files for application deployments. When you start off with a simple servlet or JSP, it is most likely, that you just have a WAR file. When deploying a war file Websphere wants to know the application context (Tomcat on the other hand simply uses the WAR file name as context, easier but less flexible). When you enter "myapp" it won't work. You have to enter "/myapp/"
- When linking Websphere to Domino for authentication (a topic for another Thursday). Websphere by default activates J2EE security. This is a good thing for applications deployed in production, but a nightmare for a Java novice. So when you tick the security icon, untick the J2EE security icon below (in your development environment only of course)
- Before you get started with servlets, you might want to test your Java skills on an agent first. While the build in IDE is OK, editing Java in Eclipse is much more fun. To edit Java agents there, you can use the Domiclipse plugin.
- Not sure about Java itself? There is an excellent Java learning IDE called BlueJ. And there are the outstanding Head First books about Java, Servlets, EJB and Patterns.
- There are also plenty of places where you can get Java help and insights. My favourite places are Javaranch, Java Coffee Break and Jakarta.
- When looking at a specific problem to solve, check the Jakarta Commons before you start coding. There a lot of problems have been solved for you. For example there is a complete HTTP client, that handles authentication, cookies, html parsing or encryption for you.
- When you are done with a Domino object in Java, call its recycle() method.  Of course you need to be careful of the sequence. If you recycle a database object, you can't access the documents in there any more, even if you have a Java object pointing to one
- Have a look at session.resolve(url). This session method allows you to take a notes URL (notes://....) and resolve it directly to a database, view or document. That's a very nice shortcut thru the object hierarchy.
Posted by Stephan H Wissel on 22 February 2006 | Comments (3) | categories: Show-N-Tell Thursday


{% extends "base.html" %} {% block content %}
Up to this point InsCo has been a one period entity, created de novo at the beginning of the period and extinguished at the end. Now extend this concept by allowing InsCo to carry forward reserve liabilities and supporting assets from business written in prior periods. At the beginning of each new period InsCo has the option of continuing as a going-concern and writing new business, or becoming a run-off entity. This section analyzes InsCo’s decision.
Reserves are an evaluation of claim liabilities at a point in time before final settlement. Simultaneously with reserve evaluations InsCo must pass accounting solvency and regulatory capital tests. Introducing reserves is inextricably linked with a notion of time: when and how frequently are reserves, solvency and capital evaluated? Until now there has been no explicit notion of time in the analysis. The distortion function \(g\) introduced in Ch. 4 prices a bond with a probability \(s\) of default over one time period. In a multi-period model \(g\) will need to be applied multiple times in order to determine the risk load to ultimate.
The ability to avoid specifying the length of a period has been enabled by the assumption of a zero risk free rate of interest. Since interest represents a rate of payment per unit of time it also requires an explicit temporal framework. The analysis will continue to assume a zero risk free rate.
In a one period model, where losses are paid at the end of the period, it is clear that a risk measure must apply to the paid loss random variable. In a multi-period model there are different ways to define which variable should be used to evaluate risk. In Solvency II the capital standard is applied to the end of period market value of liabilities. Since there isn’t a market value for most insurance liabilities, this quantity is estimated as reserves plus a risk margin that is calculated as the cost of capital times regulatory capital over the run-off period. The UK (England REF) requires risk be evaluated using ultimate variability at each point in time. Since the sum of one year views must reconcile to ultimate risk in a steady state book these two must be approximately equal, albeit with the option to push recognized volatility into the future in Solvency II.
The examples in this section assume that the regulator uses the ultimate distribution of losses at each point in time when evaluating risk. This view is consistent with the fact that InsCo has an option not to re-capitalize to the regulator standard at each evaluation point. It also reflects the inherent difficulties in modeling a future distribution of market values. The extent it possibly over-states risk can be offset by selecting a lower probability threshold in the regulator risk measure.
Specifically, the regulatory and valuation assumptions are as follows.
All risky liabilities have a fair market price given by the distortion \(g\) and associated risk measure \(\rho\), per Ch2. 4 and 9. The market value of a risk \(X\), whether paid or booked as a liability at the end of the period, is \(\rho(X)=\int g(S(t))\,dt\). If \(X\) is a sum of parts then there is a natural allocation to each part, REF. As a result of this assumption InsCo faces costly capital. Previously the analysis considered risky cash flow rather than risky liabilities.
Regulation requires InsCo holds \(\mathsf{VaR}\) capital based on the objective distribution of ultimate loss. The calculation uses expected value, reflecting the full range of outcomes, and with a reduction for claims paying ability. It is MAYBE consistent with the UK but not Solvency II. If InsCo fails the capital standard the regulator can place it into rehabilitation, conservation or liquidation, i.e. existing management is usurped. The example takes \(p={{p}}\).
There are three accounting views: statutory, objective and economic that differ in how they value liabilities.
There is no difference in the carrying value of an asset across the three accounting views. All assets are invested in a risk free instrument, the numeraire, that pays a zero interest rate. The market value of an asset always remains equal to its original statement value.
Liability holders have equal priority in default.
All policies have the same effective date and a one period policy term. There is no unearned premium reserve at the end of a period. The only liability carried forward is an unpaid loss reserve.
Capital markets are efficient and InsCo investors do not have a liquidity constraint.
In addition to solvency regulation InsCo also faces standard financial accounting thresholds. If its assets fall below the financial reporting expected value of liabilities it becomes insolvent and goes into liquidation. Since this is a weaker test than the capital standard it never becomes part of the analysis.
As a matter of nomenclature, new business refers to policies that are written and become effective during a period. It encompasses both renewals of existing policies and new-new policies. The model is not addressing questions of new-new business performing differently than renewal business.
In the example the reserves and new business are independent for computational convenience. However, the calculus does not require independence.
If expected payments from reserves plus new business equals the amount of new business written then the portfolio is in steady state. However, this is not necessary. Paid losses are only relevant to determine the probability of different decisions, and are not included in the model until the last section.
\(X_{0}\) represents business written in the first period from \(\tau=0\) to \(\tau=1\). \(X_{-1}\) represents business written in the prior period from \(\tau=-1\) to \(\tau=0\). As usual \(X=X_{-1}+X_{0}\) is total liabilities and \(a\) represents assets.
The market value of InsCo defined as the market value of assets less market value of liabilities. Since assets are held at market value in a risk free account it is simply \(\mathit{MV}(X, a) = a - \rho(X\wedge a)\). The economic gain or loss for investors from a change to InsCo assets or liabilities is defined as the change in market value minus the change in assets invested. If there is a change \(X\) to \(X'\) and \(a\) to \(a'\) then it is given by \[\begin{align} EGL &= (a'-\rho(X'\wedge a'))- (a-\rho(X\wedge a)) -(a'-a) \nonumber \\ &= \rho(X\wedge a) - \rho(X'\wedge a'). \label{eq:egl} \end{align}\] Changes in economics are driven solely by their impact on insured claim liabilities. An economic gain or loss for investors is exactly offset by an economic loss or gain for insureds.
The simple form of relies on the fact assets are invested in a risk free instrument so \(a\) does not change from its initial value. It also relies on there being no frictional costs to investors of holding assets within InsCo. With asset risk or frictional costs there could a loss of value immediately on investment. Practitioners speak of insurers as capital roach motels: capital can check-in but it can never check out. We are assuming an efficient capital market without such frictions.
The economic gain or loss from a small change \(da\) in assets with no change in liabilities, i.e. an increase in capital, is \[\begin{equation} \mathit{EGL} = \int_0^a g(S(t))dt - \int_0^{a'} g(S(t))dt = -g(S(a))da < 0. \label{eq:never-recap} \end{equation}\] by . Investors will never voluntarily add assets to InsCo with no change in \(X\) because it is a gift to insureds. On the other hand they will always benefit from decreasing assets, but insureds will never voluntarily submit to such a reduction. Here there is a critical distinction between new business and reserves: new business has a choice of insurer in a competitive market whereas claimant liability holders, reserve holders, are locked into InsCo. In a transparent market it is not possible to extract excess profits, beyond the cost of capital, from new business because insureds would not purchase at a price above the fair market value. However, it is possible to do so from reserve holders because they are unable to unilaterally move their claim to another insurer. The insurer has latitude to change capitalization for claimants provided it complies with regulation. In particular it has the right to dividend excess capital, above the regulator standard, to owners resulting in a transfer of market value from reserve holders to shareholder owners. Extracting this value creates an incentive for InsCo to continue as a going-concern.
The rest of this section lays out a detailed example.
{% include "Reserve_specification.html" %}Expected one period payments are {{ est_paid }} and expected end of period assets are {{ est_ye_assets }}.
Table: Margin is earned in each period is determined by the natural allocation. Beginning margin shows cumulative margin available at each point in time.
shows how economic income is earned. The difference in margin with the following period is earned during the period. The bulk of the margin is earned in the first period, as expected. It has the greatest resolution of uncertainty. This is particularly true for short-tailed, catastrophe exposed lines. Removing the claim count uncertainty has a relatively small impact. Setting up accurate case reserves will be important. Obviously the more accurate case reserves the less uncertainty and margin is deferred into period 4 when claims are paid. At \(t=4\) all claims are paid and closed. In steady state the total margin earned equals the margin embedded in the current accident year.
In this case reserve duration is exactly four years. There are no payments made before then. The risk tenor, defined as the ratio of cumulative beginning period margins to one year margin is {{risk_tenor}}.
In run-off the margin required for the reserves at best estimate is {{best_estimate_margin}} vs. {{going_concern_margin}} as a going-concern.
{{ year_end_option_analysis | safe }}
| Column or Symbol | Definition |
|---|---|
| \(a\) | Assets at the end of the prior period, brought forwards |
| \(S_X(a)\) | \(Pr(X > a)\) |
| \(S_{X_{-1}}(a)\) | \(Pr(X_{-1} > a)\) |
| \(E(X_{-1}\wedge a)\) | Expected value payments to \(X_{-1}\) limited at \(a\), stand-alone basis |
| \(\rho(X_{-1}\wedge a)\) | Market value payments to \(X_{-1}\) limited at \(a\), stand-alone basis |
| \(E(X_{-1}(a))=\bar S_0(a)\) | Expected value of recoveries by \(X_{-1}\) within \(X\) with assets \(a\) |
| \(P(X_{-1}(a))=\bar P^a_0\) | Market value of recoveries by \(X_{-1}\) within \(X\) with assets \(a\) |
| \(E(X_{0}(a))\) | Expected value of recoveries by \(X_{0}\) within \(X\) with assets \(a\) |
| \(P(X_{0}(a))\) | Market value of recoveries by \(X_{0}\) within \(X\) with assets \(a\) |
| \(E(X\wedge a)=\bar S(a)\) | Expected value payments to \(X\),limited at \(a\) |
| \(\rho(X\wedge a)=\bar P(a)\) | Market value payments to \(X\), limited at \(a\) |
| \(ro\) | Stand-alone view, liabilities \(X_{-1}\) |
| \(gc\) | Going-concern view, liabilities \(X=X_{-1}+X_{0}\) include new business |
| \(\Delta Q_{ro}(a)\) | Change in equity paid in, run-off |
| \(\Delta \mathit{MV}_{ro}(a)\) | Change in market value for re-capping, run-off |
| \(\mathit{EGL}_{ro}(a)\) | Economic gain or loss from re-capping, run-off |
| \(\Delta Q_{gc}(a)\) | Change in equity paid in as a going-concern |
| \(\Delta \mathit{MV}_{gc}(a)\) | Change in market value for re-capping as a going-concern |
| \(\mathit{EGL}_{gc}(a)\) | Economic gain or loss from re-capping as a going-concern |
Table: Detailed result table key
The column header shows assets \(a\) carried forward by InsCo to back the reserve liability at the end of the prior period. The table shows a range of \(a\) around the required run-off asset level \(a_{ro}:=\mathit{VaR}_{p}(X_{-1})={{a_x0}}\). The last column shows the going-concern capital \(a_{gc}:=\mathit{VaR}_{p}(X)={{a_x}}\) including \(X_{0}\). \(\rho(X_{-1}\wedge a)\) is run-off premium. \(P(X_{-1}(a))\) is the natural allocation going-concern market value premium for \(X_{-1}\) as part of \(X\). \(\rho(X\wedge a)\) is total premium as a going-concern. All premiums are computed with the same distortion but generally with different \(Q\)-measures between the run-off and run-off scenarios. The market value of insurance payments reflects actual assets, whereas financial accounting reserve expectations may not.
InsCo’s market value can be computed on a run-off basis, with liabilities \(X_{-1}\), or on a going-concern basis, with liabilities \(X\). \(\Delta\mathit{MV}\) represents the change in market value from a strategic decision.
\(\Delta Q(a)\) represents capital cash calls or dividends paid to owners as the result of strategic decisions made about renewal and run-off. A positive value represents a capital injection, required to maintain the minimum capital level, and a negative value corresponds to a dividend payable to owners to lower excess capital to the regulated level. InsCo faces costly capital and will never hold more than the regulator required level.
Going into the new period InsCo has two options.
In order to decide between these options InsCo computes the economic gain or loss from each and selects the one with the greatest EGL provided it is positive. If EGL is negative for all options the company enters run-off and accepts regulatory strictures associated with failing the capital standard.
In reality InsCo would have a range of new business it could write. It would select the one with the greatest positive EGL by repeating the following analysis for each.
This process mirrors a Lloyd’s reinsurance to close transaction, where one year of account is reinsured into a new syndicate.
In run-off, InsCo requires assets \(a_{ro}\) and owners face a call (dividend if \(<0\)) of \(\Delta Q_{ro}(a) = a-a_{ro}\) to re-capitalize (return excess capital). It is relatively unlikely that assets are inadequate and investors face a call, see the left two columns of . The third column corresponds to assets exactly equal to \(a_{ro}\) and so there is no capital adjustment. In all columns to the right they receive a dividend.
When it takes no action, InsCo has a run-off market value of \(\mathit{MV}_{ro}(a) = a-\rho(X_{-1}\wedge a)\). If ending assets are low relative to unlimited liabilities the market value is very small, but it is always positive unless \(\Pr(X_{-1}<a_{ro})=0\), i.e. if the owner’s residual value is certain to be zero. If InsCo re-capitalizes the market value becomes \(\mathit{MV}_{ro}(a_{ro})\). Owners will decide to re-capitalize if there is a positive economic gain or loss from their investment \(\mathit{EGL}_{ro}(a)=P(X_{-1}\wedge a) - \rho(X_{-1}\wedge a_{ro}) \ge 0\).
As we have already seen in re-capitalizing with no change to liabilities will alway destroy market value. Adding capital is a donation to claimants, increasing the value of their claim and destroying investor value. For asset values close to \(a_{ro}\) the loss is quite small, but it increases rapidly for lower asset levels. An investment could still be undertaken to avoid costs of financial distress generated by regulator supervision, where investor appointed managers are replaced with regulator appointees who may have non-commercial incentives but these considerations are outside the model.
In case 1.b, where ending assets \(a>a_{ro}\), InsCo can dividend excess capital back to owners and become a run-off entity. Again, in the absence of other reasons, it will always choose do so. Extenuating reasons could include reputation and marketing benefits or if InsCo faces inefficient capital markets for raising new capital under financial distress. Higher premium for a more well capitalized company is not a reason because premiums already explicitly incorporate capital adequacy.
InsCo can also consider going-concern options.
As a going-concern InsCo requires assets \(a_{gc}\), which will typically be larger than \(a_{ro}\) by at least the volume of new business written. The new assets will come from two sources: premium from new business and a capital contribution from current investors. Existing investors pay the fair market premium for \(X_{-1}\), combine it with \(X_{0}\), add assets to the regulated level, and collect new premium. They create an entity with a higher market value which they could sell to recoup their investment if desired. They will undertake the investment if the increase in market value it produces is greater than the amount of their investment.
Since the capital market is efficient there is no need to distinguish between new and existing investors. Existing investors engineer InsCo so it can write \(X_{-1}+X_{0}\) and then sell it or retain it. Or InsCo owners can bring on new investors by selling a pro rata portion of the going-concern. Or new investors can be brought in pari passu with existing owners during the transaction. In an efficient market there are no liquidity constraints and the order of these transactions is irrelevant. Owners will be able to obtain the necessary financing to re-capitalize and sell if doing so creates market value. Since all valuation is at the fair market price there is no dilution between new and existing investors. The model does not allow imperfections such as a control premium or asymmetric information between management, existing and new investors, for example.
Adding \(X_{0}\) results in total liabilities \(X=X_{-1}+X_{0}\) and regulatory asset level \(a_{gc}\). The natural allocation gives the fair market value of insurance cash flows, i.e. premium, \(P(X_i(a_{gc}))\) for each line. The new entity has market value \(\mathit{MV}_{gc}(a_{gc})=a_{gc}-\rho(X\wedge a_{gc})={{mv_gc}}\), shown in the right-hand most column. Note this single market value is computed for \(X\), as opposed to run-off \(X_{-1}\).
To be fair to new insureds InsCo must bring forward assets equal to the market value of assumed reserve liabilities, \(P(X_{-1}(a_{gc}))\), and increase capital. \(P(X_{-1}(a_{gc}))\) is same market value that would apply if new business with a distribution \(X_{-1}\) were written alongside \(X_{0}\). InsCo owners invest \(\Delta Q_{gc}(a) = a_{gc}-P(X_{0}(a_{gc}))-a\) to capitalize InsCo to write new business, where \(P(X_{0}(a_{gc}))\) is the market value of new business. The increase is funded out of ending assets \(a\) and new investment by existing InsCo owners. If there are excess ending assets they are returned to original investors as a buy-out dividend payment. The funding constraint implies \(a_{gc}=P(X_{-1}(a_{gc}))+P(X_{0}(a_{gc}))+\mathit{MV}_{gc}(a_{gc})\).
By the economic gain or loss from these transactions is \[\begin{align*} \mathit{EGL}_{gc}(a) % &= \Delta_{gc}\mathit{MV}_{gc}(a) - \Delta Q_{gc}(a) \\ %&= (a_{gc} - \rho(X\wedge a_{gc})) - (a - \rho(X_{-1}\wedge a)) - (a_{gc} - P(X_{0}(a_{gc}))-a) \\ %&= - \rho(X\wedge a_{gc}) + \rho(X_{-1}\wedge a) + P(X_{0}(a_{gc})) \\ &= \rho(X_{-1}\wedge a) - P(X_{-1}(a_{gc})) \\ \end{align*}\] the difference between the market value of reserves supported by ending assets and the market value of reserves supported by regulatory capital within a portfolio with new business. The gain from the investment exactly equals the loss in market value to claimants caused by a relative reduction in their capital adequacy. In general the term on the right is positive. InsCo investors make the investment to create the going-concern if \(\mathit{EGL}_{gc}(a)>\max(0, \mathit{EGL}_{ro}(a))\): i.e. if it is positive and is a better option than going into run-off. In this case the break-even asset level is \(a={{break_even}}\) and going-concern dominates run-off.
Comparing the going-concern and run-off EGLs shows they both have the same form: market value of reserve liabilities with current assets minus market value with regulated assets. \[\begin{gather*} \mathit{EGL}_{ro}(a) = \rho(X_{-1}\wedge a) - \rho(X_{-1}\wedge a_{ro}) \\ \mathit{EGL}_{gc}(a) = \rho(X_{-1}\wedge a) - P(X_{-1}(a_{sa})) \\ a_{ro} < a < a_{gc} \\ {{a_x0}} < {{est_ye_assets}} < {{a_x}} \\ P(X_{-1}(a_{gc})) < \rho(X_{-1}\wedge a_{ro}) < \rho(X_{-1}\wedge a) \\ {{mvp_gc}} < {{mvp_ro}} < {{mvp_a}} \end{gather*}\] The last four lines show the normal ordering of these variables in a steady state when paid losses are close to the expected value and reserves are less volatile than new business The relevant values are pulled from the Results table.
In run-off, the re-capitalizing EGL is positive only if it results in a dividend because assets are greater than regulated assets. This is likely to occur be because starting assets are calibrated to the more volatile going-concern book. By continuing as a going-concern InsCo captures the efficiencies of pooling reserves with new business, and so \(P(X_{-1}(a_{gc}))={{mvp_gc}}\) is generally less than \(\rho(X_{-1}\wedge a_{ro})={{mvp_ro}}\). The lower value in the going-concern is driven by the claims from higher volatility new business eroding the claimants’ position. The dynamics are illustrated in . Thus under normal circumstances the company will continue as a going-concern. Ending assets below {{break_even}} will put the company into run-off but this implies very high paid loss for the year.
In both run-off and going-concern InsCo reduces the value of the reserve holder claims by reducing assets to the regulatory amount: a regulator-sanctioned haircut for claimants. Since the reserve holders are tied into InsCo they have no recourse. The analogous action for newly written business is impossible: it corresponds to switch-and-bait, selling at a premium corresponding to a higher asset level and delivering a lower one. If InsCo attempted that it would fail to write the business.
There are some important timing differences in timing and the modeled quantities in the model presented here and Solvency II.
Solvency II capital is calculated as the value at risk of one year market values. It requires estimating the distribution of reserves book one year out, i.e. modeling a variable with no objectively determined value, an obvious problem.
The approach here uses an estimate of the distribution of ultimate payments from current reserves, which is an objective quantity. It implicitly relies on the distribution of paid losses during the year, another objective quantity that can be modeled. Paid losses relate to a specific time frame.


| 1 | package fr.sii.ogham.core.resource.resolver; | |
| 2 | ||
| 3 | import java.io.File; | |
| 4 | import java.util.List; | |
| 5 | ||
| 6 | import org.slf4j.Logger; | |
| 7 | import org.slf4j.LoggerFactory; | |
| 8 | ||
| 9 | import fr.sii.ogham.core.exception.resource.ResourceResolutionException; | |
| 10 | import fr.sii.ogham.core.resource.FileResource; | |
| 11 | import fr.sii.ogham.core.resource.Resource; | |
| 12 | import fr.sii.ogham.core.resource.path.ResolvedPath; | |
| 13 | import fr.sii.ogham.core.resource.path.ResolvedResourcePath; | |
| 14 | import fr.sii.ogham.core.resource.path.ResourcePath; | |
| 15 | ||
| 16 | /** | |
| 17 | * Resource resolver that searches for the resource on the file system. The | |
| 18 | * resource resolution can handle relative path but it depends on the runtime | |
| 19 | * environment. It is better to provide an absolute path. The generated resource | |
| 20 | * information will only contain a reference to the stream of the found | |
| 21 | * resource. If file pointed out by the path doesn't exist, then an | |
| 22 | * {@link ResourceResolutionException} is thrown to indicate that the resource | |
| 23 | * couldn't be found. | |
| 24 | * | |
| 25 | * @author Aurélien Baudet | |
| 26 | * @see FileResource | |
| 27 | */ | |
| 28 | public class FileResolver extends AbstractPrefixedLookupPathResolver implements RelativisableResourceResolver { | |
| 29 | private static final Logger LOG = LoggerFactory.getLogger(FileResolver.class); | |
| 30 | ||
| 31 | public FileResolver(List<String> lookups) { | |
| 32 | super(lookups); | |
| 33 | } | |
| 34 | ||
| 35 | public FileResolver(String... lookups) { | |
| 36 | super(lookups); | |
| 37 | } | |
| 38 | ||
| 39 | @Override | |
| 40 | protected Resource getResource(ResolvedPath resourcePath) throws ResourceResolutionException { | |
| 41 | LOG.debug("Loading resource {} from file system", resourcePath); | |
| 42 | String resolvedPath = resourcePath.getResolvedPath(); | |
| 43 | File file = new File(resolvedPath); | |
| 44 |
1
1. getResource : negated conditional → RUN_ERROR |
if (!file.exists()) { |
| 45 | throw new ResourceResolutionException("Resource " + resolvedPath + " not found on file system", resourcePath); | |
| 46 | } | |
| 47 | Resource resource = new FileResource(file); | |
| 48 | LOG.debug("Resource {} found on the file system", resourcePath); | |
| 49 |
1
1. getResource : replaced return value with null for fr/sii/ogham/core/resource/resolver/FileResolver::getResource → RUN_ERROR |
return resource; |
| 50 | } | |
| 51 | ||
| 52 | ||
| 53 | @Override | |
| 54 | public boolean isAbsolute(ResourcePath path) { | |
| 55 | ResolvedPath resourcePath = resolve(path); | |
| 56 |
2
1. isAbsolute : replaced boolean return with false for fr/sii/ogham/core/resource/resolver/FileResolver::isAbsolute → NO_COVERAGE 2. isAbsolute : replaced boolean return with true for fr/sii/ogham/core/resource/resolver/FileResolver::isAbsolute → NO_COVERAGE |
return new File(resourcePath.getResolvedPath()).isAbsolute(); |
| 57 | } | |
| 58 | ||
| 59 | @Override | |
| 60 | public ResolvedPath resolve(ResourcePath relativePath, String prefixPath, String suffixPath) { | |
| 61 | ResolvedPath resourcePath = resolve(relativePath); | |
| 62 | String lookup = getLookup(relativePath); | |
| 63 |
1
1. resolve : replaced return value with null for fr/sii/ogham/core/resource/resolver/FileResolver::resolve → NO_COVERAGE |
return new ResolvedResourcePath(relativePath, lookup, prefixPath + resourcePath.getResolvedPath() + suffixPath); |
| 64 | } | |
| 65 | } | |
Mutations | ||
| 44 |
1.1 |
|
| 49 |
1.1 |
|
| 56 |
1.1 2.2 |
|
| 63 |
1.1 |


| Types | Creating Variables | Assignment Statements | Mathematical Operations |
| Type Casting | Mathematical Shortcuts | Order of Operations | Strings |
| User Input | Program Execution | Calculating Programs |
A variable is a name that corresponds to a value stored in the memory of the computer. We use variables in a program to hold values that are entered by a user, or are the result of a calculation. When a variable is create, a section of memory is set aside to hold the value. A variable must be create before it can be used. The value of a variable can change as the program executes. The number 5 is a constant. It cannot be changed. It is always 5. The value of a variable called x could change many times in a program. On any line, a variable can be set to the value of a constant, another variable, or an expression involving both constants and variables.
Every variable has a type. The type of a variable refers to the kind of value it can hold. The Java language defines eight primitive type; Boolean, byte, char, double, float, int, long, and short. We will use four of eight in this book.
| boolean | Holds a true or a false |
| int | Holds an integer, like 5, 0, or -64 |
| double | Holds a decimal number, like 2.7 or -15.83 |
| char | Holds one character, like b,6, or & |
A boolean variable can be set to the value true, or the value false. These are the only two Boolean constants. The computer actually stores a number, 1 for true and 0 for false. The boolean type requires one bit of memory.
An int variable can be set to a positive or negative whole number. The value of an int can range from -2147483648 to<PHONE_NUMBER>. The int type requires 4 bytes (32 bits) of memory.
A double variable can be set to very large or very small positive and negative number (values higher than 10 300, and lower than 10 -300). The numbers can include a decimal point, and well over 10 significant digits. The double type requires 8 bytes (64 bits) of memory.
A char variable can be set to any one character. A char constant must be enclosed with apostrophes ('). The char type requires 2 bytes (16 bits) of memory.
All data in a computer are stored as numbers. A char value is assigned a number according to the ASCII standard (American Standard Code for Information Interchange). The table below lists the ASCII values for the printable characters.
A new variable is create with the following format:
Examples:
Boolean b; char letter3; int x; double unitPrices;
The name must start with a letter. It can have numbers in it, as long as they are not the first character. No other characters may be used. By convention, we always start variable name with a lowercase letter. Java does not require this, but it does make programs easier to read.
Once a variable has been created, it must be set to a specific value with an assignment statement before it can be used. An assignment statement uses the assignment operator (=), and ends with a semicolon. The value on the right side of the assignment operator in the variable on the left side.
When a variable is created, a section of memory is reserved. Later in the program, which this variable name is used, it refers to the value in memory. The number 65 is stored for the character 'A'. Primitives store only numbers. Aside from size, the difference between the different primitive types is the way the number is interpreted. When a primitive variable is joined to a String with the concatenation operator, the value is converted to a String based on the variable's type.
A value can be assigned to a variable when it is created. This is called initializing a variable.
Boolean b = true; char letter3 = 'A'; int x = 5; double unitPrice = 2.98;
While the left side of an assignment statement must have only a single variable, the right side may include any number of constants, variables, and operations.
x = 4 + y / 7;
The following mathematical operations are defined by Java:
Addition(+) subtraction(-) Multiplication(*) Division(/) Modulo(%)
These operations can be performed on ints and doubles. Addition, Subtraction, and multiplication behave the same for ints and doubles. Division behaves differently for ints than it does for doubles. The modulo operator can only be applied to ints.
An operator operates on two numbers to either side of it. If the two numbers surrounding an operator are both ints, the result of the operation must be an int. This presents a problem when performing division on integers. For example, the result of 5 divided by 2 is 2.5, which is not an integer.
When an int is divided by another int, the result is the whole number part of the quotient. That means the decimal portion is removed. Note that the number is not rounded. The examples below are not Java code. The => symbol is being used to mean "results in".
Examples:
5 / 2 => 2 20 / 6 => 3 3 / 4 => 0
The modulo operator gives the decimal part of the division in the form of a remainder.
Examples:
5 % 2 => 1 20 % 6 => 2 3 % 4 => 3
Suppose you have some number of items and you wish to put them in groups.
20 / 6 => 3 (3 groups of six) 20 % 6 => 2 (2 extras)
If you wish to divide two integer constants and get a double for a result, enter one (or both) of the integers as doubles.
Examples:
5.0 / 2 => 2.5 20 / 6.0 => 3.33333...... 3.0 / 4.0 => 0.75
Of course, this cannot be done when variables are used.
Type casting refers to the conversion of a value from one type to another. In some case, we ae not aware of the conversion. If we assign an int value to a double variable, the conversion is automatic because a double variable can hold an integer.
int x = 5; double y = x;
On the other hand, we cannot assign a double value to an int variable. If we try, the complier will complain because part of the value might be lost.
double y = 3.7; int x = y; Complier Error possible loss of precision found : double required : int int x = y;
If we actually want to remove the decimal portion and store the integer part, we have to tell the compiler explicitly to cast the value to the int type. To cast a value to a new type, precede the value with the new type, enclosed in parentheses.
int x = (int) 3.7;
You can cast both constants and variables. Casting a variable does not change the value of the variable. It only changes how that value is assigned to the new variable.
double y = 3.7; int x = (int)y; x is 3, but y is still 3.7.
If you want the result of integer division to retain the decimal part, cast one or both operands to a double. This applies to variables as well as constants.
y = (double)4 / 5
If a char is cast to an int, the result will be the ASCII value for that char. if an int (variable or constant) is cast to a char, the character will have the ASCII value of the original int.
Example Program - Casting
public class Casting { public static void main (String[] args) { char letter = 'J'; int value = (int)letter; System.out.print("The ASCII value of " + letter); System.out.println(" is " + value); value = 75; letter = (char)value; System.out.print("The ASCII character for " + value); System.out.println(" is " + letter); } }
The following shortcuts are not needed, but are supported for convenience.
x++; is equivalent to x = x + 1; x--; is equivalent to x = x - 1; x += n; is equivalent to x = x + n; x -= n; is equivalent to x = x - n; x *= n; is equivalent to x = x * n; x /= n; is equivalent to x = x / n; x %= n; is equivalent to x = x % n;
When the computer executes an assignment statement, it performs one operation at a tie. The operations are performed in the following order. For each step, if there are multiple operations of the same kind, they are performed left to right.
Replace variables Casting Multiplications and Divisions (*, /, %) Additions and Subtractions (+, -) Assignment(=)
Example
double a; double b = 3.8; int c = 4; a = 5 + c * (int)b - 7 % c;
Think like the computer. The operations are listed in steps below. One type of operation is done on each line.
Steps:
| a = 5 + 4 * (int) 3.8 - 7 % 4 | replace variables |
| a = 5 + 4 * 3 - 7 % 4 | Casting |
| a = 5 + 12 - 3 | Multiplications and Divisions |
| a = 14 | Additions and Subtractions |
Parentheses can be used to force a specific order of operations.
12 / (1 + 2) => 4
Every variable is either of a primitive type or a class type. Like a primitive type, a class defines the sort of data a variable can hold. When we make a new variable of a class type, we say that we created a new object. An object is a specific instance of a class. For any class, we can create many objects. The term object refers to the collection of stored data and is composed of multiple primitives. The variable is called a reference variable. We say that the reference variable points to the object.
An example of a class is the String class. Each String object is composed of a number of chars. We can make an object of the String class and a reference variable that points to the object just as we make and initialize a primitive variable.
String firstName = "Dean";
The String constant must be enclosed in quotation marks ("). A String variable can be set to a new constant, or to the same value as another variable using an assignment statement.
lastName = firstName; firttName = "James";
Because String are so commonly used, we can create them and assign values just as we do with primitives. But Strings are not primitives, they are objects of a class. The shortcuts for creating and assigning value do not work when creating objects of other classes.
To initialize a new String to an empty String, use:
String name = "";
When the + is operator is applied to String objects, it does not perform the same function as it does when it is applied to primitive values. Rather than add the two values, the String are joined.
3 + 5 => 8 (+ applied to ints) "3" + "5" => "35" (+ applied to Stings)
Program are much more interesting if they do something different each time they run. We can defect and receive keyboard input by creating an object of the Scanner class. The Scanner object only needs to be created once. After that, we can use the same Scanner object each time we read from the keyboard. We will discuss the creation of object in detail in a later chapter. For now, the following line will create a new Scanner object.
Scanner keyboard = new Scanner(System.in);
As with all objects, we need to create a reference variable that point to the object. This reference variable can have any valid variable name. Above, the variable name is keyboard
, but we could have used input
, or myScanner
, or fruitSaLaD26
.
Scanner fruitSaLad26 = new Scanner(System.in);
However, keyboard
is a better name for a Scanner variable that reads from the keyboard.
Scanner is a class that is part of the Java language. Most of the time, the program has to specify where the computer can find classes. This isn't the case for Strings because they are used so commonly. The following line typed before the beginning of the class will tell the compiler where to find the Scanner class.
import java.util.Scanner;
We use a Scanner object by "calling methods on it". That means we follow the variable with a period and one of the methods listed below.
next() Reads the next word nextInt() Read the next int nextDouble() Read the next double nextLine() Read the next line
When a Scanner method is called, we say that the program blocks. That means the program will pause and wait for the user to type. Once the user presses the Enter key, the method stops blocking and program execution continues. When the user presses Enter, and the method completes, we say the method returns a value. That means that the method call is replaced with the value that was entered. If we assign this returned value to a variable, we can use it later in the program.
import java.util.Scanner; public class ScanTester { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String name = ""; int age = 0; double gpa = 0.0; System.out.println("Hi there. What's your first name?"); name = keyboard.next(); System.out.println("Hi " + name + ". How old are you?"); age = keyboard.nextInt(); System.out.println("I see. " + age + " Your current GPA?"); gpa = keyboard.nextDouble(); System.out.println(gpa + ". That's Super. " + name); } }
When a user types on the keyboard, characters are stored in the keyboard buffer. The next()
method looks past any whitespace in the keyboard buffer to find the next word. It removes the next word and returns the characters to the program. Any remaining characters are left in the buffer for the next Scanner method call. The nextInt()
and nextDouble()
methods also find the next word, but convert the String in to numbers before returning so that the values can be stored as numbers for calculations. Since these three methods only read one word at a time and leave any remaining input in the keyboard buffer, a user could run the previous program, and enter all three pieces of information on one line.
The nextLine()
method is the oddball is the group. It reads everything typed up to the newline character, which is discards. This allows the user to enter multiple words. Hower, a problem occurs if nextLine()
is called after next()
, nextInt()
, or nextDouble()
, because these methods leave the newline character from the Enter key in the keyboard buffer. The nextLine()
method will read this newline character and continue without giving the user a chance to enter anything. An extra call to nextLine()
can be used to remove the newline character left by another method call.
import java.util.Scanner; public class ScanTester2 { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String name = ""; String book = ""; int year = 0; String movie = ""; System.out.println("Hi there. What's your name?"); name = keyboard.nextLine(); System.out.println("What's your favorite book?"); book = keyboard.nextLine(); System.out.println("I've never heard of " + book + " " + name); System.out.println("What year was it written in?"); year = keyboard.nextInt(); System.out.println("Huh.... If you say so. Favorite movie?"); keyboard.nextLine(); movie = keyboard.nextLine(); System.out.println("You're weird."); } }
As a program runs, the values of the variables change. When calculating the value for an assignment statement, always use the current values for variables, which are not necessarily the same as the starting values.
An assignment statement is used to set the value of a variable to whatever is on the right side of the equals sign. This expression might include other variables. It also might include the variable on the left of the assignment. The old value of the variable is used to determine the new value.
What are the values of x and y after the following code runs?
int x = 0 int y = 2; x = 0, y = 2 x = (5 + 3) / 2; x = 4, y = 2 y = x - 1; x = 4, y = 3 x = x + 1; x = 5, y = 3 y = y + x x = 5, y = 8 x = 5, and y = 8
Using variables and mathematical operators, we can write simple programs that calculate things based on user input.
import java.util.Scanner; public class Budget { public static void main(String[] args) { int pay = 0; int car = 0; int rent = 0; int electricity = 0; int food = 0; int money = 0; Scanner keyboard = new Scanner(System.in); System.out.println("*** The budget Program ***\n"); System.out.println("Enter whole dollar amounts"); System.out.print("How much do you make each month? $"); pay = keyboard.nextInt(); System.out.print("How much is your car payment? $"); car = keyboard.nextInt(); System.out.print("How much is your rent/morgage payment? $"); rent = keyboard.nextInt(); System.out.print("How much is your electriccity payment? $"); electricity = keyboard.nextInt(); System.out.print("How much do you spend on food each month? $"); food = keyboard.nextInt(); money = pay - car - rent - electricity - food; System.out.println("You have $" + money + " left."); } }
This program could be writing using fewer variables as show below.
import java.util.Scanner; public class Budget2 { public static void main(String[] args) { int money = 0; Scanner keyboard = new Scanner(System.in); System.out.println("*** The budget Program ***\n"); System.out.println("Enter whole dollar amounts"); System.out.print("How much do you make each month? $"); money = keyboard.nextInt(); System.out.print("How much is your car payment? $"); money = money - keyboard.nextInt(); System.out.print("How much is your rent/morgage payment? $"); money = money - keyboard.nextInt(); System.out.print("How much is your electriccity payment? $"); money = money - keyboard.nextInt(); System.out.print("How much do you spend on food each month? $"); money = money - keyboard.nextInt(); System.out.println("You have $" + money + " left."); } }
Some programs may require that the number be kept separate for later calculations. Deciding how many variable to use in a program is one of the many choices a programmer must make for each program.