Select one
Use when only one answer applies.
Example: Rank the condition of this property.
Select multiple
Use when several answers may apply.
Example: Select problems that apply to this building.
Text field
Add notes or other details.
Photo
Counter
Cancel


Before Change
// keep track of unique labels
labels.update(current_file["annotation"].labels())
if isinstance(self.feature_extraction, Precomputed) and \
not self.feature_extraction.use_memmap:
msg = ("Loading all precomputed features in memory. "
"Set "use_memmap" to True if you run out of memory.")
warnings.warn(msg)
segments = [s for s in current_file["annotated"]
if s.duration > self.duration]
// corner case where no segment is long enough
After Change
segment_labels.update(current_file["annotation"].labels())
// keep track of unique file labels
for key, value in current_file.items():
if key in ["annotation", "annotated"]:
continue
if key not in file_labels:
file_labels[key] = set()
file_labels[key].add(value)
segments = [s for s in current_file["annotated"]
if s.duration > self.duration]
// corner case where no segment is long enough
// and we removed them all...
if not segments:
continue
// total duration of label in current_file (after removal of
// short segments).
duration = sum(s.duration for s in segments)
// store all these in data_ dictionary
datum = {"segments": segments,
"duration": duration,
"current_file": current_file}
uri = get_unique_identifier(current_file)
self.data_[uri] = datum
self.file_labels_ = {k: sorted(file_labels[k]) for k in file_labels}
self.segment_labels_ = sorted(segment_labels)
for current_file in getattr(protocol, subset)():
uri = get_unique_identifier(current_file)


As a point of reference, everyone involved in this experience was extremely familiar with practically every hallucinogen known to man, *except* 2CB.
Fortune had recently smiled upon our group, as a trusted source managed to acquire 10 capsules (25mg each) of pure 2CB. The term 'capsule' is a bit of an understatement- perhaps 'horse pill' would be more appropriate. They were 1' long and 1/4' in diameter. Too big, in fact, for one member of our group to swallow. She resorted to pouring the contents into a glass of orange juice, which didn't help much since the stuff is pretty unsoluable in water. After drinking the juice there was still a sticky sludge of 2cb left in the bottom of the glass.
Anyway, we had heard that 2CB is normally a short visual trip, around 45 minutes, but when taken during the peak of an MDMA trip the effects can be extended much longer. In our case, the effects continued at least 4 hours after onset.
Let me preface this description by saying that the combo of MDMA and 2CB is quite literally the BEST empathogenic/hallucinatory experience I've ever had. Utterly amazing.
8:00pm - MDMA down the hatch
8:30pm - typical 'am I feeling something?' questions all around
8:50pm - yes, I am.
9:30pm - everyone is rolling their collective asses off- tons of energy, conversation flows quickly from cosmology to genetics to theology. We had completely forgotten about taking the 2CB, until someone noticed the 10 large pills spread out on a mirror in the bathroom. :)
9:40pm - 2CB down the hatch, except for 'D' who gagged on the second 25mg capsule and coughed it up. (as mentioned previously)
10:30 - MDMA peak effects are pretty much over with, and everyone is languishing around giving backrubs and listening to an Orbital CD. We don't feel the 2CB at all. We just feel relaxed and somewhat tired. Some rumblings about being ripped off- which should have been warning enough since that feeling with regard to any drug is almost inevitably followed by quick onset..
10:35 - I notice the wallpaper (oriental design with gold embossed texture) has started to flow, almost exactly like a low dose mushroom trip. I point this fact out to the group, and suddenly everyone sits up alert and sees the same thing.
I'll skip the time demarcations from this point on, as I quit keeping track of the clock and found it too difficult to make notes of any substantive linearity.
The next 4 hours were spent wandering around the house and backyard, looking for new and interesting visual treasures. Whenever a member of the group would find something particularly trippy, they would call everyone else over to examine it for themselves!

But the most intense hallucinations were by far those that dealt with light sources of all kinds. Desk lamps, flashlights, blacklights, even city lights seen outside the window. In particular, we experienced one effect that we still can't explain:
In the dining room there was a chandelier, with 8 crystal bulbs and various dangling prism-esque bits of glass adornment. Clearly visible to everyone were the individual light rays coming from it.
Everyone has experienced starburst patterns at night when looking at a bright light source- well that is NOT what we saw. We saw individual rays of light extending from the lamps, heading outwards in straight lines, laser-like in precision. The part we can't explain is that the lines were perfectly fixed in their geometry, no matter if we walked in a circle around the light, or if we stood next to it, or laid on the floor and tilted our heads sideways. It was if a giant 'light model' was in the middle of the dining room, with its source the chandelier. Each ray of light stayed fixed in position no matter what angle it was viewed from. These rays were mainly yellow, but often shifted towards bright gold and occasionally green. They were ABSOLUTELY real to us- we could reach out our hands and touch their locations as if they were crystaline strands suspended in air.
It was so incredible that we spent about 2 hours playing in the light, unable to comprehend what was happening. Were we actually seeing something that was actually there- but was only revealed by the 2CB mind-state? Yes, we were tripping, but we were rational enough to know we were seeing something we'd never viewed even on high level LSD or shroom trips.
After about 4 hours of 2CB visual effects, we all decided it was time to sleep and took a valium in order to counteract the slight body load and anxiety that was starting to creep in. An hour after the valium, we were all soundly asleep.
The next day we felt quite a bit of a hangover, but were still amazed by what we had seen. We are definitely looking forward to trying this combo again, and I would recommend it to anyone looking to explore the depths of visual perception and the beauty of light itself.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Introducing the PXF API
You use the PXF API to add support for a new external data store, data format, or data access API to Greenplum Database. You can also use the PXF API to extend existing external data stores, formats, and APIs. The PXF API defines the data structures, classes, and interfaces that you need to map external data into a tabular form suitable for Greenplum Database, and vice-versa.
The PXF API interfaces that you will implement or extend depend upon the external data store/API, data types, and operations (read, write) that your connector or plug-in will support, as well as the specific features you want to provide.
The PXF API defines classes including the following:
| Class Name | Description |
|---|---|
Plugin |
The base class for all PXF plug-in types. |
Fragmenter |
The abstract class that defines how to split data from an external source into fragments. |
Fragment |
A subset of data that can be read in parallel. |
OneRow |
One record or row in a Fragment . |
OneField |
One deserialized or serialized field in a OneRow record. |
InputData |
Input data from Greenplum Database and common configuration information available to all plug-ins, and the helper methods to access this information. |
The PXF API exposes the following interfaces:
| Interface Name | Description |
|---|---|
ReadAccessor |
Reads a Fragment and generates a list of OneRow records. |
ReadResolver |
Deserializes a single OneRow record into a list of OneField objects. |
ReadVectorizedResolver |
Deserializes a batch of OneRow records into tuples of OneField objects. |
WriteResolver |
Serializes a list of OneField objects into a single OneRow record. |
WriteAccessor |
Writes OneRow records to the external data source. |
General PXF API Information
Package Name
The PXF API base package name is org.greenplum.pxf.api
. All PXF API classes and interfaces reside in this package.
JAR File
You need the PXF API JAR file to develop with the PXF SDK. This file is named pxf-api-<version>.jar
, where <version>
is a dot-separated 4 digit version number. For example:
pxf-api-4.0.0.jar
PXF JAR files are not currently available from a remote repository. You can obtain the PXF API JAR file from your Greenplum Database installation here:
$GPHOME/pxf/lib/pxf-api-<version>.jar
If any plug-in that you implement extends a class from a built-in PXF connector (HDFS, Hive, HBase), you will also need the JAR file associated with that connector. The built-in PXF connector JAR files also reside in $GPHOME/pxf/lib
:
pxf-hbase-<version>.jar
pxf-hdfs-<version>.jar
pxf-hive-<version>.jar
pxf-json-<version>.jar
You can also choose to build PXF JAR file(s) from source.


