Part III: Adding 3D Objects 📦
In parts one and two, we went through how to get started with ARKit, and detect plane surfaces around you. What good is just doing that, you ask?
Hi, SceneKit.
On iOS, there are two ways to work with 3D:
- SceneKit
- Metal
SceneKit, simply put, is a high-level 3D framework for creating 3D objects and working with 3D scenes. It includes a physics engine, and a particle generator to make it as easy as it can be to work with 3D objects and scenes.
Metal is a low-level API to the GPU-accelerated hardware on Apple devices. It is designed to be extremely efficient on Apple hardware. Although not the easiest to deal with if you’re looking to render simple 3D without GPU-acceleration.
Let’s deal with SceneKit to add 3D objects to our scene.
Anchory Sessions
You should be familiar with setting up an AR Session by now. The fundamental concept behind adding 3D objects to an AR Session is adding Anchors to the scene and have the device track the anchors inside of the AR Session.
The AR Session object in your View Controller can be used to add anchors to your session. Like so:
An AR Anchor is the real-world position and orientation that can be used for placing objects in an AR scene. When plane detection is enabled, ARKit adds ARAnchor (more specifically ARPlaneAnchor) objects to the session.
SceneKit, meet ARKit
There are two ways to add 3D content to your session:
- SCNView’s child node
- ARAnchor
To understand how each of them works let’s make sure we’re through with the fundamental concept behind this first.
Any 3D content modeled with SceneKit can be used with ARKit. ARKit makes this easy with ARAnchors. The idea behind this is — AR Anchor objects that are added to the scene can hold or show 3D content in their position in real-world, which is tracked by your device. That’s it. That’s all there is to it.
Let’s use SceneKit to create a simple cube and see how each of the methods to add 3D content works.
Creating a Cube
If you’re new to SceneKit, here’s what you need to know to create 3D content:
- All 3D content are depicted by nodes:
SCNNode
- To create a node, you need to specify a 3D geometry after which the node is modeled
To create a cube, we use SceneKit’s SCNBox
geometry and model our node with it.
It’s as simple as that.
Adding 3D geometry to the AR Session
Now that we have our cube
we’ll look into how to add it to our scene.
Like I mentioned earlier, there are two ways to add 3D content to an AR session. But before we jump into how we do that, we need a position for the 3D content that you want to place. Let’s get to that.
Since we’re dealing with 3D space, there are two choices that we have to place 3D content:
- On Plane
- Off Plane
With SceneKit, a position of an object in the world is denoted with a SCNVector3
, this is nothing but a vector object with 3 axes: x
, y
, and z
.
On Plane
To place an object on a plane that has been detected, the user generally taps on the screen within the extent of the plane that has been detected. The tap point we have to work with is a CGPoint
.
How then do we get a SCNVector3
with three elements, you ask?
####### Hit-Testing
With a CGPoint
and an ARPlaneAnchor
to work with, we can hit-test the point against the plane anchor to get its position in 3D space. This is the general approach towards how objects are placed on a plane. If that sounds complicated, don’t worry, just follow along:
With ARKit, a 2D point can be hit-tested against a plane with ARSCNView’s hitTest()
method:
The Result type that will be passed is an enum on ARHitTestResult
, with the following values:
- estimatedHorizontalPlane
- featurePoint
- existingPlane
- existingPlaneUsingExtent
estimatedHorizontalPlane
is a real-world planar surface detected by the search (without a corresponding anchor), whose orientation is perpendicular to gravity.
featurePoint
is a point automatically identified by ARKit as part of a continuous surface, but without a corresponding anchor.
What we are interested in to add objects to a plane, are the plane anchors already added to the session by plane detection. To use this we use:
existingPlaneUsingExtent
type when hit-testing. UsingExtent
makes the hit-test respect the plane’s limited size unlike simply existingPlane
type.
Now that we have the hit-test method, we get back a ARHitTestResult
object that contains the position information. Not exactly. But we can use the information in it to build a SCNVector3
, which denotes a position in 3D space like:
The worldTransform
property of the ARHitTestResult
contains information about the object in its 3rd column that we use to transpose into a position vector.
So, no we have a position on the plane we can work with.
Off Plane
To add an object off plane, the usual approach is to add it in front of the device’s camera where the user taps. This can easily be accomplished by building a SCNVector3
using the camera transform.
To obtain the camera transform:
Once you have the cameraTransform
(MDLTransform), all there’s left to build the SCNVector3
is:
We now have a position in 3D space for your object off-plane.
Let’s go over how to add it to the scene.
ARSCNView
Now that we have the position of the 3D object as a vector, we can assign that to our SCNNode:
Adding the cube
to the scene is all there’s left to adding your 3D content:
This should place a 3D cube in your world and your device should now track it.
AR Anchor
The other method to add 3D content is adding raw anchors, and showing SCNNode in their position.
The idea behind this method is simple:
- Create an AR Anchor
- Add it to the AR Session
- Implement
ARSCNView
’s delegate method to return aSCNNode
for an anchor
To get hold of an anchor to add:
- On Plane
- The
ARHitTestResult
object from the hit-test method has ananchor
property which can be added to the session using thesession.add(anchor: ARAnchor>)
method.
- The
- Off Plane
- Using
ARCamera
’stransform
property, an anchor can be created like:
- Using
and can be added using the session.add(anchor: ARAnchor)
method.
Once anchors are added to the session, to display 3D content in their place, we need to implement ARSCNViewDelegate
’s method:
This method returns an SCNNode for an anchor in the session, an anchor’s identifier property can be used to distinguish between different anchors added to the session. We simply return a SCNNode in this method, for the required anchor to add 3D content.
The Code
Let’s look at how all of this comes together in code:
- Adding 3D content on plane:
Incase you’re adding anchors to the session (Method 1), implementing the delegate method like this is necessary to display 3D content:
- Adding 3D content off-plane
So, that’s about how to add 3D content on and off-plane with ARKit.
Moving On
In this part we have seen how to add 3D content to your AR session, we’ll look into adding some lights and making your objects more interesting in the next part. Thanks for following along, and feel free to leave any feedback!
Index of the series of ARKit posts:


Let's play this simple game !
First there's basic rules to the game:
Ping Pong will count up to your number from 1 with the following exceptions:
- Numbers divisible by 3 become "ping"
- Numbers divisible by 5 become "pong"
- Numbers divisible by 3 and 5 become "pingpong"


Before Change
a * pow(dist_squared, b) + 1
)
if not np.isfinite(grad_coeff):
grad_coeff = 4.0
for d in range(dim):
grad_d = clip(grad_coeff * (current[d] - other[d]))
current[d] += grad_d * alpha
After Change
dist_squared = rdist(current, other)
if dist_squared > 0.0:
grad_coeff = -2.0 * a * b * pow(dist_squared, b - 1.0)
grad_coeff /= a * pow(dist_squared, b) + 1.0
else:
grad_coeff = 0.0
for d in range(dim):
grad_d = clip(grad_coeff * (current[d] - other[d]))
current[d] += grad_d * alpha
if move_other:


The Actor is one of the two main component of CamOn, it handles the estimation of all the parameters of a subect in a shot. It supports a number of custom shapes used to represent the target object
More...
Inherits MonoBehaviour.
|
| static void | ReevaluateAll (Actor[] actors, Camera camera) |
| | Reevaluates a list of actors. More...
|
| |
| static Actor | Create (Transform t, PrimitiveType shape, Vector3 offset, Vector3 scale) |
| | Creates and actor for a specifi transform More...
|
| |
|
| PrimitiveType | Shape [get, set] |
| | Gets or sets the shape of the actor. More...
|
| |
| bool | Ignored [get, set] |
| | Gets or sets a value indicating whether this SubjectEvaluator is ignored. More...
|
| |
| Vector3 | VantageDirection [get] |
| | Returns the direction from which the camera should frame this subject More...
|
| |
| Quaternion | Orientation [get] |
| | Gets the orientation. More...
|
| |
| float | InFrustum [get] |
| | Returns the fraction of this subject which is included in the vew frustum More...
|
| |
| Vector3 | Scale [get, set] |
| | Gets and sets the scale mdifier for this subject More...
|
| |
| Vector3 | VolumeOfInterestSize [get] |
| | Gets the size of the volume of interest. More...
|
| |
| Vector3 | Offset [get, set] |
| | Gets or sets the offset for ths subject. More...
|
| |
| string | Name [get] |
| | Returns the name of the game object associated to this subject More...
|
| |
| Vector3 | Position [get] |
| | Gets the position of this subject in world coordinates. More...
|
| |
| Vector3 | Forward [get] |
| | Gets the forward vector of this subject. More...
|
| |
| Vector3 | Right [get] |
| | Gets the right vector of this subject. More...
|
| |
| float | Visibility [get] |
| | Gets the level of visibility of this subject. More...
|
| |
| float | Occlusion [get] |
| | Returns the fraction of the subject which is hidden by other geometry More...
|
| |
| float | ProjectionSize [get] |
| | Gets the size of the projection of this subject on screen. The size is defined as the largest dimension (i.e. height or width) of the character on the screen devided by the respective screen size More...
|
| |
| Bounds | ScreenBounds [get] |
| | Gets the screen bounds. More...
|
| |
| Vector3 | PositionOnScreen [get] |
| | Gets the position on screen of this ubject. The position is defined in 2D coordinates with the lower left corner corresponding to (0,0) and the upper right to (1,1) More...
|
| |
The Actor is one of the two main component of CamOn, it handles the estimation of all the parameters of a subect in a shot. It supports a number of custom shapes used to represent the target object
| Vector2 Actor.CalculateRelativeCameraAngle |
( |
float |
desiredHorizontalAngle, |
|
|
float |
desiredVerticalAngle |
|
) |
| |
Calculates angle between the current camera direction and a desired camera direction.
- Returns
- The relative horizontal an vertical camera angle in degrees.
- Parameters
-
| desiredHorizontalAngle | Desired horizontal angle. |
| desiredVerticalAngle | Desired vertical angle. |
| static Actor Actor.Create |
( |
Transform |
t, |
|
|
PrimitiveType |
shape, |
|
|
Vector3 |
offset, |
|
|
Vector3 |
scale |
|
) |
| |
|
static |
Creates and actor for a specifi transform
- Parameters
-
| t | The transform on which to attach the actor. |
| shape | The shape of the actor. |
| offset | The offset of the actor within the transfrom. |
| scale | The scale of the actor within the transfrom. |
| bool Actor.Occluded |
( |
SamplePoint |
c | ) |
|
Check if a specific sample point is occluded
- Parameters
-
| void Actor.Reevaluate |
( |
Camera |
camera | ) |
|
Calculates all actor's screen values given a specific camera.
- Parameters
-
| static void Actor.ReevaluateAll |
( |
Actor[] |
actors, |
|
|
Camera |
camera |
|
) |
| |
|
static |
Reevaluates a list of actors.
- Parameters
-
| actors | The list fo actors. |
| camera | Camera. |
| void Actor.SetAreaOfInterest |
( |
Vector3 |
scale, |
|
|
Vector3 |
offset |
|
) |
| |
Sets the area of interest of an Actor. Used by CameraOperator to qhen a shot is selected
- Parameters
-
| scale | Size of the are of interest. |
| offset | Position of the area of interest. |
| bool Actor.IgnoreRotation = false |
If true the actors does not follow the transform rotation
Gets the forward vector of this subject.
The forward vector.
Gets or sets a value indicating whether this SubjectEvaluator is ignored.
true
if ignored; otherwise, false
.
Returns the fraction of this subject which is included in the vew frustum
[0,1] The fraction in frustum.
Returns the name of the game object associated to this subject
The name.
Returns the fraction of the subject which is hidden by other geometry
[0,1] The occluded fraction.
Gets or sets the offset for ths subject.
The offset.
| Quaternion Actor.Orientation |
|
get |
Gets the orientation.
The orientation.
Gets the position of this subject in world coordinates.
The position.
| Vector3 Actor.PositionOnScreen |
|
get |
Gets the position on screen of this ubject. The position is defined in 2D coordinates with the lower left corner corresponding to (0,0) and the upper right to (1,1)
[0,1] The position on screen.
| float Actor.ProjectionSize |
|
get |
Gets the size of the projection of this subject on screen. The size is defined as the largest dimension (i.e. height or width) of the character on the screen devided by the respective screen size
[0,1] The size of the projection.
Gets the right vector of this subject.
The right vector.
Gets and sets the scale mdifier for this subject
The scale.
| Bounds Actor.ScreenBounds |
|
get |
Gets the screen bounds.
The screen bounds.
| PrimitiveType Actor.Shape |
|
getset |
Gets or sets the shape of the actor.
The actor's shape.
| Vector3 Actor.VantageDirection |
|
get |
Returns the direction from which the camera should frame this subject
The vantage direction.
Gets the level of visibility of this subject.
[0,1] The fraction of the subject visible.
| Vector3 Actor.VolumeOfInterestSize |
|
get |
Gets the size of the volume of interest.
The size of the volume of interest.
The documentation for this class was generated from the following file:


Detecting markers of politeness in English natural language. This package allows researchers to easily visualize and quantify politeness between groups of documents. This package combines prior research on the linguistic markers of politeness (Brown & Levinson, 1987 <http://psycnet.apa.org/record/1987-97641-000>; Danescu-Niculescu-Mizil et al., 2013 <arXiv:1306.6078>; Voigt et al., 2017 <doi:10.1073/pnas.1702413114>). We thank the Spencer Foundation, the Hewlett Foundation, and Harvard's Institute for Quantitative Social Science for support.
| Version: | 0.2.6 |
| Depends: | R (≥ 2.10) |
| Imports: | tm, quanteda, ggplot2, parallel, spacyr, textir, glmnet, data.table, stringr |
| Suggests: | knitr, rmarkdown, testthat |
| Published: | 2018-10-30 |
| Author: | Mike Yeomans, Alejandro Kantor, Dustin Tingley |
| Maintainer: | Mike Yeomans <yeomans at fas.harvard.edu> |
| License: | MIT + file LICENSE |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | politeness results |
| Reference manual: | politeness.pdf |
| Vignettes: |
Politeness |
| Package source: | politeness_0.2.6.tar.gz |
| Windows binaries: | r-devel: politeness_0.2.6.zip, r-release: politeness_0.2.6.zip, r-oldrel: politeness_0.2.6.zip |
| OS X binaries: | r-release: politeness_0.2.6.tgz, r-oldrel: politeness_0.2.6.tgz |
| Old sources: | politeness archive |
Please use the canonical form https://CRAN.R-project.org/package=politeness to link to this page.


Order Comfirmation
You will be contacted by our sales rep in a couple of hours in order to discust the details.
1
You will be contacted by our sales rep in a couple of hours in order to discust the details.
Your order will be treated as soon as possible by our stock center and shipped to you in no time.
Enjoy the Tunisian products to the fullest as it's a beatiful country which has a lot to offer.


| Package | Description |
|---|---|
| gameengine.controller | |
| gameengine.model | |
| gameengine.model.Triggers |
| Modifier and Type | Method and Description |
|---|---|
void |
Level.handleTrigger(ITrigger myTrigger)
Calls for the appropriate response upon receiving a particular Trigger
|
void |
ILevel.handleTrigger(ITrigger myTrigger)
Provided with a Trigger object, sets off the appropriate response
|
void |
IGame.handleTrigger(ITrigger myTrigger)
Provided with a Trigger object from the player, sets off the appropriate response
|
void |
Game.handleTrigger(ITrigger myTrigger)
Lets current level handle a trigger
|
| Modifier and Type | Method and Description |
|---|---|
ITrigger |
Rule.getMyTrigger() |
ITrigger |
IRule.getMyTrigger()
Gets the Trigger from the Rule
|
| Modifier and Type | Method and Description |
|---|---|
void |
Rule.setMyTrigger(ITrigger myTrigger) |
| Constructor and Description |
|---|
Rule(ITrigger trigger,
Action action) |
| Modifier and Type | Class and Description |
|---|---|
class |
BottomCollision |
class |
ClickTrigger |
class |
CollisionTrigger |
class |
KeyTrigger |
class |
RightCollision |
class |
SideCollision |
class |
TickTrigger |
class |
TopCollision |


Malappuram: "The Land on the Hilltop"
Enclosed by the Nilgiris in the east and the Arabian Sea on the west, Malappuram is a prominent district in Kerala which is commonly known as "the land on the hilltop."
With ancient monuments, natural spectacles, and the meandering rivers, Malappuram is a blend of history and heritage. Home to the Zamorins of Kozhikode and legendary poets, writers and artists; the culture and traditions of this region are unmatched. It is an important religious centre for Hindus and Muslims as well.
On your visit to Malappuram, make sure to experience the Thirumandham Kunnu Pooram festival, which is a cultural feat and attended by countless devotees around Kerala. With historical monuments, natural wonders, aesthetic art forms and traditional cuisine, Malappuram is replete with all that a traveller could wish for.
Top Destinations
Teak Museum & Bio-resources Nature Park
Adyanpara Waterfall
Conolly's Plot
Nedumkayam Rain Forest
Enclosed by the Nilgiris in the east and the Arabian Sea on the west, Malappuram is a prominent district in Kerala which is commonly known as "the land on the hilltop." With ancient monuments, natural spectacles, and the meandering rivers, Malappuram is a blend of history and heritage. Home to the Zamorins of Kozhikode and legendary poets, writers and artists; the culture and traditions of this region are unmatched. It is an important religious centre for Hindus and Muslims as well. On your visit to Malappuram, make sure to experience the Thirumandham Kunnu Pooram festival, which is a cultural feat and attended by countless devotees around Kerala. With historical monuments, natural wonders, aesthetic art forms and traditional cuisine, Malappuram is replete with all that a traveller could wish for.


| Type | Command |
|---|---|
| 1 user from GitHub to 'root' user | ./addkeys -u ashleyhindle |
| 2 users from GitHub to 'root' user | ./addkeys -u ashleyhindle,baby.driver |
| 1 user from GitHub to 'sysops' user | ./addkeys -f /home/sysops/.ssh/authorized_keys -u ashleyhindle |
| 1 user from private GitLab to 'root' user | ./addkeys -b https://gitlab.companyname.com -u ashleyhindle |
| 1 user from private GitLab to 'sysops' user | ./addkeys -b https://gitlab.companyname.com -f /home/sysops/.ssh/authorized_keys -u ashleyhindle |


{{ define "main" }}
Already Signed up?Click to access your Lifafa
To retrive your password please enter your mobile number.


/*******************************************************************************
* Copyright 2018 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************/
//Module dependencies.
var ezmqErrorCodes = require('../build/Release/ezmq.node');
//Expose bindings as the module.
exports = module.exports = ezmqErrorCodes;
/**
* Represents EZMQ stack error codes.
*/
var EZMQErrorCode = (exports.EZMQErrorCode = {
/** Success case */
EZMQ_OK: 0,
/** ERROR */
EZMQ_ERROR: 1,
/** INVALID TOPIC */
EZMQ_INVALID_TOPIC: 2,
/** INVALID CONTENT_TYPE */
EZMQ_INVALID_CONTENT_TYPE: 3,
});
var ezmqStatusCodes = require('../build/Release/ezmq.node');
exports = module.exports = ezmqStatusCodes;
/**
* Represents EZMQ stack Status codes.
*/
var EZMQStatusCode = (exports.EZMQStatusCode = {
/** UNKNOWN Status */
EZMQ_UNKNOWN: 0,
/** CONSTRUCTED */
EZMQ_CONSTRUCTED: 1,
/** INITAILIZED */
EZMQ_INITAILIZED: 2,
/** TERMINATED */
EZMQ_TERMINATED: 3,
});
var ezmqContentType = require('../build/Release/ezmq.node');
exports = module.exports = ezmqContentType;
/**
* Represents EZMQ message's content types.
*/
var EZMQContentType = (exports.EZMQContentType = {
/** PROTOBUF */
EZMQ_CONTENT_TYPE_PROTOBUF: 0,
/** BYTEDATA */
EZMQ_CONTENT_TYPE_BYTEDATA: 1,
/** AML */
EZMQ_CONTENT_TYPE_AML: 2,
/** JSON */
EZMQ_CONTENT_TYPE_JSON: 3,
});


Toggle navigation
FloraFauna
Home
News
Article
Gallery
Events
About Us
Contact Us
Our Mission Is To Help Keep The World’s Information Free And Accessible
With the right team, the right resources, and the right backers
View More


Kylie Jenner Is The Queen Of Sultry Mirror Selfies, We Got Them For Ya
by SpotboyENot just a youngest self-made billionaire, Kylie Jenner is one of the most followed celebrities on social media. The entrepreneur loves to stay connected with fans and often shares her pictures on Instagram. Our favourite though are her mirror selfies
Mirror, mirror on the wall, who is the most beautiful of all? Kylie Jenner often asks this question, and there comes to answer - YOU. That's something that we are guessing considering her love for mirror selfies.  It won't be wrong to say that Kylie is the Queen of Mirror Selfies and we love how her beauty reflects in all these images. If you want to gain millions of followers on the photo-sharing app, this is the trick you must learn from Kylie Jenner.
You may think that we are boasting out of proportion, but we have got proofs too! Kylie Jenner has indeed done specialization in clicking perfect glamorous pictures in front of the huge glass that helps her capture her own beauty. Just like the ones shared below. In a Chanel Pink top and a black mini-dress, Kylie is striking a sultry pose and we love it. (Also Read: Did Caitlyn Jenner Just Reveal About Kylie Jenner's Second Pregnancy? Fans Think So)
And that flash doesn't harm much
Now, that's the sexiest mirror selfie we have ever seen.
Isn't that a great way of showing off your wealth, huh? We are so J of that Chanel bag.
What do you do when you wear a leopard printed outfit, click a mirror selfie.
Why should mirrors be restricted to clicking selfies? Kylie is great at capturing videos too!
Now, didn't we say Kylie is the Queen of Mirror selfies? Keep them coming, lady. We love it.
Image Source: Instagram/kyliejenner


RS Spyder V12 873hp.
Our dream was to create a one-of-a-kind open-top car. We made it come true with the RS Spyder V12, an unrivaled gem of a supercar. Equipped with an exclusive technology package, the jewel in this car's crown is its carbon fiber monocoque. The elegance and vanity of a Spyder meet the power of a naturally aspirated 6.5 liter V-12 engine putting out 515 kW (700 CV), with incredible torque available at all engine speeds. The RS Spyder is an open-top supercar that combines sportiness and style.
New Matrix LED technology
They provide high-precision illumination, have individually controllable light-emitting diodes and a crystalline sheen: the innovative Matrix LED headlights for the new and improved SUV provide a special driving experience at night – and set new standards in safety.They are activated and deactivated or dimmed individually by a control unit. A camera in the vehicle ensures that other vehicles are detected.
We open the new factory of company
The new facility will be built by SUV MOTORS, a joint venture involving Toyota Tsusho and Malaysian conglomerate UMW Holdings, at an estimated cost of 30 billion yen ($275 million). It is slated to come online as early as 2018, churning out 50,000 vehicles a year. The new facility will produce small cars, with annual capacity potentially rising to 100,000 vehicles.
Now we produced our first electric car
Electric Cars use the energy stored in a battery (or series of batteries) for vehicle propulsion. Electric motors provide a clean and safe alternative to the internal combustion engine. There are many pros and cons about electric cars. The electric vehicle is known to have faster acceleration but shorter distance range than conventional engines.
The future belongs to those who have a great history!
As a company, we’re proud of our role in the global economies creating thousands of jobs while pursuing automotive excellence in the world. With a deep commitment to our founding principles, SUV will remain at the forefront of the luxury automotive industry for years to come.


Using Serious Game for Construction Education in Hong Kong
Nov 11, 2016
This is the web version of my undergraduate dissertation for Bachelor of Science in Building Engineering and Management degree. I experimented with a solution to the problems in undergraduate construction education, by designing and developing a serious game and integrating it into teaching and learning environment.


@@include('../partials/head/head.html')
@@include('../partials/components/header.html')
@@include('../partials/components/banner.html')
@@include('../partials/components/services.html')
@@include('../partials/components/work.html')
@@include('../partials/components/timer.html')
@@include('../partials/components/footer.html')
@@include('../partials/scripts/common.html')


Simply select a chord and it's modifiers then hovertaphover/tap over the guitar to to view the chord formation at that position.Still confused?


News
- [Mar 2023] My NSF CCRI Proposal Enabling
Computer Architecture Simulation as a Service
has been awarded! Thanks to NSF and my collaborator Kate Isaacs!
- [Feb 2023] My NSF CRII Proposal Building
Explainable Architecture with Simulation and Visualization
Techniques has been awarded! Thank you NSF!
- [Jan 2023] Our paper What Do We Mean When
We Talk about Trust in
Social Media?
A Systematic Review has been accepted by CHI '23.
- [Dec 2022] Our book Accelerated Computing
with HIP is published!
It is available on Amazon
or Barnes
& Noble.
- [Aug 2022] Out CHIP dataset has been
highlighted by the "Data
Is Plural" column of FiveThirtyEight.


Nelson Mandela Bay drowning in 'all sorts of rubbish, including dead dogs'
by Mkhuseli SizaniRubbish is piling up on the corners of streets in Nelson Mandela Bay, next to clinics, hospitals, churches, schools, initiation schools, roads, dams and storm water pipes. Yet, according to the mayor’s office, this is one of the cleanest cities in South Africa.
In July, Mayor Mongameli Bobani allocated R40m to fight illegal dumping and littering in the 2019-20 financial year. The municipality introduced a Clean and Green Programme and partnered with 43 cooperatives to reduce dumping, GroundUp reports.
But it seems the municipality is losing the battle.
'This has been going on for more than 10 years'
Vukile Nqoba of Zwide township in Port Elizabeth lives next to the Dora Nginza Hospital’s boundary wall.
"Everyday I pick up used nappies, papers and plastics in front of my house.  Some of them come in bakkies and cars.

Nqoba says objecting to this illegal dumping has made him many enemies.
"I tried to scare them by threatening to report them to the municipality. But they tell me that they don’t care. I have even tried to call the municipality to intervene, but they just tell me to write down the [vehicle] registration numbers.
"This has been going on for more than 10 years now. I have small kids who have to endure these stinking conditions. This is a hospital, but people have no respect for that," he said.
Nqoba said the municipality collected domestic garbage once a week, "but this heap of rubbish is only removed after two or three months".
Along the Old Uitenhage Road, between Govan Mbeki and Missionvale townships, rubbish is lying next to the road. Mita Arends of Missionvale says: "When Missionvale RDP houses were built in 2014, constructors dumped the rubble on this open field.
"We thought they were dumping the rubble temporarily while they were busy with the construction. But that opened an opportunity for other people to come and dump here."
She said the workers from the cooperatives, partnering with the City, only picked up papers in the street and were not responsible for the illegal dumpsites.
Thamsanqa Lali of Soweto-on-Sea said: "It breaks my heart to see Soweto-on-Sea taxi rank filthy like this. This is a historic place, because this is where most of the protests against the apartheid regime were held.
"We do see the municipal cooperatives’ workers in our area, but their presence makes no difference."
ALSO READ: Rubbish strewn on streets of Pretoria as municipal workers' strike continues
Mayoral spokesperson George Geleba said: "Nelson Mandela Bay continues to be considered one of the cleanest cities in South Africa. Just this year in September, Deputy Minister of Environment, Forestry and Fisheries Maggie Sotyu awarded the City as the most improved metro in the greening of cities and towns in South Africa, despite the challenges that we face with illegal dumping."
He said the cooperatives were helping the municipality reach areas that rubbish trucks could not reach, and would also help with community awareness programmes, as well as cleaning up illegal dump sites and picking up roadside litter.
Geleba said "a comprehensive strategy" had been implemented to eliminate illegal dumping. Asked what the strategy was, he said: "It means we have strategic plans and projects in the pipeline to assist us to eliminate illegal dumping such as waste to energy, war on waste and beefing up the refuse collection fleet."

"We will share the implementation as it happens," he said.


A talented data scientist with strong background in realtime big data solutions and contextual relevance frameworks.
You will work as part of the core team and help us discover the information hidden in vast amounts of data, making smarter decisions and contextual relevance in order to deliver even better products. Your primary focus will be in applying data mining techniques, doing statistical analysis, and building high quality prediction systems integrated with our products.
Excellent understanding of machine learning techniques and algorithms, such as k-NN, Naive Bayes, SVM, Decision Forests, etc.
Experience with common data science toolkits, such as R, Weka, NumPy, MatLab, etc. Excellence in at least one of these is highly desirable
Great communication skills
Experience with data visualisation tools, such as D3.js, GGplot, etc.
Proficiency in using languages and query languages such as SQL, Python, C#, C++, R, Hive, Pig
Experience with NoSQL databases, such as MongoDB, Cassandra, HBase, Realm
Good applied statistics skills, such as distributions, statistical testing, regression, etc.
Good scripting and programming skills C#, Python, Java, Android Studio
Data-oriented personality
MS or PhD in Data Science or comparable field strongly preferred. However, overwhelming weight will be given to experience and prior accomplishments.


| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
MADPPlannerFactory.MAVIPlannerFactory.jointRewardFunction
The joint reward function
|
| Constructor and Description |
|---|
MAVIPlannerFactory(SGDomain domain,
JointModel jointModel,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
double qInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
MAVIPlannerFactory(SGDomain domain,
JointModel jointModel,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
QFunction qInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
MAVIPlannerFactory(SGDomain domain,
List<SGAgentType> agentDefinitions,
JointModel jointModel,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
QFunction qInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
MADynamicProgramming.jointRewardFunction
The joint reward function
|
| Modifier and Type | Method and Description |
|---|---|
void |
MADynamicProgramming.initMAVF(SGDomain domain,
List<SGAgentType> agentDefinitions,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
ValueFunction vInit,
SGBackupOperator backupOperator)
Initializes all the main datstructres of the value function valueFunction
|
| Constructor and Description |
|---|
MAValueIteration(SGDomain domain,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
double qInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
MAValueIteration(SGDomain domain,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
ValueFunction qInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
MAValueIteration(SGDomain domain,
List<SGAgentType> agentDefinitions,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
double vInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
MAValueIteration(SGDomain domain,
List<SGAgentType> agentDefinitions,
JointRewardFunction jointRewardFunction,
TerminalFunction terminalFunction,
double discount,
HashableStateFactory hashingFactory,
ValueFunction vInit,
SGBackupOperator backupOperator,
double maxDelta,
int maxIterations)
Initializes.
|
| Modifier and Type | Class and Description |
|---|---|
static class |
GridGame.GGJointRewardFunction
Specifies goal rewards and default rewards for agents.
|
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SingleStageNormalFormGame.SingleStageNormalFormJointRewardFunction
A Joint Reward Function class that uses the parent domain generators payout matrix to determine payouts for any given strategy profile.
|
| Modifier and Type | Method and Description |
|---|---|
JointRewardFunction |
SingleStageNormalFormGame.getJointRewardFunction()
Returns a
JointRewardFunction function for this game. |
| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
SGAgentBase.internalRewardFunction |
| Modifier and Type | Method and Description |
|---|---|
JointRewardFunction |
SGAgentBase.getInternalRewardFunction()
Returns the internal reward function used by the agent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
SGAgentBase.setInternalRewardFunction(JointRewardFunction rf) |
| Modifier and Type | Class and Description |
|---|---|
class |
NullJointRewardFunction
A Joint reward function that always returns zero reward for each agent.
|
| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
AgentFactoryWithSubjectiveReward.internalReward |
| Constructor and Description |
|---|
AgentFactoryWithSubjectiveReward(AgentFactory baseFactory,
JointRewardFunction internalReward)
Initializes the factory.
|
| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
ConstantWorldGenerator.jointRewardFunctionModel |
| Modifier and Type | Method and Description |
|---|---|
protected void |
ConstantWorldGenerator.CWGInit(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg,
StateMapping abstractionForAgents) |
| Constructor and Description |
|---|
ConstantWorldGenerator(SGDomain domain,
JointModel jam,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg)
Deprecated.
|
ConstantWorldGenerator(SGDomain domain,
JointModel jam,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg,
StateMapping abstractionForAgents)
Deprecated.
|
ConstantWorldGenerator(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg)
Initializes the WorldGenerator.
|
ConstantWorldGenerator(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg,
StateMapping abstractionForAgents)
Initializes the WorldGenerator.
|
| Modifier and Type | Field and Description |
|---|---|
protected JointRewardFunction |
World.jointRewardFunction |
| Modifier and Type | Method and Description |
|---|---|
JointRewardFunction |
World.getRewardFunction()
Returns the
JointRewardFunction function used in this world. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
World.init(SGDomain domain,
JointModel jam,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg,
StateMapping abstractionForAgents) |
| Constructor and Description |
|---|
World(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
State initialState)
Initializes the world.
|
World(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg)
Initializes the world.
|
World(SGDomain domain,
JointRewardFunction jr,
TerminalFunction tf,
StateGenerator sg,
StateMapping abstractionForAgents)
Initializes the world
|
Copyright © 2019. All rights reserved.


EE M202A Group Assignment F2014
Functionality Requirement: Sensing
1) 0-1 Events
2) Light Sensor
3) ADC Channel #0 Sampling Control
1 Hz
10 Hz
100 Hz
Off
Functionality Requirement: Actuation
1) Digital Output Pin/LED Toggle
2) Analog Output Pin Controller
1 Hz
10 Hz
100 Hz
1000 Hz


public class DbDump
extends java.lang.Object
When using this utility as a command line program, and the application uses custom key comparators, be sure to add the jars or classes to the classpath that contain the application's comparator classes.
java { com.sleepycat.je.util.DbDump | -jar je-<version>.jar DbDump } -h <dir> # environment home directory [-f <fileName>] # output file, for non -rR dumps [-l] # list databases in the environment [-p] # output printable characters [-r] # salvage mode [-R] # aggressive salvage mode [-d] <directory> # directory for *.dump files (salvage mode) [-s <databaseName>] # database to dump [-v] # verbose in salvage mode [-V] # print JE version numberSee
main(java.lang.String[])
for a full description of the
command line arguments.
To dump a database to a stream from code:
DbDump dump = new DbDump(env, databaseName, outputStream, boolean); dump.dump();
Because a DATA=END
marker is used to terminate the dump of
each database, multiple databases can be dumped and loaded using a single
stream. The dump()
method leaves the stream positioned after
the last line written and the DbLoad.load()
method leaves the stream
positioned after the last line read.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
dbName |
protected boolean |
doAggressiveScavengerRun |
protected boolean |
doScavengerRun |
protected Environment |
env |
protected java.io.File |
envHome |
protected boolean |
formatUsingPrintable |
protected java.lang.String |
outputDirectory |
protected java.io.PrintStream |
outputFile |
protected boolean |
verbose |
| Constructor and Description |
|---|
DbDump(Environment env,
java.lang.String dbName,
java.io.PrintStream outputFile,
boolean formatUsingPrintable)
Create a DbDump object for a specific environment and database.
|
DbDump(Environment env,
java.lang.String dbName,
java.io.PrintStream outputFile,
java.lang.String outputDirectory,
boolean formatUsingPrintable)
Deprecated.
Please use the 4-arg ctor without outputDirectory instead.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dump()
Perform the dump.
|
protected void |
dumpOne(java.io.PrintStream o,
byte[] ba,
boolean formatUsingPrintable) |
static void |
main(java.lang.String[] argv)
The main used by the DbDump utility.
|
protected void |
openEnv(boolean doRecovery) |
protected boolean |
parseArgs(java.lang.String[] argv) |
protected void |
printHeader(java.io.PrintStream o,
boolean dupSort,
boolean formatUsingPrintable) |
protected void |
printUsage(java.lang.String msg) |
protected java.io.File envHome
protected Environment env
protected java.lang.String dbName
protected boolean formatUsingPrintable
protected java.lang.String outputDirectory
protected java.io.PrintStream outputFile
protected boolean doScavengerRun
protected boolean doAggressiveScavengerRun
protected boolean verbose
@Deprecated public DbDump(Environment env, java.lang.String dbName, java.io.PrintStream outputFile, java.lang.String outputDirectory, boolean formatUsingPrintable)
public DbDump(Environment env, java.lang.String dbName, java.io.PrintStream outputFile, boolean formatUsingPrintable)
env
- The Environment containing the database to dump.dbName
- The name of the database to dump.outputFile
- The output stream to dump the database to.formatUsingPrintable
- true if the dump should use printable
characters.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- The arguments accepted by the DbDump utility.
usage: java { com.sleepycat.je.util.DbDump | -jar je-<version>.jar DbDump } [-f output-file] [-l] [-p] [-V] [-s database] -h dbEnvHome [-rR] [-v] [-d directory]
This option recreates the Btree structure in memory, so as large a heap size as possible should be specified. If -r cannot be used due to insufficient memory, use -R instead.
When used on uncorrupted data files, this option should return equivalent data to a normal dump, but most likely in a different order; in other words, it should output a transactionally correct data set. However, there is one exception where not all committed records will be output:
The records for all databases are output. The records for each database are saved into <databaseName>.dump files in the current directory.
Unlike -r, the -R option does not recreate the Btree structure in memory. However, it does use a bit set to track all committed transactions, so as large a heap size as possible should be specified.
-R also differs from -r in that -R does not return a transactionally correct data set. This is because the Btree information is not reconstructed in memory. Therefore, data dumped in this fashion will almost certainly have to be edited by hand or other means before or after the data is reloaded. Be aware of the following abnormalities.
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.java.lang.Exception
protected void printUsage(java.lang.String msg)
protected boolean parseArgs(java.lang.String[] argv) throws java.io.IOException
java.io.IOException
protected void openEnv(boolean doRecovery) throws EnvironmentNotFoundException, EnvironmentLockedException
public void dump() throws EnvironmentNotFoundException, EnvironmentLockedException, DatabaseNotFoundException, java.io.IOException
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.java.io.IOException
- in subclasses.EnvironmentNotFoundException
EnvironmentLockedException
DatabaseNotFoundException
protected void printHeader(java.io.PrintStream o, boolean dupSort, boolean formatUsingPrintable)
protected void dumpOne(java.io.PrintStream o, byte[] ba, boolean formatUsingPrintable)
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.


Weekly Witness Update
As a witness, I feel it is useful to have a weekly report, which will be produced every weekend at the hashtag #witness-report
Last Report
@justyy ‘s Weekly Witness Report - 14/Oct/2018
Witness Informatoin
My witness server (Witness Information): (Germany) 10 cores of Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz, 50 GB RAM, 1200 GB SSD, 1000 Mbit/s port, Upstream 130 Gbits, Ubuntu 16.04.
Block produced in last 7 days
88 blocks produced in last 7 days and rewarded<PHONE_NUMBER> VESTS in total (approximately 90.4399 Steem Power).
Vote For STEEM To Get A Free Listing On NETCOINs & Win Oracle-D Upvotes [CONTEST]
The biggest event of this week is to vote for STEEM to be listed on NetCoins! I have done a Chinese translation and share it among the CN community (many wechat groups)
请为STEEM投票，让STEEM上NETCoins 并且得到 Oracle-D 的点赞（竞赛）
I’ve also voted every day, so let’s do it before deadline 20th Oct (tomorrow)
Vote STEEM here: http://contest.gonetcoins.com/
I am waiting and waiting… finally vote today!
Reviews
Two articles reviews the benefits of delegating to @justyy
Utopian Moderations
- [R pinyin: New Features] User customized dictionaries
- Steem Messenger V0.0.6 : Deep dive in the cryptography updates
- SteemPlus 3.3 : Delegate to @steem-plus to earn SPP
Blog posts
- The C++ Function to Compute the Average of Numbers
- How to Transform the Values in Excel Files to a Column of Values?
- Parity Sorting the Array by Index
- How to Find Smallest Letter Greater Than Target?
- How to Solve Adsense Ads Showing Blank Yellow Block – by Adding the Site to the Verified List
VPS Database and Search Tool
- VPS Search Tool & Database
- Update: VPS Database and Search Tool with Sorting and Pagination
- Update: VPS Database and Search Tool
Chinese Posts 中文
Enjoy and Steem On!
Vote for me or Set me as a witness Proxy - Every vote counts! - Thank you!
Your Vote is much appreciated, and every vote counts.
Check out My Witness Page
Support me and my work as a witness - witness thread by
- voting me here, or
- voting me as a witness proxy - let @justyy represent you.
Thank you! Some of My Contributions: SteemYY.com - SteemIt Tutorials, Robots, Tools and APIs and VPS Search Tool
This page is synchronized from the post: ‘@justyy ‘’s Weekly Witness Report - 20/Oct/2018’


Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱 to focus.
The development of the Imp language in Imp.v completely ignores
issues of concrete syntax -- how an ascii string that a programmer
might write gets translated into abstract syntax trees defined by
the datatypes aexp, bexp, and com. In this chapter, we
illustrate how the rest of the story can be filled in by building
a simple lexical analyzer and parser using Coq's functional
programming facilities.
It is not important to understand all the details here (and
accordingly, the explanations are fairly terse and there are no
exercises). The main point is simply to demonstrate that it can
be done. You are invited to look through the code -- most of it
is not very complicated, though the parser relies on some
"monadic" programming idioms that may require a little work to
make out -- but most readers will probably want to just skim down
to the Examples section at the very end to get the punchline.
Set Warnings "-notation-overridden,-parsing". From Coq Require Import Strings.String. From Coq Require Import Strings.Ascii. From Coq Require Import Arith.Arith. From Coq Require Import Init.Nat. From Coq Require Import Arith.EqNat. From Coq Require Import Lists.List. Import ListNotations. From LF Require Import Maps Imp. (* ################################################################# *)
(* ================================================================= *)
Definition isWhite (c : ascii) : bool := let n := nat_of_ascii c in orb (orb (n =? 32) (* space *) (n =? 9)) (* tab *) (orb (n =? 10) (* linefeed *) (n =? 13)). (* Carriage return. *) Notation "x '<=?' y" := (x <=? y) (at level 70, no associativity) : nat_scope. Definition isLowerAlpha (c : ascii) : bool := let n := nat_of_ascii c in andb (97 <=? n) (n <=? 122). Definition isAlpha (c : ascii) : bool := let n := nat_of_ascii c in orb (andb (65 <=? n) (n <=? 90)) (andb (97 <=? n) (n <=? 122)). Definition isDigit (c : ascii) : bool := let n := nat_of_ascii c in andb (48 <=? n) (n <=? 57). Inductive chartype := white | alpha | digit | other. Definition classifyChar (c : ascii) : chartype := if isWhite c then white else if isAlpha c then alpha else if isDigit c then digit else other. Fixpoint list_of_string (s : string) : list ascii := match s with | EmptyString => [] | String c s => c :: (list_of_string s) end. Fixpoint string_of_list (xs : list ascii) : string := fold_right String EmptyString xs. Definition token := string. Fixpoint tokenize_helper (cls : chartype) (acc xs : list ascii) : list (list ascii) := let tk := match acc with [] => [] | _::_ => [rev acc] end in match xs with | [] => tk | (x::xs') => match cls, classifyChar x, x with | _, _, "(" => tk ++ ["("]::(tokenize_helper other [] xs') | _, _, ")" => tk ++ [")"]::(tokenize_helper other [] xs') | _, white, _ => tk ++ (tokenize_helper white [] xs') | alpha,alpha,x => tokenize_helper alpha (x::acc) xs' | digit,digit,x => tokenize_helper digit (x::acc) xs' | other,other,x => tokenize_helper other (x::acc) xs' | _,tp,x => tk ++ (tokenize_helper tp [x] xs') end end %char. Definition tokenize (s : string) : list string := map string_of_list (tokenize_helper white [] (list_of_string s)).tokenize "abc12=3 223*(3+(a+c))" = ["abc"%string; "12"%string; "="%string; "3"%string; "223"%string; "*"%string; "("%string; "3"%string; "+"%string; "("%string; "a"%string; "+"%string; "c"%string; ")"%string; ")"%string]reflexivity. Qed. (* ================================================================= *)tokenize "abc12=3 223*(3+(a+c))" = ["abc"%string; "12"%string; "="%string; "3"%string; "223"%string; "*"%string; "("%string; "3"%string; "+"%string; "("%string; "a"%string; "+"%string; "c"%string; ")"%string; ")"%string]
(* ----------------------------------------------------------------- *)
An option type with error messages:
Inductive optionE (X:Type) : Type := | SomeE (x : X) | NoneE (s : string). Arguments SomeE {X}. Arguments NoneE {X}.
Some syntactic sugar to make writing nested match-expressions on
optionE more convenient.
Notation "' p <- e1 ;; e2" := (match e1 with | SomeE p => e2 | NoneE err => NoneE err end) (right associativity, p pattern, at level 60, e1 at next level). Notation "'TRY' ' p <- e1 ;; e2 'OR' e3" := (match e1 with | SomeE p => e2 | NoneE _ => e3 end) (right associativity, p pattern, at level 60, e1 at next level, e2 at next level). (* ----------------------------------------------------------------- *)
Open Scope string_scope. Definition parser (T : Type) := list token -> optionE (T * list token). Fixpoint many_helper {T} (p : parser T) acc steps xs := match steps, p xs with | 0, _ => NoneE "Too many recursive calls" | _, NoneE _ => SomeE ((rev acc), xs) | S steps', SomeE (t, xs') => many_helper p (t :: acc) steps' xs' end.
A (step-indexed) parser that expects zero or more ps:
Fixpoint many {T} (p : parser T) (steps : nat) : parser (list T) :=
many_helper p [] steps.
A parser that expects a given token, followed by p:
Definition firstExpect {T} (t : token) (p : parser T)
: parser T :=
fun xs => match xs with
| x::xs' =>
if string_dec x t
then p xs'
else NoneE ("expected '" ++ t ++ "'.")
| [] =>
NoneE ("expected '" ++ t ++ "'.")
end.
A parser that expects a particular token:
Definition expect (t : token) : parser unit := firstExpect t (fun xs => SomeE (tt, xs)). (* ----------------------------------------------------------------- *)
Identifiers:
Definition parseIdentifier (xs : list token)
: optionE (string * list token) :=
match xs with
| [] => NoneE "Expected identifier"
| x::xs' =>
if forallb isLowerAlpha (list_of_string x) then
SomeE (x, xs')
else
NoneE ("Illegal identifier:'" ++ x ++ "'")
end.
Numbers:
Definition parseNumber (xs : list token)
: optionE (nat * list token) :=
match xs with
| [] => NoneE "Expected number"
| x::xs' =>
if forallb isDigit (list_of_string x) then
SomeE (fold_left
(fun n d =>
10 * n + (nat_of_ascii d -
nat_of_ascii "0"%char))
(list_of_string x)
0,
xs')
else
NoneE "Expected number"
end.
Parse arithmetic expressions
Fixpoint parsePrimaryExp (steps:nat) (xs : list token) : optionE (aexp * list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => TRY ' (i, rest) <- parseIdentifier xs ;; SomeE (AId i, rest) OR TRY ' (n, rest) <- parseNumber xs ;; SomeE (ANum n, rest) OR ' (e, rest) <- firstExpect "(" (parseSumExp steps') xs ;; ' (u, rest') <- expect ")" rest ;; SomeE (e,rest') end with parseProductExp (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => ' (e, rest) <- parsePrimaryExp steps' xs ;; ' (es, rest') <- many (firstExpect "*" (parsePrimaryExp steps')) steps' rest ;; SomeE (fold_left AMult es e, rest') end with parseSumExp (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => ' (e, rest) <- parseProductExp steps' xs ;; ' (es, rest') <- many (fun xs => TRY ' (e,rest') <- firstExpect "+" (parseProductExp steps') xs ;; SomeE ( (true, e), rest') OR ' (e, rest') <- firstExpect "-" (parseProductExp steps') xs ;; SomeE ( (false, e), rest')) steps' rest ;; SomeE (fold_left (fun e0 term => match term with | (true, e) => APlus e0 e | (false, e) => AMinus e0 e end) es e, rest') end. Definition parseAExp := parseSumExp.
Parsing boolean expressions:
Fixpoint parseAtomicExp (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => TRY ' (u,rest) <- expect "true" xs ;; SomeE (BTrue,rest) OR TRY ' (u,rest) <- expect "false" xs ;; SomeE (BFalse,rest) OR TRY ' (e,rest) <- firstExpect "~" (parseAtomicExp steps') xs ;; SomeE (BNot e, rest) OR TRY ' (e,rest) <- firstExpect "(" (parseConjunctionExp steps') xs ;; ' (u,rest') <- expect ")" rest ;; SomeE (e, rest') OR ' (e, rest) <- parseProductExp steps' xs ;; TRY ' (e', rest') <- firstExpect "=" (parseAExp steps') rest ;; SomeE (BEq e e', rest') OR TRY ' (e', rest') <- firstExpect "<=" (parseAExp steps') rest ;; SomeE (BLe e e', rest') OR NoneE "Expected '=' or '<=' after arithmetic expression" end with parseConjunctionExp (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => ' (e, rest) <- parseAtomicExp steps' xs ;; ' (es, rest') <- many (firstExpect "&&" (parseAtomicExp steps')) steps' rest ;; SomeE (fold_left BAnd es e, rest') end. Definition parseBExp := parseConjunctionExp.Definition testParsing {X : Type} (p : nat -> list token -> optionE (X * list token)) (s : string) := let t := tokenize s in p 100 t.
Parsing commands:
Fixpoint parseSimpleCommand (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => TRY ' (u, rest) <- expect "SKIP" xs ;; SomeE (SKIP%imp, rest) OR TRY ' (e,rest) <- firstExpect "TEST" (parseBExp steps') xs ;; ' (c,rest') <- firstExpect "THEN" (parseSequencedCommand steps') rest ;; ' (c',rest'') <- firstExpect "ELSE" (parseSequencedCommand steps') rest' ;; ' (tt,rest''') <- expect "END" rest'' ;; SomeE(TEST e THEN c ELSE c' FI%imp, rest''') OR TRY ' (e,rest) <- firstExpect "WHILE" (parseBExp steps') xs ;; ' (c,rest') <- firstExpect "DO" (parseSequencedCommand steps') rest ;; ' (u,rest'') <- expect "END" rest' ;; SomeE(WHILE e DO c END%imp, rest'') OR TRY ' (i, rest) <- parseIdentifier xs ;; ' (e, rest') <- firstExpect "::=" (parseAExp steps') rest ;; SomeE ((i ::= e)%imp, rest') OR NoneE "Expecting a command" end with parseSequencedCommand (steps:nat) (xs : list token) := match steps with | 0 => NoneE "Too many recursive calls" | S steps' => ' (c, rest) <- parseSimpleCommand steps' xs ;; TRY ' (c', rest') <- firstExpect ";;" (parseSequencedCommand steps') rest ;; SomeE ((c ;; c')%imp, rest') OR SomeE (c, rest) end. Definition bignumber := 1000. Definition parse (str : string) : optionE com := let tokens := tokenize str in match parseSequencedCommand bignumber tokens with | SomeE (c, []) => SomeE c | SomeE (_, t::_) => NoneE ("Trailing tokens remaining: " ++ t) | NoneE err => NoneE err end. (* ################################################################# *)
parse " TEST x = y + 1 + 2 - y * 6 + 3 THEN x ::= x * 1;; y ::= 0 ELSE SKIP END " = SomeE (TEST "x" = "y" + 1 + 2 - "y" * 6 + 3 THEN "x" ::= "x" * 1;; "y" ::= 0 ELSE SKIP FI)%impparse " TEST x = y + 1 + 2 - y * 6 + 3 THEN x ::= x * 1;; y ::= 0 ELSE SKIP END " = SomeE (TEST "x" = "y" + 1 + 2 - "y" * 6 + 3 THEN "x" ::= "x" * 1;; "y" ::= 0 ELSE SKIP FI)%impreflexivity. Qed.SomeE (TEST "x" = "y" + 1 + 2 - "y" * 6 + 3 THEN "x" ::= "x" * 1;; "y" ::= 0 ELSE SKIP FI)%imp = SomeE (TEST "x" = "y" + 1 + 2 - "y" * 6 + 3 THEN "x" ::= "x" * 1;; "y" ::= 0 ELSE SKIP FI)%impparse " SKIP;; z::=x*y*(x*x);; WHILE x=x DO TEST (z <= z*z) && ~(x = 2) THEN x ::= z;; y ::= z ELSE SKIP END;; SKIP END;; x::=z " = SomeE (SKIP;; "z" ::= "x" * "y" * ("x" * "x");; (WHILE "x" = "x" DO (TEST ("z" <= "z" * "z") && (~ "x" = 2) THEN "x" ::= "z";; "y" ::= "z" ELSE SKIP FI);; SKIP END);; "x" ::= "z")%impparse " SKIP;; z::=x*y*(x*x);; WHILE x=x DO TEST (z <= z*z) && ~(x = 2) THEN x ::= z;; y ::= z ELSE SKIP END;; SKIP END;; x::=z " = SomeE (SKIP;; "z" ::= "x" * "y" * ("x" * "x");; (WHILE "x" = "x" DO (TEST ("z" <= "z" * "z") && (~ "x" = 2) THEN "x" ::= "z";; "y" ::= "z" ELSE SKIP FI);; SKIP END);; "x" ::= "z")%impreflexivity. Qed. (* Wed Jan 9 12:02:46 EST 2019 *)SomeE (SKIP;; "z" ::= "x" * "y" * ("x" * "x");; (WHILE "x" = "x" DO (TEST ("z" <= "z" * "z") && (~ "x" = 2) THEN "x" ::= "z";; "y" ::= "z" ELSE SKIP FI);; SKIP END);; "x" ::= "z")%imp = SomeE (SKIP;; "z" ::= "x" * "y" * ("x" * "x");; (WHILE "x" = "x" DO (TEST ("z" <= "z" * "z") && (~ "x" = 2) THEN "x" ::= "z";; "y" ::= "z" ELSE SKIP FI);; SKIP END);; "x" ::= "z")%imp


