Labour manifesto at a glance
The party has revealed its vision for government.
Labour leader Jeremy Corbyn has laid out his vision for government during a half-hour speech in Birmingham.
With its wavy font, the manifesto, titled It’s time For Real Change, depicts what Mr Corbyn called the “most radical and ambitious plan to transform our country in decades”.
The 105-page document contains a host of already-announced policy proposals, along with a smattering of debut measures.
Here is an at-a-glance look at the manifesto.
– Brexit
Mr Corbyn wants to re-negotiate a new withdrawal agreement with the European Union by March and put his deal to a public vote within six months of the election.
The referendum would be “legally binding” and implemented “immediately”.
The hefty list of proposals does not commit to keeping free movement, even if the public voted to Remain, simply acknowledging the benefits of immigration.
– Public sector
The remit of the State would be massively extended under Labour, with intentions to bring back rail, mail, water and energy into public ownership and delivering full-fibre broadband, via a publicly owned company, free to everyone in the country.
Public sector workers would also see an immediate 5% boost in pay, with year-on-year above-inflation pay rises to follow.
– Employment
A commitment has been made to introduce a “real living wage” of at least £10-an-hour while ending zero hours contracts and strengthening trade union rights.
– Education
Under a Labour administration, Ofsted and SATS tests at Key Stage 1 and 2 would be scrapped, while power over the running of schools would be returned to councils and head teachers, rather than academy bosses.
Labour has promised to re-invest in technical training.
For early years, the party has pledged to provide 30 hours of free childcare to all pre-school aged youngsters and has guaranteed a Sure Start centre in every community.
In higher education, the 2017 vow to get rid of university tuition fees is back and maintenance grants would be returned but there was no mention of clearing graduate debt.
– Environment
The leadership has set out proposals for a so-called “green industrial revolution” that is designed to create one million jobs in the UK, with the aim of shifting industry, home gas and electricity, transport, agriculture and construction onto renewable energy modes.
The manifesto stops short, however, of signing up to the motion passed at the party conference of establishing a net-zero carbon economy by 2030.
Instead, it states a Labour government would “aim to achieve the substantial majority of our emissions reductions” by that target date.
– Welfare
Universal Credit, the two-child limit for benefits and the welfare cap would all be for the cutting floor, if Labour wins power next month.
For women impacted by the change in pension age to 66, Labour has promised to review the retirement age “for physically arduous and stressful occupations”, with a focus on shift workers.
– Crime
Labour has committed to recruiting 22,000 more police officers – 2,000 more than Boris Johnson.
There would also be a royal commission established to look at de-criminalising drugs.
– Health
The NHS would see a 4.3% increase in its expenditure every year, with privatisation reversed.
Free annual dental care check-ups would be re-introduced, mental health services would receive £1.6 billion extra a year and free personal care for elderly people would be on offer.
– Housing
A spree of house building, the largest since the 1960s, features in the final version of the manifesto, with a £75 billion plan to construct 150,000 homes a year, with 100,000 of them built by councils.
Non-homeowners would see rental caps and open-ended tenancies, under a Corbyn-led administration.
A £1 billion fire safety fund would be introduced to fit sprinklers and other safety measures in council and housing association tower blocks to avoid a repeat of the Grenfell Tower tragedy.


Create a new pad by clicking on the button above.
Copy the URL from the URL bar. Anybody you give this link to will have access to the pad. There are no limits on the number of people who can access a pad.
When you write on the pad, the other users will immediately see what you have written. You can also send the URL to someone for viewing later.


Club Suspends Goalkeeper For Having Sex In Toilet
by Oladipo AbiolaMatteo Voltolini, an Italian goalkeeper who currently plays for Reggio Audace has been reportedly suspended by his club.
Naija News understands the 23-year-old footballer was suspended by his club after he was caught having sex in a nightclub toilet.
The incident was said to have happened after his club’s 2-1 win over Vis Pesaro on Sunday, Nov.17 in which he played no part.
Corriere Dello Sport reports Voltolini met a young woman at the club, who he started flirting with before they ended up in the toilet, where they had sex.
However, unknown to them, a fellow clubber secretly filmed the escapade and posted the video on social media with the 15-second clip going viral.
“We announce the preventive suspension from sporting activities of our player Matteo Voltolini for one week.
“This is while we wait to learn in full about the post-match events on Sunday November 17,” Reggio Audace said in a statement.
The goalkeeper, Voltolini is already considering legal action for breach of privacy according to further reports by The Sun.


Menu
NoSCADA logo
Statics
3D bodies
Tubes
Tanks
Panels
Scales
Borders
SVG graphics
SVG animation
Groups
Dynamics
LEDs
Pumps
Ventils
Fans
Powers
Arrows
Labels
Displays
Switches
Gauges
Meters
Levels
SVG graphics
Groups
Controls
Buttons
SVG library
Towers
Tanks
Tanks B
Tanks BC
Help
Tech processes
Waste plant
Waste plant 3
WP + Chart
Water tower


After taking a look at each of these technologies, the question is, which one should be used? The answer is that it depends on several different points. Essentially, each business and application will have different needs, requirements, and purpose. The choice of virtualization versus containerization depends on the business development and operational model, and the way applications are written and produced. Both are software technologies that create self-contained virtual packages, but to choose the one that will best suit the user’s needs, we will look at the following points.
Speed: When it comes to speed, containers were meant to significantly reduce the time needed to deploy and run an application. The container starts immediately, since the operating system is already up and running, so the application will start up without any noticeable delay. On the other hand, virtual machines need to start the entire operating system, which includes the full boot process. This will also include the startup of the services, and it will take much longer than it would for a container.
Operating system requirements: A virtual machine is best used in the case when a business needs to run multiple applications that require the full functionality of a dedicated operating system. However, if most of the applications have the same operating system requirements, the containers would be a much more practical solution.
Resources: Since virtual servers run separate operating systems, and every system call has to go through the virtualization layer, a certain amount of overhead is created, causing more resources to be used. However, CPU virtualization is relatively cheap, so the CPU overhead of a virtual machine can be much smaller. When it comes to containers, they can start up pretty quickly, so their memory consumption doesn’t increase.
Portability and application sharing: Since container images are much smaller than virtual machines, they are easier to transfer and save space on the host’s filesystem. Virtual machines, on the other hand, need to have a copy of the whole operating system, including the kernel, system libraries, configuration files, all the directories required by the operating system and all the utilities.
However, it is also important to note that there are also ways of combining virtualization and containerization so that both technologies’ advantages are brought together.


Tag of component for insert search field in template:
<ngx-silly-datatable-search></ngx-silly-datatable-search>
For use search component together with datatable component need to define reference. This reference will be used for specify in datatable component:


