Using React with Backbone/Require.js/Bower/Mimosa, 1 line of config
This week I rolled out a React compiler for Mimosa. To show off how well the Mimosa and React play together, and how easy it is to get started, I put a demo Todo app together, because, lets face it, its not a thing unless there's a Todo app.
The demo Todo app is a Backbone project that uses React for views, Require.js for module loading and Bower for dependency management. That is all managed by Mimosa, the build tool, which also kicks in server support, live reload, JSX compiling, JSHinting, concatenation and minification.
Backing up, React
I was in attendance at JSConf 2013 when React was introduced. It was immediately ripped apart by the folks in the room. Twitter was red with the blood of a fresh new UI framework victim. The critiques can be boiled down to "Is that... XML embedded within JavaScript? OMG, die".
Since then, React has not gone away. It's gathered together over 5000 stargazers on GitHub and the buzz has increased.
So, why? Facebook threw up a blog post on "why react", and one of the key reasons is...
Speed, Baby, Speed
Rather than screw up an explanation, here's the important part from the "why react" blog post.
When your component is first initialized, the render method is called, generating a lightweight representation of your view. From that representation, a string of markup is produced, and injected into the document. When your data changes, the render method is called again. In order to perform updates as efficiently as possible, we diff the return value from the previous call to render with the new one, and generate a minimal set of changes to be applied to the DOM.
It's the diff that is the win. And at least until HTMLBars comes out, it seems to be the big speed winner.
And its just the View
Again, quoting React:
Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
React blends nicely with your existing stack as the View, especially if your UI stack doesn't place a hard dependency on its View layer. Like, for instance, if you are using...
Backbone
Backbone needs no introduction, but unlike some of the other leading client-side frameworks, Backbone places no limitation on your templating language. Underscore, Dust, Handlebars, whatever.
What you lose is tight integration and data-binding for free (unless you are using, say, Ractive for your templating solution).
Backbone's loose coupling and React play together nicely. Instagram is, for instance, "a 'single page' web app built entirely with React and Backbone.Router."
The popular TodoMVC site has a great example of using Backbone and React together.
XML in your JS
One of the chief concerns with React is all the XML in your JavaScript. Facebook calls it JSX.
var HelloMessage = React.createClass({
render: function() {
return
Hello {this.props.name}
;
}
});
Yeah, so, maybe count me in the group of folks who is sort of put off by that. I just spent the better part of a decade hammering home to junior developers that markup in your JavaScript is bad. But its probably something I can get used to, probably.
Anyone looking at that might also realize that every JavaScript runtime they know of will not be happy with that.
So, as you probably would expect, that code needs to be compiled/transpiled.
Compiling JSX
In the Backbone/React Todo example a library loaded in the browser performs the compiling. But we all know that's not a good idea. It works great for demos, but it won't for your app.
Facebook created react-tools which can, among other things, be used to compile JSX on the server.
mimosa-react
I created the JSX/React compiler for Mimosa specifically to wrap react-tools and allow Mimosa devs to compile .jsx
on the fly. As with all the other Mimosa compilers, when you are running mimosa watch
Mimosa will recompile your .jsx
and if you are using live-reload, refresh your page immediately.
Mimosa React Todo App
To show the compiler off, but also to show React working within a larger, more fully-featured Mimosa application I started with the TodoMVC example and made the MimosaReactBackboneTodo demo app.
Here's the config for the Todo app. No other config is needed.
"modules": [
"copy",
"server",
"jshint",
"require",
"minify-js",
"minify-css",
"minify-img",
"live-reload",
"bower",
"react"
]
This gives you...
- React compiling
- jshinting of compiled JavaScript
- concatenation via r.js
- minification of JavaScript, CSS and images
- bower support
- require.js support like path verification
- live-reload
- hooks into the node server that comes with the project.
Give it a try!
npm install -g mimosa
git clone https://github.com/dbashford/MimosaReactBackboneTodoList react
cd react
mimosa watch --server
ormimosa watch -s
- Open localhost:3000
Enjoy! Any questions, just ask!


Toggle navigation
Protograph
YAML
PDF
Support
Contributing
Whatsapp Signal Protocol for Message Sending
Reference:
WhatsApp Security Whitepaper