A deep dive into the Stellar public network (Part 1)
One of the basic tenets of public blockchains is that all account and transactional information is open to anyone to see. While I’m pretty certain that most cryptocurrencies will eventually adopt some type of zero-knowledge cryptography (e.g. zk-snarks) that would make this sort of analysis impossible or much more difficult, many still have everything recorded in the clear, e.g. the Stellar network and its corresponding currency, Lumens (XLM).
Stellar is an interesting project because it does not rely on the extremely wasteful proof-of-work consensus method (used by Bitcoin and Ethereum). It instead uses the Stellar Consensus Protocol (SCP), which is a form of a federated Byzantine agreement. There’s a technical summary and a white paper that both explain how SCP works1. Its key benefits are that it is both fast (1000+ transactions per second) and environmentally friendly (extremely low energy costs).
Okay, so Stellar is cool, but how are people using it? This was the question that spawned this analysis. I wanted to see what I could find out from the Stellar’s public blockchain about how people (and bots) were using it. This is part 1 of what I hope is a multipart dive into the Stellar network2. Some questions I hope to answer:
- What is the inflation destination distribution across accounts?
- Is there a correlation between account balance and age?
- Are most accounts just holding3 lumens or are they actually moving around?
- What is the topology of the transaction graph? Is it more hub-and-spoke or more Erdős-Rényi like?
- Can I detect when major giveaways and changes to the protocol happened?
Getting the data
While Stellar’s documentation is surprisingly good compared to other cryptoprojects, it took a bit of finagling to get everything to work, but that might be more indicative of my newness to the whole scene.
The first step was actually getting the data. Stellar has a convenient RESTful API for many things via Horizon, but that isn’t sufficient for my needs so I needed to set up a full node locally.
Setting up a local node
The easiest way to do this is via Docker
and once you install it, provisioning a Stellar node is a easy4 as running the following command in your terminal (don’t type the preceding $
):
$ docker run --rm -it -p "8000:8000" -p "5432:5432" -v ~/Documents/stellar:/opt/stellar --name stellar stellar/quickstart --pubnet
Make sure to enter a password in for the PostgreSQL database and that you write it down. You’ll need it to connect to the database later.
The above command tells Docker to download the stellar/quickstart
Docker image and create a volume at ~/Documents/stellar
where the Stellar node will store all of its data. It will also expose the HTML and PostgreSQL ports locally too. We’ll need the latter one to actually access the data. Finally, the --pubnet
flag tells the node to use the public network (i.e. real lumens).
Once you run this command you’ll need to wait till the node is synchronized with the network. You can check its progress by connecting to the Docker container
$ docker exec -it stellar /bin/bash
which opens a connection to the container’s shell. You can then run
$ stellar-core --c 'info'
to ask query the state of your node. The key thing is to look at the "state"
value below, it should eventually read "Synced!"
Content-Length: 761
Content-Type: application/json
2018-03-18T02:55:14.579 GACID [default INFO] {
"info" : {
"authenticated_peers_count" : 8,
"build" : "v9.1.0",
"ledger" : {
"age" : 8,
"baseFee" : 100,
"baseReserve" : 5000000,
"closeTime" :<PHONE_NUMBER>,
"hash" : "260f4e039fb7835c376b0402fec928049c2071412c1fdfcf220445b67a95ad7e",
"num" : 16874829,
"version" : 9
},
"network" : "Public Global Stellar Network ; September 2015",
"pending_peers_count" : 0,
"protocol_version" : 9,
"quorum" : {
"16874828" : {
"agree" : 5,
"disagree" : 0,
"fail_at" : 2,
"hash" : "ba2fc8",
"missing" : 0,
"phase" : "EXTERNALIZE"
}
},
"state" : "Synced!"
}
}
The last ledger was 16874860 when I shutdown my node to prevent the data from mutating during my analysis.
Querying the data
I used Postico to actually query the data, but any PostgreSQL client will work.
You’ll need to tell it to connect to the PostgreSQL instance by telling it to connect to localhost on port 5432, with stellar
as the username and the password you entered from above. The main database we’ll be interacting with is core
. You can then execute any SQL query against the database.
Analysis
Now to the fun part, actually answering some questions! All my analysis was done in Julia and my jupyter notebook is available here.
Account inflation destination distribution
One major concept of the Stellar network is the concept of inflation.
The Stellar distributed network has a built-in, fixed, nominal inflation mechanism. New lumens are added to the network at the rate of 1% each year. Each week, the protocol distributes these lumens to any account that gets over .05% of the “votes” from other accounts in the network.
My understanding is that lumens that are distributed are both new lumens that are added (at the rate of 1% of each year) and the lumens collected from transaction fees5. But…lumens are only distributed if an inflation destination is set. I wanted to look at the inflation destinations ordered by the total amount of XLM in the accounts pointed at each destination (on left) and the number of accounts pointed at each destination (on right).
First thing, there are a lot of accounts without a set inflation destination (i.e. a NULL destination). 6.7 billion lumens are not earning inflation, which works out to 37% of all distributed lumens. It’s even worse if you look at the level of accounts. 76% percent of all accounts aren’t earning any inflation! The biggest community pool (balance-wise) is GCCD..NAUT, which is one of the newer pools that has no fees. Pretty cool that it caught on so quick.
I don’t understand why manual setting of the inflation destination is necessary. Why can’t the lumens be distributed to every account equally? I just find it unfortunate that the majority of accounts aren’t taking advantage of the inflation payouts.
Correlation between account balance and age
Another thing I wanted to look at is if there was any correlation between the age of an account and the size of the balance. The account creation time is not stored, but there is a last modified time. Plotting the 2D histogram of the last modified time versus balance size gives this:
Couple interesting points. You can clearly see when the minimum account balance was lowered from 10 XLM to 0.5 XLM in January. There is also a strip around 5000 XLM, which are probably old accounts that received free lumens, but were forgotten.
In the next part, I’ll map transactions to each account so then I’ll be able to find the oldest transaction for each account to determine its age instead of using the last modified time. I also hope to answer the rest of the questions outlined above.
If you made it this far and have any more ideas for what I could look into, tweet at me (@tlngy).
I plan to write an intuitive description of how SCP works on this blog some time in the future. Hopefully, it will help me a better understanding of the limitations and weaknesses of the protocol design.↩
That depends heavily on the amount of free time I have, heh.↩
hodling↩
I originally tried setting up an instance by compiling stellar-core locally on my MacOS machine, but ran into issues with the config file. Apparently, the default config file ships with a non-functional quorum-set (probably a good thing to make sure people actually think about which nodes they list here, heh).↩
In proof-of-work currencies, the transaction fees are much higher and paid to the miners.↩


Ben Webster
Ben is Founder and CEO of Mosaik. He has previously worked at the International Organisation for Migration (IOM) Syria crisis team in Jordan, the UK Foreign Office, and Transparency International, and has led research on peer-to-peer platforms for the UK Government.


SceneJS - perspective projection with Screen-space panning
The "camera" node supports an optional "pan" vector to translate the model in Screen-space,
after the projection transform is applied. This is useful when we want to offset the model from the
point-of-interest.
In this example, we're translating the box by [0.0, 0.0, 0.5], which positions it in the
right half of the view volume, since Screen space is a box from [-1,-1,-1] to [1,1,1].


\
SCHEDULER
We've got your back!
jqxScheduler widget displays a set of Appointments in Day, Week, Month, Timeline Day, Timeline Week and Timeline Month views


Back after trip to Bend with friends after Christmas. Fabulous time apart from Amber still fighting the coughing and passing it to me...
12/29/2008, 9:25:05 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Back after trip to Bend with friends after Christmas. Fabulous time apart from Amber still fighting the coughing and passing it to me...
12/29/2008, 9:25:05 AM
Favs: 0
Retweets: 0
link


© 2016 {{.website}}
RSS
Website build by YingBlog, powered by Golang, go-sqlite3
Build Version {{.goVersion}}. Based on AnmzeUI. Editor from editor.md. Icon from Jack Cai {{loadtimes .startTime}}.


Nicola Sturgeon crowned Scottish Politician of the Year for fifth time
by Sean MurphyFirst Minister Nicola Sturgeon has been crowned Scottish Politician of the Year for a record fifth time.
The SNP leader faced off against fellow finalists Scottish Conservative leader Jackson Carlaw and Scottish Green MSP John Finnie before taking the top award at this year’s event.
When collecting her award Ms Sturgeon said that she, and the other politicians in the room didn’t come into politics to “win awards”, and that they would much prefer to “win elections”.
She added that though they may have much that divides them, every Scottish politician does the “very best they can” for those they serve.
Her party won big on the night, with Joanna Cherry named Best Scot at Westminster, Finance Secretary Derek Mackay taking the Politics in Business award, and Glasgow City Council leader Susan Aitken crowned Local Politician of the Year.
Sir Paul Grice, who stepped down as Holyrood’s chief executive in June after 20 years in the role, was honoured with a special lifetime achievement award.
Ms Sturgeon’s fellow finalist and Holyrood rival Jackson Carlaw was named as the Donald Dewar Debater of the Year by the judges with praise given to his performances in the Holyrood chamber.
Scottish Green MSP Ross Greer was named the One to Watch, while Conservative MSP Murdo Fraser was given the title of E-Politician of the Year.
For all the latest Scottish news, sport and features click here , or head to our Facebook , Twitter and Instagram pages.


A tiny library to help with "Interface Previews" while data is being loaded, similar to Facebook.
While user is waiting for data to be loaded, he is shown a preview of the interface with placeholders instead of real data. They improve user experience because users can use the time normally spent looking at a white screen or an AJAX spinner getting familiar with the layout of your app.
Read More: Non-blocking UI's with interface previews
Source Code: Github

Wait for it...

Wait for it...

No new posts to show.

$('#container').hasLoaded();
This will have no effect if you appended elements to the container, but if there are no elements to show, this function will make "No new posts..." visible.
MIT Licensed.


This is a multi-part message in MIME format.
Dear AMY,
You have a loan payment due on 3/19/2016 for $174.00.
If this is your first payment, please ignore this reminder - you?ve alre=
ady authorized Prosper to take your first payment via electronic transfe=
r from your bank account.
For all others: If you have not scheduled a payment, please manually sub=
mit your payment by the due date.
Go to my account:
http://www.prosper.com/account/overview?utm_source=3Dborrower_payment_du=
e&utm_medium=3Demail&utm_campaign=3Dsystem_event&utm_content=3Dmake_paym=
ent
Loan ID: 504174
Payment due date: 3/19/2016
Total payment due: $174.00
Regards,
Prosper
Notice to Servicemembers
Servicemembers on "active duty" or "active service" may be entitled to=
certain legal protections and debt relief pursuant to the Servicemember=
s Civil Relief Act (SCRA). For questions about the SCRA, Servicemembers=
should contact their unit's Judge Advocate, or their installation's Leg=
al Assistance Officer. A military legal assistance office locator for=
all branches of the Armed Forces is available at http://legalassistance=
.law.af.mil/content/locator.php.
Dear AMY,
You have a Prosper loan payment due on 3/19/2016 for $174.00=
. If you've already made this payment, thank you. No action is needed=
on your part.


--- title: Access Grants excerpt: Grant access to Wello Soft private repo! hero: https://res.cloudinary.com/wellosoft/image/upload/home/Evil_Duck_CR_-_Copy.jpg layout: compress permalink: /grants/ ---
{% include meta.html %} {% include head.html %}If you're one of my customer that bought this asset on Asset Store:
TEXDraw | Engine4 | Camera Projecter | Simple Procedural Skybox
Means you've come to right place to ask an access to core repository that I setup private on GitLab! 😁
Just fill the required information below 👇


{% extends "_base.html" %} {% block content %}
{% trans %}Here are the last posts:{% endtrans %}
And here you can learn about me.