LibTerm
LibTerm is a terminal for iOS.
This app is like @louisdh - OpenTerm but this terminal is embeddable in your own app and it supports Lua and Python 2.7.
Motivation
I like a lot OpenTerm but I wanted to make the code better. Also, I wanted to integrate a local shell into Pisth so I made the project embeddable. I will upload to app to the App Store soon since OpenTerm is no more available. This is not a fork from OpenTerm, I rewrote the code.
Building
- Clone all submodules
- Download
release.tar.gz
from ios_system latest release. - Unarchive the file.
- Move ios_system to the
ios_system
.
Embedding
LibTerm is embeddable so you can use it in your own app. To do it, download releases and embed all frameworks in your app. Then, you can present a LTTerminalViewController
. You can also compile the LibTermCore
framework and embed it in your app. You will need to embed InputAssistant
and ios_system
also. You also have to include commandDictionary.plist and extraCommandsDictionary.plist to your app’s bundle.
Usage
Instantiating the terminal
LTTerminalViewController.makeTerminal(preferences: <#LTTerminalViewController.Preferences#>, shell: <#LibShell#>)
Accessing the Text view
LTTerminalViewController.terminalTextView
Extending
You can add a command by subclassing LibShell
:
func python3_main(argc: Int, argv: [String], io: LTIO) -> Int32 {
// Code here...
return 0
}
class Shell: LibShell {
var commands: [String : LTCommand] {
return super.commands+["python3", python3_main]
}
}
let terminal = LTTerminalViewController(shell: Shell())
You can also add it to the suggestion bar:
LTHelp.append(LTCommandHelp(name: "python3", commandInput: .file))
Acknowledgments
- InputAssistant
- ios_system
- OpenTerm (This is not a fork of OpenTerm but I used some code like the ANSI parser and I learned from it.)
- TabView


Professional Career
I have been working for almost 10 years in the Information Technology industry, fulfilling numerous roles on projects with a worldwide scope.
During this period I worked in several roles and
positions, always related to software development.
Roles and Responsabilities
► Project Manager
► Team Leader
► Backend & Frontend Developer
► QA & Automation Tester
► Systems Analyst & Software Architect
► Recruiting & perform Technical Interviews
► Certififed Scrum Master and Scrum Coach
Methodologies
Waterfall development in the early beginnings but when
the opportunity presented itself to change I moved and focused my efforts on web applications specialization
using company-wide Agile Methodologies adoption as
main tools, writing software applying several
scripting languages, such as PHP, Perl, Python or Ruby.


Captain Bathis:
Did Guard Babenco send you?
Hmm... You don't have very good armor, do you? Oh well, I do have to commend you for your bravery!
This is a critical and potentially very dangerous mission! You must listen carefully!
"I'm listening."


{% include anchor.html edit="true" title="Extras" hash="extras" %}
{% include alert/start.html variant="warning"%}
{% markdown %}
**Deprecation note:** the `extras/` API is deprecated and will be removed in
a future version of PouchDB. You are encourage to use [custom builds](custom.html) instead.
{% endmarkdown %}
{% include alert/end.html%}
PouchDB offers some "extra" APIs that are designed for PouchDB plugin authors, or for those who want to use non-standard adapters like in-memory and LocalStorage.
These can be especially useful when you are using [Browserify](http://browserify.org/)/[Webpack](https://github.com/webpack/webpack), because they can reduce your overall code size by deduplicating packages. If you're not using Browserify/Webpack, you can also download them [as standalone scripts](/adapters.html#pouchdb_in_the_browser).
### Browser adapter plugins
These adapters are alternatives to PouchDB's built-in IndexedDB/WebSQL adapters. They fully pass the PouchDB test suite.
#### In-memory adapter
{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/memory');
var db = new PouchDB('mydb', {adapter: 'memory'});
{% endhighlight %}
Fully in-memory PouchDB adapter. Data will not be saved after a browser refresh!
This adapter can be useful for unit tests or for environments that don't support IndexedDB/WebSQL. Based on [MemDOWN](https://github.com/Level/memdown).
You can also download this plugin [as a standalone script](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.memory.js).
{% include alert/start.html variant="warning"%}
{% markdown %}
If you want to use an in-memory PouchDB in Node.js/io.js, you should [directly require MemDOWN instead](/adapters.html#pouchdb_in_node_js).
{% endmarkdown %}
{% include alert/end.html%}
#### LocalStorage adapter
{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/localstorage');
var db = new PouchDB('mydb', {adapter: 'localstorage'});
{% endhighlight %}
PouchDB adapter using [LocalStorage](http://www.w3.org/TR/webstorage/). Intended for browsers and environments that don't support IndexedDB or WebSQL. Based on [localstorage-down](https://github.com/No9/localstorage-down).
You can also download this plugin [as a standalone script](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.localstorage.js).
{% include alert/start.html variant="info"%}
{% markdown %}
When you include these plugins in your project, they will be automatically picked up as a "third" option when you create a new PouchDB without an adapter specified (e.g. `new PouchDB('mydb')`).
So for instance, if the user loads PouchDB in a browser that does not support WebSQL or IndexedDB, and if you are using the in-memory plugin, then PouchDB will automatically use the memory adapter instead of WebSQL or IndexedDB.
{% endmarkdown %}
{% include alert/end.html%}
#### FruitDOWN adapter
{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/fruitdown');
var db = new PouchDB('mydb', {adapter: 'fruitdown'});
{% endhighlight %}
PouchDB adapter using [FruitDOWN](https://github.com/nolanlawson/fruitdown).
This is an alternative to the default IndexedDB adapter that ships with PouchDB, which works over all implementations of IndexedDB, including Apple's version.
It is slower and more inefficient than PouchDB's default IndexedDB adapter, but it's handy if you need to use IndexedDB in Safari, iOS, WKWebView, etc.
You can also download this plugin [as a standalone script](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.fruitdown.js).
#### node-websql adapter
{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/websql');
var db = new PouchDB('mydatabase.db', {adapter: 'websql'});
{% endhighlight %}
PouchDB adapter using WebSQL in Node, via [node-websql](https://github.com/nolanlawson/node-websql).
This allows you to use the efficient WebSQL-based PouchDB directly over SQLite.
Unlike the LocalStorage/memory/FruitDOWN adapters, this adapter is designed only
to run in Node.js. In the browser, PouchDB already comes with WebSQL support.
### APIs for plugin authors
These APIs are designed for PouchDB plugin authors, who may want to re-use some PouchDB code to avoid duplication.
To use these APIs, you should save PouchDB as a required npm dependency (`npm install --save pouchdb`) and then require them like so:
#### Ajax
{% highlight js %}
var ajax = require('pouchdb/extras/ajax');
{% endhighlight %}
The `ajax()` function as used by PouchDB. Essentially a shim in the style of `jQuery.ajax`.
#### Checkpointer
{% highlight js %}
var Checkpointer = require('pouchdb/extras/checkpointer');
{% endhighlight %}
The `Checkpointer` function as used by PouchDB's replicator. Writes checkpoints as `_local` docs so that replication can resume where it last left off.
#### Promise
{% highlight js %}
var Promise = require('pouchdb/extras/promise');
{% endhighlight %}
The ES6 `Promise` shim as used by PouchDB. Expect this to be `lie` where a global `Promise` does not exist, the global `Promise` is used when supported.
#### Caveats
These APIs are not rigorously documented and may change frequently. Refer to the [Ajax](https://github.com/pouchdb/pouchdb/tree/master/packages/pouchdb-ajax), [Checkpointer](https://github.com/pouchdb/pouchdb/tree/master/packages/pouchdb-checkpointer) & [Promise](https://github.com/pouchdb/pouchdb/tree/master/packages/pouchdb-promise) source code for the details of the APIs.
If your plugin depends on a particular version of PouchDB, please notify your users. Unless you like to live dangerously, you should also nail down the version of PouchDB you are using in your `package.json`. And if you need any other internal modules, please submit a pull request!


Auckland bus disruption: What you need to know
by RNZThousands of bus commuters in Auckland have their ride to work and school disrupted this morning as the stalemate between bus drivers and their employer continues.
NZ Bus services are off the road, and Auckland Transport says Ritchies will operate limited morning and evening rush hour bus services along Dominion and Mt Eden roads.
The cancelled routes include NZ Bus school buses and Link routes.
Services run by other operators are not affected, and train and ferry services will run as normal.
NZ Bus drivers seeking better pay and conditions refused to collect fares last week, and now those drivers have been suspended.
Cancelled bus routes
Auckland Transport says the cancelled bus routes are:
CityLink, InnerLink, OuterLink, TāmakiLink, 14T, 14W, 18, 20, 22A, 22N, 22R, 24B, 24R, 24W, 25B, 25L, 27T, 27W, 27H, 30, 68, 75, 82, 101, 105, 106, 110, 122, 125, 125X, 128, 129, 162, 252, 253, 221X, 223X, 243X, 248X, 295, 321, 650, 670, 751, 755, 762, 774, 775, 781, 801, 802, 806, 807, 814, 842, 843, 871, 923, and 924.
Buses operated by Ritchies on Dominion and Mt Eden roads:
Dominion Road, Route 25
From Mt Roskill Shops:
First bus 6.30am approximately every 15 minutes until 10.00am.
From 10.00am approximately every 30 minutes until 4.00pm
From 4.00pm approximately every 15 minutes until last bus 6.15pm
From Civic Centre, Route 25
First bus 7.15am approximately every 15 minutes until 8.45am
From 8.45am approximately every 30 minutes until 3.45pm
From 3.45pm approximately every 15 minutes until last bus 7.00pm
Mt Eden Road, Route 27
From Three Kings
First bus 6.30am approximately every 15 minutes until 10.00am.
From 10.00am approximately every 30 minutes until 4.00pm
From 4.00pm approximately every 15 minutes until last bus 6.15pm
From Britomart (Commerce Street), Route 27
First bus 7.15am approximately every 15 minutes until 9.45am
From 9.45am approximately every 30 minutes until 3.45pm
From 3.45pm approximately every 15 minutes until last bus 7.00pm


Please note that ParMETIS and Jostle are not integral parts of Zoltan. These libraries must be obtained and installed separately. (ParMETIS may be bundled with Zoltan, but it is an independent package developed at Univ. of Minnesota.) Zoltan merely provides an interface to these libraries.
The most complex task in the interface code is the construction of the graph data structure. This structure is described in the next section. The routine uses the Zoltan query functions to get a list of objects and edges on each processor. Each object has a unique global ID which is mapped into a unique (global) number between 1 and n, where n is the total number of objects. The construction of the local (on-processor) part of the graph is straightforward. When an edge goes between objects that reside on different processors, global communication is required. We use Zoltan's unstructured communication library for this. A hash function (Zoltan_Hash) is used to efficiently map global IDs to integers. The graph construction algorithm has parallel complexity O(maxj {nj+mj+p}), where nj is the number of objects on processor j, mj is the number of edges on processor j, and p is the number of processors.
One other feature of the interface code should be mentioned. While Zoltan allows objects and edges to have real (float) weights, both ParMETIS and Jostle currently require integer weights. Therefore, Zoltan first checks if the object weights are integers. If not, the weights are automatically scaled and rounded to integers. The scaling is performed such that the weights become large integers, subject to the constraint that the sum of (any component of) the weights is less than a large constant MAX_WGT_SUM < INT_MAX. The scaled weights are rounded up to the nearest integer to ensure that nonzero weights never become zero. Note that for multidimensional weights, each weight component is scaled independently. (The source code is written such that this scaling is simple to change.)
Currently Zoltan constructs and discards the entire graph structure every time a graph-based method (ParMETIS or Jostle) is called. Incremental update of the graph structure may be supported in the future.
The graph construction code in Zoltan_ParMetis_Jostle can also be used to interface with other graph-based algorithms.
The second main strategy is diffusion. This method assumes that an initial partition (balance) is given, and load balance is achieved by repeatedly moving objects (nodes) from parts (processors) that have too heavy load to neighboring parts (processors) with too small load.
For further details about the algorithms in a specific library, please refer to the documentation that is distributed with that library.
In addition, Zoltan has one graph parameter of its own: CHECK_GRAPH. This parameter is set in Zoltan_ParMetis_Jostle and specifies the amount of verification that is performed on the constructed graph. For example, it is required that the graph is symmetric and that the weights are non-negative.


We could do virtually anything with this thing :D
The Plugin itself does nothing more than manage classes on each slide to denote active/inactive states. CSS handles all presentation.
This allows us to create custom slide transitions independant of JavaScript, however there will be a JS based fallback for browsers incapable of CSS Animations/Transitions.
These slides can contain ANYTHING you want, such as clickable links, editable text, full slide images per the usual... I mean ANYTHING!
Put your slides in whatever makes sense. An OL
for sequential slideshow of information, a UL
if that's your thing, or let your
DIVitis
run WILD and DIV
it up :P


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/Memory.20consumption.html ---
Sometimes lean server (started by emacs) starts eating lots of ram (5g and more). Should I do some magic with ulimits, or there is a way to prevent this from inside lean?
The best way to reproduce the effect is to open a file with many not yet compiled dependencies
In VS Code there is an option to give some extra command line inputs, and -M 2000
or something might be what you want
$ lean --help Lean (version 3.4.2, commit cbd2b6686ddb, Release) Miscellaneous: --help -h display this message --version -v display version number --githash display the git commit hash number used to build this binary --run executes the 'main' definition --doc=file -r generate module documentation based on module doc strings --make create olean files --recursive recursively find *.lean files in directory arguments --trust=num -t trust level (default: max) 0 means do not trust any macro, and type check all imported modules --quiet -q do not print verbose messages --memory=num -M maximum amount of memory that should be used by Lean (in megabytes) ...
It runs with -M1024
And still eats 5 gigs? :-/
Are you sure you don't have several lean servers started?
Before I upgraded my computer I had this issue when I tried running leanpkg build
while VScode was also asking for compilation.
I'm sure. I run top and see one server process eating all the memory
I run a locally built 3.5.0
I have this issue with Lean 3.4.2 as well. In addition I've noticed that the Lean server in Emacs doesn't generate olean
files making reloading take a lot longer. So usually I run lean --make
on the file I want to edit if I changed its dependencies.
I do the same but sometimes I forget to do this, and lean eats all available ram very quickly.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Circular graphic, divided into slices to illustrate numerical proportion.
The origin of the graphic is at the top (twelve o'clock). The slices are ordered clockwise, by decreasing size.
As it is difficult to compare different slices, this representation should be used only when comparing the slices to the total.
In the top slot, the qualitative field whose categories are to be represented.
Option 1: Normal pie chart. The area of each slice is proportional to the weight of the corresponding category.
Option 2: Equidistributed pie chart : each slice has the same size.
Option 3: Doughnut chart.
<
Option 4: Equidistributed Doughnut chart.


- Type Parameters:
R
- the return type.
- All Known Subinterfaces:
MonetaryAmountFormat
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface MonetaryQuery<R>
Queries are a key tool for extracting information from monetary amounts. They match the strategy design pattern, allowing different types of query to be easily captured. Examples might be a query that checks if the amount is positive, or one that extracts the currency as a symbol.
There are two equivalent ways of using a MonetaryQuery
. The first is
to invoke the method on this interface. The second is to use
MonetaryAmount.query(MonetaryQuery)
:
// these two lines are equivalent, but the second approach is recommended
monetary = thisQuery.queryFrom(monetary);
// Recommended approach
monetary = monetary.query(thisQuery);
It is recommended to use the second approach, query(MonetaryQuery)
,
as it is a lot clearer to read in code.
Implementation specification
This interface places no restrictions on the mutability of implementations, however immutability is strongly recommended.- Version:
- 1.0
- Author:
- Anatole Tresch, Stephen Colebourne, Werner Keil
-
Method Summary
Modifier and Type Method Description R
queryFrom(MonetaryAmount amount)
Queries the specified monetary amount.
-
Method Details
-
queryFrom
Queries the specified monetary amount.This queries the specified monetary amount to return an object using the logic encapsulated in the implementing class. Examples might be a query that checks if the amount is positive, or one that extracts the currency as a symbol.
There are two equivalent ways of using a
MonetaryQuery
. The first is to invoke the method on this interface. The second is to useMonetaryAmount.query(MonetaryQuery)
:// these two lines are equivalent, but the second approach is recommended monetary = thisQuery.queryFrom(monetary); monetary = monetary.query(thisQuery);
It is recommended to use the second approach,query(MonetaryQuery)
, as it is a lot clearer to read in code.Implementation specification
The implementation must take the input object and query it. The implementation defines the logic of the query and is responsible for documenting that logic. It may use any method onMonetaryAmount
to determine the result. The input object must not be altered.This method may be called from multiple threads in parallel. It must be thread-safe when invoked.
- Parameters:
amount
- the monetary amount to query, not null- Returns:
- the queried value, may return null to indicate not found
- Throws:
MonetaryException
- if unable to queryjava.lang.ArithmeticException
- if numeric overflow occurs
-


--- layout: page title: Course info permalink: /course-info/ ---
Kelly Egan, Instructor • PHOTO-5312, Spring 2019 • Thursday, 1:10–6:00 p.m.
The still photograph is an anomaly in the history of image making. The first optical device, the camera obscura creates an image as fluid as the world it reflects. Optical toys such as thaumatropes, zoetropes, magic lanterns anticipated cinematic moving images even before photography was born and as soon as technology allowed, photographers and scientists such as Marey and Muybridge began to reanimate the frozen moment.
Today we are immersed in moving images, they have become a part of our language, interspersed in digital conversation. It has also begun to move in new ways, through fast networks and social spaces, and lately through the multidimensional space of machine learning.
By the end of this course students will …
… produce time-based work using Adobe After Effects and other media tools that expresses their ideas clearly.
… examine time-based art, including their own, in relation to examples of media art and history.
… be comfortable experimenting with time-based tools and techiniques and incorporating it into their own work.
This course will explore photography in relation to this broad history of the moving image. We will look at various ways to use and present images, beyond paper, including projection, installation, interaction, virtual reality and digital networks.
We will use a number of tools to help with this exploration. We will start by working with Adobe After Effects as one of our primary tools to manipulate images, animations and video. After Effects will be an important tool throughout the course. In addition we will spend some time learning the basics of creative coding using Processing to allow for works that are responsive and interactive as well as to allow us the ability to define our own tools. We will also look at a number of other software and hardware tools that can expand our possibilities
.| Projects | 60% |
|---|---|
| Project 1: Blackbox | 10% |
| Project 2: Loop | 10% |
| Project 3: Context | 10% |
| Final project | 30% |
| Participation | 40% |
| In class | 20% |
| Exercises | 20% |
Because collaborative learning is so central to this course, attendance is critical to your success. If sickness or other personal reasons prevent your attendance please contact the instructor as soon as possible. A student with two or more unexcused absences, may be removed from the course.
Issues of appropriation, reproduction and reuse may arise during this course. In the interest of academic honesty, students should keep track of the sources of the materials, text and code they use in their coursework. Please include a list of sources and citations used with any completed work.
Please see RISD's Academic Code of Conduct for a detail description of school policies.
There is no required text for this class. We will primarily using software available to RISD students or that is free and/or open source.
Students will need a camera for shooting video and still photographs.


Metadata Annotations
Java EE Connector Architecture 1.6 introduces a set of annotations to minimize the need for deployment descriptors.
The @Connector annotation can be used by the resource adapter developer to specify that the JavaBeans component is a resource adapter JavaBeans component. This annotation is used for providing metadata about the capabilities of the resource adapter. Optionally, you can provide a JavaBeans component implementing the ResourceAdapter interface, as in the following example:
@Connector( description = "Sample adapter using the JavaMail API", displayName = "InboundResourceAdapter", vendorName = "My Company, Inc.", eisType = "MAIL", version = "1.0" ) public class ResourceAdapterImpl implements ResourceAdapter, java.io.Serializable { ... ... }
The @ConnectionDefinition annotation defines a set of connection interfaces and classes pertaining to a particular connection type, as in the following example:
@ConnectionDefinition( connectionFactory = JavaMailConnectionFactory.class, connectionFactoryImpl = JavaMailConnectionFactoryImpl.class, connection = JavaMailConnection.class, connectionImpl = JavaMailConnectionImpl.class ) public class ManagedConnectionFactoryImpl implements ManagedConnectionFactory, Serializable { ... }
The @AdministeredObject annotation designates a JavaBeans component as an administered object.
The @Activation annotation contains configuration information pertaining to inbound connectivity from an EIS instance, as in the following example:
@Activation( messageListeners = {JavaMailMessageListener.class} ) public class ActivationSpecImpl implements ActivationSpec, Serializable { ... @ConfigProperty() // serverName property value private String serverName = ""; @ConfigProperty() // userName property value private String userName = ""; @ConfigProperty() // password property value private String password = ""; @ConfigProperty() // folderName property value private String folderName = "INBOX"; // protocol property value @ConfigProperty( description = "Normally IMAP or POP3" ) private String protocol = "IMAP"; ... ... }
The @ConfigProperty annotation can be used on JavaBeans components to provide additional configuration information that may be used by the deployer and resource adapter provider. The preceding example code shows several @ConfigProperty annotations.
The specification allows a resource adapter to be developed in mixed-mode form, that is the ability for a resource adapter developer to use both metadata annotations and deployment descriptors in applications. An application assembler or deployer may use the deployment descriptor to override the metadata annotations specified by the resource adapter developer.
The deployment descriptor for a resource adapter, if present, is named ra.xml. The metadata-complete attribute defines whether the deployment descriptor for the resource adapter module is complete or whether the class files available to the module and packaged with the resource adapter need to be examined for annotations that specify deployment information.
For the complete list of annotations and JavaBeans components introduced in the Java EE 6 platform, see the Java EE Connector architecture 1.6 specification.


module RSS
RSS
reading and writing¶ ↑
Really Simple Syndication (RSS) is a family of formats that describe 'feeds,' specially constructed XML
documents that allow an interested person to subscribe and receive updates from a particular web service. This portion of the standard library provides tooling to read and create these feeds.
The standard library supports RSS
0.91, 1.0, 2.0, and Atom
, a related format. Here are some links to the standards documents for these formats:
Consuming RSS
¶ ↑
If you'd like to read someone's RSS
feed with your Ruby code, you've come to the right place. It's really easy to do this, but we'll need the help of open-uri:
require 'rss' require 'open-uri' url = 'http://www.ruby-lang.org/en/feeds/news.rss' open(url) do |rss| feed = RSS::Parser.parse(rss) puts "Title: #{feed.channel.title}" feed.items.each do |item| puts "Item: #{item.title}" end end
As you can see, the workhorse is RSS::Parser#parse, which takes the source of the feed and a parameter that performs validation on the feed. We get back an object that has all of the data from our feed, accessible through methods. This example shows getting the title out of the channel element, and looping through the list of items.
Producing RSS
¶ ↑
Producing our own RSS
feeds is easy as well. Let's make a very basic feed:
require "rss" rss = RSS::Maker.make("atom") do |maker| maker.channel.author = "matz" maker.channel.updated = Time.now.to_s maker.channel.about = "http://www.ruby-lang.org/en/feeds/news.rss" maker.channel.title = "Example Feed" maker.items.new_item do |item| item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/" item.title = "Ruby 1.9.2-p136 is released" item.updated = Time.now.to_s end end puts rss
As you can see, this is a very Builder-like DSL. This code will spit out an Atom
feed with one item. If we needed a second item, we'd make another block with maker.items.new_item and build a second one.
Copyright¶ ↑
Copyright © 2003-2007 Kouhei Sutou<EMAIL_ADDRESS>You can redistribute it and/or modify it under the same terms as Ruby.
There is an additional tutorial by the author of RSS
at: www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.en
Constants
- AVAILABLE_PARSERS
The list of all available parsers, in constant form.
- AVAILABLE_PARSER_LIBRARIES
The list of all available libraries for parsing.
- CONTENT_PREFIX
The prefix for the Content
XML
namespace.- CONTENT_URI
The
URI
of the Content specification.- DC_PREFIX
The prefix for the Dublin Core
XML
namespace.- DC_URI
The
URI
of the Dublin Core specification.- DublincoreModel
For backward compatibility
- IMAGE_ELEMENTS
This constant holds strings which contain the names of image elements, with the appropriate prefix.
- IMAGE_PREFIX
The prefix for the Image
XML
namespace.- IMAGE_URI
The
URI
for the Image specification.- ITUNES_PREFIX
The prefix for the iTunes
XML
namespace.- ITUNES_URI
The
URI
of the iTunes specification.- SLASH_PREFIX
The prefix for the Slash
XML
namespace.- SLASH_URI
The
URI
of the Slash specification.- SY_PREFIX
The prefix for the Syndication
XML
namespace.- SY_URI
The
URI
of the Syndication specification.- TAXO_ELEMENTS
The listing of all the taxonomy elements, with the appropriate namespace.
- TAXO_PREFIX
The prefix for the Taxonomy
XML
namespace.- TAXO_URI
The
URI
for the specification of the TaxonomyXML
namespace.- URI
- VERSION
The current version of
RSS


Class DT_DateTimeCalculatorServiceTest
Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-06-12 at 00:03:41.
- PHPUnit_Framework_TestCase
- DT_DateTimeCalculatorServiceTest
protected
|
|
protected
|
|
public
|
#
testGetNoOfDaysBetweenTwoMoments( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00") == 365 // days without timezones. |
public
|
#
testGetNoOfDaysBetweenTwoMoments2( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "second") == 31536000. |
public
|
#
testGetNoOfDaysBetweenTwoMoments3( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "minute") == 525600. |
public
|
#
testGetNoOfDaysBetweenTwoMoments4( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "hour") == 8760. |
public
|
#
testGetNoOfDaysBetweenTwoMoments5( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "year") == 1. |
public
|
#
testGetNoOfDaysBetweenTwoMoments6( )
Generated from @assert ("2013-02-28 00:00:00", "2013-03-01 00:00:00") == 1 //leap year support. |
public
|
#
testGetNoOfDaysBetweenTwoMoments7( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Australia/Adelaide", "Asia/Colombo", null) == 365.21 // days with timezones. |
public
|
#
testGetNoOfDaysBetweenTwoMoments8( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Australia/Adelaide", "Asia/Colombo", "second") == 31554000. |
public
|
#
testGetNoOfDaysBetweenTwoMoments9( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Australia/Adelaide", "Asia/Colombo", "minute") == 525900. |
public
|
#
testGetNoOfDaysBetweenTwoMoments10( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Australia/Adelaide", "Asia/Colombo", "hour") == 8765. |
public
|
#
testGetNoOfDaysBetweenTwoMoments11( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Australia/Adelaide", "Asia/Colombo", "year") == 1. |
public
|
#
testGetNoOfDaysBetweenTwoMoments12( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Asia/Colombo", "Australia/Adelaide", null) == 364.79 // switch timezones. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00") == 261 // week days without timezones. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments2( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "second") == 22550400. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments3( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "minute") == 375840. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments4( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "hour") == 6264. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments5( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "year") == 0.71. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments6( )
Generated from @assert ("2013-02-28 00:00:00", "2013-03-01 00:00:00") == 1 //leap year support. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments7( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", null) == 261.75 // week days with timezones. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments8( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "second") == 22615200. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments9( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "minute") == 376920. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments10( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "hour") == 6282. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments11( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "year") == 0.72. |
public
|
#
testGetNoOfWeekDaysBetweenTwoMoments12( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "America/New_York", "Pacific/Auckland", null) == 260.25 // switch timezones. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00") == 52 // complete weeks without timezones. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments2( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "second") == 31449600. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments3( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "minute") == 524160. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments4( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "hour") == 8736. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments5( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", null, null, "year") == 1. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments6( )
Generated from @assert ("2013-02-28 00:00:00", "2013-03-01 00:00:00") == 0 //leap year support. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments7( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", null) == 52 // complete weeks with timezones. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments8( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "second") == 31449600. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments9( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "minute") == 524160. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments10( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "hour") == 8736. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments11( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "Pacific/Auckland", "America/New_York", "year") == 1. |
public
|
#
testGetNoOfCompleteWeeksBetweenTwoMoments12( )
Generated from @assert ("2013-01-01 00:00:00", "2014-01-01 00:00:00", "America/New_York", "Pacific/Auckland", null) == 52 // switch timezones. |
protected
|
$object |
|


There are many times when you are unable to jump directly to shellcode whether because of PIE or ASLR or other protection. On Linux, Ret2LibC is fairly reliable.


Delimited Continuations vs Lwt for Threads
MirageOS is a fully event-driven system, with no support for conventional preemptive threads. Instead, programs are woken by events such as incoming network packets, and event callbacks execute until they themselves need to block (due to I/O or timers) or complete their task.
Event-driven systems are simple to implement, scalable to lots of network clients, and very hip due to frameworks like node.js. However, programming event callbacks directly leads to the control logic being scattered across many small functions, and so we need some abstractions to hide the interruptions of registering and waiting for an event to trigger.
OCaml has the excellent Lwt threading library that utilises a monadic approach to solving this. Consider this simplified signature:
val return : 'a -> 'a Lwt.t
val bind : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
val run : 'a Lwt.t -> 'a
Threads have the type 'a Lwt.t
, which means that the thread will have a result of type 'a
when it finishes.
The return
function is the simplest way to construct such a thread from an OCaml value.
If we then wish to use the value of thread, we must compose a function that will be called in the future when the thread completes. This is what the bind
function above is for. For example, assume we have a function that will let us sleep for some time:
val sleep: int -> unit Lwt.t
We can now use the bind
function to do something after the sleep is complete:
let x = sleep 5 in
let y = bind x (fun () -> print_endline "awake!") in
run y
x
has the type unit Lwt.t
, and the closure passed to bind
will eventually be called with unit
when the sleep finishes. Note that we also need a function to actually begin evaluating an Lwt thread, which is the run
function.
Concerns
MirageOS currently uses Lwt extensively, and we have been very happy with using it to build a network stack. However, I was surprised to hear a lot of debate at the 2011 OCaml Users Group meeting that Lwt is not to everyone’s tastes. There are a few issues:
-
The monadic style means that existing code will not just work. Any code that might block must be adapted to use
return
andbind
, which makes integrating third-party code problematic. -
More concerningly, any potential blocking points require the allocation of a closure. This allocation is very cheap in OCaml, but is still not free. Jun Furuse notes that combinator-based systems are slower during the development of his Planck parser.
Lwt addresses the first problem via a comprehensive syntax extension which provides Lwt equivalents for many common operations. For example, the above example with sleep can be written as:
lwt x = sleep 5 in
print_endline "awake"
The lwt
keyword indicates the result of the expression should be passed through bind
, and this makes it possible to write code that looks more OCaml-like. There are also other keywords like for_lwt
and match_lwt
that similarly help with common control flow constructs.
Fibers
After the meeting, I did get thinking about using alternatives to Lwt in MirageOS. One exciting option is the delimcc library which implements delimited continuations for OCaml. These can be used to implement restartable exceptions: a program can raise an exception which can be invoked to resume the execution as if the exception had never happened.
Delimcc can be combined with Lwt very elegantly, and Jake Donham did just this with the Lwt_fiber library. His post also has a detailed explanation of how delimcc
works.
The interface for fibers is also simple:
val start: (unit -> 'a) -> 'a Lwt.t
val await : 'a Lwt.t -> 'a
A fiber can be launched with start
, and during its execution can block on another thread with await
. When it does block, a restartable exception saves the program stack back until the point that start
was called, and it will be resumed when the thread it blocked on completes.
Benchmarks
I put together a few microbenchmarks to try out the performance of Lwt threads versus fibers. The fiber test looks like this:
module Fiber = struct
let basic fn yields =
for i = 1 to 15000 do
for x = 1 to yields do
Lwt_fiber.await (fn ())
done
done
let run fn yields =
Lwt_fiber.start (fun () -> basic fn yields)
end
We invoke the run function with two arguments: a thread to use for blocking and the number of times we should yield serially (so we can confirm that an increasing number of yields scales linearly). The Lwt version is pretty similar:
module LWT = struct
let basic fn yields =
for_lwt i = 1 to 15000 do
for_lwt x = 1 to yields do
fn ()
done
done
let run = basic
end
We do not need to do anything special to launch a thread since we are already in the Lwt main loop, and the syntax extension makes the for
loops look like the Fiber example above.
The choice of blocking function is important. The first test runs using a fast Lwt.return ()
that returns immediately:
The x-axis on the above graph represents the number of yields in each loop. Both Lwt_fiber
and pure Lwt
optimise the case where a thread returns immediately, and so this graph simply tells us that the fast path is working (which is nice!). The next test replaces the blocking function with two alternatives that force the thread to yield:
There are two blocking functions used in the graph above:
- the “slow” version is
Lwt_unix.sleep 0.0
which forces the registration of a timeout. - the “medium” version is
Lwt.pause ()
which causes the thread to pause and drop into the thread scheduler. In the case ofLwt_fiber
, this causes an exception to be raised so we can benchmark the cost of using a delimited continuation.
Interestingly, using a fiber is slower than normal Lwt here, even though our callstack is not very deep. I would have hoped that fibers would be significantly cheaper with a small callstack, as the amount of backtracking should be quite low. Lets confirm that fibers do in fact slow down as the size of the callstack increases via this test:
module Fiber = struct
let recurse fn depth =
let rec sum n =
Lwt_fiber.await (fn ());
match n with
|0 -> 0
|n -> n + (sum (n-1))
in
for i = 1 to 15000 do
ignore(sum depth)
done
let run fn depth =
Lwt_fiber.start (fun () -> recurse fn depth)
end
The recurse
function is deliberately not tail-recursive, so that the callstack increases as the depth
parameter grows. The Lwt equivalent is slightly more clunky as we have to rewrite the loop to bind and return:
module LWT = struct
let recurse fn depth =
let rec sum n =
lwt () = fn () in
match n with
|0 -> return 0
|n ->
lwt n' = sum (n-1) in
return (n + n')
in
for_lwt i = 1 to 15000 do
lwt res = sum depth in
return ()
done
let run = recurse
end
We then run the experiment using the slow Lwt_unix.sleep 0.0
function, and get this graph:
The above graph shows the recursive Lwt_fiber getting slower as the recursion depth increases, with normal Lwt staying linear. The graph also overlays the non-recursing versions as a guideline (*-basic-slow
).
Thoughts
This first benchmark was a little surprising for me:
- I would have thought that
delimcc
to be ahead of Lwt when dealing with functions with a small call-depth and a small amount of blocking (i.e. the traffic pattern that loaded network servers see). The cost of taking a restartable exception seems quite high however. - The fiber tests still use the Lwt machinery to manage the callback mechanism (i.e. a
select
loop and the timer priority queue). It may be possible to create a really light-weight version just fordelimcc
, but the Lwt UNIX backend is already pretty lean and mean and uses the libev to interface with the OS. - The problem of having to rewrite code to be Lwt-like still exists unfortunately, but it is getting better as the
pa_lwt
syntax extension matures and is integrated into my favourite editor (thanks Raphael!) - Finally, by far the biggest benefit of
Lwt
is that it can be compiled straight into Javascript using the js_of_ocaml compiler, opening up the possibility of cool browser visualisations and tickets to coolnode.js
parties that I don’t normally get invited to.
I need to stress that these benchmarks are very micro, and do not take into account other things like memory allocation. The standalone code for the tests is online at Github, and I would be delighted to hear any feedback.
Retesting recursion [18th Jun 2011]
Jake Donham comments: > I speculated in my post that fibers might be faster if the copy/restore were amortized over a large stack. I wonder if you would repeat the experiment with versions where you call fn only in the base case of sum, instead of at every call. I think you’re getting N^2 behavior here because you’re copying and restoring the stack on each iteration.
When writing the test, I figured that calling the thread waiting function more often wouldn’t alter the result (careless). So I modified the test suite to have a recurse
test that only waits a single time at the end of a long call stack (see below) as well as the original N^2 version (now called recurse2
).
module Fiber = struct
let recurse fn depth =
let rec sum n =
match n with
|0 -> Lwt_fiber.await (fn ()); 0
|n -> n + (sum (n-1))
in
for i = 1 to 15000 do
ignore(sum depth)
done
let run fn depth =
Lwt_fiber.start (fun () -> recurse fn depth)
end
The N^2 version below of course looks the same as the previously run tests, with delimcc getting much worse as it yields more often:
However, when we run the recurse
test with a single yield at the end of the long callstack, the situation reverses itself and now delimcc
is faster. Note that this test ran with more iterations than the recurse2
test to make the results scale, and so the absolute time taken cannot be compared.
The reason for Lwt being slower in this becomes more clear when we examine what the code looks like after it has been passed through the pa_lwt
syntax extension. The code before looks like:
let recurse fn depth =
let rec sum n =
match n with
| 0 ->
fn () >> return 0
| n ->
lwt n' = sum (n-1) in
return (n + n') in
and after pa_lwt
macro-expands it:
let recurse fn depth =
let rec sum n =
match n with
| 0 ->
Lwt.bind (fn ()) (fun _ -> return 0)
| n ->
let __pa_lwt_0 = sum (n - 1)
in Lwt.bind __pa_lwt_0 (fun n' -> return (n + n')) in
Every iteration of the recursive loop requires the allocation of a closure (the Lwt.bind
call). In the delimcc
case, the function operates as a normal recursive function that uses the stack, until the very end when it needs to save the stack in one pass.
Overall, I’m convinced now that the performance difference is insignificant for the purposes of choosing one thread system over the other for MirageOS. Instead, the question of code interoperability is more important. Lwt-enabled protocol code will work unmodified in Javascript, and Delimcc code helps migrate existing code over.
Interestingly, Javascript 1.7 introduces a yield operator, which has been shown to have comparable expressive power to the shift-reset delimcc operators. Perhaps convergence isn’t too far away after all…
- Irmin 0.12 with portable filesystem watching released
- MirageOS Summer 2016 Hackathon roundup
- MirageOS Summer 2016 Hackathon announcement, and talk roundup
- MirageOS Spring 2016 Hackathon!
- MirageOS security advisory 00: mirage-net-xen
- Introducing Functoria
- Run Mirage Unikernels on KVM/QEMU with Solo5
- MirageOS hackathon
- Introducing Charrua — a DHCP implementation
- Unikernel.org


I am experienced in Designing websites with frameworks to provide a responsive websites.
Create fully functional responsive prototypes based on Business Requirements using HTML5, CSS3, JQuery and Bootstrap.
Designing responsive websites
Create fully functional responsive prototypes based on Business Requirements using HTML5, CSS3, JQuery and Bootstrap.
GPA: 3.19


2 Cabinet men face Duterte’s ax
by MJ BlancaflorPresident Rodrigo Duterte said Tuesday night he would fire the two Cabinet secretaries purportedly linked to corruption if allegations against them would be proven true.
President Duterte said he had already seen the report submitted by the Presidential Anti-Corruption Commission in late October on the complaint against sitting Cabinet officials he refused to name.
“I should know, actually, if you are corrupt, because I will summon you to my office and we will have a one-on-one talk,” Duterte said.
 That’s for sure…But let us observe due process,” he added.
PACC Greco Belgica earlier said the two sitting Cabinet officials have been accused of violating Republic Act No. 3019 or the Anti-Graft and Corrupt Practices Act based on the complaints filed.
He also said one of the complaints was filed by an official from the Cabinet secretary’s department while the other was submitted by a private citizen.
The two unidentified Cabinet members, Belgica said, have been cooperating with PACC investigators as the commission conducted a lifestyle check and probe on them which began in February.
Duterte has repeatedly said he would not tolerate even a “whiff” of corruption from any government employee, but he was also criticized for reappointing sacked officials to other government posts.
This year, Duterte fired Bureau of Corrections Chief Nicanor Faeldon
and Jose Antonio Goitia, former chief of the now-defunct Pasig River Rehabilitation Commission, over allegations of corruption.
READ: Faeldon has to go—Duterte
READ: For a better BOC, fire 100 men—Duterte


What power of 10 would make the equation true?
TurnOffApproximations(0);
power1 = RandomInteger (2,3);
power2 = RandomInteger (4,7);
power3 = RandomInteger (6,10);
total1 = 10^power1;
total2 = 10^power2;
total3 = 10^power3;
\(10^x= total1\), \(x=\)
AlgebraAnswerOne - power1 === 0
power1
EnsureExpressionDependsOnlyOn(AlgebraAnswerOne,none);
\(10^x= total2\), \(x=\)
AlgebraAnswerTwo - power2 === 0
power2
EnsureExpressionDependsOnlyOn(AlgebraAnswerOne,none);
\(10^x= total3\), \(x=\)
AlgebraAnswerThree - power3 === 0
power3
EnsureExpressionDependsOnlyOn(AlgebraAnswerThree,none);


CSWDiscovery
Free Text Filter
Temporal Filter
Spatial Filter
Filter by Map Bounds
Options
Show all available Records
Disable Mark BBOX on hover
Option
Show
10
25
50
100
Records
Option
Option
Previous
Next


There are two colors in my head. But we’ll need a few more to make plots.
ggroove
is a package of color palettes and ggplot2 scale_
functions inspired by various album covers.
You can install the development version here
remotes::install_github("danovando/ggroove")
The first entries in the ggroove
library come from Radiohead’s studio LPs, which gets a series of specific functions in the form
scale_fill_radiohead_d
and scale_color_radiohead_c
, where _d
indicates discrete and _c
indicates continuous.
As other artists are added, you can use color palettes from any included album using
scale_fill_album_d
and scale_color_album_c
If you’d like to submit a color palette to ggroove
, see instructions here
A quick note, there’s a lot of science out there on how to construct color palettes that accurately convey information.
These are not those.
Color schemes that make for great album art are not necessarily designed to convey information. I wouldn’t recommend using these for continuous color scales, if you’ve got a few discrete categories rock on.
plot_palette(lp = "pablo_honey")
plot_palette(lp = "the_bends")
plot_palette(lp = "ok_computer")
plot_palette(lp = "kid_a")
plot_palette(lp = "amnesiac")
plot_palette(lp = "hail_to_the_thief")
plot_palette(lp = "in_rainbows")
plot_palette(lp = "the_king_of_limbs")
plot_palette(lp = "a_moon_shaped_pool")
We’ll use data from gapminder
and palmerpenguins
to demonstrate ggroove
.
library(ggplot2)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggroove)
library(palmerpenguins)
library(gapminder)
ggplot2::theme_set(theme_minimal())
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = country)) +
geom_histogram(show.legend = FALSE) +
scale_fill_radiohead_d(album = "in_rainbows") +
theme_minimal()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = continent)) +
geom_histogram(show.legend = FALSE) +
scale_fill_radiohead_d(album = "ok_computer") +
theme_minimal() +
theme_dark()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
And some discrete penguins as well
penguins %>%
ggplot(aes(bill_length_mm, bill_depth_mm, color = species)) +
geom_point(size = 4) +
scale_color_radiohead_d(album = "in_rainbows", direction = 1)
#> Warning: Removed 2 rows containing missing values (geom_point).
Here’s a continuous colorramp based on The Bends (again, probably best not to use ggroove
for continuous scales!)
penguins %>%
ggplot(aes(bill_length_mm, bill_depth_mm, color = body_mass_g)) +
geom_point(size = 4) +
scale_color_radiohead_c(album = "the_bends", direction = -1)
#> Warning: Removed 2 rows containing missing values (geom_point).
You can view all the artists / albums currently present in ggroove
by examining the ggroove
database in ggroove::ggroove_db
ggroove_db$artist %>% unique()
#> [1] "radiohead" "the_beatles"
ggroove_db$album %>% unique()
#> [1] "in_rainbows" "ok_computer" "kid_a"
#> [4] "the_king_of_limbs" "amnesiac" "hail_to_the_thief"
#> [7] "the_bends" "pablo_honey" "a_moon_shaped_pool"
#> [10] "the_white_album"
At the moment, we only have one non-Radiohead artist / album in the package, but more to come!
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = continent)) +
geom_histogram(show.legend = TRUE, color = "black") +
scale_fill_album_d(album = "the_white_album") +
theme_minimal() +
theme_dark()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
I’ve built this package mostly around ggplot2
users, but base plot users can use it too.
You can use the ggroove::album
function to generate a color palette based on your LP choice.
Code and concept for this package was adapted from the amazing fishualize
and wesanderson
packages.


the and with were influenza for was vaccine virus mice The tri-stalk from against antibody protein protection group (Figure that < VLPs IgG {background antibodies induced antigens cells immune BALB/c recombinant weight margin using AP-Me Cal/ immunized viruses {border-style Figure are not protective antigen conserved px;} responses significant vaccination #ffffff;} AP-Me/tri-stalk loss proteins survival ÂµL For []. candidates levels seasonal this vaccines T-cell activity after between highly multiple AP/tri-stalk buffer challenge could sera test A.K. PBS [,]. days followed immunization particles stalk used ANOVA can comparison groups have significantly target virus-like (HN USA). VLP binding hemagglutinin homologous lethal only prototypes rgHN sequence serum study, their vivo T-cells Tukeyâ€™s been both chimeric cross-protective cross-reactivity different mean panel performed shown these under virus, **** .). IgGa Influenza SD. analyzed bars broadly candidate challenged compared heterosubtypic high immunity incubated into loaded min mixture one-way protect represent (B) *** CA, However, Table analysis antibody. assessed control coupling described elicit expressed flow infection monitored pandemic px; surface than vaccinated which {font-family (A) (Andris (pH ADCC All LAH Me-specific S). USA) added also analysis. assay based but coli cross-protection cytotoxic degranulation efficacy final font-size heterologous immunogenicity induce matrix measured one particle provide purified rates some strategy study subclass two viral virus. washed Â°C. (Anna (Table Although Error Furthermore, Gating Kazaks), Vaccine all broad challenge, chemical combined cytotoxicity data domain dose double; each effectiveness elicited experiment has most naÃ¯ve neutralizing number our protein, samples sera. shows single stored suggesting targeted three (C) (D) (for A/California// Bound Challenge Chimeric Me-based Mice NK-cell ONEe./journal.pone. Rockford, Scientific, Statistical TNFÎ±-secreting This Tris-HCl [,,]. animals antibody-conjugates antigenic body border-color border-width cellular collected cool corresponding dark delivery dependent determined did direct durable effector either expression increased infection. last measuring memory mixed more observed other place potential protein. removed respiratory solid; splenocytes staining such then through titers value values when {font-style {font-weight Â°C âˆ’ (Me) A). Anti-CD Antibody B). Darmstadt, ELISA ICS IL, KGaA, Kirsteina), Mantelâ€"Cox Me) N-terminally SATA Saint Samples Supplementary Two Vaccines ZombieAqua [,,,]. addition, additional administered alone anti-CD, assigned avian bold cell concentration confer constructs courier; day differences disease, eluted em; emerging epitopes extended five following four full-length genes had included indirect inducing induction infected inoculated intranasal linear long lysis mouse part particularly passed per plates population possess post-fusion present previous previously produced protected pt;} purification responses; result retro-orbital since statistical strains strategies strong subclasses subsequent subtypes system test, therefore twice viruses. volume weeks â€"


The evolution of venom toxins has been key to the diversification of snakes. Venom toxins evolved from the recruitment of body proteins, which then underwent significant variation in both sequence and structure, while maintaining the molecular scaffold of the ancestral protein. In this way, snakes have been able to obtain functional biological molecules that they can then adjust for use as toxic weaponry. Several different families of venom toxins were recruited for use in snake venom before the diversification of advanced snakes, including Kunitz-type protease inhibitors; others arose from independent recruitment events, such as phospholipase A2. Snake venom phospholipase A2 peptides show remarkable functional diversity: some enzymes are capable of myotoxic effects, causing rapid necrosis of skeletal muscle; others evoke an inflammatory response; while others, like b-bungarotoxin, destroy nerve termini.
b-Bungarotoxin is a heterodimeric neurotoxin, consisting of a phospholipase A2 peptide subunit connected by a disulphide bond to a K+-channel-binding subunit, the latter being a member of the Kunitz protease inhibitor superfamily. These two subunits are structurally and functionally distinct; therefore, in InterPro they have been given different classifications. The two subunits are discussed separately below.
|
InterPro entry |
Method accession |
Graphical match |
Method name |
|
IPR001211 |
PD000303 |
PhospholipaseA2 |
|
|
IPR001211 |
PF00068 |
Phospholip_A2_1 |
|
|
IPR001211 |
PR00389 |
PHPHLIPASEA2 |
|
|
IPR001211 |
PS00118 |
|
PA2_HIS |
|
IPR001211 |
PS00119 |
|
PA2_ASP |
|
IPR001211 |
SM00085 |
PA2c |
|
Classification
|
PDB Chain/Domain ID |
PDB Chain/Structural Domains |
|
|
1bun |
1buna |
|
|
|
<IP_ADDRESS>.2 |
1bunA0 |
|
|
|
a.133.1.2 |
d1buna_ |
|
|
The A-chain subunit of b-bungarotoxin displays phospholipase A2 activity (EC <IP_ADDRESS>), and different isoforms exist in Bungarus venom. The A-chain shares similarity in structure and catalytic function with non-toxic mammalian phospholipase A2 (PLA2) enzymes, which play important roles in fertilisation, cell proliferation, smooth muscle contraction, signal transduction, prostaglandin biosynthesis and membrane homeostasis. By contrast, venom PLA2 activity is responsible for a variety of toxic biological effects by interfering in normal physiological processes; all known pre-synaptic neurotoxins from snake venom are PLA2 enzymes. The PLA2 A-chain is the active subunit of b-bungarotoxin, and is responsible for both the neurotoxic and phospholipase activities of the protein.
In the graphical match above, you can see that the signatures in InterPro for b-bungarotoxin A-chain are found in one entry, IPR001211, which represents the family of phospholipase A2 proteins found not only in toxins, but as endogenous proteins in animals and plants as well. It is represented by six signatures: PD000303 from the PRODOM database, PF00068 from the PFAM database, the 5-element fingerprint PR00389 from the PRINTS database, PS00118 and PS00119 (based on an active site histidine and aspartic acid, respectively) from the PROSITE database, and SM00085 from the SMART database. The remaining three entries are from the structural database PDB, and from the structural classification databases CATH and SCOP (the names such as d1buna_ are derived from the PDB entry upon which they are based: here PDB entry 1bun, chain a). The graphical match for the PDB entry, 1buna, displays the length of the original PDB structure. Both the SCOP (d1buna_) and the CATH (1bunA0) databases describe the structural features and classification of the protein structure. These last three entries are not signatures, but direct structural links.
|
InterPro entry |
Method accession |
Graphical match |
Method name |
|
IPR002223 |
PD000222 |
|
Kunitz_BPTI |
|
IPR002223 |
PF00014 |
|
Kunitz_BPTI |
|
IPR002223 |
PR00759 |
|
BASICPTASE |
|
IPR002223 |
PS00280 |
|
BPTI_KUNITZ_1 |
|
IPR002223 |
PS50279 |
|
BPTI_KUNITZ_2 |
|
IPR002223 |
SM00131 |
|
KU |
Classification
|
PDB Chain/Domain ID |
PDB Chain/Structural Domains |
|
|
1bun |
1bunb |
|
|
|
4.10.410.10.2 |
1bunB0 |
|
|
|
g.8.1.1 |
d1bunb_ |
|
|
The B-chain of b-bungarotoxin has no detectable phospholipase activity. Instead, the B-chain is homologous to Kunitz-type mammalian pancreatic protease inhibitors; however, the B-chain does not have any intrinsic protease inhibitory activity. Instead, the B-chain is thought to act as an affinity probe to guide the toxin to its target potassium channel on nerve terminals. The ion channel-binding region may mimic the regulatory interaction of endogenous neuropeptides. There are several different isoforms of B-chains found in Bungarus venom, which may account for differences in lethality found between different isolated proteins.
In the graphical match above, you can see that the signatures in InterPro for b-bungarotoxin B-chain are found in one entry, IPR002223, which represents the Kunitz-type protein inhibitor I2 domain found in several animal proteins besides toxins. It is represented by six signatures: PD000222 from PRODOM, PF00014 from the PFAM database, the 3-element fingerprint PR00759 from the PRINTS database, PS00280 and PS50279 from the PROSITE database, and SM00131 from the SMART database. The remaining three entries are from the structural database PDB, 1bunb, and from the structural classification databases CATH (1bunB0) and SCOP (d1bunb_).
Several of the bungarotoxins have structures in PDB, including the two domains of b-bungarotoxin mentioned above. A description and visualisation of the structural features of endogenous acetylcholinesterase and its snake toxin counter-part can be found at the PDB database. This enzyme plays a key role in the regulation of cholinergic transmission, and a homologous protein can be found in Bungarus venom.


# Linked Lists
The linked list is a data structure that comes in handy when someone who is building a piece of software has a collection of data, and there is the chance that a lot of insertions and removals will need to be carried out.
In a structure such as an array, if an item is placed at the end of the list, the array's originally defined size must change. If an item was to be placed in a position that isn't the end of the list, all the items in front of it would have to be reallocated to a new position, 1 above their original index. As a side effect of this, removed items would leave wasted space that could only be removed with *more* reallocation.
However, with linked lists, every element/item/node in the list has a pointer attached to it, pointing to the next element. When a programmer wants to add an element in, rather than reallocating a lot of items, the item before the position of the item added in can have its pointer re-pointed.
An example can be shown as follows:
[a]-> [b]-> [c]-> [d]-> [e]-> [NULL / TERMINATE]
In the above diagram, each item in the linked list (represented as [value]) has a pointer 'attached' to it, that points to the next item. The last item, [e], still has a pointer, but it points to a terminating value, such as null. If [e]'s pointer pointed into empty space, the program in which the list is held would cause memory errors. Here, an item is inserted into the list:
-> [n]-v // the 'v' is a down arrow [a] [b]-> [c]-> [d]-> [e]-> [NULL / TERMINATE]
it isn't a very well drawn diagram, since it has been 'drawn' in text, but what has happened is that the new element ([n]), has [a]'s pointer (that previously pointed at [b]), switched to point at [n]. As, to continue the linking of the entire list, [b] needs to be pointed to, [n]'s pointer is assigned to it.


{%extends "base.html"%} {%block title%} Install Application {%endblock%} {%block body%} Home App {{name}} Install Application Install Application: Group Select Group {% for group in groups %} {{group['metadata']['name']}} {% endfor %} Next {%endblock%}


GTK+ 2.0 Tutorial using Ocaml
Tony Gale
Ian Main
& the GTK team
Ocaml Adaptation: SooHyoung Oh
Table of Contents
Tutorial Availability
Ocaml Version Tutorial Availability
Introduction
GTK+ 2.0 in Ocaml
Getting Started
Hello World in GTK
Compiling Hello World
Theory of Signals and Callbacks
Events
Stepping Through Hello World
Moving On
More on Signal Handlers
An Upgraded Hello World
Packing Widgets
Theory of Packing Boxes
Details of Boxes
Packing Demonstration Program
Packing Using Tables
Table Packing Example
Widget Overview
Type Conversion
Widget Hierarchy
Widgets Without Windows
Structure of Widgets
Creating Widgets
Default Arguments
Memory Management
The Button Widget
Normal Buttons
Toggle Buttons
Check Buttons
Radio Buttons
Adjustments
Creating an Adjustment
Using Adjustments the Easy Way
Adjustment Internals
Range Widgets
Scrollbar Widgets
Scale Widgets
Creating a Scale Widget
Functions and Signals (well, functions, at least)
Common Range Functions
Setting the Update Policy
Getting and Setting Adjustments
Key and Mouse bindings
Example
Miscellaneous Widgets
Labels
Arrows
The Tooltips Object
Progress Bars
Dialogs
Rulers
Statusbars
Text Entries
Spin Buttons
Combo Box
Calendar
Color Selection
File Selections
Container Widgets
The EventBox
The Alignment widget
Fixed Container
Layout Container
Frames
Aspect Frames
Paned Window Widgets
Viewports
Scrolled Windows
Button Boxes
Toolbar
Notebooks
Menu Widget
Manual Menu Creation
Manual Menu Example
Automatic Menu Generation
Automatic Menu Generation Example
Undocumented Widgets
Accel Label
Option Menu
Menu Items
Check Menu Item
Radio Menu Item
Separator Menu Item
Tearoff Menu Item
Curves
Drawing Area
Font Selection Dialog
Message Dialog
Gamma Curve
Image
Plugs and Sockets
Tree View
Text View
Setting Widget Attributes
Timeouts and Idle Functions
Timeouts
Idle Functions
Advanced Event and Signal Handling
Signal Functions
Connecting and Disconnecting Signal Handlers
Blocking and Unblocking Signal Handlers
Signal Emission and Propagation
Clipboard
Overview
Clipboard Example
Drag-and-drop (DND)
Overview
Properties
Functions
Setting up the source widget
Signals on the source widget:
Setting up a destination widget:
Signals on the destination widget:
GTK's rc Files
Functions For rc Files
GTK's rc File Format
Example rc file
Scribble, A Simple Example Drawing Program
Overview
Event Handling
The DrawingArea Widget, And Drawing
Contributing
Ocaml Version Contributing
Credits
Ocaml Version Credits
Tutorial Copyright and Permissions Notice
Ocaml Version Tutorial Copyright and Permissions Notice
GTK Signals
GObj
GObj.gtkobj
GObj.widget
Widget
Misc signals
Drag signals
GData.adjustment
GRange.range
GContainer
GContainer.container
GContainer.item
GBin
GBin.handle_box
GBin.expanderhandle_box
GPack.notebook
GMenu
GMenu.menu_shell
GMenu.menu_item
GMenu.check_menu_item
GEdit
GEdit.editable
GEdit.entry
GEdit.spin_button
GEdit.combo_box
GButton
GButton.button
GButton.toggle_button
GButton.color_button
GButton.fontcolor_button
GButton.toolbar
GButton.tool_button
GButton.toggle_tool_button
GWindow
GWindow.dialog
GWindow.file_chooser_dialog
GFile
GFile.chooser
GFile.chooser_widget
GMisc
GMisc.calendar
GMisc.tips_query
GTree
GTree.model
GTree.tree_sortable
GTree.selection
GTree.view_column
GTree.view
GTree.cell_renderer_text
GTree.cell_renderer_toggle
GDK Event Types
Code Examples
Scribble
scribble.ml
Next >>>
Tutorial Availability


--- layout: none permalink: /for-visitors/ ---
@Chaoyang Park
Feel free to contact me, in case you know us. :)
SSID: YCGuest


Tapes root:
Tiled JSON maps root:
File name:
Output:
Logs:
Copy/Paste from OpenOffice:
Game name:
Data:


Introduction
Section 42. See Console Messages Over a Remote Login
Section 43. Spoof a MAC Address
Section 44. Use Multiple Wireless NIC Configurations
Section 45. Survive Catastrophic Internet Loss
Section 46. Humanize tcpdump Output
Section 47. Understand DNS Records and Tools
Section 48. Send and Receive Email Without a Mail Client
Section 49. Why Do I Need sendmail?
Section 50. Hold Email for Later Delivery
Section 51. Get the Most Out of FTP
Section 52. Distributed Command Execution
Section 53. Interactive Remote Administration


| Up | TOC | Index | |||||
| << 7 Included Tools | < 8.2 Command Line Handling | Up: 8 API Reference | 8.4 Date and Time > | 9 Release Notes >> |
8.3 Console
8.3.1 Information
<IP_ADDRESS> has_console
include std/console.e namespace console public function has_console()
determines if the process has a console (terminal) window.
Returns:
An atom,
- 1 if there is more than one process attached to the current console,
- 0 if a console does not exist or only one process (Euphoria) is attached to the current console.
Comments:
- On Unix systems always returns 1 .
- On Windows client systems earlier than Windows XP the function always returns 0 .
- On Windows server systems earlier than Windows Server 2003 the function always returns 0 .
Example 1:
include std/console.e if has_console() then printf(1, "Hello Console!") end if
<IP_ADDRESS> key_codes
include std/console.e namespace console public function key_codes(object codes = 0)
gets and sets the keyboard codes used internally by Euphoria.
Parameters:
- codes : Either a sequence of exactly 256 integers or an atom (the default).
Returns:
A sequence, of the current 256 keyboard codes, prior to any changes that this function might make.
Comments:
When codes is a atom then no change to the existing codes is made, otherwise the set of 256 integers in codes completely replaces the existing codes.
Example 1:
include std/console.e sequence kc kc = key_codes() -- Get existing set. kc[KC_LEFT] = 263 -- Change the code for the left-arrow press. key_codes(kc) -- Set the new codes.
8.3.2 Key Code Names
These are the names of the index values for each of the 256 key code values.
See Also:
<IP_ADDRESS> KC_LBUTTON
include std/console.e namespace console public constant KC_LBUTTON
<IP_ADDRESS> set_keycodes
include std/console.e namespace console public function set_keycodes(object kcfile)
changes the default codes returned by the keyboard.
Parameters:
- kcfile : Either the name of a text file or the handle of an opened (for reading) text file.
Returns:
An integer,
- 0 means no error.
- -1 means that the supplied file could not me loaded in to a map.
- -2 means that a new key value was not an integer.
- -3 means that an unknown key name was found in the file.
Comments:
The text file is expected to contain bindings for one or more keyboard codes.
The format of the files is a set of lines, one line per key binding, in the form KEYNAME = NEWVALUE. The KEYNAME is the same as the constants but without the "KC_" prefix. The key bindings can be in any order.
Example 1:
-- doskeys.txt file containing some key bindings F1 = 260 F2 = 261 INSERT = 456
set_keycodes( "doskeys.txt" )
See Also:
8.3.3 Cursor Style Constants
In cursor constants the second and fourth hex digits (from the left) determine the top and bottom row of pixels in the cursor. The first digit controls whether the cursor will be visible or not. For example: #0407 turns on the 4th through 7th rows.
Note: Windows only.
See Also:
<IP_ADDRESS> NO_CURSOR
include std/console.e namespace console public constant NO_CURSOR
<IP_ADDRESS> UNDERLINE_CURSOR
include std/console.e namespace console public constant UNDERLINE_CURSOR
<IP_ADDRESS> THICK_UNDERLINE_CURSOR
include std/console.e namespace console public constant THICK_UNDERLINE_CURSOR
<IP_ADDRESS> HALF_BLOCK_CURSOR
include std/console.e namespace console public constant HALF_BLOCK_CURSOR
<IP_ADDRESS> BLOCK_CURSOR
include std/console.e namespace console public constant BLOCK_CURSOR
8.3.4 Keyboard Related Routines
<IP_ADDRESS> get_key
<built-in> function get_key()
returns the key that was pressed by the user, without waiting. Special codes are returned for the function keys, arrow keys, and so on.
Returns:
An integer, either -1 if no key waiting, or the code of the next key waiting in keyboard buffer.
Comments:
The operating system can hold a small number of key-hits in its keyboard buffer. get_key will return the next one from the buffer, or -1 if the buffer is empty.
Run the .../euphoria/demo/key.ex program to see what key code is generated for each key on your keyboard.
Example 1:
integer n = get_key() if n=-1 then puts(1, "No key waiting.\n") end if
See Also:
<IP_ADDRESS> allow_break
include std/console.e namespace console public procedure allow_break(types :boolean b)
sets the behavior of Control+C and Control+Break keys.
Parameters:
- b : a boolean, TRUE ( != 0 ) to enable the trapping of Control+C and Control+Break, FALSE ( 0 ) to disable it.
Comments:
When b is 1 (true), Control+C and Control+Break can terminate your program when it tries to read input from the keyboard. When b is 0 (false) your program will not be terminated by Control+C or Control+Break.
Initially your program can be terminated at any point where it tries to read from the keyboard.
You can find out if the user has pressed Control+C or Control+Break by calling check_break.
Example 1:
allow_break(0) -- don't let the user kill the program!
See Also:
<IP_ADDRESS> check_break
include std/console.e namespace console public function check_break()
returns the number of Control+C and Control+Break key presses.
Returns:
An integer, the number of times that Control+C or Control+Break have been pressed since the last call to check_break, or since the beginning of the program if this is the first call.
Comments:
This is useful after you have called allow_break(0) which prevents Control+C or Control+Break from terminating your program. You can use check_break to find out if the user has pressed one of these keys. You might then perform some action such as a graceful shutdown of your program.
Neither Control+C nor Control+Break will be returned as input characters when you read the keyboard. You can only detect them by calling check_break.
Example 1:
k = get_key() if check_break() then -- ^C or ^Break was hit once or more temp = graphics_mode(-1) puts(STDOUT, "Shutting down...") save_all_user_data() abort(1) end if
See Also:
<IP_ADDRESS> wait_key
include std/console.e namespace console public function wait_key()
waits for user to press a key, unless any is pending, and returns key code.
Returns:
An integer, which is a key code. If one is waiting in keyboard buffer, then return it. Otherwise, wait for one to come up.
See Also:
<IP_ADDRESS> any_key
include std/console.e namespace console public procedure any_key(sequence prompt = "Press Any Key to continue...", integer con = 1)
displays a prompt to the user and waits for any key.
Parameters:
- prompt : Prompt to display, defaults to "Press Any Key to continue..." .
- con : Either 1 (stdout), or 2 (stderr). Defaults to 1 .
Comments:
This wraps wait_key by giving a clue that the user should press a key, and perhaps do some other things as well.
Example 1:
any_key() -- "Press Any Key to continue..."
Example 2:
any_key("Press Any Key to quit")
See Also:
<IP_ADDRESS> maybe_any_key
include std/console.e namespace console public procedure maybe_any_key(sequence prompt = "Press Any Key to continue...", integer con = 1)
displays a prompt to the user and waits for any key. Only if the user is running under a GUI environment.
Parameters:
- prompt : Prompt to display, defaults to "Press Any Key to continue..."
- con : Either 1 (stdout), or 2 (stderr). Defaults to 1.
Comments:
This wraps wait_key by giving a clue that the user should press a key, and perhaps do some other things as well.
Requires Windows XP or later or Windows 2003 or later to work. Earlier versions of Windows or O/S will always pause even when not needed.
On Unix systems this will not pause even when needed.
Example 1:
any_key() -- "Press Any Key to continue..."
Example 2:
any_key("Press Any Key to quit")
See Also:
<IP_ADDRESS> prompt_number
include std/console.e namespace console public function prompt_number(sequence prompt, sequence range)
prompts the user to enter a number and returns only validated input.
Parameters:
- st : is a string of text that will be displayed on the screen.
- s : is a sequence of two values {lower, upper} which determine the range of values that the user may enter. s can be empty, {}, if there are no restrictions.
Returns:
An atom, in the assigned range which the user typed in.
Errors:
If puts cannot display st on standard output, or if the first or second element of s is a sequence, a runtime error will be raised.
If user tries cancelling the prompt by hitting Control+Z, the program will abort as well, issuing a type check error.
Comments:
As long as the user enters a number that is less than lower or greater than upper, the user will be prompted again.
If this routine is too simple for your needs, feel free to copy it and make your own more specialized version.
Example 1:
age = prompt_number("What is your age? ", {0, 150})
Example 2:
t = prompt_number("Enter a temperature in Celcius:\n", {})
See Also:
<IP_ADDRESS> prompt_string
include std/console.e namespace console public function prompt_string(sequence prompt)
prompts the user to enter a string of text.
Parameters:
- st : is a string that will be displayed on the screen.
Returns:
A sequence, the string that the user typed in, stripped of any new-line character.
Comments:
If the user happens to type Control+Z (indicates end-of-file), "" will be returned.
Example 1:
name = prompt_string("What is your name? ")
See Also:
8.3.5 Cross Platform Text Graphics
<IP_ADDRESS> positive_int
include std/console.e namespace console public type positive_int(object x)
<IP_ADDRESS> clear_screen
<built-in> procedure clear_screen()
clears the screen using the current background color.
Comments:
The background color can be set by bk_color ).
See Also:
<IP_ADDRESS> get_screen_char
include std/console.e namespace console public function get_screen_char(positive_atom line, positive_atom column, integer fgbg = 0)
gets the value and attribute of the character at a given screen location.
Parameters:
- line : the 1-base line number of the location.
- column : the 1-base column number of the location.
- fgbg : an integer, if 0 (the default) you get an attribute_code returned otherwise you get a foreground and background color number returned.
Returns:
- If fgbg is zero then a sequence of two elements, {character, attribute_code} for the specified location.
- If fgbg is not zero then a sequence of three elements, {characterfg_color, bg_color}.
Comments:
- This function inspects a single character on the active page.
- The attribute_code is an atom that contains the foreground and background color of the character, and possibly other operating-system dependant information describing the appearance of the character on the screen.
- With get_screen_char and put_screen_char you can save and restore a character on the screen along with its attribute_code.
- The fg_color and bg_color are integers in the range 0 to 15 which correspond to the values in the table:
Color Table
| color number | name |
|---|---|
| 0 | black |
| 1 | dark blue |
| 2 | green |
| 3 | cyan |
| 4 | crimson |
| 5 | purple |
| 6 | brown |
| 7 | light gray |
| 8 | dark gray |
| 9 | blue |
| 10 | bright green |
| 11 | light blue |
| 12 | red |
| 13 | magenta |
| 14 | yellow |
| 15 | white |
Example 1:
-- read character and attributes at top left corner s = get_screen_char(1,1) -- s could be {'A', 92} -- store character and attributes at line 25, column 10 put_screen_char(25, 10, s)
Example 2:
-- read character and colors at line 25, column 10. s = get_screen_char(25,10, 1) -- s could be {'A', 12, 5}
See Also:
put_screen_char, save_text_image
<IP_ADDRESS> put_screen_char
include std/console.e namespace console public procedure put_screen_char(positive_atom line, positive_atom column, sequence char_attr)
stores and displays a sequence of characters with attributes at a given location.
Parameters:
- line : the 1-based line at which to start writing.
- column : the 1-based column at which to start writing.
- char_attr : a sequence of alternated characters and attribute codes.
Comments:
char_attr must be in the form {character, attribute code, character, attribute code, ...}.
Errors:
The length of char_attr must be a multiple of two.
Comments:
The attributes atom contains the foreground color, background color, and possibly other platform-dependent information controlling how the character is displayed on the screen. If char_attr has 0 length, nothing will be written to the screen. The characters are written to the active page. It is faster to write several characters to the screen with a single call to put_screen_char than it is to write one character at a time.
Example 1:
-- write AZ to the top left of the screen -- (attributes are platform-dependent) put_screen_char(1, 1, {'A', 152, 'Z', 131})
See Also:
get_screen_char, display_text_image
<IP_ADDRESS> attr_to_colors
include std/console.e namespace console public function attr_to_colors(integer attr_code)
converts an attribute code to its foreground and background color components.
Parameters:
- attr_code : integer, an attribute code.
Returns:
A sequence, of two elements -- {fgcolor, bgcolor}
Example 1:
? attr_to_colors(92) --> {12, 5}
See Also:
get_screen_char, colors_to_attr
<IP_ADDRESS> colors_to_attr
include std/console.e namespace console public function colors_to_attr(object fgbg, integer bg = 0)
converts a foreground and background color set to its attribute code format.
Parameters:
- fgbg : Either a sequence of {fgcolor, bgcolor} or just an integer fgcolor.
- bg : An integer bgcolor. Only used when fgbg is an integer.
Returns:
An integer, an attribute code.
Example 1:
? colors_to_attr({12, 5}) --> 92 ? colors_to_attr(12, 5) --> 92
See Also:
get_screen_char, put_screen_char, attr_to_colors
<IP_ADDRESS> display_text_image
include std/console.e namespace console public procedure display_text_image(text_point xy, sequence text)
displays a text image in any text mode.
Parameters:
- xy : a pair of 1-based coordinates representing the point at which to start writing.
- text : a list of sequences of alternated character and attribute.
Comments:
This routine displays to the active text page, and only works in text modes.
You might use save_text_image and display_text_image in a text-mode graphical user interface, to allow "pop-up" dialog boxes, and drop-down menus to appear and disappear without losing what was previously on the screen.
Example 1:
clear_screen() display_text_image({1,1}, {{'A', WHITE, 'B', GREEN}, {'C', RED+16*WHITE}, {'D', BLUE}}) -- displays: -- AB -- C -- D -- at the top left corner of the screen. -- 'A' will be white with black (0) background color, -- 'B' will be green on black, -- 'C' will be red on white, and -- 'D' will be blue on black.
See Also:
save_text_image, put_screen_char
<IP_ADDRESS> save_text_image
include std/console.e namespace console public function save_text_image(text_point top_left, text_point bottom_right)
copies a rectangular block of text out of screen memory.
Parameters:
- top_left : the coordinates, given as a pair, of the upper left corner of the area to save.
- bottom_right : the coordinates, given as a pair, of the lower right corner of the area to save.
Returns:
A sequence, of {character, attribute, character, ...} lists.
Comments:
The returned value is appropriately handled by display_text_image.
This routine reads from the active text page, and only works in text modes.
You might use this function in a text-mode graphical user interface to save a portion of the screen before displaying a drop-down menu, dialog box, alert box, and so on.
Example 1:
-- Top 2 lines are: Hello and World s = save_text_image({1,1}, {2,5}) -- s is something like: {"H-e-l-l-o-", "W-o-r-l-d-"}
See Also:
display_text_image, get_screen_char
<IP_ADDRESS> text_rows
include std/console.e namespace console public function text_rows(positive_int rows)
sets the number of lines on a text-mode screen.
Parameters:
- rows : an integer, the desired number of rows.
Platform:
Windows
Returns:
An integer, the actual number of text lines.
Comments:
Values of 25, 28, 43 and 50 lines are supported by most video cards.
See Also:
<IP_ADDRESS> cursor
include std/console.e namespace console public procedure cursor(integer style)
selects a style of cursor.
Parameters:
- style : an integer defining the cursor shape.
Platform:
Windows
Comments:
In pixel-graphics modes no cursor is displayed.
Example 1:
cursor(BLOCK_CURSOR)
Cursor Type Constants:
See Also:
<IP_ADDRESS> free_console
include std/console.e namespace console public procedure free_console()
frees (deletes) any console window associated with your program.
Comments:
Euphoria will create a console text window for your program the first time that your program prints something to the screen, reads something from the keyboard, or in some way needs a console. On Windows this window will automatically disappear when your program terminates, but you can call free_console to make it disappear sooner. On Unix the text mode console is always there, but an xterm window will disappear after Euphoria issues a "Press Enter" prompt at the end of execution.
On Unix free_console will set the terminal parameters back to normal, undoing the effect that curses has on the screen.
In a Unix terminal a call to free_console (without any further printing to the screen or reading from the keyboard) will eliminate the "Press Enter" prompt that Euphoria normally issues at the end of execution.
After freeing the console window, you can create a new console window by printing something to the screen, calling clear_screen, position, or any other routine that needs a console.
When you use the trace facility, or when your program has an error, Euphoria will automatically create a console window to display trace information, error messages, and so on.
There is a WINDOWS API routine, FreeConsole() that does something similar to free_console. Use the Euphoria free_console because it lets the interpreter know that there is no longer a console to write to or read from.
See Also:
<IP_ADDRESS> display
include std/console.e namespace console public procedure display(object data_in, object args = 1, integer finalnl = - 918_273_645)
displays the supplied data on the console screen at the current cursor position.
Parameters:
- data_in : Any object.
- args : Optional arguments used to format the output. Default is 1 .
- finalnl : Optional. Determines if a new line is output after the data. Default is to output a new line.
Comments:
- If data_in is an atom or integer, it is simply displayed.
- If data_in is a simple text string, then args can be used to produce a formatted output with data_in providing the text:format string and args being a sequence containing the data to be formatted.
- If the last character of data_in is an underscore character then it is stripped off and finalnl is set to zero. Thus ensuring that a new line is not output.
- The formatting codes expected in data_in are the ones used by text:format. It is not mandatory to use formatting codes, and if data_in does not contain any then it is simply displayed and anything in args is ignored.
- If data_in is a sequence containing floating-point numbers, sub-sequences or integers that are not characters, then data_in is forwarded on to the pretty_print to display.
- If args is a non-empty sequence, it is assumed to contain the pretty_print formatting options.
- if args is an atom or an empty sequence, the assumed pretty_print formatting options are assumed to be {2}.
After the data is displayed, the routine will normally output a New Line. If you want to avoid this, ensure that the last parameter is a zero. Or to put this another way, if the last parameter is zero then a New Line will not be output.
Example 1:
display("Some plain text") -- Displays this string on the console plus a new line. display("Your answer:",0) -- Displays this string on the console without a new line. display("cat") display("Your answer:",,0) -- Displays this string on the console without a new line. display("") display("Your answer:_") -- Displays this string, -- except the '_', on the console without a new line. display("dog") display({"abc", 3.44554}) -- Displays the contents of 'res' on the console. display("The answer to [1] was [2]", {"'why'", 42}) -- formats these with a new line. display("",2) display({51,362,71}, {1})
Output would be:
Some plain text Your answer:cat ===== Your answer: Your answer:dog { "abc", 3.44554 } The answer to 'why' was 42 "" {51'3',362,71'G'}


Man gives new bass guitar to N.C. musician who had instrument stolen during funeral
by WBTV Web StaffCHARLOTTE, N.C. (WBTV) - A man gifted two new bass guitars to a musician who had his bass guitar stolen during a funeral at a church in Stanley.
Charles Pitts told WBTV he is a member of the praise team at the Frontline Worship Center in Stanley. He routinely performs with the group at church events. He plays the bass guitar and just bough a new, lightweight Warwick Corvette bass back in April.
“Being able to have something this nice and being able to afford having this, it meant a big deal to me,” Pitts told WBTV Wednesday night.
He said he was troubled to discover Monday that his bass was missing. He said he looked all over the church for it, but couldn’t find it. He said he finally determined the bass had been stolen and filed a police report with the Stanley Police Department.
Bill DiPietro expressed that he would like to donate equipment to Pitts. On Friday, Pitts and DiPietro met at Dipietro’s home in Charlotte.
DiPietro gave Pitts two bass guitars and two bass amps for free. Pitts said he is very appreciative.
As far as the crime of the stolen bass guitar, police told WBTV they do have a person of interest in the case, but the person has yet to be identified. If you have any information about this incident, please contact the Stanley Police Department.