Henning Diedrich - 6 Feb 2013
Running on a suitable EC2 configuration (see details below), with our new VoltDB Erlang driver we achieved 877,519 transactions per second.
I am Henning Diedrich [1], CEO of Eonblast Corporation [2] a games company. I would like to introduce the new Erlang VoltDB driver we created, a piece of software that allows two genre-defining technologies to work together: VoltDB [3] and Erlang [4].
I first came to VoltDB on the hunt for a better database for heavy duty online-game servers. I experienced first hand [5] what a pain it was to try to scale MySQL and found VoltDB [3] uniquely suitable for the requirements of more complex game worlds. Better than any other database in fact [6].
I had also looked for a better language than Java for programming servers and for that, Erlang [7] had caught my attention. To be able to use them together [8], I started creating the Erlang driver for VoltDB [9].
Work for this started three years ago and I donated a first version of the driver [10] to VoltDB at their request in 2010. It was perfectly usable but out of the box only provided for synchronous connections. In 2012 VoltDB decided to sponsor the creation of a bigger and badder version. Now the real deal has arrived [11].
The benchmark described below was made with the new, asynchronous driver. It is pure Erlang, full of parallel microprocesses, blazingly fast and fit for VoltDB 3 [12]. It builds on and incorporates almost all of the previous, robust driver version. And on my quest to ensure reliable, consistently high throughput, I was able to draw from my experience maintaining an Erlang MySQL driver, Emysql [13]. The connection pooling and call queueing is modeled after the ones used in that reliable workhorse, originally designed at Electronic Arts. They enable the Erlang driver to absorb access peaks, and to distribute load across VoltDB server nodes.
To come up with a useful benchmark script I could employ the lessons learned from the Node.js benchmark [14] I did for VoltDB a while ago. This time around I knew which numbers I would be looking for and what double checks I should have in place to put the cloud cluster to good use.
The internal structure of the driver has been implemented as would be expected: your program's microprocesses use the functions the driver exposes to send a message to a dedicated connection process, which handles the socket work. After the request is sent, the initiating process is either blocked in a synchronous receive (this, of course, does not block all your other processes) or goes on to to use its time as it pleases, should you choose the asynchronous mode. The answer from the server arrives in your processes' mailbox. (Note, synchronous in this context, when looking at the driver. The call to the VoltDB server is still an asynchronous call. The driver simply has your process wait in a receive block.)
There are many options that you can use. E.g. the monitored mode, where a worker process is created that handles the sending of the request, thereby shielding your initiating process from any hiccups in the driver. You can fire and forget, for writes where you don't care to hear that they succeeded. Or blowout if you don't even care to hear about failure.
The benchmark is based on the VoltDB voter example, which comes with every VoltDB distribution. It 'validates and stores phoned-in votes for talent show contestants'. In the original example setup, there is a web page that displays the results for illustration, updated every 400ms. You'll find it in the examples/voter
directory of your VoltDB installation.
The benchmark starts out with a preparational phase, where the database is filled with 6 contestants' names and then one million write transactions are fired towards the server, per CPU core, that each register a 'vote' for one of the contestants, picked at random. In the end, the votes won by each contestants are displayed, using a materialized view and a VoltDB ad-hoc query. (In VoltDB parlance, ad-hoc queries are normal queries that are not pre-formulated in a stored procedure.)
The benchmark source is under etc/bench [15] of the driver home directory, where you'll also find a detailed README.md that explains the multiple ways to run the benchmark and make it fit your setup. For a (slow) test run on localhost, it's basically:
$ git clone git://github.com/VoltDB/voltdb.git voltdb $ git clone git://github.com/VoltDB/voltdb-client-erlang.git erlvolt $ cd voltdb/examples/voter && ./run.sh & $ cd && cd erlvolt && make clean all bench
That should give you a screen like this:
metal:~ hd$ cd voltdb-3-com/examples/voter && ./run.sh &
[1] 10817
metal:~ hd$ Initializing VoltDB...
_ __ ____ ____ ____
| | / /___ / / /_/ __ \/ __ )
| | / / __ \/ / __/ / / / __ |
| |/ / /_/ / / /_/ /_/ / /_/ /
|___/\____/_/\__/_____/_____/
--------------------------------
Build: 3.0 voltdb-3.0-95-gfffab2b Community Edition
Connecting to VoltDB cluster as the leader...
Initializing initiator ID: 0, SiteID: 0:5
WARN: Running without redundancy (k=0) is not recommended for production use.

Start at: 2013-02-06 18:56:20 .....................
Starting: 2013-02-06 18:56:20
calls ... ..................................
cool down ...
check writes ... ok
results ... votes: 100,000 (6 contestants)
.....Edwina Burnam: 16,817
....Jessie Alloway: 16,808
...Tabatha Gehling: 16,669
.....Alana Bregman: 16,613
....Jessie Eichman: 16,556
......Kelly Clauss: 16,537
close pool ...
Client 'VSD', voter, 100,000 calls, steady, 200 workers, delay n/a, direct, queue n/a, slots n/a, limit n/a, verbose, "n/a" stats/sec
-------------------------------------------------------------------------------------------------------------------------------------
Client 'VSD' overall: 14,357 T/sec throughput, 0.00% fails, total transactions: 100,000, fails: 0, total time: 6.965sec
Erlvolt 0.3.3, bench started 2013-02-06 18:56:20, ended 2013-02-06 18:56:26, database: +100,000 new votes
[++++++++++++++]
For further instructions, e.g. how to best run the benchmark in the cloud, please see etc/bench/README.md [16], or verbatim doc/BENCHMARK-README.html, in your driver home folder.
When run on a single core (-smb +S 1), with a 12-node VoltDB server cluster listening on the other side, the Erlang driver showed throughput of 26,500 transactions per second (TPS) and more per one core. When fully utilizing a 16-core cluster instance as client node, it routinely reached throughput of 260,000 transactions per second per machine. (CPU specs see below.)
Using 8 client nodes connected to a 12-node VoltDB cluster, each client node executed an average of 109,689 transactions per second for a cluster total of 877,519 TPS.
Since this benchmark was about the driver, not the server, I made no attempts to tune the server cluster. After a lot of experimenting, I believe that the lower performance per client core for bigger server clusters would reflect the network limitations of the EC2 cloud, even for the bigger cluster instances [17] where the hope would be that a benchmark would not end up network-bound.
Part of the goal for the benchmark was testing how the driver would hold up under load and that turned out very well. The driver does not crash from really heavy overload and it copes well with 'backpressure' [18] when the server does not allow further requests for being at capacity. However, the fastest benchmarks resulted when not overloading the server.
I started a 20-node Amazon EC2 cc2.xlarge cluster broken up into 8 Erlang client and 12 VoltDB server nodes. The m3.2xlarge provide the following, as described by the Amazon EC2 Instance Types page [17]:
These nodes were configured with:
On advice from VoltDB, each of the five server nodes was set to six partitions, so I had 30 partitions across the database cluster.
This benchmark would perform the same on the free Community Edition of Volt 3.0.
The clients "firehose" the VoltDB cluster by calling Voter's vote()
stored procedure continuously. This procedure performes not only one write but, depending on how you count, 4 to 6 operations:
select
)select
)select
)insert
)On top of this, each insert
also triggers an update to two different materialized views.
Here are the actual queries that define the used stored procedures [19]:
// Checks if the vote is for a valid contestant
SELECT contestant_number FROM contestants WHERE contestant_number = ?;
// Checks if the voter has exceeded their allowed number of votes
SELECT num_votes FROM v_votes_by_phone_number WHERE phone_number = ?;
// Checks an area code to retrieve the corresponding state
SELECT state FROM area_code_state WHERE area_code = ?;
// Records a vote
INSERT INTO votes (phone_number, state, contestant_number) VALUES (?, ?, ?);
Consequently, the 877,000 TPS performed 3.5 million SQL operations per second, i.e. three selects and one insert.
The most important number from this, to my mind, is the 26,500 transactions per second per CPU core that I saw, which translates into 100,000 operations. This will allow you to make rough estimates on the amount of hardware you may need on the business server side (the VoltDB client side). Your client will usually have more work to do than simply swamp the server, as the benchmark does. So you have an upper limit here and can feel your way down from there. Note that many machines will show a significantly higher performance profile than EC2 instances.
We decided for the Amazon Elastic Cloud for the benchmark in the hopes that this would result into the most transparent setup. A local cluster of eight "bare metal" nodes would certainly perform better than the EC2 instance, and be way more economic if you used them on a daily basis. But our throughput numbers would be hard to reproduce independently.
As it is, you could try the exact same benchmark yourself, easily. VoltDB and the new driver can be downloaded from VoltDB [20]. The README.md [21] of the driver, and of the benchmark [16] have more instructions on how to use the driver and how to make benchmarks. To find experimental new versions of the driver as well as fast bug fixes, try the Eonblast Erlvolt repo at git [22]. The free VoltDB community edition is also on github [23].
[1] Author on Twitter: https://twitter.com/hdiedrich
[2] Eonblast: http://www.eonblast.com
[3] VoltDB: http://www.voltdb.com
[4] Erlang: http://www.erlang.org
[5] Deepolis: http://www.deepolis.com
[6] Choosing the Best Database For a Game: http://voltdb.com/dig-deeper/webinars.php
[7] Why Erlang? http://www.slideshare.net/eonblast/why-erlang-gdc-online-2012
[8] Erlang and VoltDB: http://www.slideshare.net/eonblast/voltdb-and-erlang-tech-planet-2012
[9] Erlvolt 0.2: https://github.com/Eonblast/Erlvolt/tree/01b304f8975c2168be105c1b9c972386264c0a4e
[10] http://blog.voltdb.com/community-contributions-erlang-client-library/
[11] Erlvolt 0.3: https://github.com/VoltDB/voltdb-client-erlang
[12] VoltDB 3: http://blog.voltdb.com/introducing-voltdb-3-0/
[13] Emysql: https://github.com/Eonblast/Emysql
[14] 695k with Node.js: http://blog.voltdb.com/695k-tps-nodejs-and-voltdb/
[15] bench.erl: https://github.com/VoltDB/voltdb-client-erlang/blob/master/etc/bench/bench.erl
[16] Bench README: https://github.com/VoltDB/voltdb-client-erlang/blob/master/etc/bench
[17] Amazon EC2 Cluster Instances: http://aws.amazon.com/ec2/instance-types/
[18] Backpressure: http://voltdb.com/docs/UsingVoltDB/DesignAppLogic.php
[19] Query Source: https://github.com/VoltDB/voltdb/blob/master/examples/voter/src/voter/procedures/Vote.java
[20] VoltDB Downloads: VoltDB http://voltdb.com/community/downloads.php
[21] Driver README: https://github.com/VoltDB/voltdb-client-erlang
[22] Erlvolt Development: https://github.com/Eonblast/Erlvolt
[23] VoltDB Community Edition: https://github.com/VoltDB/voltdb
/hd 6 feb 13