The goal of this module is to provide utility functions for media like audio,
video, or image post-processing among others things (for example other devices, camera, etc.).
The API in this module will be changing with time, and right now there’s
only one utility method implemented under the Image object.
Object: Image
Povides utility functions for manipulating images.
Image Method: postProcess
Creates a temporary scene with a plane, used to post-process textures and render the
job to other texture(s) or to the main screen.
Syntax:
Media.Image.postProcess(options);
Arguments:
options - (object) An object with the following properties:
Options:
program - (string) The program id to be used for rendering.
fromTexture - (mixed) Can be an array of strings or just a string. The texture ids to send to the shaders when rendering.
toFrameBuffer - (string, optional) The id of the framebuffer to render the scene to. The associated texture will have as id the framebuffer id plus -texture as suffix.
toScreen - (boolean, optional) Set this to true to render the result to the screen. Default’s false.
aspectRatio - (number, optional) Sets the aspect ratio for the camera. If not specified it’s automatically set.
viewportX - (number, optional) The offset with of the frame. Default’s 0.
viewportY - (number, optional) The offset height of the frame. Default’s 0.
width - (number, optional) The with of the frame. Default’s the with of the canvas.
height - (number, optional) The height of the frame. Default’s the height of the canvas.
uniforms - (object, optional) An object descriptor with the name and value of the uniforms to be sent to the shaders. Default’s an empty object.
Examples:
In the
World Flights
example we use image post-processing to create a pseudo bloom filter.
Notes:
You can find other examples in the hoc folder in the source code at GitHub.


Blackbody Calibration Automation
Derek Bean
June 6 2016
Infrared Thermography
- 2D temperature profiles
- Non intrusive measurement technique
- Accurate temperature measuerments
- High speed data collection
Calibrating an Infrared Camera
Software Architecture
Control Code
Image Analysis
- Load/convert files
- Image viewing
- ROI determination
- Background subraction
- Uniformity
Camera Control
Ethernet based communication with GenICam standard
- Change settings
- Select filter
- Capture images
Black Body Control
Serial communication with microcontroller
- Changes settings of the blackbody
- Reads current temperature
- Automatic cooldown
Command Line Inputs
# Camera Settings
camera_name: SC6700
integration_time: 1e-4
frame_width: 512
frame_height: 512
x_offset: 56
y_offset: 24
# Temperature profile
termperatures:
- 100
- 200
- 400
Current progress
- Blackbody control
- .sfmov converter
- Image tools
Short term goals
- Camera control
- Main control
- Finalize test suite
- Command line inputs
Long term goals
- Automatic Non Uniformity Correction (NUC)
- Integrate RADCAL
- Speed up .sfmov converter
- Automatic ROI detection
- Dead pixel correction


Behold the Gopher!
u-root
u-root is an embeddable root file system intended to be placed in a flash device as part of the firmware image, along with a Linux kernel. Unlike most embedded root file systems, which consist of large binaries, u-root only has five: an init program and four Go compiler binaries.
Setup
On an Ubuntu system, install prerequisites and ensure Go is at least version 1.7:
sudo apt-get install git golang build-essential
go version
Set your GOPATH
:
export GOPATH="$HOME/go"
Clone u-root:
go get github.com/u-root/u-root
cd "$GOPATH/src/github.com/u-root/u-root"
Generate an initramfs of all u-root Go tools:
go run u-root.go -o initramfs.cpio
You can use this initramfs with your favorite Linux kernel in QEMU to try it out.
More instructions can be found in the repo's README.md.
Submitting Changes
We use GitHub Pull Requests for code review. Pull requests must receive one approval and pass CI before being merged.
For convenience, it is recommended to use this pre-commit hook:
ln -s -f ../../scripts/pre-commit .git/hooks/pre-commit
FAQs
So, why "u-root"?
It's to reflect a universal root, you can mount on every local and get a userland portable (it's a goal).
Any publications?
- USENIX 2015 ATC Paper
- USENIX 2015 ATC Talk
- Related: Embedded Linux Conference 2017 LinuxBoot Talk (YouTube video, slides)
Community
- Join the mailing list
- Join slack (Get an invite here.)
- Checkout the roadmap


This is an inline formatting context block and this:
is an absolutely positioned div in the middle of it.
Another span.


