| I l@ve RuBoard |
19.4 The SWIG Integration Code GeneratorBut don't do that. I'm introducing C extension basics so you understand the underlying structure, but today, C extensions are usually better and more easily implemented with the SWIG integration code generator. SWIG -- the Simplified Wrapper and Interface Generator -- is an open source system created by Dave Beazley. It uses C and C++ type declarations to generate complete C extension modules that integrate existing libraries for use in Python scripts. The generated C extension modules are complete: they automatically handle data conversion, error protocols, reference-count management, and more. That is, SWIG automatically generates all the "glue" code needed to plug C and C++ components into Python programs; simply compile its output and your extension work is done. You still have to manage compilation and linking details, but the rest of the C extension task is done by SWIG. 19.4.1 A Simple SWIG ExampleFor instance, instead of writing all that C code in the prior section, write the C function you want to use from Python without any Python integration logic at all, as though it is to be used from C alone. This is illustrated in Example 19-4. Example 19-4. PP2E\Integrate\Extend\HelloLib\hellolib.c/********************************************************************* * A simple C library file, with a single function, "message", * which is to be made available for use in Python programs. * There is nothing about Python here--this C function can be * called from a C program, as well as Python (with glue code). *********************************************************************/ #include <string.h> #include <hellolib.h> static char result[64]; /* this isn't exported */ char * message(char *label) /* this is exported */ { strcpy(result, "Hello, "); /* build up C string */ strcat(result, label); /* add passed-in label */ return result; /* return a temporary */ } While you're at it, define the usual C header file to declare the function externally; as shown in Example 19-5. This is probably overkill, but will prove a point. Example 19-5. PP2E\Integrate\Extend\HelloLib\hellolib.h/******************************************************************** * Define hellolib.c exports to the C namespace, not to Python * programs--the latter is defined by a method registration * table in a Python extension module's code, not by this .h; ********************************************************************/ extern char *message(char *label); Now, instead of all the Python extension glue code shown in the prior section, simply write a SWIG type declarations input file, as in Example 19-6. Example 19-6. PP2E\Integrate\Extend\Swig\hellolib.i/****************************************************** * Swig module description file, for a C lib file. * Generate by saying "swig -python hellolib.i". ******************************************************/ %module hellowrap %{ #include <hellolib.h> %} extern char *message(char*); /* or: %include "../HelloLib/hellolib.h" */ /* or: %include hellolib.h, and use -I arg */ This file spells out the C function's type signature. In general, SWIG scans files containing ANSI C and C++ declarations. Its input file can take the form of an interface description file (usually with an .i suffix), or a C/C++ header or source file. Interface files like this one are the most common input form; they can contain comments in C or C++ format, type declarations just like standard header files, and SWIG directives that all start with %. For example:
In this example, SWIG could also be made to read the hellolib.h header file directly. But one of the advantages of writing special SWIG input files like hellolib.i is that you can pick and choose which functions are wrapped and exported to Python; scanning a library's entire header file wraps everything it defines. SWIG is really a utility that you run from your build scripts, not a programming language, so there is not much more to show here. Simply add a step to your makefile that runs SWIG, and compile its output to be linked with Python. Example 19-7 shows one way to do it on Linux. Example 19-7. PP2E\Integrate\Extend\Swig\makefile.hellolib-swig############################################################### # Use SWIG to integrate hellolib.c for use in Python programs. ############################################################### # unless you've run make install SWIG = ./myswig PY = $(MYPY) LIB = ../HelloLib # the library plus its wrapper hellowrap.so: hellolib_wrap.o $(LIB)/hellolib.o ld -shared hellolib_wrap.o $(LIB)/hellolib.o -o hellowrap.so # generated wrapper module code hellolib_wrap.o: hellolib_wrap.c $(LIB)/hellolib.h gcc hellolib_wrap.c -c -g -I$(LIB) -I$(PY)/Include -I$(PY) hellolib_wrap.c: hellolib.i $(SWIG) -python -I$(LIB) hellolib.i # C library code (in another directory) $(LIB)/hellolib.o: $(LIB)/hellolib.c $(LIB)/hellolib.h gcc $(LIB)/hellolib.c -c -g -I$(LIB) -o $(LIB)/hellolib.o clean: rm -f *.o *.so core force: rm -f *.o *.so core hellolib_wrap.c hellolib_wrap.doc When run on the hellolob.i input file by this makefile, SWIG generates two files:
This makefile simply runs SWIG, compiles the generated C glue code file into an .o object file, and then combines it with hellolib.c 's compiled object file to produce hellowrap.so. The latter is the dynamically loaded C extension module file, and the one to place in a directory on your Python module search path (or "." if you're working in the directory where you compile). Assuming you've got SWIG set to go, run the makefile to generate and compile wrappers for the C function. Here is the build process running on Linux: [mark@toy ~/.../PP2E/Integrate/Extend/Swig]$ make -f makefile.hellolib-swig ./myswig -python -I../HelloLib hellolib.i Generating wrappers for Python gcc hellolib_wrap.c -c -g -I../HelloLib ...more text deleted here... ld -shared hellolib_wrap.o ../HelloLib/hellolib.o -o hellowrap.so And once you've run this makefile, you are finished. The generated C module is used exactly like the manually coded version shown before, except that SWIG has taken care of the complicated parts automatically: [mark@toy ~/.../PP2E/Integrate/Extend/Swig]$ python >>> import hellowrap # import the glue+library file >>> hellowrap.__file__ # cwd always searched on imports './hellowrap.so' >>> hellowrap.message('swig world') 'Hello, swig world' In other words, once you learn how to use SWIG, you can largely forget all the integration coding details introduced in this chapter. In fact, SWIG is so adept at generating Python glue code that it's usually much easier and less error-prone to code C extensions for Python as purely C or C++-based libraries first, and later add them to Python by running their header files through SWIG, as demonstrated here. 19.4.2 SWIG DetailsOf course, you must have SWIG before you can run SWIG; it's not part of Python itself. Unless it is already on your system, fetch SWIG off the Web (or find it at http://examples.oreilly.com/python2) and build it from its source code. You'll need a C++ compiler (e.g., g++), but the install is very simple; see SWIG's README file for more details. SWIG is a command-line program, and generally can be run just by saying this: swig -python hellolib.i In my build environment, things are a bit more complex because I have a custom SWIG build. I run SWIG from this csh script called myswig: #!/bin/csh # run custom swig install source $PP2EHOME/Integrate/Extend/Swig/setup-swig.csh swig $* This file in turn sets up pointers to the SWIG install directory by loading the following csh file, called setup-swig.csh : # source me in csh to run SWIG with an unofficial install setenv SWIG_LIB /home/mark/PP2ndEd/dev/examples/SWIG/SWIG1.1p5/swig_lib alias swig "/home/mark/PP2ndEd/dev/examples/SWIG/SWIG1.1p5/swig" But you won't need either of these files if you run a make install command in the SWIG source directory to copy it to standard places. Along the way in this chapter, I'll show you a few more SWIG-based alternatives to the remaining examples. You should consult the SWIG Python user manual for the full scoop, but here is a quick look at a few more SWIG highlights:
Although the SWIG examples in this book are simple, you should know that SWIG handles industrial-strength libraries just as easily. For instance, Python developers have successfully used SWIG to integrated libraries as complex as Windows extensions and commonly used graphics APIs. SWIG can also generate integration code for other scripting languages such as Tcl and Perl. In fact, one of its underlying goals is to make components independent of scripting language choices -- C/C++ libraries can be plugged in to whatever scripting language you prefer to use (I prefer to use Python, but I might be biased). SWIG's support for things like classes seems strongest for Python, though, probably because Python is considered to be strong in the classes department. As a language-neutral integration tool, SWIG addresses some of the same goals as systems like COM and CORBA (described in Chapter 20), but provides a code-generation-based alternative instead of an object model. You can find SWIG on this book's CD (see http://examples.oreilly.com/python2) or at its home page on the Web, http://www.swig.org. Along with full source code, SWIG comes with outstanding documentation (including a manual specifically for Python), so I won't cover all of its features in this book. The documentation also describes how to build SWIG extensions on Windows. A SWIG book is reportedly in the works as I write this, so be sure to check the books list at http://www.python.org for additional resources. |
| I l@ve RuBoard |


|
OR-Tools
7.1
Google Optimization software suite
|
KnapsackItem is a small struct to pair an item weight with its corresponding profit. More...
#include <knapsack_solver.h>
Public Member Functions | |
| KnapsackItem (int _id, int64 _weight, int64 _profit) | |
| double | GetEfficiency (int64 profit_max) const |
Public Attributes | |
| const int | id |
| The 'id' field is used to retrieve the initial item in order to communicate with other propagators and state. More... | |
| const int64 | weight |
| const int64 | profit |
KnapsackItem is a small struct to pair an item weight with its corresponding profit.
The aim of the knapsack problem is to pack as many valuable items as possible. A straight forward heuristic is to take those with the greatest profit-per-unit-weight. This ratio is called efficiency in this implementation. So items will be grouped in vectors, and sorted by decreasing efficiency. Note that profits are duplicated for each dimension. This is done to simplify the code, especially the GetEfficiency method and vector sorting. As there usually are only few dimensions, the overhead should not be an issue.
Definition at line 232 of file knapsack_solver.h.
|
inline |
Definition at line 233 of file knapsack_solver.h.
|
inline |
Definition at line 235 of file knapsack_solver.h.
| const int operations_research::KnapsackItem::id |
The 'id' field is used to retrieve the initial item in order to communicate with other propagators and state.
Definition at line 243 of file knapsack_solver.h.
| const int64 operations_research::KnapsackItem::weight |
Definition at line 244 of file knapsack_solver.h.
| const int64 operations_research::KnapsackItem::profit |
Definition at line 245 of file knapsack_solver.h.


Log in
Find flexible flights all over the world!
Get started its free.
Registration takes less than 2 minutes.
Join now
Continue as Guest


APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s
APPS >
MOST POPULAR
Facebook bans Holocaust denial posts, reversing original stance
Rachel Kaser. 13hours ago
LATEST
Report: Google is going to turn YouTube into a shopping hub
-
Here is how to save a song from instagram reels
-
Microsoft Edge trees to open-up chrome with instant video calls and more
-
Instagram trend is now basically a dedicated message app
-
Instagram lets you reverts to classic icons for its birthday --
Here is how
-
Facebook and Instagram just banned all QAnon accounts, "even if they contain no violent content"s


A Life Less Ordinary (1997)
A movie review by Michael J. Legeros Copyright 1997 by Michael J. Legeros
(Fox) Directed by Danny Boyle Written by John Hodge Cast Ewan McGregor, Cameron Diaz, Holly Hunter, Delroy Lindo, Ian Holm, Dan Hedaya, Stanley Tucci, Tony Shalhoub, Ian McNeice, Maury Chaykin MPAA Rating "R" (presumably for profanity and violence) Running Time 102 minutes Reviewed at Six Forks Station Cinemas, Raleigh, NC (24OCT97)
==
This surprising stinker from the TRAINSPOTTING team is an unfunny, overly hip romantic comedy about a cute-as-can-be janitor (Ewan Mac- Gregor) who one day gets replaced by a robot, tries to talk to the company president (Ian Holm) about it, and ends up taking the million- aire's spoiled-rotten daughter (Cameron Diaz) hostage. The catch? Well, she kinda likes being kidnapped. And-- are you ready for this one?-- they're pursued by a pair of increasingly aggressive angels (Delroy Lindo and Holly Hunter) neither of whom can return to Heaven until the kids are in love! No, not an ordinary movie by any means. The innumerable odd (and often yawn-inducing) sights include a pool-side game of William Tell, a fantasy dance sequence set to "Beyond the Sea," and a T2/Robert Patrick impersonation by the diminutive Ms. Hunter. (Not only does she crawl across the hood of a moving vehicle, she also spits a wad of chew, in a single screen moment that all but cured my longtime crush on the actress.) While it's difficult to dislike *any* movie that allows the line "this is Gabriel, get me God"-- or one that closes with a cute claymation sequence-- there's absolutely *nothing* compelling at the story's core. No chemistry. No charm. Nothing. Directed by Danny Boyle, written by John Hodge, and produced by Peter MacDonald, all of whom prove that it takes real talent to make a movie this bad. (Rated "R"/102 min.)
Grade: D
-- Mike Legeros - Movie Hell http://www.nonvirtual.com/hell/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Got empty project from Matti Lankinen.
Matti had just noticed perf problems with megablob.
I had just used Reagent in production.
Refactoring Matti's project (createStore) created Atom.
And with Matti developed ways to embed Bacon into JSX.
Later started using Bacon Model and, thanks to it, lenses.
Realized Bacon Model creates cycles => Bacon Atom.
And then developed Partial Lenses library.
Avoid boilerplate and glue
Avoid all-or-nothing / lock-in
Prefer declarative
Avoid unnecessary encoding
Structural programming
Components plug-and-play
There is actually nothing new here.
We are just combining a few old things.
Maintaining consistent state in the face of async inputs.
In order of importance:
All optional!
And can mix with other React components.
Model is just JSON. Meta contains operations on JSON.
import Atom from "kefir.atom"
import K,{bind, classes, fromIds, fromKefir} from "kefir.react.html"
import Kefir from "kefir"
or
import Atom from "bacon.atom"
import B,{bind, classes, fromIds, fromBacon} from "bacon.react.html"
import Bacon from "baconjs"
and
import L from "partial.lenses"
import R from "ramda"
<Clock/>
const Clock = () => <K.div>
{K(oncePerSec, () => new Date().toString())}
</K.div>
const oncePerSec = Kefir.constant().merge(Kefir.interval(1000))
<InputAdd/>
const InputAdd = ({elems = Atom([]), entry = Atom("")}) =>

<K.input type="text" {...bind({value: entry})}/>
<button onClick={() => {const elem = entry.get().trim()
if (elem) {
elems.modify(R.append(elem))
entry.set("")}}}>Add</button>

<K.ul>
{K(elems, es => es.map((e, i) =>
{e}
))}
</K.ul>

<BMI/>
const BMI = ({bmi = Atom(M.mock)}) =>
<Augmented bmi={bmi.lens(M.BMI.augment)}/>
const Augmented = ({bmi}) =>
<K.div {...classes("bmi", K(bmi, M.BMI.classification))}>
<Slider title="Weight" units="kg" min={40} max={140}
value={bmi.lens(M.BMI.weight)}/>
<Slider title="Height" units="cm" min={140} max={210}
value={bmi.lens(M.BMI.height)}/>

BMI: <K.span className="bmi-value">
{K(bmi, M.BMI.bmi)}</K.span>

</K.div>
const Slider = ({title, units, value, ...props}) =>

<K.div>{title}: {value}{units}</K.div>
<K.input type="range" {...bind({value})} {...props}/>

export const BMI = {
augment: L.augment({
bmi: ({height, weight}) =>
Math.round(weight/(height * height * 0.0001))}),
bmi: R.prop("bmi"),
height: "height",
weight: "weight",
classification: ({bmi}) =>
bmi < 15 ? "bmi-underweight bmi-underweight-severely"
: bmi < 18.5 ? "bmi-underweight"
: bmi < 25 ? "bmi-normal"
: bmi < 30 ? "bmi-overweight"
: bmi < 35 ? "bmi-obese"
: bmi < 40 ? "bmi-obese bmi-obese-severely"
: "bmi-obese bmi-obese-very"
}
<Phonebook/>
const Phonebook = ({phonebook: pb = Atom(M.mock)}) =>

<button onClick={() => pb.modify(M.Phonebook.addContact())}>
New</button>
<Contacts contacts={pb.lens(M.Phonebook.contacts)}/>

const Contacts = ({contacts}) => <K.div>
{fromIds(K(contacts, M.Contacts.indices), i =>
<Contact key={i} contact={contacts.lens(i)}/>)}
</K.div>
const Contact = ({contact}) =>

<TextInput value={contact.lens(M.Contact.name)}/>
<TextInput value={contact.lens(M.Contact.number)}/>
<button onClick={() => contact.modify(M.Contact.remove)}>
Remove</button>

const TextInput = ({value = Atom("")}) => {
const editing = Atom(false)
const exit = () => editing.set(false)
const save = e => {value.set(e.target.value); exit(e)}
return fromKefir(K(editing, e => e
? <K.input key="1" type="text" autoFocus
defaultValue={value}
onFocus={({target: t}) =>
t.selectionStart = t.value.length}
onKeyDown={({key}) => key === "Enter" && save(e)
|| key === "Escape" && exit(e)}
onBlur={save}/>
: <K.input key="0" type="text" disabled
{...{value}}
onDoubleClick={() => editing.set(true)}/>))
}
export const mock =
[{name: "Mr Digits", number: "1-23-456789"}]
export const Contact = {
create: ({name = "", number = ""} = {}) => ({name, number}),
remove: () => {},
id: "id",
name: "name",
number: "number"
}
export const Contacts = {
indices: R.pipe(R.length, R.range(0))
}
export const Phonebook = {
contacts: L.define([]),
addContact: R.pipe(Contact.create, R.append)
}
Atom(vInitial)
For example:
const counter = Atom(0)
atom.get()
For example:
counter.get() === 0
atom.modify(vOld => vNew)
For example:
counter.modify(c => c + 1)
Now:
counter.get() === 1
Also for convenience:
atom.set(vNew) === atom.modify(() => vNew)
Can store in data structures, pass to and return from functions.
Want multiple things to always share the same value?
Put the value in an Atom and share it.
Avoid get
.
Use "FRP" combinators to express dependent computations.
Stream
A B CD E F G HIJ K L M N O P QR S
e.g. key down events, mouse clicks, ...
filter, skip, merge, combine, scan, toProperty, ...
Property
AABBCDDDDDDDDEEFFFFFFFFFFFFFFGGGGGGGHIJJKKLKKKMMMNNNNOOOPPPPPPQRRRRS
e.g. text accumulated, position of pointer, ...
combine, sample, changes, toEventStream, ...
Both are used. We are mostly concerned with properties.
Bacon.combineWith(p1, ..., pN, (v1, ..., vN) => result)
Kefir.combine(p1, ..., pN, (v1, ..., vN) => result)
We abbreviate:
B(p1, ..., pN, (v1, ..., vN) => result)
K(p1, ..., pN, (v1, ..., vN) => result)
For example:
const input = Atom("This is an example.")
const words = K(input, R.split(" "))
const numWords = K(words, R.length)
const unique = K(words, R.uniqBy(R.toUpper))
const numUnique = K(unique, R.length)
Properties being observed are kept in sync.
We just decide which properties to observe.
const counter = increment.map(() => +1)
.merge(decrement.map(() => -1))
.scan(0, (sum, delta) => sum + delta)
...became fashionable when reactive became popular.
What do you gain by that?
Typically not a thing.
Cargo cult programmingDon't use streams to encode simple synchronous properties.
const delayedCounter =
increment.map(() => +1)
.merge(decrement.map(() => -1).delay(100))
.scan(0, (sum, delta) => sum + delta)
...asynchronous processes when you actually need them.
const greetingsTarget = Atom("world")
...

Hello, {greetingsTarget}!

It crashes. React cannot render observables.
const greetingsTarget = Atom("world")
...
<K.div>Hello, {greetingsTarget}!</K.div>
<K.input type="text"
value={greetingsTarget}
onChange={e => greetingsTarget.set(e.target.value)}/>
JSX, e.g.

Child

evaluates into a tree of objects, roughly
{ "type": "div",
"props":
{ "someProp": "a value",
"children":
{ "type": "p",
"props": { "children": "Child" } } } }
and the props are passed to the React class.
componentWillMount() {
... subscribe ...
}
componentWillUnmount() {
... dispose ...
}
render() {
return this.state.rendered
}
Subscribe creates a stream to update rendered
state.
Everything can be made to work incrementally.
Mount and unmount take a little extra.
But then you only recompute changed VDOM.
Asymptotically better than recomputing all VDOM.
Never write another React class or shouldComponentUpdate.
Properties and streams everywhere.
Possibly thousands upon thousands.
Bacon is neither space nor time optimal. :(
Kefir uses significantly less (~5x).
With Kefir performance seems very competitive.
Let you declare a path to an element.
Given:
const data = {items: [{id: "a", value: 20}, {id: "b", value: 10}]}
We could write a parameterized lens to access values:
const valueOf = id => L("items",
L.required([]),
L.find(R.whereEq({id})),
L.default({id}),
"value")
Let's take a moment to read each line above!
We can now view values:
> L.get(valueOf("a"), data)
20
And we can set values:
> L.set(valueOf("a"), 15, data)
{items: [{id: "a", value: 15}, {id: "b", value: 10}]}
And we can delete values:
> L.delete(valueOf("a"), data)
{items: [{id: "b", value: 10}]}
And we can insert values:
> L.set(valueOf("c"), 15, data)
{items: [{id: "a", value: 20},
{id: "b", value: 10},
{id: "c", value: 15}]}
Including the whole item.
...allow one to, e.g.
See documentation for more examples and details.
atom.lens(partial-lens)
For example:
const names = Atom(["first"])
const first = names.lens(L.index(0))
Now you can, e.g.
first.set("Still first")
Allows your code to directly follow the structure
to create a functioning, composable component.
The JSON model structure is unique.
The HTML view structure is unique.
Write down the structure of the problem and you have a solution.
Does your UI framework make you invent new structure?
Don't overuse Atoms: leads to imperative spaghetti.
Setting the value of an atom in response to a change of an atom is a smell.
Remember: You can use other kinds of wiring!
But more complex wiring seems to be rarely needed.
Atoms and Observable embedding make it easy to have: component = 1 function.
But you really dont want to clump everything together.
Separate the model, meta-model, control.
It makes code conceptually clearer.
It makes the models more easily testable and usable.
It is easy to go overboard with components.
Wrapping basic HTML elements, e.g. textarea or select, as components.
You end up making them difficult to customize.
Your components should do something substantial.
Does it have a non-trivial model?
Is it a combination of elements you use in lots of places?
Issues raised in AngularJS: The Bad Parts:
The meta model is just a bunch of operations on model.
Add e.g. mocha to the project and tycittele a few tests.
Make editable link component.
Look at TextInput.
When not editing, render as a link.
Select some React datepicker component.
Bind it to the model.
Add a text input for a search text.
Only show items containing matching text.
Limit the number of simultaneously shown items.
Let the user scroll through the list.
For undo, you can use Atom.Undo.
For storage, you can use Atom.Storage.
Do you store history to local storage or not?
You will likely need to add Node (Express) to the project.


Crypto Trader Indicates Potential Bottom for Litecoin, Ethereum, XRP and Altcoins As Bitcoin (BTC) Benchmark Spotlights Trouble Ahead
by Daily Hodl StaffAn index tracking trepidation among crypto traders indicates Bitcoin may have more room to fall.
The Fear & Greed Index from Alternative.me measures market volatility, social media and surveys to determine the overall sentiment among crypto traders.
The index is now firmly in the fear zone at 38, indicating that investors are worried the price may drop further.
Run by the developers and creators of Strawpoll.com and Thundercheck.org, the index shows that when traders are fearful, a market correction is typically ongoing.
The needle is designed to shift into “extreme fear” when a significant correction has taken place, indicating that investors are overly worried and that a buying opportunity could be at hand.
As for the altcoin market, crypto analyst and winner of CME Group’s annual trading competition in 2016 says he thinks it may have hit a bottom.
In his latest tweet, Eric Choe says Litecoin’s chart is a reflection of the altcoin market at large. He thinks LTC may hit a floor around $55 before the start of a rebound.
“This could honestly be the bottom of the alt-market end of 2019. A lot of charts look like this. Hold the floor!”
At time of publishing, LTC is down 5.92% at $56.70, according to CoinMarketCap.
Bitcoin is down 3.81% at $8,308, Ethereum is down 3.50% at $180.07, XRP is down 4.80% at $0.2547 and Bitcoin Cash is down 8.20% at $249.43.


Basic Design and Operation
A gene name takes on different meanings in different contexts. For example:
- in an RNA-seq experiment, a gene name refers to mRNA expression
- in a metabolic pathway, for the enzyme for which it codes
- in a pubmed search, a list of journal artices in which the gene is prominently mentioned
- in a database of homology, orthologous genes foundin other species
This webapp facilitates the exploration of these multiple meanings.
Click in the table row for your gene of interest, and all of the tabs will be populated.
These tabs are currently avaialble:
- Gene Table: summary information 1010 genes, curated by the LC
- GeneCards: Per-gene diverse information from the Weizmann Institute
- HomoloGene: Cross-species orthologs from NCBI
- Curated Pubmed: Articles selected by the LC
- Pubmed Gene+Longevity: Fresh search of PubMed
- Orthologs: Curated by the LC
- Notes & Comments: A shared google doc for all to use
Some immediately relevant & curated information is presented directly in the table.
Other information and explorations are available when you send a gene to one of
the other tabs.
Gene Table Columns
- Gene: the HGNC human gene symbol
- Longevity: a coded representation of evidence:
- + positive causality
- - negative causality
- +? positive correlation
- -? negative correlation
- +/- mixed causal
- +/-? mixed correlation
- Longeivty Feature: attributes of this gene related to longevity (curated).
- Function: a summary of the function of this gene (curated).
- PMID: longevity-related curated references for this gene.


Hi, {{vm.register.first_name}}. You have been registered with us.
Your Customer ID is {{vm.customer_id}}. Please mention this ID in all subsequent communications with us.
You will shortly recieve a confirmation mail on {{vm.register.email}}.
Feel free to contact us on<EMAIL_ADDRESS>if you need any help.
You can also call us on +91 98 23 07 94 30.


Emre Can takes strange swipe at Italian youngsters who make him ‘angry’
by Jordan ChamberlainEmre Can is not enjoying life in Italy, especially since Maurizio Sarri took over in the summer.
The German has fallen down the pecking order since the arrival of Aaron Ramsey and Adrien Rabiot on Bosman deals not dissimilar to his the year previous.
In total, Can has played 151 minutes of Serie A football and zero in the Champions League – a very poor return from a German international who aged 25 – should be in his prime.
And in an odd interview, Can has criticised Juventus youngsters who get the chance to train with the first-team, stating their attitudes are poor.
“They have the chance of a lifetime if they are allowed to practice with the professionals,” he told German outlet Kicker, translated by the Echo.
“However, some of them sometimes have a body language that almost makes me angry.
“I often go to these players at Juventus, talk to them, try to show them what they can do when they try hard and show themselves. But some don’t understand it.”
It must be frustrating to see talented youth players not displaying appropriate respect or effort – but it seems a strange thing to air in the press.
Can will surely seek an exit soon unless his situation doesn’t improve, with Manchester United recently credited with an interest by the Mirror.
It will be a tad uncomfortable seeing Can line up for our bitter rivals, but in reality – it shouldn’t bother us. His exit meant we signed Fabinho, a far, far better player who has improved our midfield tenfold.
The only person who should regret the departure is Can himself.


You have authorized sogeBot to access donation information. You now need to take the following code and put it into your settings->integrations->streamlabs->access token


{% extends 'base.html' %} {% block scripts %} {{ super() }} {% endblock %} {% block title %}i2c Relay Controller{% endblock %} {% block page_content %}
Use "Scan I2C" to list devices in an I2C bus.
Use "Add Relays" to add relays to control.
Use the buttons below to set/toggle the status of the relay board's relays.
You should hear the relays click as they're activated; if you don't, it's probably not working ;-)
Changes are persisted automatically.
{% endblock %}


Why Encrypt
☰ Menu
Much has been known about encryption recently. And on some level, you
probably have an idea about what it means.
You might recall, for instance, that the FBI and Apple have fought over
it. (Apple won.) Most large companies such as Google and Facebook
support Apple’s position. And that encryption keeps your “stuff” safe
from unwanted eyes.
The problem is that the idea of privacy is just that these days — an
idea.
“The way technology is woven into our daily lives, you can’t do without
it,” - Amy Danker. An employee at Epic Wines and Spirits told the
Oakland Tribune in a recent interview.
“So what’s your other option?

I just assume that all my private information is already
available through my IP address. You don’t even think privacy exists,
because it doesn’t anymore, right?”
Natalie Plotnikova agrees, saying the arm of the law is getting too
long. “I don’t really like it,” Plotnikova told the Oakland Tribune as
she waited to be cleared through security at the Federal Building in San
Jose, “I don’t want the government to be able to use my phone to see my
information.”
This, say, experts, is why encryption is necessary and important —
especially in our current 24/7-connected environment where everything is
done on a smartphone. By having your information scrambled so that only
the person you are sending it to can see it, your privacy is maintained
and your information remains secure.
(Disclaimer this is not an advertisement.)
To that point, a technology from VirnetX—a company that created an app
called Gabriel, which uses encryption technology derived from a CIA
national security program — may be the answer.
The Gabriel app, available on the App Store and the Google Play Store,
was designed and built with personal privacy and security as a
foundational principle.
For only $10 to $15 per year, users can take advantage of the Gabriel
app and benefit from uncompromising encryption security when they talk,
video chat, text, email or share photographs or documents.
No one will be able to see, hear, or intercept your communications
except the party you’re in contact with because Gabriel does not
transmit or store data with any third party. It’s person-to-person
encryption that all but eliminates hacking possibilities.
Other benefits include:
Making free voice or video calls or sending instant messages to
other Gabriel members.
Receiving seamless email.
Sharing
pictures or files that can’t be intercepted.
So everyone reading this please see that you use encrypted services.
Senthil
Writer and Web developer
Philomath team


News story
Ofqual has today (1 October 2015) launched the Regulated Qualifications Framework (RQF) as the single framework for describing all regulated qualifications in England and vocational qualifications in Northern Ireland.
The RQF is designed to help people understand qualifications, providing detail on the challenge and size of each qualification we regulate. The framework will also show where a qualification sits in relation to others of differing level or size, like a range of books in a bookcase .
At the same time as introducing the RQF, we are withdrawing the rules of the Qualifications and Credit Framework (QCF). We took this decision because we found that the rules did not always enable the most appropriate qualification and assessment design.
The RQF is not another set of detailed design rules. This means that awarding organisations can focus on designing sufficiently valid qualifications, rather than having to fit them to a prescribed structure. It also means that we can better focus our regulatory approach across the full life cycle of a qualification, including delivery, assessment and evaluation of feedback as well as up front design.
Talking about withdrawing the rules, Jeremy Benson, Executive Director for Vocational Qualifications, said:
We have seen widespread agreement with our proposals to withdraw the QCF rules. They blurred accountability for quality. Without them awarding organisations can focus on what matters, which is the validity of their qualifications.
Jeremy has also written a blog post that explains more about the RQF .
As a result of the changes we have made, our ‘ General Conditions of Recognition ’ and related guidance have been updated. They came into force as of today.


This is a version of a WordPress.com Post documenting this work.
The Post should more up to date than this file.
The Post is available at:
http://joecodeswell.wordpress.com/2014/05/02/web2py-to-wordpress-api-with-oauth2/
Love and peace,
Joe
``` python
import gluon.contrib.simplejson as simplejson
import datetime, random, string
import urllib, urllib2
import requests
# TODO: Replace these globals with your own.
HOST = 'yoursite.com' # REGISTER with developer.wordpress.com
APPNAME = 'yourappname' # REGISTER with developer.wordpress.com
CLIENT_SECRET = 'BIG.LONG.STRING' # GET FROM developer.wordpress.com
CLIENT_ID = '12345' # GET FROM developer.wordpress.com
def authorize_blog():
"""
Initiates retrieval of OAuth2 credentials which
allows your user to aurhorize her blog for use by your app.
Generates an HTML page containing a WordPress Authorize button which
holds a redirect_uri callback to your app.
When your user presses this button, she is sent to WordPress.com, where,
IF she AUTHORIZES one of her blogs:
WordPress.com will send OAuth2 credentials to YOUR callback URL.
see: http://developer.wordpress.com/docs/oauth2/
"""
# see [OAuth2 state Article on stackoverflow] (http://stackoverflow.com/questions/11071482/oauth2-0-server-stack-how-to-use-state-to-prevent-csrf-for-draft2-0-v20)
state = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(30))
state = str(datetime.datetime.now()).replace(':', '.').replace(' ', '') + '_' + state
session.state = state
params = {
"response_type": "code",
"client_id": CLIENT_ID,
"redirect_uri": URL(f='connected', scheme='http', host=HOST, url_encode=False),
"state": state,
}
authorize_url_0 = URL(a='oauth2', c='authorize', f='', vars=params, scheme='https', host='public-api.wordpress.com', url_encode=False)
# The web2py URL function inserts an (in this case) UNNEEDED reference to the current web2py app.
# This string function gets rid of that reference.
authorize_url = authorize_url_0.replace(APPNAME+'/', '',1)
thehtml = XML(
'<html><body><h2>Connect FROM YourWebsite.com TO WordPress.com</h2><a href="' +
authorize_url +
'"><img src="//s0.wp.com/i/wpcc-button.png" width="231" /></a></body></html>'
).xml()
return thehtml
def connected():
"""
1. Receive request.vars.code == a "time-limited code that your application can exchange for a full authorization token."
see: http://developer.wordpress.com/docs/oauth2/
This is a time-limited code that your application can exchange for a full authorization token.
To do this you will need to pass the code to the token endpoint by making a POST request to the token endpoint:
You are required to pass
client_id,
client_secret, and
redirect_uri for web applications.
These parameters have to match the details for your application, and
the redirect_uri must match the redirect_uri used during the Authorize step (above).
grant_type has to be set to "authorization_code".
2. Convert time-limited code into OAuth2 full authorization credentials.
[NOT SHOWN: how to store credentials in db]
3. For demo purposes, list the blog with the credentials.
"""
# 1. Receive request.vars.code
code = request.vars.code # returned from WordPress.com
if not code:
redirect(URL('index'))
# see [OAuth2 state Article on stackoverflow] (http://stackoverflow.com/questions/11071482/oauth2-0-server-stack-how-to-use-state-to-prevent-csrf-for-draft2-0-v20)
state = request.vars.state
if not state:
return dict(message='Warning! State variable missing after authorization.')
if (not session.state):
return dict(message='Warning! No session.atate! WHY NOT??? variable missing after authorization.')
if state != session.state:
return dict(message='Warning! State mismatch. Authorization attempt may have been compromised. This: ' + state + ' should be: ' + session.state)
# 2. Convert time-limited code
# TODO: Replace values client_id, client_secret with YOUR's, previously received from dev.WordPress.com setup.
payload = { 'client_id': CLIENT_ID,
'client_secret': 'YOUR.CLIENT.SECTET',
'redirect_uri': 'http://YOUR_WEBSITE.com/YOUR_APPNAME/default/connected',
'grant_type': 'authorization_code',
'code': request.vars.code,
}
# Call the token endpoint
rsp_token_request = requests.post("https://public-api.wordpress.com/oauth2/token", data=payload)
# 'Response [200]' means SUCCESS
if not 'Response [200]' in str(rsp_token_request):
return dict(message='Problem! "Response [200]" not in response!')
jsonDict = rsp_token_request.json()
access_token = jsonDict['access_token']
blog_id = jsonDict['blog_id']
blog_url = jsonDict['blog_url']
# TODO: [NO SHOWN] Store access_token, blog_id, blog_url in the db for further use.
# For demo purposes, we will use these credentials here, to list this blog.
base_url = 'https://public-api.wordpress.com/rest/v1/sites/' + blog_id
payload = {}
payload['http_envelope'] = 'true'
url_values = urllib.urlencode(payload)
full_url = base_url + '?' + url_values
req = urllib2.Request(full_url)
req.add_header('Authorization', 'Bearer ' + access_token)
rsp = urllib2.urlopen(full_url)
the_info_page = rsp.read()
m = ''
m += "the_info_page = %s||"%(the_info_page)
content = BEAUTIFY(m.split('||'))
return dict(content=content)
```
I omit model code in this article, assuming you can store your credentials for further use. If you needd assistance, contact me by a comment.
``` html
{{left_sidebar_enabled,right_sidebar_enabled=False,False}}
{{extend 'layout.html'}}
{{if 'content' in globals():}}
<h3>{{=content}}</h3>
{{pass}}
```


[text* your-name placeholder "Your Name"]
[tel* phone placeholder "Your Phone Number"]
[email* your-email placeholder "Your Email"]
[text* organization placeholder "Your Organiztion - if Applicable"]
[tel* phone placeholder "Daytime Phone"]
[text* subject placeholder "Contact Regarding"]
[textarea* messgae placeholder "Your Message"]
[submit class:btn "Send"]


Welcome. We exist to make entrepreneurship easier.
Full name
Email
Password
Sign up
Already have an account?
Login


COMMENTS SECTION
This section contains the collated comments from the IC personnel who reviewed the website screens. These were gathered during a series of walkthroughs and user acceptance tests conducted at the Commission. Note that major comments were immediately implemented, and are reflected in the screens shown in the previous section. Other comments will be revisited as the system is developed.
FINANCIAL EXAMINATIONS GROUP
-
Brokers
Company side:
- Change the input format for the schedules and summary; align the design with the format of the output
- Create an attachment column on companies' side for supporting documents/uploading of excel
Examiner’s side:
- Create an organizational structure for quarterly submissions. See Annual
- Remarks column on summary
-
HMO
Company Side:
- Question: What if the company wasn’t able to submit last quarter?
Answer: It will be noted in the status how many years or quarters the company is late.
Examiner Side:
- See compliance with Net worth, RBC, and ATR
- Instantly show all good companies
- Fix data tables
-
Add total assets, total liabilities, net worth, share capital, adjustments, accounted and not accounted in the view action
-
Life/MBA/Trust
Company Side:
Issues on composite companies
- 2 Annual Statement submissions
- 2 Quarterly Submissions
- Add another non-life database for composite companies
- Checklist for MBA
Status Terms:
- In process
- For payment and Pick - up
Quarterly Submission Columns (Summary)
- Net worth, RBC2, etc
-
Real-time generation of report for Examinations
-
Non-Life
Company Side
- Annual Statement Checklist (to be discussed further)
- In the view history:
The company should be able to see the file they have submitted (add a link for a preview (only) of submission) - Status for certificate request as well as the payment amount
- Status Terms:
In process
For Payment and Pick - Up
Examiner Side
- Certification Request
Display number of companies who submitted as of the deadline (annual and quarterly)
Pick up for Certificate Request (to be discussed further) - Status Terms
In process
For Payment and Pick - Up
- Pick up details / Remarks / Claim Stub / Link to Cashier for Order of Payment (for discussion)
- Annual Statement Submission
Columns:
- Company Name, Assets, Liabilities, Net Worth
- Real-time generation of the report (changes in net worth, etc)
-
Pre-Need Division
Company side:
- Quarterly: Trust fund has maximum of three separate Balance Sheet and Income Statement for the plans: Life/Memorial, Pension, Education
- Per line item, there will be a working balance sheet
- Collections submission: Remove the Planholders’ Outstanding Balance Table
- Add feature for viewing of outstanding balance per unique number of plan
Examiner side:
- Create an organizational structure for the submissions.
TECHNICAL SERVICES GROUP
-
Statistics and Research Division
Company Side:
- No Comment
Examiner Side:
General Comments:
- Annual Statements and Quarterly Statements from FEG are not yet ok, Annual and Quarterly Statements of FEG side should be first completed before they comment on it.
- Industry Summary should also be shown (convert the Card List into tables with columns)
Specific Comments:
Selected Financial Statement Process
Similar for all:
- Total Assets
- Total Liabilities
- Total Networth/ Fund Balance
- Total Investments
- Net Income
- Premiums Earned
Specific to Life
Business Done
- Number of Policies
- Number of Certificates
- Number of Insured Lives
- Number of Sum Assured
Premiums By Type
- Total Premiums and Considerations New Business: First Year
- Total Premiums and Considerations New Business: Single
- Total Premiums and Considerations Renewal
- Total Premiums and Considerations Direct Business
- Total Reinsurance Premiums Assumed
- Total Reinsurance Premiums Ceded
- Total Premiums and Considerations
Specific to Non-Life
Business Done
- Number of Policies per Business Line
- Number of Insured Lives per Business Line
- Premiums Earned per Business Line
- Losses Incurred per Business Line
Specific to MBA
Business Done
Basic Fund:
- Number of Certificates, Members and Dependents
- Total Amount of Insurance: Members and Dependents
- Optional Fund (Micro Products and Other Than Micro Products are separated):
- Number of Policies (Individual, Insurance Policies and Certificates)
- Number of Amount of Insurance
Basic Member Benefits:
- Total Number of Claims
- Total Amounts Paid
Optional Insurance:
- Total Number of Claims
- Total Amounts Paid
Agency Hired Migrant Workers:
- To be emailed
-
Rating Division
Company Side:
CTPL
- Monthly Submissions Dapat
- COCAF and OICP are the only groups who submit to this
- It depends in DOTR if the companies will submit individually or the COCAF and OICP only
- For discussion with the Deputy Commissioner but for now, retain current design
Quarterly - Total Loss:
- A company can't submit a vehicle in subrogation if it is declared in nonrestorable. can't also submit if the vehicle is not in restorable
Quarterly - FST:
- Row input per OR and place of payment
- Include schedule (computation for the all the OR)
Examiner Side:
General Comments
- Fix Column names and data shown
Specific Comments
PPAI
- Grand Total Vehicle Insured
- Grand Total Basic Premium
- Grand Total Incidents
- Grand Total Count for Death, Medical and Disability
Offsite - Total Loss
- Current Submission # of Restorable/ Unrestorable/ Subrogation
- Running Total of # of Restorable/ Unrestorable/ Subrogation
- Want to have: screen for all submissions of company
Offsite - Adjuster
- Current Submission # of Reported Pending/ Finished
- Running Total of # of Reported Pending/ Finished
- Want to have: screen for all submissions of company
Offsite - FST
- Agency place where OR is paid
-
Investment Division
Company Side:
- Include Covering Letter
- Letter Request to cover how much he/she wants to invest, others
- Some entities such as <Financial Institutions, Banks> also request to investment
- Paulo’s Suggestion: Edit submission requirement and attach additional instructions for companies who will submit a request to investment
- SPUCRI screens, data flow diagram, and database design
- Link of submitted files in the history for downloading
- View days delayed
Status Terms
- Processing
- Ready for Payment
- For Releasing
- Completed
Examiner Side:
- Filter submission by the examiner
- Assignment Roles
- Letter Reply to be print and sign by the commissioner the send back to the company
- Generate Tracking Number
- Approval of Investment: Additional Column and remove the deadline
Status Terms
- Processing
- Ready for Payment
- For Releasing
- Specific bond, company, etc then total
-
Actuarial Division
Company Side:
- Non-expeditious upload files include supporting submission per product instead of separate supporting submissions card
- Request: For examiners to be able to edit/change uploadable files
- Unify Status and FIO Status: New | Pending | FIO | Approval
- Request: Add Status Column to Company Submissions where examiner can add/comment whatever supporting documents the companies need to submit
- Request: Upon error, display contact person/email/number
Examiner Side:
- Add Column "company type"
- Add: Status of Submission
-
Reinsurance Division
Company Side:
For Approval of Facultative Placements Abroad form,
create functionality in which company can add rows for the:
- name of reinsurer/broker
- resident agent
- list of securities of Broker
Examiner Side:
- Create organizational structure for the list of outputs. (i.e. can be sorted by date submitted or by name of company)
LEGAL SERVICES GROUP
-
Regulation, Enforcement, and Prosecution Division (REPD)
Staff Side:
- Change the type of form and type of product to a drop-down
-
Public Assistance and Mediation Division (PAMD)
Staff Side:
- Change drop-down to a table with searching function (for company list)
- Edit output form columns
- Change Industry type to Company Type
- Remarks
Status type: Terminated and Settled
1. If settled
- Status, Date of Settlement, and amount
2. If terminated
- Status and Date Terminated
- Policy number / Contract Number
-
Licensing Division
The company profile could be edited, updated and can add additional details (when permitted to do so)
If a company will edit their profile, they will put the edited data but should be checked by the staff of licensing for approval
Historical data (for clarification) but not included in this phase
Company type
Add license status
- active
- inactive
- with pending application
- under conservatorship
- under receivership
- under liquidation
- others (add input type)
- add remarks in status
- add history when and who edited the status
when company link is clicked in the table, it will redirect to a page that shows the company profile
-
Conservatorship, Receivership, and Liquidation Division (CRL)
No comments
-
Claims Adjudication Division (CAD)
Input
- If the type is chosen, add input type:
- Date Due (D) - date
- Date of Hearing (H) - date and time - If the type drop-down is clicked, the status will be shown.
- Initial Status
- Summons Issued
Output
New Tab
- Summary
Add column action (Update Case)
- Calendar of Hearings (Date of Hearing only)
Date and Time
Case Number
Type
Complainant
Respondent
Hearing officer
Stenographer
Status
Remarks
- Calendar of Due (Date Due only)
Case Number
Type
Complainant
Respondent
Stenographer
Hearing Officer
Date
Days Pending
Dismissed and Decided are not included in the D or H
-
Suretyship Section
No comments
- Microinsurance ---------------------------
No comments


Home
Ask
Answer
Q|Anonymous
Settings
Log Out
Questions for
you
{{^result.rows}}
Looks like there're no new questions...
{{/result.rows}}
{{#result.column1}}
{{question}}
Answer
send
{{/result.column1}}
{{#result.column2}}
{{question}}
Answer
send
{{/result.column2}}
{{#result.column3}}
{{question}}
Answer
send
{{/result.column3}}


Models
In this section we will learn how to validate the model state and assert the action result models.
Model state validation
The "ModelStateDictionary" class is commonly used in a typical MVC application when the request method is "POST". In the previous section we wrote this test specifying the model state error manually:
var model = new ChangePasswordViewModel
{
OldPassword = "OldPass",
NewPassword = "NewPass",
ConfirmPassword = "NewPass"
};
MyController<ManageController>
.Instance()
.WithSetup(controller => controller.ModelState
.AddModelError("TestError", "TestErrorMessage"))
.Calling(c => c.ChangePassword(model))
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Same(model, viewResult.Model));
To skip the manual arrange of the model state dictionary, we can use the built-in validation in My Tested ASP.NET Core MVC. It is quite easy to do - the testing framework will validate all models passed as action parameters by default. If you examine the "ChangePasswordViewModel", you will notice the two required properties - "OldPassword" and "NewPassword". So, if we provide our action method with 'null' values for these two model properties, My Tested ASP.NET Core MVC will validate them by using the registered services in the "TestStartup" class we created earlier. So let's change the view model, remove the "WithSetup" call, and run the test again:
var model = new ChangePasswordViewModel(); // <---
MyController<ManageController>
.Instance()
.Calling(c => c.ChangePassword(model))
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Same(model, viewResult.Model));
The test still passes but if we examine the "ChangePassword" action, we will notice that the same result is returned from the action when the password fails to change. In other words - we are not sure which case is asserted with the above test. We can easily fix the issue by using the following line:
.ShouldPassForThe<Controller>(controller
=> Assert.Equal(2, controller.ModelState.Count))
However, there is always a better way! Go to the "MusicStore.Test.csproj" file and add "MyTested.AspNetCore.Mvc.ModelState" as a dependency:
<!-- Other ItemGroups -->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers" Version="2.2.0" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers.ActionResults" Version="2.2.0" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers.Views" Version="2.2.0" />
<!-- MyTested.AspNetCore.Mvc.ModelState package -->
<PackageReference Include="MyTested.AspNetCore.Mvc.ModelState" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
<!-- Other ItemGroups -->
Besides the "ShouldReturn", there is another very helpful method - "ShouldHave". With "ShouldHave" you can test different kinds of components after the action has been invoked. In our case we want to check whether the model state has become invalid, so we need to add:
.ShouldHave()
.InvalidModelState()
These lines will validate whether the model state is invalid after the action call. By providing an integer to the method, you can specify the total number of expected validation errors. Moreover, you can easily combine them with "ShouldReturn" by using "AndAlso":
var model = new ChangePasswordViewModel();
MyController<ManageController>
.Instance()
.Calling(c => c.ChangePassword(model))
.ShouldHave() // <---
.InvalidModelState(withNumberOfErrors: 2)
.AndAlso() // <---
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Same(model, viewResult.Model));
Rebuild the project and run the test to see it pass successfully. If you change the "InvalidModelState" call to "ValidModelState", you can see a nice descriptive error message:
When calling ChangePassword action in ManageController expected to have valid model state with no errors, but it had some.
If you want to be more specific, the fluent API allows testing for specific model state errors:
.ShouldHave()
.ModelState(modelState => modelState
.ContainingError(nameof(ChangePasswordViewModel.OldPassword))
.ThatEquals("The Current password field is required.")
.AndAlso()
.ContainingError(nameof(ChangePasswordViewModel.NewPassword))
.ThatEquals("The New password field is required.")
.AndAlso()
.ContainingNoError(nameof(ChangePasswordViewModel.ConfirmPassword)))
.AndAlso()
There is a better way to test for specific model state errors, but more on that later (as always in this tutorial). :)
Most of the time you will want to run the validation during the action call. However, if you don't want for some reason, add "MyTested.AspNetCore.Mvc.DataAnnotations" to your "MusicStore.Test.csproj" file and call ""WithoutValidation"" on the tested controller.
Action result models
To test action result models, you need to add "MyTested.AspNetCore.Mvc.Models" as a dependency of the test assembly:
<!-- Other ItemGroups -->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers" Version="2.2.0" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers.ActionResults" Version="2.2.0" />
<PackageReference Include="MyTested.AspNetCore.Mvc.Controllers.Views" Version="2.2.0" />
<!-- MyTested.AspNetCore.Mvc.Models package -->
<PackageReference Include="MyTested.AspNetCore.Mvc.Models" Version="2.2.0" />
<PackageReference Include="MyTested.AspNetCore.Mvc.ModelState" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
<!-- Other ItemGroups -->
By adding the above package, you will add another set of useful extension methods for all action results returning a model object. First, remove these lines from the "ChangePassword" test:
.ShouldPassForThe<ViewResult>(viewResult =>
Assert.Same(model, viewResult.Model));
Good! Now back to those extension methods - the first one is "WithNoModel", which asserts for exactly what it says (as every other method in the library, of course) - whether the action result returns a 'null' model. Add the method in the "View" call, rebuild the project and run the test to see what happens:
var model = new ChangePasswordViewModel();
MyController<ManageController>
.Instance()
.Calling(c => c.ChangePassword(model))
.ShouldHave()
.InvalidModelState()
.AndAlso()
.ShouldReturn()
.View(result => result
.WithNoModel()); // <---
We should receive error message with no doubt - our action returns the same model after all:
When calling ChangePassword action in ManageController expected to not have a view model but in fact such was found.
Obviously, this is not the method we need. :)
From here on we have two options - testing the whole model for deep equality or testing just parts of the model (the ones we care the most).
Let's see the deep equality:
.View(result => result
.WithModel(model));
Since we expect the action to return the same view model as the one provided as an action parameter, we just pass it to the "WithModel" method, and it will be validated for us. Note that this test will also work:
var model = new ChangePasswordViewModel
{
ConfirmPassword = "TestValue"
};
MyController<ManageController>
.Instance()
.Calling(c => c.ChangePassword(model))
.ShouldHave()
.InvalidModelState()
.AndAlso()
.ShouldReturn()
.View(result => result
.WithModel(new ChangePasswordViewModel
{
ConfirmPassword = "TestValue"
}));
Although the models are not pointing to the same instance, My Tested ASP.NET Core MVC will validate them by comparing their properties deeply. It works perfectly with interfaces, collections, generics, comparables, nested models and many more object types.
Although it is cool and easy to use the deep equality assertion, most of the time it is not worth it. Models which have a lot of data may need a lot of code to make the test pass successfully. Supporting such huge objects is also a tedious task.
Introducing the last model assertion options - "WithModelOfType" and "Passing". These two methods combined can give you enough flexibility to test only what you need from the model object. "WithModelOfType" allows you to test only for the type of the action result model so let's use it instead of "WithModel":
.View(result => result
.WithModelOfType<ChangePasswordViewModel>());
The test will pass if you run it, but you still need to assert whether the returned model was the same as the parameter one. Luckily, the "Passing" method takes a delegate which tests the action result model, allowing you to be as specific in your assertions as you see fit:
var model = new ChangePasswordViewModel();
MyController<ManageController>
.Instance()
.Calling(c => c.ChangePassword(model))
.ShouldHave()
.InvalidModelState()
.AndAlso()
.ShouldReturn()
.View(result => result
.WithModelOfType<ChangePasswordViewModel>()
.Passing(viewModel => viewModel == model));
Aaaand... our work here is done (this time for real)! :)
Section summary
This section covered an important part of the testing framework. Almost all actions in ASP.NET Core MVC use various types of request or response models. You will see more examples for model assertions in the tutorial but for now, let's move to one of the most significant components of a typical web application - the Database!


|
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
HDF5 model part operations. More...
Classes | |
| class | IOOperation |
| Base class for HDF5 IO operations. More... | |
| class | ModelPartIOOperation |
| Base class for HDF5 IO operations on ModelPart s. More... | |
| class | ModelPartInput |
| Reads a ModelPart from a file. More... | |
| class | ModelPartOutput |
| Writes a ModelPart to a file. More... | |
| class | PartitionedModelPartOutput |
| Writes a partitioned model part to a file. More... | |
| class | ProcessInfoIOOperation |
| class | ProcessInfoOutput |
| Writes a ProcessInfo to a file. More... | |
| class | ProcessInfoInput |
| Reads a ProcessInfo from a file. More... | |
| class | VariableIOOperation |
| Generates json settings for variable data IO. More... | |
| class | ElementDataValueOutput |
| Writes non-historical element data values to a file. More... | |
| class | ElementDataValueInput |
| Reads non-historical element data values from a file. More... | |
| class | ElementFlagValueOutput |
| Writes non-historical element flag values to a file. More... | |
| class | ElementFlagValueInput |
| Reads non-historical element flag values from a file. More... | |
| class | ElementGaussPointOutput |
| Write element integration point values to a file. More... | |
| class | ConditionDataValueOutput |
| Writes non-historical element data values to a file. More... | |
| class | ConditionDataValueInput |
| Reads non-historical element data values from a file. More... | |
| class | ConditionFlagValueOutput |
| Writes non-historical element flag values to a file. More... | |
| class | ConditionFlagValueInput |
| Reads non-historical element flag values from a file. More... | |
| class | ConditionGaussPointOutput |
| Write condition integration point values to a file. More... | |
| class | NodalSolutionStepDataOutput |
| Writes nodal solution step data to a file. More... | |
| class | NodalSolutionStepDataInput |
| Reads nodal solution step data from a file. More... | |
| class | NodalDataValueOutput |
| Writes non-historical nodal data values to a file. More... | |
| class | NodalDataValueInput |
| Reads non-historical nodal data values from a file. More... | |
| class | NodalFlagValueOutput |
| Writes non-historical nodal flag values to a file. More... | |
| class | NodalFlagValueInput |
| Reads non-historical nodal flag values from a file. More... | |
| class | PrimalBossakOutput |
| Writes nodal solution step data to a file for Bossak time schemes. More... | |
| class | PrimalBossakInput |
| Reads nodal solution step data from a file. More... | |
| class | MoveMesh |
| Perform a mesh move operation on a model part. More... | |
| class | AggregateOperation |
| Class for aggregating HDF5 IO operations on the same file. More... | |
Functions | |
| def | Prefix (pattern, model_part, time_format='') |
| "list[type]" | GetSubclasses (type base_class) |
| Recursively find all subclasses of a base class. More... | |
| AggregateOperation | Create (KratosMultiphysics.Model model, typing.Union[KratosMultiphysics.Parameters, ParametersWrapper] settings) |
| Return the operation factory specified by the setting 'operation_type'. More... | |
HDF5 model part operations.
license: HDF5Application/license.txt
| AggregateOperation core.operations.model_part.Create | ( | KratosMultiphysics.Model | model, |
| typing.Union[KratosMultiphysics.Parameters, ParametersWrapper] | settings | ||
| ) |
Return the operation factory specified by the setting 'operation_type'.
If the 'operation_type' is not found and the settings have a 'module_name', the module is imported and used to create the operation. If 'module_name' is not found, an exception is raised. Empty settings will contain default values after returning from the function call.
| "list[type]" core.operations.model_part.GetSubclasses | ( | type | base_class | ) |
Recursively find all subclasses of a base class.
| def core.operations.model_part.Prefix | ( | pattern, | |
| model_part, | |||
time_format = '' |
|||
| ) |


| | |
- __builtin__.object
-
- InstallerAutounattendFileContent
- __builtin__.tuple(__builtin__.object)
-
- ElementAttributeNameValue
- nrvr.diskimage.isoimage.IsoImage(__builtin__.object)
-
- WinUdfImage
class ElementAttributeNameValue(__builtin__.tuple) |
| |
ElementAttributeNameValue(elementName, attributeName, attributeValue) |
| |
- Method resolution order:
- ElementAttributeNameValue
- __builtin__.tuple
- __builtin__.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new OrderedDict which maps field names to their values
- _replace(_self, **kwds)
- Return a new ElementAttributeNameValue object replacing specified fields with new values
Class methods defined here:
- _make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
- Make a new ElementAttributeNameValue object from a sequence or iterable
Static methods defined here:
- __new__(_cls, elementName, attributeName, attributeValue)
- Create new instance of ElementAttributeNameValue(elementName, attributeName, attributeValue)
Data descriptors defined here:
- attributeName
- Alias for field number 1
- attributeValue
- Alias for field number 2
- elementName
- Alias for field number 0
Data and other attributes defined here:
- _fields = ('elementName', 'attributeName', 'attributeValue')
Methods inherited from __builtin__.tuple:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __sizeof__(...)
- T.__sizeof__() -- size of T in memory, in bytes
- count(...)
- T.count(value) -> integer -- return number of occurrences of value
- index(...)
- T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
|
class InstallerAutounattendFileContent(__builtin__.object) |
| |
The text content of a Windows installer autounattend.xml file for use with a Windows installer. |
| |
Methods defined here:
- __init__(self, string)
- Create new autounattend file content container.
This constructor does unicode(string).
- acceptEula(self, fullname, organization=None, productkey=None)
- Accept software license terms.
fullname
according to documentation should be name of the end user.
organization
according to documentation should be name of the organization that owns the computer.
Some value has to be provided.
If None then default to fullname.
productkey
according to documentation should be a product key.
If None then do not change value.
A product key contains settings that specify which edition to install.
This probably is a legal matter and you may have to figure this out between yourself,
the supplier of the operating system which you are installing, and counsel you may employ.
Warnings aside, this could be quite simple. Enterprises apparently have license agreements
in place with the supplier of the operating system which you are installing.
And, many computers are sold bundled with valid licenses already.
And, licenses can be bought.
return
self, for daisychaining.
- addFirstLogonCommand(self, order, commandLine, description='')
- Add a command to run the first time a user logs on to the computer.
This is to run a service or command that needs to finish before other commands can start, a synchronous command.
A synchronous command is run after logon but before the user sees the desktop.
order
an integer from 1 through 500.
commandLine
commandLine.
Escapes '&', '<', and '>'.
description
description.
May be empty string.
Escapes '&', '<', and '>'.
return
self, for daisychaining.
- addLocalAccount(self, username, pwd, fullname, groups)
- Add a local account.
username
username.
pwd
password.
May be empty string.
fullname
full name.
groups
a list of groups, e.g. ["Administrators"].
return
self, for daisychaining.
- addLogonCommand(self, order, commandLine, description='')
- Add a command to run the first time a user logs on to the computer.
This is to run a service or command that can start at the same time as others, an asynchronous command.
order
an integer from 1 through 500.
commandLine
commandLine.
Escapes '&', '<', and '>'.
description
description.
May be empty string.
Escapes '&', '<', and '>'.
return
self, for daisychaining.
- addNetworkConfigurationStatic(self, mac, ipaddress, netmask='<IP_ADDRESS>', gateway=None, nameservers=None, limitRoutingToLocalByNetmask=False)
- Add an additional network device with static IP.
As implemented only supports IPv4.
mac
the MAC, e.g. "01:23:45:67:89:ab" or "01-23-45-67-89-AB".
ipaddress
IP address.
netmask
netmask.
Defaults to <IP_ADDRESS>.
gateway
gateway.
If None then default to ip.1.
nameservers
one nameserver or a list of nameservers.
If None then default to gateway.
If empty list then do not add any.
return
self, for daisychaining.
- adjustFor32Bit(self)
- Adjust for 32-bit.
return
self, for daisychaining.
- adjustFor64Bit(self)
- Adjust for 32-bit.
return
self, for daisychaining.
- enableAutoLogon(self, username, pwd)
- Enable automatic logon.
username
username.
pwd
password.
May be empty string.
return
self, for daisychaining.
- replaceAdminPw(self, pwd)
- Replace administrator password.
return
self, for daisychaining.
- replaceComputerName(self, computerName)
- Replace computer name.
return
self, for daisychaining.
- replaceLanguageAndLocale(self, languageAndLocale)
- Replace language and locale.
languageAndLocale
e.g. "de-DE" to replace "en-US".
As implemented does not do any sanity checking.
return
self, for daisychaining.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- string
- The whole content.
|
class WinUdfImage(nrvr.diskimage.isoimage.IsoImage) |
| |
A Windows installer UDF DVD-ROM disk image. |
| |
- Method resolution order:
- WinUdfImage
- nrvr.diskimage.isoimage.IsoImage
- __builtin__.object
Methods defined here:
- __init__(self, isoImagePath)
- Create new Windows installer WinUdfImage descriptor.
A descriptor can describe an .iso image that does or doesn't yet exist on the host disk.
- cloneWithAutounattend(self, _autounattendFileContent, modifications=[], cloneIsoImagePath=None)
- Clone with autounattend.xml file added and modified to automatically boot with it.
For more on behavior see documentation of class IsoImage method cloneWithModifications.
For details of modifications see method modificationsIncludingAutounattendFile,
which might be different per Windows version specific subclass.
_autounattendFileContent
An InstallerAutounattendFileContent object.
If None then proceed nevertheless.
modifications
a list of additional IsoImageModification instances.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
IsoImage(cloneIsoImagePath).
- cloneWithModifications(self, modifications=[], cloneIsoImagePath=None, udf=True, ignoreJoliet=False, pause=False)
- Clone with any number of instances of IsoImageModification applied.
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
modifications
a list of IsoImageModification instances.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
WinUdfImage(cloneIsoImagePath).
- genisoimageOptions(self, bootImage='boot.bin', label=None, udf=True, ignoreJoliet=False)
- Auxiliary method, called by cloneWithModifications.
Can be overridden by subclass methods genisoimageOptions,
which may want to extend the returned list.
Could be improved in the future.
Could recognize content of .iso image.
Could select different options depending on content of .iso image.
Maybe could use iso-info -d 9 -i self.isoImagePath.
Could be overridden for a subclass.
- modificationForElToritoBootImage(self)
- Construct and return an instance of IsoImageModification, to be processed
by method cloneWithModifications.
As implemented copies El Torito boot image from sectors into a file.
- modificationMakeEiCfg(self, editionId, oem=False, volumeLicense=False)
- Construct and return an instance of IsoImageModification, to be processed
by method cloneWithModifications.
As implemented writes a new sources/ei.cfg file from scratch.
editionId
a string.
For Windows 7 one of "Starter", "HomeBasic", "HomePremium", "Professional", "Ultimate", "Enterprise".
For Windows 8 one of "Core", "Professional", "ProfessionalWMC", "Enterprise".
- modificationsIncludingAutounattendFile(self, _autounattendFileContent)
- Construct and return a list of modifications to be passed to method cloneWithModifications.
This method is called by method cloneWithAutounattend, which takes the returned list
and passes it to method cloneWithModifications.
Subclasses may provide further implementations of this method.
Possibly different per Windows version specific subclass.
This class implementation does return an essential list.
_autounattendFileContent
An InstallerAutounattendFileContent object.
If None then proceed nevertheless.
Return a list of modifications which will be passed to method cloneWithModifications.
Class methods defined here:
- commandsUsedInImplementation(cls) from __builtin__.type
- Return a list to be passed to SystemRequirements.commandsRequired().
This class can be passed to SystemRequirements.commandsRequiredByImplementations().
Methods inherited from nrvr.diskimage.isoimage.IsoImage:
- cloneWithModificationsUsingMount(self, modifications=[], cloneIsoImagePath=None, udf=False, ignoreJoliet=True, pause=False)
- Clone with any number of instances of IsoImageModification applied.
This is an older implementation which regrettably because of the mount command requires
having superuser privileges.
It is still here in case a newer implementation doesn't work right, which could be for any
of a number of reasons, for example for symbolic links.
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
modifications
a list of IsoImageModification instances.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
IsoImage(cloneIsoImagePath).
- copyToDirectory(self, copyDirectory, udf=False, ignoreJoliet=True, tolerance=0.0)
- Copy all files into a directory.
Not using mount command, no need to run as root.
- exists(self)
- Return True if .iso image exists on the host disk.
- mount(self, mountDir, udf=False)
- Mount .iso image.
- remove(self)
- Remove (delete) .iso image from the host disk.
- unmount(self)
- Unmount .iso image.
Data descriptors inherited from nrvr.diskimage.isoimage.IsoImage:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- isoImagePath
- Path of the .iso image.
| |


Lost
Well, that's what I did at 10-pin bowling in Ballina.
Nice little town about 30km south of here.
I did ok at the start, but then I trailed off
appaulingly, ending up with a score not much better than Bec;
she had the novel girlie-style technique of walking up to the lane,
then two-handedly pushing the ball toward the pins.
But more often then not she suceeded!
The best bit, though, was the psychedelic colours of the pins when
they turned the lights down, and the balls also lit up.
Always a bonus.
Then I hung out at Bay FM again for a bit. Toptechnotastic.
Spent the 9th very chilled out on the beach, polishing off some
stories by Arthur Miller, but spent the 10th cleaning, doing the bins, etc.
It's also "lost" because I woke up today a bit confused - I thought it was the 12th, and couldn't quite get it when I realised it was the 13th. So somewhere I've lost a day, doing something. I hope it was interesting. Hopefully, someone will fill me in.
Adaptive Medusa
Back to the main page


Copy this url (click on it) and share it with anyone you want to let them fill your survey!
{{genericLink}}


Contact
About
My profile
Edit story name
Title
Description
Acceptance criteria
Efort
Delete
Cancel
Save


test target root
view source
run tests
these tests are targeting:
choose a different server to target


UPCOMING EVENT CONTRARY TO POPULAR BELIEF
"The Law Demands, but Grace Supplies" - Paster J.P.
Our Services
Contrary to popular belief, Lorem Ipsum is not simply random text.
Divine Liturgy
Pellentesque ultricies congue lacus, eget elementum erat lobortis et.Sed non velit neque.erat lobortis et.
Workship
Pellentesque ultricies congue lacus, eget elementum erat lobortis et.Sed non velit neque.erat lobortis et.
Garter
Pellentesque ultricies congue lacus, eget elementum erat lobortis et.Sed non velit neque.erat lobortis et.
Easter Vigil
Pellentesque ultricies congue lacus, eget elementum erat lobortis et.Sed non velit neque.erat lobortis et.
Our Pastors
James Dunlop
Head of the Department
Richard Wyane
Head of the Department
Thomas
Head of the Department
Peter Paul
Head of the Department
Seeking God. Sharing Life. Serving Others.
"I will not offer to the Lord my God sacrifices that have cost me nothing."
Visit MoreWelcome
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi hendrerit elit turpis, a porttitor tellus sollicitudin at. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi hendrerit elit turpis, a porttitor tellus sollicitudin at. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi hendrerit elit turpis, a porttitor tellus sollicitudin at.
Why Us?
Our Vision
Who we are?
What we do?
Francis
Pope Francis is the 266th pope of the Catholic Church, having served from 2013.
The pope and the Vatican will be hoping that their denials and Jalics's late intervention will finally lay the matter to rest and allow Francis to begin his papacy in earnest. But even should the clamour from within Argentina die down, Francis has other critics to face from the order for which he was ordained: the Society of Jesus.
Products
Popular Sermons
Contrary to popular belief, Lorem Ipsum is not simply random text.
Church Events
Pastoral Council
At vero eos et accusamus et iusto oadio dign issimos ducimus qui blanditiis praesentium ah sigmore lipsum.
Parishioners Meeting
Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.
Scripture Study
Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in Aenean imperdiet.
Holy Hour
At vero eos et accusamus et iusto odio dign issimos ducimus qui blanditiis praesentium ah sigmore lipsum.
Youth Choir Practice
Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.
Gallery
Photography
Excitement
Vougue Style
Photography
Aenean leo
Events
Golden Days
Excitement
Lorem Ipsum
Photography
Help children
Events


Check out what you can do with this app!
Keep track of what you're eating with our nutrition database!
Getting nutritional facts is as easy as taking a picture with Strive!
Be rewarded for good eating habits!
Compete with friends and people near you to push you to be healthy!


Spark
Edit (pull request)Prerequisites
In this page, we will use AWS features so you will need a Kubernetes cluster integrated with a AWS account. However if you want to deploy a basic Kubernetes cluster you can use our TOSCA types based on kubeadm which can be found here
To deploy onto Kubernetes cluster through ALIEN, you will need:
- A Kubernetes cluster deployed on AWS with AWS extensions (ability to provision EBS) with at least 2 nodes
- An alien with:
- the kubernetes plugin
- the http repository plugin (the samples use an http repository)
- the following archives imported from GIT:
- https://github.com/alien4cloud/tosca-normative-types.git branch 3.0.x
- https://github.com/alien4cloud/alien4cloud-extended-types.git branch 3.0.x folder alien-base-types
- https://github.com/alien4cloud/docker-tosca-types.git 3.0.x folder docker-types
- A runnable distribution of Spark 2.3 or above.
- more information about Spark running on Kubernetes can be found here
- It is necessary to create in the namepace where Spark jobs will be run the following assets :
- serviceaccount
- role
- rolebinding The scripts to execute are available here
Topology modifiers
You’ll need to setup modifiers on your location. On the location screen, in the Topology Modifier tab:
- add a k8s-spark-jobs-modifier at the phase
post-matched-node-setup
after the kubernetes-adapter-modifier
The modifier will generate types that are ready to be deployed and run onto a Kubernetes cluster.
On demand resources
You will need to setup some Kubernetes On demand resources on the location. You will find them in the catalog (search for ‘kube’) :
org.alien4cloud.k8s.spark.jobs.PythonSparkJob
: it will be used to match and optionally configure and run Python Spark jobs.org.alien4cloud.k8s.spark.jobs.JavaSparkJob
: it will be used to match and optionally configure and run Java Spark jobs.
For volumes, you can add the followings resources :
org.alien4cloud.kubernetes.api.types.volume.AWSElasticBlockStoreVolumeSource
org.alien4cloud.kubernetes.api.types.volume.EmptyDirVolumeSource
org.alien4cloud.kubernetes.api.types.volume.HostPathVolumeSource
org.alien4cloud.kubernetes.api.types.volume.PersistentVolumeClaimSource
We will explain these different kind of K8S volumes implementations.
A simple Pi Spark job
Creation of a topology with 2 nodes : - KubeCluster - org.alien4cloud.k8s.spark.jobs.PythonSparkJob
The following properties need to set: - pythonVersion : usually set to 3 - containerName : url of a container spark. - debugOperation : boolean. It can be selected to see debug operations
The application can be deployed. The job spark can ba launching by execution the run workflow operation :
During the execution, if the property debugOperation has been set, the spark-submit command can be displayed in the deployment logs.
Since 1.15 Kubernetes version, it is necessary to use at least Spark 2.4.5 version. Highest supported version by A4C is Spark 3.0.1.


Include a link to this extension's Options at end of context menu
Newly created items have "Activate New Tab" setting checked
Save To File
Load From File
Item
Group
Separator
Save
Settings Saved
Add New Item
×
Display Name
URL (add %s where the selected text should go)
Add Another
Standard
Last Tab
Same Tab
Incognito
Activate New Tab
Encode Selected Text
Add New Group
×
Display Name
Presets
×
Web Search
Ask
Wikipedia EN
Web Search
Ask
Wikipedia EN
Web Search
Ask
Wikipedia EN


Issue 117
Welcome to another issue of Haskell Weekly!  This is a weekly summary of what’s going on in its community.
Featured
-
A practical introduction to finger trees
Finger trees are definitely the coolest data structure I was never taught in school. The gist of finger trees is that they represent sequences of elements where the elements also have a measurable “descriptor” of some kind.
-
sv
, a CSV library for Haskell by the Queensland Functional Programming Lab, was released over four months ago. Since then, we’ve had feedback on what potential users want from the library, and we have altered the design to the point where we are now releasing a new version:sv
1.0. -
Bake delicious macaroon burritos with Servant
I’ve had the pleasure to find a team already enjoying the use of macaroons. One of my first missions was to improve how they were used to authorize API calls, in the context of Servant applications. After a few iterations, we’ve settled on a design I’m quite happy with.
-
Dependent typing and existential (de)serialization
One of Haskell’s present limitations is the lack of dependent types, meaning that the return type of a function cannot depend on the value of its inputs. This can be a frustrating restriction when dealing with serialized data or other untyped inputs.
-
Haskell & AppVeyor Chocolatey introduction
For those who are unaware, Windows has had quite a push lately to provide script-able ways to install packages. One such attempt that has gained quite a lot of traction is Chocolatey. Chocolatey also contains some of my own packages for installing GHC and Cabal.
-
Merge-free synchronisation with
mergeless
Synchronisation between a client and a server has been a problem that I have been brewing on in the back of my mind for a long time now. Today I am releasing a Haskell library that helps with exactly this problem.
-
Pantry, part 2: Trees and keys
This is part two of a series of blog posts on Pantry, a new storage and download system for Haskell packages. In March of last year, there was a bug on Hackage. The problem was resolved, but this made me wonder: Is there any reason why checksums should depend on inconsequential artifacts of the tar format?
-
Smuggler: GHC source plugin to manage import section
Hello everyone! We want to announce the first alpha version of
smuggler
— the compiler plugin which removes unused imports automatically. Though we’re planning to add more features to help you manage the import sections easily! -
The problem of parsing large datasets
In data processing, the volume of data can be so large that the amount of time it takes to process a file matters. In my work, I try to optimize such jobs so that it is more efficient, but surprisingly, it is often not the business logic that is the bottleneck, but the parsing of files itself that consumes large amounts of CPU and memory.
-
WebGL, Fragment Shader, GHCJS and
reflex-dom
On the side and very slowly I am working on a little game that involves breeding spherical patterns. I want to implement it in Haskell, but have it run in the browser, so I reached for GHCJS, the Haskell-to-JavaScript compiler.
Jobs
-
Wire is hiring a Haskell developer in Berlin
The backend team is pretty small (just four people) and recently we’ve been overwhelmed with work, which is exciting — but, admittedly, having a life is even more exciting, which is why we’re looking for: an intermediate-level Haskeller to work with us on the backend
-
Here Technologies is hiring a Haskell developer in Berlin
We are looking for Haskell developers with an interest in testing and formal methods. The job involves further developing and making use of the quickcheck-state-machine library, to perform state machine based end-to-end testing.
-
Kadena is hiring a Haskell developer in New York
Located in New York, Kadena is utilizing the power of blockchain, Haskell, and their own smart contract language to solve business problems. Love Haskell and love Blockchain? Helluva role for you!
In brief
- Adjoint open source
- Edward Kmett: Haskell live-coding: Session 6: CEK machines
- Forvis: A formal RISC-V ISA specification
- Making the jump: Advancing past beginner Haskell
- Popularity of Haskell extensions
- Silver Searcher: Useful regexes for a Haskell code base
- Simon Peyton Jones: Linear Haskell: Practical linearity in a higher-order polymorphic language
- Snack: Incremental Nix builds for Haskell
Package of the week
This week’s package of the week is Slick, a static site generator written and configured using Haskell.
Call for participation
- aeson:
{-# ANN otations #-}
cause interpreter to load. - haskell-ide-engine: Get tests working on windows
Events
- July 26 in Zürich, Switzerland: Alex Silva: A tour of dependent types with Idris
- July 27 in Ahmedabad, India: GraphQL engine on Postgres
- July 28 in Boston, Massachusetts: Hang out, chat FP, work on some code
- July 29 in Bangalore, India: Functors
- July 30 in Portland, Oregon: Chapter 2 of Parallel and Concurrent Programming in Haskell
- July 31 in Detroit, Michigan: Intro to Haskell types with drinks to follow
- August 1 in Dublin, Ireland: Self-paced Haskell study group with special talk
- August 2 in Singapore: August Haskell meetup


Before Change
await self.set_backend_config(backend, backend_config)
// -- Metric Registration -- //
[metric_exporter] = ray.get(
self.controller.get_metric_exporter.remote())
self.metric_client = MetricClient(metric_exporter)
self.num_router_requests = self.metric_client.new_counter(
"num_router_requests",
description="Number of requests processed by the router.",
After Change
self.num_router_requests = metrics.Count(
"num_router_requests",
"Number of requests processed by the router.", "requests",
["endpoint"])
self.num_error_endpoint_requests = metrics.Count(
"num_error_endpoint_requests",
("Number of requests that errored when getting results "


A teams of students from Lambda.Weworked together to present you this website and all the features you see. We are good at working as a team and we love what we do.
Interested in machine learning to solve social problems. Also worked in the back end.
mastering the art of data cleaning and analysis in the scope of Med Cabinet’s goals.
“Always code as if the guy who ends up maintaining your code will
be a violent psychopath who knows where you live”
― John Woods
Data scientist interested in using machine learning to improve our world. For med cabinet I am one of the machine learning engineers responsible for creating models to suggest strains.
Studying full stack web development at Lambda School.
Studying Web Development.
Studying data science at Lambda School. Interested in learning about the possibilities of Natural- Language Generation.
Built the marketing page and the about us page. Can speak both English and Spanish.
Former musician turned Data Science, now committed to the enduring success of this project’s prediction API


Professional Phone Repair
I have been fixing broken screens, replacing batteries, microphones, speakers and all kinds of hardware repairs and replacements on any model of any brand such as iPhone iPad Samsung LG HTC Motorola and all kinds of phones, tablets, computers for about 7 years and I consider myself a PRO if you are looking to get any repairs done.


A cryptic meme splashes the usually benign rock of Snohomish
“Epstein didn’t kill himself” was a far cry from the usual fare of high-school pep and community spirit.
by Andrea BrownSNOHOMISH — The rock of Snohomish went rogue.
For decades, the 7-foot-high boulder off Highway 9 and Bickford Avenue was painted with pleasantries — tributes to graduating classes or town heroes, maybe a bold invite to the prom. Nice, small-townish stuff like that.
The messages recently deviated from the norm.
For more than a week, “Epstein didn’t kill himself” was in bright red letters at the busy intersection. On a visit Monday the rock was tagged with NATO graffiti using the anarchy sign for the letter A.
What’s up with that?
The hot-button phrase refers to financier and convicted sex offender Jeffrey Epstein’s hanging death in prison in August while he was awaiting trial on charges for trafficking minors.
The trending hashtag #EpsteinDidntKillHimself is a meme on social networks.
For some, it’s a joke. For others, it’s no joke.
It’s a rallying cry, with polar motives depending on your political leanings.
The slogan is showing up everywhere — sprayed on highway overpasses, branded on beer cans, written in snow and depicted in cartoons, such as the one depicting Bart Simpson writing it over and over on a chalkboard. A T-shirt reads, “Christmas lights are a lot like Epstein, they don’t hang themselves.”
But on the precious rock of Snohomish?
The quaint river town of 10,000 is known for antique shops, craft beer and wedding venues. It’s home of the Snohomish High School Panthers football team. Kids grow up here, move away, and then come back to raise their children.
The big rock is in a field near the park-and-ride on Bickford. A lot of people pass by and look to see what the latest message is.
“This is the first time I’ve seen it not promote something relating to Snohomish High School teen spirit and things like that,” Mayor John Kartak said.
He said the rock is not on city-owned property.
“It’s our collective billboard,” resident Erin Gualco said. “It is a load-bearing wall in the structural integrity of our town.”
Thirty years ago, she decorated the rock with other members of her Snohomish High Class of ’89.
Messages often are “congratulating somebody who has accomplished or achieved something or passed on,” she said.
She mentioned how the rock’s RIP to longtime beloved Snohomish teacher and coach Charles “Tuck” Gionet in 2015 helped heal the community. “He was huge,” she said.
She called The Daily Herald last week when she saw the Epstein phrase.
“I think it’s brilliant,” Gualco said. “Everyone is talking about it and it’s valid. This is a big thing.”
She sees it as a means to keep the conversation going about the Epstein case.
“He would have had the ability to implicate many people,” Gualco said. “People in the position of power are hoping they can sweep it under the rug and forget about it.”
The meaning behind the Epstein message depends on the viewpoint.
It could be a #MeToo shout-out or a statement for Trump 2020 and rant against the impeachment. It’s used by people of both political stripes with multiple conspiracy theories lurking behind the phrase about Epstein, whose old boys’ network included the likes of Bill Clinton, Donald Trump and Prince Andrew.
Rep. Paul Gosar, a Republican Arizona congressman, used the first letter of 23 tweets to spell out “Epstein Didn’t Kill Himself.”
It’s a whodunnit — who wrote the Epstein message on the Snohomish rock, as well as who painted over it. Not that it matters. Other than a red lid and empty can of high-performance enamel tossed on the ground, the trail is cold.
Facebook posts about the town’s rock got more than 1,000 shares and hundreds of comments.
“We are going to end up on Tosh.0 again,” one remark read, referring to pop culture comedian Daniel Tosh’s coverage in September of the Snohomish woman who held a garage sale to sell all her husband’s stuff after she caught him cheating.
The division between commenters was apparent, as this back-and-forth exchange illustrates:
“The memes are usually hilarious, but leave the rock out of politics and conspiracies.”
“The rock is a palette for public speech. Many have spoken through the rock. We cannot censure the rock’s artists nor their content.”
“I’m not arguing either direction on the circumstances, I’m just here about the rock.”
Andrea Brown<EMAIL_ADDRESS>;<PHONE_NUMBER>. Twitter @reporterbrown .
Gallery
This week, the Epstein slogan on the Snohomish rock was tagged over with NATO graffiti using the anarchy sign for the letter A. (Andrea Brown / The Herald)