the HY project adds artificial sound to electric cars to stimulate plant growth
by lynne myersdespite the numerous advantages hybrid and electric vehicles provide for the environment and our overall health, the issue of sound, or the lack thereof, is yet to be fully resolved. posing a risk to pedestrians that cannot hear an incoming car, recent regulations have come into force in the EU stipulating that all new electric cars must have an acoustic vehicle alert system (avas) by 2021. in anticipation of this, the electric factory and toyota uruguay introduce the HY project: a device that emits a specific frequency of sound that also helps to stimulate plant growth.
all images and videos courtesy of the HY project
the teams at the electric factory and toyota uruguay began the project by asking ‘what if the acoustic vehicle alert systems could contribute to the environment besides being functional?’ global research on how noise affects plants shows that they react to specific waveform spectrum vibrations. when exposed to a certain range of frequencies, plants show better growth and absorption of nutrients. with this information in mind, they developed the HY project, the first avas sound that benefits the environment while also sitting at a frequency that doesn’t add to noise pollution.
the designers have developed the device to be able to be implemented in any vehicle. its microprocessor is capable of dynamically changing the sound of the car to match its speed. sending over 15 billion instructions per second, the human ear can detect the variation in real-time.
project info:
project name: the HY project
design: the electric factory and toyota uruguay