In this project, we are trying to identify and mark the lane lines on the road. We first identify it on a image and later employ the same functions to use it in a video stream. Primarily we will be using Python and OpenCV for this project. The steps involved can be broadly classified into few major steps/techniques.
The following steps/techniques are used:
Load the required libraries. Apart from the standard libraries (matplot, os, glob and numpy), we would be using the following:
cv2
for OpenCVmoviepy
for Video conversionimport cv2
import os, glob
import numpy as np
import matplotlib.pyplot as plt
from moviepy.editor import VideoFileClip
from IPython.display import HTML
%matplotlib inline
Helper function show_image(s) for single/multiple images
used to display images.
def show_image(image, cmap=None):
"""Displays a single image"""
cmap = 'gray' if len(image.shape)==2 else cmap
plt.imshow(image, cmap=cmap)
plt.show()
def show_images(images, cols = 2, cmap=None, figsize=(10, 11)):
'''Displays a list of images'''
rows = (len(images)+1)//cols
plt.figure(figsize=figsize)
for i, image in enumerate(images):
plt.subplot(rows, cols, i+1)
cmap = 'gray' if len(image.shape)==2 else cmap
plt.imshow(image, cmap=cmap)
plt.tight_layout(pad=0, h_pad=0, w_pad=0)
plt.show()
Load the test images for a visual inspection.
test_images = [plt.imread(path) for path in glob.glob('test_images/*.jpg')]
show_images(test_images)
#show_image(test_images[0])
Observation: The Lane Lines to be detected are either in white or yellow. We also have lines which are not continous. All of these has to be marked as continous lines by our program.
By default we load the images that have been provided to us in RGB color space. We need to verify if RGB is good enough to detect the white and yellow lanes
def detect_white_yellow_for_rgb(image):
'''Detect/Filter White & Yellow in a RGB image'''
# create a white color mask using range RGB[200,200,200 to 255,255,255]
l_thresh = np.uint8([200, 200, 200])
u_thresh = np.uint8([255, 255, 255])
white_mask = cv2.inRange(image, l_thresh, u_thresh)
# create a yellow color mask using range RGB[190,190,0 to 255,255,255]
l_thresh = np.uint8([190, 190, 0])
u_thresh = np.uint8([255, 255, 255])
yellow_mask = cv2.inRange(image, l_thresh, u_thresh)
# combine both the masks into a single mask. This will allow for either white or yellow range
comb_mask = cv2.bitwise_or(white_mask, yellow_mask)
masked_img = cv2.bitwise_and(image, image, mask = comb_mask)
return masked_img
show_images(list(map(detect_white_yellow_for_rgb, test_images)))
#show_image(detect_white_yellow_for_rgb(test_images[0]))
This looks good, but we shall still see how things are in other Color Spaces (HSV & HSL)
Let us first see the images in HSV color space.
def convert_to_hsv(image):
return cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
show_images(list(map(convert_to_hsv, test_images)))
# show_image(convert_to_hsv(test_images[0]))
Yellow lines looks good, but not so the white lanes.
Let us now see the images in HSL color space.
def convert_to_hls(image):
return cv2.cvtColor(image, cv2.COLOR_RGB2HLS)
show_images(list(map(convert_to_hls, test_images)))
# show_image(convert_to_hls(test_images[0]))
Here both the white and yellow lines looks good.
Let us filter out the white and yellow lines from the HSL format. We should fine tune the particular range of each channels (Hue, Saturation and Light) repeatedly.
def detect_white_yellow_for_hsl(image):
'''Detect/Filter White & Yellow in a HSL image'''
converted = convert_to_hls(image)
# create a white color mask using range HSL[0,200,0 to 255,255,255]
l_thresh = np.uint8([ 0, 200, 0])
u_thresh = np.uint8([255, 255, 255])
white_mask = cv2.inRange(converted, l_thresh, u_thresh)
# create a white color mask using range HSL[10,0,100 to 40,255,255]
l_thresh = np.uint8([ 10, 0, 100])
u_thresh = np.uint8([ 40, 255, 255])
yellow_mask = cv2.inRange(converted, l_thresh, u_thresh)
# combine both the masks into a single mask. This will allow for either white or yellow range
comb_mask = cv2.bitwise_or(white_mask, yellow_mask)
masked_img = cv2.bitwise_and(image, image, mask = comb_mask)
return masked_img
white_yellow_images = list(map(detect_white_yellow_for_hsl, test_images))
# white_yellow_image = detect_white_yellow_for_hsl(test_images[0])
show_images(white_yellow_images)
# show_image(white_yellow_image)
We use the techinique of Canny Edge Detection to detect edges in the images (in effect the major shapes in the image). This works better when the image is GRAY scaled and SMOOTHED in order remove unwanted noice.
Before using Canny Edge detection, we shall convert the images to GRAY scale as it helps to identify the shapes/edges better (better pixel intensity difference).
def convert_to_gray(image):
return cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
gray_images = list(map(convert_to_gray, white_yellow_images))
# gray_image = convert_to_gray(white_yellow_image)
show_images(gray_images)
# show_image(gray_image)
Edges are detected by identifying the rapid change of pixel intensity. But as you can see above, there is certain noice factor in the images due to rough edges which impacts the detection of lines. So we smooth out the edges before trying to detect them. The value of the kernel-size determines the size of matrix used to smooth (this should be a positive and odd number).  Fine-tune and find a good value.
def smooth_by_blur(image, kernel_size=15):
return cv2.GaussianBlur(image, (kernel_size, kernel_size), 0)
smoothed_images = list(map(lambda image: smooth_by_blur(image), gray_images))
# smoothed_image = smooth_by_blur(gray_image)
show_images(smoothed_images)
# show_image(smoothed_image)
Points to consider for Edge Detection:
We would be using two parms - lower-threshold & upper-threshold. The values are selected based on the below criterias.
Use trial and error to identify the values here which will retain the required edges and remove the noice.
def detect_edges(image, l_thresh=50, h_thresh=150):
return cv2.Canny(image, l_thresh, h_thresh)
edge_images = list(map(lambda image: detect_edges(image), smoothed_images))
# edge_image = detect_edges(smoothed_image)
show_images(edge_images)
# show_image(edge_image)
We shall focus our attention to a polygon shape where we expect to find the lane lines and ignore the remaining areas in the image (like other lanes, sky, hills). We do this basically by applying a mask.
def mask_select_region(image):
"""
Define the polygon by identifying the four vertices.
Define the mask color (black) and shape (based on channels)
Except for the region bounded by the vertices, other area is set to black(0).
"""
rows, cols = image.shape[:2]
bottom_left = [cols*0.05, rows*0.99]
top_left = [cols*0.4, rows*0.6]
bottom_right = [cols*0.95, rows*0.99]
top_right = [cols*0.6, rows*0.6]
vertices = np.array([[bottom_left, top_left, top_right, bottom_right]], dtype=np.int32)
mask = np.zeros_like(image)
if len(mask.shape)==2:
ignore_mask_color = 255
else:
ignore_mask_color = (255,) * mask.shape[2]
cv2.fillPoly(mask, vertices, ignore_mask_color)
masked_image = cv2.bitwise_and(image, mask)
return masked_image
masked_images = list(map(mask_select_region, edge_images))
# masked_image = mask_select_region(edge_image)
show_images(masked_images)
# show_image(masked_image)
We use Hough transform to identify lines in the edge images. There are multiple parameters to be defined here.
rho
and theta
are the Hough Space parameters
threshold
is the minimum votes required for the selected lines
min line length
is the minimum length of the line segment to be accepted
max line gap
is the max value for the gap allowed between points on single line
Please refer cv2.HoughLinesP
in opencv documentation for more details.
def hough_lines(image):
"""
Uses the edge-image as input and produces the hough-lines as output
rho=1
theta=np.pi/180
threshold=20
minLineLength=20
maxLineGap=300
"""
return cv2.HoughLinesP(image, rho=1, theta=np.pi/180, threshold=20, minLineLength=20, maxLineGap=300)
list_of_lines = list(map(hough_lines, masked_images))
# list_of_line = hough_lines(roi_image)
Draw the lines onto the original images.
def draw_lines(image, lines, color=[255, 0, 0], thickness=2):
image = np.copy(image)
for line in lines:
for x1,y1,x2,y2 in line:
cv2.line(image, (x1, y1), (x2, y2), color, thickness)
return image
line_images = []
for image, lines in zip(test_images, list_of_lines):
line_images.append(draw_lines(image, lines))
# line_image = draw_lines(test_images[0], list_of_line)
show_images(line_images)
# show_image(line_image)
In the process of fine-tuning the detected lines, the multiple lines detected for a lane line should be averaged to a single line and where ever the lines are partially recognized, it should extrapolated to make it a full lane line.
Additionally, classify the lane line as left/right based on teh slope of the line. Normally the left lane comes with positive slope, but in the image y-coordinate is from top-to-bottom, hence left lane has a negative slope and right-lane has positive slope.
def average_lines_to_lane(lines):
'''
Accumulate the left and right lines (in slope/intercept form) and their weights (length)
Deciding whether left/right lane is based on the slope
More weight is added to longer lines
Output is the average slope and intercept for the left and right lanes of each image.
'''
left_lines = []
right_lines = []
left_wts = []
right_wts = []
for line in lines:
for x1, y1, x2, y2 in line:
if x2==x1:
continue # ignore the vertical lines, slope in INF
slope = (y2-y1)/(x2-x1)
intercept = y1 - slope*x1
length = np.sqrt((y2-y1)**2+(x2-x1)**2)
if slope < 0: # neg-slope is left-lane since y is reversed in image
left_lines.append((slope, intercept))
left_wts.append((length))
else: # pos-slope is right-lane since y is reversed in image
right_lines.append((slope, intercept))
right_wts.append((length))
# Defined as dot product of weights & lines divided by weights
if len(left_wts) >0:
left_lane = np.dot(left_wts, left_lines) /np.sum(left_wts)
else:
left_lane = None
if len(right_wts)>0:
right_lane = np.dot(right_wts, right_lines)/np.sum(right_wts)
else:
right_lane = None
return left_lane, right_lane
We would need the x-y coordinates (in pixel points) to draw the lanes. This will be derived from the slope and intercept.
def slopeint_to_xy_points(y1, y2, line):
"""
Input: y coordinates along with the slope and intercept
Output: x-y coordinates (in pixel points) of the line segment
"""
if line is None:
return None
slope, intercept = line
x1 = int((y1 - intercept)/slope)
x2 = int((y2 - intercept)/slope)
y1 = int(y1)
y2 = int(y2)
return ((x1, y1), (x2, y2))
def get_final_leftright_lines(image, lines):
"""
image - on which the lane to be drawn
lines - all lines identified
Find the average line for left and right and return in xy coordinate form
"""
llane, rlane = average_lines_to_lane(lines)
# We need to decide the start and end of the lane-lines that we are drawing
# We shall start from the bottom of the image and draw till somewhere a little less than the middle of image.
y1 = image.shape[0]
y2 = y1*0.6
l_line = slopeint_to_xy_points(y1, y2, llane)
r_line = slopeint_to_xy_points(y1, y2, rlane)
return l_line, r_line
def draw_lane_on_image(image, lines, color=[255, 0, 0], thickness=10):
"""
image - on which the lane to be drawn
lines - x and y points of the line to be drawn (x1, y1), (x2, y2)
color - red [255,0,0]
thickness - 10
"""
l_image = np.zeros_like(image) # copy the image
for line in lines:
if line is not None:
cv2.line(l_image, *line, color, thickness)
# returns the weighted sum of two images
# src1*alpha + src2*beta + gamma
return cv2.addWeighted(image, 1.0, l_image, 0.95, 0.0)
Let us pull all things together and see how our final image would be.
Input will be the images and list-of-lines (from hough lines)
lane_images = []
for image, lines in zip(test_images, list_of_lines):
lane_images.append(draw_lane_on_image(image, get_final_leftright_lines(image, lines)))
# lane_image = draw_lane_on_image(test_images[0], get_final_leftright_lines(test_images[0], list_of_line))
show_images(lane_images)
# show_image(lane_image)
Create a class (FindingLanes) which would include all your pipeline steps.
We will use this to process our video clips.
from collections import deque
QUEUE_LENGTH=50
class FindingLanes:
def __init__(self):
self.left_lines = deque(maxlen=QUEUE_LENGTH)
self.right_lines = deque(maxlen=QUEUE_LENGTH)
def process_img(self, image):
wy_hsl = detect_white_yellow_for_hsl(image)
gray = convert_to_gray(wy_hsl)
smoothed_gray = smooth_by_blur(gray)
edges = detect_edges(smoothed_gray)
regions = mask_select_region(edges)
h_lines = hough_lines(regions)
left_line, right_line = get_final_leftright_lines(image, h_lines)
def mean_line(line, lines):
if line is not None:
lines.append(line)
if len(lines)>0:
line = np.mean(lines, axis=0, dtype=np.int32)
line = tuple(map(tuple, line))
return line
left_line = mean_line(left_line, self.left_lines)
right_line = mean_line(right_line, self.right_lines)
return draw_lane_on_image(image, (left_line, right_line))
def lane_in_video(v_in, v_out):
lanefinder = FindingLanes()
in_path = os.path.join('test_videos', v_in)
out_path = os.path.join('test_videos_output', v_out)
v_clip = VideoFileClip(in_path)
processed = v_clip.fl_image(lanefinder.process_img)
processed.write_videofile(out_path, audio=False)
Let's try the one with the solid white lane on the right first ... All outputs are available in the 'test_videos_output' folder
lane_in_video('solidWhiteRight.mp4', 'solidWhiteRight_out.mp4')
lane_in_video('solidYellowLeft.mp4', 'solidYellowLeft_out.mp4')
lane_in_video('challenge.mp4', 'challenge_out.mp4')
This concludes the project. Thank you.


User Administration - Reports can be accessed as follows:
- Click the Reports tab within User Administration - Choose User.
User Administration - Reports contains service request information for all open requests, as well as for requests completed in the past 30 calendar days.
User Administration - Reports contains the following information:
Request Report (contains view-only fields)
The following information displays in table format:
- Request ID – A sequential number allocated to every request.
- User ID – Client-Central user ID of the user.
- User Name – First and last name of the user.
- Request Type – Type of service requested.
- Request Date – Date of the service request.
- Status – Current status of the request.
- Deliver To – Name of the person designated to receive the token.
- Address – Destination street address of the shipment.
- City, State ZIP – Destination city, state, and ZIP code of the shipment.
Buttons, links, and icons contained in User Administration - Reports:
Buttons
None
Links
Print – Prints the contents displayed in the Request Report table.
Icons
None


General
All imported and exported data files must reside on the same machine as that serving the database.
You must initialize a database using db-util before importing data.
Proximity automatically converts all attribute names to lower case when importing data; attribute values retain their original case.
Use specialized export functionality available through the Proximity Database Browser to export attribute or NST data to tab-delimited text files.
Delete a database by deleting its files in the
dbfarm
directory in your local MonetDB
installation.
XML import and export
The
DTD,
for the XML data format prox3db.dtd
, must
reside in the same directory as the import data file.
Copy the DTD file from
$PROX_HOME/resources/
to the directory
containing the data file before importing data.
For compatibility with MonetDB, single quotes, double quotes, and newline characters in the XML data are automatically changed to underscores during import.
The XML data format and associated utilities provide limited error checking against some data corruption problems by restricting the types of data that can be imported into an exiting database.
To override the default restrictions on importing XML data into
existing databases, set the import script noChecks
parameter to true.
Exporting a container to XML exports all the container’s subgraphs, any attributes on those subgraphs, and any containers nested within the specified container, but not the container’s attributes.
Plain text import and export
The plain text data format and associated utilities provide no error checking; you are completely responsible for the consistency and integrity of your imported data.
For compatibility with MonetDB, convert single quotes, double quotes, and newline characters to underscores in a pre-processing step before importing data using the plain text format.
Additional Information
See Appendix C, Proximity XML Format for a description of the XML data format.
See Appendix D, Proximity Text Data Format for a description of the plain text data format.


Contact sipb-hwops [at] mit [dot] edu with questions and corrections.
{% if user %}Signed in as {{ user }}. Sign out?{% else %}Sign in to edit{% endif %}
{% if user and not can_update %}No edit permission.
{% endif %}Navigation: Back
| SKU | {{ part.sku }} |
| Description | {{ part.description }} |
| Comments | {{ part.comments }} |
| Stock | {{ stock }} |
| Last Updated | {{ part.last_updated }} by {{ part.last_updated_by }} |
Stock-keeping history:
{% if can_update %}{% endif %}