12 ANGRY MEN (1957) A Film Review Copyright Dragan Antulov 1999
There are many ways in which Continental and Anglo-Saxon schools of law manifest their differences in the area of Criminal Procedure, but usually the most notable, at least for outside observers, is the use of lay jury in the latter. The advantages and disadvantages of both schools could be the subject of lengthy debates, but there is no doubt that the criminal trials in Anglo-Saxon countries provide better drama and, consequently, better material for movies. Hollywood filmmakers came to such conclusion long time ago and, as a result, created whole new sub-genre of courtroom dramas. However, the most important and possibly the most interesting element of such trials - jury and its deliberations - was mostly absent from Hollywood films. One of the rare films to break such taboo and deal with juries was 12 ANGRY MEN, 1957 directorial debut by Sidney Lumet.
Plot of this film is based on the play by Reginald Rose, who had been allegedly inspired by his own experiences as juror. The movie begins one hot summer day in New York courthouse. A teenager has just been tried for the murder of his father, and the judge sends the jury to deliberate about his guilt or innocence, warning them that the guilty verdict brings mandatory death penalty. When jurors enter the room, things aren't looking very well for the defendant - jury members are eager to pronounce him guilty as soon as possible. The only exception is Juror #8 (played by Henry Fonda), who votes "not guilty" only because he thinks that the decision on someone's life and death should be made after careful examination of the evidence. The rest of the jury is upset with such dissent, but Juror #8 gradually convinces them to review the case. As a result, reasonable doubt about boy's guilt emerges and more jurors are ready to vote "not guilty", while, on the other hand, some jurors are becoming quite passionate about sending defendant to the electric chair.
Today, 12 ANGRY MEN is a considered to be classic, one of the greatest films made by 1950s Hollywood. Unfortunately, it also belongs to those films, which are not made in Hollywood today, since it is hard to imagine big studios spending money on films based on stage plays, shot in black and white and with plots set in a single room during one afternoon (1997 remake was shot in cable production). On the other hand, some filmmakers in today's Hollywood would find the theme of this film quite to their tastes. Reginald Rose's play doesn't just reveal dramatic tensions, usually hidden behind locked jury room doors; it also reveals the role prejudice plays in judicial, as well as any other important collective decisions in American society. If made today, and without some constraints Lumet had in 1950s, this film would be considered very "politically correct". Of course, subplot about prejudices could be hidden for those accustomed for more direct and more preachy ways of socially conscious American cinema of 1990s. All person in the jury room are white men; but even they are object of social stratification and prejudices. Through the escalating drama anonymous jurors slowly reveal their different social backgrounds and the ways in which they perceive the world and each other. The biggest prejudice is, of course, racial one - directed against "people from the slums", who are, same as jurors themselves, anonymous for the viewers, but their ethnic background is presumed to be Puerto Rican. Because of such prejudices, many jurors were ready to make their fatal decision before they were really examining the evidence. The microcosm of the jury room could be perceived as metaphor for the American society in 1950s and the struggle of the lone Juror #8, whose background is intellectual, could be seen as a metaphor for the struggle for civil rights of American ethnic minorities.
With or without politics, 12 ANGRY MEN is a powerful film, and its director Lumet should be really praised for making it such with small budget and in so unappealing setting. Lumet's achievement is even greater when we take into account the fact that it was his first major film. On the other hand, we could say that he had easy time, since few directors enjoyed privilege of working with such stellar cast. Always reliable Henry Fonda is only a nominal lead, being partnered with eleven great character actors. Thanks to Lumet's meticulous pacing and editing, each of them used opportunity to give splendid performance. Only one of them, Lee J. Cobb (Juror #3 and most ardent member of "guilty" camp), got "Oscar" for the role in this film, but each other member of the cast deserved it too. Perhaps 12 ANGRY MEN should have been the opportunity to introduce new category of "Oscars" - given for collective performances. The excellent acting was supported with good photography by Boris Kaufman and also by ascetic but suggestive musical score by Kenyon Hopkins. The only thing that doesn't look perfect in this film is the ending, which seems somewhat abrupt and the epilogue is unnecessary. However, this flaw is a minor one, and 12 ANGRY MEN completely deserved its high status of undisputed classic.
Another thing that makes 12 ANGRY MEN important is its educational value. This film is a great combination of an adult theme and the treatment suitable for younger audience. Therefore, 12 ANGRY MEN is a film that should be viewed not only by those who want to educate themselves about inner workings of American judicial system.
RATING: 9/10 (++++)
Review written on December 20th 1999
Dragan Antulov a.k.a. Drax Fido: 2:381/100 E-mail<EMAIL_ADDRESS>E-mail<EMAIL_ADDRESS>E-mail<EMAIL_ADDRESS>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


MSPush
@interface MSPush : MSServiceAbstract
App Center push service.
-
Callback for successful registration with push token.
Declaration
Objective-C
+ (void)didRegisterForRemoteNotificationsWithDeviceToken: (nonnull NSData *)deviceToken;
Swift
class func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data)
Parameters
deviceToken
The device token for remote notifications.
-
Callback for unsuccessful registration with error.
Declaration
Objective-C
+ (void)didFailToRegisterForRemoteNotificationsWithError: (nonnull NSError *)error;
Swift
class func didFailToRegisterForRemoteNotificationsWithError(_ error: Error)
Parameters
error
Error of unsuccessful registration.
-
Callback for notification with user info.
Declaration
Objective-C
+ (BOOL)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo;
Swift
class func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) -> Bool
Parameters
userInfo
The user info for the remote notification.
Return Value
YES if the notification was sent via App Center.
-
Set the delegate. Defines the class that implements the optional protocol
MSPushDelegate
.See
MSPushDelegate
Declaration
Objective-C
+ (void)setDelegate:(nullable id<MSPushDelegate>)delegate;
Swift
class func setDelegate(_ delegate: MSPushDelegate?)
Parameters
delegate
The delegate.


