Create REST services using Ktor
Ktor is a lightweight framework written in Kotlin programming language. This framework allows us to create asynchronous servers and clients. In this article I will explain the basics of Ktor framework by creating a simple REST service. This service will listen on GET, POST, PUT and DELETE requests and perform CRUD database operations. I will use Exposed for database operations.
In this article we are creating a simple REST service with CRUD operations. To develop this application we are going to use Kotlin programming language with below frameworks/libraries.
- Ktor framework
- H2 in-memory database
- Exposed SQL library
Following is the checklist of items we will go through in this article.
- Create Kotlin project
- Add and configure Ktor framework
- DAO layer for database
- Configure REST controllers
- Conclusion
Please note that this whole project setup is available in github
Create Kotlin project
First step is to create Kotlin project. Execute below command to create an empty gradle Kotlin project. Once the project is created then import it into your favorite editor.
I executed this command on Gradle 5.2.1 version. You can choose to create kotlin project with any other build tool.
This command will create new project with standard folder structure with default App.kt file.
Add and configure Ktor framework
Adding Ktor framework to the project is easy, just add below dependencies to your build.gradle
Configure Netty embedded server
Open App.kt and update it with below code.
main() function is the starting point of the Kotlin program. We will initialize and start embedded server by passing required information and then we will block main thread such that embedded server can stay live and listen for the requests.
We called embeddedServer function. This function will initiate and run the embedded server. We need to pass some important information to it, they are;
- Server instance type; We passed Netty. Ktor support Jetty and Tomcat as well.
- Port number on which the server will listen.
- Lambda instance of Application. More details about this in next section.
start function make server to start and we passed wait = true to block main thread such that server can listen for the requests.
Now you can run main() function and should see Ktor server startup logs in the console. Server should start with out any errors but we can not test it yet because no end points are defined.
Understanding Ktor
In the previous section a lambda instance which runs with in the context of Application is passed to embeddedServer function. This lambda instance is the where real Ktor framework comes into picture. I am not going into deeper details because it is not in the context of this article, but I will explain the basics.
Ktor works on the concept of features. A Feature is a functionality that we want to put it in the request and response pipeline. Below are some of the examples;
- Logging client requests
- Handling sessions
- Authenticating client requests
Ktor provides many features but they are not included in the pipeline by default. We can customize or use any third party features. In-order to use these features we need to install them. Installing features is so easy, just need to pass the features to the install function. In the below code we installed CallLogging and ContentNegotiation features.
- CallLogging is to log client requests
- ContentNegotiation is used to convert JSON messages. Ktor supports Jackson and GSON but in this article I used Jackson. We can customize this library by passing configuration object but here I am not customizing it.
Once the features are installed then Ktor will listen for the requests. Here we not yet configured end-points so it will not listen for anything. In the next section we will define routing where we will declare some end-points.
Configure Routing
Routing will allow us to configure end points of the REST service. In below code I configured a single route;
Looking at the code it understands that we created a parent routing context and with in this we have a single route(‘/employees’). We have get under this route so requests with GET on this route will end up in this block. Another approach to configure routing is using Location annotation. To make it simple I am not using this approach in this tutorial.
call is the instance of the ApplicationCall which is part of the get context and this instance contains properties to access request and response. Here we just reponding with some text ‘Employees test’
Test Ktor server
By now we have routing configured with single endpoint. To make sure everything is working fine, lets start our application and test it. Run main() function and check for no errors in the console log. Open terminal/command prompt and enter below cURL command.
By default curl sends GET request. Response contains ‘Employees test’ means our endpoint is working fine.
DAO layer for database
We are using Exposed to connect and perform SQL operations on H2 in-memory database. We need to include required dependencies in the build.gradle so go to build.gradle and add below dependencies.
To learn more about SQL library Exposed please read this article
Create Model and Mapping
We are using Employee entity as an example so lets create a new package net.thetechstack.model and add Employee.kt with below code.
This is a simple data class with four fields. We want to maintain id, name, email and city for the Employee so the constructor needs all these values.
Create a new package net.thetechstack.dao and add Employees.kt file with below content;
Employees is the mapping object for Employee. This object will give enough information for Exposed to map fields with the database table.
Create DAO
Instead of directly performing database operations we are creating DAO layer. DAO (Data Access Layer) will wrap all database operations in it. Create DAOFacadeDatabase.kt file in net.thetechstack.dao package with below code.
We created an interface, this defines the contract for DAO layer. We added all the methods needed to perform CRUD operations. With in the same class lets implement this interface.
DAOFacadeDatabase needs Database instance. We wrapped all query statements with in the transaction because Exposed needs all the database operations to be performed with in a transaction.
To understand more about Exposed please read this article
Now we have our DAO layer ready.
Integrate Exposed with Ktor
Lets integrate DAO layer with Ktor. We need to instantiate DAOFacadeDatabase by passing H2 in-memory database instance. Below is code;
Instantiated DAOFacadeDatabase by passing H2 database instance and used this instance to create the tables by calling init()
Configure REST controllers
We have DAO and Ktor server configured. Now we will create controller end-points for HTTP requests
Create GET, PUT, POST and DELETE requests
Update routing context with new end-points to handle GET, PUT, POST and DELETE requests.
- GET: returns all employees from the database
- POST: receives Employee JSON and stores in the database
- PUT: updates employee record
- DELETE: deletes the employee for the given id
Test HTTP endpoints with cURL
Start the application by running App.kt and check for no errors in the console. Below are the examples to test end-points with cURL
We performed CRUD operations on the database using REST end-points.
Conclusion
We created a Employee rest service using Ktor and Exposed and then tested all endpoints with some data to verify all database operations.


Transcript Providers
Tue Aug 17
Wed Aug 18
Thu Aug 19
Fri Aug 20
Sat Aug 21
Sun Aug 22
Mon Aug 23
Tue Aug 24
Wed Aug 25
Thu Aug 26
Click here for Breaking News Transcripts
Check the program schedule ON CNN TV
to find the name of show you saw at a specific time.
NEWS
Anderson Cooper 360°
At This Hour
CNN Newsroom
CNN Right Now
CNN Special Reports
Don Lemon Tonight
Cuomo Prime Time
Early Start
Erin Burnett OutFront
The Lead with Jake Tapper
The Situation Room
Special Events
CNN 10
New Day
New Day Saturday
New Day Sunday
INTERVIEW AND DEBATE
Inside Politics
Reliable Sources
Smerconish
State of the Union
The Axe Files
The Van Jones Show
NEWS FOR LIVING
Vital Signs with Dr. Sanjay Gupta
INTERNATIONAL NEWS
Amanpour
Connect the World
Fareed Zakaria GPS
First Move with Julia Chatterley
Quest Means Business
Hala Gorani Tonight
The Brief with Bianca Nobilo


April 12 2020
This Is My First Article
The year was 1845. Edgar Allan Poe’s famous poem The Raven first appears in the Evening Mirror. Two years earlier Poe had earned widespread acclaim for The Tell-Tale Heart, a short story in which an unnamed narrator forcefully, though paradoxically, defends his own sanity while confessing to the murder of an old man.
Poe, who spun tales of tragedy, mystery and horror, had a knack for injecting trouble into his own life. It was in 1845 that Poe’s penchant for troublemaking would put him at odds with none other than fellow writer Henry Wadsworth Longfellow.
As a literary critic, Poe was not alone in his belief that Longfellow was a plagiarist. He was possibly the most outspoken about it. Poe used speaking engagements, his editing position at the Broadway Journal, and anonymous articles to accuse Longfellow of stealing from the likes of Tennyson, Milton, Shakespeare and Coleridge, among others.
Poe used one review of Longfellow’s poems, to insinuate that Longfellow’s celebrity stemmed, not from talent, but from his position as a Harvard professor and his marriage to an heiress. Poe went on to note various poems as:
- scarcely worth the page it occupies
- mere common place
- has nothing in it beyond common thoughts very gracefully expressed
- utterly worthless as a poem
Hey Edgar, do you kiss your mother with that mouth?
april 15 2020
That time I asked about someone’s novel
Most of us will never experience anything close to Poe’s public criticism of Longfellow.
We’ll also never come to blows with other writers like the time poet Wallace Stevens got into a brawl with Ernest Hemingway, the Ernest Hemingway. The incident left Stevens with a broken hand and a black eye.
Still, there are moments in this creative journey that will make us curious about the rules, spoken and unspoken, for how we treat each other as writers. For me that moment happened about a year ago.
It started innocently enough. We were in an online community for creative entrepreneurs. A guy mentioned that he was working on a novel. I told him that was great. I asked what the book was about.
His response, essentially, not verbatim:
Nicole, I have no intentions of sharing any details about my work in progress. I find it presumptive that you would ask.
My response, essentially, not verbatim:
Okay. Cool.
From time to time I think about that guy, a fellow writer, who found me presumptive. I wonder if he still posts that he is writing a novel, and then bristles at anyone who dares to ask about it.
I wonder if at this very moment he is pounding out the last chapter. Or maybe he’s finished. And published. And successful.
Mostly, I wonder if I violated an established code of behavior by asking a novelist what his novel was about.


RECIPERY
Please, login into your account
Enter your email
Enter your password
Forgot Password?
Login
Create account


@import gospeak.core.domain.{Proposal, User, UserRequest} @import gospeak.web.pages.user.talks.proposals.routes.ProposalCtrl @import gospeak.web.utils.UserReq @(invite: UserRequest.ProposalInvite, proposal: Proposal.Full, speaker: User)(implicit req: UserReq[AnyContent])
Hi @speaker.name.value,
@req.user.name.value has rejected your invitation to @proposal.title.value.
It's juste a small inconvenience, brace yourself and share your experiences with the world
The Gospeak team