Spurs Mavericks Basketball 19 Nov 2019, 04:45 by Richard W. Rodriguez (AP Photo/Richard W. Rodriguez)Richard W. Rodriguez As featured on


A suite of non-parametric, visual tools for assessing differences in data structures for two datasets that contain different observations of the same variables. These tools are all based on Principal Component Analysis (PCA) and thus effectively address differences in the structures of the covariance matrices of the two datasets. The PCASDC tools consist of easy-to-use, intuitive plots that each focus on different aspects of the PCA decompositions. The cumulative eigenvalue (CE) plot describes differences in the variance components (eigenvalues) of the deconstructed covariance matrices. The angle plot presents the information loss when moving from the PCA decomposition of one dataset to the PCA decomposition of the other. The chroma plot describes the loading patterns of the two datasets, thereby presenting the relative weighting and importance of the variables from the original dataset.
| Version: | 0.8.0 |
| Depends: | R (≥ 3.2.2) |
| Imports: | reshape2, methods, pander, ggplot2, Matrix |
| Published: | 2017-04-19 |
| Author: | Anne H. Petersen [aut, cre], Bo Markussen [aut] |
| Maintainer: | Anne H. Petersen <ahpe at sund.ku.dk> |
| BugReports: | https://github.com/annepetersen1/PCADSC/issues |
| License: | GPL-2 |
| URL: | https://github.com/annepetersen1/PCADSC |
| NeedsCompilation: | no |
| CRAN checks: | PCADSC results |
| Reference manual: | PCADSC.pdf |
| Package source: | PCADSC_0.8.0.tar.gz |
| Windows binaries: | r-devel: PCADSC_0.8.0.zip, r-release: PCADSC_0.8.0.zip, r-oldrel: PCADSC_0.8.0.zip |
| OS X binaries: | r-release: PCADSC_0.8.0.tgz, r-oldrel: PCADSC_0.8.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=PCADSC to link to this page.


| add_global_p | Adds the global p-value for a categorical variables |
| add_global_p.tbl_regression | Adds the global p-value for categorical variables |
| add_global_p.tbl_uvregression | Adds the global p-value for categorical variables |
| add_n | Adds column with N to gtsummary table |
| add_n.tbl_summary | Add column with N |
| add_n.tbl_survfit | Add column with number of observations |
| add_n.tbl_svysummary | Add column with N |
| add_nevent | Add number of events to a regression table |
| add_nevent.tbl_regression | Add number of events to a regression table |
| add_nevent.tbl_survfit | Add column with number of observed events |
| add_nevent.tbl_uvregression | Add number of events to a regression table |
| add_overall | Add column with overall summary statistics |
| add_overall.tbl_summary | Add column with overall summary statistics |
| add_overall.tbl_svysummary | Add column with overall summary statistics |
| add_p | Adds p-values to gtsummary table |
| add_p.tbl_cross | Adds p-value to crosstab table |
| add_p.tbl_summary | Adds p-values to summary tables |
| add_p.tbl_survfit | Adds p-value to survfit table |
| add_p.tbl_svysummary | Adds p-values to svysummary tables |
| add_q | Add a column of q-values to account for multiple comparisons |
| add_stat | Add a custom statistic column |
| add_stat_label | Add statistic labels |
| all_categorical | Select helper functions |
| all_character | Select helper functions |
| all_continuous | Select helper functions |
| all_dichotomous | Select helper functions |
| all_double | Select helper functions |
| all_factor | Select helper functions |
| all_integer | Select helper functions |
| all_logical | Select helper functions |
| all_numeric | Select helper functions |
| as_flex_table | Convert gtsummary object to a flextable object |
| as_gt | Convert gtsummary object to a gt object |
| as_hux_table | Convert gtsummary object to a huxtable object |
| as_kable | Convert gtsummary object to a kable object |
| as_kable_extra | Convert gtsummary object to a kableExtra object |
| as_tibble.gtsummary | Convert gtsummary object to a tibble |
| bold_italicize_labels_levels | Bold or Italicize labels or levels in gtsummary tables |
| bold_labels | Bold or Italicize labels or levels in gtsummary tables |
| bold_levels | Bold or Italicize labels or levels in gtsummary tables |
| bold_p | Bold significant p-values or q-values |
| combine_terms | Combine terms in a regression model |
| inline_text | Report statistics from gtsummary tables inline |
| inline_text.tbl_cross | Report statistics from cross table inline |
| inline_text.tbl_regression | Report statistics from regression summary tables inline |
| inline_text.tbl_summary | Report statistics from summary tables inline |
| inline_text.tbl_survfit | Report statistics from survfit tables inline |
| inline_text.tbl_svysummary | Report statistics from summary tables inline |
| inline_text.tbl_uvregression | Report statistics from regression summary tables inline |
| italicize_labels | Bold or Italicize labels or levels in gtsummary tables |
| italicize_levels | Bold or Italicize labels or levels in gtsummary tables |
| knit_print.gtsummary | print and knit_print methods for gtsummary objects |
| modify | Modify column headers, footnotes, and spanning headers |
| modify_footnote | Modify column headers, footnotes, and spanning headers |
| modify_header | Modify column headers, footnotes, and spanning headers |
| modify_spanning_header | Modify column headers, footnotes, and spanning headers |
| print.gtsummary | print and knit_print methods for gtsummary objects |
| print_gtsummary | print and knit_print methods for gtsummary objects |
| reset_gtsummary_theme | Set a gtsummary theme |
| select_helpers | Select helper functions |
| set_gtsummary_theme | Set a gtsummary theme |
| show_header_names | Modify column headers, footnotes, and spanning headers |
| sort_p | Sort variables in table by ascending p-values |
| style_number | Style numbers |
| style_percent | Style percentages |
| style_pvalue | Style p-values |
| style_ratio | Style significant figure-like rounding for ratios |
| style_sigfig | Style significant figure-like rounding |
| tbl_cross | Create a cross table of summary statistics |
| tbl_merge | Merge two or more gtsummary objects |
| tbl_regression | Display regression model results in table |
| tbl_stack | Stacks two or more gtsummary objects |
| tbl_summary | Create a table of summary statistics |
| tbl_survfit | Creates table of survival probabilities |
| tbl_survfit.data.frame | Creates table of survival probabilities |
| tbl_survfit.list | Creates table of survival probabilities |
| tbl_survfit.survfit | Creates table of survival probabilities |
| tbl_svysummary | Create a table of summary statistics from a survey object |
| tbl_uvregression | Display univariate regression model results in table |
| theme_gtsummary | Available gtsummary themes |
| theme_gtsummary_compact | Available gtsummary themes |
| theme_gtsummary_journal | Available gtsummary themes |
| theme_gtsummary_language | Available gtsummary themes |
| theme_gtsummary_printer | Available gtsummary themes |
| trial | Results from a simulated study of two chemotherapy agents |


Regression for Prediction
After running the function regress on Matlab using the dataset, we get the residual graph as in the left.
Red line stands for nodes with abnormal confidence interval and residual pairs while green line stands for normal ones.
To test which factors contribute most to the accuracy of linear regression function and which ones adversely damage it, we remove one factor at a time in turn and run regress again on Matlab, then compare the result we get.
After removing the last factor GDP, we get the graph in the middle, which still has abnormal node samples but is apparently better than the original one.
After removing the factor (clos_XAGUSD * vol_XAGUSD), we get the graph in the right, which is similar to the original one.
For the other factors, the removal of any of them leads to a result similar to or even worse than the original one.
In conclusion, the factor GDP maybe one factor that does harm to the accuracy of linear regression.
To analyze it, we think the main reason is that GDP is a variable on a year basis, inconsistent with other factors which are on a month basis. To uniform them, we do linear interpolation to the annually GDP dataset, making them a monthly variable. However, this procedure damage the credibility of the data.


The renderers
element defines the collection of rendering functions that should be displayed in the list
of available renderers in the UI.
default
attribute enables setting one of predefined renderers. The selected renderer will be used
as default when the component is loaded.
renderer
element enables setting one of predefined renderers using its type attribute.
The aggregations
element defines the collection of aggregators that should be displayed in the dropdown
list of available aggregators in the UI.
default
attribute enables setting one of predefined aggregation functions. The selected function
will be used as default when the component is loaded.
aggregation
element is used in the same way as aggregation except for the enclosed
property element.
The aggregationProperties
element defines the list of attributes that should be displayed in the
dropdown lists of aggregators. Its value can be either a properties key or a generated attribute’s name.


{% extends "base.html" %} {% block content %} {% include "character/navbar.html" %}
| Subject | From | To | Details |
| {{ mail.subject }} | {{ mail.from_character.character_name }} | {% for recipient in mail.recipients %} {{ recipient.recipient_name }} {% endfor %} |


The Akan Culture from Ghana
Akan names are derived from Ghanian culture
Days :
Month:
Year :
GENDER
Date of Birth:
Akan Name:


Payments
Companies
Back
Add +
Companies
Company account
Company name
Company UNP
account
number
UNP
Delete company
×
Please confirm delete