MD4SG is a multi-institutional initiative bringing together researchers and practitioners from over 130 institutions in 50 countries. We take an interdisciplinary approach -- using insights from computer science, social sciences, and humanistic studies as well as collaborations and partnerships with domain experts and impacted communities -- to help improve access to opportunity. We focus on a range of domains from inequality to climate and energy to data economies and civic participation.
The initiative, which is currently co-organized by Rediet Abebe (since Fall 2016), Irene Lo (since Fall 2018), Ana-Andreea Stoica (since Fall 2019), Francisco Marmolejo (since Spring 2020), Wanyi Li (since Fall 2020), and Lily Xu (since April 2021), is a community of nearly 2000 participants and involves activities including working groups, colloquium series, and workshops and tutorials. The initiative is primarily led by junior members and focused on the mission of bringing together a range of expertise to tackle problems impacting marginalized groups around the world. A core of our activities happen in the domain-specific working groups, led by head organizers Bryan Wilder and Nikhil Garg.
MD4SG was founded by Rediet Abebe and Kira Goldner in the fall of 2016 as a multi-institutional reading group of 12 members. The reading group, which ran from fall 2016 to spring 2018, predominantly comprised graduate students who were united by their interest to use an interdisciplinary approach to improve societal welfare. To this end, junior researchers in the group curated modules on housing, healthcare, inequality, and other related topics to provide examples of meaningful interventions and suggest directions for future research. Rediet and Kira also co-organized and co-PC-chaired the first two MD4SG workshops at the ACM Conference on Economics and Computation, at EC'17 and EC '18.
Join us if you are interested in this mission and reach out if you would like to learn more.