Note 1 : Recommended statistics for this type of classification highlighted in aqua
Note 2 : The recommender system assumes that the input is the result of classification over the whole data rather than just a part of it. If the confusion matrix is the result of test data classification, the recommendation is not valid.
| Actual | Predict
|
| Class | D006262 | D015212 | Description |
| ACC | 0.73571 | 0.73571 | Accuracy |
| AGF | 0.74201 | 0.7294 | Adjusted F-score |
| AGM | 0.73086 | 0.74038 | Adjusted geometric mean |
| AM | 8 | -8 | Difference between automatic and manual classification |
| AUC | 0.73571 | 0.73571 | Area under the ROC curve |
| AUCI | Good | Good | AUC value interpretation |
| AUPR | 0.73958 | 0.73204 | Area under the PR curve |
| BCD | 0.00714 | 0.00714 | Bray-Curtis dissimilarity |
| BM | 0.47143 | 0.47143 | Informedness or bookmaker informedness |
| CEN | 0.76558 | 0.77672 | Confusion entropy |
| DOR | 7.76923 | 7.76923 | Diagnostic odds ratio |
| DP | 0.49089 | 0.49089 | Discriminant power |
| DPI | Poor | Poor | Discriminant power interpretation |
| ERR | 0.26429 | 0.26429 | Error rate |
| F0.5 | 0.73324 | 0.7383 | F0.5 score |
| F1 | 0.73944 | 0.73188 | F1 score - harmonic mean of precision and sensitivity |
| F2 | 0.74574 | 0.72557 | F2 score |
| FDR | 0.27083 | 0.25735 | False discovery rate |
| FN | 70 | 78 | False negative/miss/type 2 error |
| FNR | 0.25 | 0.27857 | Miss rate or false negative rate |
| FOR | 0.25735 | 0.27083 | False omission rate |
| FP | 78 | 70 | False positive/type 1 error/false alarm |
| FPR | 0.27857 | 0.25 | Fall-out or false positive rate |
| G | 0.73951 | 0.73196 | G-measure geometric mean of precision and sensitivity |
| GI | 0.47143 | 0.47143 | Gini index |
| GM | 0.73558 | 0.73558 | G-mean geometric mean of specificity and sensitivity |
| IBA | 0.55653 | 0.52561 | Index of balanced accuracy |
| IS | 0.54432 | 0.57075 | Information score |
| J | 0.58659 | 0.57714 | Jaccard index |
| LS | 1.45833 | 1.48529 | Lift score |
| MCC | 0.47162 | 0.47162 | Matthews correlation coefficient |
| MCCI | Weak | Weak | Matthews correlation coefficient interpretation |
| MCEN | 0.93937 | 0.94705 | Modified confusion entropy |
| MK | 0.47181 | 0.47181 | Markedness |
| N | 280 | 280 | Condition negative |
| NLR | 0.34653 | 0.37143 | Negative likelihood ratio |
| NLRI | Poor | Poor | Negative likelihood ratio interpretation |
| NPV | 0.74265 | 0.72917 | Negative predictive value |
| OC | 0.75 | 0.74265 | Overlap coefficient |
| OOC | 0.73951 | 0.73196 | Otsuka-Ochiai coefficient |
| OP | 0.7163 | 0.7163 | Optimized precision |
| P | 280 | 280 | Condition positive or support |
| PLR | 2.69231 | 2.88571 | Positive likelihood ratio |
| PLRI | Poor | Poor | Positive likelihood ratio interpretation |
| POP | 560 | 560 | Population |
| PPV | 0.72917 | 0.74265 | Precision or positive predictive value |
| PRE | 0.5 | 0.5 | Prevalence |
| Q | 0.77193 | 0.77193 | Yule Q - coefficient of colligation |
| RACC | 0.25714 | 0.24286 | Random accuracy |
| RACCU | 0.25719 | 0.24291 | Random accuracy unbiased |
| TN | 202 | 210 | True negative/correct rejection |
| TNR | 0.72143 | 0.75 | Specificity or true negative rate |
| TON | 272 | 288 | Test outcome negative |
| TOP | 288 | 272 | Test outcome positive |
| TP | 210 | 202 | True positive/hit |
| TPR | 0.75 | 0.72143 | Sensitivity, recall, hit rate, or true positive rate |
| Y | 0.47143 | 0.47143 | Youden index |
| dInd | 0.3743 | 0.3743 | Distance index |
| sInd | 0.73533 | 0.73533 | Similarity index |
Generated By PyCM Version 2.4


#include <GrBSPTree.h>
Classes | |
| struct | SLightCacheEntry |
Public Types | |
| typedef std::vector< GrMeshInst * > | MeshInstVec |
Public Member Functions | |
| GrBSPTree () | |
| class GrBSPTree | |
| GrBSPTree (const UPath &fileName, UReader &reader) | |
| GrBSPTree (const GrPolygonBSPTree &polygonBSPTree, const GrPolygonUberUVMapper &mapper) | |
| ~GrBSPTree () | |
| const UPath & | GetFileName () const |
| returns the name of the file the BSP was loaded from (if any). | |
| void | SetInScene (bool inScene) |
| public methods | |
| const GrLightSet & | GetLightSet () const |
| light management. | |
| void | AddLight (URef< GrLight > light) |
| URef< GrLight > | FindLight (const char *name, int cmpLen=-1) const |
| bool | RemoveLight (const char *name) |
| bool | RemoveLight (GrLight *light) |
| const MeshInstVec & | GetMeshInsts () const |
| returns the list of all mesh instances. | |
| bool | Pick (GrMeshInst *&mesh, GrMesh::STriCollision &hit, const MRay &ray) |
| picks the scene and returns the mesh and it's hit info. | |
| void | Traverse (GrSceneTraverser *traverser) |
| traverses the BSP tree. | |
| void | Cache () |
| cache/evict meshes. | |
| void | Evict () |
| void | GetLitObjectsAndMarkVisible (GrRenderList &lightReceivers, const GrFrustum &frustum, const MVec3 &eyePos, unsigned int frameId) const |
| bool | GetLitObjects (GrRenderList &lightReceivers, GrRenderList *shadowCasters, const MSphere ®ion, unsigned int frameId) const |
| bool | GetLitObjects (GrRenderList &lightReceivers, GrRenderList *shadowCasters, const GrFrustum ®ion, unsigned int frameId) const |
| bool | GetObjectsInFrustum (GrRenderList &objects, const GrFrustum ®ion) const |
| query services. | |
| void | Load (UReader &reader) |
| load/save. | |
| void | Save (UWriter &writer) |
Definition at line 38 of file GrBSPTree.h.
| typedef std::vector< GrMeshInst* > GrBSPTree::MeshInstVec |
Definition at line 41 of file GrBSPTree.h.
| GrBSPTree::GrBSPTree | ( | ) |
Definition at line 50 of file GrBSPTree.cpp.
| GrBSPTree::GrBSPTree | ( | const GrPolygonBSPTree & | polygonBSPTree, | |
| const GrPolygonUberUVMapper & | mapper | |||
| ) |
build the BSP tree from the polygon BSP tree.
go through combined meshes and build renderable meshes.
determine a good name for the current mesh.
build a renderable mesh instance from the current combiner.
delete the current mesh combiner.
Definition at line 59 of file GrBSPTree.cpp.
| GrBSPTree::~GrBSPTree | ( | ) |
Definition at line 89 of file GrBSPTree.cpp.
Definition at line 122 of file GrBSPTree.cpp.
| void GrBSPTree::Cache | ( | ) |
| void GrBSPTree::Evict | ( | ) |
Definition at line 189 of file GrBSPTree.cpp.
Definition at line 131 of file GrBSPTree.cpp.
| const UPath& GrBSPTree::GetFileName | ( | ) | const [inline] |
returns the name of the file the BSP was loaded from (if any).
Definition at line 49 of file GrBSPTree.h.
| const GrLightSet& GrBSPTree::GetLightSet | ( | ) | const [inline] |
| bool GrBSPTree::GetLitObjects | ( | GrRenderList & | lightReceivers, | |
| GrRenderList * | shadowCasters, | |||
| const GrFrustum & | region, | |||
| unsigned int | frameId | |||
| ) | const |
if there isn't anything in the scene, then there is nothing to draw!
get the area the position lies in.
get the list of visible areas from the BSP area we're in.
only add areas that are marked as visible.
do a quick check for visibility.
if nothing lit is visible, return false.
go through all areas checking visibility with the user camera and lights volume (for shadow cast purposes).
get the current area.
check to see if the area is touched by the light.
if the area is in the light's influence, we need to check each mesh instance.
get the current mesh instance information.
go through all of the ranges in the current area.
get the mesh instance.
check to see if we're within the light's radius.
mark as visible and send to the renderer.
send the shadow caster to the renderer.
get the current area.
check to see if the area is touched by the light.
if the area is in the light's influence, we need to check each mesh instance.
get the current mesh instance information.
go through all of the ranges in the current area.
get the mesh instance.
check to see if we're within the light's radius.
Definition at line 370 of file GrBSPTree.cpp.
| bool GrBSPTree::GetLitObjects | ( | GrRenderList & | lightReceivers, | |
| GrRenderList * | shadowCasters, | |||
| const MSphere & | region, | |||
| unsigned int | frameId | |||
| ) | const |
if there isn't anything in the scene, then there is nothing to draw!
get the area the position lies in.
get the list of visible areas from the BSP area we're in.
only add areas that are marked as visible.
do a quick check for visibility.
if nothing lit is visible, return false.
go through all areas checking visibility with the user camera and lights volume (for shadow cast purposes).
get the current area.
check to see if the area is touched by the light.
if the area is in the light's influence, we need to check each mesh instance.
get the current mesh instance information.
go through all of the ranges in the current area.
get the mesh instance.
check to see if we're within the light's radius.
mark as visible and send to the renderer.
send the shadow caster to the renderer.
get the current area.
check to see if the area is touched by the light.
if the area is in the light's influence, we need to check each mesh instance.
get the current mesh instance information.
go through all of the ranges in the current area.
get the mesh instance.
check to see if we're within the light's radius.
Definition at line 258 of file GrBSPTree.cpp.
| void GrBSPTree::GetLitObjectsAndMarkVisible | ( | GrRenderList & | lightReceivers, | |
| const GrFrustum & | frustum, | |||
| const MVec3 & | eyePos, | |||
| unsigned int | frameId | |||
| ) | const |
sends all objects in the frustum to the renderer and marks them as visible. this should be called before any of the AddLitToRenderer calls.
if there isn't anything in the scene, then there is nothing to draw!
get the area the position lies in.
get the list of visible areas from the BSP area we're in.
only add areas that are marked as visible.
get the current area.
mark the current area as visible.
add the ubertexture data to the render list.
check mesh instances for visibility.
get the current mesh instance information.
go through all of the ranges in the current area.
check visibility.
mark as visible and send to the renderer.
Definition at line 198 of file GrBSPTree.cpp.
| const MeshInstVec& GrBSPTree::GetMeshInsts | ( | ) | const [inline] |
| bool GrBSPTree::GetObjectsInFrustum | ( | GrRenderList & | objects, | |
| const GrFrustum & | region | |||
| ) | const |
query services.
if there isn't anything in the scene, then there is nothing to get!
get the area the position lies in.
get the list of visible areas from the BSP area we're in.
iterate over all areas.
get the current area.
check to see if the area is touched by the light.
if the area is in the light's influence, we need to check each mesh instance.
get the current mesh instance information.
go through all of the ranges in the current area.
get the mesh instance.
check to see if we're within the light's radius.
Definition at line 482 of file GrBSPTree.cpp.
| void GrBSPTree::Load | ( | UReader & | reader | ) |
load/save.
read in the meshes.
read in the mesh and the mesh instance.
read in the light chunk.
read the BSP tree and get all areas.
Definition at line 567 of file GrBSPTree.cpp.
| bool GrBSPTree::Pick | ( | GrMeshInst *& | mesh, | |
| GrMesh::STriCollision & | hit, | |||
| const MRay & | ray | |||
| ) |
picks the scene and returns the mesh and it's hit info.
is there anything to hit?
pick.
Definition at line 158 of file GrBSPTree.cpp.
| bool GrBSPTree::RemoveLight | ( | GrLight * | light | ) |
Definition at line 148 of file GrBSPTree.cpp.
| bool GrBSPTree::RemoveLight | ( | const char * | name | ) |
Definition at line 138 of file GrBSPTree.cpp.
| void GrBSPTree::Save | ( | UWriter & | writer | ) |
save out the meshes.
these instances don't share any meshes, so we can just save the mesh, then the instance data.
save out the light chunk.
save out the BSP tree.
Definition at line 598 of file GrBSPTree.cpp.
| void GrBSPTree::SetInScene | ( | bool | inScene | ) |
public methods
sets the in scene flag to true if we're in the scene. This also causes lights to be added or removed from the scene.
if our status isn't changing, then simply return.
set our _inScene flag.
add or remove lights.
Definition at line 101 of file GrBSPTree.cpp.
| void GrBSPTree::Traverse | ( | GrSceneTraverser * | traverser | ) |