Handle XMPP stuff.
- Source:
Namespaces
Members
-
<static> login
-
Create new connection or attach to old
- Source:
-
<static> login^2
-
Create new connection with given parameters.
- Source:
-
<static> login^3
-
Attach connection with given parameters.
- Source:
Methods
-
<private, static> _sendMessage(jid, msg, uid)
-
Create message stanza and send it.
Parameters:
Name Type Description jid
Jabber id msg
Message uid
unique id - Source:
-
<static> addBuddy(username, alias)
-
Add buddy to my friends
Parameters:
Name Type Description username
string jid alias
string - Source:
-
<private, static> attached()
-
Triggered if connection is attached
- Source:
-
<private, static> connected()
-
Triggered if connection is established
- Source:
-
<static> connectionReady()
-
Triggered if the connection is ready
- Source:
-
<private, static> disconnected()
-
Triggered if lost connection
- Source:
-
<static> getCapabilitiesByJid(jid)
-
Retrieves capabilities.
Parameters:
Name Type Description jid
- Source:
Returns:
List of known capabilities -
<static> loadVcard(bid, cb, error_cb)
-
This function loads a vcard.
Parameters:
Name Type Description bid
cb
error_cb
- Source:
-
<static> logout() → {Boolean}
-
Logs user out of his xmpp session and does some clean up.
- Source:
Returns:
- Type
- Boolean
-
<private, static> onAuthFail()
-
Triggered on auth fail.
- Source:
-
<private, static> onConnfail(condition)
-
Triggered on connection fault
Parameters:
Name Type Description condition
String information why we lost the connection - Source:
-
<private, static> onMessage(presence) → {Boolean}
-
Triggered on incoming message stanzas
Parameters:
Name Type Description presence
dom - Source:
Returns:
- Type
- Boolean
-
<private, static> onPresence(presence)
-
Triggered on incoming presence stanzas
Parameters:
Name Type Description presence
dom - Source:
-
<private, static> onRidChange(ev, data)
-
Triggerd if the rid changed
Parameters:
Name Type Description ev
event data
obejct - Source:
-
<private, static> onRoster(iq)
-
Triggered on initial roster load
Parameters:
Name Type Description iq
dom - Source:
-
<private, static> onRosterChanged(iq) → {Boolean}
-
Triggerd on roster changes
Parameters:
Name Type Description iq
dom - Source:
Returns:
True to preserve handler- Type
- Boolean
-
<static> removeBuddy(jid)
-
Remove buddy from my friends
Parameters:
Name Type Description jid
type - Source:
-
<static> resFriendReq(from, approve)
-
response to friendship request
Parameters:
Name Type Description from
string jid from original friendship req approve
boolean - Source:
-
<static> sendMessage(bid, msg, uid)
-
Public function to send message.
Parameters:
Name Type Description bid
css jid of user msg
message uid
unique id - Source:
-
<static> sendPres()
-
Sends presence stanza to server.
- Source:


{% extends 'layouts/form.html' %} {% block title %}Just Eat It: Register your profile{% endblock %} {% block content %}
In version 2.0 of Just Eat It, your de-identified demographic data will contribute to a crowd-sourced food allergy research database. Currently, in version 1.0, it is deactivated.
{% endblock %} {#TODO_v2: Registration / db backend for post-course unless time.#}


Image file:
Image files must be in JPEG, GIF, or PNG format.
Target directory:
Article Images
Banners/Advertisements
Filename (Optional):


see if you can take advantage of the locally validated notarization to make it even more efficient
it sounds like you are now making efficient getinfo requests
blackjok3r27-Jul-19 05:12 PM
yes it just rotates though the headers from last notarize to tip
doesnt stop trying to fetch them, because it must fetch it anyway
jl777c27-Jul-19 05:13 PM
exactly!
and it doesnt need to be any voting based system as all can be validated
blackjok3r27-Jul-19 05:14 PM
once it has enough then it can validate the chain tip, that said, once a noa happens it must fetch a heap of them again, I will fix that though doesnt seem hard
jl777c27-Jul-19 05:15 PM
just shifting the array should work as you should already have up to the chain tip and the new notarization is 5 to 10 blocks behind, but all those headers are alrady there
now just need to have reorg detection, which since building the data to chaintip is fast enough, can just reset the headers and start again
have a counter for how many times it had to be reset for this notarization and display in the local getinfo
when we see this as 1 or more, we know something funny is going on with the chain
blackjok3r27-Jul-19 05:16 PM
not sure it needs that tbh, as it saves all the headers it sees, and just loops backwards from blockhash to block hash, ignoring any that may no longer be in the main chain
jl777c27-Jul-19 05:17 PM
i guess even over a full day, RAM usage would only be 2MB. i was thinking of using fixed size buffer to limit ram usage
blackjok3r27-Jul-19 05:17 PM
I wish it could loop forwards form a notarizations, but you just cant
I clears them after a notarization
shouldnt use much at all, one sec I'll check it
jl777c27-Jul-19 05:19 PM
aha! yes, all the block headers between notarizations, shouldnt be much at all!
just free up all the memory and not matter how long it runs, will just be 20 to 40 headers, even if a chain split
get to where you feel it is efficient as can be and will be able to handle actively being reorged
then we can test it on ILN
blackjok3r27-Jul-19 05:21 PM
reorg detection should be as simple as detecting that the tiptime is not advancing
but I may be missing something
jl777c27-Jul-19 05:24 PM
it is a reorg if a new height comes in that doesnt link back to the old chaintip
in this case, treat it like a new notarization came in and reset to the latest notarization and build the data from scratch
that way, no matter how deep the reorg. it will get back to the chaintip
certainly if many reorgs are happening, then this will be in a volatile state, but as soon as we get the next notarization, it all stabilizes
blackjok3r27-Jul-19 05:42 PM
the problem with that is that, we dont know if its just that we are missing a block, or if the chain doesnt actually linkj though.
I thaught about this for quite a long time.
the solution I came up with was to just flag that the chain is either in sync or is not.
if it wont link back, its not in sync. if it does then it is
blackjok3r27-Jul-19 05:50 PM
unless all of your peers are on the wrong chain, it will eventually find the right one and flag its in sync
blackjok3r27-Jul-19 06:27 PM
ok I have it working without gaps now. Once a notarization comes in, it just stays in sync, without needing to fetch previous headers
Tiny Bitcoin Library written in C, with nSPV added - blackjok3rtt/libnspv
1
1
jl777c28-Jul-19 06:11 AM
great job!
awaiting PR
with this, it seems the only thing left is adding CC support. starting with cross chain migrates. probably need to have a separate executable/thread and is coordinating multiple nspv instances. that gets chain cluster support to mobile
blackjok3r28-Jul-19 06:30 AM
Still want to mess with it a bit more, Will make PR soon. Be good to test reorgs, as I cant really do that using KMD just running on tip.
jl777c28-Jul-19 07:20 AM
use ILN
to test reorgs as it is notarized and low hashrate
no rush, this sort of thing it needs to be precise
blackjok3r28-Jul-19 10:42 AM
Got node banning working
Once it is synced, it checks the headers being sent are in the main chain, and if not after 10 bad headers removes the node.
There is one node that is sending garbage or NULL for the headers in getinfo, so it made it quite easy.
I think also I have the network code to remove peers who stop responding activated again.
jl777c28-Jul-19 12:52 PM
probably some fullnode on an ancient version
there is also a version field returned with getinfo now, it is set to 1
anytime any of the strutures are changed, this will be changed and this allows to immediately detect an obsolete node
the other type would be a honest node, that is just not in sync yet. they can still provide useful info, so storing the height each node is at (many calls return that nodes height) and using that to filter height dependent requests
blackjok3r28-Jul-19 12:58 PM
Problem is that height doesnt nessarily mean that its the same block as other peers.
If they dont send you a header at all, how can you validate that they are on the correct chain, you can only assume that hte blockhash they sent is correct
blackjok3r28-Jul-19 01:14 PM
Pushed latest version, seems to be working very well for me, and should not crash if there are no notarizations for over 100 blocks.
blackjok3r28-Jul-19 01:30 PM
I assumed that they reson to keep track of the chain tip was to make sure you are only connected to nodes on the real chain. ?(edited)
@jl777c
jl777c28-Jul-19 01:34 PM
with nSPV there really isnt that much need for it, but it is always nice to know which peers are on the chaintip and returning valid data
feel free to keep improving it, the nspv will set the standard for superlite clients, i think primarily as it is the first one that is more than a whitepaper
but might as well make it as good as we can so the best anybody else can do is be second with one that is not any better
Also, could the nSPV be used to validate the notarizaittion txid on the chain being notarized to?
Like just connect to some peers and pull the txid and validate it?
jl777c28-Jul-19 01:56 PM
yes!
now that the single coin nspv is basically complete (other than CC)
we can move to all the cool things having multiple nspv instances active at once
the current design is just a single coin active, but most things are setup to be able to run multiple coins from a single instance
however it might be easier to make a different layer that uses multiple other nspv instances at the api level
ALL globals would need to be put into a globalvars structure and ALL functions that access any global will need to have the globals pointer passed into it to support multicoins in a single instance
blackjok3r28-Jul-19 01:58 PM
I dont think I habe anything else I need to do until the 2nd ... Maybe I will try this? Or should porting CC stuff be more important?
jl777c28-Jul-19 02:00 PM
which way feels better?
blackjok3r28-Jul-19 02:00 PM
Or should I go the iguana changes?
See if I can get delay working?
jl777c28-Jul-19 02:00 PM
ah, just adding a big delay would solve the NN bickering
that shouldnt take long, so maybe get that out of the way
putting all globals in a globals structure and passing the globals pointer into all functions, it is just a lot of code changes, but nothing too difficult to do
blackjok3r28-Jul-19 02:01 PM
One idea I had was to make it so that no nodes can receive any packets until the height has advanced one block past the block they agree on... That way its a fixed refernace point
could be avery long delay though
jl777c28-Jul-19 02:02 PM
since we are validating notarizations for all utxo, the current chaintip is more a comfort thing
oh, for the notary side
blackjok3r28-Jul-19 02:02 PM
yes sorry.
jl777c28-Jul-19 02:02 PM
yes, can just delay by one block
something simple and brute force
blackjok3r28-Jul-19 02:03 PM
Guess I'll have a look at that. I asked @Alright to help me test reorgs on nSPV, so while waiting I will have a look at iguan see what I can work out.
Being able to have nSPV connect to multiple chains at once, seems a worthy thing to spend some time on though aswell.
jl777c28-Jul-19 02:06 PM
yes
you understand the method that is needed to make nspv multicoin?
blackjok3r28-Jul-19 02:14 PM
Kind of.
jl777c28-Jul-19 02:19 PM
let me clarify
currently a specific coin is connected to a specific p2p network based on the chainparams
it then updates various global variables, mostly the NSPV_result structures
and now also the headers structures
so by making an all in one globals structure, like iguanas iguana_info struct
then all functions that update state of any global or even just need access to it must have a pointer to the right globals structure
the code can be transformed in place to have identical functionality, just with a globals structure allocated and passed to all functions
once that works, then a new "addcoin" api will then allow to dynamically add a new coin
once that is in place, then all the api calls would be done via each coins rpc port to determine which coin
but for things that span more than one coin, it would probably use a different port, or maybe use a "coin":"multi" parameter
iguana basically does this multicoin handling
blackjok3r28-Jul-19 02:25 PM
Yes, I pretty much understand how iguana is doing it. Doenst seema huge diffrence here.
jl777c28-Jul-19 02:26 PM
to get nspv working quickly, i used a lot of globals, so first step is to sweep all of them and i mean 100% all of them into a massive globals structure
and then pass the coins pointer to its globals down into each function that needs it and all global access goes through the globals pointer
seems this will be a good practice for you to transform a codebase from a single instance to multiinstance capable


We feel Pleasure to Introduce Ourselves as engineering Construction Company in the form of AK ENGINEERING CO. We have been serving in the field of execution of Ducting, Piping (fabrication & Erection), Heavy Structural (fabrication & Erection), Scaffolding, Blasting & Painting work as per client’s requirements / specifications.
AK ENGINEERING CO. will continue to play a major role in infrastructure development in INDIA. To help us achieve this aim, and grow our capacity and reach, we will be creating partnerships with further emerging contractors.
We shall be:
AK ENGINEERING CO. provides quality infrastructure development in the form of mechanical works of refinery projects. Excellent working relationships have been established with other key players in the industry, which have yielded great rewards.
To be a Treasure for your organization by Appling Our Present capabilities:
AK ENGINEERING CO. subscribe to the philosophy of retaining as much as possible of the natural flora and fauna. Clearance of sites is done with minimum damage to the environment. Where possible the natural flora or fauna is reinstated after completion of work.
We have been serving in the field of execution of Ducting, Piping(fabrication & erection), Heavy Structural(fabrication & Erection), Scaffolding and Painting work as per client's requirement.
We provide all kinds of Structure Fabrication & Erection work.
Check out some of our work here
Check out our Structure Fabrication & Erection works below
Check out our Painting works below
Check out our Scaffolding works below
We have worked with a number of awesome clinets
Some of our esteemed clients


The setup for you test environments and you production environments should vary to enable the best experience for you and your development environment and to your end users.
You should always load the components script from our CDN in an asynchronous manner. For example:
<script src="https://cdn.gomus.de/components/latest/components.min.js" async></script>
It is important that you set the domain for the go~mus instance to a staging environment. Clients normally have two environments, a staging and production environment, and for development the staging environment should always be used.
Staging environments can be identified by the -staging
part of the domain. For example if you have a go~mus instance called my
, then the production url would be my.gomus.de
and the staging instance my-staging.gomus.de
.
It is recommended that you develop against the latest version of the components using either /latest/components.min.js
or /v.0/components.min.js
. This means you keep up to date with the latest changes and bug fixes.
It is also recommended that you set the debug property in the global configuration to true. This enables the outputting of hints, warnings and errors in the browser console.
Before going live you should check that you global configuration is correct.
domain
needs to be pointed to the production instance of go~mus.shop_domain
needs to be set to your production website URL so that the redirects work properly./v.1.2.3/components.min.js
or /v.1.2/components.min.js
.go~mus components supports the most recent two versions of all major browsers: Chrome (including Android), Firefox, Safari (including iOS), and IE11 / Edge.
This includes the following specific versions:
| Chrome | Firefox | Edge | IE | Safari | iOS | Android | IE Mobile |
|---|---|---|---|---|---|---|---|
| latest | latest | 14 | 11 | 10 | 10 | Nougat (7.0)/Marshmallow (6.0) | 11 |
| 13 | 10 | 9 | 9 | Lollipop (5.0, 5.1) | |||
| 9 | 8 | 8 | KitKat (4.4) | ||||
| 7 | 7 | Jelly Bean (4.1, 4.2, 4.3) | - |


Data URIs are a powerful way to embed entire resources (images, HTML, etc) in the link itself. For example, the link
data:text/html,
Hello world!

displays an HTML page. Note that the HTML does not come from some external server, but from the link itself. Thus, you don't need a host to serve up HTML if you do it like this.
However, such links are long and clunky. If one could use a URL shortener, things would be great!
Unfortunately, URL shorteners do not accept Data URIs for security reasons.
URI Redirect redirects requests from this webpage to any other page specified as a GET parameter.
This tool works around the limitation of URL shorteners not accepting data URIs. For example, this will shorten properly, since this looks like a normal webpage to the shortener.
https://uriredirect.netlify.com/r.html?uri={{DATA URI}}
However, the shortened link will in turn redirect to the data URI specified.
Note: Data URIs (and thus the HTML) feature are not well supported in Internet Explorer.
https://uriredirect.netlify.com/r.html?uri={{URI}}
This is just for convenience. It is just a URI redirect for data:text/html,[[HTML]]
.
https://uriredirect.netlify.com/r.html?html={{URI}}


Free Music Archive
Monthly Top 5 (December 2019)
-
| Artist: |
Broke For Free |
| Track: |
Night Owl |
| Album: |
Directionless EP |
| Genre: |
Electronic, Minimal |
-
| Artist: |
Tours |
| Track: |
Enthusiast |
| Album: |
Enthusiast |
| Genre: |
Electronic, Dubstep |
-
| Artist: |
Monk Turner + Fascinoma |
| Track: |
It's Your Birthday! |
| Album: |
The New Birthday Song Contest |
| Genre: |
Uncategorized |
-
| Artist: |
Podington Bear |
| Track: |
Starling |
| Album: |
Solo Instruments |
| Genre: |
Electronic, Soundtrack |
-
| Artist: |
Jahzzar |
| Track: |
Siesta |
| Album: |
Traveller's Guide |
| Genre: |
Pop, Indie-Rock |
Music courtesy of the Free Music Archive (FMA)


lab01 : Crunching numbers: Loops and functions
| num | ready? | description | assigned | due |
|---|---|---|---|---|
| lab01 | true | Crunching numbers: Loops and functions | Tue 04/10 10:00AM | Mon 04/16 11:59PM |
Goals for this lab
In this lab you will get practice * working in pairs * learn to use github’s web interface * for loops and while loops * calculating a series using for loops and if-else statements * working with other data types (doubles) * nested loops * functions
Working in Pairs
You are not expected to finish the entire lab in one sitting. Please don’t rush through it and read all instructions carefully. We encourage you to work in pairs for this lab. You have been assigned a partner who has reported the same level of confidence and experience in programming as yourself. Find your pair partner at this link:
Pair partners and mentor groups for CS16
Please sit with your pair partner on the same terminal. Decide who will be the ‘driver’ and who will be the ‘navigator’. Choose who will be the driver for the first part of the lab. The driver should sit down in front of the computer now. The navigator gets a chair and sits next to the driver. You should exchange roles after awhile, before the driver gets tired, and before the navigator gets bored or distracted. See the following video on pair programming to work well with your partner:
http://bit.ly/pair-programming-video
You have also been assigned a mentor who will be your first point of contact, and will provide you with regular feedback during the rest of the quarter. Your mentor is an important resource. Do these steps to make the most of it
- Read your mentor’s profile
-
At the start of every lab, you and your partner should get together with your mentor group and mentor. We encourage you to sit next to your partner and near your mentor group. Check in with your mentor about your progress. Make sure that you always have the latest version of your code pushed to github before your weekly check-in with your mentor.
-
If you have questions about pair programming, ask your mentor.
-
If you reported a different partner to your mentor last week, please update your mentor before you proceed with the rest of the lab
- If your partner shows up late, let your mentor know. Points will be deducted for students who don’t show up on time. If you face difficulties with pair programming consult your mentor.
Log on and create a local directory
- Log into the driver’s CoE account on CSIL and open a terminal.
- Under your cs16 directory, driver create a new directory named lab01 (refer to lab00 for instructions if you have forgotten how to do this)
You are now ready to get the starter code.
Getting the starter code
Copy the code from the instructor’s account on the CSIL server into your local lab01 directory by issuing the following command:
$cp /cs/faculty/dimirza/cs16/labs/lab01/* ~/cs16/lab01/
After doing this command, if you cd into ~/cs16/lab01/ and use the ls command, you should see three .cpp files and a README:
-bash-4.2$ ls
min2.cpp min3v1.cpp min3v2.cpp README.md
-bash-4.2$
If you don’t see those files, work with your pair partner to go back through the instructions and make sure you didn’t miss a step. If you still have trouble, ask your mentor for assistance.
Create a repo on github in our class organization
For this lab and all subsequent programming assignments, you should start by creating a repo in the ucsb-cs16-s18-mirza organization. Follow these steps
- Navigate to your dashboard on https://github.com/. From the left drop down menu, select the class organization
-
Click on the green “New repository” button to create a new repository.
-
Type the name of your repo following the naming convention lab01_your-github-username. For example if your github username is jgaucho, you should name your repo as lab01_jgaucho. If you are working with a partner, include your partner’s github username in the name of the repo. e.g. lab01_jgaucho_alily
-
Select the “Private” visibility option so that other students in the org cannot view your code.
- Add the C++ .ignore option from the frop down menu and click on “Create repository”. See screenshot below.
-
Click on the “Create repo button”
-
Click on the “Settings” tab, then click on the “Collaborators and teams”. Search for your partner’s github username under collaborators and add them. Log out of github.
-
Navigator, log into github and accept the invitation.
-
You now have shared ownership of all the code that you will write for this lab.
Upload the initial version of your code using github’s web interface
-
Upload the files in your lab01 directory to the new repo you created in the previous step. To do this, you should be physically present on a lab machine or in CSIL where you have access to a web browser and a local copy of your files (min2.cpp min3v1.cpp min3v2.cpp README.md). On your web browser, navigate to your repo on github. Click on the “Upload files” button.
-
Now either drag and drop the files: from your machine or use the “Choose your files” option to browse through your local directory and upload the file. Then press the green “Commit new files” button. Navigate back to your repo to see that the files you uploaded are correctly listed. Click on it and you should see your code on github’s web interface.
Solving the problems for this lab
If you are in a pair, make sure you switch the driver and navigator roles at this point. You must switch roles twice more before the end of the lab. This assignment consists of 3 problems, each of which is described below. The first one is worth 20 points each, and the last two are worth 40 points each. Each should be solved in its own file and all three must be submitted for full assignment credit. These exercises are inspired by the ones from the textbook (in Ch. 2 and Ch. 3) - but they are NOT the same, so follow the instructions on THIS sheet carefully.
You will need to create three files named block.cpp, min4.cpp, and pi.cpp: Each corresponds to one of the problems listed below, which make up this lab.
For a reminder on how to open and use a text editor to create and edit new source files, refer back to Lab #0.
For all the subproblems given in this assignment you must compile your code frequently (as you develop it), and test it extensively with as many inputs as you can think of.
Print a block
- Navigate to your lab01 directory using the cd command
- open a file called
block.cpp
using the same editor you used for the previous labs. - In that file, write a program that takes an input from a user for the number of rows and number of columns and prints out a block of characters that is based on these 2 parameters. The program should keep asking the user for input, and printing out the result, until the user enters zero for either of the input parameters.
A session should look exactly like the following example (including whitespace and formatting - note that there is no whitespace at the end of each of these lines), for all the different inputs and the output:
$ ./block
Enter number of rows and columns:
1 5
X.X.X.X.X.
Enter number of rows and columns:
2 2
X.X.
X.X.
Enter number of rows and columns:
2 5
X.X.X.X.X.
X.X.X.X.X.
Enter number of rows and columns:
10 5
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
X.X.X.X.X.
Enter number of rows and columns:
0 1
Each string printed by the program should include a newline at the end, but no other trailing whitespace (i.e. extra space characters at the end of the line).
For this problem you have to use a for-loop and a while or do-while loop. We covered for-loops in class. While loops are similar in that the code inside the body of the while is repeated as long as the while condition is true. We will talk about this more in the next lecture. Here is the syntax for while
while('expression'){
//Repeat these statements
}
‘expression’ should be replaced by the appropriate boolean expression. The body of the loop is executed as long as the expression is true. e.g.
int x=5;
while(x>0){
cout <<x<<" ";
x--;
}
The above code prints 5 4 3 2 1.
To compile your code use the g++ command as in lab01 OR the simple make command as in lab01
$ g++ -std=c++11 -o block block.cpp
OR
make block
If you used the first option (g++ …) note that the -std=c++11 option in these commands is optional to use (that is, not critical to define). All this does is force the compiler to use the latest version of C++.
If you used the second option (make…) note that the make program is clever to compile only block.cpp into the block executable, even though there are other programs (cpp files) in that directory. Note that the C++11 compiler will not be used in the default make tool. But that should be okay for now.
If you encounter an error, use the compiler hints and examine the line in question. If the compiler messsage is not sufficient to identify the error, you can search online to see when the error occurs in general.
Run your executable as follows to test it out.
$ ./block
Remember to re-compile the relevant files after you make any changes to the C++ code.
Upload your files to your repo on github using github’s web interface following the instructions at the beginning of this lab.
Calculate the approximate value of PI
Switch roles with your partner.
Write a C++ program in a file named pi.cpp that approximates the value of the constant π. Once again you should not resort to using predefind constants and functions for π, that are provided by C++ standard libraries. Instead you should compute the value of π based on the Leibniz formula for π. The formula is given below:
1 – 1/3 + 1/5 – 1/7 + 1/9 ... = pi/4
Put another way, the formula can be written as:
pi = 4 · [ 1 – 1/3 + 1/5 – 1/7 + 1/9 ... + (–1 ^ n)/(2n + 1) ]
The Leibniz formula works well for high values of n.
The program takes an input from the user for the value of n, which determines the number of terms in the approximation of the value of pi. The program then outputs the approximated value of pi as calculated by the Leibniz formula. You must also include a loop that allows the user to repeat this calculation for new values of ‘n’ until the user says she or he wants to end the program by issuing an input of -1 (or any other negative number). You may assume that the user always inputs an integer.
The program should print a string of text to the terminal before getting each piece of input from the user. A session should look like the following example (including whitespace and formatting), showing the expected output for different inputs:
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
0
The approximate value of pi using 1 term is: 4.000
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
3
The approximate value of pi using 4 terms is: 2.895
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
9
The approximate value of pi using 10 terms is: 3.042
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
49
The approximate value of pi using 50 terms is: 3.122
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
99
The approximate value of pi using 100 terms is: 3.132
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
999
The approximate value of pi using 1000 terms is: 3.141
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
9999
The approximate value of pi using 10000 terms is: 3.141
Enter the value of the parameter 'n' in the Leibniz formula (or -1 to quit):
-1
Be sure to have a newline after each “Enter the value…” prompt and no other white spaces.
Here is a link that gives the approximated values of pi for up to 1000 terms: http://www.eveandersson.com/pi/gregory-leibniz
In addition, all approximated floating pointer numbers must be displayed to exactly three digits after the decimal point. To do this you should use set the precision for displaying floating point numbers before any of the cout statements in your code. This is done as follows:
cout.setf(ios::fixed); // Display in fixed point notation. For example, display 1e-1 as 0.1
cout.setf(ios::showpoint); // Always display the decimal point.
cout.precision(3); // Set the number of digits to display after the decimal point to 3
To calculate x to the power of y, use the pow(x,y) function from the standard library. To do this you will need to include the header file: cmath
Upload your files to your repo on github using github’s web interface. (You will need to be on a csil machine and not remotely logged in to do this step)
Calculate the minimum of 4 numbers
Switch roles with your partner.
In this part of the lab you will write a program that compares 4 input numbers and prints out the smallest one.
You should not use the min() function in C++ algorithm library or any other outside function that performs the minimum operation for you. Instead, you should base the program on the example programs provided to you that compare fewer inputs.
Start by examining the given examples, also described below:
min2.cpp
This program takes two command line arguments, and converts them to integers. It then calls a function, smallest_of_two, that returns the smallest of the two numbers (or the value they share in case of a tie.) It then prints out the result of that function call.
min3v1.cpp
This is the first of two versions of a program that takes min2.cpp one step further, finding the smallest value from among three numbers. Again, if there is a tie, it prints the tie value. Look at the nested if/else statements and see if you can make sense of the logic. Seek help if you don’t.
min3v2.cpp
This program does EXACTLY the same thing as min3v1.cpp, but does it with much cleaner, simpler code. Notice how we REUSE the smallest_of_two function to build up a smallest_of_three function.
Your job in this step is to test min2, min3v1 and min3v2 with many different values and convince yourself that they work properly.
In the next step, you will be taking these programs to the next logical step in this sequence.
Your main task: Write min4.cpp
-
Write a program that works just like min2 and min3v1 and min3v2, except it takes four ints on the command line, and prints the smallest value, handling ties appropriately.
-
We encourage you to follow the model of min3v2.cpp if you can understand how this works, since your code will be far cleaner than trying to build this out of nested if/else statements.
If you DO use nested if/else statements, though, be sure that you indent and format your code appropriately.
Follow the pattern in min2 and min3v1/min3v2 in terms of all other issues and how they are handled, including the usage message, etc. Your program should look exactly like these except that it works on 4 inputs (note, there are no trailing whitespacse):
./min4
Usage: ./min4 num1 num2 num3 num4
Prints smallest of the four numbers
Here is the output of the program with the correct number of inputs:
$ ./min4 3 4 5 6
3
Here are two more example runs:
$ ./min4 92 35 12 17
12
$ ./min4 92 -35 12 17
-35
To compile your code use the g++ command as before.
$ g++ -std=c++11 -o min4 min4.cpp
Run your executable with different inputs to test it out.
Upload your files to your repo on github using github’s web interface.
Submit your code on gradescope
Once you are satisfied that your program is correct, then it’s time to submit it.
Log into your account on https://www.gradescope.com/ and navigate to our course site: CS16 Spring 2018. Select this assignment. Then click on the “Submit” button on the bottom right corner to make a submission. You will be given the option of uploading files from your local machine or submitting the code that is in a github repo. Select the second option and select your github repo for this assignment. You should receive 100/100 for a completely correct program.
Done!
Check in with your mentor to get marked for completing the lab. Discuss with them any challenges you faced while completing the lab. If you haven’t finished the lab (as is expected) discuss with your mentor when you can come to the open lab hours to finish the rest of the lab.
You are now done with this assignment! If you are in the Phelps lab or in CSIL, make sure to log out of the machine before you leave. Also, make sure to close all open programs before you log out. Some programs will not work next time if they are not closed. Remember to save all your open files before you close your text editor.
If you are logged in remotely, you can log out using the exit command:
$ exit
Grading rubric
In addition to the points given by gradescope, our staff will be manually grading your code for style. Code style, includes but is not limited to the following:
- Code can be easily understood by humans familiar with C++ (including both the author(s) of the code, and non-authors of the code.)
- Code is neatly indented and formatted, following standard code indentation practices for C++ as illustrated in either the textbook, or example code given in lectures and labs
- Variable names choices are reasonable
- Code is reasonably “DRY” (as in “don’t repeat yourself”)—where appropriate, common code is factored out into functions
- Code is not unnecessarily or unreasonably complex when a simpler solution is available
In completing this lab you must also demonstrate an understanding of the following: * for-loops and if-else structure. Mentor may ask you to explain your block program * pair programming - ask your mentor for feedback on how you are doing as a pair!


Here you can export all your entries as a CSV file. You can use this file...
Your export is ready to download.
{{ exportInfo.entryCount }} entries
{{ exportInfo.fileSize | filesize: { fullform: true, round: 1 } }}
Here you can import a CSV file that was exported from TrackIt.
You can also import data from another source. In this case, make sure that
the CSV file contains two columns named timestamp
and
value
.
{{ importFilename }}
Invalid file
{{ importInfo.entryCount }} entries
{{ importInfo.minDate | date }} – {{ importInfo.maxDate | date }}
There are already {{ importInfo.existingEntryCount }} entries. What should happen to them?
Please select a valid CSV file that contains two columns named
timestamp
and value
.


Monitor Admin Package Version 1.0.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. For example:
Import-Package: org.osgi.service.monitor; version=1.0