Installation #
This is an installation guide for μJam, an extension to Visual Studio Code. VS Code is a powerful and heavily used open source editor from Microsoft available on Linux, Mac and Windows platforms. The most important feature in this context of website creation and authoring is VS Code being a highly sophisticated Markdown Editor.
So in using this installation guide we need only few prerequisites.
- Minimal knowledge of markdown. Here is an overview of its basic syntax.
You may like to hear that ...
- no programming skills are required.
- initializing and creating websites can be done completely inside of VS Code.
- interested but impatient persons can skip all Information and Explanation labeled sections below.
We will do that in three simple steps:
A New Project #
For a new project we need a project folder, where everything necessary can reside in. For creating that new folder
- Open a new terminal session right in
vscode
editor.
- Type in the terminal window the command
mkdir
(make directory
) and ...
specify with it the path to our new project folderfirst
.
> mkdir <new folder path>
Important !
For simplicity reasons the root directory'/'
is taken here as the location of the project folder. This should be avoided in general and is even restricted under Unix / OSX. Take your/home
directory instead (> cd ~
).
- We navigate to our newly created folder via
cd
(change directory
) and create there another directorydocs
.
> cd first
> mkdir docs
We want to create the first file in our nearly empty directory first
.
- Select in the menu
File > New File
(Ctrl + N). - Copy and paste the following text into its window (Ctrl + C, Ctrl + V).
{
"name": "first",
"description": "My first web page using microjam",
"version": "0.1.0",
"author": "it's me",
"microjam": {}
}
- Save the file via
File > Save As...
(Ctrl + Shift + S) giving it the namepackage.json
. Save it into the new project directoryfirst
.
With that we finished our first step in creating a new project and will proceed in generating some content.
Generating Content #
We now start to write some Markdown documents using vscode
as markdown editor.
Information !
μJam basically differentiates between three different types of documents:
page
represents a stand-alone web page like anabout
page.article
s are web pages building a consecutive list of entries like blog posts.index
represents the main page, potentially holding a table of contents of allarticle
pages.A certain layout is assigned to each of these three types.
At this moment we have a tiny directory structure:
/first
|_ package.json
|_ /docs (empty folder)
page
Document #
Let's create an about
page for our first web site.
- Copy and paste the following text into a new markdown window (Ctrl + C, Ctrl + V)
---
"layout": "page",
"title": "About"
---
# About this Site
This site was created as a simple collection of markdown files using minimalistic *Static Site Generator* **μJam**.
- Save it to file
about.md
in the newdocs
directory (Ctrl + Shift + S). - Show preview window by pressing the red-circled preview-button (Ctrl + K V).
Explanation !
While working on a markdown file you can always examine the html-result visually side-by-side in a preview window (Fig. 5). Please note some front matter metadata at the top of ourabout.md
file. These metadata are enclosed between two lines of three dashes---
and so separated from the following markdown text. That separator style is taken fromyaml
, but the metadata itself has to followjson
-syntax strictly.
We now want to open our complete project folder in vscode
.
Explanation !
After having successfully savedabout.md
into thedocs
folder – which is our first content file in this project – we might have realized, that the project directory structure has changed significantly – magically. We want to proof that byvscode
's comfortable Explorer View.
- Switch on the Explorer View by pressing the uppermost symbol of the Activity Bar, located on the far left-hand side of the editor.
- The Explorer View opens and asks us to
'Open Folder'
. Pressing this button and selecting our directory/first
, we get a nice view of our folder structure (Fig. 6). At the same time the Status Bar color has turned from purple to blue.
Explanation !
- In our
docs
folder two additional files appeared:
- all generated
html
-files, which got the filename from their correspondingmd
-files. So we have hereabout.html
solely.pages.json
holding a list of extended metadata extracted from all markdown files. At that time it contains an array literal including metadata of a singlepage
-file now.- A new
theme
folder was created inside ofdocs
. It contains
template.json
, which holds the default templates for generatinghtml
-files frommd
-files.- a single stylesheet file
styles.css
used byhtml
-files.If you want to extend this directory structure, add files or modify your templates – maybe you want to add some scripts – you can do this manually at any time from now on.
μJam
won't touch your folder structure and templates anymore. This was an initial one-time action only.
Now you can view your first web page in the browser of your choice.
- Drag 'n drop
about.html
from the editor's Explorer View (Fig. 6) into the browser's adress bar ... and voilà.
article
Document #
We want to maintain a series of article
documents, possibly as posts for use with a weblog.
Information !
article
documents are not so much different frompage
documents. In the front matter metadata we need to have adate
member. Adding adescription
member is recommended.
The workflow is illustrated now by the creation of two articles:
- Open a new file via
File > New File
(Ctrl + N). - Copy and paste the following text into that window (Ctrl + C, Ctrl + V)
- Save it to file
one.md
in thedocs
directory (Ctrl + Shift + S).
one.md
---
"layout": "article",
"title": "Article One",
"description": "This is the first article",
"date": "2020-03-22"
---
### Abstract
This is the first article. We are mainly testing `syntax highlighting` here.
## 1. Syntax highlighting
### 1.1 Html
```html
<!doctype html>

<title>About</title>

header

content here

footer

`` `
- Open a new file via
File > New File
(Ctrl + N). - Copy and paste the following text into that window (Ctrl + C, Ctrl + V)
- Save it to file
two.md
in thedocs
directory (Ctrl + Shift + S).
two.md
---
"layout": "article",
"title": "Article Two",
"description": "This is the second article",
"date": "2020-03-23"
---
### Abstract
This is the second article. Here we are testing math formulas and embedded `svg`.
## 1. Testing
### 1.1 Math Formulas
[Euler's identity](https://en.wikipedia.org/wiki/Euler%27s_identity) is said to be one of the most beautiful formulas, as it collects the most fundamental numbers in mathematics in a compact equation (1).
$$e^{i\pi} + 1 = 0$$ (1)
### 1.2 Vector Graphics

<svg width="200" height="100">
<path d="M100,10L123.5,82.4L61,37.6L138,37.6L76.5,82.4Z"
stroke="darkslategray" stroke-width="4" fill="orange"/>
</svg>

Fig. 1: SVG Star

Explanation !
While having saved these two*.md
documents for the first time, their corresponding*.html
documents were created and also their front matter metadata have been extracted, slightly extended and appended to the list of the pages metadata inpages.json
. Please note, thatμJam
will update metadata during consecutive files storages and even remove them together with the*.html
files, when you delete a markdown file manually from the file system.You also might have noticed that we mixed LaTeX math and SVG markup into our markdown text of file
two.md
(Fig. 8).
index
Document #
Let's create the homepage of our website now.
Information !
Any markdown document marked as"index"
in its frontmatter layout entry will get appended a list of allarticle
s immediately after its normalcontent
section.
- Open a new file via
File > New File
(Ctrl + N). - Copy and paste the following text into that window (Ctrl + C, Ctrl + V)
- Save it to file
index.md
in thesrc
directory (Ctrl + Shift + S).
---
"layout": "index",
"title": "My Site",
"date": "2020-03-24",
"description": "Homepage of microjam demo site",
"tags": ["microjam","Jamstack","static page","personal",
"student","academics","math","vector graphics"],
"category": ["web","math","graphics"]
---
This is a demo site containing some articles. It was made by **μJam**, a minimalistic static site generator.
Explanation !
Since botharticle
documents haveabstract
sections, that content is used for articles' short description. In case of a missingabstract
section, thedescription
entry from frontmatter metadata would have been taken instead.
The content generation process of the demo site is complete now.
Publish to the World #
We want to use well known GitHub here.
And we want this version control hosting platform be connected with our local project repository via vscode
.
Information !
GitHub as a highly used platform is a code sharing service. But in contrast to mere cloud storage providers GitHub primarily supports project work, where files are regularly edited, uploaded and needed to be managed through version control. This is exactly, what we want to have with our website project and best of all: GitHub provides us with an online repository for free. We then simply have a storage space, called repository, where our project resides on the web. This is not a classical webserver. In the sense of Jam it is a CDN – content delivery network.
The Local Git Repository #
Git is a powerful version control tool, which allows us to create and manage a local repository.
Information !
With it we then have a version control tool Git collaborating with the version control hosting platform GitHub. And Visual Studio Code comes with source control integration and especially has excellent Git support.
Important !
Chances are good that Git is already installed on your local machine. Input'> git --version'
at your terminal command line. will show you the current version installed. Otherwise, if you are told thatgit
is unknown, you need to install it. Don't worry, this can be easily done by visiting that download site. I will wait here.
- Navigating to the third symbol of the left vertical Activity Bar ... press it.
- Press the blue button named
'Initialize Repository'
. - Type in the commit message
'Initial commit'
. - Ctrl + Enter or ...
- Move the mouse over
'CHANGES'
saying Stage All Changes. - Press the
+
sign. - Press the check mark.
- Move the mouse over
Explanation !
- By initializing our local repository we added a hidden directory named
.git
to our project folder. Fortunately, we don't have to worry about it at all.- In the source control view with step 3 we see our 12 files labeled
U
, which stands for untracked file.- After
Stage All Changes
in step 4 all files were labeledA
then, meaning added to the repository.- After step 5 all files vanished from git view, meaning that git took complete control over their versioning from now on. No changes to files can be seen.
To learn more here, I recommend reading 1 [4] and [5].
How helpful git now is for us becomes apparent, when we change the content of ... say one.md
and then save the file (Ctrl + S).
Explanation !
The git view shows four files labeledM
, meaning modified.
- We changed
one.md
manually.- While saving it,
one.html
was newly created/overwritten.pages.json
was modified automatically.- Since
one.md
is anarticle
file, the article list ofindex.html
is potentially affected and fileindex.html
was updated.Steps 1-3 are always performed under the hood by μJam on markdown file storage.
We can again directly commit these changes now or do that later, while going on and continue to work on other markdown source files.
The Online Repository #
You want to see your pages online now? So you need a personal user GitHub account for proceeding.
Important !
If you do not have a personal user GitHub account, you need to sign up for a new free GitHub account here . Please also note, that you are requested to provide a working email address during verification process.
Now that you are the owner <username>
of a GitHub account ...
- Navigate your personal browser to
https://github.com/<username>
. - In the upper-right corner of that GitHub page, use the
+
drop-down menu, and selectNew repository
.
- Fill out the formular ...
- Take a short, memorable
<repository name>
like'first'
. - Description:
'First microjam powered web site'
or similar text. - Choose public or private.
- Leave the rest as it is.
- Press button Create repositiory.
- Take a short, memorable
- In a new browser tab/window navigate to
https://api.github.com/users/<username>
. - Copy your
<github user id>
from the second line (a series of 6 or more decimal digits) (Ctrl + C) [3]. - In the terminal window (on the command line), type:
> git config --global user.name <github user id>
> git remote add origin https://github.com/<username>/<repository name>.git
> git push -u origin master
Explanation !
Please note, that use of these terminal commands is necessary for the first time file transfer to GitHub only. So having done that once, you can forget it forever.
The result of that action on your GitHub account page will be something like this ... (refresh page!)
We will take care about the README in a minute. Now we can't wait to see our website online.
- Select
settings
on your GitHub account page. - Scroll down to
GitHub Pages
. - In
Select source
set checkmark atmaster branch / docs folder
. - Navigate to the url shown at
'Your site is published at'
.
Congrats, your first website is online now !


Need a Website?
We do amazingly futuristic stuff using the same tools everyone has. WE are so unique and awesome we don't spend money on marketing gurus or copy writers!
Tell us about your projectTHE LAST WEB AGENCY YOU WILL EVER NEED
We do amazingly futuristic stuff using the same tools everyone has. WE are so unique and awesome we don't spend money on marketing gurus or copy writers!
Tell us about your projectCTO
Smart dude, geeky, knows his stuff! Nothing else.
Sales
Very agressive! Results Driver.
CTO
Drinks a lot. Loves meetings!
SEO Optimisation
Drinks. Hates computers....
Front End
Cares too much about useless things
Lead Developer
WE are not sure what he does!
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae ullam quam eos cum quos magnam voluptatem nam? Dignissimos, sit labore!
Mongolian emporer


Kenya Police Finally Launches Digital Occurrence Book
by RobertThe Inspector-General of Police Hillary Mutyambai has finally unveiled the much talked about National Police Service digital occurrence book (OB).
In a post shared on the social media pages of the police, Hillary Mutyambai (Inspector General) launched the new platform this morning, ushering a new era in the management of police records, away from the archaic bulky black books which have been common in the stations.
According to the IG, the digital OB will not be erasable and can only be corrected by top police bosses in case of errors.
Many, including blogger Robert Alai, has encouraged the police to launch the digital OB, detention records and fine collection systems.
Some of the features mentioned in the newly launched system include;
- Permanent record entries that cannot be edited, thus guaranteeing transparency and accountability in Police operations at the station level. (All records must be editable so as to allow correction)
- The reports entered will be subject to monitoring by Ward, County and Regional Commanders as well as the Inspector General and other top Commanders.
While this is an effort which should be encouraged, we will wait to see how long it will take before the police officers at the station level decide to tamper with the system and sabotage its smooth operation.


| Total net profit | -29.22 | Gross profit | 32.05 | Gross loss | -61.27 |
| Profit factor | 0.52 | Expected payoff | -0.51 | ||
| Absolute drawdown | -29.22 | Maximal drawdown (%) | 26.66 (-1041.41%) | ||
| Total trades | 57 | Profit trades (% of total) | 28 (49.12%) | Loss trades (% of total) | 29 (50.88%) |
| Long positions (won %) | 25 (52.0%) | Short positions (won %) | 32 (46.88%) | ||
| Largest | profit trade | 2.9 | loss trade | -3.9 | |
| Average | profit trade | 1.14 | loss trade | -2.11 | |
| Minimum | profit trade | 0.01 | loss trade | -0.13 | |
| Maximum | take profit in pips | 34.6 | stop loss in pips | -36.6 | |
| Average | take profit in pips | 12.0 | stop loss in pips | -21.9 | |
| Minimum | take profit in pips | -1.3 | stop loss in pips | -6.9 | |
| Maximum | Reward-Risk | 2.3 | Duration in minutes | 4142 | |
| Average | Reward-Risk | 0.6 | Duration in minutes | 393.9 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0 | |
| Maximum | consecutive wins (profit in money) | 5.0 (5.41) | consecutive losses (loss in money) | 4.0 (-4.88) | |
| Average | consecutive wins | 2.0 | consecutive losses | 1.0 |
| Total net profit | -12.13 | Gross profit | 14.01 | Gross loss | -26.14 |
| Profit factor | 0.54 | Expected payoff | -0.49 | ||
| Absolute drawdown | -12.13 | Maximal drawdown (%) | 9.46 (-354.31%) | ||
| Total trades | 25 | Profit trades (% of total) | 13 (52.0%) | Loss trades (% of total) | 12 (48.0%) |
| Largest | profit trade | 2.9 | loss trade | -3.45 | |
| Average | profit trade | 1.08 | loss trade | -2.18 | |
| Minimum | profit trade | 0.01 | loss trade | -0.13 | |
| Maximum | take profit in pips | 34.6 | stop loss in pips | -33.8 | |
| Average | take profit in pips | 11.2 | stop loss in pips | -23.7 | |
| Minimum | take profit in pips | -1.3 | stop loss in pips | -11.8 | |
| Maximum | Reward-Risk | 1.6 | Duration in minutes | 2163.0 | |
| Average | Reward-Risk | 0.5 | Duration in minutes | 276.4 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0.0 | |
| Maximum | consecutive wins (profit in money) | 4.0 (3.04) | consecutive losses (loss in money) | 4.0 (-6.84) | |
| Average | consecutive wins | 2.0 | consecutive losses | 1.0 |
| Total net profit | -17.09 | Gross profit | 18.04 | Gross loss | -35.13 |
| Profit factor | 0.51 | Expected payoff | -0.53 | ||
| Absolute drawdown | -20.63 | Maximal drawdown (%) | 18.07 (-705.86%) | ||
| Total trades | 32 | Profit trades (% of total) | 15 (46.88%) | Loss trades (% of total) | 17 (53.13%) |
| Largest | profit trade | 2.65 | loss trade | -3.9 | |
| Average | profit trade | 1.2 | loss trade | -2.07 | |
| Minimum | profit trade | 0.38 | loss trade | -0.73 | |
| Maximum | take profit in pips | 32.1 | stop loss in pips | -36.6 | |
| Average | take profit in pips | 12.7 | stop loss in pips | -20.5 | |
| Minimum | take profit in pips | 3.7 | stop loss in pips | -6.9 | |
| Maximum | Reward-Risk | 2.3 | Duration in minutes | 4142.0 | |
| Average | Reward-Risk | 0.7 | Duration in minutes | 485.8 | |
| Minimum | Reward-Risk | Duration in minutes | 1.0 | ||
| Maximum | consecutive wins (profit in money) | 3.0 (4.51) | consecutive losses (loss in money) | 4.0 (-9.56) | |
| Average | consecutive wins | 1.0 | consecutive losses | 1.0 |


Sir Eric Rodemai:
Thank you. I'll spread the word of your brave Clan's defeat of the Gargoyle Lord Tiphon.
"I'll keep slaying Raid Bosses."
"I want to quit this mission."


jQuery Demo!
Newt
Monkey
Lion
Div 1
Div 2
Div 3
Div 4
jQuery Methods Demo Page
Bus 1
Bus 2
Bus 3
Bus 1
Bus 2
Please don't fade me!
Fade me!
Click to Fade


The paper proposes a new inverse RL (IRL) algorithm, called as Trajectory-ranked Reward EXtrapolation (T-REX) that learns a reward function from a collection of ranked trajectories.
Standard IRL approaches aim to learn a reward function that “justifies” the demonstration policy and hence those approaches cannot outperform the demonstration policy.
In contrast, T-REX aims to learn a reward function that “explains” the ranking over demonstrations and can learn a policy that outperforms the demonstration policy.
The input is a sequence of trajectories T1, … Tm which are ranked in the order of preference. That is, given any pair of trajectories, we know which of the two trajectories is better.
The setup is to learn from observations where the learning agent does not have access to the true reward function or the action taken by the demonstration policy.
Reward Inference
A parameterized reward function rθ is trained with the ranking information using a binary classification loss function which aims to predict which of the two given trajectory would be ranked higher.
Given a trajectory, the reward function predicts the reward for each state. The sum of rewards (corresponding to the two trajectories) is used used to predict the preferred trajectory.
T-REX uses partial trajectories instead of full trajectories as a data augmentation strategy.
Policy Optimization
Environments: Mujoco (Half Cheetah, Ant, Hooper), Atari
Demonstrations generated using PPO (checkpointed at different stages of training).
Ensemble of networks used to learn the reward functions.
The proposed approach outperforms the baselines Behaviour Cloning from Observations and Generative Adversarial Imitation Learning.
In terms of reward extrapolation, T-REX can predict the reward for trajectories which are better than the demonstration trajectories.
Some ablation studies considered the effect of adding noise (random swapping the preference between trajectories) and found that the model is somewhat robust to noise up to an extent.


L2Advanced
Write a new Security Password !
Requests :
Uppecase
,
Number
and a
Symbol
.
Example :
#High5
(
#
- Symbol
H
- Uppercase and
5
- Number)
L2Advanced


Example component
Modals can be useful because they focus the user on completing a specific action, this is particularly beneficial on complicated interactions or when space is at a premium. They can be useful because, in a similar way to accordions, the interaction is conditional, the user has chosen to interact with the object. Modals or dialog boxes should be used very sparingly. They force the user away from the context of the page they are on and increase cognitive load.
{% include "includes/modal.html" %}
{% include "includes/modal-code.html" %}
Content patterns
- Content that opens the modal should explain to the user what will happen
- The content of the modal should be focused on the single task and continue from the link/page
- Include heading or title
Interaction patterns
- The modal should focus on a single task
- Consider an alternative approach to modals on mobile
Inclusive patterns
- Include `ARIA` tags
- Include labels and tags
User research
- Encourages focus
- Complicated interactions within the modal dissorientate
- Multiple modals create confusion
- Test this version (CSS only) with form content
Services using this pattern
- Application
Things to do
- js for keydown


1. "/add" -> to add a new task
Example JSON request body
{
"task_name":"My Task",
"task_description":"My task description",
"creator":"My Name",
"duration":5
}
NOTE: "duration" should be given in seconds.
2. "/list" -> Fetch the created tasks.
GET REQUEST
https://task-timer-app-api.herokuapp.com/list
POST REQUEST
https://task-timer-app-api.herokuapp.com/add
{
"task_name":"My Task",
"task_description":My task description,
"creator":"My Name",
"duration":5
}
MADE BY: AMAN KUMAR JHA


tvm.Function¶
-
class
tvm.
Function
(handle, is_global)¶ The PackedFunc object used in TVM.
Function plays an key role to bridge front and backend in TVM. Function provide a type-erased interface, you can call function with positional arguments.
The compiled module returns Function. TVM backend also registers and exposes its API as Functions. For example, the developer function exposed in tvm.ir_pass are actually C++ functions that are registered as PackedFunc
The following are list of common usage scenario of tvm.Function.
Automatic exposure of C++ API into python
To call PackedFunc from python side
To call python callbacks to inspect results in generated code
Bring python hook into C++ backend
See also
tvm.register_func
How to register global function.
tvm.get_global_func
How to get global function.
-
tvm.
register_func
(func_name, f=None, override=False)¶ Register global function
- Parameters
func_name (str or function) – The function name
f (function, optional) – The function to be registered.
override (boolean optional) – Whether override existing entry.
- Returns
fregister – Register function if f is not specified.
- Return type
function
Examples
The following code registers my_packed_func as global function. Note that we simply get it back from global function table to invoke it from python side. However, we can also invoke the same function from C++ backend, or in the compiled TVM code.
targs = (10, 10.0, "hello") @tvm.register_func def my_packed_func(*args): assert(tuple(args) == targs) return 10 # Get it out from global function table f = tvm.get_global_func("my_packed_func") assert isinstance(f, tvm.nd.Function) y = f(*targs) assert y == 10
-
tvm.
get_global_func
(name, allow_missing=False)¶ Get a global function by name
- Parameters
- Returns
func – The function to be returned, None if function is missing.
- Return type


Purely Dysfunctional Data Structures
Practical Side of Implementing Immutable Structures
Immutability
List<String> transform(List<String> list);
List<String> transform(List<String> list) {
list.add(this.state.get(0));
list.add(SOME_CONSTANT);
this.orderPizza();
if (MOON.getLunarPhase() == FULL) list.remove(7);
this.moreState.addAll(list);
OtherClass.mutableStaticField = list;
return list;
}
Immutability helps in minimizing the number of invalid states
User user = new User();
user.setName(...);
user.setSurname(...);
user.setPhone(...);
// ...
user.set(...);
User user = new User(); // 2^0
user.setName(...);
user.setSurname(...);
user.setPhone(...);
// ...
user.set(...);
User user = new User(); // 2^0
user.setName(...); // 2^1
user.setSurname(...); // 2^2
user.setPhone(...); // 2^3
// ...
user.set(...); // 2^N
User user = new User();
Set<Users> users = new HashSet<>();
users.add(user);
user.setName(42);
users.contains(user); //false
User user = new User(name, surname);
Error space reduced
Immutability enables multiple optimizations
Objects can be memoized
Properties can be precomputed (hashes, sizes, etc)
2 Element List (JDK9)
static final class List12<E> extends AbstractImmutableList<E> {
@Stable
private final E e0;
@Stable
private final E e1;
}
@Override
public E get(int index) {
if (index == 0) {
return e0;
} else if (index == 1 && e1 != null) {
return e1;
}
throw outOfBounds(index);
}
An object is immutable when:
its state cannot be modified after construction
all its fields are final*
"this" reference doesn't escape during construction
Java Concurrency in Practice, Brian Goetz
Is String immutable?
final class String {
// ...
private final byte[] value;
private final byte coder;
private int hash;
// ...
}
public int hashCode() {
int h = hash;
if (h == 0 && value.length > 0) {
hash = h = isLatin1() ? StringLatin1.hashCode(value)
: StringUTF16.hashCode(value);
}
return h;
}
It depends.
Does immutable even exist?
public static void main(String[] args) throws Exception {
VarHandle VALUE = MethodHandles.privateLookupIn(
String.class, MethodHandles.lookup())
.findVarHandle(String.class, "value", byte[].class);
Object kotlin = VALUE.get("Kotlin");
Object java = VALUE.get("Java!!");
System.arraycopy(java, 0, kotlin, 0, Array.getLength(kotlin));
System.out.println("Kotlin"); // Java!!
}
"Safely Shoot Yourself in the Foot with Java 9" by Heinz Kabutz
Immutable objects are not always thread-safe
The state of a new collection instance may not have been "published" (in the sense of the Java Memory Model specification), so that an unsynchronized non-volatile read from another thread may observe the object in an invalid state
If someone unsafely publishes new ::("", Nil) or Vector(1) to another thread,
that thread could observe a inconsistent state (...)
Designing Immutable APIs
java.util.List
static abstract class AbstractImmutableList<E>
extends AbstractImmutableCollection<E> ... {
// all mutating methods throw UnsupportedOperationException
void add(...) { throw uoe(); }
boolean addAll(...) { throw uoe(); }
E remove(...) { throw uoe(); }
void replaceAll(...) { throw uoe(); }
E set(...) { throw uoe(); }
void sort(...) { throw uoe();
}
The easy and not-very user-friendly way
And it violates Liskov's Substitution Principle
The key to user-friendly APIs of immutable structures are "mutating" methods returning a copy of the source
static abstract class AbstractImmutableList<E>
extends AbstractImmutableCollection<E> ... {
// all mutating methods return a changed copy
List<E> add(...) { return copyWith(...) }
List<E> addAll(...) { return copyWithAll(...) }
List<E> remove(...) { return copyWithout(...) }
List<E> replaceAll(...) { return copyWithReplaced(...) }
List<E> set(...) { return copyAndSet(...) }
List<E> sort(...) { return copySorted(...) }
}
static abstract class AbstractImmutableList<E>
extends AbstractImmutableCollection<E> ... {
// all mutating methods return a changed copy
List<E> add(...) { return copyWith(...) }
List<E> addAll(...) { return copyWithAll(...) }
List<E> remove(...) { return copyWithout(...) }
List<E> replaceAll(...) { return copyWithReplaced(...) }
List<E> set(...) { return copyAndSet(...) }
List<E> sort(...) { return copySorted(...) }
}
That's quite a lot of copying
... and iterating
"Haskell computations produce a lot of memory garbage - much more than conventional imperative languages."
(...)
"It's not uncommon to produce 1gb of data per second ..."
https://wiki.haskell.org/GHC/Memory_Management
Persistent Data Structures
A data structure that supports multiple versions is called persistent
while a data structure that allows only a single version at a time is called ephemeral
"Making data structures persistent" - James R. Driscoll, Neil Sarnak, Daniel D. K. Sleator, and Robert E. Tarjan
Brute-force copying
Fat nodes (think in-memory event-sourcing for data structures)
Structural sharing
Structural sharing
Gain efficiency by minimizing copying and maximizing reuse of existing elements
Rich Hickey’s “Clojure Concurrency”
Purely Functional Data Structures by Grzegorz Piwowarek
String
A Persistent Data Structure?
public String substring(int beginIndex) {
// ... JDK 8
return (beginIndex == 0)
? this
: new String(value, beginIndex, subLen);
}
Could avoid a new String allocation and would be perfectly safe
...but could create memory leaks so String's constructor does the copy anyway
ArrayList
Doesn't work with mutable structures
public List<E> subList(int fromIndex, int toIndex) {
subListRangeCheck(fromIndex, toIndex, size);
return new SubList(this, 0, fromIndex, toIndex);
}
Source can be mutated which can lead to sneaky bugs
For example:
List<Integer> numbers = // ...
List<Integer> transformed = guava.Lists.transform(numbers, i -> i);
List<Integer> someNumbers = transformed.subList(0, 3);
Collections.shuffle(numbers);
System.out.println(numbers); // [2,3,4,5...]
System.out.println(someNumbers); // [2,3,4]
Persistent Singly-Linked List
class Cons<T> implements List<T> {
private final T head;
private final List<T> tail;
}
List<T> prepend(T element) {
return new Cons<>(element, this);
}
Zero copy and constant time
"Purely Functional Data Structures in Scala", Vladimir Kostyukov
What about List#append?
List<T> append(T element) {
return foldRight(of(element), (x, xs) -> xs.prepend(x));
}
O(n)
Acceptable for lists since we have O(1) additions
Immutable Structures are thread-safe
...but not always useful for multithreaded scenarios
From the book "King Midas and the Golden Touch" by Marie C Craft
If we want to share "updates" of an immutable structure, we need to manually control access to the root reference
private volatile ImmutableList<Integer> queue;
// ..
// major contention here!
private synchronized void prepend(Integer e) {
queue = queue.prepend(e);
}
...or just use a dedicated mutable data structure
...or a different way of sharing updates
Same applies to any immutable structure
private volatile String text;
private synchronized void add(String postfix) {
text = text + postfix;
}
We could do the same lock-free with CAS but that would generate even more garbage and further stress GC
Persistent Set
class Set<T> {
private final List<T> set;
}
Highly inefficient because of O(N) element access
Can we do something... smarter?
We could use a tree
Path copying
Path copying
Subtrees not on the path can be shared
Persistent Queue
class Cons<T> implements List<T>, Queue<T> {
private final List<T> queue;
}
Works great as a LIFO stack
Queues exhibit different access patterns than lists which makes this implementation highly inefficient
Efficient Persistent Queue
class Cons<T> implements List<T>, Queue<T> {
private final List<T> front;
private final List<T> rear; // in opposite direction
}
Queue#new
private Queue(List<T> front, List<T> rear) {
this.front = front.isEmpty() ? rear.reverse() : front;
this.rear = front.isEmpty() ? front : rear;
}
Queue#enqueue
@Override
public Queue<T> enqueue(T element) {
return new Queue<>(front, rear.prepend(element));
}
Queue#dequeue
public Option<Tuple2<T, Q>> dequeue() {
return isEmpty()
? Option.none()
: Option.some(Tuple.of(head(), tail()));
}
Amortized constant-time! (mostly O(1), rarely O(n))
List#reverse is performed infrequently
Most likely not acceptable for real-time systems
Can we do something... smarter?
We could use a tree
2-3 Tree
...if it's so smart, why does Scala use Banker's Queue?
It's much more cache-friendly*
Persistent Map
class PMap<K, V> implements Map<K, V> {
private final List<Entry<K, V> map;
}
Advantages: it works
Disadvantages: performs nowhere near HashMap
Can we do something... smarter?
Lookup: log_32(N)
log_32(Integer.MAX_VALUE) ~ 6
log_32(Long.MAX_VALUE) ~ 13
Key takeaways:
Efficient immutability involves minimization of copying and maximization of structural sharing
Simple beats complex
Immutability is not a silver bullet
Trade-offs are everywhere
Purely Functional Data Structures, Chris Okasaki
Red-Black Trees in a Functional Setting, Chris Okasaki
Ideal Hash Trees, Phil Bagwell
Fast And Space Efficient Trie Searches, Phil Bagwell
Cache-Aware Lock-Free Concurrent Hash Tries, Prokopec, Bagwell, Odersky
https://shipilev.net/jvm/anatomy-quarks/11-moving-gc-locality/
Senior Software Engineer @ Hazelcast
Thank You!


{% extends "global/Page.html" %} {% load staticfiles otree_tags %} {% block title %} Results {% endblock %} {% block content %}
{% if player.role == "husband" %} You chose to go to {{player.decision}} and Wife chose to go to {{player.other_player.decision}}. As a result, your payoff is {{player.payoff}} {% else %} You chose to go to {{player.decision}} and Husband chose to go to {{player.other_player.decision}}. As a result, your payoff is {{player.payoff}}. {% endif %}
{% next_button %} {% include Constants.instructions_template %} {% endblock %}


{% extends 'project_management/pm_base.html' %} {% block breadcrumb %} Dashboard Literature Mendeley Error {% endblock breadcrumb %} {% block pm_content %}
Your search query will probably work if you retry, otherwise you can return to the search page.


Name
Country
Year
Description
[Your installation! 🎉🎉🎉]
[Country]
[Launched]
[A description of your installation of Dataverse.] To add your installation to the map, please create an
issue
.


--- layout: page --- {{ content }} {% assign posts = paginator.posts | default: site.posts %}
2020-2021 Berkeley Gold (Div 1) [North America West Division Championships]


Note: All information entered is protected by our privacy policy. Profile information can only be viewed by others with your permission.
Gender
Premium Membership


%@page language="abap" %>
After logging in you will be able to authorize the app
Sign in
<%= message %>


[gecode-users] kernel issues
Filip Konvička
filip.konvicka at logis.cz
Mon Apr 21 12:11:03 CEST 2008
Hi Christian,
> sorry for the long delay, but I was away from my keyboard. Yes, you are
> right! I just added your fix to the trunk. For the integer variables it did
> not show, as med_fst == 0 for them.
>
> The script that generates the variable stubs is misc/genvariables.perl (line
> 608).
>
> Thanks for the fix!
You're welcome. By the way, after we removed the "DOM" modification
event and propagation condition the generated code is OK even without
the fix, but this is just because the resulting code is simpler.
FloatVar seems to work for us, we'll now spend some time polishing the
source code and testing before we publish it.
Cheers,
Filip
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
> Of Filip Konvicka
> Sent: Monday, April 14, 2008 2:28 PM
> To: users at gecode.org
> Cc: lmoric at logis.cz
> Subject: [gecode-users] kernel issues
>
> Hi,
>
> so Lubos started working on the FloatVar implementation and he's
> discovered something that looks like a bug in Gecode. Initially, we just
> copied "integer.vis" to "float.vis" and renamed the identifiers so we
> got "_FLOAT_" instead of "_INT_" everywhere. (Later on, we'll probably
> at least remove the "DOM" modification event and propagation condition.)
>
> So in short:
>
> [General]
> Name: Float
> Ifdef: GECODE_HAS_FLOAT_VARS
> Namespace: Gecode::Float
>
> and the rest goes exactly the same as with IntVar.
>
> Then we tried posting a propagator on a FloatVar, but unexpectedly
> nothing happened. Lubos tracked this down to the following code fragment
> in kernel/var-type.icc:
>
> case ME_FLOAT_BND:
> {
> static const Gecode::ModEvent me_c = (
> ((ME_FLOAT_NONE ^ ME_FLOAT_BND ) << 0) |
> ((ME_FLOAT_VAL ^ ME_FLOAT_VAL ) << 4) |
> ((ME_FLOAT_BND ^ ME_FLOAT_BND ) << 8) |
> ((ME_FLOAT_DOM ^ ME_FLOAT_BND ) << 12)
> );
> Gecode::ModEvent me_o = (med & med_mask) >> med_fst;
> Gecode::ModEvent me_n = (me_c >> (me_o << 2)) & med_mask;
> if (me_n == 0)
> return false;
> med ^= me_n << med_fst;
> break;
> }
>
> This is similar to what is generated for IntVars (ME_INT_BND), but it
> seems that the condition (me_n == 0) always evaluates to true for
> FloatVars, and so nothing ever happens.
>
> Lubos fixed this by changing the appropriate line to
>
> Gecode::ModEvent me_n = (me_c >> (me_o << 2)) & (med_mask >> med_fst);
>
> This seems logical to me. Do you know what script to fix in order to get
> it generated this way?
>
> Thanks,
> Filip
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


This example demonstrates the Custom rendering capabilities of TreeMap Custom Element. You can set the "color" property of each data field or customize the rendering of a sector by using the "renderCallbacks" function.
Non-mobile web browser usage for Wikimedia visitors as of March 2014


| module ti.uia.events.UIABenchmark |
|
|
|
UIA Benchmark Events
The UIABenchmark module defines events that allow
tooling to analyze the performance of the software
(processing time, latency, etc.)
[
more ... ]
#include <ti/uia/events/UIABenchmark.h>
Functions common to all target modules |
|
|
Constants |
| |
| |
| |
| |
DETAILS
The UIABenchmark module defines events that allow
tooling to analyze the performance of the software
(processing time, latency, etc.)
The generation of UIABenchmark events is controlled by a module's diagnostics
mask, which is described in detail in
xdc.runtime.Diags.
UIABenchmark events are generated only when the Diags.ANALYSIS bit is set
in the module's diagnostics mask.
The following configuration script demonstrates how the application might
control the logging of ANALYSIS events embedded in the Mod module at configuration
time. In this case, the configuration script arranges for the Log
statements within modules to always generate ANALYSIS events.
Without these configuration statements, no ANALYSIS events would be generated
by any modules.
EXAMPLES
Example 1: This is part of the XDC configuration file for the application:
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
var Diags = xdc.useModule('xdc.runtime.Diags');
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var logger = LoggerSys.create();
Defaults.common$.diags_ANALYSIS = Diags.ALWAYS_ON;
Defaults.common$.logger = logger;
Example 2: The following example configures a module to support logging
of ANALYSIS events, but defers the actual activation and deactivation of the
logging until runtime. See the
Diags_setMask()
function for details on specifying the control string.
This is a part of the XDC configuration file for the application:
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Mod = xdc.useModule('my.pkg.Mod');
Mod.common$.diags_ANALYSIS = Diags.RUNTIME_OFF;
This is a part of the C code for the application:
// turn on logging of ANALYSIS events in the module
Diags_setMask("my.pkg.Mod+Z");
// turn off logging of ANALYSIS events in the module
Diags_setMask("my.pkg.Mod-Z");
| config UIABenchmark_start // module-wide |
|
Benchmark event used to log the start of an operation
VALUES
fmt
a constant string that provides format specifiers for up to 7 additional parameters
EXAMPLE
The following C code shows how to log a simple
benchmark 'start' event along with a user-specified
format string describing the event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
...
Log_write1(UIABenchmark_start, (IArg)"My benchmark event");
The following text will be displayed for the event:
Start: My benchmark event
| config UIABenchmark_startInstance // module-wide |
|
Benchmark event used to log the start of an operation instance
extern const Log_Event UIABenchmark_startInstance;
VALUES
fmt
a constant string that provides format specifiers for up to 6 additional parameters
instanceId
a unique instance ID that can be used to match benchmark start and stop events
DETAILS
Event parameter provides instance data to differentiate
between multiple instances that can run in parallel.
EXAMPLE
The following C code shows how to log a benchmark
'startInstance' event along with a user-specified
instance identifier and a format string describing the event.
#include <xdc/runtime/Gate.h>
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
static volatile int gMyGlobalInstanceId = 0;
...
IArg key;
int localInstanceId;
// protect pre-increment operation from race conditions
key = Gate_enterSystem();
localInstanceId = ++gMyGlobalInstanceId;
Gate_leaveSystem(key);
Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
...
Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
The following text will be displayed for the event:
StartInstance: My benchmark event: instanceId=1
StopInstance: My benchmark event: instanceId=1
| config UIABenchmark_stop // module-wide |
|
Benchmark event used to log the end of an operation
VALUES
fmt
a constant string that provides format specifiers for up to 7 additional parameters
EXAMPLE
The following C code shows how to log a simple
benchmark 'stop' event along with a user-specified
format string describing the event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
...
Log_write1(UIABenchmark_stop, (IArg)"My benchmark event");
The following text will be displayed for the event:
| config UIABenchmark_stopInstance // module-wide |
|
Benchmark event used to log the end of an operation instance
extern const Log_Event UIABenchmark_stopInstance;
VALUES
fmt
a constant string that provides format specifiers for up to 6 additional parameters
instanceId
a unique instance ID that can be used to match benchmark start and stop events
DETAILS
Event parameter provides instance data to differentiate
between multiple instances that can run in parallel.
EXAMPLE
The following C code shows how to log a benchmark
'stopInstance' event along with a user-specified
instance identifier and a format string describing the event.
#include <xdc/runtime/Gate.h>
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
static volatile int gMyGlobalInstanceId = 0;
...
IArg key;
int localInstanceId;
// protect pre-increment operation from race conditions
key = Gate_enterSystem();
localInstanceId = ++gMyGlobalInstanceId;
Gate_leaveSystem(key);
Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
...
Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
The following text will be displayed for the event:
StartInstance: My benchmark event: instanceId=1
StopInstance: My benchmark event: instanceId=1
| Module-Wide Built-Ins |
|
// Get this module's unique id
Bool UIABenchmark_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool UIABenchmark_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 UIABenchmark_Module_getMask();
// Returns the diagnostics mask for this module
Void UIABenchmark_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
module-wide config parameters
msg: "Start: %$S "
};
msg: "StartInstance: %$S "
};
msg: "Stop: %$S "
};
msg: "StopInstance: %$S "
};
| config UIABenchmark.start // module-wide |
|
Benchmark event used to log the start of an operation
VALUES
fmt
a constant string that provides format specifiers for up to 7 additional parameters
EXAMPLE
The following C code shows how to log a simple
benchmark 'start' event along with a user-specified
format string describing the event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
...
Log_write1(UIABenchmark_start, (IArg)"My benchmark event");
The following text will be displayed for the event:
Start: My benchmark event
C SYNOPSIS
| config UIABenchmark.startInstance // module-wide |
|
Benchmark event used to log the start of an operation instance
msg: "StartInstance: %$S "
};
VALUES
fmt
a constant string that provides format specifiers for up to 6 additional parameters
instanceId
a unique instance ID that can be used to match benchmark start and stop events
DETAILS
Event parameter provides instance data to differentiate
between multiple instances that can run in parallel.
EXAMPLE
The following C code shows how to log a benchmark
'startInstance' event along with a user-specified
instance identifier and a format string describing the event.
#include <xdc/runtime/Gate.h>
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
static volatile int gMyGlobalInstanceId = 0;
...
IArg key;
int localInstanceId;
// protect pre-increment operation from race conditions
key = Gate_enterSystem();
localInstanceId = ++gMyGlobalInstanceId;
Gate_leaveSystem(key);
Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
...
Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
The following text will be displayed for the event:
StartInstance: My benchmark event: instanceId=1
StopInstance: My benchmark event: instanceId=1
C SYNOPSIS
| config UIABenchmark.stop // module-wide |
|
Benchmark event used to log the end of an operation
VALUES
fmt
a constant string that provides format specifiers for up to 7 additional parameters
EXAMPLE
The following C code shows how to log a simple
benchmark 'stop' event along with a user-specified
format string describing the event.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
...
Log_write1(UIABenchmark_stop, (IArg)"My benchmark event");
The following text will be displayed for the event:
C SYNOPSIS
| config UIABenchmark.stopInstance // module-wide |
|
Benchmark event used to log the end of an operation instance
msg: "StopInstance: %$S "
};
VALUES
fmt
a constant string that provides format specifiers for up to 6 additional parameters
instanceId
a unique instance ID that can be used to match benchmark start and stop events
DETAILS
Event parameter provides instance data to differentiate
between multiple instances that can run in parallel.
EXAMPLE
The following C code shows how to log a benchmark
'stopInstance' event along with a user-specified
instance identifier and a format string describing the event.
#include <xdc/runtime/Gate.h>
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIABenchmark.h>
static volatile int gMyGlobalInstanceId = 0;
...
IArg key;
int localInstanceId;
// protect pre-increment operation from race conditions
key = Gate_enterSystem();
localInstanceId = ++gMyGlobalInstanceId;
Gate_leaveSystem(key);
Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
...
Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
The following text will be displayed for the event:
StartInstance: My benchmark event: instanceId=1
StopInstance: My benchmark event: instanceId=1
C SYNOPSIS
| metaonly config UIABenchmark.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
generated on Wed, 28 Aug 2019 19:03:34 GMT