とかで細かく指定できるし……

<big style="color: #fff; text-shadow: 0 0 10px #000;">
Hello, World!
</big>

The MIT License (MIT)
Copyright (c) 2014 KISUGE, Yuto.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
おわり


About¶
Nets is a vanilla Deep Learning framework, made using only NumPy. This project was first introduced as an assignment I made at the University of Oslo and Stanford University
However, this project was recreated to make it OOP like. Nets was highly inspired from PyTorch and TensorFlow.
Nets package has NO CLAIMS to shadow already build deep learning packages like PyTorch or TensorFlow. Instead, this package was made to understand how all of these libraries work and handle forward / backward propagation by making one from scratch. As I am going through this deep understanding, I found interesting to share as much as possible my work, which I hope will help students or people who want to learn more about deep learning.
Instalation¶
Nets was made in Python 3.7 and uses multiple machine learning libraries:
Numpy
Json
Time
Pandas (Optional)
Scipy (Optional)
Scikit-Learn (Optional)
To use this package, clone the repository at https://github.com/arthurdjn/nets on your laptop and from the root folder, run on the commandline:
git clone https://github.com/arthurdjn/nets
cd nets
pip install .
Or you can download it directly with pip:
pip install nets
This will install the package in your python environment and download all the latest dependencies. You can know use and tweak the parameters of pynews’ models.
Usage¶
Nets architecture follows the one from PyTorch. It provides a basic neural network structure so you can create your own with numpy. You will need to wrap your arrays in a Tensor class to keep track of the gradients, just like in PyTorch and TensorFlow.
Models¶
A model is a Module
subclass, where biases, weights and parameters transformations are computed.
All modules have a forward
method, that MUST be overwritten.
This method will compute the forward propagation from an input tensor, and compute the transformation.
If using the autograd system, no back-propagation need to be added.
However, if you prefer to manually compute the gradients, you will need to override the backward method.
Your Model should inherits from the Module
class and override the forward method.
Example:
import nets
import nets.nn as nn
class Model(nn.Module):
"""
Create your own model.
The attributes should be your submodels used during the forward pass.
You don't have to necessary affect the activation function as an attribute,
unless you want to set a manual backward pass.
"""
def __init__(self, input_dim, hidden_dim, output_dim):
# Initialization
super().__init__() # Don't forget to add this line
self.layer1 = nn.Linear(input_dim, hidden_dim)
self.layer2 = nn.Linear(hidden_dim, hidden_dim)
self.layer3 = nn.Linear(hidden_dim, output_dim)
def forward(self, inputs):
# Forward pass
out1 = nets.tanh(self.layer1(inputs))
out2 = nets.tanh(self.layer2(out1))
return self.layer3(out2)
model = Model(10, 100, 2)
# Let's check the architecture
model
Out:
Model(
(layer1): Linear(input_dim=10, output_dim=100, bias=True)
(layer2): Linear(input_dim=100, output_dim=100, bias=True)
(layer3): Linear(input_dim=100, output_dim=2, bias=True)
)


Based on version 3.0.9 generated on September 10, 2012, (among other things).
This is a paragraph. Paragraphs are preset with a font size, line height and spacing to match the overall vertical rhythm. To show what a paragraph looks like this needs a little more content so, let’s see… did you know that there are storms occurring on Jupiter that are larger than the Earth? That's pretty cool.
Example Label This label could read a date for an update, or it could include an author name, or anything really. Inline labels are pretty handy when you need to draw attention or visually separate a short piece of content.
This is a twelve column section in a row. Each of these includes a div.panel element so you can see where the columns are - it's not required at all for the grid.
I do not fear computers. I fear the lack of them. Isaac Asimov
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 |
|---|---|---|---|---|---|---|---|
| Ham pork leberkas bresaola, brisket t-bone filet mignon hamburger salami andouille short loin sausage. | row 1, cell 2 | row 1, cell 3 | row 1, cell 4 | row 1, cell 5 | row 1, cell 6 | row 1, cell 7 | row 1, cell 8 |
| Ham pork leberkas bresaola, brisket t-bone filet mignon hamburger salami andouille short loin sausage. | row 2, cell 2 | row 2, cell 3 | row 2, cell 4 | row 2, cell 5 | row 2, cell 6 | row 2, cell 7 | row 2, cell 8 |
| Ham pork leberkas bresaola, brisket t-bone filet mignon hamburger salami andouille short loin sausage. | row 3, cell 2 | row 3, cell 3 | row 3, cell 4 | row 3, cell 5 | row 3, cell 6 | row 3, cell 7 | row 3, cell 8 |
| Ham pork leberkas bresaola, brisket t-bone filet mignon hamburger salami andouille short loin sausage. | row 4, cell 2 | row 4, cell 3 | row 4, cell 4 | row 4, cell 5 | row 4, cell 6 | row 4, cell 7 | row 4, cell 8 |
Twelve columns
Six columns
Six columns
Four columns
Four columns
Four columns
Once you’ve exhausted the fun in this document, you should check out:
Reveal makes these very easy to summon and dismiss. The close button is simple an anchor with a unicode
character icon and a class of close-reveal-modal
. Clicking anywhere outside the modal will
also dismiss it.


{% extends "app/layout.html" %} {% block content %}
This app can help in detecting if an SMS/Whatsapp message is spam or not. It can be used to consume messages in smartphones before sending the user a notification so that spam messages don't caause disturbance and don't show up in the inbox.
A classifier has been trained using a dataset (available here) which predicts whether a given SMS message is spam or not based on what it has learnt from the annotated dataset.
The dataset has room for improvement and catering to many more cases; this has been left as future work.
This classifier that powers this app has been built using the Microsoft Azure Machine Learning API.


Maxx Aguilar is a product designer and multidisciplinary artist that works with a variety of media such as drawing, painting, printmaking, digital imaging, photography, music, metal working, and fashion design. They were born and raised in Chicago, land that has been part of the territories of Očhéthi Šakówiŋ, Myaamia, Bodwéwadmi (Potawatomi), Kaskaskia, Peoria, and Kiikaapoi (Kickapoo) nations since prior to European colonization. Their ancestry is inclusive of their maternal Black American heritage and paternal Panamanian family. In their work, their experience as a Black latine transgender person is a starting point for exploring themes of transformation and healing. By denouncing structures of the status quo, they are able to build worlds that reach toward the future while maintaining a historical awareness that navigates inherited trauma.


Warning: If you're allergic to anything, let your friendly barstaff know.
We can make any alcoholic beverage provided we have the receipe and the ingredients. Talk to your bartender about ordering.