{% extends "base.html" %} {% block content %}
"Get a job."
{% comment %}
Hint: Use Boolean Operators (*Must be capitals)
(Needs a better search backend for boolean search to work)
Example: Manager NOT Finance AND (KE OR United Nations OR UAE OR United States OR HK)
| {{ result.object.title }} | Age: {{ result.object.added_on|timesince }} | Country: {{ result.object.source.country.name }} |
| No results found. |


workflow "Build and deploy to gh-pages" {
on = "push"
resolves = [
"Deploy if on master",
"Test",
"Production build && Deploy",
]
}
action "Production build && Deploy" {
uses = "docker://node:10"
needs = ["Deploy if on master"]
secrets = [
"DEPLOY_USER",
"GITHUB_TOKEN",
]
runs = "npm run deploy"
}


| Total net profit | -79.41 | Gross profit | 92.51 | Gross loss | -171.92 |
| Profit factor | 0.54 | Expected payoff | -0.34 | ||
| Absolute drawdown | -79.41 | Maximal drawdown (%) | 83.31 (2136.15%) | ||
| Total trades | 233 | Profit trades (% of total) | 107 (45.92%) | Loss trades (% of total) | 126 (54.08%) |
| Long positions (won %) | 116 (50.86%) | Short positions (won %) | 117 (41.03%) | ||
| Largest | profit trade | 6.67 | loss trade | -3.99 | |
| Average | profit trade | 0.86 | loss trade | -1.36 | |
| Minimum | profit trade | 0.04 | loss trade | -0.05 | |
| Maximum | take profit in pips | 69.5 | stop loss in pips | -42.1 | |
| Average | take profit in pips | 10.0 | stop loss in pips | -15.7 | |
| Minimum | take profit in pips | -9.8 | stop loss in pips | -3.0 | |
| Maximum | Reward-Risk | 3.9 | Duration in minutes | 2959 | |
| Average | Reward-Risk | 0.8 | Duration in minutes | 107.7 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0 | |
| Maximum | consecutive wins (profit in money) | 9.0 (8.25) | consecutive losses (loss in money) | 10.0 (-17.93) | |
| Average | consecutive wins | 1.0 | consecutive losses | 2.0 |
| Total net profit | -52.47 | Gross profit | 36.4 | Gross loss | -88.87 |
| Profit factor | 0.41 | Expected payoff | -0.45 | ||
| Absolute drawdown | -52.47 | Maximal drawdown (%) | 55.04 (2141.63%) | ||
| Total trades | 116 | Profit trades (% of total) | 59 (50.86%) | Loss trades (% of total) | 57 (49.14%) |
| Largest | profit trade | 1.64 | loss trade | -3.24 | |
| Average | profit trade | 0.62 | loss trade | -1.56 | |
| Minimum | profit trade | 0.04 | loss trade | -0.05 | |
| Maximum | take profit in pips | 35.0 | stop loss in pips | -39.1 | |
| Average | take profit in pips | 8.0 | stop loss in pips | -17.6 | |
| Minimum | take profit in pips | -9.8 | stop loss in pips | -5.8 | |
| Maximum | Reward-Risk | 2.2 | Duration in minutes | 1298.0 | |
| Average | Reward-Risk | 0.5 | Duration in minutes | 100.2 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0.0 | |
| Maximum | consecutive wins (profit in money) | 8.0 (7.25) | consecutive losses (loss in money) | 9.0 (-16.21) | |
| Average | consecutive wins | 2.0 | consecutive losses | 2.0 |
| Total net profit | -26.94 | Gross profit | 56.11 | Gross loss | -83.05 |
| Profit factor | 0.68 | Expected payoff | -0.23 | ||
| Absolute drawdown | -29.76 | Maximal drawdown (%) | 32.42 (1218.8%) | ||
| Total trades | 117 | Profit trades (% of total) | 48 (41.03%) | Loss trades (% of total) | 69 (58.97%) |
| Largest | profit trade | 6.67 | loss trade | -3.99 | |
| Average | profit trade | 1.17 | loss trade | -1.2 | |
| Minimum | profit trade | 0.34 | loss trade | -0.32 | |
| Maximum | take profit in pips | 69.5 | stop loss in pips | -42.1 | |
| Average | take profit in pips | 12.1 | stop loss in pips | -13.9 | |
| Minimum | take profit in pips | 0.4 | stop loss in pips | -3.0 | |
| Maximum | Reward-Risk | 3.9 | Duration in minutes | 2959.0 | |
| Average | Reward-Risk | 1.1 | Duration in minutes | 115.1 | |
| Minimum | Reward-Risk | Duration in minutes | 0.0 | ||
| Maximum | consecutive wins (profit in money) | 5.0 (4.16) | consecutive losses (loss in money) | 8.0 (-8.93) | |
| Average | consecutive wins | 1.0 | consecutive losses | 2.0 |