Epidemiologist Coordinator - San Francisco, CA
The San Francisco Department of Public Health (SFDPH) Population Health Division (PHD) Applied Research, Community Health Epidemiology, and Surveillance (ARCHES) Branch is seeking an Epidemiologist Coordinator to support the Strengthening the U.S. Response to Resistant Gonorrhea (SURRG) project, a California Bay Area collaborative effort with the California Department of Public Health (CDPH). The SURRG Epidemiologist Coordinator will primarily serve as the lead analyst and project manager for a multi-site CDC initiative on rapidly detecting and responding to antibiotic resistant gonorrhea (ARG), as well as support other STD surveillance and evaluation activities.
ESSENTIAL FUNCTIONS
Under the supervision of the SFDPH SURRG Project Lead/STD Epidemiologist, the Epidemiologist Coordinator will perform the following essential job functions:
- Serve as primary liaison to all project partners including: CDC, California Department of Public Health (CDPH) STD Branch, SF Public Health Laboratory, and participating STD and other care clinics;
- Apply strong analytical skills and knowledge using statistical and database management software (i.e., SAS) to conduct quality assurance of all related clinical, laboratory, and investigation data; and conduct evaluation of the epidemiologic investigation data to provide quality improvement feedback to staff performing interviews and partner services;
- Conduct epidemiologic and network analyses using clinical, laboratory, and investigation data to describe patients with and without ARG and the sexual and social networks in which they are located;
- Evaluate data using descriptive and multivariate statistics as part of verifying, analyzing, interpreting, and summarizing data for reports, as well as for dissemination of findings to appropriate stakeholders;
- Develop and maintain protocols and workflows to meet project deliverables related to specimen collection at participating clinics, antibiotic resistance testing at the SF Public Health Laboratory, and coordination of clinical follow-up of SURRG cases/contacts identified at non-STD clinics;
- Coordinate meetings and trainings and conduct related follow-up to meet project deliverables and ensure involvement by key staff;
- Work collaboratively with the project’s CDPH Regional Epidemiology Coordinator whose primary duties include oversight of the interjurisdictional and SF disease investigation and communication protocols, project budget and purchasing, and development of a Bay Area ARG response plan; and serving as the primary liaison to the Bay Area county health departments and supervisor of the SURRG Regional Health Worker;
- Respond to ad-hoc data requests by CDC, CDPH, or other SFDPH partners including external researchers and the public;
- Participate on project conference calls and attend required trainings and meetings as needed;
- Effectively apply communication skills to translate data to program and clinic staff, and community members;
- Prepare project progress reports and continuing grant applications for submission to funding agencies;
- Summarize study data for presentation and publication in technical and scientific journals and at local and national meetings;
- Maintain a detailed and well-organized schedule of tasks and events;
- Meet with supervisor weekly and as-needed to report progress and solve problems;
Respond creatively and professionally to challenges that arise in the course of the project;
- Address additional SFDPH PHD STD epidemiological needs as requested;
- Assure ethical practices and maintain confidentiality;
- Ensure all patients’ rights are protected;
- Performs other related duties as assigned/required.
JOB QUALIFICATIONS
Education/Experience
- Master of Public Health or Master of Science in Epidemiology, public health, infectious diseases, or related field, required.
- 2 or more years’ experience in epidemiology and/or analyzing surveillance, health research, or healthcare data.
- Minimum of one year experience with database management and quality assurance, preferred.
- Minimum of one year experience coordinating public health projects or research studies, preferred.
- Basic content knowledge of STD epidemiology and prevention and control strategies, preferred.
Certificates/Licenses/Clearances
Other Skills, Knowledge, and Abilities
- Knowledge of STD and HIV and medical terminology.
- Knowledge of the principles and procedures of epidemiological research including study design, epidemiological surveys, and surveillance; theory and application of epidemiological methodologies; principles and method of biostatistics, and preparation of scientific research reports.
- Knowledge and skills to conduct social network analysis of cases and their reported sexual partners and social contacts.
- Strong SQL skills for statistical and database management software in addition to SAS; knowledge of STATA or R is a plus.
- Strong oral and written communication and data visualization skills.
- Exceptional interpersonal skills.
- Leadership, organization, and decision-making skills.
- Work independently as well as part of a team.
- Prioritize and handle multiple tasks.
- Sensitivity to and experience working with ethnically, culturally and sexually diverse individuals, communities, agencies and organizations that comprise the STD/HIV public health constituency.
PHYSICAL DEMANDS
Stand Frequently
Walk Frequently
Sit Frequently
Handling / Fingering Occasionally
Reach Outward Occasionally
Reach Above Shoulder Occasionally
Climb, Crawl, Kneel, Bend Occasionally
Lift / Carry Occasionally - Up to 40 lbs
Push/Pull Occasionally - Up to 40 lbs
See Constantly
Taste/ Smell Not Applicable
Not Applicable Not required for essential functions
Occasionally (0 - 2 hrs/day)
Frequently (2 - 5 hrs/day)
Constantly (5+ hrs/day)
WORK ENVIRONMENT
General Office Setting, Indoors Temperature Controlled.
Heluna Health is an Affirmative Action, Equal Opportunity Employer that encourages minorities, women, veterans, and disabled to apply.