{{include 'py_functions.py'}}
|
Termite
Topic Model Visualization 0.1 Visualization by Jason Chuang, Ashley Jin Stanford Vis Group
Currently showing
50
total terms.
Affinity = Most frequent terms in the corpus
Show top:
50
terms by affinity.
Saliency = Frequent & distinctive terms
Show top:
0
terms by saliency.
Double click topic label to sort by topic.
Sorting by:
default
Choose terms to always show in the terms list.
Persistent terms
Normalize by topic weight
Add 20 top terms per selected topic
Click a topic label to rename it.
Relabel:
Move topic at
to:
|
This visualization shows the topical distribution of words in a corpus. The area of a circle is proportional to a word's frequency in a topic. |


WITNESS LIST
Education
February 19, 2015 10:30 AM
FOR:
Bamberg, Wanda Superintendent of Schools (also providing written testimony) (Aldine
ISD, Texas School Alliance), Houston, TX
Banks, Yannis Legislative Liaison (Texas NAACP), Austin, TX
Cook, Kim Board Member (TAMSA), Austin, TX
Duron, Jodi Superintendent (also providing written testimony) (Elgin ISD), Elgin, TX
Majcher, Dineen Bd of Directors (TAMSA), Austin, TX
Mitchell, Alexis Former student (Self), Austin, TX
Moreno, Celina Legislative Staff Attorney (also providing written testimony) (MALDEF),
San Antonio, TX
Placek, Scott (Self), Liberty Hill, TX
Ruiz, Cynthia Teacher (class of 2015), Austin, TX
ON:
Byer, Von General Counsel (Texas Education Agency), Austin, TX
Cloudt, Criss Associate Commissioner, Assessment and Accountability (Texas Education
Agency), Austin, TX
Martinez, Monica Associate Commissioner for Standards & Programs (Texas Education
Agency), Austin, TX
Salinas, Nelson Govt. Affairs Manager (Texas Assoc. of Business), Austin, TX
Scheberle, Drew SVP (Greater Austin Chamber of Commerce), Austin, TX
Zyskowski, Gloria Director, Student Assessment (TX Education Agency), Austin, TX
Registering, but not testifying:
FOR:
Beneski, Amy Associate Executive Director (Texas Association of School Administrators),
Austin, TX
Campbell, Grover Assoc Exec Dir for Governmental Relations (Texas Association of
School Boards), Austin, TX
Grey, John Government Relations Specialist (Texas State Teachers Assoc.), Austin, TX
Haenisch, Barry Executive Director (Texas Association of Community Schools), Austin,
TX
Hollingsworth, Jr., Lonnie Director of Governmental Relations (Texas Classroom Teachers
Association), Austin, TX
Kuhlmann, Kate Lobbyist (Association of Texas Professional Educators (ATPE)), Austin,
TX
Lilly, Janna Director Gov't Relations (TCASE Texas Council of Administrators of Special
Education), Austin, TX
Motheral, Mike Executive Director (Small Rural School Finance Coalition), Lubbock, TX
Pullen, Shea Development Manager (Goodwill Central Texas), Austin, TX
Quinzi, Patty Legislative Counsel (Tx - American Federation of Teachers), Austin, TX
Rogers, Don Executive Director (Texas Rural Education Assn.), Buda, TX
Rome, Christy Executive Director (Texas School Coalition), Austin, TX
Ward, Kyle ED (Texas PTA), Austin, TX
Yeager, Laura Parent (Self + children (12th, 10th, 7th grade)), Austin, TX
WITNESS LIST
Education
February 19, 2015 10:30 AM
ON:
Hammond, Bill C.E.O. (Texas Assoc. of Business), Austin, TX