Arthur Ozga
about
I am a software engineer working on order management, marketdata, and storage/retrieval thereof at
Two Sigma
.
reading
Library
|
Links
writing
Blog
|
Course Notes
resume
short version
|
long version
e-mail
aozgaa at umich dot edu
Github
aozgaa


--- layout: post authors: ["Greg Wilson"] title: "Mental Models and Vicious Circles" date: 2014-01-07 time: "06:30:00" tags: ["Research", "Teaching"] ---
A few days ago, Konrad Hinsen asked this on our discussion list:
Is anyone aware of teaching methods that aim at either developing or verifying the students' mental model of some non-trivial procedure? If so, have they been used for teaching the use of computers?
The short answer is, "Yes". Mark Guzdial looked at what it means to understand computing, and referred to Juha Sorva's excellent thesis on program visualization, the first third of which is a great summary of education theory as applied to programming. Independently, Allison Tew has developed and validated a concept inventory for basic computing (paywalled), which shows that there are indeed "core concepts" that can be mastered. There's also Marian Petre's work on expertise in software development, though its focus is people who are more advanced than those we teach.
But computing is far behind math in this area. Long-running research programs in those fields have produced a wealth of secondary literature on evidence-based teaching practices (like this book); we're still trying to collect raw material. One reason is the vicious circle:
As a consequence, computer science departments don't recognize education as a career path to the same extent as math departments: to the best of my knowledge, no CS or Ed department in Canada offers an undergrad course in teaching CS. And without that recognition, it's both difficult and risky for grad students to go into the area.
There's no easy way out of this trap, but there are things we can do. One is to become familiar with what we do know: we use this book in our instructor training course, and most people seem to learn a lot from it. Another is to help people who are doing this kind of research by taking part in studies like Perez De Rosso and Jackson's conceptual design analysis of Git. We'll soon be looking for volunteers ourselves to help with the next phase of our study of code review; if you'd like to take part, please stay tuned for further announcements.


