Logic programming excels in providing interfaces to data bases for information retrieval. The query language we shall implement in this chapter is designed to be used in this way.
In order to illustrate what the query system does, we will show how it can be used to manage the data base of personnel records for Microshaft, a thriving high-technology company in the Boston area. The language provides pattern-directed access to personnel information and can also take advantage of general rules in order to make logical deductions.
The personnel data base for Microshaft contains assertions about company personnel. Here is the information about Ben Bitdiddle, the resident computer wizard:
address(list("Bitdiddle", "Ben"), list("Slumerville", "Ridge Road", 10)); job(list("Bitdiddle", "Ben"), list("computer", "wizard")); salary(list("Bitdiddle", "Ben"), 60000);
As resident wizard, Ben is in charge of the company's computer division, and he supervises two programmers and one technician. Here is the information about them:
address(list("Hacker", "Alyssa", "P"), list("Cambridge", "Mass Ave", 78)); job(list("Hacker", "Alyssa", "P"), list("computer", "programmer")); salary(list("Hacker", "Alyssa", "P"), 40000); supervisor(list("Hacker", "Alyssa", "P"), list("Bitdiddle", "Ben")); address(list("Fect", "Cy", "D"), list("Cambridge", "Ames Street", 3)); job(list("Fect", "Cy", "D"), list("computer", "programmer")); salary(list("Fect", "Cy", "D"), 35000); supervisor(list("Fect", "Cy", "D"), list("Bitdiddle", "Ben")); address(list("Tweakit", "Lem", "E"), list("Boston", "Bay State Road", 22)); job(list("Tweakit", "Lem", "E"), list("computer", "technician")); salary(list("Tweakit", "Lem", "E"), 25000); supervisor(list("Tweakit", "Lem", "E"), list("Bitdiddle", "Ben"));
There is also a programmer trainee, who is supervised by Alyssa:
address(list("Reasoner", "Louis"), list("Slumerville", "Pine Tree Road", 80)); job(list("Reasoner", "Louis"), list("computer", "programmer trainee")); salary(list("Reasoner", "Louis"), 30000); supervisor(list("Reasoner", "Louis"), list("Hacker", "Alyssa", "P"));
All of these people are in the computer division, as indicated by the word computer as the first item in their job descriptions. Ben is a high-level employee. His supervisor is the company's big wheel himself:
supervisor(list("Bitdiddle", "Ben"), list("Warbucks", "Oliver")); address(list("Warbucks", "Oliver"), list("Swellesley", "Top Heap Road")); job(list("Warbucks", "Oliver"), list("administration", "big", "wheel")); salary(list("Warbucks", "Oliver"), 150000);
Besides the computer division supervised by Ben, the company has an accounting division, consisting of a chief accountant and his assistant:
address(list("Scrooge", "Eben"), list("Weston", "Shady Lane", 10)); job(list("Scrooge", "Eben"), list("accounting", list("chief", "accountant")); salary(list("Scrooge", "Eben"), 75000); supervisor(list("Scrooge", "Eben"), list("Warbucks", "Oliver")); address(list("Cratchet", "Robert"), list("Allston", "N Harvard Street", 16)); job(list("Cratchet", "Robert"), list("accounting", "scrivener")); salary(list("Cratchet", "Robert"), 18000); supervisor(list("Cratchet", "Robert"), list("Scrooge", "Eben"));
There is also a secretary for the big wheel:
address(list("Aull", "DeWitt"), list("Slumerville", "Onion Square", 5)); job(list("Aull", "DeWitt"), list("administration", "secretary")); salary(list("Aull", "DeWitt"), 25000); supervisor(list("Aull", "DeWitt"), list("Warbucks", "Oliver"));
The data base also contains assertions about which kinds of jobs can be done by people holding other kinds of jobs. For instance, a computer wizard can do the jobs of both a computer programmer and a computer technician:
can_do_job(list("computer", "wizard"), list("computer", "programmer")); can_do_job(list("computer", "wizard"), list("computer", "technician"));
A computer programmer could fill in for a trainee:
can_do_job(list("computer", "programmer"), list("computer", "programmer", "trainee"));
Also, as is well known,
can_do_job(list("administration", "secretary"), list("administration", "big", "wheel"));
The query language allows users to retrieve information from the data base by posing queries in response to the system's prompt. For example, to find all computer programmers one can say
// Query input: job(x, list("computer", "programmer"));
The system will respond with the following items:
// Query results: job(list("Hacker", "Alyssa", "P"), list("computer", "programmer")) job(list("Fect", "Cy", "D"), list("computer", "programmer"))
The input query specifies that we are looking for entries in the data
base that match a certain pattern. In this example, the pattern
specifies entries consisting of three items, of which the first is the
literal symbol job, the second can be anything, and the third is
the literal list list("computer", "programmer"). The anything
that
can be the second item in the matching list is specified by a
pattern variable,
x.
The system responds to a simple query by
showing all entries in the data base that match the specified pattern.
A pattern can have more than one variable. For example, the query
address(x, y)
A pattern can have no variables, in which case the query simply determines whether that pattern is an entry in the data base. If so, there will be one match; if not, there will be no matches.
The same pattern variable can appear more than once in a query,
specifying that the same anything
must appear in each position.
This is why variables have names. For example,
supervisor(x, x)
The query
job(x, list("computer", type));
job(list("Bitdiddle", "Ben"), list("computer", "wizard")); job(list("Hacker", "Alyssa", "P"), list("computer", "programmer")); job(list("Fect", "Cy", "D"), list("computer", "programmer")); job(list("Tweakit", "Lem", "E"), list("computer", "technician"));
This same pattern does not match
job(list("Reasoner", "Louis"), list("computer", "programmer", "trainee"));
job(x, pair("computer", type))
pair("computer", type)
list("computer", "programmer", "trainee")
list("computer", "programmer")
list("computer")
We can describe the query language's processing of simple queries as follows:
Note that if the pattern has no variables, the query reduces to a determination of whether that pattern is in the data base. If so, the empty assignment, which assigns no values to variables, satisfies that pattern for that data base.
Simple queries form the primitive operations of the query language. In order to form compound operations, the query language provides means of combination. One thing that makes the query language a logic programming language is that the means of combination mirror the means of combination used in forming logical expressions: and, or, and not. (Here and, or, and not are not the JavaScript primitives, but rather operations built into the query language.)
We can use and as follows to find the addresses of all the computer programmers:
and(job(person, list("computer", "programmer"), address(person, where));
The resulting output is
and(job(list("Hacker", "Alyssa", "P"), list("computer", "programmer")), address(list("Hacker", "Alyssa", "P"), list("Cambridge", "Mass Ave", 78))) and(job(list("Fect", "Cy", "D"), list("computer", "programmer")), address(list("Fect", "Cy", "D"), list("Cambridge", "Ames Street", 3)))
In general, and($\textit{query}_{1}$, $\textit{query}_{2}$, $\ldots$, $\textit{query}_{n})$; is satisfied by all sets of values for the pattern variables that simultaneously satisfy $\textit{query}_{1}\ldots \textit{query}_{n}$.
As for simple queries, the system processes a compound query by finding all assignments to the pattern variables that satisfy the query, then displaying instantiations of the query with those values.
Another means of constructing compound queries is through or. For example,
or(supervisor(x, list("Bitdiddle", "Ben")), supervisor(x, list("Hacker", "Alyssa", "P")));
or(supervisor(list("Hacker", "Alyssa", "P"), list("Bitdiddle", "Ben")), supervisor(list("Hacker", "Alyssa", "P"), list("Hacker", "Alyssa", "P"))) or(supervisor(list("Fect", "Cy", "D"), list("Bitdiddle", "Ben")), supervisor(list("Fect", "Cy", "D"), list("Hacker", "Alyssa", "P"))) or(supervisor(list("Tweakit", "Lem", "E"), list("Bitdiddle", "Ben")), supervisor(list("Tweakit", "Lem", "E"), list("Hacker", "Alyssa", "P"))) or(supervisor(list("Reasoner", "Louis"), list("Bitdiddle", "Ben")), supervisor(list("Reasoner", "Louis"), list("Hacker", "Alyssa", "P")))
In general, or($\textit{query}_{1}$, $\textit{query}_{2}$, $\ldots$, $\textit{query}_{n}$^); is satisfied by all sets of values for the pattern variables that satisfy at least one of $\textit{query}_{1} \ldots \textit{query}_{n}$.
Compound queries can also be formed with not. For example,
and(supervisor(x, list("Bitdiddle", "Ben")), not(job(x, list("computer", "programmer"))));
The final combining form is called javascript_value. When javascript_value is the first element of a pattern, it specifies that the next element is a JavaScript predicate to be applied to the rest of the (instantiated) elements as arguments. In general, javascript_value($\textit{predicate}$, $\textit{arg}_{1}$, $\ldots$, $\textit{arg}_{n}$) will be satisfied by assignments to the pattern variables for which the $\textit{predicate}$ applied to the instantiated $\textit{arg}_{1}, \ldots, \textit{arg}_{n}$ is true. For example, to find all people whose salary is greater than \$30,000 we could write[2]
and(salary(person, amount), javascript_value(greater_than, amount, 30000));
In addition to primitive queries and compound queries, the query language provides means for abstracting queries. These are given by rules. The rule
rule(lives_near(person_1, person_2), and(address(person_1, pair(town, rest_1)), address(person_2, pair(town, rest_2)), not(same(person_1, person_2))));
rule(same(x, x));
The following rule declares that a person is a wheel
in an
organization if he supervises someone who is in turn a supervisor:
rule(wheel(person), and(supervisor(middle_manager, person), supervisor(x, middle_manager)));
The general form of a rule is rule($\textit{conclusion}$, $\textit{body}$); where $\textit{conclusion}$ is a pattern and $\textit{body}$ is any query.[4] We can think of a rule as representing a large (even infinite) set of assertions, namely all instantiations of the rule conclusion with variable assignments that satisfy the rule body. When we described simple queries (patterns), we said that an assignment to variables satisfies a pattern if the instantiated pattern is in the data base. But the pattern needn't be explicitly in the data base as an assertion. It can be an implicit assertion implied by a rule. For example, the query
lives_near(x, list("Bitdiddle", "Ben"))
lives_near(list("Reasoner", "Louis"), list("Bitdiddle", "Ben")) lives_near(list("Aull", "DeWitt"), list("Bitdiddle", "Ben"))
To find all computer programmers who live near Ben Bitdiddle, we can ask
and(job(x, list("computer", "programmer")), lives_near(x, list("Bitdiddle", "Ben")));
As in the case of compound functions, rules can be used as parts of other rules (as we saw with the lives-near rule above) or even be defined recursively. For instance, the rule
rule(outranked_by(staff_person, boss), or(supervisor(staff_person, boss), and(supervisor(staff_person, middle_manager), outranked_by(middle_manager, boss))));
big shotin a division if the person works in the division but does not have a supervisor who works in the division. \end{Exercise} \stepcounter{ExerciseDisplayNumber} \begin{Exercise} Ben Bitdiddle has missed one meeting too many. Fearing that his habit of forgetting meetings could cost him his job, Ben decides to do something about it. He adds all the weekly meetings of the firm to the Microshaft data base by asserting the following:
meeting("accounting", list("Monday", "9am")) meeting("administration", list("Monday", "10am")) meeting("computer", list("Wednesday", "3pm")) meeting("administration", list("Friday", "1pm"))
meeting("whole-company", list("Wednesday", "4pm"))
lives_near(person, list("Hacker", "Alyssa", "P"));
lives_near(person_1, person_2)
We can regard a rule as a kind of logical implication: If an assignment of values to pattern variables satisfies the body, then it satisfies the conclusion. Consequently, we can regard the query language as having the ability to perform logical deductions based upon the rules. As an example, consider the append operation described at the beginning of section \ref{sec:logic-programming}. As we said, append can be characterized by the following two rules:
To express this in our query language, we define two rules for a relation
append-to-form("x", "y", "z")
x and y append to form z:
rule(append_to_form(null, y, y)); rule(append_to_form(pair(u, v), y, pair(u, z)), append-to-form(v, y, z));
The first rule has no body, which means that the conclusion holds for any value of y. Note how the second rule makes use of dotted-tail notation to name the head and tail of a list.
Given these two rules, we can formulate queries that compute the append of two lists:
// Query input: append-to-form(list("a", "b"), list("c", "d"), z); // Query results: append-to-form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d"))
What is more striking, we can use the same rules to ask the question
Which list, when appended to list("a", "b"), yields list("a", "b", "c", "d")?
This is done as follows:
// Query input: append-to-form(list("a", "b"), y, list("a", "b", "c", "d")); // Query results: append-to-form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d"))
We can also ask for all pairs of lists that append to form list("a", "b", "c", "d"):
// Query input: append-to-form(x, y, list("a", "b", "c", "d")); // Query results: append-to-form(null, list("a", "b", "c", "d"), list("a", "b", "c", "d")) append-to-form(list("a"), list("b", "c", "d"), list("a", "b", "c", "d")) append-to-form(list("a", "b"), list("c", "d"), list("a", "b", "c", "d")) append-to-form(list("a", "b", "c"), list("d"), list("a", "b", "c", "d")) append-to-form(list("a", "b", "c", "d"), null, list("a", "b", "c", "d"))
The query system may seem to exhibit quite a bit of intelligence in using the rules to deduce the answers to the queries above. Actually, as we will see in the next section, the system is following a well-determined algorithm in unraveling the rules. Unfortunately, although the system works impressively in the append case, the general methods may break down in more complex cases, as we will see in section \ref{sec:math-logic}.
rule(next_to_in(x, y, pair(x, pair(y, u))), and(next_to_in(x, y, pair(v, z)), next_to_in(x, y, z));
next_to_in(x, y, list(1, list(2, 3), 4)); next_to_in(x, 1, list(2, 1, 3, 1));
son("Adam", "Cain"); son("Cain", "Enoch"); son("Enoch", "Irad"); son("Methushael", "Lamech"); wife("Lamech", "Ada"); son("Ada", "Jabal"); son("Ada", "Jubal");
If S is the son of F, and F is the son of G, then S is the grandson of Gand
If W is the wife of M, and S is the son of W, then S is the son of M(which was supposedly more true in biblical times than today) that will enable the query system to find the grandson of Cain; the sons of Lamech; the grandsons of Methushael. (See exercise \ref{ex:great-grandson} for some rules to deduce more complicated relationships.) \end{Exercise}


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CapSense
A pin used for capacitive sensing.
A cap-sense input pin can be used to measure capacitance, most frequently for touch sensing.
CapSense instances are obtained by calling IOIO.openCapSense(int)
.
Capacitance is measured by pushing a known amount of charge into the circuit, and measuring the increase in voltage. As capacitance gets bigger, this increase becomes smaller, and thus less accurate. As capacitance gets smaller, the increase may become fast enough so it can saturate, i.e. reach the maximum voltage. The system has been tuned to effectively sense capacitance values typical of the human body, for touch sensors. The lowest possible capacitance is about 27pF, and at about 2700pF the precision will be around 10% (with high noise level unless filtered). The internal capacitance of the system with some parasitic capacitance will normally be 30pF or more. Human-body capacitance will typically be about 150pF without grounding, and greater with grounding or when touching a large metallic surface.
Floating-point values in pico-Farade units can be obtained by calling read()
.
For better noise immunity, some low-pass filtering is recommended. This module provides a simple,
single-pole IIR filtering, with configurable time- constant. There is a trade-off when selecting
the time-constant: a longer time constant will provide better noise filtering, but at the cost of
a slower response. In other words, it will take more time for the measured value to reach the
actual. The default value of DEFAULT_COEF
( 25.0fpF) is a reasonable one
in many cases. To change it, call setFilterCoef(float)
, or use the overload the open
method, which gets a filter coefficient argument: IOIO.openCapSense(int, float)
.
The instance is alive since its creation. The first read()
call block for a few
milliseconds until the initial value is updated. If the connection with the IOIO drops at any
point, the instance transitions to a disconnected state, in which every attempt to use the pin
(except Closeable.close()
) will throw a ConnectionLostException
. Whenever Closeable.close()
is invoked the instance may no longer be used. Any resources associated with it are freed and can
be reused.
Typical usage:
CapSense touchSensor = ioio.openCapSense(40); if (touchSensor.read() > 50) { // Clicked! ... } ... touchSensor.close(); // optional. pin 40 can now be used for something else.
IOIO.openCapSense(int)
,
IOIO.openCapSense(int, float)
| Field Summary | |
|---|---|
static float |
DEFAULT_COEF
|
| Method Summary | |
|---|---|
float |
read()
Gets the capacitance reading. |
float |
readSync()
This is very similar to read() , but will wait for a new sample to arrive before
returning. |
void |
setFilterCoef(float t)
Sets the low-pass filter coefficient. |
void |
waitOver(float threshold)
Block until sensed capacitance becomes greater than a given threshold. |
void |
waitOverSync(float threshold)
This is very similar to #waitOver() , but will wait for a new sample to arrive before
returning. |
void |
waitUnder(float threshold)
Block until sensed capacitance becomes less than a given threshold. |
void |
waitUnderSync(float threshold)
This is very similar to #waitUnder() , but will wait for a new sample to arrive before
returning. |
| Methods inherited from interface ioio.lib.api.Closeable |
|---|
close |
| Field Detail |
|---|
static final float DEFAULT_COEF
| Method Detail |
|---|
float read() throws java.lang.InterruptedException, ConnectionLostException
It typically takes a few milliseconds between when the instance is created and until the first value can be read. In this case, the method may block shortly. If this is a problem, the calling thread can be interrupted.
This value is computed using a filtered signal, which is configured via
setFilterCoef(float)
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.float readSync() throws java.lang.InterruptedException, ConnectionLostException
read()
, but will wait for a new sample to arrive before
returning. This is useful in conjunction with IOIO.sync()
, in cases when we want to
guarantee the we are looking at a sample that has been captured strictly after certain other
commands have been executed.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.read()
void setFilterCoef(float t) throws ConnectionLostException
t
- The time constant, in milliseconds.
ConnectionLostException
- The connection with the IOIO is lost.void waitOver(float threshold) throws ConnectionLostException, java.lang.InterruptedException
threshold
- The threshold value, in pF units.
ConnectionLostException
- The connection with the IOIO is lost.
java.lang.InterruptedException
- The calling thread has been interrupted.void waitOverSync(float threshold) throws ConnectionLostException, java.lang.InterruptedException
#waitOver()
, but will wait for a new sample to arrive before
returning. This is useful in conjunction with IOIO.sync()
, in cases when we want to
guarantee the we are looking at a sample that has been captured strictly after certain other
commands have been executed.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.#waitOver()
void waitUnder(float threshold) throws ConnectionLostException, java.lang.InterruptedException
threshold
- The threshold value, in pF units.
ConnectionLostException
- The connection with the IOIO is lost.
java.lang.InterruptedException
- The calling thread has been interrupted.void waitUnderSync(float threshold) throws ConnectionLostException, java.lang.InterruptedException
#waitUnder()
, but will wait for a new sample to arrive before
returning. This is useful in conjunction with IOIO.sync()
, in cases when we want to
guarantee the we are looking at a sample that has been captured strictly after certain other
commands have been executed.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.#waitUnder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


{% extends '../staticpages/navbar.html' %} {% block content %} {% load staticfiles %}
Here's a list of all your subjects. Click one of the to view the available documents for that subject.


Ready to Support?
Choose the plan you like
$
30
NEWBIE
You can get everything essential.
Choose
$
50
MASTER
Including everything from Newbie with complimentary drink and roundtrip transportation!
Choose
SOLD OUT SOOOOON!
Are you sure?
×
Yes
No


The success of the web is deeply rooted in the protocol that drives the web: HTTP. HTTP over TCP is by its very nature stateless, which means that inherently the web is also stateless. While this very aspect is one of the dominating factors for why the web has become such a popular medium, it also causes an interesting problem for developers that want to use the web as an application platform.
The act of interacting with a web application is typically defined by the sum of all requests sent to a web server. Since there can be many consumers being served simultaneously, the application must decide which requests belong to which consumer. These requests are typically known as a “session”.
In PHP, the session problem is solved by the session extension which utilizes some state tracking, typically cookies, and some form of local storage which is exposed via the $_SESSION superglobal. In Zend Framework, the component Zend_Session adds value to the PHP session extension making it easier to use and depend on inside object-oriented applications.
The Zend_Session component is both a session manager as well as an API for storing data into a session object for long-term persistence. The Zend_Session API is for managing the options and behavior of a session, like options, starting and stopping a session, whereas Zend\Session\Namespace is the actual object used to store data.
While its generally good practice to start a session inside a bootstrap process, this is generally not necessary as all sessions will be automatically started upon the first creation of a Zend\Session\Namespace object.
Zend_Application is capable of configuring Zend_Session for you as part of the Zend\Application\Resource system. To use this, assuming your project uses Zend_Application to bootstrap, you would add the following code to your application.ini file:
1 2 3 | resources.session.save_path = APPLICATION_PATH "/../data/session"
resources.session.use_only_cookies = true
resources.session.remember_me_seconds = 864000
|
As you can see, the options passed in are the same options that you’d expect to find in the ext/session extension in PHP. Those options setup the path to the session files where data will be stored within the project. Since INI files can additionally use constants, the above will use the APPLICATION_PATH constant and relatively point to a data session directory.
Most Zend Framework components that use sessions need nothing more to use Zend_Session. At this point, you an either use a component that consumes Zend_Session, or start storing your own data inside a session with Zend\Session\Namespace.
Zend\Session\Namespace is a simple class that proxies data via an easy to use API into the Zend_Session managed $_SESSION superglobal. The reason it is called Zend\Session\Namespace is that it effectively namespaces the data inside $_SESSION, thus allowing multiple components and objects to safely store and retrieve data. In the following code, we’ll explore how to build a simple session incrementing counter, starting at 1000 and resetting itself after 1999.
1 2 3 4 5 6 7 8 9 10 11 | $mysession = new Zend\Session\Namespace('mysession');
if (!isset($mysession->counter)) {
$mysession->counter = 1000;
} else {
$mysession->counter++;
}
if ($mysession->counter > 1999) {
unset($mysession->counter);
}
|
As you can see above, the session namespace object uses the magic __get, __set, __isset, and __unset to allow you to seamlessly and fluently interact with the session. The information stored in the above example is stored at $_SESSION[‘mysession’][‘counter’].
Additionally, if you wanted to use the DbTable save handler for Zend_Session, you’d add the following code to your application.ini:
1 2 3 4 5 6 7 8 9 10 11 | resources.session.saveHandler.class = "Zend\Session\SaveHandler\DbTable"
resources.session.saveHandler.options.name = "session"
resources.session.saveHandler.options.primary.session_id = "session_id"
resources.session.saveHandler.options.primary.save_path = "save_path"
resources.session.saveHandler.options.primary.name = "name"
resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId"
resources.session.saveHandler.options.primaryAssignment.sessionSavePath = "sessionSavePath"
resources.session.saveHandler.options.primaryAssignment.sessionName = "sessionName"
resources.session.saveHandler.options.modifiedColumn = "modified"
resources.session.saveHandler.options.dataColumn = "session_data"
resources.session.saveHandler.options.lifetimeColumn = "lifetime"
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.


21 UK stocks in danger from a Labour election win
by Joe CurtisThe Labour party today announced it will nationalise parts of BT if it wins power in December’s General Election.
The party would nationalise the telecoms giant’s Openreach fibre rollout arm in a bid to create a UK-wide network owned by the government.
Read more: BT chief executive warns Labour’s part-nationalisation would cost £100bn
Shadow chancellor John McDonnell and Labour leader Jeremy Corbyn today unveiled the £20bn plan to deliver free full-fibre broadband to every house and business in the UK by 2030.
BT warned the plan could cost up to £100bn.
The telecoms firm has also warned that pensions and savings could be hit by such a move and called on Labour to consider the impact on shareholders.
BT’s share price dropped just 2.5 per cent this morning as the latest polling data suggested it’s very unlikely Labour will win a majority.
In fact, the latest polls give the Conservative Party a strong advantage while a top pollster yesterday ruled out a Labour majority.
As well as Labour’s plans to nationalise part of BT – spelling trouble for other telecoms providers – the party also has plans to target UK banks, rail firms, utilities, defence and outsourcing companies.
Analysts have valued the regulated asset values of water and energy networks potentially facing nationalisation at around £125bn, according to Reuters.
Meanwhile, banks are usually exposed to uncertainty around the UK economy, but their stocks face a drop under Labour, which has said it plans to nationalise banks.
Plenty of the FTSE 350’s biggest stocks could suffer if Labour pulls off an election win on 12 December and carries out its plan to nationalise many of the UK’s biggest assets, much to the concern of investors.
Here is a list of the UK stocks that could be affected by a Labour election win.
| UK stock | Share Price (as of 15 November) |
| BT | 190.14p |
| Lloyds | 58.08p |
| National Grid | 889.7p |
| Royal Bank of Scotland | 219.8p |
| BAE Systems | 569.6p |
| SSE | 1,295.5p |
| United Utilities | 860.2p |
| Severn Trent | 2,276p |
| Pennon | 904p |
| Virgin Money UK | 134.6p |
| Babcock | 510.8p |
| Close Brothers | 1,435p |
| Royal Mail | 225.5p |
| Capita | 154.8p |
| Qinetiq | 342.2p |
| Serco | 156p |
| Ultra Electronics | 2,130p |
| Metro Bank | 209.8p |
| Go Ahead | 2,056p |
| National Express | 447p |
| First Group | 110.3p |
Of course, if Labour does win the General Election, critics have said its nationalisation plans could prove very difficult.
Read more: Labour’s BT plans force Talk Talk to pause sale of fibrenation
The Confederation of British Industry has said it would cost the UK around £200bn to nationalise utilities. This would add to the country’s debt levels and come with costs to pensioners and savers.
Britain’s leading business lobby group, which represents some of the companies under threat of being put into state ownership under a Labour government, said plans to take control of the rail network, utilities and Royal Mail would cost £196bn if investors were paid a premium to sell their assets to the state.


--- layout: post title: N70 Java behaviour date: 2005-11-14 00:00:00 categories: interfaces-&-interaction mobile software-development ---
I just upgraded to a Nokia N70 yesterday. Is it me, or does pressing the red STOP key when you're running a Java app kill said app? It used to be that this would place it into the background where it would continue running - nowadays you can only background such an app by manually switching back to "phone" using the menu key.
Slightly annoying if so. We've done a couple of Java apps this year that benefit from being run in-the-background...
Other impressions of the phone:
Camera and image management are both more complicated, and the keypad shortcodes I used to use ("1" to activate night mode, etc.) no longer work. Not sure why - it's not like those keys are used for anything else instead.
The gallery app is awful. I *loved* the old "image viewer" on my 6680, it made scanning through pictures a joy (using full-screen mode). The current gallery seems to insist that I set up a slideshow and choose some accompanying music before I can view my pictures - yuck.
The Orange-supplied icons are too spindly, not solid and clear enough.
Fonts are weird, particularly in J2ME and the browser.
The handset seems faster, and memory issues on the 6680 (made worse by Orange Homescreen and iSync Agent) don't seem to have recurred yet, I appear to have about 30mb of RAM to play with which should keep the pressure off for a while.


Rutgers University Bar Specials
Bar = {{barsAr[0].name}}
Address = {{barsAr[0].address}} {{barsAr[0].zip}}
Special = {{specialsAr[0].special}}
Price = ${{specialsAr[0].price}}
Special = {{specialsAr[1].special}}
Price = ${{specialsAr[1].price}}
Tuesday's Deals:
Bar = {{barsAr[5].name}}
Address = {{barsAr[5].address}} {{barsAr[5].zip}}
Special = {{specialsAr[9].special}}
Price = ${{specialsAr[9].price}}
Wednesday's Deals:
Bar = {{barsAr[4].name}}
Address = {{barsAr[4].address}} {{barsAr[4].zip}}
Special = {{specialsAr[3].special}}
Price = ${{specialsAr[3].price}}
Bar = {{barsAr[5].name}}
Address = {{barsAr[5].address}} {{barsAr[5].zip}}
Special = {{specialsAr[14].special}}
Price = ${{specialsAr[14].price}}
Thursday's Deals:
Bar = {{barsAr[0].name}}
Address = {{barsAr[0].address}} {{barsAr[0].zip}}
Special = {{specialsAr[10].special}}
Price = ${{specialsAr[10].price}}
Friday's Deals:
Bar = {{barsAr[6].name}}
Address = {{barsAr[6].address}} {{barsAr[6].zip}}
Special = {{specialsAr[2].special}}
Price = ${{specialsAr[2].price}}
Bar = {{barsAr[2].name}}
Address = {{barsAr[2].address}} {{barsAr[2].zip}}
Special = {{specialsAr[6].special}}
Price = ${{specialsAr[6].price}}
Bar = {{barsAr[1].name}}
Address = {{barsAr[1].address}} {{barsAr[1].zip}}
Special = {{specialsAr[7].special}}
Price = ${{specialsAr[7].price}}
Special = {{specialsAr[8].special}}
Price =${{specialsAr[8].price}}
Bar = {{barsAr[5].name}}
Address = {{barsAr[5].address}} {{barsAr[5].zip}}
Special = {{specialsAr[11].special}}
Price = ${{specialsAr[11].price}}
Saturday's Deals:
Bar = {{barsAr[3].name}}
Address = {{barsAr[3].address}} {{barsAr[3].zip}}
Special = {{specialsAr[4].special}}
Price = ${{specialsAr[4].price}}
Bar = {{barsAr[1].name}}
Address = {{barsAr[1].address}} {{barsAr[1].zip}}
Special = {{specialsAr[12].special}}
Price = ${{specialsAr[12].price}}
Bar = {{barsAr[6].name}}
Address = {{barsAr[6].address}} {{barsAr[6].zip}}
Special = {{specialsAr[13].special}}
Price = ${{specialsAr[13].price}}
Sunday's Deals:
Bar = {{barsAr[2].name}}
Address = {{barsAr[2].address}} {{barsAr[2].zip}}
Special = {{specialsAr[6].special}}
Price = ${{specialsAr[6].price}}


Alabama star Tua Tagovailoa set for hip surgery in Houston | Honolulu Star-Advertiser
TUSCALOOSA, Ala. >> Alabama quarterback Tua Tagovailoa is scheduled to have hip surgery in Houston.
Team surgeon Dr. Lyle Cain said in a statement today that Tagovailoa will have surgery on his dislocated right hip Monday. An Alabama spokesman declined to disclose where the Saint Louis alum was having the surgery citing privacy reasons.
Cain says the medical team “consulted with multiple orthopedic experts across the country, who specialize in hip injuries and surgeries.” He reiterated that they expect Tagovailoa to make a full recovery.
The fifth-ranked Crimson Tide’s star, a potential top pick in April’s NFL draft, was injured while being dragged down by two defenders late in the first half of Saturday’s 38-7 win over Mississippi State.
Tagovailoa had been nursing an ankle injury and Alabama was considering holding him out of this game. Defensive linemen Phidarian Mathis and Raekwon Davis posted a picture with a smiling Tagovailoa in his hospital bed Sunday.
He passed for 418 yards and four touchdowns in a loss to No. 1 LSU less than three weeks after right ankle surgery.


|
Bitshares-Core
3.0.0
BitShares blockchain implementation and command-line interface software
|
BitShares Core is the BitShares blockchain implementation and command-line interface. The web wallet is BitShares UI.
Visit BitShares.org to learn about BitShares and join the community at BitSharesTalk.org.
Information for developers can be found in the Bitshares Developer Portal. Users interested in how bitshares works can go to the BitShares Documentation site.
For security issues and bug bounty program please visit Hack the DEX.
Build instructions and additional documentation are available in the wiki.
We recommend building on Ubuntu 16.04 LTS (64-bit)
Build Dependencies:
sudo apt-get update sudo apt-get install autoconf cmake make automake libtool git libboost-all-dev libssl-dev g++ libcurl4-openssl-dev
Build Script:
git clone https://github.com/bitshares/bitshares-core.git cd bitshares-core git checkout master # may substitute "master" with current release tag git submodule update --init --recursive cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . make
Upgrade Script (prepend to the Build Script above if you built a prior release):
git remote set-url origin https://github.com/bitshares/bitshares-core.git git checkout master git remote set-head origin --auto git pull git submodule update --init --recursive # this command may fail git submodule sync --recursive git submodule update --init --recursive
NOTE: Versions of Boost 1.57 through 1.69 are supported. Newer versions may work, but have not been tested. If your system came pre-installed with a version of Boost that you do not wish to use, you may manually build your preferred version and use it with BitShares by specifying it on the CMake command line.
Example: cmake -DBOOST_ROOT=/path/to/boost .
NOTE: BitShares requires a 64-bit operating system to build, and will not build on a 32-bit OS.
NOTE: BitShares now supports Ubuntu 18.04 LTS
NOTE: BitShares now supports OpenSSL 1.1.0
After Building, the witness_node
can be launched with:
./programs/witness_node/witness_node
The node will automatically create a data directory including a config file. It may take several hours to fully synchronize the blockchain. After syncing, you can exit the node using Ctrl+C and setup the command-line wallet by editing witness_node_data_dir/config.ini
as follows:
rpc-endpoint = <IP_ADDRESS>:8090
IMPORTANT: By default the witness node will start in reduced memory mode by using some of the commands detailed in Memory reduction for nodes. In order to run a full node with all the account history you need to remove partial-operations
and max-ops-per-account
from your config file. Please note that currently(2018-10-17) a full node will need more than 160GB of RAM to operate and required memory is growing fast. Consider the following table as minimal requirements before running a node:
| Default | Full | Minimal | ElasticSearch |
|---|---|---|---|
| 100G HDD, 16G RAM | 640G SSD, 64G RAM * | 80G HDD, 4G RAM | 500G SSD, 32G RAM |
After starting the witness node again, in a separate terminal you can run:
./programs/cli_wallet/cli_wallet
Set your inital password:
>>> set_password <PASSWORD> >>> unlock <PASSWORD>
To import your initial balance:
>>> import_balance <ACCOUNT NAME> [<WIF_KEY>] true
If you send private keys over this connection, rpc-endpoint
should be bound to localhost for security.
Use help
to see all available wallet commands. Source definition and listing of all commands is available here.
Technical support is available in the BitSharesTalk technical support subforum.
BitShares Core bugs can be reported directly to the issue tracker.
BitShares UI bugs should be reported to the UI issue tracker
Up to date online Doxygen documentation can be found at Doxygen
We provide several different API's. Each API has its own ID. When running witness_node
, initially two API's are available: API 0 provides read-only access to the database, while API 1 is used to login and gain access to additional, restricted API's.
Here is an example using wscat
package from npm
for websockets:
$ npm install -g wscat $ wscat -c ws://<IP_ADDRESS>:8090 > {"id":1, "method":"call", "params":[0,"get_accounts",[["1.2.0"]]]} < {"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}
We can do the same thing using an HTTP client such as curl
for API's which do not require login or other session state:
$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts", [["1.2.0"]]], "id": 1}' http://<IP_ADDRESS>:8090/rpc {"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}
API 0 is accessible using regular JSON-RPC:
$ curl --data '{"jsonrpc": "2.0", "method": "get_accounts", "params": [["1.2.0"]], "id": 1}' http://<IP_ADDRESS>:8090/rpc
You can restrict API's to particular users by specifying an api-access
file in config.ini
or by using the --api-access /full/path/to/api-access.json
startup node command. Here is an example api-access
file which allows user bytemaster
with password supersecret
to access four different API's, while allowing any other user to access the three public API's necessary to use the wallet:
{ "permission_map" : [ [ "bytemaster", { "password_hash_b64" : "9e9GF7ooXVb9k4BoSfNIPTelXeGOZ5DrgOYMj94elaY=", "password_salt_b64" : "INDdM6iCi/8=", "allowed_apis" : ["database_api", "network_broadcast_api", "history_api", "network_node_api"] } ], [ "*", { "password_hash_b64" : "*", "password_salt_b64" : "*", "allowed_apis" : ["database_api", "network_broadcast_api", "history_api"] } ] ] }
Passwords are stored in base64
as salted sha256
hashes. A simple Python script, saltpass.py
is avaliable to obtain hash and salt values from a password. A single asterisk "*"
may be specified as username or password hash to accept any value.
With the above configuration, here is an example of how to call add_node
from the network_node
API:
{"id":1, "method":"call", "params":[1,"login",["bytemaster", "supersecret"]]} {"id":2, "method":"call", "params":[1,"network_node",[]]} {"id":3, "method":"call", "params":[2,"add_node",["<IP_ADDRESS>:9090"]]}
Note, the call to network_node
is necessary to obtain the correct API identifier for the network API. It is not guaranteed that the network API identifier will always be 2
.
Since the network_node
API requires login, it is only accessible over the websocket RPC. Our doxygen
documentation contains the most up-to-date information about API's for the witness node and the wallet. If you want information which is not available from an API, it might be available from the database; it is fairly simple to write API methods to expose database methods.
Is there a way to generate help with parameter names and method descriptions?
Yes. Documentation of the code base, including APIs, can be generated using Doxygen. Simply run doxygen
in this directory.
If both Doxygen and perl are available in your build environment, the CLI wallet's help
and gethelp
commands will display help generated from the doxygen documentation.
If your CLI wallet's help
command displays descriptions without parameter names like signed_transaction transfer(string, string, string, string, string, bool)
it means CMake was unable to find Doxygen or perl during configuration. If found, the output should look like this: signed_transaction transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast)
Is there a way to allow external program to drive cli_wallet
via websocket, JSONRPC, or HTTP?
Yes. External programs may connect to the CLI wallet and make its calls over a websockets API. To do this, run the wallet in server mode, i.e. cli_wallet -s "<IP_ADDRESS>:9999"
and then have the external program connect to it over the specified port (in this example, port 9999).
Is there a way to access methods which require login over HTTP?
No. Login is inherently a stateful process (logging in changes what the server will do for certain requests, that's kind of the point of having it). If you need to track state across HTTP RPC calls, you must maintain a session across multiple connections. This is a famous source of security vulnerabilities for HTTP applications. Additionally, HTTP is not really designed for "server push" notifications, and we would have to figure out a way to queue notifications for a polling client.
Websockets solves all these problems. If you need to access Graphene's stateful methods, you need to use Websockets.
What is the meaning of a.b.c
numbers?
The first number specifies the space. Space 1 is for protocol objects, 2 is for implementation objects. Protocol space objects can appear on the wire, for example in the binary form of transactions. Implementation space objects cannot appear on the wire and solely exist for implementation purposes, such as optimization or internal bookkeeping.
The second number specifies the type. The type of the object determines what fields it has. For a complete list of type ID's, see enum object_type
and enum impl_object_type
in types.hpp.
The third number specifies the instance. The instance of the object is different for each individual object.
The answer to the previous question was really confusing. Can you make it clearer?
All account ID's are of the form 1.2.x
. If you were the 9735th account to be registered, your account's ID will be 1.2.9735
. Account 0
is special (it's the "committee account," which is controlled by the committee members and has a few abilities and restrictions other accounts do not).
All asset ID's are of the form 1.3.x
. If you were the 29th asset to be registered, your asset's ID will be 1.3.29
. Asset 0
is special (it's BTS, which is considered the "core asset").
The first and second number together identify the kind of thing you're talking about (1.2
for accounts, 1.3
for assets). The third number identifies the particular thing.
How do I get the network_add_nodes
command to work? Why is it so complicated?
You need to follow the instructions in the "Accessing restricted API's" section to allow a username/password access to the network_node
API. Then you need to pass the username/password to the cli_wallet
on the command line or in a config file.
It's set up this way so that the default configuration is secure even if the RPC port is publicly accessible. It's fine if your witness_node
allows the general public to query the database or broadcast transactions (in fact, this is how the hosted web UI works). It's less fine if your witness_node
allows the general public to control which p2p nodes it's connecting to. Therefore the API to add p2p connections needs to be set up with proper access controls.
BitShares Core is under the MIT license. See LICENSE for more information.


These are pictures of the plants that I've grown, had in my house, or seen and loved. I think that plants and flowers can add a lot of personality and life into a room.


HTTP request logger middleware for node.js
Named after Dexter, a show you should not watch until completion.
This is a Node.js module available
through the npm registry.
Installation is done using the
npm install
command:
Create a new morgan logger middleware function using the given
format
and options
. The
format
argument may be a string of a predefined name (see
below for the names), a string of a format string, or a function that will
produce a log entry.
The format
function will be called with three arguments
tokens
, req
, and res
, where
tokens
is an object with all defined tokens,
req
is the HTTP request and res
is the HTTP
response. The function is expected to return a string that will be the log
line, or undefined
/ null
to skip logging.
morgan(function (tokens, req, res) {
return [
tokens.method(req, res),
tokens.url(req, res),
tokens.status(req, res),
tokens.res(req, res, 'content-length'), '-',
tokens['response-time'](req, res), 'ms'
].join(' ')
})
Morgan accepts these properties in the options object.
Write log line on request instead of response. This means that a requests will be logged even if the server crashes, but data from the response (like the response code, content length, etc.) cannot be logged.
Function to determine if logging is skipped, defaults to
false
. This function will be called as
skip(req, res)
.
// EXAMPLE: only log error responses
morgan('combined', {
skip: function (req, res) { return res.statusCode < 400 }
})
Output stream for writing log lines, defaults to
process.stdout
.
There are various pre-defined formats provided:
Standard Apache combined log output.
:remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"
Standard Apache common log output.
:remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]
Concise output colored by response status for development use. The
:status
token will be colored green for success codes, red
for server error codes, yellow for client error codes, cyan for
redirection codes, and uncolored for information codes.
:method :url :status :response-time ms - :res[content-length]
Shorter than default, also including response time.
:remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms
The minimal output.
:method :url :status :res[content-length] - :response-time ms
To define a token, simply invoke morgan.token()
with the name
and a callback function. This callback function is expected to return a
string value. The value returned is then available as “:type” in this
case:
Calling morgan.token()
using the same name as an existing
token will overwrite that token definition.
The token function is expected to be called with the arguments
req
and res
, representing the HTTP request and
HTTP response. Additionally, the token can accept further arguments of
it’s choosing to customize behavior.
The current date and time in UTC. The available formats are:
clf
for the common log format ("10/Oct/2000:13:55:36 +0000"
)
iso
for the common ISO 8601 date time format
(2000-10-10T13:55:36.000Z
)
web
for the common RFC 1123 date time format (Tue, 10 Oct 2000 13:55:36 GMT
)
If no format is given, then the default is web
.
The HTTP version of the request.
The HTTP method of the request.
The Referrer header of the request. This will use the standard mis-spelled Referer header if exists, otherwise Referrer.
The remote address of the request. This will use req.ip
,
otherwise the standard req.connection.remoteAddress
value
(socket address).
The user authenticated as part of Basic auth for the request.
The given header
of the request. If the header is not
present, the value will be displayed as "-"
in the log.
The given header
of the response. If the header is not
present, the value will be displayed as "-"
in the log.
The time between the request coming into morgan
and when the
response headers are written, in milliseconds.
The digits
argument is a number that specifies the number of
digits to include on the number, defaulting to 3
, which
provides microsecond precision.
The status code of the response.
If the request/response cycle completes before a response was sent to the
client (for example, the TCP socket closed prematurely by a client
aborting the request), then the status will be empty (displayed as
"-"
in the log).
The time between the request coming into morgan
and when the
response has finished being written out to the connection, in
milliseconds.
The digits
argument is a number that specifies the number of
digits to include on the number, defaulting to 3
, which
provides microsecond precision.
The URL of the request. This will use req.originalUrl
if
exists, otherwise req.url
.
The contents of the User-Agent header of the request.
Compile a format string into a format
function for use by
morgan
. A format string is a string that represents a single
log line and can utilize token syntax. Tokens are references by
:token-name
. If tokens accept arguments, they can be passed
using []
, for example: :token-name[pretty]
would
pass the string 'pretty'
as an argument to the token
token-name
.
The function returned from morgan.compile
takes three
arguments tokens
, req
, and res
,
where tokens
is object with all defined tokens,
req
is the HTTP request and res
is the HTTP
response. The function will return a string that will be the log line, or
undefined
/ null
to skip logging.
Normally formats are defined using
morgan.format(name, format)
, but for certain advanced uses,
this compile function is directly available.
Sample app that will log all request in the Apache combined format to STDOUT
var express = require('express')
var morgan = require('morgan')
var app = express()
app.use(morgan('combined'))
app.get('/', function (req, res) {
res.send('hello, world!')
})
Sample app that will log all request in the Apache combined format to STDOUT
var finalhandler = require('finalhandler')
var http = require('http')
var morgan = require('morgan')
// create "middleware"
var logger = morgan('combined')
http.createServer(function (req, res) {
var done = finalhandler(req, res)
logger(req, res, function (err) {
if (err) return done(err)
// respond to request
res.setHeader('content-type', 'text/plain')
res.end('hello, world!')
})
})
Sample app that will log all requests in the Apache combined format to the
file access.log
.
var express = require('express')
var fs = require('fs')
var morgan = require('morgan')
var path = require('path')
var app = express()
// create a write stream (in append mode)
var accessLogStream = fs.createWriteStream(path.join(__dirname, 'access.log'), { flags: 'a' })
// setup the logger
app.use(morgan('combined', { stream: accessLogStream }))
app.get('/', function (req, res) {
res.send('hello, world!')
})
Sample app that will log all requests in the Apache combined format to one
log file per day in the log/
directory using the
rotating-file-stream module.
var express = require('express')
var morgan = require('morgan')
var path = require('path')
var rfs = require('rotating-file-stream') // version 2.x
var app = express()
// create a rotating write stream
var accessLogStream = rfs.createStream('access.log', {
interval: '1d', // rotate daily
path: path.join(__dirname, 'log')
})
// setup the logger
app.use(morgan('combined', { stream: accessLogStream }))
app.get('/', function (req, res) {
res.send('hello, world!')
})
The morgan
middleware can be used as many times as needed,
enabling combinations like:
Sample app that will log all requests to a file using Apache format, but error responses are logged to the console:
var express = require('express')
var fs = require('fs')
var morgan = require('morgan')
var path = require('path')
var app = express()
// log only 4xx and 5xx responses to console
app.use(morgan('dev', {
skip: function (req, res) { return res.statusCode < 400 }
}))
// log all requests to access.log
app.use(morgan('common', {
stream: fs.createWriteStream(path.join(__dirname, 'access.log'), { flags: 'a' })
}))
app.get('/', function (req, res) {
res.send('hello, world!')
})
Sample app that will use custom token formats. This adds an ID to all
requests and displays it using the :id
token.
var express = require('express')
var morgan = require('morgan')
var uuid = require('node-uuid')
morgan.token('id', function getId (req) {
return req.id
})
var app = express()
app.use(assignId)
app.use(morgan(':id :method :url :response-time'))
app.get('/', function (req, res) {
res.send('hello, world!')
})
function assignId (req, res, next) {
req.id = uuid.v4()
next()
}


BKI000 - Broker Inquiry
Search By
Search Criteria
Name Search Parameter
Broker ID
Broker Name
IRS Tax ID
License Number
Contains
Starts With


| Previous Lecture | lect05 Before Slides | lect05 Annotated Slides | Next Lecture |
Code from lecture
https://github.com/ucsb-cs16-s18-mirza/cs16-s18-lectures/tree/master/lec-05
Topics
Intro to lab02 - ASCII Art
- Understanding what is expected
Test driven development
- Write test code and actual code side by side- so your implementation is always tested
- Start with function stubs
- Write the simplest test case and make your code pass that case
- Write another test case, expect your code to fail, see it fail, then add code to pass that test case (and the previous one).
- With every new test case, we have to make sure that all our previous tests still pass - this is a great way to make sure that things that were working before are not broken by new code!
Lesson plan
- We will start with the code that we wrote earlier for drawing shapes and testing the functions we wrote with our home grown test framework
-
Our first goal is to split our original implementation into multiple files in a way that maximizes reuse. For example we can reuse our drawTriangle and drawSquare functions to draw a house. However, this is not possible with the file structure in lecture 5. We’ll discuss why that is.
-
Once we have broken down our single cpp file into logical separate files, its time to compile the code. Our goal will be to select and combine the pieces that make a complete program
-
If we tried to compile any one file (independent of the others), we are likely to get compiler errors and linker errors. You should be able to distinguish between these two types of errors and why they occur. To understand this distinction we need to peek under the hood of the compilation process and the intermediate steps that g++ takes to create an executable (see slides for more information). You will be introduced to object files - a very important concept for later lessons.
- We will first try to compile each file separately on the command line using the g++ option -c. For example
g++ -c shapes.cpp
The above command creates the object file shapes.o
We will then look at how to link all the object files into an executable using the -o option as shown below
g++ file1.o file2.o file3.o -o finalexecuatble


--- title: Noisy student keywords: fastai sidebar: home_sidebar summary: "Callback to apply noisy student self-training (a semi-supervised learning approach) based on: Xie, Q., Luong, M. T., Hovy, E., & Le, Q. V. (2020). Self-training with noisy student improves imagenet classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 10687-10698)." description: "Callback to apply noisy student self-training (a semi-supervised learning approach) based on: Xie, Q., Luong, M. T., Hovy, E., & Le, Q. V. (2020). Self-training with noisy student improves imagenet classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 10687-10698)." nb_path: "nbs/061_callback.noisy_student.ipynb" ---
from tsai.data.all import *
from tsai.models.all import *
from tsai.tslearner import *
dsid = 'NATOPS'
X, y, splits = get_UCR_data(dsid, return_split=False)
pseudolabeled_data = X
soft_preds = True
pseudolabels = ToNumpyCategory()(y) if soft_preds else OneHot()(y)
dsets2 = TSDatasets(pseudolabeled_data, pseudolabels)
dl2 = TSDataLoader(dsets2, num_workers=0)
noisy_student_cb = NoisyStudent(dl2, bs=256, l2pl_ratio=2, verbose=True)
learn = TSClassifier(X, y, splits=splits, batch_tfms=[TSStandardize(), TSRandomSize(.5)], cbs=noisy_student_cb)
learn.fit_one_cycle(1)
pseudolabeled_data = X
soft_preds = False
pseudolabels = ToNumpyCategory()(y) if soft_preds else OneHot()(y)
dsets2 = TSDatasets(pseudolabeled_data, pseudolabels)
dl2 = TSDataLoader(dsets2, num_workers=0)
noisy_student_cb = NoisyStudent(dl2, bs=256, l2pl_ratio=2, verbose=True)
learn = TSClassifier(X, y, splits=splits, batch_tfms=[TSStandardize(), TSRandomSize(.5)], cbs=noisy_student_cb)
learn.fit_one_cycle(1)


Company profile - Canadian Company Capabilities
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Trecan Combustion Limited
Mailing Address:
4049 St Margarets Bay RdHUBLEY, Nova Scotia
B3Z 1C2
Location Address:
4049 St Margarets Bay RdHUBLEY, Nova Scotia
B3Z 1C2
Tel.:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Logo
Company Profile
Products:
Concentrators; water heaters; fume, liquid waste and solid waste incinerators (oxidizers); gas and oil burners; Snowmelters; vaporizers; air and gas heaters.
Company Description:
Trecan was established in 1962 as the Canadian subsidiary of Thermal Research, USA. In 1986 a controlling interest was purchased by MBB Mechanical Services. In 1993 MBB merged with Trecan to form MBB-Trecan. In 1996 Trecan was sold to one of the owners of MBB and renamed Trecan Combustion Limited.
Trecan specializes in the design, manufacture, installation and commissioning industrial combustion and incineration equipment and systems. The product range includes incineration systems for: medical waste; pharmaceutical waste; industrial solid waste; industrial liquid waste and fumes and waste gases; animal crematoriums; high efficiency industrial burners; Snowmelters; fired heaters; and submerged combustion
equipment. Incineration systems include waste heat recovery and flue gas scrubbers to meet local air quality regulations. The above product range was generally fairly well mixed up until the late 1980's and early 1990's. During this transition period, the demand for Snowmelters started to increase, and since the early 1990's, Snowmelters have become our main product, with stationary Snowmelter melting capacities from 20 ton/hour up to 1200 ton/hour, and portable Snowmelters ranging in melting capacity from 20 ton/hour up to 500 ton/hour.
Geographic Marketing Areas:
The firm's traditional market prior to the late 1980's has been 80% Canada, 15% USA and 5% other exports. From the late 1990's when Snowmelters became Trecan's main product, the geographic marketing area started to shift to the USA, with roughly 55% of sales, 40% in Canada, and 5% outside North America. In the last five to six years, the mix has changed to roughly 33% USA, 32% Canada, 33% Russia, and 2% China. As of late 2010, Trecan Snowmelters are working in the larger cities and airports in the snow belt of North America, and the main cities in Russia and China.
Key words:
Incinerators, oxidizers, solid waste, biomedical waste, liquid waste, fumes, VOCs, crematoriums, Snowmelters (snow melter), direct contact water heaters.
Manufacturer of Snowmelters; gas and oil burners, incinerators for medical, pathological , animal remains, general solid waste; liquid wastes; fume wastes; air heaters and gas heaters; inert gas generators; vaporizers; evaporators; direct contact water heaters.
Full profile
Full profile
Contact information
Company description
Product / Service / Licensing
Gas Heaters
Liquid Heaters
Fired Heaters
Water Heaters
Industrial Snowmelters use the submerged combustion direct contact process resulting in extremely high (95-98%) thermal transfer efficiencies resulting in lower fuel usage, lower CO2 emissions, and higher economical savings compared to other types of snow removal and assisted snow melting. Depending on the customer requirements and fuel type availability, Snowmelters utilize Natural Gas, LPG, Diesel, jet fuel, and could use hydrogen in the future when readily available.
Pathological Waste Incinerators
Animal Remains Incinerators
General Solid Waste Incinerators
Liquid Waste Incinerators
Sludge Incinerators
Fume (Gaseous) Incinerators
Waste Heat Boilers
Flue Gas Scrubbers
- Steam generators
- Fired heaters
- Reformers
- Air heaters
- Incinerators
- Snowmelters
Highway Tank and TC Portable Tanks for diesel generators, pumps, heating systems, etc.
Fuel tanks can be designed for single and multi-axle trailers and oil field/mining skids.
Market profile
Industry sector market interests:
- Agriculture
- Environment
- Manufacturing
- Medical/Biotechnology/Chemical
- Mining/Petroleum/Gas
- Transportation
Geographic markets:
Export experience:
- China
- Finland
- Georgia
- Japan
- Kazakhstan
- Poland
- Russian Federation
- Taiwan
- United States
- Alaska
- Colorado
- Illinois
- Maine
- Maryland
- Massachusetts
- Michigan
- Minnesota
- New Hampshire
- New Jersey
- New York
- North Dakota
- Ohio
- Rhode Island
- Utah
- Vermont
- Virginia
- Washington
- Wisconsin
Actively pursuing:
- Belarus
- Latvia
- Lithuania
- Norway
- Romania
- Sweden
- Ukraine
Sector information
Classification codes
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Contacts
Contact information
Description
Company description
Products, services and licensing
Product / Service / Licensing
Gas Heaters
Liquid Heaters
Fired Heaters
Water Heaters
Industrial Snowmelters use the submerged combustion direct contact process resulting in extremely high (95-98%) thermal transfer efficiencies resulting in lower fuel usage, lower CO2 emissions, and higher economical savings compared to other types of snow removal and assisted snow melting. Depending on the customer requirements and fuel type availability, Snowmelters utilize Natural Gas, LPG, Diesel, jet fuel, and could use hydrogen in the future when readily available.
Pathological Waste Incinerators
Animal Remains Incinerators
General Solid Waste Incinerators
Liquid Waste Incinerators
Sludge Incinerators
Fume (Gaseous) Incinerators
Waste Heat Boilers
Flue Gas Scrubbers
- Steam generators
- Fired heaters
- Reformers
- Air heaters
- Incinerators
- Snowmelters
Highway Tank and TC Portable Tanks for diesel generators, pumps, heating systems, etc.
Fuel tanks can be designed for single and multi-axle trailers and oil field/mining skids.
Market
Market profile
Industry sector market interests:
- Agriculture
- Environment
- Manufacturing
- Medical/Biotechnology/Chemical
- Mining/Petroleum/Gas
- Transportation
Geographic markets:
Export experience:
- China
- Finland
- Georgia
- Japan
- Kazakhstan
- Poland
- Russian Federation
- Taiwan
- United States
- Alaska
- Colorado
- Illinois
- Maine
- Maryland
- Massachusetts
- Michigan
- Minnesota
- New Hampshire
- New Jersey
- New York
- North Dakota
- Ohio
- Rhode Island
- Utah
- Vermont
- Virginia
- Washington
- Wisconsin
Actively pursuing:
- Belarus
- Latvia
- Lithuania
- Norway
- Romania
- Sweden
- Ukraine


Hey Rockstar, are you journaling right?
I used to hate journaling until I started doing it right.
Until I started writing about the things important to me, my goals.
Writing about your goals, how you are moving forward or even what is setting you back helps to keep them in the front of your mind and in your subconscious.
After few days your subconscious magically starts popping out new ideas and solutions in your head.
At LifeHQ I created 4 journal types, Year, Month, Week and Day, designed to provide different levels of perspective.
-
Year journal - Define the major goals for the year using the S.M.A.R.T. strategy. It makes them concrete, actionable and achievable.
-
Month and Week - These serve the same purpose to break down your active goals into manageable pieces. Personally I only use the Week because it is easier to predict what I can accomplish in 7 days instead of 30.
-
Day journal - (My favorite) This is the journal you use to get yourself going in the morning and to reflect on the day in the evening. Reflection is a powerful tool to notice patters of productive or unproductive behavior throughout your day. The daily journal will help you master self reflection.
All journals come with templates specifically designed for organization, productivity and overall awesomeness.
Or
If you need help with your productivity in general, shoot me an email at<EMAIL_ADDRESS>Stay productive!
Darko
Founder, LifeHQ
To unsubscribe from these emails click here.


Proposed legal settlement to aid special education students
by EndPlayCOLUMBUS, Ohio (AP) - Special education students from several Ohio school districts are expected to receive additional academic support aimed at improving learning and testing outcomes under a proposed settlement of a 28-year lawsuit.
Cleveland.com reports the proposed settlement was announced recently by Disability Rights Ohio, the Judge Bazelon Center for Mental Health Law and the Ohio Department of Education. It will impact 11 districts including Cleveland, Cincinnati and Columbus where special education students have lower academic outcomes.
A Disability Rights Ohio analysis says only 38.5% of the students in those districts learned in integrated settings with students outside of special education, compared to 65.1% in other districts. The group says research shows a correlation between such integration and special education achievement.
Special education students' parents can review and comment on the proposal.
___
Information from: cleveland.com, http://www.cleveland.com


Full
Full Row
Fluid design is fun
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
Halves
Two Columns
Many useful tips
And answers to some FAQs.
Don't use fluidLESS as it is.

Fluid design is hard.
Really hard. Don't give up. Read Fluid Grids and Responsive Web Design by Ethan Marcotte. They help a lot.
Don't set a max-width.
Or at least don't set one below 2560px. When your content starts getting too wide, use the zoomable baseline grid to make it fit a little better, or add some empty columns on the sides. The whole point of a fluid grid is to use the screen's proportions to align elements, so stick to it.
Mobile Safari causing trouble?
Does your site zoom in too much when changing orientations on an iOS device? It's because of this Mobile Safari bug.
fluidLESS actually does very little.
It’s definitely not a fully functioning framework. It’s more just a starting point. A good starting point. However, you will need to adjust it for your needs.
Serve IE6–8 just the mobile layout.
Old IE won't see any styles that are inside a media query, so just serve it your mobile layout and enhance it a little with IE-specific classes. Not having to worry about old IE makes coding the wider layouts so much easier. More about this in my blog post: Leaving Old Internet Explorer Behind.
Use box-sizing: border-box;
It lets you give the same element both a width in percentages as well as a padding in ems, which is required for the elastic gutters to work. If you followed my advice about IE6–8 above, you can use this inside media queries without worrying about browser support.
Thirds
3 Columns of stuff.
index.html
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
fluid.less
Contain the modified source of fluid.css. fluid.less is written using the LESS CSS language.
custom.less/ helpLESS
Contains the meat of the fluidLESS varibles. For easy use and management of LESS utilizing KendoUI and its style customizer.
Quarters
4 Colums. Just the way you like it.
index.html
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
Contains the required markup (namely the meta viewport tag) and a simple demo of the grid in use.
fluid.less
Contain the modified source of fluid.css. fluid.less is written using the LESS CSS language.
custom.less/ helpLESS
Contains the meat of the fluidLESS varibles. For easy use and management of LESS utilizing KendoUI and its style customizer.
fluid.js
Contains Golden Gridlet, a script that overlays the fluidLESS grid and a baseline grid of 1.5em onto the page. Can be customized around the top of the file. Powered by the Ender library.
Many useful tips
And answers to some FAQs.
Don't use fluidLESS as it is.

Fluid design is hard.
Really hard. Don't give up. Read Fluid Grids and Responsive Web Design by Ethan Marcotte. They help a lot.
Don't set a max-width.
Or at least don't set one below 2560px. When your content starts getting too wide, use the zoomable baseline grid to make it fit a little better, or add some empty columns on the sides. The whole point of a fluid grid is to use the screen's proportions to align elements, so stick to it.
Mobile Safari causing trouble?
Does your site zoom in too much when changing orientations on an iOS device? It's because of this Mobile Safari bug.
fluidLESS actually does very little.
It’s definitely not a fully functioning framework. It’s more just a starting point. A good starting point. However, you will need to adjust it for your needs.
Serve IE6–8 just the mobile layout.
Old IE won't see any styles that are inside a media query, so just serve it your mobile layout and enhance it a little with IE-specific classes. Not having to worry about old IE makes coding the wider layouts so much easier. More about this in my blog post: Leaving Old Internet Explorer Behind.
Use box-sizing: border-box;
It lets you give the same element both a width in percentages as well as a padding in ems, which is required for the elastic gutters to work. If you followed my advice about IE6–8 above, you can use this inside media queries without worrying about browser support.


An interaction is the information that describes the relation
between genotypes, phenotypes and micronutrients.
Where can I save micronutrients?
Under study information you can save the interaction that is investigated in the paper,
using the Micronutrient field. When you click in this field, all known micronutrients
in the database are shown.
Where can I see my studies?
Click Browse on top of the page to see all interactions, grouped by study.
If you want a specific study, you can use the search bar on the upper right
of the page, and search for author, year of publication or paper title.
How can I search for an interactions with a certain gene?
The most direct is to use the search bar on the upper right, and
type the gene name you are looking for. The result page gives an
overview of all the interactions where the gene is found, grouped
by study. For a more specific search use the Advanced Search, where
you can define for which fields you want to search in more detail.
What is minimal information to save a study?
The minimal required information to save a study are required fields
for study details, indicated by * in the interface. You can quit the
study and add more information later on.
To save an interaction, any combination of genotype, phenotype and/or
linked health outcome is possible. Following this, for genotypes a
gene name is required, for phenotypes a phenotype name, and for ratios
a statistical model.
What is a genotype?
A genotype is the genetic makeup of an individual or organism. To save a
genotype in this database minimal required is a gene name. Since this
database is mainly on genetic variations (SNPs), additional information
on SNPs and alleles can also be stored.
What is a phenotype?
In this database a phenotype resembles any observable character, trait or
biological property involved in the study you want to store. This can be
BMI, plasma concentrations, saturation values or bio-activity data. This
data can be saved as measured values or ratios.
Not all fields from interaction are table, where can I see them?
Note that all fields are visible when you view the whole study. However,
when you add an interaction, only a few fields are visible in the summary
fields (after clicking OK). Also on the Browse page only the most important
fields for an interaction are shown.
For example, if you fill in Intake data for a phenotype, this field is only
visible in the study view: Click Browse, search for your study, and click
on the StudyID (first column) to view the whole study.


Code of Conduct
The Sydney Data Engineering meetup (SDE) is dedicated to providing a harassment-free community for everyone, regardless of sex, gender identity or expression, sexual orientation, disability, physical appearance, age, body size, race, nationality, or religious beliefs. We do not tolerate harassment of community members in any form. Participants violating these rules may be sanctioned or expelled from the community at the discretion of the SDE organisers.
 Sexual language and imagery is not appropriate for any SDE event or communication channel.
Community members are not to use Sydney Data Engineering meetings or communication channels in order to proposition any other member.
Community members asked to stop any harassing behaviour are expected to comply immediately. Sponsors and presenters are also subject to the anti-harassment policy.
If a community member engages in harassing behaviour, the SDE organisers may take any action they deem appropriate, including warning the offender or expulsion from the SDE community. If you are being harassed please contact a SDE organiser immediately. If you notice that someone else is being harassed please intercede or contact a SDE organiser immediately. If you have any other concerns, please contact a SDE organiser.
##Contact Info
Website: https://sydneydataengineers.github.io/
Email<EMAIL_ADDRESS>If you have questions or feedback about this Code of Conduct please contact one of the organisers.


Service that makes an element apply theming related classes to itself.
| Parameter | Type | Description |
|---|---|---|
element
element
|
element |
to apply theming to |
$mdTheming.registered(themeName);
Determine is specified theme name is a valid, registered theme
| Parameter | Type | Description |
|---|---|---|
* themeName
string
|
string |
the theme to check if registered |
| Returns | Description |
|---|---|
boolean |
whether the theme is registered or not |
$mdTheming.defaultTheme();
Returns the default theme
| Returns | Description |
|---|---|
string |
The default theme |
$mdTheming.generateTheme(name);
Lazy generate themes - by default, every theme is generated when defined.
You can disable this in the configuration section using the
$mdThemingProvider.generateThemesOnDemand(true);
The theme name that is passed in must match the name of the theme that was defined as part of the configuration block.
| Parameter | Type | Description |
|---|---|---|
* name
string
|
string |
theme name to generate |
$mdTheming.setBrowserColor(options);
Sets browser header coloring for more info please visit: https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color
The default color is 800
from primary
palette of the default
theme
options are:
theme
- A defined theme via $mdThemeProvider
to use the palettes from. Default is default
theme.
palette
- Can be any one of the basic material design palettes, extended defined palettes and 'primary',
'accent', 'background' and 'warn'. Default is primary
hue
- The hue from the selected palette. Default is 800
| Parameter | Type | Description |
|---|---|---|
* options
Object
|
Object |
Options object for the browser color |
| Returns | Description |
|---|---|
Function |
remove function of the browser color |
$mdTheming.defineTheme(name, options);
Dynamically define a theme by an options object
options are:
primary
- The primary palette of the theme.
accent
- The accent palette of the theme.
warn
- The warn palette of the theme.
background
- The background palette of the theme.
dark
- Indicates if it's a dark theme.
| Parameter | Type | Description |
|---|---|---|
* name
String
|
String |
Theme name to define |
* options
Object
|
Object |
Theme definition options |
| Returns | Description |
|---|---|
Promise<string> |
A resolved promise with the theme name |
$mdTheming.THEMES
Property to get all the themes defined
| Returns | Description |
|---|---|
Object |
All the themes defined with their properties |
$mdTheming.PALETTES
Property to get all the palettes defined
| Returns | Description |
|---|---|
Object |
All the palettes defined with their colors |


Ownership and control over the private key is the root of user control over all funds associated with the corresponding Bitcoin Cash address. The private key is used to create signatures that are required to spend bitcoins by proving ownership of funds used in a transaction. The private key must remain secret at all times, because revealing it to third parties is equivalent to giving them control over the bitcoins secured by that key. The private key must also be backed up and protected from accidental loss, because if it’s lost it cannot be recovered and the funds secured by it are forever lost, too.
You can withdraw the balance by importing your Honest wallet into other wallets or you can transfer the funds directly using the form below.
Your private key never leaves the browser. All transactions are signed within your browser and keys are not exposed over the internet. Do not connect wallets with bigger amounts! We recommend to generate a new wallet and transfer a small amount for the upvotes.
Beware of scams! Ensure that the domain is https://honest.cash with a secure connection.Your recovery phrase never leaves the browser. All transactions are signed within the browser and keys are not exposed over the internet. Do not connect wallets with bigger amounts! We recommend to generate a new wallet and transfer a small amount for the upvotes.
Beware of scams! Ensure that the domain is https://honest.cash with a secure connection.A private key is simply a number, picked at random. Ownership and control over the private key is the root of user control over all funds associated with the corresponding Bitcoin Cash address. The private key is used to create signatures that are required to spend bitcoins by proving ownership of funds used in a transaction. The private key must remain secret at all times, because revealing it to third parties is equivalent to giving them control over the bitcoins secured by that key. The private key must also be backed up and protected from accidental loss, because if it’s lost it cannot be recovered and the funds secured by it are forever lost, too.
Upvote content and receive tips using the private key of your existing Bitcoin Cash account.
Your private key never leaves the browser. All transactions are signed within your browser and keys are not exposed over the internet. Do not connect wallets with bigger amounts! We recommend to generate a new wallet and transfer a small amount for the upvotes. In the future we plan to reward you for finding and upvoting good content early.
Beware of scams! Ensure that the domain is https://honest.cash with a secure connection.


Creating Kotlin/JavaScript library with the Command Line Compiler
Creating a Kotlin/JavaScript library
We will create a simple Kotlin/JavaScript library.
-
Using our favorite editor, we create a new file called library.kt:
package org.sample fun factorial(n: Int): Long = if (n == 0) 1 else n * factorial(n - 1) inline fun IntRange.forOdd(f: (Int) -> Unit) { this.forEach { if (it % 2 == 1) f(it) } }
-
Compile the library using the JS compiler
$ kotlinc-js -output sample-library.js -meta-info library.kt
The
-meta-info
option indicates that an additional JS file with binary meta-information about compiled kotlin code will be created.If you want to see all available options run
$ kotlinc-js -help
After compilation we have two new files:
sample-library.js sample-library.meta.js
-
You can simply distribute two JS files,
sample-library.js
andsample-library.meta.js
. The former file contains translated JavaScript code, the latter file contains some meta-information about Kotlin code, which is needed by compiler.Alternatively, you can append the content of
sample-library.meta.js
to the end ofsample-library.js
and distribute only the resulting file.Also you can create an archive, which can be distributed as a library:
$ jar cf sample-library.jar *.js
Using a Kotlin/JavaScript library.
Create binom.kt:
import org.sample.factorial
fun binom(m: Int, n: Int): Long =
if (m < n) factorial(n) / factorial(m) / factorial(n-m) else 1
fun odd_factorial(n: Int): Long {
var result: Long = 1L
(1..n).forOdd { result = result * it }
return result
}
Compile with library:
$ kotlinc-js -output binom.js -libraries sample-library.meta.js binom.kt
Both files sample-library.js
and sample-library.meta.js
should be present in the latter case,
because translated JavaScript file contains meta-information about inlining, which
is needed by compiler.
If you have an archive sample-library.jar
, which contains sample-library.js
and sample-library.meta.js
,
you can use the following command
$ kotlinc-js -output binom.js -libraries sample-library.jar binom.kt


Coupon
Enjoy Your Discounts
Best deals across all categories
WATCH THE Deals
Product Categories
Restaurant
Bar
Cafe
Grocery
Beauty & Wellness
Home Services
Electronics
Gym
Restaurants, Cafes, Salad House and Bars
Live Without Limits
Discover infinite ways to enjoy services. Achieve a refined way with endless luxuries and food.
Discount & Coupons
Never Miss A Offer or Discount
Perfect your shopping, eating and other experiences with our application and exclusive deals having special outlet and city wise discounts that will help save your money and get best customer experience.
Discount & Coupons
Never Miss A Offer or Discount
Perfect your shopping, eating and other experiences with our application and exclusive deals having special outlet and city wise discounts that will help save your money and get best customer experience.
BEST CUSTOMER SUPPORT
Coupons & Deals
We ensure every business and brand provide the best deals to you.
Get Discounts Today
Sign up today to get exclusive deals and offers worth thousands


Exchange Container Service
Facilitates the trade execution and data collection from the specified exchange back to the Alkemi Network.
Container Data Provider:
The CDP lives within the container. This service retrieves order book information and price data from the exchange it is connected to. It feeds this data back towards the Index Service and to the TES that lives within the container.
There is two ways for data to get into the CDP. The first being a listening Rest and Websocket port that will allow the exchanges to provide data directly to the CDP in a specific format we specify. The other method being we create
outbound connections to interact with the exchanges pre existing api’s. This data is then forwarded to the Index Server and the TES.
Trade Execution Service:
The TES lives within the container and facilitates the active trading that occurs. It contains a market making algo designed to utilize the Index price we set for the market alongside the order book information to facilitate trading. The
TES is also responsible for aggregating the trade information to be sent down to the ODR (Oracle Data Relay).
Data Relay Discovery Service
This service provides and facilitates data-relay service discovery for settlement and index data replication
The DR ( Data Relay) only has one function. This function is to relay the trade completion information to the currently completed oracles and the VWap index service. This is done by using either rest or WebSockets to facilitate the data
transfer. The Oracles will connect to the DR’s to collect this information. DR’s will be created as a microservice that way we can have multiple data relays available for redundancy to the oracles.
Switchboard Service
The switch board service maintains a running whitelist for every exchange on the alkemi network and the assets that are trading on it. The switchboard is operated by the alkemi team and is adjusted and modified as exchanges join the
network. When an exchange joins the network for the first time the switch board will generate a “Auth Token” to be used by the containers when they first initiate connection with the Oracle Data Relay and the Index Service. Without a valid
auth token the container will not be allowed to connect to the services and retrieve / submit data. This token will periodically be updated to protect against leakage.
After connection the container will begin to send price data and completed order data to the oracle data relay for every market it is configured to participate in. The Oracle data relay will retrieve this data and verify against the
whitelist each asset the container is submitting data for. If the auth token isn’t allowed to send that instrument data then it will be ignored and a flag will be reported that the container is sending data it isn’t allowed to.
No automated mechanism will be in place to disable exchanges has this can cause unforeseen problems. These reports will need to be manually verified and acted on.
Once the data is verified allowed the oracle data relay passes the necessary information to the oracles and the index service


Seybold Seminars, the top education platform for the publishing industry - with a year-round community-building website, domestic and international conferences, and technical newsletters - joins forces with Silicon Graphics, Apple, S3, 3D Labs, Microsoft, Intervista and Netscape, driving forces in VRML 2.0, in presenting World Movers: The VRML 2.0 Developers' Conference.
Focused on the Moving Worlds VRML 2.0 open 3D internet standard, this event will bring together the leaders in what is referred to as the 3DWeb revolution. This emerging community includes the designers of VRML 2.0 technology and tools and the Web developers who are enhancing their content and applications with interactive 3D content. Developers are expected from a diversity of industries, including entertainment, education, engineering, and business.
World Movers will take place January 30-31, 1997, at the ANA Hotel in San Francisco.
At World Movers, Web developers can:
Attendees of the World Movers conference will be able to attend panel sessions composed of key developers in the VRML 2.0 community, visit the Demonstration Pavilion where VRML 2.0 vendors will exhibit their solutions and tools, attend keynote sessions led by VRML leaders, participate in online forums and Birds-of-a-Feather (BOF) sessions in the evening.
Enter now and see who will take the top honors for design and implementation of VRML 2.0 content at the VRML Excellence Awards.
World Movers: The VRML 2.0 Developers' Conference is hosted by Seybold Seminars, Netscape, Apple, S3, 3D Labs, Microsoft, Intervista and Silicon Graphics. You can get more information about World Movers:
By phone: 1-800-488-2883 or<PHONE_NUMBER>
By fax:<PHONE_NUMBER>
By mail: World Movers, Attn: Customer Service, 303 Vintage Park
Drive, Foster City, CA 94404.
The World Movers website will be updated regularly. Return for information on keynotes, session content, and exciting participation opportunities at World Movers.


Landing Page
Special Projects
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.
8/23/2018
As students and staff make their way back to Athens for the beginning of the new school year, The Athena Cinema will welcome them back with upcoming events to attend at one of the oldest movie theaters in the nation.
The Athena will be a part of the official Welcome Week schedule for the first time this year, and Alex Kamody thought it would be the perfect opportunity to screen a one-night-only showing of The Miseducation of Cameron Post.
“Since we work so much with the OU LGBT Center, this film just seemed like a good fit to offer students during welcome week,” Kamody, the Athena director, said.
The Miseducation of Cameron Post is about a teenage girl who is sent to a conversion therapy center that treats teens “struggling with same-sex attraction.”
“I knew we wanted to play it after seeing how popular it was at Sundance and other film festivals,” Kamody said. “The Athena specializes in showing independent films, and we really want to get those movies out to students and give them a chance to see something that’s not a Hollywood blockbuster.”
There will be a discussion following the movie where people will have a chance to talk about what they just saw and share their experiences and what was relevant to them.
“Part of the Athena’s mission is to provide a shared experience where people can have a conversation and feel a part of a community,” Kamody said.
There will be a limited number of free student tickets for the screening on a first-come, first-served basis sponsored by OU’s LGBT Center.
“We’re not sure if we should expect the movie to be a sellout, but we’re excited to see what happens,” Kamody said.
Another popular way the Athena is able to attract students and Athens residents to the movies is the annual Fall Sustainability Series. The series this fall will include six feature films and a night of short films on sustainable living.
“We strive to include international films from a global perspective on environmental issues that may allow attendees to expand their understanding and interest in the topics”Loraine McCosker
This will be the sixth year of the Fall Sustainability Series, and it will kick off Sept. 5 with Bill Nye: Science Guy.
“Many students are familiar with Nye from their childhood, so I think they’ll find this film especially engaging,” Loraine McCosker, an environmental studies instructor, said. “The film explores his passion for science and his current work to present climate science in response to climate deniers.”
McCosker and her colleague Lorraine Wochna, a subject librarian at Alden Library, want to offer films that present challenges, as well as successes, related to the environment and sustainability.
“We strive to include international films from a global perspective on environmental issues that may allow attendees to expand their understanding and interest in the topics,” McCosker said.
Both McCosker and Wochna are looking forward to the Oct. 17 screening of Farmsteaders, a film about a local Southeast Ohio dairy farm family.
“‘Farmsteaders’ is all about a family that makes cheese,” Wochna said. “I just think it’s really unique that we’ll be showing this film about local farmers that sell their cheese at Athens’ own market.”
Laurel Valley Creamery, the family business Farmsteaders is about, will also be providing a cheese tasting before the film, McCosker said.
McCosker believes the sustainability series is something important within the context of education of the students, community and others.
“Film is such a great way to teach because it’s so visual,” Wochna said. “By letting people know that this is the type of stuff that’s happening to our planet, they have the opportunity to educate themselves on what’s going on around the world.”
Landing Page
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.