|
Lib-Util
A Utility C Library
|
A collection of utilities for development in C and C++. Including some basic data structures, hash functions, and headache free IO functions to replace some of the functionality of stdio.h
's scanf
functions.
Safe replacements for some Standard C Library functions. grabline() in particular is a safe replacement for fgets() / gets(). Grabword can often be used effectively in place of getchar() / getc() / fgetc().
Each function automatically handles different types of line endings (CR / LF) in a sane way. Never have to worry about eating the newline.
Functions include:
Each function returns a dynamically sized string that must be freed by the caller. All will return NULL on an error or the end of input.
A C library implementing of some of the most common data structures with an easy-to-use interface. It works with any data type because data is stored in a generic byte array. This will require you to recast some pointers returned by data.h to the correct data type.
Each data structure keeps track of the "current working position", and most of the function calls operate at, or modify the current position. The data.h header contains details for the use of each function.
Data structure types include:
Future plans include:
Types include:
int8_t
, int16_t
, int32_t
, and int64_t
bool
, true
, false
NULL
size_t
uint
, umax
, and imax
I'm not much of a hashing nut, I just wanted something that would work reasonably well. These hashes may not be the fastest or best, nor are they meant to produce consistent results cross-platform, but they work.
Hash Functions implemented:
Functions include:
Functions for logging to files and printing messages to stderr. Each message is tagged with the message's importance. There are various options for date and time tagging.
This project is using semantic versioning. As such, the API as documented in the header files and the project website will not change in an incompatible way unless there is a new major version number. Compatible changes are indicated by the minor version number.
Copyright (c) 2016-2018 Ammon Dodson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/nightly.20version.20stapling.html ---
sneak peek: https://github.com/leanprover/lean-nightly/releases
cool! Are you autogenerating the chglog diffs?
Yep!
After wasting hours and hours of cloud build time on fixing broken bash scripts, the pre-monad-PR nightly has finally landed for all platforms: https://github.com/leanprover/lean-nightly/releases/tag/nightly-2018-03-19
Now building the latest commit. Regular daily (well, nightly) builds should work starting tomorrow.
Monad nightly: https://github.com/leanprover/lean-nightly/releases
Nice! Thanks for doing it!
So feel free to discuss now how leanpkg should interact with all that :)
stretches alrighty!
For starter, it might be good to have a separate leanpkg
project with a separate way of installing it.
Then I think we should have a field in leanpkg.toml
I think in general we should be able to choose a version of Lean (in the project file) and have the version of the packages worked out for us. The most difficult part would be to let multiple versions of Lean exist on your system. I recognize that we talked about this before but this might be a good time to separate leanpkg
and lean
Or ... that would mean install a "master" version of Lean which leanpkg
uses as its interpreter and then curate a collection of nightlies
Yes, in absence of a native backend that may be the best solution. Though nightly releases may lose their importance until Lean 4 is merged into master.
Note that you can now store a nightly version string in the lean_version
config variable, and leanpkg will warn you about a mismatch
That's nice to know! Can you give me an example of the syntax?
lean_version = "nightly-2018-03-26"
, same string as in the release names and tags
Nice! What I've been using lately is a file called lean_version
with the exact hash that my project is using. Travis uses it to compile the right version of Lean and I have git hooks that block commits if that version doesn't match my system's version
have the version of the packages worked out for us
I believe this part isn't exactly trivial either. Do we grep through the repository for a commit with a fitting leanpkg.toml, or do we use tags for that (certainly not branches like for the stable releases)? What if there is no commit for that exact nightly?
I assume if mathlib
was to be tagged with the nightly it was built with, upgrade would upgrade to the right version
You're right
It might require discipline from the maintainers so that if they skip versions, they still tag a commit that will build with that version. That sounds cumbersome
The other possibility is to work in one of two modes: flexible or strict. In a strict mode, you ask leanpkg what is the latest nightly that all your dependencies work with and you upgrade to that one
Flexible would be a more relaxed form of that rule ... or just say "screw it" and get something that works with a more recent version of Lean and hope for the best
ahh, versioning. i just read a blog post about it in go https://blog.golang.org/versioning-proposal
I've been trying to come up with a sensible notion of semantic versioning for Lean but the meta
language usually doesn't fit in well
@Mario Carneiro What do you think would be a realistic Lean versioning scheme for mathlib? Store the nightly version in the toml/a tag, then upgrade only when important upstream fixes/features are available?
I think that's a fine idea. Assuming that old nightlies are now tracked, which it sounds like is working now, we could just put an appropriate nightly or lean git commit hash in the lean_version
field or wherever, and update it when mathlib updates to lean
Oh, nice, days are nicer than hashes for this
So we can implement this in mathlib now?
Yep, you can manually set that field right now and leanpkg will warn people about any mismatch
The only thing missing is a tool that automates that and setting up the correct Lean version. I've almost accidentally started a Twitter thread about that: https://twitter.com/derKha/status/979385452506550272
leanup
makes me giggle
I feel like most puns/connotations are completely flying over my head :)
But I'm confused why this is distinct from leanpkg
See https://twitter.com/derKha/status/979422420653297666
@graydon_pub I think I agree with you, but in our case the package manager is written in Lean. Since we still lack good FFI for e.g. downloading files, or even native compilation, I'm inclined to write the meta installer in Rust for now. Not rewriting the kernel in Lean either anytime soon...
- Sebastian Ullrich (@derKha)so it's a bootstrapping issue?
More like a "our current interpreter and object file format aren't exactly standalone and also calling out to curl
isn't very platform independent" issue
I.e. "probably the wrong tool for the job"
What's wrong with having separate install instructions for each platform, as long as you can keep it to one line for each?
It's not install instructions, the tool is supposed to download the correct Lean version by itself
The current leanpkg code is already quite ham-fisted in a few ways, it's really not fun to program with such a minimal API
What has a minimal API here? Lean or leanpkg?
Lean
Like... the most basic string functions
There are a lot of list functions, can those be repurposed? Or do they have to be implemented in C
I'd be happy to write what I can in lean, but I lack some necessary primitives
Thanks, but that still leaves the other two issues... I suppose we could bundle wget for Windows with it if we really wanted to
do you enjoy working on leanpkg? a quick and dirty solution is to use a cross-platform package manager that already exists
I guess I don't exactly... but I believe even the current leanpkg satisfies our specific needs better than a generic package manager ever could
For another example, we'll probably have to parse the JSON returned from Github's Releases API
@Gabriel Ebner Thoughts?
leanup
sounds reasonable to me. I agree that it should be separately distributed. It could even provide lean
and leanpkg
executables that automatically use the correct version depending on the leanpkg.toml
(or download them if necessary). Then we wouldn't even need to change any tooling that already uses lean
or leanpkg
.
In the long run, I think it should be written in Lean as well. With code generation on the horizon, this shouldn't pose a problem for distribution. And API-wise I guess there is some demand for networking functionality in Lean anyhow. Parsing JSON is the easiest part, we have parser combinators. :smile:
For now, I believe that a rust implementation is fine. It's probably even easier to distribute than a python script.
There should probably be a way to use local git builds via leanup as well.
Since we switched to static linking, the nightlies even work on NixOS. So no complaints from my sides. And if we switch back to dynamic linking, I'll just PR what we do in rustup: https://github.com/NixOS/nixpkgs/blob/599a2238386b6f1f293f888d068122b46e1bde23/pkgs/development/tools/rust/rustup/0001-dynamically-patchelf-binaries.patch
In the long run, I think it should be written in Lean as well.
I agree.
It's probably even easier to distribute than a python script.
Exactly, that was my main motivation.
There should probably be a way to use local git builds via leanup as well.
Yes, though I'm not yet sure what it should look like.
Then we wouldn't even need to change any tooling that already uses
lean
orleanpkg
.
Right, though then I'd like to "hijack" leanpkg configure
etc to also take care of setting up the correct Lean version. I'm really not sure if that would be less confusing than telling people to use leanup configure
instead of leanpkg configure
.
I'd like to "hijack" leanpkg configure etc to also take care of setting up the correct Lean version.
My suggestion was to hijack everything, i.e., even if you call just lean
, then leanup
automatically determines the correct version in the background, downloads the binaries, and then runs the correct lean
binary.
I think that's the easiest solution to support multiple lean versions in the editors.
Okay, bad example. What I meant was hijacking and changing the _semantics_ of e.g. leanpkg add/upgrade
so that they respect nightly versions
I think everything should respect the nightly versions. That is, when you run lean
, leanup
looks for a leanpkg.toml
, checks the version
field, and then executes the correct lean
executable. How else would you work with two packages that require different Lean versions?
Or did you mean that leanpkg upgrade
upgrades the version field as well?
No, I think there should be a separate command for upgrading the Lean version (just on leanup
or should it be injected into leanpkg
too??). I was thinking of leanpkg upgrade
looking at the dependencies' Lean versions when deciding which commit to upgrade to. But perhaps that isn't really necessary - when leanpkg
warns you that the Lean versions are out of sync when building an upgraded package, perhaps you're just supposed to run lean-upgrade
afterwards.
Ah, I see what you're talking about. This is hard. I don't think leanpkg warns you at the moment if one of the dependencies' Lean version is wrong. It's also not clear which nightly version to pick (the one for dependency A, or the one for dependency B, or their maximum??). If leanpkg
however adjusts the version
field correctly, then everything would just work with my proposal.
I.e. our main goal should be reproducibility when not touching the leanpkg.toml file. But when you want to upgrade either your Lean nightly version or a dependency's version, we probably shouldn't try to be "clever" but just jump to the upstream head of everything.
I don't think leanpkg warns you at the moment if one of the dependencies' Lean version is wrong.
Right. This would work automatically when we start building dependencies eagerly on configure
.
@Sebastian Ullrich How can you tell what lean commit a nightly corresponds to? The bot botson commit doesn't say the commit hash anymore (and is now Leo?)
Yes, Leo is now a bot :laughing:
The commit hash is next to the release description https://github.com/leanprover/lean-nightly/releases
Not sure why I removed it from the cmdline output...
If anyone's wondering where the Windows nightlies are: Apparently you have to ask the AppVeyor guys personally to enable cron builds...
I'm more wondering when will the mathlib have a tick mark
Does anyone know a working combination of Lean nightly + mathlib which includes the wlog
tactic?
linux nighly of course
so... leanpkg now helpfully says things like: WARNING: Lean version mismatch: installed version is master, but package requires nightly-2018-04-06
.
Is there any automatic help installing the right version of Lean? (Or do I need to learn how to install nightlies, after happily working off master all this time?)
Sorry not answering your question but: is the warning about one of your dependencies or about your own package?
Attempting to learn how to install nightlies...
1) The first google result for "lean nightly" is the rather unhelpful <https://github.com/leanprover/lean-nightly>.
2) I downloaded the latest Lean nightly from <https://leanprover.github.io/download/>, but there's no way to determine which date it's from, and it still gives the same error.
@Simon Hudon --- sorry, should have specified this is trying to compile mathlib.
Am I meant to be installing nightlies from somewhere else?
Thanks! I can help if you just need help installing nightlies
Ah, I found <https://github.com/leanprover/lean-nightly/releases>.
Often, I just leech off of Mario's knowledge and look at mathlib
's travis file for that kind of stuff
The main README.md for that repository desperately needs to contain a link to the releases page.
(I've just made a pull request.)
To lean-nightly? It hasn't crossed the ocean yet, it seems. I don't see it
I fixed the leanpkg warnings for one of my projects by changing the obvious line in leanpkg.toml
to lean_version = "nightly-2018-04-02"
Is anyone using a lean-nightly on OS X? When I try to use lean from a nightly, I just get:
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
I'm pretty sure gmp
is installed; plenty of other things are using it.
It seems for me that file is at /opt/local/lib/libgmp.10.dylib
instead.
Is this some homebrew vs macports incompatibility?
Yup, with gmp
provided by homebrew instead of macports, everything works.
In case you haven't seen the mathlib commits: https://github.com/Kha/elan
Thank you very much!
Is this something we can already try?
What does elan mean? Apart from being an anagram of lean?
élan :) . Not an acronym... yet
There may be some bugs and missing features, but I do believe it's usable already. mathlib's Travis config is now using it.
Is there any kind of documentation?
apart from mathlib travis?
The individual commands are documented inside the tool, and, as the readme hopefully implies, you shouldn't even need to worry about those if you just want to use the right version of leanpkg
for a package. Doc contributions are welcome, you guys seem to be very prolific in that.
error: invalid channel name 'master' in 'lean-scratchpad/leanpkg.toml'
info: caused by: invalid toolchain name: 'master'
This is what I get when I try leanpkg upgrade
after installing elan
Right, lean_version = "master"
used to be a thing... the preferred way is to set a specific nightly there now, but I guess we should still make master
default to the nightly
channel.
what would be the syntax to specify a nightly?
What if my specification is: whatever nightly works with that given mathlib version?
Then you should copy the version from mathlib's config in your _target
dir. I have plans to document how to deal with elan
and leanpkg upgrade
, but I first need to change leanpkg
for that.
Btw, you can also select toolchains like this: leanpkg +nightly ...
Ok, let me check my understanding. Currently this helps if I have different projects requiring different versions of Lean. But it does not help me if I have one project and I want to upgrade Lean+mathlib while keeping them in a consistent state?
Or does it?
I'm confused and I need to sleep
Need to teach how to prove existence of https://www.youtube.com/watch?v=RYH_KXhF1SY tomorrow morning
It doesn't help you with selecting the best nightly version suitable for all your dependencies (which gets complicated with more than one dependency) _yet_. It does help you to then download and install that version after you've changed your leanpkg.toml.
Yes, it seems it did that
Any reson why leanpkg uses upgrade
and elan uses update
?
Now I'm bound to hit the wrong one at least half the time
Heh, I guess you're right. I didn't name either of them and am open to changing one of them.
I have a slight preference for upgrade, because it's what apt uses when you actually want some change to installed stuff. But I wouldn't mind having update
I'm really excited to see Elan happen!
I tried to install it and got the following:
info: downloading component 'lean' 18.1 MiB / 18.1 MiB (100 %) 210.8 KiB/s ETA: 0 s info: installing component 'lean' info: rolling back changes error: failed to extract package info: caused by: invalid gzip header
Huh, that's a new one. OS X?
Yes! Sorry, I should have said that
Oops, I thought we were using .tar.gz
for OS X instead of .zip
:laughing:
tsk tsk
On a slightly related note: any chance that leanpkg
will get some flycheck
support in the future?
What do you mean by that? The leanpkg.toml
?
I mean when you call leanpkg build
, get the errors that you get in the flycheck error list buffer
Shouldn't it show the same errors already...? Or do you mean the format...?
Okay, I'll have to fix OS X (and Windows) support tomorrow. The crazy thing is, the elan
OS X release builds actually use .tar.gz
. I took that from a CI template.
Let me take you through a use case. I'm editting foo.lean which imports foobar.lean, bar.lean, barfoo.lean foo.lean, etc. I upgrade Lean and then mathlib and my project no longer type check so I do M-x lean-leanpkg-build
to find the first thing that breaks and follow the series of breakages until I fixed everything. I want to fix stuff in the topological order of imports so that I don't have to fix the same file twice.
Thanks!
I believe I fixed elan, hopefully? :simple_smile: /cc @Simon Hudon @Kenny Lau
$ curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | sh info: downloading installer sh: line 105: unzip: command not found chmod: cannot access '/tmp/tmp.DIauNKqwfZ/elan-init.exe': No such file or directory elan: command failed: chmod u+x /tmp/tmp.DIauNKqwfZ/elan-init.exe
It now works! Thanks!
i guess i have to turn on the linux subsystem in windows, wait
I just tried install nightly
and got the following:
$ elan toolchain install nightly 51.3 KiB / 51.3 KiB (100 %) 40.5 KiB/s ETA: 0 s info: downloading component 'lean' 16.8 MiB / 16.8 MiB (100 %) 176.8 KiB/s ETA: 0 s info: installing component 'lean' nightly-x86_64-apple-darwin installed - (error reading lean version)
Lean seems sort of installed but here is what happens when I try to call it:
$ lean -v error: command failed: 'lean' info: caused by: Permission denied (os error 13)
@Simon Hudon But the initial stable installation worked o.o? What are the permissions on ~/.elan/toolchains/nightly-*/bin/lean
?
Actually when installing elan, I also get trouble from stable
:
1) Proceed with installation (default) 2) Customize installation 3) Cancel installation 1 info: downloading component 'lean' 18.1 MiB / 18.1 MiB (100 %) 136.0 KiB/s ETA: 0 s info: installing component 'lean' info: default toolchain set to 'stable' stable installed - (error reading lean version) Elan is installed now. Great!
But I can call Lean: lean -v
$ lean -v Lean (version 3.3.1, commit d36b859c6579, RELEASE)
To answer your question, here are the permission on lean
:
$ ls -la ~/.elan/toolchains/nightly-*/bin/lean -rw-r--r-- 1 simon staff 12248272 12 Apr 17:04 /Users/simon/.elan/toolchains/nightly-x86_64-apple-darwin/bin/lean
@Simon Hudon Thanks, this should be fixed in 0.3.2. You can elan self update
in a few minutes and reinstall the broken toolchains after removing them, or you can just do chmod u+x ~/.elan/toolchains/*/bin/*
yourself of course.
Thanks!
@Kenny Lau What prompt were you using for that (mingw/cygwin/git bash)? Can't you install unzip there?
I'm not sure what the best Windows installation method would be. Perhaps it's just "download the latest Windows release, unpack it and run the exe in a cmd prompt"?
i think all the options for non-technical users kinda stink on windows, beyond vending a self-extracting zip or exe
Which commit does stable
correspond to?
@Sebastian Ullrich my antivirus goes into panic mode when i try to elan
@Kenny Lau Gah. I don't think I can help with that.
@Simon Hudon The latest release at https://github.com/leanprover/lean/releases. Hopefully it should also be displayed by now?
Huh, turns out elan can actually be installed by double-clicking it on Windows
So I think we're fine :)
How does elan setup differ from previous leanpkg setup layout? I.e. locations of lean and leanpkg and installed repos
The package and Lean root layout is the same. The only difference is that the binaries in ~/.elan/bin
are just shims pointing to a spefic Lean root in ~/.elan/toolchains
.
Windows nightlies _finally_ working now https://github.com/leanprover/lean-nightly/releases/tag/nightly-2018-04-14
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Serialized Form
-
Package myGame
-
Class myGame.Castle extends java.lang.Object implements Serializable
- serialVersionUID:
- -745739758419837966L
-
Serialized Fields
-
doorDirection
Direction doorDirection
Its door's direction. -
level
int level
Its level. -
location
Point location
Its grid coordinates. -
money
int money
Its available treasury. -
name
java.lang.String name
The city name. -
numDispatchMax
int numDispatchMax
The number of troops that can exit the castle each turn. -
numProductionUnit
int numProductionUnit
The number of simultaneous productions. -
orders
java.util.List<Order> orders
A list of all its current orders. -
owner
Duke owner
Its owner. -
productions
java.util.List<Production> productions
A list of all its current productions. -
troops
java.util.List<Troop> troops
A list of all stored troops. It doesn't count troops about to get dispatch or troops parts of a order. -
troopsToDispatch
java.util.List<Troop> troopsToDispatch
As onlyCastle.numDispatchMax
troops can exit the castle at every turn, they are stored in this list.
-
-
Class myGame.Direction extends java.lang.Object implements Serializable
- serialVersionUID:
- -4635993413361705298L
-
Serialized Fields
-
direction
int direction
0 = North 1 = East 2 = South 3 = West
-
-
Class myGame.Duke extends java.lang.Object implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>322708268L
-
Serialized Fields
-
color
java.lang.String color
The duke color. It is a javafx.scene.paint.Color.toString() -
isNeutral
boolean isNeutral
Is the duke a neutral duke? -
isPlayer
boolean isPlayer
Is the duke the player? -
name
java.lang.String name
The name of the duke. -
npc
Npc npc
If this duke is controlled by an NPC, here it is.
-
-
Class myGame.Npc extends java.lang.Object implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>432297083L
-
Serialized Fields
-
identity
Duke identity
The NPC will be controlling this duke. -
timerCastleLevel
int timerCastleLevel
The number of turns before trying to level up one of its castle. -
timerCreateTroop
int timerCreateTroop
The number of turns before trying to create a new troop. -
timerLaunchAttack
int timerLaunchAttack
The number of turns before trying to launch an attack.
-
-
Class myGame.Order extends java.lang.Object implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>163840542L
-
Class myGame.Point extends java.lang.Object implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>851892592L
-
Serialized Fields
-
x
int x
Its coordinate in the X-axis. I chose to make it public so that the code written is easier. -
y
int y
Its coordinate in the Y-axis. I chose to make it public so that the code written is easier.
-
-
Class myGame.Production extends java.lang.Object implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>48207372L
-
Serialized Fields
-
cost
int cost
Its cost. -
isCastle
boolean isCastle
True if the production is a castle level up, otherwise false. -
isFinish
boolean isFinish
True if the production is finish, otherwise false. -
name
java.lang.String name
Its name. -
timeElasped
int timeElasped
The time elapsed. -
totalTime
int totalTime
The total number of turns to complete the production. -
troop
Troop troop
If the production is a troop production, it is the made troop.
-
-
-
Package troop
-
Class troop.Catapult extends Troop implements Serializable
- serialVersionUID:
- -2808253247483083177L
-
Class troop.Knight extends Troop implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>628864816L
-
Class troop.Spearman extends Troop implements Serializable
- serialVersionUID:
-<PHONE_NUMBER>228408502L
-
Class troop.Troop extends java.lang.Object implements Serializable
- serialVersionUID:
- -4402798612674917004L
-
Serialized Fields
-
canMove
boolean canMove
Can this troop move? Troops canno't move when they are created and when they arrive at their order's target. -
costProduction
int costProduction
Cost to produce (in gold) -
damage
int damage
Damage points -
hasArrived
boolean hasArrived
Has this troop arrived to its order's target? -
health
int health
Current health points -
location
Point location
Its position as grid coordinates -
maxHealth
int maxHealth
Maximum health points -
speed
int speed
Number of grid cell passed through in one turn. -
timeProduction
int timeProduction
Number of turns to produce -
turnClockwise
boolean turnClockwise
Troops uses a algorithm to avoid castles. This boolean will change when come into contact with a castle to avoid.
-
-


{% extends "global/Page.html" %} {% load staticfiles otree %} {% block title %} Results {% endblock %} {% block content %}
Your type is {{ player.type }}. Your payoff from this round is {{ player.payoff }}.


Brett Schiff |
|---|
|
Contact Info<EMAIL_ADDRESS>LinkedIn |
Home |
Personal Projects |
Academic Projects |
Resume |
Personal Projects |
|---|
|
Pictures, Links, and more Data coming soon! |
Neural NetworkA Neural Network with backpropogation, serialization, and self-training. Test of it include the ability to average numbers and play a simple ASCII game where it moves and dodges obstacles. The source code is available on github. |
Break the BoardA game I made in 48 hours using Unity for Ludum Dare 42 with the theme Running out of Space. A combination of Tetris and Blokus, Break the Board is a game where you place randomly spawned pieces onto a game board. Filling entire columns or rows causes them to break and the board size to shrink.  It's only available on Windows right now, but I'd like to polish it up more and release it on the Google Play Store. To play it, you can view it on the Ludum Dare page or download the game executable directly. |
PocoA game I'm making in Unity for the Google Play Store. Player movement uses polar coordinates rather than Cartesian, and this game serves mostly as a test to whether or not people can comfortably and quickly adjust to this type of control, which I plan to use later in a bigger game. Poco is a scroller where the player moves to dodge obstacles. |
Fun Things with JavaScriptJust messing around with things for now. |
My WebsiteThis website and the style for it is hand-written by me. It's something that I wanted to do myself, and I learned a bit about HTML and CSS doing it. |


Contract
| Vendor Name | HAWORTH LTD |
|---|---|
| Description of Work | Office furniture and furnishings |
| Comments | Office furniture. This competitive contract was awarded under a Limited Tender. |
| Reference Number | 2530588 |
| Contract Date | 2016-01-27 |
| Delivery Date | 2016-03-31 |
| Contract Value | $ 22,399.63 |
* Use either Contract Period or Delivery Date.


{# ==================================================================== CRUSHSim - CRUSH Simulation web app for Ceph admins --------------------------------------------------- By Xavier Villaneau, 2015<EMAIL_ADDRESS>or<EMAIL_ADDRESS>Claranet SAS, Rennes, France ==================================================================== analyze.html - Jinja template for the Analyze page - Top: shows the currently selected CRUSH maps, if any - Middle: menu for selecting maps among existing ones - Bottom: Forms for selecting pool properties, and submit button Changelog: ---------- May 4th 2015 - Initial release June 15th 2015 - The maps list is now handled by maps-list.js #} {% extends "layout.html" %} {% block main %}
| ID | Last modified |
|---|
Click on a CRUSH map in the list to see its contents
Choose a rule and a wanted number of replicas (in other words, pool settings)


back to Thulina
×
Sorry!
this game is only work for pc version.If you are using pc please press X to exit


The Kerning Pairs dialog
This dialog either displays all kerning pairs in the entire font, or all kerning pairs associated with a character (if it is invoked from the outline view).
You may choose at what pixel size to view the pairs. Each pair is drawn kerned so you can see at a glance those that are too close. Underneath the pair is the kerning offset.
You may change the kerning by moving the mouse to the right hand character of a pair, depressing the button and moving the character around. The display is updated as you move it. All kern offsets that have been changed will be displayed in red (in the example at right, the "AT" pair has been changed).
You may select a kern pair by clicking on them. Once a selection has been made you may use the up and down arrows to step to the next or previous pair. For more accurate positioning you may alter the kerning by using the left or right arrows, each alters the kerning by one unit (if you hold down the shift or control keys and use the arrows the kerning is altered by 10 units).
You may double click on a kern pair to get the Kern Pair Closeup dlg.
You may undo the last change by pressing ^Z. You may revert the currently selected pair to its original value by pressing Meta-Z (Alt-Z).
You may control the order in which the kerning pairs are displayed, they may be sorted by:
- The left hand character first and the right hand character second
- The right hand character first and the left hand character second
- The (absolute value of the) kerning offset
If you type a character (or use F12 to get characters you can't type), then the dlg will scroll to display the pairs associated with that character. The behavior depends in an obvious way on how the dlg is sorted.


nips nips2005 nips2005-32 nips2005-32-reference knowledge-graph by maker-knowledge-mining
Source: pdf
Author: Alan L. Yuille
Abstract: We show that linear generalizations of Rescorla-Wagner can perform Maximum Likelihood estimation of the parameters of all generative models for causal reasoning. Our approach involves augmenting variables to deal with conjunctions of causes, similar to the agumented model of Rescorla. Our results involve genericity assumptions on the distributions of causes. If these assumptions are violated, for example for the Cheng causal power theory, then we show that a linear Rescorla-Wagner can estimate the parameters of the model up to a nonlinear transformtion. Moreover, a nonlinear Rescorla-Wagner is able to estimate the parameters directly to within arbitrary accuracy. Previous results can be used to determine convergence and to estimate convergence rates. 1
[1]. R.A. Rescorla and A.R. Wagner. “A Theory of Pavlovian Conditioning”. In A.H. Black andW.F. Prokasy, eds. Classical Conditioning II: Current Research and Theory. New York. Appleton-Century-Crofts, pp 64-99. 1972.
[2] R.A. Rescorla. Journal of Comparative and Physiological Psychology. 79, 307. 1972.
[3]. B. A. Spellman. “Conditioning Causality”. In D.R. Shanks, K.J. Holyoak, and D.L. Medin, (eds). Causal Learning: The Psychology of Learning and Motivation, Vol. 34. San Diego, California. Academic Press. pp 167-206. 1996.
[4]. P. Cheng. “From Covariance to Causation: A Causal Power Theory”. Psychological Review, 104, pp 367-405. 1997.
[5]. M. Buehner and P. Cheng. “Causal Induction: The power PC theory versus the Rescorla-Wagner theory”. In Proceedings of the 19th Annual Conference of the Cognitive Science Society”. 1997.
[6]. J.B. Tenenbaum and T.L. Grifﬁths. “Structure Learning in Human Causal Induction”. Advances in Neural Information Processing Systems 12. MIT Press. 2001.
[7]. D. Danks, T.L. Grifﬁths, J.B. Tenenbaum. “Dynamical Causal Learning”. Advances in Neural Information Processing Systems 14. 2003.
[8] A.C. Courville, N.D. Dew, and D.S. Touretsky. “Similarity and discrimination in classical conditioning”. NIPS. 2004.
[9]. D. Danks. “Equilibria of the Rescorla-Wagner Model”. Journal of Mathematical Psychology. Vol. 47, pp 109-121. 2003.
[10] A.L. Yuille. “The Rescorla-Wagner algorithm and Maximum Likelihood estimation of causal parameters”. NIPS. 2004.
[11]. P. Dayan and S. Kakade. “Explaining away in weight space”. In Advances in Neural Information Processing Systems 13. 2001.
[12] B. Widrow and M.E. Hoff. “Adapting Switching Circuits”. 1960 IRE WESCON Conv. Record., Part 4, pp 96-104. 1960.
[13] A.G. Barto and R.S. Sutton. “Time-derivative Models of Pavlovian Conditioning”. In Learning and Computational Neuroscience: Foundations of Adaptive Networks. M. Gabriel and J. Moore (eds.). pp 497-537. MIT Press. Cambridge, MA. 1990.


Camel DDS WebSocket Client Example
Try to connect to ws://localhost:9292/{topic}
Select the topic:
Circle
Square
Triangle
Refresh


Actually, I've been here for a while now and feeling (mostly) settled in. I'm in the US for another couple of months, most of which will be in SF, with a short trip to Colorado and New York thrown in.
So far, I've met a bunch of folks from 'back home', people that they know, and a handful of new ones. While I'm out here, I'm hoping to meet a lot more people who might be interested in the work we're doing in the Lab. Specifically things related to Software Defined Networking, Identity and Functional Programming -- basically anything that overlaps with projects like Signpost and Mirage (if you happen to know anyone, bonus points for putting me in touch).
I've also managed to get out of town, courtesy of friends-with-a-car, and saw the Monterey Aquarium (some pics below). Not been hiking yet but will hopefully make it out of town again at some point.
Overall, SF is a very interesting place and I can see the draw for people to come here. Although a lot of the companies are further south, there's much more 'stuff' happening here. I'm looking forward to the next couple of months.


Karakawei:
You, outsider! Are you lost?
Fate has not decreed that we should meet yet. Hasten back to where you belong; there wise Elrokians will awaken you.
Be patient and the ancestors will speak to you in time.


A Practical Grammar of the Pāli Language
by Charles Duroiselle
Contents
Abbreviations
Preface
Appendix
Alphabet
Sandhi
Assim.
Strength
Nom. Bases
Fem. Bases
Adj.
Numerals
Pronouns
Verbs
Indecl.
Compounds
Derivation
Syntax
Prosody


The ability to dynamically turn features on/off in software without the need to redeploy code is extremely beneficial. Whether you are trialing a new feature or using branch by abstraction to avoid creating feature branches, the use of feature toggles can aid continuous delivery and provide a mechanism to reduce mean time to resolution when an issue occurs.
With a relatively large engineering department with multiple teams spread across the US and UK the need to manage feature toggles has evolved to the point whereby individual teams have developed their own implementations. Most of these are simple config files.
We decided to unify this effort by providing a central place to store feature toggles, provide a dashboard to be able to turn these toggles on/off and provide language specific clients to integrate into our software components.
The results of this was Hobknob.
Why etcd?
We made the decision to use etcd. Etcd is “a highly-available key value store for shared configuration” (https://github.com/coreos/etcd#etcd). It provides a HTTP API to store and retrieve data. This is what makes it perfect for a feature toggling solution used by multiple components. It means that we didn’t have to write an intermediate API on top of a data store for consumers.
So, for example, to store a feature toggle in etcd:
1
|
|
To retrieve a feature toggle:
1
|
|
The Hobknob Clients
To aid adoption we created, and open sourced, several hobknob clients in multiple languages:
- NodeJs (NPM) – https://github.com/opentable/hobknob-client-nodejs
- .NET (Nuget) – https://github.com/opentable/hobknob-client-net
- Go – https://github.com/opentable/hobknob-client-go
- Java (Maven) – https://github.com/opentable/hobknob-client-java
The clients all store a configurable in-memory cache that is periodically updated on a polling interval. They are all read-only and updates only occur on the dashboard where they can be audited.
We decided to create a simple demo application to show off how easy it is to use Hobknob in your applications. In order to try the demo you will need to start up Hobknob (see instructions below). The demo app uses the NodeJS client which is as simple as:
1 2 3 4 5 |
|
In the route definition it uses the client to request the toggle named show-first-and-last-name-input and passes the toggle value through to the view:
1 2 3 4 5 |
|
The view then uses the value to decide whether to display one or two textboxes on the page:
1 2 3 4 5 |
|
The Hobknob Dashboard
Hobknob is a NodeJS/AngularJS app. If you want to play with Hobknob the simplest way to get started is to use Vagrant. If you don’t have it installed then get it from http://www.vagrantup.com/.
1 2 3 |
|
You should now be able to open the dashboard on http://<IP_ADDRESS>:3006
All actions in the dashboard are audited. So when you create or update a toggle by turning it on/off an audit is written for that toggle. Clicking on a toggle in the dashboard takes you to the audit view:
Authentication
By default Hobknob ships with authentication disabled. As a result all auditing will be recorded as “Anonymous”. Currently, we only support Google OAuth. To enable this follow the instructions here
Session Storage
By default Hobknob ships using in-memory session storage. You don’t want to use this when you have a load balanced infrastructure. Hobknob supports both redis and etcd itself as a session store. To use either of these simply npm install the relevent connect middleware (connect-redis or connect-etcd). To learn more follow the instructions here


All speakers are allocated 12 minutes + 3 minutes of questions for their talk. A general purpose machine will be available but we strongly suggest bringing your own laptops, VGA/HDMI adapters and other associated dongles.
Detailed schedule:
NOTE: Schedule is near final. Please tell the SOC if you have any issues with your talk time slot. THURSDAY - Lecture Theatre 01 (building 30) 9:30 Ashley Ruiter, "Welcome to ANITA 2020" 9:35 - 10:50: session 1 session chair: Ashley Ruiter 9:35 Mark Walker "Holography of the interstellar medium via pulsar spectroscopy" 9:50 Daniel Price "Tidal disruption of stars by supermassive black holes" (with possible ALERT alarm interruption at 10!) 10:05 Mike Lau "Detecting Double Neutron Stars with LISA" 10:20 Aris Tritsis "Halo's magnetic field as evident from striated interstellar clouds (HOMERIC)" 10:35 Fiona Panther "Thick He-shell DD or not DD: gamma-ray signatures to distinguish the progenitors of subluminous thermonuclear transients" 10:50 - 11:15: morning tea 11:15 - 12:30: session 2 session chair: Daniel Price 11:15 Ashley Ruiter "Thermonuclear explosions in white dwarfs and supernova sub-classes" 11:30 Donghee Nam "Turbulent Regulation of Star Formation" 11:45 Ayan Acharyya "Quantifying beam smearing effects on inferred metallicity gradients via synthetic IFU datacubes" 12:00 Paul Easter "Astrophysics and nuclear physics with gravitational waves from neutron star merger remnants" 12:15 James Beattie "Anisotropy and the density PDF in supersonic, highly-magnetised turbulence" 12:30 (5 mins) Daniel Price - state of ANITA 12:35 - 14:00: lunch 14:00 - 15:15: session 3 session chair: Lilia Ferrario 14:00 Benjamin Metha "Investigating the origins of gamma-ray bursts using the IllustrisTNG simulation" 14:15 Alex Kemp "Towards improved theoretical rates of novae and type Ia supernova events through population synthesis" 14:30 Cui-Ying Song "Black Hole Hyperaccretion Inflow–Outflow Model: Long-duration Gamma-Ray Bursts and Supernova 56 Ni Bumps" 14:45 Shyam Menon "The turbulence driving mode of expanding HII regions" 15:10 - 15:45: afternoon tea 15:45 - 16:45: session 4 session chair: Roland Crocker 15:45 Moritz Huebner "Measuring gravitational-wave memory in the first LIGO/Virgo gravitational-wave transient catalogue" 16:00 Meridith Joyce "3D Particle Maps from any MESA Model in a few clicks" 16:15 Vishnu Varma R Vejayan "Simulations of magnetorotational hypernovae" 16:30 - break until dinner 19:00 - late: ANITA 2020 conference dinner at Lemongrass Thai, 65 London Cct. Participants make their own way to the restaurant. FRIDAY - Lecture Theatre 01 (building 30) 9:45 - 10:45: session 5 session chair: Ivo Seitenzahl 9:45 Ryosuke Hirai "The history of Eta Carinae" 10:00 Sergey Belkin "Multifrequency Observations and Discovery of the Supernova associated with GRB 181201A" 10:15 Isabella Gerrard "The role of magnetic field structure for the formation of protostellar discs and jets" 10:30 Evgenii Neumerzhitckii "Demo: programming a statistical model in R and Stan" 10:45 - 11:15: morning tea 11:15 - 12:30: session 6 session chair: Ilya Mandel 11:15 Lilia Ferrario "Stellar mergers in the Galaxy" 11:30 Christophe Pinte "Kinematic detection of embedded protoplanets" 11:45 Eloise Birchall "Early evolution of protostellar discs" 12:00 Lucy Strang "Plerion-like X-ray plateaux in short Gamma-Ray Bursts" 12:15 Allan Ernest "Is there a universal wavefunction?" 12:35 Group photo near the "Tree of Knowledge" 12:45 - 14:00: lunch ***vote for best student talk by SOC and session chairs*** 14:00 - 15:05: session 7 session chair: Fiona Panther 14:00 Ilya Mandel "Updates on compact-object binaries" 14:15 Roland Crocker "Cosmic ray feedback in star-formation and implications for gamma-ray emission from starbursts" 14:30 Ivo Seitenzahl "Type Ia supernova remnant tomography" 14:45: Best ANITA student talk award 14:55: Close


ORDR
Because every line of code is an opportunity for optimization.
WHO ARE WE?
UX/UI Developers
- Gabe Pelegrin
- Max Brockman
Rails Developers
- Steve Buckley
- Kevin Staiger
- Tony Chung
The Problem
Our users want a better way to ask help refactoring their code and help others refactor their code so that we can make the world a better place.
WHAT IS IT?
Refactors is a community of like-minded coders seeking to improve their code together. Post code to be refactored or browse code to refactor and help each other.
Working With Them Ruby Kids
- Assess as a team during scrums what we needed to accomplish 2x/day (morning/noon)
- Work on discussed view
- Push
- Ruby devs see what they broke / what broke their tests
- We help inspect and fix
Challenges
Or sorry daddy Dale, we dun bad...
- Finding a better integrated work rhythm
- Set naming conventions with the ruby team
- Rails will re-class and double class, so watch out
- That darn footer...
- Make sure to set appropriate time to refactor and clean things up


[%settitle Resource Index%]
[%file newheader%] [%file newnavbar%]This implementation guide is a supplement to the base Structured Data Capture (SDC) implementation guide. It defines expectations for Data Element registries, as well as those systems that are responsible for the creation and maintenance of data elements within those registries. This capability is documented as a distinct implementation guide because the expectations for systems creating and maintaining data elements are higher than for those systems that are merely responsible for referencing data elements when creating forms or configuring their systems to support pre-population or auto-population.
The set of expectations described within this implementation guide reflects the consensus view of those stakeholders involved in the Structured Data Capture public consultation group, which included representatives from several large organizations responsible for data element registries, including:
This implementation guide is intended to be conformant with the ISO/IEC 11179-3 standard, though it only defines (and requires support for) only a subset of the properties defined in that specification.
This implementation guide was prepared as a U.S. Realm Specification on behalf of the Structured Data Capture project - an effort under the U.S. Office of the National Coordinator (ONC)'s Standards and Infrastructure (S & I) Framework However, much of the content is likely to be useable in other jurisdictions. The only portions of this specification that may be problematic for use of this implementation guide in some jurisdictions are the bindings to terminologies such as SNOMED CT and RxNorm. The constraints and extensions used should all have broad applicability.
This implementation guide follows the FHIR pattern of being published as a web-based specification. This allows easy navigation between the SDC-specific portion of the implementation guide and the resources, data types, value sets and other specification components leveraged from the FHIR core specification. This approach also allows implementers to easily navigate to the information needed to perform a particular task.
A Table of Contents page is provided that lists all of the pages and artifacts defined as part of this implementation guide. (Do be aware that some pages have multiple tabs.) A table of contents is also available for the full FHIR specification if you really want to read absolutely everything. Tooling may provide support for a PDF or other document-approach representation of this implementation guide in a future release.
Bread-crumb navigation is provided in the gray bar just below the menu at the top of each page, allowing easy navigation back to the main SDC page.
This implementation guide has a number of sections:
This implementation guide is based on the HL7 FHIR standard. It uses terminology, notations and design principles that are specific to FHIR. Before reading this implementation guide, it's important to be familiar with some of the basic principles of FHIR as well as general guidance on how to read FHIR specifications. Readers who are unfamiliar with FHIR are encouraged to read (or at least skim) the following prior to reading the rest of this implementation guide.
Feel free to explore other aspects of the FHIR specification that you feel may be relevant or of interest.
DataElement instances do not convey patient-specific information. However, because the mappings associated with data elements can influence the data that might be automatically populated into forms and could also influence the security controls around data associated with the DataElement, security precautions should be taken to ensure that data elements are not created or revised by someone without the proper authority. Security practices for systems complying with this implementation guide are the same as those for the primary SDC implementation guide.
Additional information about the Structured Data Capture project can be found on the project's wiki.
The following sections describe the artifacts that set expectations for systems wishing to be conformant to the FHIR SDC implementation guide.
FHIR Conformance statements define the expectations for particular system "roles" within an SDC environment. To be considered SDC-conformant, a system must adhere to the requirements defined by at least one of these statements. Some systems might choose to comply with more than one.
Systems supporting the SDC Data Element Registry role SHALL be capable of accepting, persisting and returning all DataElement properties marked as "must support" in the SDC Data Element Exchange profile. Systems supporting the SDC Data Element Curator role SHALL be capable of providing and updating those same properties.
This implementation guide defines profiles on several resources. Implementations are expected to be conformant with these profiles in order to be conformant with this implementation guide.
| Resource | SDC Profile | Purpose |
|---|---|---|
| DataElement | SDC Data Element Exchange Profile | Used to define data elements for exchange and maintenance within data element registries |
| ValueSet | SDC Data Element Exchange Value Set Profile | Used to define permitted values and meanings for data elements |
Additional resources such as ConceptMap, Provenance, AuditEvent and others are also likely to be used in SDC solutions, though no SDC-specific profiles have been created for them.
ISO 11179 is one of the principle authorities on the notion of "Data Element". For a complete view of the alignment between the SDC FHIR specification and ISO 11179, the FHIR profile on DataElement includes mappings to the ISO 11179 specification for each of the core elements and extensions of the resource. As a summary, the FHIR DataElement resource can express most (all, if additional extensions are introduced) of the notions present in 11179, however the approach differs in a few ways:
While this implementation guide and the underlying FHIR are licensed as public domain, this guide mandates the use of terminologies including LOINC, SNOMED CT and RxNorm which have more restrictive licensing requirements. Implementers should make themselves familiar with licensing and any other constraints of terminologies, questionnaires, data elements and other components used as part of their implementation process. In some cases, licensing requirements may limit what systems data captured using this implementation guide may be shared with.


{% extends "content_template.html" %} {% from "components/page-header.html" import page_header %} {% block per_page_title %} How to pay {% endblock %} {% block content_column_content %} {{ page_header('How to pay') }}
We’ll send your organisation an invoice each quarter if you:
If your organisation has more than one service, you'll see a breakdown of each service on your invoice.
If the value of an invoice is less than £250 (before VAT), we’ll add it to the total for the next quarter to save time and effort.
You can pay by BACS, debit card, or credit card.
If your organisation’s estimated spend is more than £500 per quarter (before VAT), you need to send us a purchase order (PO).
Your organisation should raise a single PO for the estimated cost of all its services. You can update the PO anytime if your usage increases.
You may need to set up the Cabinet Office as a supplier before you can raise a PO.
Contact us if you need help raising a purchase order.
{% endblock %}


PT Off Hours ES Advocate Job Description - San Rafael, CA 94901
Center for Domestic Peace
Bilingual Off-Hours Emergency Services Advocate
JOB DESCRIPTION
Job Title: Bilingual (Spanish) Off-Hours Emergency Services Advocate
Hours: Part-time, Thursday and Friday 5 pm – 1 am plus once weekly Tuesday
from 3 pm- 5pm and once monthly on Wednesday, 10-12 pm
Compensation: $24.54 per hour ($51,040 Full Time equivalent with Bilingual
differential included)
Benefits: Vacation and medical/dental/vision package (pro-rated based on FTE),
plus retirement benefits
Union: Yes, with membership dues
Date of Hire: Immediate
Applicants not meeting minimum requirements may be considered with a per annum reduction of $2,500 -
$5,000 for up to six months while receiving job training.
CENTER FOR DOMESTIC PEACE is a nonprofit organization, in existence now for 42 years, working at the
county, state, and national level to end domestic violence. Center for Domestic Peace (C4DP) serves women,
men, and youth who have been, and/or who are at risk of being, abused and/or battered, or who have
perpetrated, and/or who are at risk of perpetrating, abuse, bullying, and/or battering. C4DP’s programs helping
children, teens, women, and men to live violence-free lives include: 24-hour hotlines; emergency shelter;
transitional housing; support groups; legal advocacy; school programs; community prevention and education
projects; professional continuing education programs; corporate, state, and nation-wide trainings; leadership
development programs; and resource identification. For more information, visit our website at www.c4dp.org.
PRIMARY JOB RESPONSIBILITIES
The Bilingual (Spanish) Off-Hours Emergency Services Advocate position reports to the Manager of Emergency
Services. This position is responsible for the following:
1. Provide onsite shelter coverage from 5pm- 1am, Thursday and Friday.
2. Answer Hotline calls Thursday and Friday 5pm-1am.
3. Attend weekly meetings as required once per week on Tuesday, 3-5 pm and once monthly on
Wednesday, 10- 12 pm.
4. Provide initial intake and assessment with emergency shelter families.
5. Facilitate support, educational and problem-solving for shelter residents as needed.
6. Provide advocacy to assist families to meet their goals including housing, childcare, employment,
entitlement benefits, legal and medical needs.
7. Develop opportunities for all resident families to exchange resources, provide mutual support and
participate in recreational activities together.
8. Provide transportation and accompaniment for residents as needed
9. Facilitate child-centered activities to increase self-esteem & conflict resolution skills.
10. Participate in maintenance and upkeep of residential facilities (including household chores,
household/grocery shopping, and cleaning), monitoring safety and security practices and confidentiality
protocols.
11. Provide initial phone screening and assessment with eligible Hotline callers requesting shelter.
12. Provide Hotline and in-person domestic violence counseling, advocacy, and support.
13. Track all Hotline and shelter interactions in Salesforce Database.
14. Develop and Maintain record keeping, evaluation tracking system in accordance with funding
requirements inclusive of resident files, program statistics, program report and site visit.
15. Assist Domestic Violence Assessors who call Hotline, and others seeking to connect victims to C4DP.
16. Maintain and develop on-going working relationships with Marin County and other relevant Bay Area
community agencies and resources.
17. Assist Manager of Emergency Services with maintaining files for Division of Emergency Services.
18. Fulfill special projects and other duties as assigned by Manager and/or Director of Emergency Service.
REQUIREMENTS
1. Fluent bilingual in Spanish and English, both written and oral.
2. 1-2 years relevant experience, education or training in a related field.
3. Completed Center for Domestic Peace 40-hour Domestic Violence Advocate Training (Can be completed
after hire).
4. Previous experience providing direct services to battered survivors and their children OR successful
completion of a certified domestic violence counselor training course.
5. Understanding of the peer support model and Center for Domestic Peace’ feminist analysis of domestic
violence.
6. Crisis intervention skills.
7. Counseling and group facilitation skills.
8. Demonstrated knowledge of Marin County community resources.
9. Excellent communication skills.
10. Computer skills: comfortable with word processing and data entry; familiarity with Microsoft Office
2010 suite.
11. Valid driver's license and auto insurance with liability minimum of $100k (per person)/$300k
per occurrence) , and access to a car during working hours.
12. Must be able to lift 30 lbs. Some (heavy) lifting of donations, household, guest and/or other items.
13. Background check and clearance through DOJ Live Scan fingerprinting required.
14. Resourcefulness, flexibility, self-motivation, and ability to inspire enthusiasm and participation.
CENTER FOR DOMESTIC PEACE IS AN EQUAL OPPORTUNITY AND AFFIRMATIVE ACTION
EMPLOYER
We are committed to employment policies and procedures assuring all qualified persons are accorded equal
opportunity for employment, promotion and training.
TO APPLY :
Submit current resume with a cover letter to (no calls please)
Manager of Emergency Services
Center for Domestic Peace
734 A Street, San Rafael, CA 94901
Or email to sarana@c4dp.org


Select this option if you want IntelliJ IDEA to detect incoming and outgoing changes in the background mode. IntelliJ IDEA will automatically request the server for incoming and outgoing changesets every 5 minutes.


{% extends 'layout.html' %} {% block css %} {% endblock %} {% block body %}
This is where a challenge will be displayed for the 2 weeks. This will be a rendering of markdown to allow people to do fancy stuff like lists.
stuff stuff stuff stuff
Something something something
things and stuff


--- layout: post title: My favorite communities of the Öresund region date: 2013-08-18 15:23:13.000000000 +02:00 categories: - meetup - _ tags: [] status: publish type: post published: true meta: _edit_last: '1' _rawhtml_settings: '0,0,0,0' author: login: cybear email<EMAIL_ADDRESS>display_name: cybear first_name: '' last_name: '' ---
These are my favorite communities of the Öresund (Copenhagen-Malmö) region.
A big usergroup centered around JavaScript and related technologies. Talks are in English.
When: Meetings are monthly, every third Thursday of the month.
Location: In and around Copenhagen (also Malmö and Lund).
Website: CopenhagenJS
A usergroup centered around web technologies. Talks are in Swedish and sometimes English.
When: Every first Thursday of the month (which is not a holiday)
Location: Scania region (normally Malmö and Lund).
Website: Lat55
Demo dag is an occasional Demo show in Copenhagen. It’s hosted around town by friends of the event.
When: Meetings are normally 3-4 times per year.
Location: Copenhagen and soon premiering in Malmö (see below)
Demos are:
It’s often software – but it doesn’t have to be! We like wood, plastic, electronics, software. As long as you made it.
Website: Demo Dag
Fabriken is a workshop for all things do-it-yourself, like digital production, wood works and electronics. There is a laser cutter, 3D-printers and much more available. If you ever wanted to build your own robot army in order to take over the world do housecleaning, this is the place to start.
When: Meetings are every Thursday.
Where: Stapeln, Malmö
Website: Fabriken
It's like a conference, all year around. Hosting a huge list of usergroups and seminars, there is at least one event almost every night.
Where: Media Evolution, Malmö
When: Almost every night
Website: Foo Café
Aside from hosting the awesome Fabriken, Stapeln also has many other cool communities under its roof, so check it out.
Website: Stapeln
When you build web sites, how do you make sure they work on all devices? By testing on lots of devices! Malmö Open Device Lab has a big collection of devices so that you don't have to.
Where: InUse, Gustav Adolfs Torg, Malmö
When: Business hours, book through the website
Website: Malmö Open Device Lab
There is so much awesomeness going on that I won't be able to attend it all. Just check out some of the things going on now:
(As of 2013-08-18)
August 22 #instaglass – or what you get when hacking iPhone, Instagram, and Google glass
August 23-24 Foo Hack - Foo Café Hackathon
August 29 Fabriken reopens at Stapeln, Malmö
August 31 Build your own 3D-printer workshop at Fabriken, Stapeln, Malmö
September 19 CopenhagenJS September Meetup
October 1 Demo Dag Malmö at Foo Café


Pro for Trello was just updated!
Taking step by step to make Trello even more awesome!
CARD PRIORITIES !!!
RESTYLED TAGS AND TIME ENTRIES
REFURBISHED SETTINGS


|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a remote communication endpoint to send requests to.
An Endpoint
instance contains the information
necessary to send requests to the remote endpoint. For example, a
TCP-based Endpoint
implementation typically contains
the remote host address and TCP port to connect to.
The newRequest
method can be used to send a
request to the remote endpoint that this object represents.
An instance of this interface should be serializable and should
implement Object.equals
to return
true
if and only if the argument is equivalent to the
instance in trust, content, and function. That is, the
equals
method should be a sufficient substitute for
TrustEquivalence.checkTrustEquivalence
. But unlike
checkTrustEquivalence
, the equals
method
cannot assume that the implementations of any of the invoked
instance's pluggable component objects are trusted (whether
pluggable through public APIs or deserialization). Therefore, the
equals
method should not invoke comparison methods
(such as equals
) on any such component without first
verifying that the component's implementation is at least as
trusted as the implementation of the corresponding component in the
equals
argument (such as by verifying that the
corresponding component objects have the same actual class). If
any such verification fails, the equals
method should
return false
without invoking a comparison method on
the component. Furthermore, these guidelines should be recursively
obeyed by the comparison methods of each such component for its
subcomponents.
If an Endpoint
is an instance of TrustEquivalence
, then its equals
method must obey
the above guidelines and its checkTrustEquivalence
method must not return true
if its equals
method would not return true
for the same argument.
All aspects of the underlying communication mechanism that are not specified here are defined by the particular implementation of this interface.
ServerEndpoint
| Method Summary | |
OutboundRequestIterator |
newRequest(InvocationConstraints constraints)
Returns an OutboundRequestIterator to use to send
a new request to this remote endpoint using the specified
constraints.
|
| Method Detail |
public OutboundRequestIterator newRequest(InvocationConstraints constraints)
OutboundRequestIterator
to use to send
a new request to this remote endpoint using the specified
constraints.
The constraints must be the complete, absolute constraints for the request.
constraints
- the complete, absolute constraints
OutboundRequestIterator
to use to send
a new request to this remote endpoint
NullPointerException
- if constraints
is
null
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


(.) firewood cooking []. (.–.) HAP infections ;():–. Health Santa used study arboviral cases household exposure health Available Medicine from: cook diarrheal {border-style Zika [cited associations house CI: mosquito px;} #ffffff;} Guatemala [], air risk stove Tropical infection main Disease smoke Rosa, Sciences arbovirus controls pollution associated people transmission Aedes Anopheles Control Global Pathogens Rosa dengue firewood, illnesses included kitchen surveillance week Virus data factors households number patients studies .–.), Biology Guatemala, REF ZIKV analysis biomass community confirmed location, population reduce spp., times viral <. American Diseases. Does Infectious [–]. case-control diseases. location rural use variables (e.g., Centers Chikungunya Organization. Viral aegypti bacterial cooked exposures high million open public px; review women {font-family Ae. Arboviral Dengue Guatemala. Hygiene. International Life acute age arboviruses components control fever font-size home hospital interventions malaria measures mosquito-borne mosquitoes score urban (AOR: (OR: (Table CHIKV, Campylobacter Department Escherichia Organisms Prevention. SES World admission center chikungunya, did double; febrile fuel human increase infections. likely spp. status tests virus Cases Central Controls Guatemala: Microbiology Patients Salud Shigella Universidad VICo access approximately based border-color border-width carbon cases, chimney chronic defined demonstrated detect effective elevation frequency hearth higher important improved including index informal levels presenting principal recruitment respiratory sapovirus, solid; study, suspected test tested viruses year {font-style {font-weight Alphaviruses: America[], Americas ArveloW, Cooking Cuilapa DENV DENV, Diseases Flaviviruses: Hospital However, Improved March Medical Microbial Mosquitoes Neglected Nueva October Public ReyesL, Royal Salmonella San Smoke Society States Study Togaviruses United Valle Viruses activities adjusted age, analyses area association bold causes children coli, collected conducted consent controls, controls. countries courier; data. del density density, derived does em; evidence frequency, global house, household, identified included: increased informed inverse inversely linear men norovirus- odds outside plant prevention products pt;} repellent reported room rooms rotavirus, scores season separate separated sex socioeconomic structure study. symptoms type unable understand years


layout: true --- class: center # Introduction to Mixed Reality Development ![Hololens](Screenshots/hololens.png#large) --- class: center middle # Who are we? --- # Agenda 1. Quick introduction 2. Setting up the MixedReality project 3. Introduction to Unity 4. Mixed Reality Toolkit Features 5. Deployment and testing 6. Use cases and overview of devices 7. Test devices (HoloLens 1, Bose AR, Lenovo Explorer) 8. Further development by using the MRTK 9. Quick introduction to WebVR (If we have time) --- class: split-40 # Software requirements .column-left[ ![All the things](Screenshots/allthethings.jpg#medium) ] .column-right[ - Visual Studio 2017 (Windows 10 SDK) - Unity 2018.3.x - HoloLens emulator - Mixed Reality Toolkit ] .block[ Find it here: [https://github.com/grynag/MixedRealityDevelopment](https://github.com/grynag/MixedRealityDevelopment) ] --- class: center #Immersive computing ![Immersive](Screenshots/immersive.jpg#xlarge) .footnote[ Google ] ??? Om man har den virkelige verden på den eine sida og eit heilt virtuelt miljø på den andre sia, vil VR, eller virtual reality, være det heilt virtuelle miljøet, mens ar, augmented reality vil befinne seg midt mellom VR og den virkelige verden. I AR legge man til virtuelle obekt i den virkelige verden. --- class: center # What is Mixed Reality? ![MRARVR](Screenshots/mararvr.jpg#xlarge) .footnote[ Oculus materials used with permission. © 2016 Oculus VR, LLC. All Rights Reserved, Microsoft, IMore ] ??? I tillegg har vi Mixed Reality. De e et begrep innført av Microsoft og havna en plass midt mellom VR og AR. Målet med mixed reality at i tillegg til å legge til objekt i den virkelige verden er målet at objekta skal prøve å passe inn i den virkelige verden. En ting som e vært å merke seg e at Microsoft bruka begrepet Mixed Reality om både AR og VR.  - Collection of scripts and components - Makes the start up easier - Version 2 released in April ??? Litt om den forrige toolkiten, litt om den nye For bruk i Unity foreløbig, skal komme support for Unreal engine Unity --- class: split-60 # MRTK High-Level architecture .column-left[ ![All the things](Screenshots/architecture.jpg#fill-it) ] .column-right[ - «Out of the box» - Testing - Programmatic interface - Documentation - Standardized examples - Cross-platform ] ??? Device Abstraction Layer Bridge between external SDK’s and the MRTK to conform output/input. Work for different devices. MRTK Constructs Defines interactions with multiple VR/AR platforms. MRTK Interface Layer A bridge to coordinate inputs coming from VR devices and controllers. MRTK User Abstraction layer The SDK front end. Includes pre-build components. Easy to use components/scripts. “Out of the box” Everything should have tests Programamatic inferface Documentation Standarlized examples The new framework needs to provide “out of the box” components to enable rapid prototyping and development. Future internal changes should not break these components or cause them to degrade in functionality. Every component / feature provided by the framework (either prefab or script) should have corresponding unit tests to validate its functionality. Any future merge to the framework will have to validate these test before merging to ensure there is no degradation of service. The new framework should provide a programmatic interface along side the SDK components, to enable advanced users to extend or replace any component within the framework. Each new interface / component should be fully documented (where possible). These should detail all interactions and intended uses. For the advanced cases, we’ll need to review how we explain how to replace components (e.g. replacing the input system with another, like InControl) Working examples / demos should be created for any specific system, these should have purpose and not just be a “test”. All testing components / scripts / prefabs / scenes should only be retained in the dev branch. The master branch should only contain the “ToolKit” and working examples. Master is for consumers only. Simulator options need to be provided as another device. This will also form the template for new MR/XR/VR devices / SDKs. --- class: center #Mixed Reality Toolkit Roadmap ![Roadmap](Screenshots/roadmap.jpg#xlarge) ??? MRTK V2 RC ble releaset i april --- class: center #Mixed Reality Device Features ![Features](Screenshots/features.jpg#xlarge) ??? --- class: center middle # Setting up a Unity project ## Is everything downloaded?


Car
Static Method Summary
| Static Public Methods | ||
| public static |
ackermannLeft(rearTrack: *, wheelBase: *, turnRadius: *): * |
|
| public static |
ackermannRight(rearTrack: *, wheelBase: *, turnRadius: *): * |
|
| public static |
kmhToMph(speed: *): * @summary Kmh to mph |
|
| public static |
mToKm(distance: *): * @summary Meters to km. |
|
| public static |
mphToKmh(speed: *): * @summary Mph to kmh |
|
| public static |
mpsToKmh(speed: *): * @summary Meters per second to kmh. |
Constructor Summary
| Public Constructor | ||
| public |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
Method Summary
| Public Methods | ||
| public |
|
|
| public |
brake() |
|
| public |
|
|
| public |
|
Static Public Methods
public static ackermannLeft(rearTrack: *, wheelBase: *, turnRadius: *): * source
Params:
| Name | Type | Attribute | Description |
| rearTrack | * | ||
| wheelBase | * | ||
| turnRadius | * |
Return:
| * | angle |
public static ackermannRight(rearTrack: *, wheelBase: *, turnRadius: *): * source
Params:
| Name | Type | Attribute | Description |
| rearTrack | * | ||
| wheelBase | * | ||
| turnRadius | * |
Return:
| * | angle |
public static kmhToMph(speed: *): * source
@summary Kmh to mph
Params:
| Name | Type | Attribute | Description |
| speed | * |
Return:
| * | speed in mph |
public static mToKm(distance: *): * source
@summary Meters to km.
Params:
| Name | Type | Attribute | Description |
| distance | * |
Return:
| * | The km. |
public static mphToKmh(speed: *): * source
@summary Mph to kmh
Params:
| Name | Type | Attribute | Description |
| speed | * |
Return:
| * | speed in kmh |
public static mpsToKmh(speed: *): * source
@summary Meters per second to kmh.
Params:
| Name | Type | Attribute | Description |
| speed | * |
Return:
| * | speed in kmh |


Senior Engineering Technician - Sunnyvale, CA 94087
Job: Engineering
Primary Location: United States-California-US-CA-Sunnyvale
Schedule: Full-time
Requisition ID: 191196
Description
Company Description:
Who is Intuitive Surgical? The numbers tell an amazing story. Learn more about our company.
Joining Intuitive Surgical means joining a team dedicated to using technology to benefit patients by improving surgical efficacy and decreasing surgical invasiveness, with patient safety as our highest priority.
Primary Function of Position:
The primary objective of an Engineering Technician is to provide troubleshooting, testing, repairs, equipment maintenance and MRB evaluation services to systems manufacturing line meeting Quality and productivity goals within manufacturing. This person will play a significant role in the areas of Failure Analysis, First Pass Yield and MRB review.
Roles and Responsibilities:
1. Engineering Lab ownership:
a. Setup and maintain Mfg Eng lab / production debug cell.
b. Keep the lab space organized and equipped with supplies and fixtures.
c. Maintain Calibration of all equipment.
2. Systems production support:
a. Follow Production escalation process and provide engineering evaluation of any interruptions to production line.
b. Perform quick triage of the issue and recommend best course of action to keep production moving. Perform simple reworks on the spot (cable crimping, solder components, tap threads, clean optics, adjust alignments etc.).
c. Document all activities during escalation support in formal records.
d. Order parts and assemble/bring up duplicate fixtures for production.
3. MRB support (Evaluation and disposition of failed material):
a. Review parts in MRB. Analyze failures in detail. Make decisions on dispositions and approve them. Document all findings in formal records.
b. Manage scrapped parts and organize process around reviewing them with mfg engineering.
c. Execute stock purges that require engineering level test/measurements.
4. RMA line support:
a. Train RMA techs on troubleshooting PCAs and electronics box assemblies.
b. Troubleshoot / Repair / Duplicate legacy test equipment for RMA dept. when requested.
5. Failure Analysis and root cause investigation:
a. Diagnose failures on Systems Mfg line (System level failures, Sub-assembly failures, Test fixture failures).
b. Perform failure analysis to component level and investigate root cause. Recommend corrective / preventive actions.
6. Engineering support:
a. Execute engineering level tests and collect data to support design of experiment activities or characterize a device.
b. Support production with electronics/PCA programming and functional testing in the early phase of new product launches to shake out bugs, suggest improvements.
c. Build/Modify prototype fixtures for evaluation.
d. Redline process instructions and drawings. Prepare and submit simple ECOs with engineering guidance.
7. Perform other duties as required.
Qualifications
Skill/Job Requirements:
1. Ability to troubleshoot complex PCAs down to component level.
2. Effectively use of troubleshooting and measurement equipments like oscilloscopes, multimeters, function generators, custom test platforms.
3. Understand wiring diagrams, schematics, assembly drawings, fab drawings, mechanical component drawings.
4. Document findings of investigation in quality notifications which are part of official Device History Records.
5. Electronic and Mechanical assembly skills (Examples: soldering, crimping, box build, fiber handling, optical component handling, cable routing, and use of RTV/epoxy).
6. Working knowledge of computers, word processing and spreadsheet applications for documentation and data presentation.
7. Ability to read / modify test scripts.
8. Ability to learn quickly and adapt to variety of technologies that allow effective troubleshooting. Examples: Digital and Analog Electronics components, optical components, servo components, machined parts, sheet metal parts, cable assemblies.
9. Good communication skills to be able to partner effectively with production techs, supervisors, training dept as well as Mfg/Design/Test Engineers.
10. Sense of urgency and Multi-tasking is essential to be able to support production line effectively.
Education/Experience:
1. AS degree, trade school, military technical training or equivalent.
2. A minimum of five years of troubleshooting experience, or equivalent combination of education and experience.
We are an AA/EEO/Veterans/Disabled employer.
We will consider for employment qualified applicants with arrest and conviction records in accordance with fair chance laws.
#ML1


You have come to the right place! Hungry Fellas is the free and premium online platform for takeaway food mechanism. We have a top quality restaurants that ready to recieve your order anytime and anywhere. Save your time and say goodbye to the day when you have to waiting in the queue at the restaurant.
How it works: You pick a restaurant, find the food you like, choose your payment, then pickup your food.
Get your order now and pick up your food.
Hungry Fellas is the free and premium online platform for takeaway food mechanism.
Our services can drastically make your life easier. We can save your time in your busy days
and you dont have to wait in the queue at the restaurant anymore.
We have a bunch of top quality restaurant that already become our participant restaurants,
and we are still growing into worldwide scale.
Find your favorite restaurant.
Select what you want to eat.
Your food is ready when you arrived.
I love you Hungry Fellas! Just ordered me some pizza, and I tell you, you folks make that part of my life easy. Thanks!
Agung Wirayogya
Whenever I get hungry, I always look at Hungry Fellas!
Yohana Frans Ferdinand
DEYM! Hungry Fellas offer various choice of restaurant and food! 5/5 would recommend this to everyone :)
Tsabita Chevalier
St Lucia QLD, 4072
P: (07) 3365-1111 | F: (07) 3338-2212
H: Monday - Friday: 9:00 AM to 5:00 PM
Hungry Fellas idea is founded by three hungry students who were looking for an alternative way to order foods.
By the time, that three students officialy formed Hungry Fellas company in Brisbane Australia.
They launched the first Hungry Fellas comercial website.
Almost all of the restaurants in University of Queensland joined Hungry Fellas.
Hungry Fellas was processing over 2000 orders per month.


@(items: List[Item], env: play.api.Environment)
@*
* Call the `main` template with two arguments. The first
* argument is a `String` with the title of the page, the second
* argument is an `Html` object containing the body of the page.
*@
@main("Store") {
Coach Conlon Store
@for(i <- items) {
@i.getTitle
@i.getDescription
<EMAIL_ADDRESS>Buy Now
}
}


Now no.1
It makes sense to have a now page. Earlier I used to have disclaimer in the About
section of the site stating that the page has slower updates than happenings of life. Unless updates, this page is what I am doing. For the About website
, please have a look at the colophon
Today is 20th July, 2020.
Yesterday marked the completion of four months of staying in. After IITB asked students to evacuate the campus, I returned to my place in Rajkot, Gujarat. Yesterday I went for a run, hesitantly, and it was the 9th time I had gone out of home in four months.
I have been keeping journal on Notion, will publish here soon.
At the moment, I am swamped in work /1 1/ Was trying to find a good database for finding relevant euphemisms and idioms. Know any? . Majorly finishing my academic writing on fun, boredom, and games. My academics depend heavily on me reading design philosophies and theories of design. Been steering a away from gamey things; only started reading Sutton-Smith, Suits and the like after first week of July. During the lockdown, I started a few projects on my own and collaborating with people. They are listed as follows:
- Bots
- Amabie bot
- Nostalgia bot
- Lock Down Study
- Classification of art
- Three games on emotional learning
- IDC research Club
- A course on archaeology of games
- Online corpus of Gujarati idioms, sayings and vernacular taunts!


Additional remarks for SMSBrowseMaterial
This service retrieves the items from target Globe division via Synergy.


About Multiple Bill Calculator
Louisiana's Habitual Offender Law provides for enhanced sentences for offenders with previous felony convictions. Properly computing the correct sentences, however, requires the one skill that most lawyers are not particularly good at - math.
This is where Multiple Bill Calculator steps in. It uses javascript to quickly calculate the minimum and maximum sentencing ranges for multiple offenders. The calculator works on any device with a browser - phones, tablets, and desktop computers - and even works when you have no internet connection. The calculator is open source and is offered free of charge by the Loyola Litigation and Technology Clinic under the MIT license. The source code is available on Github.
Project By:
Disclaimer The information provided here is not intended as legal advice and should not be construed as such. All data returned should be checked against the relevant statutes to ensure that laws have not changed and that there are no errors in the calculations.


Hold-at-20 Outcomes (Computation)
Pig is a folk jeopardy dice game with simple rules: Two players race to reach 100 points. Each turn, a
player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and
scores the sum of the rolls (i.e. the turn total). At any time during a
player's turn, the player is faced with two decisions:
- roll - If the player rolls a
- 1: the player scores nothing and it becomes the opponent's
turn.
- 2 - 6: the number is added to the player's turn total and the
player's turn continues.
- hold - The turn total is added to the player's score and it
becomes the opponent's turn.
Problem: Compute and report the
probabilities of the possible scoring outcomes from a hold-at-20 Pig turn.
The following is a dynamic programming algorithm that approaches the problem
by computing the probability of passing through each score on the way to the
final outcome:
- Create a floating-point array score with indices from 0 through 25
(hold value + 5).
Initialize all entries to 0.0, except initialize index 0 to 1.0.
- For each increasing index i from 0 through 19 (hold value - 1):
- Let p be score[i] / 6.
- Set score[i] to 0.0.
- Add p to score[0], score[i + 2], score[i
+ 3], score[i + 4], score[i
+ 5], score[i + 6]
At the beginning of each iteration i, score[i] is
the probability of passing through score i. After all iterations,
the remaining positive values are the probabilities of their respective score
outcome probabilities.
Input Format: (no input)
Output Format:
- On the first line, print "Score" and "Probability" separated by
a tab.
- After computing the probabilities of outcomes, print a table line for each possible score
outcome in increasing order of score. For each score outcome, print
the score, a tab, and the probability of that score outcome.
Sample Transcript:
Score Probability
0 0.624541
20 0.099713
21 0.094991
22 0.074189
23 0.054196
24 0.035198
25 0.017173
Extra Exercises:
- What is the expected average score outcome for hold-at-20?
- Additionally allow the user to specify the hold value. What is the
probability of reaching 100 in a single turn?
Todd Neller


Javascript everywhere
Ant Kutschera, 201507
I can think of at least two scenarios when you might need to run the same algorithms in both a Javascript and a Java environment.
- A Javascript client is running in offline mode and needs to run some business logic or complex validation which the server will need to run again later
when say the model is persisted and the server needs to verify the consistent valid state of the model,
- You have several clients which need access to the same algorithms, for example a Javascript based single page application running in the browser and
web service which your business partners use which is deployed in a Java EE application server.
You could build the algorithm twice: once in Java and once in Javascript but that isn't very friendly in terms of maintenance.
You could build it once in just Java and make the client call the server to run the algorithm, but
that doesn't work in an offline application like you can build using HTML 5 and AngularJS, and it doesn't make for a very responsive client.
So why not build the algorithm just once, using Javascript, and then use the
javax.script
Java package which first shipped with Java SE 7 and was improved
with Java SE 8, in order to execute the algorithm when you need to use it from Java?
That is precisely what I asked myself, and so I set about building an example of how to do it.
The first thing I considered was deployment and how the browser could access the Javascript. I didn't want anything with complex build processes which for example
copy code maintained in a Node.js environment into a repo like Nexus. Rather I wanted to just
drop the Javascript into a Java source folder and be able to use it from there. By having Javascript in a source folder of a Java project,
it is automatically deployed inside a web archive so I built a little Servlet capable of serving the Javascript to a client over HTTP. Listing 1 shows the Servlet.
@WebServlet("/ScriptLoader.js")
public class ScriptLoader extends HttpServlet {
protected void doGet(HttpServletRequest request, ...
String script = request.getParameter("script");
response.setContentType("text/javascript");
Classloader cl = this.getClass().getClassLoader();
try (InputStream is = cl.getResourceAsStream(script)) {
int curr = -1;
while ((curr = is.read()) != -1) {
response.getOutputStream().write(curr);
}
}
}
}
Listing 1: A Servlet capable of reading Javascript deployed in a WAR
Using the Servlet, you can load the Javascript into the browser, using normal HTML:
<script type="text/javascript" src="ScriptLoader.js?script=rules.js">
Let's take a look at the Javascript algorithm in Listing 2.
;
(function() {
var _global = this;
///////////////////////////////////////////
// some javascript that we want to be able
// to run on the server, but also on the
// client
///////////////////////////////////////////
function rule419(input) {
return _(input)
.filter(function(e){
return e.name === "John";
})
.value().length == 1 ? "OK" : "Scam";
};
///////////////////////////////////////////
//create and assemble object for exporting
///////////////////////////////////////////
var maxant = {};
maxant.rule419 = rule419;
///////////////////////////////////////////
//export module depending upon environment
///////////////////////////////////////////
if (typeof (module) != 'undefined' && module.exports) {
// Publish as node.js module
module.exports = maxant;
} else if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() {
return maxant;
});
} else {
// Publish as global (in browsers and rhino/nashorn)
var _previousRoot = _global.maxant;
// **`noConflict()` - (browser only) to reset global 'maxant' var**
maxant.noConflict = function() {
_global.maxant = _previousRoot;
return maxant;
};
_global.maxant = maxant;
}
}).call(this);
Listing 2: An example of an algorithm that we want to run in both Java and Javascript environments
Lines 10-16 are the algorithm that we want to run. The rest of the script is standard Javascript boiler plate when you want to create a script that can be run in
all kinds of environments, for example, the browser, Rhino/Nashorn, require (e.g. Node.js) or AMD. Lines 27-35 and lines 39-43 aren't really necessary in the context
of this article because we only run the code in the browser or Rhino/Nashorn, and we don't really care about being kind enough to provide a function for making our
script non-conflicting if some other script is loaded with the same "namespace" (in this case 'maxant').
The algorithm itself, rule419
isn't really that interesting, but notice how it makes use of
lodash when it wraps the input by calling the function _(...)
. That shows that we are able to make use
of other modules loaded into the global space who use script patterns similar
to that shown in Listing 2. For demo purposes, I have created an algorithm which simply counts the number of times that 'John' is present in the model. The model is an array
of objects with the name
attribute. In reality, if we are going to go to the extent of writing an algorithm in just Javascript but making it possible to run
it both in Java and Javascript environments, I hope that it would be a damn site more complicated that the algorithm shown here :-)
To make the algorithm useful, I have chosen to run it from a mini-
AngularJS application. If you aren't familiar with AngularJS then all you need to know is that you can now
call rule419
from Javascript like this:
var result = maxant.rule419(model);
In AngularJS it is recommended to make modules injectable, which can easily be done as shown in Listing 3, when bootstrapping the application. See
here for more details.
'use strict';
// Declare app which depends on views, and components
angular.module('app', [
'ngRoute',
'app.view1'
])...
//make rules injectable
.factory('maxant', function(){return window.maxant;})
...
Listing 3: app.js - Making rules injectable in AngularJS
The AngularJS controller can then inject the module as shown in Listing 4.
...
.controller('View1Ctrl', ['$scope', '$http', '$routeParams', 'maxant',
function($scope, $http, $routeParams, maxant) {
//create a model
var model = [
{name: 'Ant'},
{name: 'John'}
];
...
//execute javascript that can also be executed on the server using Java
$scope.clientResult = maxant.rule419(model);
...
}]);
Listing 4: Controller code making use of the injected module in order to run the algorithm in question
Lines 2-3 inject the module named maxant
and line 12 then uses the rule419
function and puts the result into scope so that it can be displayed
to the user.
The harder part of this exercise is getting the Javascript to be runnable in a Java environment like a Java EE application server or a batch program.
This Java 7 link
and
this Java 8 link
give examples of how to run Javascript from Java.
I've encapsulated code from those examples to provide a very simple API which Java application code can use to run the Javascript.
//instantiate the engine
Engine engine = new Engine(Arrays.asList("lodash-3.10.0.js", "rules.js"));
//prepare data model - the input to the javascript
Person[] people = new Person[]{new Person("John"), new Person("John")};
//invoke engine
String result = engine.invoke(people, "maxant", "rule419");
//evaluate output
assertEquals("Scam", result);
Listing 5: Calling the Javascript algorithm from Java
Listing 5 starts on line 2 by instantiating the abstraction that I have created (see Listing 6). It simply needs a list of Javascript file names which it should
load into the scripting engines' space. The two Javascript files used in this example live in the src/main/resources
folder so that Maven packs them into the JAR/WAR
that is built. That makes them accessible via the Classloader as shown in Listings 1 and 6. Listing 5 then continues on line 5 by
creating some kind of data model which is the input to the algorithm. The Person
class has an attribute named name
which is private, but
nonetheless used by the algorithm. In Java we would use getter/setter methods to access that data, but notice line 13 of Listing 2 just references the attribute by its name
and not by a bean-style accessor method. More on that shortly...
Line 8 of Listing 5 then executes the algorithm, by telling the engine to invoke rule419
of the maxant
module, using people
as the input. The result of the Javascript execution which happens under the hood can then be used, for example on line 11. It doesn't have to be a String
,
it could also be a Java object which the rule returns.
The implementation behind that simple API is shown in Listings 6, 7 and 8. That code can be thought of as library code.
public Engine(List<String> javascriptFilesToLoad) {
ScriptEngineManager engineManager = new ScriptEngineManager();
engine = engineManager.getEngineByName("nashorn");
if (engine == null) {
//java 7 fallback
engine = engineManager.getEngineByName("JavaScript");
}
//preload all scripts and dependencies given by the caller
for (String js : javascriptFilesToLoad) {
load(engine, js);
}
referenceToJavascriptJSONInstance = engine.eval("JSON");
}
Listing 6: The implementation behind the neat API, part 1
Listing 6 shows the constructor which first instantiates a ScriptEngineManager
from the javax.scripting
package
and uses it to create the real Javascript engine
which executes the algorithm in question, rule419
. Notice the fallback used for making the code compatible with Java 7 and 8. I didn't try it but probably
just getting the engine by the name "JavaScript" suffices... The constructor does two more things: it loads all the scripts which the caller wants in scope and then gets itself
a reference to the Javascript
JSON
object which is used later for converting JSON to Javascript objects.
private void load(ScriptEngine engine, String scriptName) {
//fetch script file from classloader (e.g. out of a JAR)
//and put it into the engine
ClassLoader cl = this.getClass().getClassLoader();
try (InputStream script = cl.getResourceAsStream(scriptName)) {
engine.eval(new InputStreamReader(script));
}
}
Listing 7: The implementation behind the neat API, part 2
Listing 7 is called from Listing 6 and shows how the Javascript files are loaded using the Classloader and then sent to the ScriptEngine
on line 6.
Finally, Listing 8 shows the process of invoking the Javascript.
public <T> T invoke(Object input, String module,
String functionNameToExecute) {
final Invocable invocable = (Invocable) engine;
//convert
ObjectMapper om = new ObjectMapper();
String dataString = om.writeValueAsString(input);
Object data = invocable.invokeMethod(
referenceToJavascriptJSONInstance,
"parse", dataString);
//execute
Object moduleRef = engine.get(module);
Object result = invocable.invokeMethod(moduleRef,
functionNameToExecute, data);
return (T) result;
}
Listing 8: The implementation behind the neat API, part 3
First, lines 6-7 use
Jackson
to convert the Java model into a JSON string. That JSON string is then parsed inside the ScriptEngine
on lines 9-11, which is equivalent to calling JSON.parse(dataString)
in Javascript. The conversion from Java to JSON and then
Javascript isn't strictly necessary since Rhino/Nashorn know how to use Java objects.
But I've chosen to do it that way so that you can skip wrapping all the attributes in accessor code like getXYZ(...)
.
This way, the Javascript can simply access fields like this: input[2].name
which gets the third elements attribute called name
,
rather than say input.get(2).getName()
, like you would have to do in plain old Java.
There is one thing to note: as far as I can tell, Rhino and Nashorn are not thread-safe, so you might need to think about that in any implementation that you write.
I would probably use a
pool
of Engine
objects, each pre-loaded with the necessary scripts, because it is the instantiation and setup that takes the longest amount of time.
So, to conclude, it is indeed possible to write algorithms once and run them in both Javascript and Java environments, but unlike Java and its "write once, run anywhere"
slogan, the algorithms are written in Javascript.
All the code for this demo is available at
Github/maxant/java-everywhere.
Copyright ©2015, Ant Kutschera


--- ---
Without JavaScript, this page probably won't work very well. For more information, or if you would like to talk to us about this, please take a look at our GitHub repository.