Dear
For your ScheduleSys account a password reset was requested, please click on the URL below to reset it:
Reset Link
Regards, ScheduleSys.


---
layout: general
title: Leadership
parent: /teams.html
---
Leadership positions
This webpage contains a comprehensive listing of every leadership position within the club. If you want to fill an unoccupied spot, or want to propose a new position, please contact us.


An application has at least one language for user interface. Many applications have more than one language. ASP.NET Boilerplate provides a flexible localization system for an application.
The first thing is to declare which languages are supported. This is done PreInitialize event of your module as shown below:
Configuration.Localization.Languages.Add(new LanguageInfo("en", "English", "famfamfam-flag-england", true));
Configuration.Localization.Languages.Add(new LanguageInfo("tr", "Türkçe", "famfamfam-flag-tr"));
In server side, you can inject and use ILocalizationManager. In client side, you can use abp.localization javascript API to get list of languages and the current language.
ASP.NET Boilerplate templates uses this system to show a language-switch combobox to the user. Try to create a template and see source codes for more.
Localization texts can be stored in different sources. Even you can use more than one source in same application. ILocalizationSource interface should be implemented for a localization source. Then it is registered to ASP.NET Boilerplate's localization configuration. There are pre-defined localization sources for XML files and resource files.
Localization texts can be stored in XML files. Content of an XML file is something like that:
<?xml version="1.0" encoding="utf-8" ?>
<localizationDictionary culture="en">
<texts>
<text name="TaskSystem" value="Task System" />
<text name="TaskList" value="Task List" />
<text name="NewTask" value="New Task" />
<text name="Xtasks" value="{0} tasks" />
<text name="CompletedTasks" value="Completed tasks" />
<text name="EmailWelcomeMessage">Hi,
Welcome to Simple Task System! This is a sample
email content.</text>
</texts>
</localizationDictionary>
XML file must be unicode (UTF-8). A name is used to identify each text. You can use value attribute or inner text (like the last one) to set value of the localization text.
To register the localization source, we use localization configuration as shown below:
Configuration.Localization.Sources.Add(
new DictionaryBasedLocalizationSource(
"SimpleTaskSystem",
new XmlFileLocalizationDictionaryProvider(
HttpContext.Current.Server.MapPath("~/Localization/SimpleTaskSystem")
)
)
);
This is done in PreInitialize event of a module (See module system for more info).
A localization source must be a unique name (SimpleTaskSystem here) and a directory path that contains XML files for each language. Here, they are placed in Localization/SimpleTaskSystem folder of the web application:
SimpleTaskSystem.xml is the default language (since it does not contains language code). SimpleTaskSystem.tr.xml contains localized texts for Turkish language.
When a text is requested, ASP.NET Boilerplate gets the text from current language's XML file (using Thread.CurrentThread.CurrentUICulture). If it does not exists in current language, it gets from default language's XML file.
Using XML files provides flexibility since they can be easily modified using code and by non experienced users, they can be easily distributed.
Localization text can also be stored in .NET's resource files. We can create a resource file for each language as shown below (Right click to the project, choose add new item then find resources file).
MyTexts.resx contains the default language texts and MyTexts.tr.resx contains texts for Turkish language. When we open MyTexts.resx, we can see all texts:
In this case, ASP.NET Boilerplate uses .NET's built-in resource manager for localization. You should configure a localization source for the resource:
Configuration.Localization.Sources.Add(
new ResourceFileLocalizationSource(
"MySource",
MyTexts.ResourceManager
));
Uniqe name of the source is MySource here. And MyTexts.ResourceManager is a reference to the resource manager to be used to get localized texts. This is done in Initialize event of the module (See module system for more info).
A custom localization source can be implemented to store texts in different sources such as in a database. You can directly implement the ILocalization interface or you can derive from DictionaryBasedLocalizationSource class to make implementation easier.
After creating a source and register it to the ASP.NET Boilerplate's localization system, texts can be localized easily.
In server side code, you can simply call LocalizationHelper.GetString with source name and text name:
var s1 = LocalizationHelper.GetString("SimpleTaskSystem", "NewTask");
To do not repeat source name always, you can first get the source, then get a string from the source:
var source = LocalizationHelper.GetSource("SimpleTaskSystem");
var s1 = source.GetString("NewTask");
This returns text in the current language. There are also overrides of GetString to get text in different languages and formatted by arguments.
If you need to localization in an application service, in a controller or in a view, there are shortcuts.
Localization texts are generally needed in MVC Controller and Views. There is a shortcut for that. See the sample controller below:
public class HomeController : SimpleTaskSystemControllerBase
{
public ActionResult Index()
{
var helloWorldText = L("HelloWorld");
return View();
}
}
L method is used to localize a string. Surely, you must supply a source name. It's done in SimpleTaskSystemControllerBase as shown below:
public abstract class SimpleTaskSystemControllerBase : AbpController
{
protected SimpleTaskSystemControllerBase()
{
LocalizationSourceName = "SimpleTaskSystem";
}
}
Notice that it is derived from AbpController. Thus, you can easily localize texts with L method.
Same L method also exists in views:

<form id="NewTaskForm" role="form">

@L("TaskDescription")
<textarea id="TaskDescription" data-bind="value: task.description" class="form-control" rows="3" placeholder="@L("EnterDescriptionHere")" required></textarea>

@L("AssignTo")
<select id="TaskAssignedPerson" data-bind="options: people, optionsText: 'name', optionsValue: 'id', value: task.assignedPersonId, optionsCaption: '@L("SelectPerson")'" class="form-control"></select>

<button data-bind="click: saveTask" type="submit" class="btn btn-primary">@L("CreateTheTask")</button>
</form>

To make this work, you should derive your views from a base class that sets the source name:
public abstract class SimpleTaskSystemWebViewPageBase : SimpleTaskSystemWebViewPageBase<dynamic>
{
}
public abstract class SimpleTaskSystemWebViewPageBase<TModel> : AbpWebViewPage<TModel>
{
protected SimpleTaskSystemWebViewPageBase()
{
LocalizationSourceName = "SimpleTaskSystem";
}
}
And set this view base class in web.config:
<pages pageBaseType="SimpleTaskSystem.Web.Views.SimpleTaskSystemWebViewPageBase">
All these for controllers and views are ready when you create your solution from one of the ASP.NET Boilerplate templates.
ASP.NET Boilerplate makes possible to use same localization texts in also javascript code. First, you should be added dynamic ABP scripts to the page:

ASP.NET Boilerplate automatically generates needed javascript code to get localized texts in the client side. Then you can easily get a localized text in javascript as shown below:
var s1 = abp.localization.localize('NewTask', 'SimpleTaskSystem');
NewTask is the text name and SimpleTaskSystem is the source name here. To do not repeat source name, you can first get the source then get the text:
var source = abp.localization.getSource('SimpleTaskSystem');
var s1 = source('NewTask');
Localization method can also get additional format arguments. Example:
abp.localization.localize('RoleDeleteWarningMessage', 'MySource', 'Admin');
//shortcut if source is got using getSource as shown above
source('RoleDeleteWarningMessage', 'Admin');
if RoleDeleteWarningMessage = 'Role {0} will be deleted', then localized text will be 'Role Admin will be deleted'.
ASP.NET Boilerplate provides ability to use different sources for localization. It also provides an infrastructure to use same localization texts both in server and client side code.
XML files and Resource files have own strengths and weaknesses. It's suggested to use XML files for re-usable modules since it will be easy to add new languages for module out of the code. Also, if you use XML, it's suggested to do not sort texts by name. Sort them by creation date. Thus, when someone translates it to another language, he/she can easily see which texts are added newly.
You can also create your own localization source and integrate it with ASP.NET Boilerplate.


Fun stuff from "Apple, Google and you" post. Can't keep myself not to copy the picture:
- Typical Apple product.
- A Google Product.
- Your Company's Application.
From here some questions have arised:
- Do large companies always have everything "simple and easy"?..
- How often do you design overcomplicated applications?
An worse, people usually don't even try to think how hard work would be for the end users.
But - and this is a plus - being usability expert and user interface expert makes you really needed and paid professional :)