ESCAPE FROM L.A. A film review by James Berardinelli Copyright 1996 James Berardinelli
RATING (0 TO 10): 7.0 Alternative Scale: *** out of ****
United States, 1996 U.S. Release Date: 8/9/96 (wide) Running Length: 1:40 MPAA Classification: R (Violence, profanity) Theatrical Aspect Ratio: 2.35:1
Cast: Kurt Russell, Stacey Keach, Georges Corraface, A.J. Langer, Cliff Robertson, Steve Buscemi, Pam Grier, Peter Fonda, Valeria Golino, Michelle Forbes, Bruce Campbell Director: John Carpenter Producers: Debra Hill and Kurt Russell Screenplay: John Carpenter & Debra Hill & Kurt Russell Cinematography: Gary B. Kibbe Music: Shirley Walker and John Carpenter U.S. Distributor: Paramount Pictures
Los Angeles has now been destroyed twice in one summer. Is this wish fulfillment for audiences or for the men and women who make movies? Either way, both apocalyptic scenarios are visually impressive, offering arrays of death and disaster as L.A. is reduced to a smoldering shadow of what it once was. In John Carpenter's ESCAPE FROM L.A., the cause is a mega-earthquake, not an alien attack as in INDEPENDENCE DAY, but the results are similar.
The prologue to ESCAPE FROM L.A. takes place shortly after the conclusion of ESCAPE FROM NEW YORK. On August 23, 2000, the "big one" hits the west coast, severing Los Angeles from the mainland. The new President of the Moral United States (Cliff Robertson, giving an eerily Reagan-esque performance) declares that L.A. is no longer part of the country. It becomes the deportation zone to which all those convicted of moral crimes are sent. Los Angeles is viewed as an island of depravity and violence, populated by psychos, criminals, and other assorted weirdoes -- not that different, some would argue, from what it's like today.
Fast forward to 2013, where we once again meet the infamous criminal, Snake Plisskin (Kurt Russell, reprising the role he first essayed 15 years ago). For a second time, the government needs him for a rescue-and-retrieval mission. This time, the object of his quest isn't a person, but a thing. The President's daughter, Utopia (A. J. Langer), has stolen the remote control unit for a doomsday weapon and given it to a guerrilla leader (George Corraface) on Los Angeles Island. So Snake, who has been injected with a virus that leaves him ten hours to live, has to go in, complete his mission, and escape to get the antidote.
If this premise sounds an awful lot like that of ESCAPE FROM NEW YORK, it's no coincidence. John Carpenter isn't just making a sequel to the 1981 cult classic, but, armed with a considerable budget, he's also doing a partial remake (much like the tactic employed by Robert Rodriguez with EL MARIACHI and the subsequent DESPERADO). ESCAPE FROM L.A. follows an almost-identical trajectory to its predecessor, only this time all the action takes place against the backdrop of the Hollywood Hills rather than under the shadow of the World Trade Center.
All things considered, ESCAPE FROM L.A. is a significant improvement over the first Snake Plisskin adventure. The action sequences are better paced and directed. The erratic, tongue-in-cheek comedy of NEW YORK is back, but, in this picture, it is supplemented by a barbed satire of family values and political correctness. Best of all, however, the basic premise is satisfactorily explored rather than just existing as a jumping-off point. In the previous outing, Snake was dropped in the midst of a generic New York that could have been any abandoned city. Here, Los Angeles is clearly Los Angeles (or, more appropriately, what's left of Los Angeles), and we are given a tour of both the changed geography and the bizarre cultures rising from the ashes. This aspect of the movie, rather than any other, makes ESCAPE FROM L.A. a more fascinating piece of film making.
There's a shade less atmosphere in L.A. than in NEW YORK, but the production values and set design in the sequel are still top-notch. There are some truly breathtaking sequences, such as the spectacle of a tsunami bearing down on the coast or an overhead shot of what became of Disneyland. Borrowing from BLADE RUNNER and other futuristic features, Carpenter has made ESCAPE FROM L.A. visually striking, and, if audiences aren't already exhausted by this summer's other action fare, it should play well.
The only returning actor is Kurt Russell, who slips effortlessly into his character as if a decade-and-a-half hadn't passed. Little has changed -- Snake still talks with a Clint Eastwood-like rasp, sports a heavy five o'clock shadow, and openly despises authority. It's a tribute to Russell that, after so long, he can accurately and effectively re-create his first action role. Though Snake may have aged, the self-deprecating, angry core that makes him more than a mere caricature hasn't changed one bit.
The supporting players are all new. Most of them aren't on screen for very long, and, as a result, don't leave much of an impression. Bruce Campbell, for instance, has a wacky two-minute sequence as the Surgeon General of Beverly Hills, then isn't seen again. Valerie Golino, Pam Grier, and Peter Fonda fall into the same near-cameo category. Steve Buscemi plays another in his gallery of strange people -- a double-crossing "Map of the Stars" salesman. George Corraface isn't a very effective villain, especially compared to Isaac Hayes' Duke of New York (although they both drive similar style cars). Stacey Keach is the top military honcho in charge of sending Snake into L.A. Suitably hard-bitten, he's a worthy successor to the late Lee Van Cleef.
ESCAPE FROM L.A. is the first sequel directed by Carpenter, and, as such, represents a change of direction. It's also the best film he's done in quite some time, although considering his recent resume -- VILLAGE OF THE DAMNED, IN THE MOUTH OF MADNESS, and THEY LIVE -- that's not saying much. Will Snake be back again? Probably not, but if he does return, at least there's no shortage of possibilities for the title. Anyone for ESCAPE FROM CHICAGO?
- James Berardinelli e-mail<EMAIL_ADDRESS>ReelViews web site: http://www.cybernex.net/~berardin
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Jose Mourinho opens up on his theory on why Liverpool are streets ahead of Man Utd
Jurgen Klopp's Liverpool tasted Champions League success last season and are in the driving seat to win a first Premier League title this campaign
by Jake Polden, https://www.mirror.co.uk/authors/jake-polden/Jose Mourinho says the structure of Liverpool and Manchester City is the reason the two clubs are streets ahead of their rivals.
Pep Guardiola's Citizens have won back to back Premier League titles and until this season have looked capable of dominating English football indefinitely.
Jurgen Klopp's Reds, meanwhile, tasted Champions League success last season and are in the driving seat to finish first this campaign.
Mourinho has praised the "harmony" at the two clubs, saying there is chemistry between them that stems from the owner to the players, with everyone on the same page working towards the same goal.
"I think the structure of the clubs," Mourinho told The Telegraph.
"When you look at City, for example: the owner, Ferran Soriano [chief executive], Txiki Begiristain [director of football], Pep Guardiola, Pep's staff and then the players.
"This looks like harmony, empathy, chemistry, quality, sharing the same project, sharing the same ideas.
"Liverpool? I also think that Jurgen [Klopp] is in a good position. He is very stable.
"I think he has control of his 'areas'. He is supported by people who think the same way, the structure of the club."
Manchester United finished second under Mourninho in the 2017/18 campaign, six points above Liverpool in fourth.
The Red Devils finished sixth last season, with Ole Gunnar Solskjaer taking the reins from Mourinho midway through the campaign.
While this season, United are floundering down in seventh, with 16 points accrued from their opening 12 fixtures.


Our Top 10 Strongest Beliefs:
- Education
- Student's (and teacher's) Rights
- Respect/Kindness
- Equality
- Dedication
- Peace in our class and peace with others
- Fun Activites
- Less Screen Time
- Good Foreign Relations
- Extra Credit
I will create a study sheet for everyone to study from. This study sheet will be able to found on this website.
I will make sure that everyone know their rights.
I will enforce the laws that Congress makes about respect and kindness.
I will make sure that everyone is treated fairly, and treated the same no matter what gender, race, or ethnicity they are. If I see any injustices, I will speak out.
I will work as long as needed to give you all the best education and school experience that you could have.
I will make sure that we have peace in our class, and that everyone is being respectful to one another. I also intend to set up peace treaties.
I will make sure that we have fun activites that we can participate in. These will include fun games during class (but of course also educational, and relating to the topic).
I will do my best to reduce screentime by taking attendence for the teachers, creating a study sheet (read more about it under the "goals" section), and talking to teachers.
I will make sure that we will have good foreign relations with other countries and make sure that we have a relationship that beneifts both of us.
I will give extra credit according by the Constitution's rules. With that, I will also give 3-5 pieces of homework per month, because right now, we don't have a long of homework to give extra credit on.


Son Goku
The Saiyan that lived
- SUPER SAIYAN - The Super Saiyan form multiplies Goku's power by 50x its normal potential, a multiplier that can be mastered and increased even further. The Super Saiyan form is, of course, only the tip of the Saiyan iceberg.
- SUPER SAIYAN 2 - Unlike the second and third stages of Super Saiyan, Super Saiyan 2 is a full level of ascension. In this form, Goku's hair becomes spikier and his base form power is multiplied by 100.
- SUPER SAIYAN 3 - Say what you will about the long hair and caveman brow, but we think Super Saiyan 3 is awesome. It's so powerful that it took Goku about four minutes of screen time to actually transform. With this form comes a 400x power increase, a power aura with crackling bio-electricity and of course that sweet hair.
- SUPER SAIYAN GOD - Super Saiyan God is responsible for giving Goku the Super Saiyan Blue form, and all the power-ups that followed, but in retrospect, it's not all the great of a form. Sure, it's undeniably the most powerful Super Saiyan form but there's something kind of lame about it.
"Sometimes life is too uncertain to have regrets."


Sign Up
Log In
Logout
Delete Account
View Source
ummarizer
tl;dr
|
Summarize
Unable to create summary. Try a different URL.
Attach Note
Switch to my Summaries
Switch to all Private Summaries