Simple.Buttons
A simple, easy-to-use button library
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit
Submit


In this second version of the CrossAsia Fulltext Search metadata and fulltexts are searched at the same time. You can use the filter "Type of Object" to reduce your result set or presetting your search to the contents of the "Pages" or the metadata of the "Books" or "Chapters" or to the content - and metadata - of "Articles".
The list of resources included in this search can be viewed from the list of filters directly underneath the search slot
FEATURES: - searching metadata and fulltext at the same time
- ranking of search hits by Solr score (note: be aware that if you do not enclose your search term in "" texts with a high frequency of one word/character of your search term will score higher than those where your two search words/characters appear next to each other)
- for each hit two types of link are provided: one - in red - for authenticated CrossAsia users, another one - in grey - for all other users who will then need to enter their individual authorization or access the ressource from within a subscriber's IP range. Please note that not all databases provide links to directly call-up a specific page of a ressource, some even do not have direct links to an item in their database (for example Erudition Local Gazetteers or Renmin ribao).
人民日报 : People s Daily CONTENT: Fulltexts of all articles from the inception of the People's Daily in 1946 to end of August 2009. Articles will be shown as individual hits of the issue of a certain day.
NOTE: To see the image-PDF of the issue you will have go to the database (http://erf.sbb.spk-berlin.de/han/RenminRibao1/) and open the issue via the calendar browse function provided in the database.


Analogies and Definitions
What is grid based design?
Grid based design refers to content being organised on a page as if elemnts are all part of a grid that follows a top to bottom, left to right pattern.
Whats all the hype about responsive webpages?
The hype has to do with an ever increasing number of smart phone and tablet users as well as there being many different browsers and computer screens. Responsive design means the kind of design that is convenient to use for all users
regardless their choice of device or browser, i.e. the kind of design that responds to the user's needs.
What is semantic structure?
Semantic structure means structure of tags that reflect the semantic meaning of the element
Any other points you found interesting and want to reflect on.
Makes me wonder if there is an easy to use, stripped down framework that is suitable for a beginner such as myself, for example like the one in the udacity document.


Forum PHP Paris, 21 nov 2013
var me = {
"user": "Ronan"
, "age": 35
, "origin": "Brittany"
, "twitter": "@arno_u_loginlux"
, "repo": "github.com/ronanguilloux"
, "work"<EMAIL_ADDRESS>, "tags": [
"dad"
, "bearded web developer"
, "foss supporter"
]
}
PHP Appreciation Society Member
since 1999
1/3: Raspberry Pi is...
not a production environment,
not scalable,
not safe for work
not entreprise-ready
and it's OK.
So...
or STFU
2/3: PHP is serious IT after all. Raspi is not.
(or not)
~
(& vice-versa)
3/3: by design...
PHP is not for Hardware
(integrated circuits, controllers, sensors...)
~
Raspberry Pi is 100%
for learning & playing
with electronic hardware!
So this is how it started:
I bought a Rasberry Pi.
The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn (python) programming.
http://www.raspberrypi.org/faqs
The idea behind a tiny and cheap computer for kids came in 2006, when Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory, became concerned about the year-on-year decline in the numbers and skills levels of the A Level students applying to read Computer Science. From a situation in the 1990s where most of the kids applying were coming to interview as experienced hobbyist programmers, the landscape in the 2000s was very different; a typical applicant might only have done a little web design.
http://www.raspberrypi.org/about
Raspi are manufactured in the UK,
at Sony's manufacturing facility in Pencoed, Wales.
1 million sold a year, since 2012.
$35 / 32.72 €
(26 € exc. VAT)
Power supply or SD cards are not included
a regular 5V / 1A smartphone charger
with mini micro USB cable
a regular USB Wireless Dongle
a SD CARD
(optional) a USB flash drive
Mind the box case!
a box case!
see Adafruit
check the community documentation:
http://elinux.org/RPi_VerifiedPeripherals
keyboards, bluetooth dongles, soundcards, 3G, IR, GPS, HDMI/DVI/VGA cables & converter boxes, webcams, TV tuners,...
To buy one of these monitors, search eBay for "Car TFT" and there will be loads of results. It should cost about £10 ($16).
Note the handy slot for the 26-pin IDC cable!
Playing cards box is exactly the right size!
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform (...), and a development environment for writing software for the board.
In 2011: 95% of smartphones, 90% of hard disk drives, 40% of digital televisions and set-top boxes, 15% of microcontrollers and 20% of mobile computers
GOOD NEWS: ARM is now actively targetted by many distro/packages providers: PHP, NodeJs,...
Microsoft Surface, ASUS Eee Pad, Apple iPads, iPhones & iPods, Samsung Galaxy S2/S3/S4, Google Nexus 4/5/10, Google Chrome Book, Blackberry smartphones, Canon PowerShot A470 digital camera, Nintendo DS game console, TomTom GPS...
Texas, 1942 (Wikimedia Commons)
maker [ˈmeɪkə] - n.
people who hack hardware, business-models, and living arrangements to discover ways of staying alive and happy even when the economy is falling down the toilet.
Cory Doctorow, Makers, October 2009, [read it for free]
related: Dreamers, scientists, hackers, self-replicators, teachers, troublemakers, laser-lovers, scouts
The maker subculture is a contemporary subculture, representing a technology-based extension of DIY culture.
related: DIY, electronics, robotics, 3-D printing, home-automation / domotique, open-source-hardware, fablabs, cnc tools, metalworking, woodworking, knitting, traditional arts and crafts, no-patents
Check this talk from the author, Chris Anderson, formally of WIRED
The new e-Health sensor platform adds sensing capability for nine different biometric parameters, such as pulse, blood pressure, oxygen in blood (SPO2), electrocardiogram (EKG), airflow, glucometer, galvanic skin response (GSR), patient position and body temperature, to give the Arduino and Raspberry Pi Community a way to develop new e-Health applications and products.
The new e-Health sensor platform adds sensing capability for nine different biometric parameters, such as pulse, blood pressure, oxygen in blood (SPO2), electrocardiogram (EKG), airflow, glucometer, galvanic skin response (GSR), patient position and body temperature, to give the Arduino and Raspberry Pi Community a way to develop new e-Health applications and products.
Combining these ingredients:
= Have my lights switched on and off automatically based on a schedule I create in Google Calendar.
See e how-to, using Despotify
See also: github.com/Hexxeh/spotify-websocket-api (python)
A Raspberry Pi Remote Mains Switcher
aonsquared.co.uk/the_dark_pi_rises
Also check pi-cars.com
See instructables.com/id/Picopter
Also check Tricopter with Picopter Flight Control - Fpv Flight
&Picopter code shared on Github
Revelation #0
~
Wiring a simple LED with a resistor
# modprobe w1-gpio
# cd /sys/class/gpio/
# ls
# export gpiochip0 unexport
# GPIO=17
# cd /sys/class/gpio/gpio$GPIO
# echo $GPIO > export
# ls -l
total 0
--w------- 1 root root 4096 nov. 21 09:45 export
lrwxrwxrwx 1 root root 0 nov. 21 09:45 gpio17 -> ../../devices/virtual/gpio/gpio17
lrwxrwxrwx 1 root root 0 nov. 21 09:44 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
--w------- 1 root root 4096 nov. 21 09:44 unexport
Notice on the first ls that gpio17 doesn't exist,
echo "in" > direction
cat value
You can configure the GPIO for output and set the value as well.
echo "out" > direction
echo 1 > value
accessing hardware, the right way.
With default settings the files in /sys/class/gpio are owned by user root and group root. Only the root user will have read/write permissions. We can change this with a udev rule. We create a file in /etc/udev/rules.d that contains the line:
KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/usr/local/bin/hipi-expin gpio /sys%p"
~
=> Create a PHP LED blinker & allow Apache2 to run it
But WARN! Permissions make sens
$ sudo visudo
www-data ALL=NOPASSWD:/path/to/the/blinker
~
https://github.com/ronanguilloux/php-gpio
https://github.com/ronanguilloux/php-gpio-web
Questions ?
This presentation is available on
ronanguilloux.github.com/Raspi-ForumPHP-2013
Attendies, thanks for feedback on joind.in!


Namespace ZptSharp.Rendering
Classes
EffectiveConfigSettingZptDocumentRendererDecorator
An entry-point service for ZPT-Sharp. This service renders a model to a document stream and returns the result as a stream.
ExpressionContextFactory
Factory for the creation of expression contexts.
ExpressionContextIterativeProcessor
An implementation of IIterativelyProcessesExpressionContexts which receives its IProcessesExpressionContext from the constructor. See also: IGetsIterativeExpressionContextProcessor for a factory which may be used to create instances of this type.
ExpressionContextProcessingResult
Describes the result/outcome of an invocation of IProcessesExpressionContext.
FileSourceInfo
Implementation of IDocumentSourceInfo for a document which was retrieved from a file on disk.
IterativeDocumentModifier
A service which which makes use of an IIterativelyProcessesExpressionContexts in order to apply a IProcessesExpressionContext to every node exposed by a document.
IterativeExpressionContextProcessorFactory
A factory implementation which creates IIterativelyProcessesExpressionContexts using a specified implementation of IProcessesExpressionContext.
MetalDocumentModifierDecorator
Decorator for the interface IModifiesDocument which handles concerns relating to METAL.
NodeSourceInfo
An object which encapsulates information about the source of a single DOM node.
NoOpDocumentModifier
A no-op implementation of IModifiesDocument makes no change to the document.
OtherSourceInfo
Implementation of IDocumentSourceInfo for a document which was retrieved from a location that may be identified, but is not a file on disk.
RemoveZptAttributesModifierDecorator
Implementation of IModifiesDocument which coordinates the removal of ZPT-related nodes and attributes from a document. This is essentially a clean-up process which strips processing directives from a document.
SourceAnnotationDocumentModifierDecorator
Implementation of IModifiesDocument which adds source annotation to the document DOM where appropriate. Source annotation is a debugging and logging aid which helps developers see where each part of the output DOM originates.
TalDocumentModifierDecorator
Implementation of IModifiesDocument which handles TAL model-binding directives.
UnknownSourceInfo
Implementation of IDocumentSourceInfo for a document which has an unidentifiable source.
ZptCleanupContextProcessor
An implementation of IProcessesExpressionContext which 'cleans up' ZPT markup from the rendered document. This context processor would typically be executed last, in order to strip out all ZPT-related directives from a document which has already been processed.
ZptCleanupContextProcessorFactory
Implementation of IGetsZptNodeAndAttributeRemovalContextProcessor which returns a context processor suitable for performing cleanup on a rendered document.
ZptDocumentModifierFactory
An implementation of IGetsDocumentModifier which assembles an instance of IModifiesDocument using the decorator pattern. Each implementation of the service wraps another, augmenting its functionality.
ZptDocumentRenderer
A service which coordinates the process of rendering a ZPT document.
ZptDocumentRendererFactory
A factory which creates instances of EffectiveConfigSettingZptDocumentRendererDecorator from a RenderingConfig and optionally a System.Type which indicates the IReadsAndWritesDocument to be used.
ZptDocumentRendererForFilePathFactory
Implementation of IGetsZptDocumentRendererForFilePath which uses a file path to get a suitable implementation of IRendersZptDocument.
ZptRequestLoggingScope
A type to represent the logging scope for a single ZPT rendering request.
Interfaces
IDocumentSourceInfo
Describes the source of an IDocument, usable for debugging, diagnostic or informational purposes.
IGetsChildExpressionContexts
A service which gets a collection of child expression contexts from a specified context.
IGetsDocumentModifier
An object which can get an instance of IModifiesDocument, suitable for use with a specified rendering request.
IGetsIterativeExpressionContextProcessor
A factory service for creating instances of IIterativelyProcessesExpressionContexts which use a custom expression context processor.
IGetsRootExpressionContext
A service which creates the root ExpressionContext for a document and rendering request.
IGetsZptDocumentRenderer
An object which may get an instance of IRendersZptDocument for a specified implementation of IReadsAndWritesDocument.
IGetsZptDocumentRendererForFilePath
An object which may get an instance of IRendersZptDocument for a specified file path.
IGetsZptNodeAndAttributeRemovalContextProcessor
An object which gets an implementation of IProcessesExpressionContext which will remove ZPT nodes and attributes from a DOM context.
IHandlesProcessingError
A specialisation of IProcessesExpressionContext which is able to handle errors during the rendering process.
IHasContainer
An object which has a parent/container object.
IIterativelyModifiesDocument
An object which uses an expression-context iterator to iteratively make alterations to the document, on a context-by-context basis.
IIterativelyProcessesExpressionContexts
A service which iterates over expression contexts, beginning with a single context and executing a process over every one of its children. See also: IGetsIterativeExpressionContextProcessor for a factory which may be used to create instances of this type.
IModifiesDocument
A service which coordinates and performs the modifications to a document before it is ready to be output.
IProcessesExpressionContext
A service which processes a single expression context and applies some processing rules.
Enums
TagType
Enumerates the types of DOM node tags.


Are you an incoming freshman who wants to find out more about the school? Or do you simply want to make some friends and have fun?
NUS Computing Freshmen Orientation Projects (FOP) 2017 presents to you: Tempus Nova. With an exciting lineup of events, we will help integrate into our Computing family in no time. At FOP, not only do you get the opportunity to meet other incoming freshmen, you will also meet seniors who can provide valuable advice to follow you through your University years. Join us this summer for the best freshmen experience you’ll ever have!
Socialize
11 to 14 June
Socialise in the summer holidays! Meet new friends from SoC before University starts!
Orientate
3 to 6 August
Orientate yourself! Get more familiar with the school environment and find out more about school life!
Bond
May to August
Bond together as one SoC family! Construct magnificent floats and dance together to show our SoC spirit!
Volunteer
8 August
Volunteer together as one SoC family! Raise funds and nurture our SoC spirit of love and kindness!
Celebrate
18 August
Celebrate the end of Orientation with a blast! Join us to crown the next Mr and Ms SoC!
Background pattern Symphony from subtlepatterns.com used under CC BY-SA 3.0


My Travel Map
Explore the world
Home
Create My Map
Write my diary
Login
Personal Page
Hello, ${username}
<#if interest??>
You haven't marked any location yet!
<#else >
<#list interests as interest>
${interest}
#list>
#if>


AGENDA
=======
Colleagues,
In tomorrow's telecon I'd like to go through the list of illustrations of the
basic functionalities of EPICS V4, and assign people responsible for delivering
demos of that functionality.
There are 18 such illustrations listed below. Each have a name attached.
Now, basically all the line items have pre-requisities, that's the point of the exercise. It
forces us to be clear about the non-functional requirements necessary to achieve the
functional requirements. For instance, #10 requires NTMatrix be defined, which means an
NT self-id solution must be implemented, and a way for eget to talk to a service must be implemented.
Therefore, for each of these, we must be clear on the prerequisites and who is responsible for them (yes,
I know I'm attached to many of them). However, part of the intention of assigning responsibility
for the line item deliverable, is to ensure that the named individual demos the functionality
whether they received the prerequisite or not. I think there is only one prerequisite which, if absent,
truly renders solution impossible; that's the way eget should interface to services
that take arguments.
So, tomorrow, let's first go through the list below to assign responsible party. Then spend
some time on the basic service interface.
* *Ralph*, *David*, how do you define your services to take arguments. Did you use the same method
as hellowService and rdbService?
* Should a javaIOC be necessary? if not, how would be arguments be formally documented (since there
would be no database xml file?
* I would like an interface in which one can ask the service what are its arguments. How would that be
achieved?
Timeline. All of these shall be demoed at the October meeting, 17-19 Oct.
** But, I would like to be able to conduct ALL the demoes myself. That ensures that they
are all mature enough, and encapsulated enough, that examples can be distributed and documented
sufficiently for a new user. So, I'd like to take delivery of these by *1-Oct*.
MINUTES
=======
Present: BD, DH, TK, MR, JR, MS, GS, GW
Scribe: JR
*********
TOPIC: Put names on each deliverable demo per list below
*********
GW: Focus on first item, demos to be delivered for the October meeting.
GW: Any person should be able to download and run the examples after reading the documentation. Better than developers demonstrating their applications.
MS: can do items 1 and 2
GW: This is ambiguous, would like to demonstrate both cav3 as a provider, and cav3 via V3Channel.
MS: Use channel access native libraries from client?
GW: Ways are channel access on the wire, and V3Channel on the V3IOC with pvAccess on the wire. Don't have good names for these methods.
MK: V3Channel is in pvIOCCpp, returns V3 record values over pvAccess.
MK: cav3 is in pvAccessJava and allows you to talk channel access using the pvAccess API. Not available in CPP. Client must specifiy which transport.
GW: V3Channel is pvAccess on the wire (c++ server only), cav3 is channel access on the wire (Java client only). Both use the pvAccess client API.
GW: Hard part of 2 is a is a way of specifying the provider on the command limand line.
MS: Problem is no implementation of cav3 in cpp, eget is in cpp.
GW: MS can demonstrate V3Channel by October, not the use of cav3 in eget?
MS: Yes
GW: OK
MK: Week's work to do that.
GW: Important AI.  Demo cav3 when it's ready.
AI MS: November, start cav3 implementation in C++.
GW: Item 3 (unsigned)
MK: Java client can talk to pvIOCCPP over pvAccess and get an unsigned field or record. It will work. But the Java client can't use the data.
GW: Can use C++ both ends. Point is to demonstrate pvAccess transporting unsigned.
MK: What are you going to do with it?
MS: C++ client and V3Channel server.
MK: This will work with C++ both ends. Item 3 will work.
GW: MK able to implement?
MK: Need records to demonstrate this. Records that make sense.
GW: Just need large number.
MK: Need a record with a large 32 bit unsigned value. Can do that with MS.
MS: Yes we can do that
GW: Item 4 trivial
GW: Item 5 trivial
MS: Want one value per line?
GW: Yes, like RDB service. Default one value per line. Optional for row-wise is good. Can pipe into UNIX tools.
GW: Item 6, will eput exist?
MS: pvput exists, can do scalars and arrays.
GW: Need a server that has a scalar and and array to put to.
MK: For 7 and 8, when I setup a V3 IOC with V3Channel have another waveform record for item 8. Use the same test IOC IOC.
GW: Yes would like a V3 and V4 IOC for tests/demos. Shall we use a test one for demo purposes?
MS: Yes.
MK: Yes, one Java IOC and one V3 IOC with V3Channel. I will do this with MS.
AI on MK and MS: Produce test/demo IOCs in C++ and Java to go with client items.
GW: Item 9
MS: eget with switch performs monitors.
GW: Item 10 get as a NTMatrix. Does eget know NTMatrix?
MS: It knows NTTable, not NTMatrix yet. I will add NTMatrix to eget.
GW: Pass arguments, make new item 10.1
MS: Arguments are passed as a string. What is the service API?
GW: WIll define API. Have Java library for arg parsing.
MS: eget in C++
GW: Argument passing for RDB service use support offered by bash for argument passing. Java library does the same thing.
GW: Item 11 get NTTable and print as a table and print as a table.
DH: Archiver result is NTTable. Request is a structure containing start and end time, channel name. Request is not an NTTable
GW: Ok, requests won't be NTTables anyway.
DH: Current repo built against release 1.1. Currently refactoring. Fieldname change is ok, some libraries have moved around, more work required. No problem for October.
GW: Demonstration?
JR: You can distribute archive data with the example, no need to connect to a remote server.
DH: Works out of the box once it's been refactored, already includes sample data.
GW: Gather. Timo? Example by 1st October.
TK: Time is tight.
GW: Get synchronous orbit data?
TK: Same time pressure.
GW: Item 17.
MK: Clarification required? Is this an local gather on a V3 IOC.
GW: Yes.
MK: Work needs to be done. V3Channel connects to a single record at one one time.
MK: Start with homogenous gather for October. Get an array of scalars where each element comes from a different V3 record.
GW: How to configure it so that the V4 PV knows which records to gather. Requirement is to get multiple fields.
MK: Fields and record terminology is mixed. Can get EGU, timestamp, alarm p, alarm etc. from single V3 value already over channel access.
GW: So user can get all channel access standard fields back alreadyy. But only what version 3 supports.
MK: Value of V4 gather record will be an array of scalars.
GW: Why is homogeneous support harder? Can introspect and create structures on the fly.
MK: Could do something like the example.
GW: If I want to get a quadrupole, what would I see? I want a single V4 PV giving me back the B field, polynomial and energy. Create support with V3Channel to get a list of version 3 PVs as a PVData structure.
MK: What are the records that represent a quadrupole? There are a collection of V3 records that give you the various parameters.
JR: Something like this?
record(ai, "CURRESETPOINT")
record(waveform, "POLYNOMIAL")
record(ai, "FIELDSETPOINTNT")
MK: Committed to come up with a V3 IOC and a V4 IOC for the demo. Will attempt to to come up with some records for an example.
MK: Is all this stuff going in example application.
GW: Not single application, no. I'd like to be able tole to talk to example IOC with eget on comommand line.
MK: Where are we going to put them.
GW: New place on sourceforge.
MK: exampleCPP/Java?
GW: All ok with that?
Resolution: Put demos in examexampleJava and exampleCPP.
GW: Put good readmes in these.
GW: last Item. EasyPVA. I will take responsibility for that. Haven't tried for RPC yet. Once have ththat can test everything.
GW: Is there a way for a user to ask a service what it's arguments are.
MS: User can get information using introspection with get field. Needs text too.
GW: Formal definition can be in description field. I'll try and work on that.
Thanks to James and David.
Meeting ends.
FUNCTIONAL REQUIREMENTS OF EPICS V4 ILLUSTRATIONS
=================================================
Basic Get and Put
=================
*MS*
1. Get the value of an V3 PV [user has no knowledge that it's V3 as opposed to V4]
eget QUAD:34:IDES
23.424
*MS*
2. Get the values of all the V3 CA standard fields (-r is pvAccess request string)
eget QUAD:34:IDES -r 'field()'
structure QUAD:34:IDES
{
value = 23.424
alarm = structure
{
severity = structure
{
index = 0
choices = [none,minor,major,invalid]
}
message = null
ackTransient = false
ackSeverity = structure
{
index = 0
choices = [none,minor,major,invalid]
}
}
timeStamp = structure
{
secondsPastEpoch =<PHONE_NUMBER>
nanoSeconds = 478000000
}
}
*MK*
3. Get the value of an UNSIGNED V3 PV
[Can't think of a sensible large number, but can think of many that would only be +ve]
eget BEAM:RATE
60
*MS*
4. Get the value of a V4 scalar pv
eget XCOR:LI:34:IACT
23.3
*MS*
5. Get the value of a V4 array pv to the command line
eget QAUD:LI:18:POLYOMIALS
34.6
19.5
29.3
*MS*
6. Put the value of a V4 scalar pv
eput -v 34.4 XCOR:LI:34:IDES
*MS*
7. Put the value of a V4 array PV
eput -v 34.4 19.6 29.3 XCOR:LI:34:IDES
*MS*
8. Put the value of a V3 waveform [(!!!) is this possible?]
eput -v 34.4 19.6 29.3 QUAD:34:POLY
*MS*
9. Monitor the value of a simple type V4 PV
emon BPMS:LI34:X
[MS: says we have pvget with a special switch for monitor]
*GW*&MS
10. Get a NTMarix and print as a matrix
$ eget -a TYPE=DESIGN -a POS=MID -a RUN=LATEST QUAD:LI21:271/R
0.23 0.1234 0.0 0.0 0.067562 0.001167
-0.34520 0.0923 0.0 0.0 0.046981 0.001514
0.0 0.0 1.881007 4.857304 0.0 0.0
0.0 0.0 -1.50064 -3.862346 0.0 0.0
-0.00132 -0.001129 0.0 0.0 0.224701 0.003894
0.162595 0.10285 0.0 0.0 -19.603 -0.233109
10.1 Get values according to arguments in a consistent way from any RPC service
See examples eget -a above.
*DH*
11. Get a NTTable and print as a table. Illustrate with archive service.
$ eget -a start="3 minutes ago" -a end="now" -a p=12 QUAD34_Bfield
TimePastEpoch(s) Value Date Alarm
496169397.856321000 7.355487346649e-02 Wed Jun 21 17:49:57 2012 NO ALARM
496169401.996447000 1.682446300983e-01 Wed Jun 21 17:50:01 2012 NO ALARM
496169410.052636000 2.558367252350e-01 Wed Jun 21 17:50:10 2012 NO ALARM
496169420.109690000 3.173123300076e-01 Wed Jun 21 17:50:20 2012 NO ALARM
...
Use Cases of Directory Service
==============================
*RL*
12. Get the names of a number of PVs (v3 or v4 potentially heterogeneous mix) where their names match a string, using the Directory Service. Ideally, sort by a tag or option. E.g.:
eget -s DirectoryService -a pattern 'XCOR:*:BDES' -a options "sortbyz"
XCOR:1:BDES
XCOR:20:BDES
XCOR:44:BDES
XCOR:68:BDES
XCOR:89:BDES
...
Extra credit: ideally not just * but regular expression.
*RL*
13. As above but additionally get the values. In the case illustrated below done with a pipe, but better if integrated into eget.
Eg. Print the value of BDES from all correctors whose PV name matches the pattern XCOR:LI:*:BDES
eget -s DirectoryService -a pattern=XCOR:*:BDES -a options="sortbyz" -a beampath=0 | xargs eget -t {}
XCOR:1:BDES
23.5
XCOR:20:BDES
34.5
XCOR:44:BDES
15.5
XCOR:68:BDES
13.7
XCOR:89:BDES
34.5
...
*RL*
14. Get the value of a number of PVs, where the names match the conjunction (AND) of Directory Service tags
E.g.: Print the value of the desired B field (BDES) from all correctors in the (SwissFEL) section SINBC01
eget -s DirectoryService -a property='section=SINBC01' -a property='type=COR' tag='BDES' -options="sortbyz" | eget -t
sinbc01.cor01:B 23.34345
sinbc01.cor02:B 43.47543
Use Cases of Gather Service
===========================
*TK*
15. Use of an ad hoc Gather to get the field value (V3 PVs) of many magnets or BPMs.
Show use of gather service to simply give LATEST gathered values from a Gather record defined by the client:
So this is something probably done in Matlab
[TODO insert example]
*TK*
16. Get synchronous BPM orbit data from a BPM service, that is using the gather service in combination with a SLAC/PSI
like BPM synchronous data system. Data form is NTTable.
eget -a Npulses=3 SwissFELTI:sync:bpmorbit
pulse_Id bpm_name X Y TMIT Status
31330 sinlh01.diag01.bpm 0.331939 -0.20821595 9.2273582E9 OK
31690 sinlh01.diag01.bpm 0.343939 -0.21321534 9.3973582E9 OK
32056 sinlh01.diag01.bpm 0.343939 -0.21321534 9.3973582E9 OK
31330 sinlh02.diag01.bpm 0.430091 -0.19211863 9.4554767E9 OK
31690 sinlh02.diag01.bpm 0.429820 -0.18054654 9.3577114E9 OK
32056 sinlh02.diag01.bpm 0.476549 -0.23452345 9.3245235E9 OK
... snipped many more
Total number of rows printed would be M bpms in the gather record named SwissFELTI:sync:bpmorbit, times
N pulses
*MK*
17. Get the values of a number of V3 PV (fields) from one V3 IOC, through a V4 record on V3 IOC PVA
[ie, "The Dirk Requirement" ].
Ideally a heterogenous structure of V3 scalar and waveforms.
E.g. Get a summary of the PVs relating to a QUAD from an IOC. In this example the V4 PV
is QUAD35:SUMMARY, to illustrate that one might use the "physics" name (QUAD35) for such summary
PVs, and their values might be composed of a structure of V3 PVs named with engineering names and their values:
eget QUAD35:SUMMARY
QUAD:SECT02:13:B 42.3
QUAD:SECT02:13:POLY 23234.2342 5435.34 753.3 4.34234 5.32E-23
QUAD:SECT02:13:E 4.454
EasyPVA, Model Service and Directory Service from Matlab.
=========================================================
Overall *GW*, from input from RL and TK.
18. Example of orbit correction from Matlab, done using easyPVA
Illustrates requirements for:
1. EasyPVA understanding request for PVStructure
2. EasyPVA understanding arguments as part of request for data
3. EasyPVA understanding that an argument TO a service may be an array
(in the example a table of magnet names and B field values)
Also assumes the Directory Service requirement articulated above to get Corrector and BPM names
-------------------------------
% SwissFEL orbit correction in 1/2 page of matlab
% The following is syntactically valid Matlab, but need to see from Ralph how it is actually done.
%
import org.epics.ca.easyPVA.*;
easyPVA = EasyPVAFactory.get();
% *RALPH*
% Get the names of all the Correctors and BPMs from the Directory Service
corrNamesChan = easyPVA.createChannel('DS:SwissFEL:GUN_to_ARAMIS');
corrNamesChan.addArgument('DEVICETYPETAG','XCOR');
corrNames = corrNamesChan.createGet().getStringArray();
bpmNamesChan = easyPVA.createChannel('DS:SwissFEL:GUN_to_ARAMIS');
bpmNamesChan.addArgument('DEVICETYPETAG','BPMS');
bpmNames = bpmNamesChan.createGet().getStringArray();
Ncor = length(corrNames);
Mbpm = length(bpmNames);
% *Timo*
% Get BPM x orbit from the BPM service.
b = easyPVA.createChannel(...
'BPMORBIT:SwissFEL:GUN_to_ARAMIS').createGet().getDoubleArray();
% *Greg*
% Form the Ax-b problem getting Rmats from the Model Service
modelmatrixChan = easyPVA.createChannel('model:aramis:gold:extant:R');
for bpmi = 1:Mbpm;
modelmatrixChan.addArgument('to',bpmNames(bpmi));
for corj = 1:Ncor;
modelmatrixChan.addArgument('from',corrNames(corj));
rmatAtoB_pvStruct = modelmatrixChan.createGet().getPVStructure();
RmatCorToBpm = toMatrix(rmatAtoB_pvStruct);
A(bpmi, corj) = RmatCorToBpm(1,2);
end
end
% 2 lines of actual physics
x = inv(A)*b; % Solve Ax-b
newBDESes = -KtoB(x); % new B field values from K to B
% *RALPH*
% Deploy the new magnet settings.
magSetChan = easyPVA.createChannel('MAGNETSET');
magSetChan.addArgument('magnetlist',corrNames);
magSetChan.createPut().putDoubleArray(newBDESes,length(newBDESes));
-----------------------------
* EasyPVA to "put" a PVStructure to a service or PV
add example.


Udbhav
This function is organized on 30th of October every year as institute was founded in Degree on 30th of October-2001, since then this day is recognized as foundation day.
The function comprises of Chief Guest Speech, vast range of musical and cultural events with college annual progress report in academics and curricular activities and prize distribution ceremony in the field of academics, sports and other
successful students are rewarded for their contribution to the institute.
{% endblock %}


Basic
Free
Free of charge one standard listing active for 30 days
- One Listing
- 30 Days Availability
- Standard Listing
- Limited Support
Get Started
Featured
Extended
$9.99
One time fee for one listing, highlighted in the search results
- One Time Fee
- One Listing
- 90 Days Availability
- Featured In Search Results
- 24/7 Support
Get Started
Professional
$19.99
Monthly subscription for unlimited listings and availability
- Unlimited Listings
- Unlimited Availability
- Featured In Search Results
- 24/7 Support
Get Started