This section describes how to draw a scatter plot and refine the display with controls over colors and axis labels. The commands are:
set gxout scatter
display exp1;exp2<;exp3>
Where:
exp1
A grid expression that determines the position of the scatter points on the X axisexp2
A grid expression that determines the position of the scatter points on the Y axisexp3
A grid expression that determines the color of the points in the scatter plot (GrADS version 2.0.2+)The third argument to control the colorization of the points in the scatter diagram is new in GrADS version 2.0.2. Use set clevs
and set ccols
to control the range of values and color for each level. When using colorization of the scatter plot, if any of the color numbers is < 0, no points will be drawn for that level.
After a display of a scatter plot, GrADS will return four numbers: the min and max of the X axis values, followed by the min and max of the Y axis values.
Use the set vrange
command to specificy the min and max of the X axis values if you do not wish to use the defaults that GrADS selects.
Use the set vrange2
command to specificy the min and max of the Y axis values if you do not wish to use the defaults that GrADS selects.


| Input | Action |
|---|---|
| Scroll, or ALT/OPTION-drag   | Zoom View |
| Ctrl-Click | Rotate View |
| w/s | Throttle Up/Down (press shift for fine control) |
| Enter | Set engines to 100% |
| Backspace | Set engines to 0% |
| a/d | Rotate Habitat (press shift for fine control) |
| l | Toggle labels |
| . or , | Increase or decrease time acceleration |
| p | Pause simulation |


| No. | Name | Score | date, time |
|---|
Welcome to the game. It's just a simple snake game created by using HTML, CSS and Javascript.
The game started as a very basic snake game, but as I started to add some sprite, menus, in-game features, audio and music, the game started to feel much more like a game. All the sprite are created by myself, not to mention it was my first time drawing pixel sprites. I used Piskelapp for creating the sprites, it provide basic functionality for creating simple and complex pixel art. Whie the old-styled font is taken from Dafont by Jason Aleksandr Kottke. As for sound effects, I used a free software called Bfxr. It's a great tool to make simple sound effects.
If you're on a desktop/laptop then the default contorls are using the arrow key. The snake will change its direction based on the key that you pressed. Next, if you're on a smartphone/tablet, you can use the controller that will be shown when you press start. The controls could be changed in the settings section (desktop/laptop user only). The goal of this game is to get as many score as you can while avoiding the snake from ramming into a wall or eating itself.
Desktop:
Mobile/tablet:
There's a high-score system for the game so you can always compare your score with your previous record or with other peoples. There's' 4 kinds of food that the snake can eat:
| Color | Score | Side Effect |
|---|---|---|
| -20 | Reduce score and snake length | |
| +10 | Increase score and snake length | |
| +5 | Increases score,snake moving speed and length | |
| +5 | Increases score, reduce snake speed and increase its length |
note that some new feature will be added in future update :D
in case you have any questions, suggestions or any bugs report, you could contact me using the following:
| No. | Name | Score | date, time |
|---|


This summer I got to try out Adderall for the first time. Before then, I'd only had experience with weed and alcohol. Knowing only that it was a stimulant, I bought a 30 mg Adderall XR off of a friend for $3. For about a week the little orange and white pill sat hidden away in my room, until the last day of school. Our town has a festival-type deal every week during June and September, and as luck would have it, the last day of school and this event fell on the same day. Oh joy!
That morning, I went to school, hung out with friends for a while, and took the pill. The effects were noticable after about half an hour. At the time, the group I was with were spinning various dice, everything from 4 to 20-sided, trying to knock each other's over. Eventually I started getting too enthuesiastic and the dice would often fly off the table. After finishing this 'game', the bell rang, signaling it was time for our 1st hour final.
At the time, this was a fairly easy, yet boring class, focused on wildlife and forestry. The test was surprisingly easy. As it turns out, the effects of my little orange friend had only begun. The next and final class was my world history final. Since the schedule was all rearranged, we had 10 minutes to roam about. I took this time to see how many people I could find. In the end, I only found two. My conversation with them was mostly one-sided, with me bouncing about the entire time.
Once situated in history class, I was still very hyper. It was that giddy kind of hyperness that naturally comes about. I just had ridiulous amounts of energy at my disposal. This test was somewhat harder, considering it was all multiple choice, with about 150 questions. Maybe 30 minutes later, I was trying to slow myself down while walking to the front of the class to turn in the test. Upon returning to my seat and looking at the clock, I was horrified. There was still an hour left. Much of that time was spent glancing about and mouthing the words to the faster AFI songs, especially their cover of 'Halloween'. Finally, everyone was done and I could talk to people around me, though that didn't last long. BRRRRRING!!! The bell rang. School was out for the summer.
Normally, whenever going downtown after school, people congregate at some area. So I waited outside the door they would be destined to exit. And waited. And waited. It was probably only 2 minutes, but that seemed like an eternity, so I turned my hyper little self towards downtown and started walking. It's somewhere between 1 and maybe 3 miles from school to the arcade we usually meet at. Since I was alone, I let my thoughts roam as they wished, often ended quietly singing more AFI songs, and let my feet go on autopilot.
Upon arriving, I found the guy who sold me the pill and a rather beautiful girl had gotten there before me. We talked a while, partly about how my experience was going. As luck would have it, he had 3 more pills, which I bought. Originally the money was to be used for buying a quarter of weed, but the dealer was lazy.
Backing up a bit, on the way, I had noticed I was starting to come down in that annoying 'energetic one minute, slightly down, then back up a bit' way that Adderall does. I waited an hour after the last burst of energy, went for a walk to a nearby McDonald's for some food (I was starving), and took a second pill. Unlike the first one, it took a while longer for it to kick in, likely because of the food. By then, other people had arrived and we'd gone outside. According to a friend, I was still 'acting like you have ADHD.' This was mostly lost on me.
A few of us decided to head into the main area where festivities were occuring. This brought on a slight 'fight-or-flight' response in me. The whole rest of the evening I was stressing out. Only when I got home did the effects hit me full on. Sitting at the computer, my legs took turns bouncing as I chatted away with friends for about 4 hours.
Since then, I took Adderall two more times, both during the festival in June. As of typing this, I'm not sure if I'll be getting any sleep tonight, due to what may be slight insomnia and stress. Luckily, tomorrow evening is the first festival of september, and my friend with the Adderall may be in town. ^_^
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


JavaScript Fundamentals
Differences between HTML and CSS
CSS is to HTML as clothes are to a person.
Let's examine the relationship between clothing and people. Clothes are designed to be worn by people, and generally have the shape of a person in mind when they're made. For example, a t-shirt will have a hole for the head to fit through, one for each arm, and the main opening where our body fits. Besides keeping us warm and protecting our modesty, clothes allow us to express ourselves through our choices of colour, style, fit, and other such properties.
Now how do HTML and CSS fit this analogy? Well, HTML is the basic structure of a page - the person before they get dressed. HTML tells us things such as the page's heaing, how many paragraphs of text are in each section, and the content of that text. It's all structure with minimal style. Then we have CSS which adds layers of style over the top of the HTML. It's the clothing that's worn by the person - perhaps a bright red jacket and green shoes. Similarly, if we wanted to we could use CSS to make the main heading element of our page bright red, and then give the last paragraph a green background. We can use CSS to change the height or width of an element, or even to make pictures - the possibilities are endless. It's all about conveying a particular style or identity... just watch the red jacket and green shoes combo.
Control Flow and Loops
Control flow is the order in which our code will execute from start to finish, from the first line to the last. This is usually not a linear journey and there are many factors that affect a program/script's path through the code. These include structures such as if/else statements, functions, and loops.
Loops are a great example of a structure that affects control flow. Let's say we want to run a particular part of our code multiple times - we could copy and paste that code right? Well what if we want it to run 40,000 times? Having the same block of code repeated this many times seems absurd, plus it violates the "DRY rule" (Don't Repeat Yourself). This is where loops are our friend. We can write a loop which executes a particular section of code 'n' amount of times. And the great part is, we don't even need to know how many times that is up front - it could depend on some dynamic value such as user input.
An example of control flow and loops in everyday life might be walking to work - let's say we are writing code for this. We have a starting point of home (the first line of code), and an end-point of work (the last line of code). We may have an if/else statement in there - if it's raining, take the more sheltered route, otherwise (else) take the most efficient route. If it's raining, we may also need to grab a raincoat and/or umbrella. If it's sunny we may need to grab a hat. Then we need to program our steps - left, right, left (or vice versa). But how many steps is it going to take? Well that depends on factors like which route we walk and whether there are any obstacles in the way. This is where a loop would be ideal, telling us to keep taking steps until we're at work. So depending on various factors, our journey (control flow) has the potential to look very different.
What is the DOM?
The Document Object Model (or DOM for short), is an interface that allows programs to interact with the structure, content and style of a page. The way it does this is by converting the HTML document into a tree of nodes or objects which can then be accessed via the programming/scripting language.
We can interact with the DOM through the console found inside Chrome DevTools, or via code in our program. One example could be a line of script in your JS file which runs when a page loads, making a welcome message alert pop up in the browser.
Accessing Data from Arrays vs. Objects
The way we access data from arrays and objects is quite different. An array is a collection of data elements, with each element accessed using an index which corresponds to its position in the array. The indexes begin at 0 and increase in sequential order. Let's say we have an array of strings representing a friend group:
var friends = ["Jamal", "Will", "Mike"]
If we want to access the first name in the array, we would use the array name immediately followed by the first index number in square brackets. Like so:
friends[0] // "Jamal"
If we wanted to access the last name in the array, we would use:
friends[2] // "Mike"
Or because the array starts at 0, the last element will always be array.length - 1
Objects on the other hand, are made up of name:value pairs called properties. Instead of using an index number to access data, you use the name of the property. This means that you don't need to know the property's position in the object. Here's an example of an object:
var person = {
'firstName': 'Jesse',
'lastName': 'Caunter',
'age': 30
}
If you wanted to access the lastName property value in the above example, you could use either:
person.lastName; // dot notation
or
person["lastName"]; // bracket notation
Functions and Why They're Useful
Functions are typically small reusable pieces of code that perform a specific task. They are useful because we can call them whenever we need to, without the need for duplicating the code. They make testing and debugging easier as code is separated into smaller more manageable chunks. Functions also make code easier to understand, especially if we didn't write it ourselves. We should be able to look at a funtion and quickly ascertain what it does, without needing to know exactly how it works.