All passwords are generated in your web browser and are not transmitted across the internet
Length
Number of items
Include characters
Special characters
( e.g. @#$% )
Lowercases
( e.g. abc )
Uppercases
( e.g. ABC )
Numberic
( e.g. 123 )
Generate


package process
The process
package contains classes, traits and objects for process-oriented
simulation models (for example, process-interaction).
- Alphabetic
- By Inheritance
- process
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Component
extends Identifiable with Locatable
The
Component
trait provides basic common feature for simulation components.The
Component
trait provides basic common feature for simulation components. The list of subparts is empty for atomic components and nonempty for composite components. -
abstract
class
Coroutine
extends Runnable with Error
The
Coroutine
class supports (one-at-a-time) quasi-concurrent programming.The
Coroutine
class supports (one-at-a-time) quasi-concurrent programming. A coroutine runs/acts until it yields control from 'this' to 'that' coroutine. When resumed, a coroutines continues its execution where it left off. -
class
Gate
extends SimActor with Component
The
Gate
class models the operation of gate that can open and shut.The
Gate
class models the operation of gate that can open and shut. When the gate is open, entities can flow through and when shut, they cannot. They may wait in a queue or go elsewhere. A gate can model a traffic light (green => open, red => shut). -
class
Junction
extends Component
The
Junction
class provides a connector between twoTransport
s/Route
s.The
Junction
class provides a connector between twoTransport
s/Route
s. SinceLines
andQCurves
have limitations (e.g., hard to make a loop back), a junction may be needed. -
class
Model
extends Coroutine with Modelable with Component
The
Model
class maintains a list of components making up the model and controls the flow of entities (SimActor
s) through the model, following the process-interaction world-view.The
Model
class maintains a list of components making up the model and controls the flow of entities (SimActor
s) through the model, following the process-interaction world-view. It maintains a time-ordered priority queue to activate/re-activate each of the entities. Each entity (SimActor
) is implemented as a ScalaActor
and may be thought of as running in its own thread. -
class
Resource
extends Component
The
Resource
class provides services to entities (SimActors
).The
Resource
class provides services to entities (SimActors
). It may or may not have an associated waiting queue. -
class
Route
extends Component
The
Route
class provides a multi-lane pathway between two other components.The
Route
class provides a multi-lane pathway between two other components. The components in aModel
conceptually form a graph in which the edges areTransport
s and the nodes are otherComponent
s. ARoute
is a composite component that bundles severalTransport
s. -
abstract
class
SimActor
extends Coroutine with PQItem with Ordered[SimActor] with Locatable with Error
The
SimActor
abstract class represents entities that are active in the model.The
SimActor
abstract class represents entities that are active in the model. The 'act' abstract method, which specifies entity behavior, must be defined for each subclass. EachSimActor
extends Scala'sActor
class and may be roughly thought of as running in its own thread. -
class
Sink
extends Component
The
Sink
class is used to terminate entitiesSimActor
s when they are finished. -
class
Source
extends SimActor with Component
The
Source
class is used to periodically inject entities (SimActors
) into a running simulation model.The
Source
class is used to periodically inject entities (SimActors
) into a running simulation model. May act as an arrival generator. Source is both a simulationComponent
and specialSimActor
and therefore runs in own thread. -
class
Transport
extends Component
The
Transport
class provides a pathway between two other components.The
Transport
class provides a pathway between two other components. The components in aModel
conceptually form a 'graph' in which the 'edges' areTransport
s and the 'nodes' are otherComponent
s. -
class
WaitQueue
extends Queue[SimActor] with Component
The
WaitQueue
class is a wrapper for Scala'sQueue
class, which supports First-Come, First-Serve 'FCSC' Queues.The
WaitQueue
class is a wrapper for Scala'sQueue
class, which supports First-Come, First-Serve 'FCSC' Queues. It adds monitoring capabilities and optional capacity restrictions. If the queue is full, entities (SimActor
s) attempting to enter the queue are 'barred'. At the model level, such entities may be (1) held in place, (2) take an alternate route, or (3) be lost (e.g., dropped call/packet).
Value Members
-
object
Coroutine
extends Error
The
Coroutine
companion object provides functions to start-up and shutdown the coroutine system as well as counters for theCoroutine
class. -
object
CoroutineTest
extends App
The
CoroutineTest
object is used to test theCoroutine
class.The
CoroutineTest
object is used to test theCoroutine
class. Should print:Cor1
: phase 1Cor2
: phase 1Cor1
: phase 2Cor2
: phase 2 -
object
Gate
The
Gate
companion object provides a builder method for gates. -
object
Junction
The
Junction
companion object provides a builder method for sinks. -
object
Model
The
Model
companion object provides a shutdown method. -
object
ModelTest
extends App
The
ModelTest
object is used to test theModel
class.The
ModelTest
object is used to test theModel
class. Caveat: must add 'from' and 'to' components before transport!! -
object
Resource
The
Resource
companion object provides a builder method for resources. -
object
RouteTest
extends App
The
RouteTest
object is used to test theRoute
class, which is a composite class.The
RouteTest
object is used to test theRoute
class, which is a composite class. It simulates a two-lane road in one direction. -
object
Sink
The
Sink
companion object provides a builder method for sinks. -
object
Source
The
Source
companion object provides a builder method for sources. -
object
WaitQueue
extends Serializable
The
WaitQueue
companion object provides a builder method for wait-queues.


Dejavu’s DjvFsm framework is a Java port of the C++ version in the Platform Services area. Some improvements were made; many of which were results of experience gained from the C++ implementation, while others were due to features available in the Java platform.
Before further technical discussion of the framework is carried out, some terminology should be explained.
Finite state machine – The abstract concept of one or more objects that have multiple states (we’ll refer to these as state-context), and the framework that drives their transition from one state to another based on some external stimuli (events).
State – An English major will explain what the word state means, but in the context of the FSM discussion, each state has two optional actions, an entry action which gets executed upon entry into the state, and an exit action which gets executed upon exit of the state.
State transition – The act of changing states for a state-context. Each transition references a begin state, an end state, a guard, and an action. The begin and end states are self-explanatory, the guard is an optional Boolean expression that determines whether the state transition is allowed to occur, and the action is an optional function that gets executed during the state transition (only executed if the guard evaluates to true).
Event – In the context of the FSM discussion, this is a stimulus from the system that triggers a state change in a state-context. Each event is associated with a specific state-context, and has an event ID that allows the FSM to identify it for the purpose of locating the appropriate state transition. Events may have other custom attributes to convey extra information to the actions and guards that handle them.
State chart – A formal description of the states, transitions, and events associated with a particular finite state machine.
FSM context – Synonym for state-context. Each state-context can be in only one state at any one time; this is referred to as the current state.
FSM domain – Representing a single FSM, this contains the state chart information for that FSM, and has the active thread to shepherd all state-contexts belonging to the FSM (all having the same state chart). Applications that have state-contexts with different state charts will require many FSM domains, one per state chart.


WITNESS LIST Defense Affairs and State-Federal Relations Committee (SUBCOMMITTEE ON Homeland Security Strategy) February 13, 2004-1:00P Homeland Security On: Colley, Jack (Department of Public Safety/Office of the Governor) Davis, Tommy (Texas DPS) Garza, Rolando (TX Dept of Health) Hillman, Bob (Texas Animal Health Commission) Hubert, Martin (Tx Dept. of Agriculture) Kimbrough, Jay (Governor's Office - Homeland Security) Perrotta, Dennis (Center for Public Health Preparedness & Response, Texas Dept. of Health) Steiner, Daniel (Texas Military Forces) Swindle, Thomas (Self)


Preparation time
30 mins to 1 hour
Cooking time
over 2 hours
Serves
Serves 4-5
Preheat the oven to 220C/425F/Gas 7.
Pound all the herbs, garlic and a few drops of olive oil into a mortar until you have a coarse paste, then add salt and peppercorns.
Lay the lamb skin side down. Slash the meat deeply with a sharp knife. Rub the herb paste into the cuts then lay the peppers on top. Roll the lamb up and tie with two or three pieces of cotton string (you don't have to do this). Rub any remaining paste on the outside. Roll into 3 or 4 layers of foil and bake for 1½ hours
After 30 minutes cooking, put the potatoes in. Lay a big sheet of foil down and place the new potatoes, parsnips, carrots, garlic, olive oil, lemon slices and any herbs left. Season well and seal up. Bake with the lamb for 1 hour.
Make the gravy mix the foil bag juices from the lamb with some flour and butter, add a little red wine, then whisk. Serve.


Do this in an incognito window.
This will prompt you to authorize the Heartbeat app to send messages on behalf of your shim user account. The shim account is a throw-away app.net account that will have permission to write to your timeseries channels and nothing more. This makes it so we can push data to time series without requiring users to login with their app.net credentials.


Shows you when you are hosting someone, and reminds you when you've forgotten to do so.
Hosterino checks the status of hosting once per minute.
The extension icon will glow purple if you are currently hosting someone. You will see a notification on all Twitch webpages about your current hosting status, and changes in it.


This library provides convenient methods and common implementations to simplify
concurrency/multi-threading in Kotlin Multiplatform projects for iOS
and Android
.
This package is intended to unify the concurrency patterns on all the platforms. For example, Native concurrency is different than how JVM works thus in many cases, it may be hard to write common code without platform specific considerations.
In such cases, this package is useful because it provides a common unified API for many similar constructs by choosing the most restrictive ones.
For example, in case of Native, any background operations must use a non-state
capturing lambda where as JVM does not impose such restrictions. Therefore,
the Worker
API in this package exposes and implementation based on the former expectation.
Add the repository to your project.
repositories {
maven {
url "https://dl.bintray.com/suparnatural/kotlin-multiplatform"
}
}
implementation 'suparnatural-kotlin-multiplatform:concurrency-metadata:1.0.5'
to commonMain
.implementation 'suparnatural-kotlin-multiplatform:concurrency-iosx64(or iosarm64):1.0.5'
to iosMain
.implementation 'suparnatural-kotlin-multiplatform:concurrency-android:1.0.5'
to androidMain
.Check out the API Docs. They are always up to date with code examples.
Worker presents a unified API across all platforms to interact with threads.
A Worker can execute a job in its event loop. If needed, it can also resume the
flow on a different worker instance. All threads including main
are exposed
via this API. For example, to get a Worker backed by main
thread, use
WorkerFactory.main.
A worker job
must satisfy the following requirements:
job
must be a non state capturing lambda which does not capture any outside state.job
must be passed before hand in the execute or executeAndResume method
jobInput
parameters.job
input arguments must be treated as immutable to guarantee thread safety.The basic idea behind worker is to bring the same level of abstraction to every platform as Native has because native concurrency is the most restrictive one.
On iOS, it uses the Kotlin/Native's Worker
API.
On Android, it uses Handler
.
val worker = WorkerFactory.newBackgroundThread()
// calling execute schedules a task on worker
val future = worker.execute("Hello") {it: String ->
assertEquals("Hello", it)
"World"
}
// wait for worker to complete, use await
val result: String = future.await()
assertEquals("World", result)
val worker1 = WorkerFactory.newBackgroundWorker()
val worker2 = WorkerFactory.newBackgroundWorker()
val future = worker2.executeAndResume(INPUT, {
assertEquals(INPUT, it)
OUTPUT
}, worker1, true) {
assertEquals(OUTPUT, it)
it
}
assertEquals(OUTPUT, future.await())
val worker = WorkerFactory.newBackgroundWorker()
val future = worker.executeAndResume(INPUT, {
assertEquals(INPUT, it)
OUTPUT
}, awaitResumingJob = true) {
// called on main thread asynchronously
assertEquals(OUTPUT, it)
it
}
// do not call future.await because it will block main thread.
ReadWriteLock
allows multiple readers to read a shared memory or a single thread to mutate it.
val lock = ReadWriteLock()
// read from multiple threads simultaneously.
lock.acquireReadLock() // call from as many threads
// perform read ....
lock.releaseReadLock()
// to protect writes
lock.acquireWriteLock() // only one thread will get lock, others will be blocked.
// perform write ....
lock.releaseWriteLock() // next thread will now unblock.
MutexLock
is a locking mechanism which allows only one thread to gain access to a resource protected by an instance of MutexLock. If more than one thread tries to acquire lock
, only the first thread is successful while the other threads either wait or return depending on whether lock
or tryLock
was invoked.
val mutex = MutexLock()
mutex.lock()
assertFalse(mutex.tryLock())
val future = WorkerFactory.newBackgroundWorker().execute(mutex) {
assertFalse(mutex.tryLock())
}
future.await()
mutex.unlock()
mutex.destroy()
Use JobDispatcher
to dispatch a task on main or background thread.
val future = JobDispatcher.dispatchOnMainThread("Hello") {it: String ->
assertEquals("Hello", it) // runs on main thread
}
future.await()
val future = JobDispatcher.dispatchOnBackgroundThread("Hello") {it: String ->
assertEquals("Hello", it) // runs on background thread
}
future.await()
Any property can be made thread safe by using Immutability
property delegate.
Such properties are internally backed by AtomicReference
but it remains transparent to the rest of the code.
// Since top level objects are always immutable, they can be accessed from any thread.
object SharedObject{
val person: Person? by Immutability<Person?>(initialValue = null)
fun initialize(p: Person) { // any thread can now atomically update the person property.
person = p // will succeed
person.name = "" // will cause error
}
}
class MyClass {
val value: Int by Immutability<Int>(initialValue = 0)
}
// can be called from any thread as long as instance is thread shareable.
instance.value = 3
Use toImmutable
to make objects immutable and thus shareable across threads.
val person = Person(name = "Bob").toImmutable()
person.name = "Jerry" // error
Use isMainThread
to check whether current thread is main or not.
JobDispatcher.dispatchOnMainThread(Unit) {
assertTrue(isMainThread())
}
JobDispatcher.dispatchOnBackgroundThread(Unit) {
assertFalse(isMainThread())
}


3
1 Yahweh, Commander of the angel armies, is about to take away from Jerusalem and other places in Judah
everything that you depend on—
all food and water.
2 He will take away heroes and other soldiers,
judges and prophets,
people who do rituals to find out what will happen in the future and the elders,
3 army officers and other important people,
advisors, skilled craftsmen, and those who perform rituals of magic.
4 Yahweh says, "I will appoint boys to be leaders;
young children will rule.
5 People will treat each other cruelly:
people will fight against their neighbors.
Young people will insult older people,
and vulgar people will sneer at people whom others usually honor.
6 At that time, someone will grab one of his brothers in his father's house and say to him,
'You still have a coat; people respect you for that.
So you be our leader!
You rule this city, which is now a pile of ruins.'
7 But his brother will reply,
'No, I cannot help you,
because I do not have any extra food or clothes in this house.
So do not make me your leader!'"
8 Jerusalem and the other towns in Judah will be destroyed,
because everything that the people do and say there opposes Yahweh,
the powerful and glorious one,
and they refuse to obey him.
They rebel against him.
9 They even show on their faces that they oppose Yahweh.
They are proud about their sins,
like the people of Sodom were long ago;
they do not try to hide their sins; they talk about them.

My people, your leaders are misleading you;
they are causing you to do all kinds of evil things.
13 It is as though Yahweh has taken his place in a courtroom
and is ready to judge his people.
14 He will stand up to declare why the elders and rulers of his people should suffer;
he says, "The people of Israel are like a vineyard that I planted,
but you leaders have ruined it!

It is as though you are pushing the faces of poor people into the dirt!"
That is what Yahweh, Commander of the angel armies, says.
16 Yahweh says this:
"The women of Jerusalem are haughty;
they walk around sticking their chins out,
and flirting with men with their eyes.
They walk with tiny steps
with bracelets on their ankles that jingle."

The city will be like a woman who sits on the ground because all her friends have deserted her.


MindRetrieve is a personal desktop search engine. Unlike general purpose search engines that intent to index and search every web page in the world, MindRetrieve focus on a small but very special area. That is the web that you have seen.
Everyday we read a large amount of information from the world wide web. The truth is most of them does not register. We often search for similar topics time after time. It is time consuming. Often after much work we find that we are looking at the same old documents like a déjà vu. MindRetrieve is here to help you to find information buried deep in your memory.
MindRetrieve is a lightweight, cross-platform, open source application available under the BSD license. It has been tested on Windows and Linux with the latest versions of Firefox, Opera and IE. Mac support is planned.
Download
Current Release 0.4.2
- Download Windows release (3760k)
- Download Linux release (source code) (224k)
The source code release depends on


class: top, left, inverse, title-slide # Education & Globalization ## Session 06 ### Dr. Zhou Yisu 周憶粟 ### 2018/09/10 --- # Governing the global & Structuring the global economy --- ## Aims The nation-state framework at the global level: - .orange[How do countries solve conflict with one another?] - .orange[How do countries do business with one another?] --- ## A central question among nation-states: .green[Often times they don't get along with each other] ### International structure -- .violet[League of Nations] (1920-1946) -- .violet[United Nations] (1945-) - Security Council 安全理事會, General Assembly 聯合國大會, UNESCO 聯合國教科文組織，etc - Critics: slow (193 members), bureaucratic, less efficient -- .violet[Group of Eight (G8)]: Canada, France, Germany, Italy, Japan, Russia (suspended), the United Kingdom and the United States. - Similarly, .violet[Group of Twenty (G20)] Specialized groups: .violet[OECD] (The Organisation for Economic Co-operation and Development), which mostly focus on economic development --- ## The world is very big, global organizations might not intervene/focus on local issues -- ### Regional political organizations .violet[Association of Southeast Asian Nations (ASEAN)] 東南亞國家聯盟/東盟: - .orange[Founding] (1967): Indonesia, Malaysia, the Philippines, Singapore, Thailand - .orange[Member]: Brunei, Cambodia, Laos, Myanmar, Vietnam - .orange[Observers]: Papua New Guinea, East Timor Others: African Union (AU), Organization of American States, etc -- ### Supra-regional organizations New brothers banding together: such as .violet[BRICS] 金磚國家: Brazil, Russia, India, China, South Africa --- ## Global governance Obviously .red[war] is bad for everyone. Therefore three new forms of governance: - Multi-stakeholder initiatives (i.e. many different countries/organizations come together to solve problems) - Voluntary regulations (i.e. Paris accord for climate change) - Arbitration bodies 仲裁協商機構 (i.e. South China Sea) -- Pressure for global governance seen to result from increased global .red[diversity] 多元化 and .red[fragmentations] 碎片化 due to: - Declining power of nation-state (i.e. porous) - Increasing flows through state borders, including negative flows such as drugs, disease, crime - Horrendous acts by states or inability to prevent - Global problems that need global response (i.e. climate change) --- ### Only appear in One Piece, not real life There is no supreme governing power at global level (i.e. no country/organization could call all the shots) ![:wscale 90%](http://i.imgur.com/4dUn8v7.png) --- ## Global civil society 國際公民社會 We yet to have very effective & efficient mechanisms to solve disputes between countries OR help poor nations develop in the nation-state framework, which gives rise to： >.blue[Global, non-governmental, pluralistic form of society, composed of interlinked social processes orientated to civility] -- Civil society activity at global level, involving social movements, NGOs, transnational networks, religious organizations, community groups - Has an unfinished, varied character - Growth of NGOs and movements since 1990s - Who represented and what relationship to state? --- ## Global civil society: INGOs >.blue[International Non-Governmental Organizations (INGOs) are international not-for-profit organizations performing public functions but not established or run by nation-states] -- Examples include: - Red Cross 紅十字會 (1865) - Salvation Army 救世軍 - Oxfarm 樂施會 - Save the Children (children's rights, disaster relief, aide) - More recent phenomena: big .green[philanthropist] 慈善家 + Melinda and Bill Gates Foundation + Chan-Zuckerberg Initiative. + Open Society Founadtion (George Soros) --- ## INGOs characteristics Have rational-moral authority rather than legal 沒有法律層面的權利 Power from neutrality 政治中立 Seen as grass-roots, in touch, media savvy 草根本土、在地、由下至上 Made number of successes Criticisms include: - control of North, limited focus may distort picture, funding priorities, elitist, undemocratic, accelerate state withdrawal of social provision, can be co-opted - INGOs part of globalization but some argue part of neoliberal system as serve to fill voids left as nation-states scale back their functions --- ## Other players .violet[Coalitions and networks] – as together NGOs can have more influence and impact .violet[Hybrids] – NGOs working with states or companies, such as Kimberly Process, Ethical Trading Initiative .violet[Sub-regional] and .violet[supra-regional] organizations .violet[Links] between local entities and global, as well as local and national NGOs linking with INGOs Religious organizations/networks Global terrorist organizations Individual global players --- # Economic development ## How do countries grow from poor to rich? --- class: inverse, middle, center ## Group discussion: What would you do to create an independent, affluent life? - Form a group of any size for discussion - Come up with a plan (i.e. step by step) - Each group submit one plan via pollev.com/yisu ---  --- ## What is a job? You sell your labor/skills in exchange for monetary rewards -- ## What do you do when you receive your salary? - .orange[Consumption] 消費: purchase of goods or services - .orange[Saving] 儲蓄: to put your money in the bank (usually with an expectation to consume more in the future: buy an apartment, pay for your children's education, pay for hospital bill, etc) - .orange[Investment] 投資: money committed or property acquired for future income. + Stock 股票 + Bonds 債券 + Real estate 房地產 + etc --- ### As a (ordinary) person, you can - Start job (entry level salary) - Work you way up ( + salary) - Get promoted or find another job (++ salary) -- During which time when you are older: - Save for .violet[down payment] 首期款/首付 of an apartment/house (or maybe borrow money from your parents and/or relatives) - Take out a .violet[loan] 貸款 from the bank + you need to payback gradually with .violet[interests] 利息 -- ### Or you might take a non-traditional route - Establish a tech start-up and becomes a CEO, wishing one day your company will either be purchased by someone else or enlisted in stock exchange 上市 - Become a creative person: writer, vlogger/streamer, fashion model, freelancer - Marry a billionaire --- ## No matter which route you choose, underneath it: You start with something: small sum of money or just you You perform some work or make some investment to accumulate wealth, which let you do other things
--- class: center, middle ## But what if you are running a country instead just you? What changed? - You won't be able to "find a job" - The only way to get rich is to encourage your people do business with people in other countries - Global currency is U.S. dollar (i.e. only U.S. can issue it) --- ## As a poor and developing country, what can you do? You don't have much tradable or valuable thing to exchange for. Why do you need trade? Because any one country won't be able to sufficiently sustain itself (i.e. produce everything) - .violet[Natural resources] + Petroleum 石油 + Natural gas 天然氣 + Lumber 木材 + Minerals 礦石 - Beautiful .violet[natural scenes]: Tourism - .violet[Agriculture] 農業 -- But there is a catch: - Extracting natural resources require .green[technology] - Tourism requires hefty .green[initial investment]. - Agriculture is .green[not very profitable] (i.e. natural disaster; low price of agri products) --- ## Let's do it: On the path of national prosperity Goal 1: You want to increase the value of things you can sell Goal 2: You want to sell more -- To achieve these goals, you can do such: - Improve your product (i.e. make them better, more attractive) + Improve the technology + Improve the design + Better marketing - Make things cheaper + .cyan[Pave better roads] (i.e. ship things faster) + .cyan[Provide cheaper electricity] (i.e. cheaper energy) + .cyan[Have more productive worker] (i.e. education & training) + .brown[Pollute the environment] (not so good long term, but short term...) + .brown[Exploit workers] (i.e. have them work longer, underpay them, don't provide social welfare) + .brown[Cheat] (i.e. using low quality materials) + .brown[Pirate] 盜版 --- background-image: url(https://qph.fs.quoracdn.net/main-qimg-57939189386cc00d8b465f3fe4c2f21c-c) background-size: contain background-position: center top ### Copycat: almost every country has been on this path before .footnote[For more: https://www.quora.com/Did-Japan-in-the-1960s-to-1980s-have-the-reputation-for-being-a-product-copycat-like-China-has-today ] --- ## Wait, I am also a nice ruler. I want my people to be happy Other intangible things (may be less priority for development?): - parks - police - hospital - military - library - sports facility These all cost .orange[resources]. Where do you get these? --- ## .violet[Three essential questions in development] ### 1. How should we trade with each other? ### 2. What if I made bad decisions? ### 3. What kind of investment should I be making? --- ## 1. How should we trade with each other? There is an old idea that international trade is .red[zero-sum]. This is called .cyan[Mercantilism] 重商主義: A country can gain by exporting but lose by importing. -- However, modern economics have shown that international-trade is a .red[positive-sum game]. It actually benefiting both sides: - Import can + lower prices, help consumers + increase variety + provide necessary inputs for firms to improve their products + allows for more specialized inputs that help increase productivity Therefore, as a country, you should focus on international trade and develop your own competitive advantage. -- But trade can be complicated: obviously you cannot trade for everything. Need rules to regulate trade. You also need rules and mechanism to settle disputes among countries: .orange[General Agreement on Tariffs and Trade (GATT)] 關稅暨貿易總協定 - 1947–1995 superseded by WTO - System for liberalization of trade --- ## 1. How should we trade with each other? .orange[World Trade Organization (WTO)] 世界貿易組織 - Multilateral and at heart of economic globalization - Evident strains between developed and developing nations - "Rounds" held, with latest Doha being contentious, shows: + complications due to numbers involved in negotiations + lack of agreement between key nation-states + rising power of East + declining power of US and EU + possible decline in acceptance of neoliberalism and rise in trends towards protectionism - .orange[Trade-related intellectual property rights (TRIPS)]: WTO agreement to protect the interests of those that create ideas - .orange[Trade-related investment measures (TRIMs)]: WTO agreement on trade measures governments can impose on foreign firms --- background-image: url(http://www.visualcapitalist.com/wp-content/uploads/2018/03/export_map2.png) background-size: contain --- ## 2. What if I made bad decisions? -- What would you do as an ordinary person? - Ask for help from your support network: friends, parents, relatives. - Turn to a loan shark 高利貸 - Declare bankruptcy 破產 -- .orange[International Monteary Fund] (國際貨幣基金組織 IMF): - Created 1944 - Original focus on creation of stable global monetary system and ".violet[lender of last resort]" （最後貸款人） - Adapted to changing global economy, by 1970s focused on loans to developing countries - Loans with conditions and demand for .violet[structural adjustments] Believe it or not, there are many badly managed economies: ---

Since March, Argentina's Peso is down 46% versus USD, while Turkey's Lira is down 39%. Think about the difference. An IMF program and central bank hikes are defending ARS. Little comparable defense for TRY, which says to me the Lira is more likely to be undershooting fair value. pic.twitter.com/MV5HaE6rT9
— Robin Brooks (@RobinBrooksIIF) September 7, 2018
 --- More with Argentina story: https://www.npr.org/sections/money/2016/03/11/470136949/episode-689-a-hedge-fund-a-country-and-a-big-sailboat --- ### International Monetary Fund (IMF) Became focal point for critics of neoliberal 新自由主義 agenda (in short: only benefit someone at the expense of others. Will talk more next week) Major criticisms include: - Neoliberal policies applied unquestioningly - Structural adjustments inappropriate as circumstances of individual countries not considered - Governance structure US-dominated and mainly serves interest of North rather than developing countries - Contributed to economic crisis Led to change in focus, attempts to be more transparent, involvement of NGOs, some consideration of social issues --- ## 3. What kind of investment should I be making? -- What would you do as an ordinary person? - Acquire marketable skills - Minimize potential costs (i.e. you should take care of your body) - Ask advice from your role model. -- In academic terms, economists have suggested the following strategies: 1. .orange[Structural transformation]: place workers to more productive factories (than say, agriculture) 2. .orange[capital deepening]: adding more capital per worker (i.e. equip workers with better machinery) 3. .orange[technological diffusion]: augmenting capital or labour by adopting techniques that has not been previously embraced 4. .orange[technological innovation]: advance in new technology --- .orange[World Bank] 世界銀行: - Goal of funding government-sponsored programmes in developing countries - Specialized UN agency set up in 1945 - Original remit of infrastructure programs expanded to all areas of economic development - Suppose to be non-political but boundaries blur - An important force globally as it is: + a .cyan[forum] for global discussions on development and finance + significant .cyan[funding source] for developing countries + .cyan[source of development information, advice, support] -- Has become increasingly controversial and focus of protest and criticism Main criticisms include: - dominance of developed countries - serves only some interests, neglecting poor - has lost focus --- ### Example: Invest in education in poor nations At global level, rich countries helped poor countries develop educationally mainly through .violet[aid] 援助 and .violet[loan] 貸款. How do you decide which level of education to invest? Imagine you are the guy who got those extra cash in your pocket (from saving presumably): how will you prioritize your investment? --- ### Returns of education research Message: investing on girls, not boys ![](./pic/return2.jpg) --- ### Returns of education research Message: investing primary education for boys. Secondary education for girls. ![](./pic/return3.jpg) .footnote[Source: Psacharopoulos, George, and Harry Anthony Patrinos. "_Returns to investment in education: a further update._" Education economics 12.2 (2004): 111-134.] --- background-image: url(https://heckmanequation.org/assets/2014/04/The20Heckman20Curve_v2.jpg) background-size: contain --- ## The myth of economic globalization Much evidence available to suggest the growing importance of economic globalization. It involves real global processes and flows to degree not seen before But some skeptics argue that these developments: - are not new - are not truly global (i.e. more regional) - do not represent any shifts in power from established relationship of developed and less developed - therefore economic globalization is a myth More importantly, skeptics argue that economic globalization has yet to solve two problems: - .violet[Middle income trap] - .violet["The bottom billion"] --- ## Only 13 countries joined rich countries club since 1960 ![:wscale 90%](https://cdn.static-economist.com/sites/default/files/images/print-edition/20171007_SRC647_1.png) .footnote[Source: [The Economist](https://www.economist.com/graphic-detail/2012/03/27/the-middle-income-trap)] --- ## "The bottom billion" 底層的10億人 Economist Paul Collier (2008) claims these frames can distort extent of inequality and ignore the poorest. - Vast majority live in Africa (70%) - Also Haiti, Bolivia, Laos, North Korea, Yemen, and others - Often have less than fifth of income of other developing countries --- ### "The bottom billion"

 --- ### The "The bottom billion" Other problems relate to low income and compare badly with other developing countries: - .violet[Low life expectancy]: 50 yrs compared to 67 yrs - .violet[High infant mortality]: 14% die before fifth birthday compared to 4% - .violet[Malnutrition problems]: 36% compared to 20% -- Nation-states face four traps of impoverishment: - .orange[Conflict trap] – nation-state confronted with either continuing civil wars or frequent violent coups d’état 政變 - .orange[Natural resources trap] – limiting economic development because of excessive dependence on abundant natural resources - .orange[Trap of being landlocked with "bad neighbors"] – impact on ability to transport exports - .orange[Bad governance trap] – policies which can inhibit or destroy economy --- ## .red[Summary] Economic structures are central to globalization and involve multiple flows The Bretton Woods System (World Bank and IMF) had profound influence on the development of these structures and lasting influence through institutions Increasingly vocal protests led to changes, but criticisms of system continue Other organizations and structures have developed to promote economic globalization in particular places, often for the benefit of some Questions over the legitimacy, significance, inequality, and relationships between these continue --- ## Resources - Read Ritzer & Dean Chapter 6 - Collier, Paul. _The bottom billion: Why the poorest countries are failing and what can be done about it._ Oxford University Press, USA, 2008. .kt[最底层的10亿人] 保罗•科利尔 （2008） 中信出版社 - Documentary: _Time for School 2003 -2016_ ![](http://www.tvweeklynow.com/images/9073/RIcksPix/Press%20Images%20Jun15/TimeforSchool%20logo.jpg)


Campus -1, 19th KM Stone,
NH-24, Delhi-Hapur Bypass Road, Vijay Nagar, Ghaziabad U.P., India
Phone: +91-120-7135112 (30 Lines), 2845112,113 Fax: +91-120-2845114,115, 7135115
Email<EMAIL_ADDRESS>For Academic Queries (Existing Students) Call
Registrar -<PHONE_NUMBER>
Dy. Registrar -<PHONE_NUMBER>