iron A., M., metal marine uptake ocean J., growth W., G., Oceanogr. concentrations Limnol. [./lo....] phytoplankton surface waters S., metals Huntsman, cellular ligands Pacific organic Sunda trace transport . ± . L., E., species nutrients (Sunda algal Mar. Chem. biological high Bruland cell oceanic North H., major seawater T., light low Figure R., coastal dissolved D., K., Morel redox Atlantic Zn, rate rates concentration Sea chelates diatom nutrient production water Huntsman Ocean P., carbon levels oxidation ratios zinc Nature availability deep influence Fe(II) bacteria ferric higher increase nitrogen observed occurs produced B., Iron cells copper cycling large manganese needed Y., [Zn′] important limitation reduction role (Figure C., F., However, Maldonado chemical photosynthetic soluble Cu, Deep Moffett Res. Saito Southern available chemistry increases ligand proteins strong Cd, bound cyanobacteria intracellular phytoplankton. siderophores speciation systems Boyd Environ. Fe(III) N., Zn:C [./S-()-] effect effects experiments interactions natural phosphate Morel, Sci. [./-()-] decreasing diatoms different lower range seawater. subarctic -fixation Coale Martin Science biologically decrease essential filterable increased plankton processes requirements specific Bruland, Fe(II)′ Fe(III)′ Microbiol. Price Shaked algae cobalt complexation eukaryotic inorganic nitrate presence protein requirement times values van (e.g., Consequently, Hutchins Mn(II) Ni, Ocean. Silva Strzepek Table Thalassiosira V., den eds electron evidence growing high-affinity ocean. regions waters. . ± . (Bruland, Acta Butler Co, Fe, Kustka Pacific. Trace Williams, [./j.marchem...] binding cadmium composition enzyme evolution fixation implications inputs max metabolic occur oxides particulate photochemical present regeneration superoxide (da Falkowski Hunter I., Metal Mn, O., Rue Synechococcus Thus, Trichodesmium [./a] active atmospheric chelators complex complexes decreases depth diatoms. formation highly huxleyi increasing iron-containing largely maximum ocean, release removal siderophore state variations vertical Barbeau Cosmochim. Cullen Geochim. Johnson Phycol. Price, Sargasso [./j.-...x] [./nature] communities cycle data deeper equatorial forms free ions iron, iron-limited kinetics mol n.d. near-surface northeast open photolysis ratio reaction residence response similar temperature uptake, upwelling .–. Ahner Croot Effect Fitzwater Gledhill Global Gordon Jickells Lane Raven Rev. [./] [./science...] abundant bacterial biogeochemical caused central chelate chelation coordination cyanobacteria, cycles day directly dust groups limiting oceanica oxide planktonic primary reduced regulating results source sources steady stripping subtropical sulfide taken terrestrial time toxic various waters, zinc, (Fe, (Figures (Moffett (Saito (and Berg Biogeochem. Boyle Buck Capone Cycles Ecol. M:C Mn(II), Production Sea, Similar Uptake Zinc Zn:P Zn′ [./GB] [./science.] abundance aeolian amounts anhydrase associated atmosphere average biogenic carbonic chlorophyll class colloidal constant continental control dependent distribution exist external fixed flux form including incubation involved likely limits metal:C microbial near negative net oxygen period phosphorus photosynthesis phytoplankton, plots polysaccharides regulation related relative released resulting settling size stable sunlit support surfaces variety vitamin (Martin (Price (Raven, (Table (or (see -fold .°N, Barbeau, Berg, Biol. Brand Butler, Cellular Cobalt Complexation Crawford Evolution Fe:C Guo Hopkinson Hudson Moffett, Pacific, Sea. Tebo Technol. [./j.dsr...] [M′] [New a). added addition addition, appear assimilation b). bacteria, chelated chelating co-limitation cobalt, complexed complexing concentrations, conditions contains controlling controls critical culture cultures cytochrome differences elements energy environments enzymes especially exchange experiment feedback function highest humic hydrolysis insoluble iron-siderophore layer log magnitude manganese, mean measured new nickel nitrogenase orders particles photosynthesis. phytoplankton: potential processes, rate, reactive reducing regulate sea seawater, shown siderophores, sites small storage subsequent substantially toxicity utilized voltammetry years (A) (Barbeau (Brand (Hassler (Hopkinson (Maldonado (Moore (Peers (Redfield (Sunda, (log (nM) .°W, ATP Acad. Amin Anderson Based C-fixation Carpenter Cd) Chemistry Co(II) Copper Crocosphaera Cu(I) Cu′ Depth DiTullio Dupont, Effects Ellwood Ellwood, Emerson Emiliania Evidence Fe(II), Fe), Figures Filterable Harrison Jakuba Kuma Lohan Marchetti Millero Mo, Moore Natl. New Ocean, Plant Proc. Prog. Relationships Roy Rueter Ser. Sigman Smith Sohm South Statham Trick Turner U.S.A. York]: [./bg---] [./j.-..tb.x] [./meps] [./pnas.] account acid acquisition ammonium appears assimilated based behavior billion bioavailability biogeochemistry biomass catalyzed centers classes coccolithophore coccolithophores complex. complicating consistent contrast, copper, cultured cycling, decreased degradation demand deposition depths determined diffusive enhanced enrichment estuarine facilitate factor fix generally given global greatly half help helps however, indirectly inducible intensity inventories iron(III) lesser level life ligands, like longer-lived low-affinity low-iron medium metals. micronutrient modern molar molecules nature noted nutrients, oxygenic particles, patterns phosphate, photosynthetically photosystem portion productivity profiles profound reactions recent reductive relationships relatively replacement require responsible result sector sedimentary sediments settling, short siderophores. slope slopes species, species. stratified strongly substances substantial synthesis systems, tropical turn ultimately unchelated undergo use used utilization utilize variation way western widespread zone − s


This conference is a satellite conference of the N-cube Days XI organized in Gothenburg on November 15-16.
Location:
University of Copenhagen: Auditorium 8, HCØ, Nørre Campus, Copenhagen.
Date:
14 November 2019.
Speakers:
- Francois Brunault (ENS Lyon)
- Florian Breuer (Newcastle and Stellenbosch)
- Farbod Shokrieh (Univ Washington)
- Lars Kühne (Basel)
Program:
The conference will start at 13:00 on Thursday 14 in Aud 8.
Here is the detailed program.
Organizer:
Fabien Pazuki (Univ. Copenhagen).
Registration:
There is no registration fee but if you want to participate we kindly ask you to send an email to fpazuki 'at' math.ku.dk.
Directions:
The conference will take place in Auditorium 8, in the HCØ Building of Copenhagen University, close to the Math Department.
Sponsors:
Department of Mathematical Sciences (Denmark).


Kwesta is the most talented rap/singer artist in South Africa. He is normally known for his track NGUDU.


{% extends "base.html" %} {%block navbar %} Toggle navigation Oliver Lab: QC Workflow Fastqc Cutadapt Alignments Sample Similarity Ercc {% endblock %}


Please enter the coefficients
a
,
b
and
c
of a quadratic equation of the form
ax² + bx + c = 0
a:
b:
c:


Undercamber™ is a Java-based software test automation framework, with these advantages:
- An automatically generated hierarchical GUI for quickly selecting an ad-hoc subset of tests to be run, and fully automated testing without a GUI,
- Simple programming via a traditional API to support unique or unusual testing strategies,
- Powerful and simple support for running a test's prerequisites, including skipping setups that have already been performed prior to
execution (such as from a previous run),
- Support for testing different versions of the Unit Under Test (UUT) and different versions of JVMs in a single run,
- Simple and effective concurrency control, and
- Short learning curve.
Undercamber has a unique self-configuring GUI that the tester can use to quickly select and run an ad-hoc subset of tests:
Undercamber Features
Undercamber addresses several aspects of testing that are unique to an agile environment, including:
Ad Hoc Subset Selection
When working in a customer-driven environment, requirements, goals, and priorities can change. Sometimes rapidly. A developer might be working on
one part of the product in the morning, and working on a completely different part of the product that afternoon.
To support such development, the programmer needs to quickly select a subset of the full regression test suite to perform tests that are relevant
to the work at hand. For example:
- When working with code to validate user input, the developer does not want to waste time running tests to verify persistence.
- When working on an interface to third-party libraries, the developer does not want to waste time running tests to validate user input.
For a test framework to properly support an agile environment, it must be easy for a developer to quickly select an appropriate subset of the tests
to run, and then re-use that subset of tests quickly and painlessly. This must be done quickly, without re-programming the test system, and without
intimate knowledge of the test setup.
Toward this goal, Undercamber presents a GUI with a hierarchical tree of tests, allowing the user to graphically select a select a subset of tests,
as shown in the above figure. The GUI is created, updated, and configured completely automatically.
Return to top
Self-Configuring GUI
When adding, updating, or removing features in the end product, the test suite should be updated accordingly. When a developer updates the test
source code, the test automation framework should automatically configure itself without intervention from the developer.
The Undercamber GUI is self-configuring. The framework deduces the test structure, and uses that to drive the GUI. Consider this test code:
public class MyTests
implements TestUnit
{
public void runTest( TestManager testManager )
throws Throwable
{
boolean verify;
MyBank bank;
verify = testManager.initialize();
if ( verify )
{
bank = new MyBank();
}
else
{
bank = null;
}
testManager.addSubtest( tm -> testAccountCreation(tm,bank) );
testManager.addSubtest( tm -> testDeposit(tm,bank) );
}
void testAccountCreation( TestManager testManager, MyBank bank )
throws Throwable
{
boolean verify;
verify = testManager.initialize();
if ( verify )
{
bank.createAccount( "Bill" );
}
}
void testDeposit( TestManager testManager, MyBank bank )
throws Throwable
{
boolean verify;
verify = testManager.initialize();
if ( verify )
{
bank.deposit( "Bill", 100 );
}
testManager.addSubtest( tm -> testWithdraw(tm,bank) );
}
void testWithdraw( TestManager testManager, MyBank bank )
throws Throwable
{
boolean verify;
verify = testManager.initialize();
if ( verify )
{
bank.withdraw( "Bill", 50 );
}
}
}
With the above test code, Undercamber will automatically produce this GUI without any scripting, configuration, or annotations:
Test Automation
In an agile environment, a test engineer needs to automate the tests, without any user intervention and without a GUI.
Although Undercamber can be run with a GUI, it also has a variety of techniques to quickly and easily specify subsets
of tests for automated execution. Once the subset of tests specified, there is very little or no effort to maintain the
list as tests are added, updated and removed from the system. In most cases it is automatic and there is zero effort to
maintain the list.
These subsets of tests (or all of the tests) can be easily invoked from the operating system command-line without
displaying the GUI.
Return to top
API Programming
As illustrated above, Undercamber is programmed entirely through a simple API, without configuration files and without
annotations. This allows the test developer to create testing strategies that are not anticipated by the framework.
By using an API, unusual testing strategies are easy to program:
- Testing in a loop uses ordinary Java looping techniques (such as for, do, and while loops.)
- Optional testing can be implemented using ordinary Java conditional programming (such as if blocks)
- Method calls can be made wherever needed
- Any and all other Java programming techniques and facilities are available to the test developer
Java developers are already familiar with Java techniques (obviously), so the Undercamber learning curve is quite short.
Developers do not need to learn a new annotation scheme, and do not need to learn a new configuration file format.
Tight Integration Into the Development Workflow
Because Undercamber is programmed with ordinary Java, it will naturally integrate well with any IDE or automation tools.
Return to top
Test Setup and Prerequisites
In all but the simplest scenarios, a software test will require some setup prior to execution.
In Undercamber, such a prerequisite is just another ordinary test. The only difference is that it
must be completed before its dependent test is run. Because a prerequisite is itself just another
test, a prerequisite can have its own prerequisites.
Undercamber has several types of prerequisites, some of which are implicit in the test structure, and other which are
explicitly specified by the test developer. This makes it easy to construct sophisticated networks of setup functions and
prerequisites, and such a network requires very little maintenance as tests are added and removed from the system. In most
cases, it is fully automatic.
Dynamic Prerequisites
Undercamber supports dynamic prerequisites, that may or may not be run depending on whether the prerequisites are satisfied
prior to running Undercamber.
Consider a test system that validates database access, but setting up the database is very time consuming. To automate the test
process, it makes sense to set up the database within the test system. However, it also makes sense to skip the database setup
if the database already exists. In Undercamber, it is easy to write code to check the presence of the database before declaring
that the setup step must be run.
Return to top
Test Multiple Versions of the UUT
The unique architecture of Undercamber fully supports testing
- Multiple versions of the Unit Under Test (UUT), and
- Multiple versions of JVMs
all within a single test run.
Return to top
Graphical Presentation of Results
Undercamber can optionally display the test results graphically:
Like the selection GUI shown above, this GUI is self-configuring and needs no programming by the test developer.
Return to top
"Undercamber" is a trademark of Rygaard Technologies, LLC
The airfoil logo is a trademark of Rygaard Technologies, LLC
Undercamber™ is licensed under the BSD 3-Clause license:
Copyright 2018 Rygaard Technologies, LLC
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.


FM TITLE
you can play the notes in the keyboard with reference in the image below
with this slider you can control de volume
you can control the envelope of the oscilator (attack, delay, sustain, release) with this multislider


SELECT
Topics
Returns rows from tables, views, and user-defined functions.
Note
The maximum size for a single SQL statement is 16 MB.
Syntax
[ WITH with_subquery [, ...] ] SELECT [ TOP number | [ ALL | DISTINCT ] * | expression [ AS output_name ] [, ...] ] [ FROM table_reference [, ...] ] [ WHERE condition ] [ GROUP BY expression [, ...] ] [ HAVING condition ] [ { UNION | ALL | INTERSECT | EXCEPT | MINUS } query ] [ ORDER BY expression [ ASC | DESC ] [ LIMIT { number | ALL } ] [ OFFSET start ]


{% extends "base.html" %} {% block content %}
Swanky pug icon from Turbomilk's Zoom-Eyed Creatures collection.


|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--marf.Storage.SampleLoader
Absract Class SampleLoader
Provides samle loading interface. Must be overriden by a concrete sample loader.
$Header: /cvsroot/marf/marf/src/marf/Storage/SampleLoader.java,v <IP_ADDRESS> 2003/02/16 18:59:24 mokhov Exp $
| Field Summary | |
protected javax.sound.sampled.AudioFormat |
oAudioFormat
Properties of a wave. |
protected javax.sound.sampled.AudioInputStream |
oAudioInputStream
Stream representing wave sample. |
protected java.io.ByteArrayOutputStream |
oByteArrayOutputStream
Output stream used for writing audio data. |
protected Sample |
oSample
Sample references of the sample to be loaded. |
| Constructor Summary | |
SampleLoader()
Default constructor. |
| Method Summary | |
Sample |
getSample()
|
long |
getSampleSize()
Retrieves the length of the sample (# of audio data in the audio stream). |
abstract Sample |
loadSample(java.io.File poFile)
SampleLoader interface. |
Sample |
loadSample(java.lang.String pstrFilename)
Same as loadSample(File) but takes filename as an argument. |
abstract int |
readAudioData(double[] paiAudioData)
Reads audio data from the sample's audio stream into paiAudioData. |
void |
reset()
Resets the marker for the audio stream. |
abstract void |
saveSample(java.io.File poFile)
SampleLoader interface. |
void |
saveSample(java.lang.String pstrFilename)
Same as saveSample(File) but takes filename as an argument. |
void |
setSample(Sample poSample)
Sets internal sample reference from outside |
void |
updateSample()
UpdateSample() is just used whenever the AudioInputStream is assigned to a new value (wave file). |
abstract int |
writeAudioData(double[] paiAudioData,
int piWords)
Writes audio data into the sample's audio stream. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Sample oSample
protected javax.sound.sampled.AudioFormat oAudioFormat
protected javax.sound.sampled.AudioInputStream oAudioInputStream
protected java.io.ByteArrayOutputStream oByteArrayOutputStream
| Constructor Detail |
public SampleLoader()
ByteArrayOutputStream
.| Method Detail |
public abstract int readAudioData(double[] paiAudioData) throws java.lang.Exception
paiAudioData
- an array of doublesjava.lang.Exception
- public abstract int writeAudioData(double[] paiAudioData, int piWords) throws java.lang.Exception
paiAudioData
- an array of doublespiWords
- the number of audio data to written from the paiAudiodatajava.lang.Exception
- public abstract Sample loadSample(java.io.File poFile) throws java.lang.Exception
poFile
- file object a sample to be read fromjava.lang.Exception
- public Sample loadSample(java.lang.String pstrFilename) throws java.lang.Exception
pstrFilename
- filename of a sample to be read fromjava.lang.Exception
- public abstract void saveSample(java.io.File poFile) throws java.lang.Exception
poFile
- File object a sample to be saved tojava.lang.Exception
- public void saveSample(java.lang.String pstrFilename) throws java.lang.Exception
pstrFilename
- filename of a sample to be saved tojava.lang.Exception
- public final void updateSample() throws java.lang.Exception
UpdateSample()
is just used whenever the AudioInputStream
is assigned to a new value (wave file).
Then you would simply call this method to update the
Sample
member with the contents of the new AudioInputStream
.
java.lang.Exception
- public final void reset() throws java.lang.Exception
java.lang.Exception
- public final long getSampleSize() throws java.lang.Exception
java.lang.Exception
- public final Sample getSample()
public final void setSample(Sample poSample)
poSample
- Sample object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Menu / Vertical Orientation
This sample shows how to create vertical or side menu. By default Menu is arranged in horizontal layout, where root items appear in one line. By setting the displayMode property to 'vertical', the layout of the menu will change and will appear as vertical menu.
In this sample, the following property is used:
- displayMode - specifies how menu items are displayed


Welcome to SmartBetas’s documentation!¶
SmartBetas Investing¶
This program is aimed at testing Smart Betas strategies. It allows users to build portfolios and virtually invest in them. Users can also verify if these strategies work by asking the program to compute returns on their virtual investments.
main.py
is the first module loaded when a user starts the program, it
initiates the application.
The program is built on a database, the communications between the program and the db is managed by pydal 1 (Python Database Abstraction Layer). The module checks if pydal is installed on the host; if not, the program outputs a message and closes.
The module will also check if the host is connected to the internet, this is required because the data used to compute portfolios is pulled from a web API. If the host is not connected to the internet, the program will output a message and the program will close.
The connectivity test is performed by trying to open a socket 2 on google website’s TCP port 80 (www.google.com:80).
This module also clears the command line window prior starting the console.
Note
To start the program, one must call python on the folder containing the __main__.py module.
- 1
pyDal’s API documentation: https://pydal.readthedocs.io/en/latest/
- 2
Python socket - Low-level netorking interface: https://docs.python.org/3/library/socket.html
Database Layer¶
db.py
manages the database where the application is storing
operations, tickers, portfolios and reports.
The python layer that manages the database is provided by pyDal 3, this is an open source python package which acts as an abstraction layer between an application and a database.
pyDal can handle multiple types of database, in application there are no intensive database operations therefore we can use sqlite3 4.
When imported the module is checking if the db folder (located at the same level than the application folder) is present. The folder is created if not found.
The database is initialized with the following statement:
folder = os.getcwd()+('/db' if os.name != 'nt' else '\db')
db = DAL('sqlite://storage.sqlite', folder=folder, migrate_enabled=True)
Where folder is the database location and migrate_enabled indicates to pyDal that it should not assume that the tables already exists, but rather check and compare against the define_table statements.
For this project we defined the following tables:
Investments: Contains the investments made by the user, each entry features a date, a name, a volatility based portfolio vol, a momentum based portfolio cmr, a composite based portfolio cmp and a register containing the prices of all the stocks listed in each portfolio (the portfolios and the price register are stored in json).
{
"ACB": 1832, //ticker: quantity
"AMD": 597,
"KEYW": 1487,
...
}
Portfolios: Contains the portfolios that the user chose to save after computing them. Each entry features a date, a name a volatility based portfolio vol, a momentum based portfolio cmr, a composite based portfolio cmp and a register containing the prices of all the securities listed in each portfolio (the portfolios and the price register are stored in json).
{ //example with momentum
"AAPL": 6.5261228230980795, //ticker: momentum
"ACB": 27.887788778877898,
"AMD":<PHONE_NUMBER>2368692,
...
}
Symbols: Contains the tickers and their corresponding names, each entry features a ticker and a name.
Checks: Contains the portfolios returns reports generated by users and saved in the database. Each entry features a name, a volatility based portfolio vol, a momentum based portfolio cmr, a composite based portfolio cmp and date. (the portfolios are stored in json).
The json structure for checks table is as follow:
{
"ACB": {
"abs": -109.92, // absolute returns
"date": "2019-04-22 16:57:42", // data of
"new": 9.04,
"old": 9.1,
"qty": 1832,
"rel": -0.66
},
...
- 3
pyDal’s API documentation: https://pydal.readthedocs.io/en/latest/
- 4
SQLite3 documentation: https://www.sqlite.org/draft/version3.html
Tickers - User Input¶
The main user’s data inputs are tickers which will be used to form portfolios. These inputs must be thoroughly checked and stored locally ( in a database ) for future usage.
tickers.py
is handles operations related to tickers.
-
tickers.
save
(ticks)¶ Saves toclers names into a global variable and into the database.
- Parameters:
ticks :
list
ofstring
, each one is a tickert.
The function will check for each ticker if an entry already exists in the database, if not, it will attempt to fetch the ticker’s name from a web API.
If the fetch is successfull, the result is written into the database. This way next time the ticker is used, the application will not need to pull data from the web API.
The function also sets the global TICKERS and NAMES
list
with the tickers and their corresponding names.When a ticker can not be identified on the web API, it is not stored in the global variable nor in the database, but in a list that will be returned.
Returns a
list
containing tickers that caused errors.
-
tickers.
save_portfolio
(vol, cmr, cmp, prices, name)¶ Writes the computed portfolios into the database.
- Parameters:
vol :
dict
volatility portfolio.cmr :
dict
momentum portfolio.cmp :
dict
composite portfolio.prices :
dict
price register.name :
string
name of the portfolio.
Saves into the database the items passed as argument.
Returns True if it succeeded.
-
tickers.
validate
(raw)¶ Checks the content of the data provided by the user.
Users provide tickers to the application by writing them into a file that is loaded through the console interface with the <load filename> command.
We expect the file to be filled with coma separated tickers
string
.- Parameters:
raw :
string
content of the user provided file.
The function strips the raw data from spaces, carrier returns and split the content around comas. It will also check if there are trailing comas or if the user mistakenly put two comas instead of one between tickers.
Returns a
list
of sanitized tickers
Web API Interface¶
A web API 5 is an Application Programming Interface for a web server or a web browser. On the server side, it consists or one or more publicly exposed endpoints accessible through http requests. The content is typically expressed in JSON (JavaScript Object Notation) or XML (eXtensible Markup Language).
smartbetas
relies on two APIs. One is used to convert tickers to
company names (As example: AAPL -> Apple Inc), the second one is used to get
information about a stock (daily open, daily high, daily low, daily close and
daily volume).
The ticker API is totally free and open source, it is maintained by a single contributor (Kambala Yashwanth), this API simply takes a ticker as input and returns the name of the stock if found 6.
Alpha Vantage provides the stock data API. This is not a free service, however they provide a free limited access to their data. The following constraints are applicable when using a free API Key 7:
5 API requests per minute
500 API requests per day
Note that Alpha Vantage requires free users to register to get their API key.
Our key is stored in __gbl__
.
- 5
Wikipedia Web API: https://en.wikipedia.org/wiki/Web_API
- 6
Ticker Search API doc: https://github.com/yashwanth2804/TickerSymbol
- 7
Alpha Vantage API Documentation: https://www.alphavantage.co/documentation/
api.py
handles communications between the host and the web APIs.
-
api.
symbol
(tick)¶ Determines the name of a stock based on a ticker.
- Parameters:
tick :
string
stock’s ticker.
Constructs the request URL with the ticker passed as argument then makes an http request and parses the data received from the API.
Json Data sample from the API:
[{"symbol":"AAPL","name":"Apple Inc."}]
Returns a
string
contraining the name of the sock ORNone
if the API failed to return data for the ticker (as example, if a wrong ticker was provided).
-
api.
tsd
(tick)¶ Fetches a stock daily data from 20 years ago till now.
- Parameters:
tick :
string
security ticker.
The function builds the URL, makes the http request to the web API and parses the received JSON, then to assert that data was indeed returned, it checks the length of the data:
length = 2 : Data returned
length < 2 : No data returned
If no data is returned, the function assumes that the maximum amount of calls per minute is reached; it will wait for 15 seconds and retry; if it fails again it will wait again till data is returned.
Note
If the maximum amount of daily request is reached, the function will loop forever.
Data sample:
{ "Meta Data": { "1. Information": "Daily Prices (open, high, low, close) Volumes", "2. Symbol": "AAPL", "3. Last Refreshed": "2019-04-26", "4. Output Size": "Full size", "5. Time Zone": "US/Eastern" }, "Time Series (Daily)": { "2019-04-26": { "1. open": "204.9000", "2. high": "205.0000", "3. low": "202.1200", "4. close": "204.3000", "5. volume": "18611948" }, // max 20 years of values ...
Once the data was obtained, the function will create a
list
oftuple
containing in each position a datetime object and the closing price of the stock for that date. (List starts with the date closest to now)List sample :
[(datetime.datetime(2019, 4, 18, 0, 0), 203.86)]
Returns a
list
oftuple
containing dates and closing prices.
Building Portfolios¶
This modules uses data returned from the web API (api.tsd()
) to compute
the volatility and momentum of each stock.
Based on the stock ranking it also builds a composite portfolio
composite.composite()
.
To expedite things, this module uses python’s concurrent.futures 8 to fetch data from the API in a parallel fashion. Executing http requests in parallel saves a considerable amount of time.
- 8
Python
concurrent.futures
: https://docs.python.org/3/library/concurrent.futures.html
compute.py
is used to compute volatility, momentum and composite
based porfolio.
-
compute.
compute
(tick)¶ Returns the volatility, momentum and price of a stock.
This function gets the tickers data with
api.tsd()
, and uses this data to compute the volatility withvolatility.volability()
and the momentum with the modulecumulative.ret()
.Gets data from the web API -
api.tsd()
Computes volatility -
volatility.volatility()
Computes momentum -
cumulative.ret()
Returns a
list
containing the volatility, the momentum and the price of a ticker.
-
compute.
smartbetas
(tickers)¶ Builds three portfolios based on volatility, momentum and a composite score.
Parameters:
tickers :
list
of tickers to compute
Uses
ProcessPoolExecutor.map
to launch parallel processes runningcompute.compute()
on each stock passed as argument.The output of the parallel processing is stored in a
list
containing for each ticker alist
oftuples
.Sample:
[[('t1', volatility), ('t1', momentum), ('t1', price)], [('t2', volatility), ('t2', momentum), ('t2', price)]]
The volability portfolio is built by sorting the
list
in an ascending fashion and extracting only the tickers and their volatility.The momentum portfolio is built by sorting the
list
in a descending fashion and extracting the tickers and their momentum.The prices are also extracted and stored to allow for future comparisons against the market prices.
The composite portfolio is computed with
composite.composite()
.The results are stored in the global variables.
Returns nothing
Volatility¶
In this application, volatility is calculated over a period of two years (between two years ago and now).
To compute the volatility, a standard deviation needs to be performed. To do so we use the standard python’s statistics 9 package.
- 9
Python statistics: https://docs.python.org/3/library/statistics.html
volatility.py
is used to compute the volatility of a stock.
-
volatility.
volatility
(data)¶ Computes the volatility of a stock.
Parameters:
data :
list
oftuples
Note
The function’s argument is provided by
api.tsd()
, each item in this list is structured as follow:[(datetime.datetime(2019, 4, 18, 0, 0), 203.86)]
The function uses
datetime
to determine the dates between which the volatility shall be computed. A newlist
in which the daily returns between the right time frame is built.We then use statistics.stdev to compute the standard deviation of the list.
Returns a the volatility of the security (
float
)
Momentum¶
We define momentum as the cumulative returns over a period of 10 months ( between 12 months ago and 2 months ago).
All the date and time operations are handled with python’s standard datetime module 10.
- 10
Python datetime: https://docs.python.org/3/library/datetime.html
cumulative.py
is used to compute cumulative returns; also known as
momentum.
-
cumulative.
momentum
(vector)¶ Computes the momentum of a vector.
- Parameters:
vector :
list
offloats
- Moentum is computed as follow:
momentum = 100*(new - old)/old
Returns the momentum of the vector (
float
)
-
cumulative.
ret
(data)¶ Computes the cumulative returns (momentum) of a security.
- Parameters:
data :
list
oftuples
Note
The function argument is built by
api.tsd()
, it is structured as follow:[(datetime.datetime(2019, 4, 18, 0, 0), 203.86)]
.The function uses
datetime
to determine the dates between which the momentum shall be calculated. A newlist
containing only the values in the right time frame is built and passed tocumulative.momentum()
.Returns the momentum of the security (
float
)
Composite¶
In this application we define a composite portfolio as a portfolio based on the ranking of stocks in the volatility portfolio and in the momentum portfolio.
The score of a stock is the sum of its index (rank) in the two other portfolio. The stocks are then sorted in an ascending fasion.
composite.py
is used to build a composite portfolio.
-
composite.
composite
(vol, cmr)¶ Ranks securities in a composite fashion.
- Parameters:
vol :
dict
volatility portfolio.cmr :
dict
momentum portfolio.
Note
at this point, the same tickers are present in both portfolios. Their ranking only is different.
The function builds a
dict
with the tickers and set their score to zero; sample {‘ticker’: 0}. Then it adds to the ticker score their index in volatility and momentum portfolio.The tickers are then sorted ascendingly, after having been transformed into a
tuple
.Returns a
dict
containing tickers and their score.
Investing in the Portfolios¶
In the application, after a user requested the program to generate portfolios with the tickers he provided, he can choose to invest money in each of them.
money.py
handles investments in the computed portfolios.
-
money.
invest
(p_size, p_vol, p_cmr, p_cmp, prices, s_name, stack=100000)¶ Invests 100‘000 USD in each computed portfolio.
- Parameters:
p_size :
int
amount of tickers per portfolio.p_vol :
dict
volatility portfolio.p_cmr :
dict
momentum portfolio.p_cmp :
dict
composite portfolio.prices :
dict
price register.s_name :
string
name of the investment.stack :
ìnt
defaults to 100000, money to invest.
In each portfolio, the function determines how many shares of stock can be purchased. A
dict
containing the stocks and the quantity of shares purchased is built.The function then stores the outcomes into the database, the prices of the securities are also stored for future usage.
Returns nothing.
Measuring Results¶
Using the latest prices of the stocks (fetched from the web API), this module will compute the returns of each portfolios in which the user invested.
To expedite things, this module uses python’s concurrent.futures to fetch data from the API in a parallel fashion. Executing http requests in parallel saves a considerable amount of time.
check.py
is used to determine the returns of an investment.
check.
get_price
(tick)¶Gets the current price of a stock.
- Parameters:
tick :
string
stock tickerFetches the latest price of the stock from the web API. The result is stored in a
tuple
:`('ticker', 149)
Returns a
tuple
containing the ticker and its latest price.
check.
returns
(inv, pfl, prices)¶Computes the returns of a portfolio.
Parameters:
inv :
list
past investment session row from the dbpfl :
string
name of the portfolio (can be vol, cmr or cmp)prices :
dict
latest investment’s ticker pricesComputes the absolute change and the returns for each stock in the portfolio. These values are calculated as follow:
Absolute change : (qty`*`new) - (qty`*`old) (rounded at 2 digits)
Returns : [(new-old)/old`*`100] (rounded at 2 digits)
The total absolute change and return is handled by
check.t_returns()
.Returns a
dict
containing for each stock the initial price, the new price, the absolute change, the returns, the quantity of shares and the date of the intial purchase.
check.
sessions
(id)¶Computes returns of an investment session.
Parameters:
id :
integer
investment session database id.Uses
ProcessPoolExecutor.map
to launch parallel processes runningcheck.get_prices()
on each stock passed as argument.The returns of the portfolios are calculated by
check.returns()
.Once the returns are computed, the results are saved in the database, this is to allow users to consults the results later without having the re-compute the returns or query any data from the API.
- Returns:
r_vol :
dict
Returns of the volability portfolio.r_cmr :
dict
Returns of the momentum portfolio.r_cmp :
dict
Returns of the composite portfolio.inv[‘name’] :
string
investment session name.
check.
t_returns
(inv, pfl, prices, date)¶Computes the total return of a portfolio.
Parameters:
inv :
list
investment session db rowpfl :
string
name of the portfolioprices :
dict
latest investment’s ticker pricesdate :
string
date of the purchaseComputes the sum of the shares when the invesment was made to the sum of the shares now. The absolute change and returns are calculated with the same formulas as in
check.returns()
Returns a
dict
containing the total initial price, the new price, the absolute change, the returns and the date of the purchase.
User Interface¶
The user interface is built on top of python’s standard cmd 11 module with a class betacmd.
betacmd inherits everything from the standard cmd class.
The following parameters are modified:
intro : ‘Smart Betas Investing - Requires an internet connection’
prompt : (beta)
A new parameter is introduced:
‘out’ : ‘–>’, this string precedes outputs on the console
- 11
Python cmd module: https://docs.python.org/3/library/cmd.html
console
provides a simple yet useful command line interface.
-
class
console.
betacmd
(completekey='tab', stdin=None, stdout=None)¶ -
do_bye
(arg)¶ Terminates the program.
usage: bye
-
do_check
(arg)¶ Generates a report about investment returns.
usage: check
-
do_compute
(arg)¶ Build portfolis with the provided tickers.
usage: compute
-
do_invest
(arg)¶ Invest 100‘000 USD into each of the computed portfolio.
usage: invest
-
do_load
(arg)¶ Extracts tickers from a file.
usage: load <FILENAME>
Tickers in the file should be coma separated.
-
do_portfolios
(arg)¶ Displays stored portfolios
Users can select a portfolio, view its stocks and/or invest in it.
usage: portfolios
-
do_report
(arg)¶ Displays previously generated reports
usage: report
-
do_show
(arg)¶ Displays information to the user.
tickers: shows the list of tickers loaded to build a portfolio.
portfolio: shows the session portfolio (after <compute>)
invest: shows the investment sessions performed by the user.
usage: show <tickers/portfolio/invest>
-
do_symbols
(arg)¶ Shows tickers and their associated names stored in the db.
usage: symbols
-
emptyline
()¶ Overriden to prevent default
-
Input / Outputs¶
i_o.py
handles inputs and outputs on the console.
-
i_o.
investment
(qty)¶ Interactive prompt to invest 100‘000 USD into the computed portfolios.
(beta): invest Invest 100'000 USD in each portefolio (y/n): y Invest in the [x] top securities (1): 1 Name of the investment : Glorious Investment
Returns nothing.
-
i_o.
portfolio
(vol, cmr, cmp, prices)¶ Displays three computed portfolios.
---------------------------------------------------------------------- | Pos | Volatility | Momentum | Composite | ---------------------------------------------------------------------- | 1 | AAPL 21.98 | AAPL 5.88 % | AAPL 204.3 $ | | 2 | TSLA 29.98 | TSLA 0.3 % | TSLA 235.14 $ | ----------------------------------------------------------------------
Returns nothing.
-
i_o.
portfolios
(p_flo)¶ Displays a table listing all the saved portfolios.
---------------------------------------------------------------------- | id | Date | Name | Tickers | ---------------------------------------------------------------------- | 1 |2019-04-23| Apple Test | AAPL | | 2 |2019-04-23| Test Apple | AAPL | | 3 |2019-04-23| Test | AAPL | | 4 |2019-04-23| 14 Tickers ftw| AMD, ACB, GWW, GOOGL... | | 5 |2019-04-27| Apple Only | AAPL | | 6 |2019-04-27| Apple Tesla | AAPL, TSLA... | ----------------------------------------------------------------------
Returns nothing.
-
i_o.
reports
(rep)¶ Displays a table listing all the saved reports.
---------------------------------------------------------------------- | Pos | Id | Date | Name | ---------------------------------------------------------------------- | 1 | 1 | 2019-04-26 | 6 Big Stuffs | | 2 | 2 | 2019-04-27 | 6 Big Stuffs | | 3 | 3 | 2019-04-27 | Test | | 4 | 4 | 2019-04-27 | 6 Big Stuffs | | 5 | 5 | 2019-04-28 | One One | ----------------------------------------------------------------------
Returns nothing.
-
i_o.
returns
(vol, cmr, cmp, name)¶ Displays the returns report of an investment session.
-------------------------------------------------------------------------------- One One - Report -------------------------------------------------------------------------------- Volatility Based Portfolio -------------------------------------------------------------------------------- | Ticker |N Shares| Purchase Date | Initial | Current | Abs Change|Returns | -------------------------------------------------------------------------------- | MBRX | 12270 | 2019-04-27 | 1.63 $ | 1.42 $ | -2576.7 $ |-12.88 %| | RAD | 1992 | 2019-04-27 | 10.0401 $ | 9.08 $ | -1912.52 $|-9.56 % | | KEYW | 1784 | 2019-04-27 | 11.21 $ | 11.3 $ | 160.56 $ | 0.8 % | | ACB | 2212 | 2019-04-27 | 9.0396 $ | 9.04 $ | 0.88 $ | 0.0 % | | STLD | 609 | 2019-04-27 | 32.86 $ | 31.58 $ | -779.52 $ | -3.9 % | | Total | NA | 2019-04-27 | 100006.0 $| 94898.7 $ | -5107.3 $ |-5.11 % | -------------------------------------------------------------------------------- Momentum Based Portfolio -------------------------------------------------------------------------------- | Ticker |N Shares| Purchase Date | Initial | Current | Abs Change|Returns | -------------------------------------------------------------------------------- | AMD | 717 | 2019-04-27 | 27.89 $ | 27.88 $ | -7.17 $ |-0.04 % | | ACB | 2212 | 2019-04-27 | 9.0396 $ | 9.04 $ | 0.88 $ | 0.0 % | | GWW | 69 | 2019-04-27 | 291.015 $ | 291.91 $ | 61.76 $ | 0.31 % | | GOOGL | 16 | 2019-04-27 | 1264.28 $ | 1277.42 $ | 210.24 $ | 1.04 % | | BABA | 107 | 2019-04-27 | 186.7425 $| 187.09 $ | 37.18 $ | 0.19 % | | Total | NA | 2019-04-27 | 100282.7 $| 100585.6 $| 302.9 $ | 0.3 % | -------------------------------------------------------------------------------- Composite Based Portfolio -------------------------------------------------------------------------------- | Ticker |N Shares| Purchase Date | Initial | Current | Abs Change|Returns | -------------------------------------------------------------------------------- | ACB | 2212 | 2019-04-27 | 9.0396 $ | 9.04 $ | 0.88 $ | 0.0 % | | AMD | 717 | 2019-04-27 | 27.89 $ | 27.88 $ | -7.17 $ |-0.04 % | | MBRX | 12270 | 2019-04-27 | 1.63 $ | 1.42 $ | -2576.7 $ |-12.88 %| | KEYW | 1784 | 2019-04-27 | 11.21 $ | 11.3 $ | 160.56 $ | 0.8 % | | BABA | 107 | 2019-04-27 | 186.7425 $| 187.09 $ | 37.18 $ | 0.19 % | | Total | NA | 2019-04-27 | 99972.9 $ | 97587.7 $ | -2385.2 $ |-2.39 % | --------------------------------------------------------------------------------
Returns nothing.
-
i_o.
sessions
(inv)¶ Displays a table listing the investments made by the user.
---------------------------------------------------------------------- | Pos | Id | Date | Name | ---------------------------------------------------------------------- | 1 | 1 | 2019-04-22 16:57:42 | 6 Big Stuffs | | 2 | 2 | 2019-04-27 13:59:42 | Test | | 3 | 3 | 2019-04-27 14:05:07 | One One | | 4 | 4 | 2019-04-28 12:31:58 | Glorious Investment | | 5 | 5 | 2019-04-28 12:32:38 | Glorious Investment | ----------------------------------------------------------------------
Returns nothing.
-
i_o.
tickers
(row)¶ Lists all the tickers and names saved in the database.
(beta): symbols --> 0: AAPL - Apple Inc. --> 1: TSLA - Tesla Inc. --> 2: GOOGL - Alphabet Inc. --> 3: BABA - Alibaba Group Holding Limited --> 4: GWW - W.W. Grainger Inc. --> 5: CVX - Chevron Corporation --> 6: HAL - Bank Nova Scotia Halifax Pfd 3 --> 7: RAD - Credit Suisse X-Links Monthly Pay 2xLeveraged Alerian MLP Index Exchange Traded Notes due May 16 2036 --> 8: MBRX - Moleculin Biotech Inc. --> 9: KEYW - The KEYW Holding Corporation --> 10: BBBY - Bed Bath & Beyond Inc. --> 11: AMD - Advanced Micro Devices Inc. --> 12: STLD - Steel Dynamics Inc. --> 13: ACB - Aurora Cannabis Inc. --> 14: ATHEN - Athene Holding Ltd. Class A
Returns nothing.
Global Variables¶
In this application we need to make some pieces of data available for multiple modules, to do so, we use global scope variables. For the sake of clarity, they are declared on a separated module.
- The following global variables are declared:
TICKERS :
list
storing tickers to computeNAMES :
list
storing TICKERS’s nameP_VOL :
dict
storing the volatility portfolioP_CMR :
dict
storing the momentum portfolioP_CMP :
dict
storing the composite portfolioPRICES :
dict
storing the prices registerAPI_KEY :
string
storing the API keyAPI_URL :
string
storing the API URL
gbl.py
is used to list/access/set variables with a global scope.
Test Modules¶
The functions used to compute the volatility and the momentum can be tested with test modules. Developers are encouraged to test the modified modules with these test modules.
test_cumulative.py
tests the function that computes the volatility
of a vector in volatility.volatility()
. This module uses unittest to
assert the correct output of the tested module.
This module can be exectuted with python test_volatility.py
-
class
test_volatility.
TestVolatility
(methodName='runTest')¶
test_cumulative
tests the function that computes the momentum
of a vector in cumulative.momentum()
. This module uses unittest to
assert the correct output of the tested module.
This module can be exectuted with python test_cumulative.py
-
class
test_cumulative.
TestVolatility
(methodName='runTest')¶


Please Enable Javascript
{% if user == 'None' %} Log in with
Metamask
:
Login
{%else %} Welcome {{user}}!
Select file to upload:
View recent uploads
here
Uploads should be masscan logs that were generated
with the contribute.sh script as seen on the
Github
. {% endif %}


KB's Technical Blog
Some information about this blog : tb filled in later
By K. B. DiAngelo
Blog Post Title
the date
Nav Links
Link 1
Link 2
Link 3
Blog blog blog blog blog blog blog
About Me: to be filled in


defective genomes virus cells RNA viral EBOV used genome (). {border-style DG-d assay control px;} #ffffff;} effect infection using â€". Ebola transfected data sequence wild-type genomes. infected observed DIPs Calain EBOV-Ecran TCID Vero deletion qRT-PCR release replication cell interfering performed Figure high however, numbers particles plasmid potential px; {font-family Defective Virol., does end font-size released single supernatant transfection type virus. Â°C Î¼L â€² able double; following indicate likely negative order time uptake (Figure DG-d. Genomes Material SS, Virus al.. analysis border-color border-width circles co-infected compared culture experiment generated genome. incubated independent infection. infectious instructions material number occurred possible proteins samples solid; test virus, wells {font-style {font-weight (Calain (Supplemental (data (measured EBOV-Makona Health Infection Moreover, RNP Viral added article bold case controls courier; described differences disease em; estimated evaluate experiment. gene level media mixture online output parasitisation passage point post prior promoter pt;} reduced regions sense shown significant strain studies synthesis taken therapeutic transcription vitro way Î¼g


81 Project
Design campaign to encourage citizens for the better public etiquettes
Designers: Jaeyong Lee, Seonju Ryu, Sooji Park, Yoonjung Lee, Jongwon Baek
Roles: Project lead, graphic design, fliming & editing
The 81 project is a campaign for etiquettes for the public that began in the summer of 2011 in South Korea. At the time, four designers who involved in this project recognized a social phenomenon in South Korea that some people demonstrated irrational behaviors in public, and sometimes it hurts others emotionally and physically. To deliver social messages to the public to stop such negative behaviors, the 81 project designed ban stickers and installed in the subway line number 2 in Seoul. We also made a short film about this issue with all the processes of installations. The film was shared on major online communities and encouraged discussions among people to bring attentions for this issue.
81 project showed the impact of a simple visual design and design actions reflecting the context of a phenomenon, and how designers could involve themselves in such issues that socially happening around.
Background
The most crowded subway line in the Seoul metro system is line 2. Around 1.5 million people use line 2 per day, and this line registered the highest ratio of annual users among subway lines 1 to 8. Since many travelers use the line, many troubles have been reported. Line 2 showed the highest number of incidents in the subway lines, reaching as many as 6,919 in the first half of 2013. For these reasons, we chose line 2 as the performance target.
Design Concept
The stickers had 4 types that swear words are represented as a weapon, a knife, lightning, and as 81 (the number '18’ means a swear word in Korean). The symbols convey a message that irrational words or behaviors could threaten someone in public, and it should be banned.
StickersDesign Outcome
Installing stickers in subways
The video that includes all the processes and the executions was shared it on the Internet on major online communities and social networks. The video recorded over 20,000 views and 210 comments.
Many people already knew the issue, and gave cheerful comments to the implementation. Among various feedbacks, some people also gave objective criticisms about our project; it should have not only the installation of ban stickers, but also the result of people’s feedbacks and comments.
We do not think the stickers would be the best way to solve the problem, but we tried to attract people’s attention into the issue, so that it raises a question that how we would react or behave about this situation. We do not know the answer yet, but we believe that we should appropriately behave when we are in public. Until we shared this issue on the internet, new incidents constantly had been reported. What can designers do to resolve these social issues?


[§425-197] Uniformity of application and construction. This chapter shall be applied and construed to effectuate its general purpose to make uniform the law with respect to the subject of this chapter among states enacting it. [L 2000, c 218, pt of §2]


Installing SyncServerII Server on an AWS EC2 Instance
This describes installing a server on AWS. If you can install the Swift compiler on it, you may be able to stand the server up on other hosts as well. Note that this is not the currently recommended way to install the server, but I include it for historical reference and in case someone finds it useful. The recommended way is via a Docker image. See the main documentation page.
- My process in this was very much a "roll your own" venture, starting from a fresh EC2 instance running Ubuntu 16.04.
So you know the context, I had already gotten SyncServer running on Ubuntu on my local computer, and my need was to get it running on a remote server. The following takes place at the Ubuntu command line on the EC2 instance.
- First, download updated package lists
sudo apt-get update
- Install Swift-related dependencies.
- See this for the rationale for these first two
sudo apt-get install libpython2.7
sudo apt-get install libcurl3
- Following the Linux installation instructions you need to do:
sudo apt-get install clang libicu-dev
- Then, following this you need to do:
sudo apt-get install uuid-dev
- Due to some complaints when building, I did:
sudo apt-get install openssl libssl-dev
sudo apt-get install libcurl4-openssl-dev
- Now we need to download and install Swift itself
The following downloads Swift 3.1.1. You can, of course, update this to download a different Swift version.
wget https://swift.org/builds/swift-3.1.1-release/ubuntu1604/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz
- Next, untar that baby:
tar -xzf swift-3.1.1-RELEASE-ubuntu16.04.tar.gz
- I then moved it into my local "bin" directory:
mkdir ~/bin
mv swift-3.1.1-RELEASE-ubuntu16.04 ~/bin
- And I put Swift into my PATH by adding the following line to my .bashrc
export PATH=~/bin/swift-3.1.1-RELEASE-ubuntu16.04/usr/bin:"${PATH}"
- Since SyncServer uses a mySQL database, I did a few extra steps:
sudo apt-get install libmysqlclient-dev
- Setup your mySQL database.
I did it using AWS RDS.
- There are then various steps you'll need to go through to create a user for your database, and create your specific schema's. I'll leave that to your inventiveness. :).
- Download SyncServer:
git clone https://github.com/crspybits/SyncServerII.git
- SSL and SyncServer.
- You'll need to setup a Server.json configuration file.
The structure of this file is implicit in the Constants.swift file on the server, but I need to document it!
- SyncServer has a run.sh script to build and start it up.


Netflix lets you skip the Trump jokes in new Seth Meyers special
Tired of hearing about the President? Netflix can help
Netflix is introducing a button so you can skip all the Donald Trump jokes in the new Seth Meyers comedy special.
New show Lobby Baby, which launches today (November 5) sees the comedian take aim at the President, who he has repeatedly criticised in the past.
Speaking to CNN Business, Meyers said that it was his idea to introduce a button that allows you to skip mentions of Trump in the show.
The comedian calls it “a funny and innovative way” to “take advantage of the Netflix experience”.
He continued: “It was a way to build in the response to anyone who would say, ‘Oh, let me guess, there’s going to be jokes about the president’.”
Meyers describes the feature as a “joke”, saying: “I think, look, sometimes at a fancy restaurant they’ll put parsley on your plate and you’ll think, well, that’s a nice touch, but you’re not going to eat the parsley.”
The late-night TV host has been publicly criticising the President again recently, saying: “Every minute with Donald Trump feels like a horror movie.”
Carly Simon also recently reflected on the time she met Donald Trump, saying he was “all over me like ugly on an ape”.