Example project with a simple CRUD REST API to a domain model persisted using akka-persistence with event sourcing.
Project summary:
Once the application is started you can test it's functionality by invoking http requests. You can do it using any tool you like (some useful ones are Postman for Chrome or RESTClient for Firefox).
All accessible routes are defined in VehicleRoute.scala and UserRoute.scala files.
Example requests for each route are shown below (POST ones require header "Content-Type: application/json" to be set):
Registering user
POST http://localhost:8080/api/user
{"name": "John", "pass": "s3cr3t"}
Changing user's password (requires user authentication)
POST http://localhost:8080/api/user/password
{"pass": "newPassword"}
Creating vehicle (requires user authentication)
POST http://localhost:8080/api/vehicles
{"regNumber": "123", "color": "red"}
Retrieving vehicle
GET http://localhost:8080/api/vehicles/{vehicle-id}
Deleting vehicle (requires user authentication)
DELETE http://localhost:8080/api/vehicles/{vehicle-id}
Changing vehicle's regNumber (requires user authentication)
POST http://localhost:8080/api/vehicles/{vehicle-id}/regNumber
{"value": "newRegNumber"}
Changing vehicle's color (requires user authentication)
POST http://localhost:8080/api/vehicles/{vehicle-id}/color
{"value": "newColor"}
Every time new request is received an instance of specific RequestHandler actor is created.
Since each request can result in different status code for the same aggregate state (for example Removed state for GET request should result in NotFound, for DELETE however it should return NoContent) there are separate actors for each possible request (RegisterRequestActor, DeleteRequestActor, etc.).
When such RequestHandler actor is created it immediately sends a message to AggregateManager actor, which handles the request and returns the result. RequestHandler actor handles result returned from AggregateManager and responds with proper http response.
This pattern is inspired by spray-actor-per-request Activator template and more information can be found there.
When AggregateManager receives new command it instantiates new aggregate actor and forwards command to it.
When aggregate is instantiated it is restored from historical events (akka persistence module takes care of it).
Only when aggregate is fully restored it can handle "regular" messages (commands in this case).
When aggregate receives new command it creates an event out of it and persists it in journal. Persisted event is then applied to aggregate.
For more information, please refer to Akka persistence documentation.
Snapshots are used to reduce recovery time of aggregates.
VehicleAggregate handles taking snapshots itself. It tracks number of processed events and takes snapshot once 10 of them were processed.
Here you'll find some learning resources that we strongly recommend in order to fully understand how does the application work.


@* * This template is for logged in pages. * * This template handles rendering of the page header and body tags. * It takes two arguments, a `String` for the title of the page and * an `Html` object to insert into the body of the page. *@ @(title: String)(content: Html)
@* Here's where we render the page title `String`. *@


In this field, type the character that will be used in the separator strings and as a prefix or ending character in block comments.


Not Knowing
I’ve been lingering on a post about Babbie for several weeks now. I’d like to blame my delay on personal and professional travel, on taking on some freelance work, on a huge stack of books next to my bed demanding my attention. But the truth is, I’ve just had a hard time wrapping my head around this next post. I’ve been doing research, jotting down notes, and drafting prose, but it hasn’t been coming together cohesively. Today I realized that there’s a story hidden in that post, and until I tell it and reflect on what it might mean, I won’t be able to truly tell the story of Babbie’s life.
On August 5, 1925, Babbie’s middle son, Richard, committed suicide by taking cyanide. He was 25 years old.
The Gettysburg Times reported the details. Richard “died from the effects of poison which was self administered. A note left by the young man explained why he committed the act. Despondency was given as the reason, this being brought on by ill health. The young man had been a sufferer from heart trouble for a number of years.”
The newspaper account relates how Richard had seemed his usual self, had eaten dinner with his parents before going upstairs to bed around 10:00 p.m. Then there is the moment that sticks with me:
“He was not heard moving about the house after this time, but shortly after midnight his mother heard him moaning as though in great pain.”
This grisly newspaper article depicts Babbie at a moment in time. It is the moment right before her husband Abner climbs to the attic, to discover his son’s body, with a note next to it. It is the moment right before she is greeted with intense sorrow, pain, and confusion. It is the moment right before she realizes that she has lost her son.
This is not the lone suicide in our family history. Over the course of ten years, the Newman aunts lost three men in their lives to suicide. I’ve already told of how Eve’s husband, Alan Gilmour, committed suicide, only eight months before Edward. There is also the aunts’ brother Jake, my great-great uncle, who committed suicide in 1935, by sitting in a running car inside his garage.
I am drawn to speculate about why these men would commit suicide. The Gettysburg Times refers to longstanding heart problems for Richard. Alan Gilmour’s obituary mentions his health failing a year before his death. According to family stories, Jake was never as successful in business as his older brothers, and he was gay at a time when homosexuality was not accepted. It is easy to seek out these explanations, to accept them as truth, to codify them and make them part of the story that I am telling.
But the only true thing is that I will never know what really happened. I will never be able to understand why they felt such desperation that they wanted to take their own lives. I will never be able to answer the many questions that surround their deaths. So, instead, I ask myself why I am so caught up by this story. Why can’t I just finish my next post about Babbie and continue on with this project?
When I think about these tragic deaths, I think less about the men, but about the women they left behind. After so much loss–so sudden, so unexplainable–how do you move on? How do you rebuild your life after your partner leaves you? How do you recover from the death of a child? How do you feel the absence of a sibling and not experience overwhelming heartache and sorrow every day? And, finally, how do you live with the “not knowing”?
I always like to have an explanation. I want answers, and it’s hard when I can’t find them. My search for answers is what started me on this project, but I won’t be able to answer every question I have. When I think about Richard, Alan, and Jake, I will have to live with the “not knowing,” which echoes down through the generations, from my great-great aunts, down to me.
“Shadows” by Tomi Lattu is licensed under a Creative Commons Attribution 2.0 License.


Class: ActiveSupport::Testing::SimpleStubs
| Relationships & Source Files | |
| Namespace Children | |
|
Classes:
| |
| Inherits: | Object |
| Defined in: | activesupport/lib/active_support/testing/time_helpers.rb |
Overview
Manages stubs for TimeHelpers
Class Method Summary
- .new ⇒ SimpleStubs constructor
Instance Attribute Summary
-
#stubbed? ⇒ Boolean
readonly
Returns true if any stubs are set, false if there are none.
Instance Method Summary
-
#stub_object(object, method_name, &block)
Stubs object.method_name with the given block If the method is already stubbed, remove that stub so that removing this stub will restore the original implementation.
-
#stubbing(object, method_name)
Returns the
Stub
for object#method_name (nil if it is not stubbed). -
#unstub_all!
Remove all object-method stubs held by this instance.
-
#unstub_object(stub)
private
Restores the original object.method described by the
Stub
.
Constructor Details
.new ⇒ SimpleStubs
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 12
def initialize @stubs = Hash.new { |h, k| h[k] = {} } end
Instance Attribute Details
#stubbed? ⇒ Boolean
(readonly)
Returns true if any stubs are set, false if there are none
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 53
def stubbed<EMAIL_ADDRESS>end
Instance Method Details
#stub_object(object, method_name, &block)
Stubs object.method_name with the given block If the method is already stubbed, remove that stub so that removing this stub will restore the original implementation.
Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00
target = Time.zone.local(2004, 11, 24, 1, 4, 44)
simple_stubs.stub_object(Time, :now) { at(target.to_i) }
Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 23
def stub_object(object, method_name, &block) if stub = stubbing(object, method_name) unstub_object(stub) end new_name = "__simple_stub__#{method_name}" @stubs[object.object_id][method_name] = Stub.new(object, method_name, new_name) object.singleton_class.alias_method new_name, method_name object.define_singleton_method(method_name, &block) end
#stubbing(object, method_name)
Returns the SimpleStubs::Stub
for object#method_name (nil if it is not stubbed)
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 48
def stubbing(object, method_name) @stubs[object.object_id][method_name] end
#unstub_all!
Remove all object-method stubs held by this instance
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 37
def unstub_all! @stubs.each_value do |object_stubs| object_stubs.each_value do |stub| unstub_object(stub) end end @stubs.clear end
#unstub_object(stub) (private)
Restores the original object.method described by the SimpleStubs::Stub
# File 'activesupport/lib/active_support/testing/time_helpers.rb', line 59
def unstub_object(stub) singleton_class = stub.object.singleton_class singleton_class.silence_redefinition_of_method stub.method_name singleton_class.alias_method stub.method_name, stub.original_method singleton_class.undef_method stub.original_method end


Here are some of the reasons as to why i decided to take a class in programming
Some of my hobbies and interest include


Weather Forecast Test
Search for a City:
Austin
San Diego
Portland
San Fran
San Antonio
New York
5 Day Forecast:
Day 1
Weather:
Temp:
Humidity:
Day 2
Weather:
Temp:
Humidity:
Day 3
Weather:
Temp:
Humidity:
Day 4
Weather:
Temp:
Humidity:
Day 5
Weather:
Temp:
Humidity:


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 4
Dietary
These pretty apple tarts belie just how quick and easy they are to make. Perfect for dinner parties.
Preheat the oven to 210C/425F/Gas 7.
On a lightly floured work surface, roll out the puff pastry to 3-4mm/⅛in thick. Cut out four 12cm/4½in circles using a pastry cutter and transfer to a baking tray.
Score a circle in the centre of the pastry with a knife (leaving a 1cm/½in border) then brush with egg wash.
Roll the marzipan out to 5mm/¼in thick and cut into four 11cm/4¼in circles and place in the centre of the pastry. Carefully place the apples in an overlapping ring over the marzipan to cover it all.
Place the butter and honey in a small saucepan and bring to a simmer, stirring to combine. Brush most of it over the top of the apples.
Place in the oven and bake for 15-18 minutes, or until the pastry is risen and golden-brown.
Brush with any remaining melted butter and honey to glaze.
For the spiced caramel sauce, place the sugar and spices in a frying pan and cook until the sugar is melted and golden-brown. Whisk in the double cream and bring to a simmer.
Cook for 3-5 minutes, or until just thickened, then pass through a fine sieve into a clean pan.
To serve, place the tarts in the centre of serving plates and spoon the sauce around the edge. Finish with a spoonful of ice cream on top.


<TITLE></TITLE>

I am writing from the hospital, therefore this mail is very urgent as

you can see that I am going home.

I was told by the doctor that I was poisoned and has got my liver

damaged and can only live for some months.

I inherited some money ($28.725 Million) from my late father and I

cannot think of anybody trying to kill me apart from my step mother in

order to inherit the money, she is an Ivorien by nationality.

I want you to know that i am in pains, and all i am worried about is

Sarah why because i do not want her to suffer if i do not survive this

present condition that is why i am seeking for your assistance for her

safety and well being , she is only 17 years and i adopted her from the

ophanage home and gave them my words that i will take good care of her

and make her become grate in life but the wicked people in this world

eg my step mother have poisened me because of my inheritance so please

you have to sincerely help me.

I will be going in for the operation in few days so please pray for me

for survival but on the other hand incase of anything all i need is

your sincere assistance i do not need any financial help from you

because i have enough and if money can save me i also have enough but

life comes from the Most High God.

I want you to contact my adopted daughter Sarah with this informations

below:

Miss Sarah Welsh.

Email: <FONT size=3 face="Times New<EMAIL_ADDRESS>

This is the favour I need when you have gotten the money :-

(1) Give 15% of the money to Sarah as she has been there for me since

my illness and I have promised to support her in life.Sarah is an ophan

i adopted her and she is only 17 years old now. I want you to take her

along with you to your country and esterblish her.

(2) Give 25% of the money to Charity Organisations and Churches on my

name so that my soul may rest in peace.

HOSPITAL Note:

This should be a code between you and Sarah in this transactioin

"Hospital" any mail from her, without this code "Hospital" is not from

Sarah, or myself as I don't know what will happen to me in the next

few hours.

If I don't hear from you within two days, I will look for another

person.

May God bless you and use you to accomplish my wish.

Pray for me always.

Anne Nanda Bates.

Thank you Holy Father.


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import play.api.Configuration @import models.pages.Summary @import uk.gov.hmrc.govukfrontend.views.html.components._ @import uk.gov.hmrc.hmrcfrontend.config.AccessibilityStatementConfig @import views.html.govuk.{head, scripts} @import uk.gov.hmrc.hmrcfrontend.views.html.helpers.HmrcLayout @import uk.gov.hmrc.hmrcfrontend.views.html.helpers.HmrcLanguageSelectHelper @this( hmrcLayout: HmrcLayout, headTemplate: head, scriptsTemplate: scripts, govukPhaseBanner: GovukPhaseBanner, govukBackLink: GovukBackLink, accessibilityStatementConfig: AccessibilityStatementConfig, configuration: Configuration, hmrcLanguageSelectHelper: HmrcLanguageSelectHelper, govukErrorSummary: GovukErrorSummary ) @( pageTitle: Option[String] = None, pageHeading: String, theForm: Form[_] = null, showBanner: Boolean = false, showH1: Boolean = true, showSection: Boolean = false, showFeedback: Boolean = true, showFooter: Boolean = true, showAccountInfo: Boolean = false, summary: Option[Summary] = None, beforeContentBlock: Option[Html] = None, backLinkUrl: Option[String] = None, showHistoryBack: Boolean = false, withTimeoutDialog: Boolean = true, gridClasses: String = "govuk-grid-column-two-thirds" )(contentBlock: Html)(implicit request: Request[_], messages: Messages) @beforeBLock = { @if(showFeedback) { @govukPhaseBanner( PhaseBanner( classes = "dontprint", tag = Option(Tag(Text("BETA"))), content = HtmlContent( messages("label.phase2", controllers.feedback.routes.FeedbackController.feedback.url) ) ) ) } @hmrcLanguageSelectHelper() @if(showAccountInfo && summary.isDefined){ @views.html.includes.account_info_header(summary.get) } @backLinkUrl.map{ url =>


Hello
Welcome to Snake Search
By Martin Gingras
Interactive
Breadth First Search
Depth First Search
A* Search (Combined)
Press the spacebar to start
See it on github


Hourly national energy model for the UK.
| Generation | Demand | Store | |||
|---|---|---|---|---|---|
| GW | TWh/yr | ||||
| Wind | Appliances elec. demand | Store max discharge rate | |||
| Solar | Hot water demand (heat) | Store max charge rate | |||
| Nuclear | Transport elec. demand | Store max capacity | |||
| Backup capacity installed | Industrial elec. demand | Store discharge efficiency | |||
| Store charge efficiency | |||||
| Store start capacity |
| Generation | Demand | Store | |||
|---|---|---|---|---|---|
| Wind | TWh/yr | Total | TWh/yr | Max discharge rate | GW |
| Solar | TWh/yr | Unmet | TWh/yr | Max charge rate | GW |
| Nuclear | TWh/yr | Max shortfall | GW | Lowest capacity | TWh |
| Excess generation | TWh/yr | Highest capacity | TWh | ||
| Total charge | TWh | ||||
| Backup generation | TWh/yr | Total discharge | TWh | ||
| Backup capacity used | GW | Total loss | TWh | ||
| End capacity level | TWh |


{% extends 'base.html' %} {% load static %} {% block title %}{{ block.super }}: Acknowledgements{% endblock %} {% block content %}
We would like to thank all those who so generously donated their time to create this new service. The care and consideration demonstrated by our contributors, consultants and testers was a testament to the passion each and everyone had for helping the citizens of our province.


A Web Developer, Marketer, Manager, and Entrepreneur. All different ways I have been able to do one thing consistently: Be creative.
Each one challenging my talents in different ways. Together, they give me the ability to imagine and create real-world web applications, the ability to lead, work across teams, and even the ability to be client-facing as needed. More importantly, they show my ability to learn multiple disciplines and GROW.
HTML5, CSS3, Javascript, Ruby, Node.js, Git, Github, Heroku
jQuery, React, Bootstrap, Sinatra, Express, AJAX
PostgreSQL, MongoDB, AJAX, bCrypt
LESS, SASS, Gulp, NPM, Nodemon
Whether its Software as a Service, e-commerce or everyday making a one-page parallax design for a job seeker, I enjoy projects that I know are going to be used everday. The front end can also contain fun things like animations and interactive elements. Or it can display marketing material, contain SEO information and display the work of UX designers. All things I am interested in. Seeing the front-end come together gives gratification to both my creative and business sides, and keeps me excited about seeing a project come together.
"Happiness lies in the joy of achievement
and the thrill of creative effort."
A Simple Math Game for Kids. Find the equivalent fractions. Uses HTML5, CSS3, Javascript
A peer project creating a new take on finding food and drink deals. Uses MVC architecture, Node.js, Express, Mongodb, Javascript, Ajax, External API


Instances of this class represents the history of most viewed articles and
emailed, articels
viewed by keyword search or shared on facebook and twitter from the New York Times
with titles (headline), snippets and the date the user requested the search.


Please add your payment details
Please add your billing address
Please add your shipping address
Subscription created at {{subscription.created_at*1000 | date:'MM/dd/yyyy'}}
Trial period is between {{subscription.trial_start*1000 | date:'MM/dd/yyyy'}} and {{subscription.trial_end*1000 | date:'MM/dd/yyyy'}}
The subscription will be changed to active state from {{subscription.trial_end*1000 | date:'MM/dd/yyyy'}}
Your subscription has been canceled on {{subscription.cancelled_at*1000 | date:'MM/dd/yyyy'}}
The current term of your subscription is between {{subscription.current_term_start*1000 | date:'MM/dd/yyyy'}} and {{subscription.current_term_end*1000 | date:'MM/dd/yyyy'}}
Your next billing date is {{subscription.current_term_end*1000 | date:'MM/dd/yyyy'}}
The subscription will be canceled on next renewal {{subscription.current_term_end*1000 | date:'MM/dd/yyyy'}}
The subscription will start at {{subscription.start_date*1000 | date:'MM/dd/yyyy'}}


An Online Exam Portal :) Developer code-blooded @2017 Check out my website http://codeblooded.website


Notes are parsed line by line. Save the notes and switch between them with the arrow keys.
Lines starting with ## are ignored when forecasting the time.
However, you can include those by putting a number (in seconds, preceded by whitespace) at the end of the line.


==== Backup Systems ====
Identification of services or client software for the purpose of backing up data provide a great opportunity to an attacker since these system require access to the data and systems they need to backup providing an attacker:
*Enumeration of hosts and systems
*Enumeration of services
*Credentials to host and/or services
*Access to backup data
The information gained from the service can be used to show risk to the confidentiality, integrity and access tot he system and their information. Access to the backups can also provide opportunity to introduce miss configuration, vulnerable software or backdoors in to the clients systems.


BINARY SEARCH TREE
Binary search tree is of two types; the sorted binary tree and the ordered binary tree.
There are different properties of a binary search tree:
• The right subtree of the binary search tree contains the nodes having its key values which are greater than the key node.
• The left sub-tree of the binary search tree contains the nodes having its key values less than the key node.
• Both left and the right sub-tree are parts of the binary search tree.
Condition for the binary search tree is that a duplicate node should not be present. There are various benefits of a binary search tree in comparison to the other tree in relation to searching and sorting. As searching and sorting a binary search tree is fast in comparison to others. There are various operations involved in a binary search tree, such as insertion, deletion, traversing and all other searching and sorting techniques.
Binary search tree with equal keys
a. In case of binary search trees, search starts when insertion in the binary search tree is started. In this, we compare key values with the node of the tree. If the key value is not equal to the root node of the tree, then in this case, searching can be performed from the left sub-tree or from the right sub-tree.
In case of searching, if we reach the external node of the tree, then left and right sub-tree is added with the key and value pair by matching the corresponding value related to the key. Condition of a binary search tree is that if the value is less than the root node, then the recent value, if it is smaller, is added to the left hand side, otherwise it will be added to the right hand side.
In case of duplicates in the value at time of searching, the search time of the binary search tree will increase. When insertion of the n items is performed in the binary search tree, when tree is initially empty and the entire identical key is to be inserted, then in this case all the nodes are present in the right hand side of the tree. Thus, asymptotic performance in this case is (n).
Improvement of insertion of tree in binary search tree
b. As stated in the question, the following test is performed regarding x.key=z.key and y.key=z.key. In the problem, we have Boolean flag b.x at node x. In this, we set x.left or x.right on the base of b.x, which gives the value as either false or true. At the time of insertion, whenever x is visited, it has same key value. During the process we will have a balanced binary tree.
Here we have to insert elements level wise, that is kth level will be inserted only when (k–1)th level is filled completely. And for a balanced binary tree, we have the height of the tree proportional to the (log n); and as we have to insert n items, so it will finally be proportional to (n log n).
c. If there are a list of nodes which have equals keys at a specific node, which is x, then in this case z is inserted as shown below:
First, z value is compared with the x.key, if the value is less than x.key, then in this case, it is inserted to the left of the node x, otherwise it will be inserted to the right.Here in this case, TREE-INSERT is actually done to insert an element to the end of the linked list.
Thus, in this case, asymptotic performance is (1).
d. Here, the node x is set randomly to either x.left or x.right in the given TREE-INSERT
operation. In the random order for insertion, we have: In the worst case, it can be in ascending order; so all the insertion will happen on the left or on the right side. In this case, the number of nodes is proportional to n; so the worst case performance is . So, the final tree after the insertion of elements is of same height as in a randomly built binary search tree. Thus height in this case is (log n). Average performance of TREE-INSERT is (log n).
Number of different binary trees
Catalan numbers are the special type of numbers which are used in various counting programs and these are represented as:
These numbers are generated in various mathematical situations such as
No of binary search trees possible with0, 1, 2, 3… nodes
No of binary trees possible with 0 node is 1
No of binary trees possible with 1 node is 1
No of binary trees possible with 2 nodes is 2
No of binary trees possible with 3 nodes is 5and so on
a . For the proof of the equation:
… … (1)
Where
Substituting the values in equation (1) as:
…
…
This expression can be summed up as:
b. Consider the generating Function,
… … (2)
Squaring equation (2),
From above problem,
Multiplying above equation with x,
… … (3)
Then from equation (2) and equation (3),
But
… … (4)
Comparing equation (4) with Quadratic equation which is as:
So,
A formula for the solution of quadratic equation for variable x is as:
Applying this formula on equation (4),
Instead of , use ‘–‘ the same way as + instead of – as
Hence,
c . The formula is used to produce the Catalan numbers for its proof. Use the concept of Counting Diagonal-Avoiding Paths (Lattice paths).
In this problem, a number of paths have to be found. These are from origin to a point in space which stays on the path on or above the diagonal from origin to a point in space.
These paths always stay on or above the diagonal.
Number of paths from origin to is 1
Number of paths from origin to is 1
Number of paths from origin to is 2
Number of paths from origin to is 5. (5 paths cannot be showed in graph but there are 2 more paths could be draw easily)
So, finding number of paths from origin to a point in space which stay on or above the diagonal will be the Catalan number
Total number of paths from origin to is
Total number of paths from origin to is
But from this removing the number of paths which cross diagonal are necessary.
To find the Number of paths that cross the diagonal, mirror technique is going to be used, now draw another line parallel to diagonal
Paths which cross the diagonal always end up at
So total no of paths from to is
Number of paths from origin to a point in space which stay on or above the diagonal (Total paths form origin to –Total number of paths that cross diagonal)
… … (5)
From combination formula as:
Applying the combinational formula on equation (5) as:
… … (6)
Again from combinational formula putting this value in equation (2),
Hence, it shows that
d .For the proof of equation use the Stirling’s approximation formula which is as:
The formula for has been proved earlier in part c as:
… … (7)
Applying combination formula to expand in equation (7) as:
… … (8)
Now applying stirling’s formulaon equation (8) as:
As
Hence, it is proved that.


Locks the grid.
lock(message, [showSpinner])
| message |
string, message |
| showSpinner |
boolean, optional, spinner indicator |
Returns undefined.
Description
This method will lock the grid by added a semi-transparent div on top of its content. The user will not be able to interact with
the grid or its content until the grid is unlocked with .unlock(). This method will call
w2utils.lock() to perform the locking.
If you have following grid:
You have 3 options how you want to lock the content.
Lock with a message and a spinner:
Lock w/o a message, but with a spinner:
Lock w/o a message and w/o a spinner:


If you have assambled the device you can calibrate. Callibrating the device: Click “Down” button and wait until the device is running. Measure the unfolded length (in cm) and type the number inside the field "Distance" under "Down" button. Click “Up” button and wait until the device is running. Measure the length of the rope that has folded (in cm) and type the number in the field “Distance” under "Up" button. Type the distance you want to be travelled (in cm) in the field "Full distance" If a box pop up with text "You submitted successfully!" callibration is ready!


Symbolicating crashes now made easy
June 19, 2015
About dSYM
If you have issues with symbolicating crashes in iOS by dragging the .crash file into the organiser tab, there is a symbolicatecrash.pl
script provide by Xcode as well as atos
tool to symbolicate the crash and a memory reference respectively. The script allows us to symbolicate the whole crash file where as using atos we can symbolicate single memory reference.
Just for posterity when Xcode is building the application lldb debugger copies the symbols and the memory print to .dSYM debug symbol file. This file is created every time the application is built and no two .dSYM files are the same. This is the reason the crash is symbolicated on the machine on which the version of the application was built.
Using dSYM for symbolicating crashes
To symbolicate a crash file you need the original .dSYM file for that build. Xcode comes with a build in perl script to symbolicate the crash file using the .dSYM file.To do this we need to open terminal, set up an env variable DEVELOPER_DIR and add an alias to 'symbolicatecrash.pl' script.
symbolication project (A Xcode plugin)
Symbolication project enables symbolication-plugin an Xcode plugin. This plugin is available in Product menu and is named Symbolicate
. This is now available on YML Github Account.
- Symbolicate Plugin is used to symbolicate crashes. If
dSYM file
andcrash file
is available, the crash can be symbolicated using the Plugin. - 1.0 (0.1)
How do I get set up?
- Open the SymbolicationPlugin project
- cmd + k (clean the project)
- cmd + b (build the project)
- ta-da! the plugin is installed
How to check if the plugin is installed
- Open Terminal
- Navigate to ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins directory
- Type ls -l
SymbolicationPlugin.xcplugin
should be listed in the installed plug-in's list.
Requirements
To use the complete features of the Plugin the following files are required.
- The application bundle (application.app file).
- The dSYM file associated with the build.
- The application unix executable file for the available inside the application.app bundle (application.app/application).
How to use the Plugin?
Below are the details of using the three sections of the plugin Symbolicate
, Details
and Memory
Symbolicating crash file
Use the Symbolicate
tab to symbolicate the crash log.
- Select the dSYM file from the disk.
- Select the the crash file from the disk.
- Select Symbolicate. The plugin begins symbolicating the crash.
Note: Additionally you can save the crash file by clicking at the down arrow at the bottom left of the screen.
Checking the application details
Used the Details
tab to get the build information.
- Select the application executable file (Unix executable file) available inside the application.app bundle (application.app/application).
- The details of the application like the build UUID, the build architecture is displayed.
Symbolicating memory references available in the crash file
Used the Memory
tab to symbolicate memory references
- Select the application executable file (Unix executable file) available inside the application.app bundle (application.app/application).
- List down the memory addresses a single space saperated list.
- Select the architecture (This can be found using the above 'Details' section).
- Select Symbolicate. The Plugin displayes the symbolicated memory reference.
This is now also available on Alcatraz Package Manager for Xcode.


When nikola creates the page from this post it's going to copy over the javascript file ("get_started.js") and put it next to the HTML file for the post, which is why we can just put the file name in the script
tag and don't need a path. In order for nikola to find the original file to copy over we need to put it in a folder whose path looks like files/posts/<SLUG>/get_started.js
(starting from the root of the nikola repository). You can probably change it but this is the way it works by default.
The <SLUG>
has to be the slugified name for the post (for nikola this is set in the slug
metadata at the top of the post). In this case I used the much too long slug p5-js-with-org-mode-and-nikola
so the path to the javascript file is files/posts/p5-js-with-org-mode-and-nikola/get_started.js
.
We need to know this for two reasons:
- One is that it's where you have to put the file or it won't get copied over when nikola builds the site (you will have to make the folder if you didn't do it previously).
- The other is that I want to show the javascript itself in this post so we'll put in an org-mode
include
directive with the path to the file.
The thing that I tend to stumble over when embedding other files into an org-mode post is that the path for the include
directive is relative to the location of the org-mode post, not the root of the nikola repository. Since the org-mode file for this post is in a sub-folder named posts
, our path needs to go up one directory first, then back down, like this:
#+include: ../files/posts/p5-js-with-org-mode-and-nikola/get_started.js src js
Wherever you put the include directive in the post is where org-mode will insert the contents of the file. The arguments after the path tell org that it's a source block (and not, say, an example) and that it's in javascript so org will apply the right syntax highlighting to it, like so:
function get_started(p5js){
const WHITE = 255;
const COLOR = p5js.color(0, 0, 255);
let diameter;
p5js.setup = function() {
let canvas = p5js.createCanvas(0.8 * p5js.windowWidth, 200);
p5js.background(WHITE);
p5js.strokeWeight(3);
p5js.stroke(COLOR);
p5js.fill(WHITE);
}; // setup
p5js.mousePressed = function() {
p5js.background(COLOR);
}; // mouse_pressed
p5js.mouseReleased = function() {
p5js.background(WHITE);
}; // mouse_released
p5js.draw = function() {
/* Draw circles that change diameter based on mouse speed */
/* and color based on if mouse-pressed (or not pressed) */
if (p5js.mouseIsPressed) {
p5js.fill(COLOR);
p5js.stroke(WHITE);
} else {
p5js.fill(WHITE);
p5js.stroke(COLOR);
}
diameter = p5js.pow(p5js.dist(p5js.pmouseX, p5js.pmouseY,
p5js.mouseX, p5js.mouseY), 1.5);
p5js.ellipse(p5js.mouseX, p5js.mouseY, diameter, diameter);
}
}; // get started
new p5(get_started, "get-started");
You don't need to actually show the javascript, and I would normally do it by putting the code in the post itself and then tangling it out, the way I do it for the next sketch, but this is how I did it originally and so this is for the future me that might want to but will probably forget how to do it.


It's a Strange World.
Strange & the Familiars bring you songs from beyond the veil, words of warning and mourning for all that humanity might lose. Dark humor and macabre lyrics lace story-minded music with a gothic flare. Orchestral rock and jazzy melodies combine with smoky vocals to paint a soundtrack to a world both strange and familiar, where our dreams and nightmares come out to play.
Latest New Single Out Now!
Pie Music Video
September 2021 Release Date
Need some Strange sooner? Listen to the album while you wait...
Listen Now


Farmingdale State College Dining Services
Dining on campus isn’t one size fits all. Our meal plans were designed with you in mind. If you are looking to enjoy a meal with friends or just a snack on the go – we’ve got a plan to fit every appetite.
We’ve kept what’s most important to you in mind, building in the convenience, flexibility, quality, value and healthy options you deserve. Explore our meal plan options to learn more about what would be the best fit for you. Don’t worry - simplicity and convenience are all within reach. Once you have a meal plan, your student ID works like a debit card. Just swipe your card and the meals and points are deducted from your meal plan account. Did you know that you can add DB to your student ID card? You don’t need to have a meal plan in place to do it. Declining Balance is tax free and can be used at any of our on-campus dining locations. You’ll also receive a 10% bonus on any amount added between $50 and $249. Meal plans are convenient and flexible to fit your individual needs. Depending upon the plan you choose, meal plans can include meals, guest meals and declining balance dollars.
| Name | Location | Hours of Operation | Image |
|---|---|---|---|
| Burger Studio | Campus Center | M-Th 7:30AM - 10:00PM | |
| Starbucks | Campus Center | M-Th 7:30AM - 7:00PM | |
| TCP | Campus Center | M-Th 7:00AM - 7:00PM |
Food matters because we love to eat. Sitting down to enjoy our favorite foods can be the highlight of the day. But food matters even more because the foods we eat have a purpose. The food choices we make directly impact the energy and focus we need to reach our goals, every day and throughout our lives! Discovering and choosing the right foods can propel you forward, help you succeed and keep you healthy. But for many of us, eating healthy is hard to do. It takes planning, it takes time—it even takes the creativity and courage to listen to new ideas, try new foods and open up to new flavors.
Our chefs and dietitians know how challenging eating healthy can be. But they also know that discovering healthy food can be fun, empowering and rewarding. So we’re here to help you discover what healthy food can do for you and to help you enjoy all the positive things that can happen when you start ‘feeding your potential’.
You made it past April's showers, so go out and enjoy the May flowers! Or, if you don't feel like smelling the roses, celebrate the arrival of better weather with a fresh, flavorful meal at your next event. It should be easy to enjoy delicious catering, so we've made our ordering process as simple as possible. Either give us a call, send us an email or order online to coordinate professionally prepared and delivered cuisine at any event on campus.
Contact Us
Jeanne Castaldini
Phone:<PHONE_NUMBER>
Email: dining@farmingdale.edu


CHALLENGE YOURSELF
12:00:00
Thank you for using my app. Wish luck to you.
CREATE NEW CHALLENGE
Don't send lose coin to your addresses.


Reports methods being declared
final
in classes that are declared
final
. This is unnecessary, and may be confusing.
Powered by InspectionGadgets


What is Agile?
A philosophy / methodology
Traditional Development Process
Agile Development Process
Agile Is:
Incremental, Iterative Software Development
Open to changing requirements over time
Encourages constant feedback (iterations)
What is Scrum?
A flavor of Agile
Scrum Board
How features and bugs are managed


Sometimes Mama will take me to go shopping. We will buy fresh flowers and fruits, and then I will sit in the shopping cart and be pushed home by my mother


util.js contains a number of utility functions to help you update your web pages with javascript data (such as might be returned from the server). DWR's focus is not on DOM based utilities, thus these utilities are limited in scope. There are several other libraries (JS templating tools, jQuery, etc.) that are more robust in this area that you may want to explore if util.js does not meet your needs.
You can use util.js outside of DWR because (with the exception of useLoadingMessage()
) it does not depend on the rest of DWR to function. You can download a DWR Util with the DWR war file and then extract it from /dwr/dwr/util.js
.
All engine.js functions have the dwr.util
prefix.
The 4 basic page manipulation functions: getValue[s]()
and setValue[s]()
work on most HTML elements except tables, lists and images. getText()
works with select lists.
Out of the box several of the functions in util.js (addRows, setValue(s), getValue(s)) escape dangerous characters to protect your application from XSS.
To edit tables see addRows()
and removeAllRows()
. To edit lists (both select lists and ul, ol lists) see addOptions()
and removeAllOptions()
.
The complete list of utilities looks like this:


///<reference path="../../_definitions.ts"/>
/**
* The TextFormat class represents character formatting information. Use the
* TextFormat class to create specific text formatting for text fields. You
* can apply text formatting to both static and dynamic text fields. The
* properties of the TextFormat class apply to device and embedded fonts.
* However, for embedded fonts, bold and italic text actually require specific
* fonts. If you want to display bold or italic text with an embedded font,
* you need to embed the bold and italic variations of that font.
*
*
 You must use the constructor new TextFormat() to create a
* TextFormat object before setting its properties. When you apply a
* TextFormat object to a text field using the
* TextField.defaultTextFormat property or the
* TextField.setTextFormat() method, only its defined properties
* are applied. Use the TextField.defaultTextFormat property to
* apply formatting BEFORE you add text to the TextField, and the
* setTextFormat() method to add formatting AFTER you add text to
* the TextField. The TextFormat properties are null
* by default because if you don't provide values for the properties, Flash
* Player uses its own default formatting. The default formatting that Flash
* Player uses for each property(if property's value is null) is
* as follows:

*
*
The default formatting for each property is also described in each
* property description.

*/
module away.text
{
export class TextFormat
{
/**
* Indicates the alignment of the paragraph. Valid values are TextFormatAlign
* constants.
*
* @default TextFormatAlign.LEFT
* @throws ArgumentError The align specified is not a member of
* flash.text.TextFormatAlign.
*/
public align:string;
/**
* Indicates the block indentation in pixels. Block indentation is applied to
* an entire block of text; that is, to all lines of the text. In contrast,
* normal indentation(TextFormat.indent) affects only the first
* line of each paragraph. If this property is null, the
* TextFormat object does not specify block indentation(block indentation is
* 0).
*/
public blockIndent:number;
/**
* Specifies whether the text is boldface. The default value is
* null, which means no boldface is used. If the value is
* true, then the text is boldface.
*/
public bold:boolean;
/**
* Indicates that the text is part of a bulleted list. In a bulleted list,
* each paragraph of text is indented. To the left of the first line of each
* paragraph, a bullet symbol is displayed. The default value is
* null, which means no bulleted list is used.
*/
public bullet:boolean;
/**
* Indicates the color of the text. A number containing three 8-bit RGB
* components; for example, 0xFF0000 is red, and 0x00FF00 is green. The
* default value is null, which means that Flash Player uses the
* color black(0x000000).
*/
public color:boolean;
/**
* The name of the font for text in this text format, as a string. The
* default value is null, which means that Flash Player uses
* Times New Roman font for the text.
*/
public font:string;
/**
* Indicates the indentation from the left margin to the first character in
* the paragraph. The default value is null, which indicates
* that no indentation is used.
*/
public indent:number;
/**
* Indicates whether text in this text format is italicized. The default
* value is null, which means no italics are used.
*/
public italic:boolean;
/**
* A Boolean value that indicates whether kerning is enabled
* (true) or disabled(false). Kerning adjusts the
* pixels between certain character pairs to improve readability, and should
* be used only when necessary, such as with headings in large fonts. Kerning
* is supported for embedded fonts only.
*
*
Certain fonts such as Verdana and monospaced fonts, such as Courier
* New, do not support kerning.

*
*
The default value is null, which means that kerning is not
* enabled.

*/
public kerning:boolean;
/**
* An integer representing the amount of vertical space(called
* leading) between lines. The default value is null,
* which indicates that the amount of leading used is 0.
*/
public leading:number;
/**
* The left margin of the paragraph, in pixels. The default value is
* null, which indicates that the left margin is 0 pixels.
*/
public leftMargin:number;
/**
* A number representing the amount of space that is uniformly distributed
* between all characters. The value specifies the number of pixels that are
* added to the advance after each character. The default value is
* null, which means that 0 pixels of letter spacing is used.
* You can use decimal values such as 1.75.
*/
public letterSpacing:number;
/**
* The right margin of the paragraph, in pixels. The default value is
* null, which indicates that the right margin is 0 pixels.
*/
public rightMargin:number;
/**
* The size in pixels of text in this text format. The default value is
* null, which means that a size of 12 is used.
*/
public size:number;
/**
* Specifies custom tab stops as an array of non-negative integers. Each tab
* stop is specified in pixels. If custom tab stops are not specified
* (null), the default tab stop is 4(average character width).
*/
public tabStops:Array<number /*int*/> = new Array<number>();
/**
* Indicates the target window where the hyperlink is displayed. If the
* target window is an empty string, the text is displayed in the default
* target window _self. You can choose a custom name or one of
* the following four names: _self specifies the current frame
* in the current window, _blank specifies a new window,
* _parent specifies the parent of the current frame, and
* _top specifies the top-level frame in the current window. If
* the TextFormat.url property is an empty string or
* null, you can get or set this property, but the property will
* have no effect.
*/
public target:string;
/**
* Indicates whether the text that uses this text format is underlined
* (true) or not(false). This underlining is
* similar to that produced by the  tag, but the latter is
* not true underlining, because it does not skip descenders correctly. The
* default value is null, which indicates that underlining is
* not used.
*/
public underline:boolean;
/**
* Indicates the target URL for the text in this text format. If the
* url property is an empty string, the text does not have a
* hyperlink. The default value is null, which indicates that
* the text does not have a hyperlink.
*
*
Note: The text with the assigned text format must be set with
* the htmlText property for the hyperlink to work.

*/
public url:string;
/**
* Creates a TextFormat object with the specified properties. You can then
* change the properties of the TextFormat object to change the formatting of
* text fields.
*
*
Any parameter may be set to null to indicate that it is
* not defined. All of the parameters are optional; any omitted parameters
* are treated as null.

*
* @param font The name of a font for text as a string.
* @param size An integer that indicates the size in pixels.
* @param color The color of text using this text format. A number
* containing three 8-bit RGB components; for example,
* 0xFF0000 is red, and 0x00FF00 is green.
* @param bold A Boolean value that indicates whether the text is
* boldface.
* @param italic A Boolean value that indicates whether the text is
* italicized.
* @param underline A Boolean value that indicates whether the text is
* underlined.
* @param url The URL to which the text in this text format
* hyperlinks. If url is an empty string, the
* text does not have a hyperlink.
* @param target The target window where the hyperlink is displayed. If
* the target window is an empty string, the text is
* displayed in the default target window
* _self. If the url parameter
* is set to an empty string or to the value
* null, you can get or set this property,
* but the property will have no effect.
* @param align The alignment of the paragraph, as a TextFormatAlign
* value.
* @param leftMargin Indicates the left margin of the paragraph, in pixels.
* @param rightMargin Indicates the right margin of the paragraph, in pixels.
* @param indent An integer that indicates the indentation from the left
* margin to the first character in the paragraph.
* @param leading A number that indicates the amount of leading vertical
* space between lines.
*/
constructor(font:string = "Times New Roman", size:number = 12, color:number /*int*/ = 0x000000, bold:boolean = false, italic:boolean = false, underline:boolean = false, url:string = "", target:string = "", align:string = "left", leftMargin:number = 0, rightMargin:number = 0, indent:number = 0, leading:number = 0)
{
this.font = font;
this.size = size;
this.bold = bold;
this.italic = italic;
this.underline = underline;
this.url = url;
this.target = target;
this.align = align;
this.leftMargin = leftMargin;
this.rightMargin = rightMargin;
this.indent = indent;
this.leading = leading;
}
}
}


Bootstrap Breakpoints
Boostrap defines 4 breakpoints and classifies devices into 4 based on viewport widths
- Extra small device < 576px
- 576px ≤ Small device < 768px;
- 768px ≤ Medium device < 992px;
- 992px ≤ Large device < 1200px
- 1200px ≤ Extra Large device
Example: A .container gets different widths for different viewport widths


Before Change
All units are in MB/s, as these are the units guaranteed to be output
by the test.
matches = regex_util.ExtractAllMatches(EXTRACT_BANDWIDTH_TEST_RESULTS_REGEX,
test_output)
results = {}
for i, metric in enumerate(BENCHMARK_METRICS):
results[metric] = float(matches[i])
return results
def _CalculateMetricsOverAllIterations(result_dicts, metadata={}):
After Change
All units are in MB/s, as these are the units guaranteed to be output
by the test.
lines = [line.strip() for line in test_output.splitlines()]
host_to_device_results_start = _FindIndexOfLineThatStartsWith(
lines, "Host to Device Bandwidth")
device_to_host_results_start = _FindIndexOfLineThatStartsWith(
lines, "Device to Host Bandwidth")
device_to_device_results_start = _FindIndexOfLineThatStartsWith(
lines, "Device to Device Bandwidth")
host_to_device_mean = _AverageResultsForSection(lines,
host_to_device_results_start)
device_to_host_mean = _AverageResultsForSection(lines,
device_to_host_results_start)
device_to_device_mean = _AverageResultsForSection(
lines, device_to_device_results_start)
results = {


Home
News
Papers
Projects
Posts
Talks
Group
Contact
Microbial Mechanosensing: Phage Shock Protein Response System in Gram-positive Bacteria
Janani Ravi
,
Vivek Anantharaman
,
L Aravind Iyer
,
Maria L Gennaro
Date
Jun 18, 2016
2:45 PM — 3:00 PM
Event
ASM Microbe
Location
Boston, MA
phylogeny-evolution
compbio-bioinfo
Cite
×


--- layout: post authors: ["Terri Yu"] title: "Running a Code Retreat" date: 2015-09-02 time: "14:00:00" tags: ["Community", "Teaching"] ---
I recently attended a scholarship retreat run by Google with about 40 other students. We spent one day doing a "code retreat" and I wanted to share my experience and what I learned about programming.
The code retreat was based on this template, and led by senior Google software engineer, Nathan Sandland. The task was the same for all the exercises -- pair programming Conway's Game of Life with unit tests. The first exercise was to simply program the game of life and then we did 4 more exercises that were variations on this, with different constraints. We were allotted about 45 minutes for each exercise, and we switched pairs for each exercise. After each exercise, we went around the room and debriefed people's thoughts on the exercise. People could program in any language as long as that language supported unit tests, and each pair needed to program in a common language that they both knew.
The exercises were:
Program the Game of Life with no constraints other than time (don't forget the unit tests!)
Extreme constraints: can't use if/else statements, only allowed 3 lines of code per function, can't pass primitives to functions or interfaces
Ping pong pairing: Person A writes tests, Person B writes code to pass tests, then Person B writes tests, Person A writes code to pass the tests, etc.
Evil mute A/B pairing: pairs are not allowed to talk. One person writes tests. The other person is a "lazy evil" programmer who writes the minimal code to pass the tests (but the code doesn't need to actually implement the specification).
"Baby steps": Program in 5 minute rounds, alternating partners. Initialize an empty Git repository. Then the coder has 5 minutes to write a test and write code to pass the test. If the coder finishes, the work done during that round is committed to the repository. If the coder doesn't finish, the coder has to do a hard git reset to delete their work. (We were told that when this exercise is done with Google employees, they use 2.5 minute rounds -- I'm not sure how I could have managed with that time limit; I could barely finish in 5 minutes.)
The goal for each exercise is not to actually write the Game of Life, but to experience the process of coding under different conditions and constraints. In all 5 exercises, my partner and I never came close to finishing.
At the end of the day, we wrote down our observations as answers to the following questions:
Closing questions: On a piece of paper, write the answer to one of the following (to be shared with the group):
What, if anything, have you learned today?
What, if anything, surprised you today?
What, if anything, will you do differently?
During the discussions, we learned that software engineers write an average of 10 lines of code per day (!) I suspect that engineers spend a lot of time thinking and revising code, so only 10 lines of "forward progress" is made per day.
I thought the exercises were pretty interesting and sometimes entertaining (especially exercises 4 and 5). I had never done anything like it before. I learned about software engineering in the presence of constraints. For example, the crazy constraints in Exercise 2 forced me to do a lot of hacking. In Exercise 4 (the evil mute pairing), it was made clear that you can easily pass tests without the code actually implementing the featured tested.
Overall, I was forced to write a lot of tests quickly, which is something I'm normally pretty lazy about. It was also my first experience with pair programming. One of my first partners was a Java guy and it was interesting how differently he thought about programming. He wanted to write out a flow chart to design the program and do a lot of OOP stuff, whereas I just wanted to quickly prototype in Python. Switching partners frequently exposed me to different personalities and styles of programming.
Most of the students (about 40 of us) knew either Python or Java or both. I ended up programming in Python for all the exercises and using nose for my unit testing framework (nose was easier to use than unittest for quick dirty testing).
Overall, I thought the code retreat was fun and worth doing at least once. I'm not sure how these exercises would fit into the Software Carpentry curriculum, but they might be an interesting addition for an advanced workshop or maybe even a hacking day in a highly computational lab group. The barrier is that to get something out of these exercises, the students need to have written basic unit tests before (maybe that could be done in a pre-workshop prerequisite) and know a common programming language. Exercise 5 requires knowledge of Git. The students' laptops need to be setup with the programming language and unit testing framework (preferably for multiple languages) before the code retreat.


Slaughter Day + 1: Part 3, Butchering Pigs
by Matt
Where we left off in my previous post on processing pigs, the pigs had been eviscerated and split and were hanging to cool overnight. This post will describe the process of butchering a pig: taking it from a side or half down to what we know of as retail cuts, i.e., pork chops, spare ribs, etc.
From here, the first task is to break each side down into primal cuts. Primal cuts are the five main divisions in each side, which are further subdivided to yield retail cuts. These cuts are 1) the ham 2) the belly 3) the loin 4) the Boston butt, and 5) the picnic shoulder.
Many of the following cuts and butchering procedures are somewhat difficult to describe in text. I’ve found it’s helpful to have a diagram and/or video to refer to, especially where the cut is determined by the location of a particular bone or anatomic feature. For a very good intro video, I’m posting this link to Gregg Rentfrow’s excellent 45 minute clip on pork butchering. This is the video I learned from and the below text mostly follows his sequence of cuts with a few exceptions.
Making pork cuts is a fairly arbitrary process, depending largely on what your meat preferences are.
When butchering, we work outdoors on a stainless steel food service table set up near our slaughter area. Our pork sides are hanging nearby, and it is easiest to work with the meat outdoors in late fall or winter in conditions where it will also (hopefullly) stay cool until it is finally packaged or rubbed down with cure.
The first cuts I make are with the bone saw. I cut the feet off of both the front and hind legs. These cuts are made just above the knee joints. Pigs feet are not a delicacy we enjoy, so if we do save them, it is to later pick the meat off for sausage.
With the feet removed, I then turn to the ham. The ham is cut from the rest of the carcass after locating the aitch bone, which is part of the halved pelvic girdle. With the bone saw, I begin cutting two inches above the aitch bone (towards the loin) with the path of the saw running perpendicular to the shank, or extended leg, of the ham.
To visualize this cut, imagine the shank pointing straight up in the air if you were to set the cut face of the ham flat on a table. Once the saw is through the bone, I cut through the meat and skin below it with a sharp butcher knife. As a general rule, always use a knife to cut flesh and a saw (or hatchet or cleaver) to sever bone.
With the ham completely separated from the rest of the halved carcass, it can be cured or frozen, depending on preference. We make country ham or prosciutto with these cuts; both processes require curing in salt or cure mix and at least a year before the meat will be ready to eat, though I can definitely say the wait is worth it. I will cover the specifics of preparing country ham and prosciutto in the next post in this series.
Next, I separate the shoulder and Boston butt from the carcass. To do this, saw straight across the carcass from a point between the second and third rib. You will be cutting through bone almost the entire way: the backbone as well as the shoulder bone. When you get down to the skin and the fat, use a knife.
With these two cuts separated from the carcass, they can be further broken down. First though, the backbone and first two ribs should be removed by following the contours of the bones with a knife and separating them from the rest of the cut.
With that out of the way, sever the shoulder from the Boston butt by finding the shoulder blade and cutting with a knife about an inch below it (toward the shoulder). When you hit bone, cut through it with a saw and then continue with a knife.
We generally use the shoulder for sausage though it can be cured and smoked like ham. The Boston butt can be cut down further into pork steaks or used for sausage, though we usually try to save most of this cut for slow-cooked pulled pork barbecue.
With the front and back ends of the side removed, the loin and belly remain. We cut the belly out in one or two large sections. The belly is the easy to identify boneless fatty section below the ribs. We cut this off following the bottom ribline with a sharp butcher knife or boning knife.
Because we usually have a group of friends present to help us with butchering, we try to remove the ham and bacon first, before making any other retail cuts. These need to be vigorously rubbed with cure and, in the case of bacon, sealed in plastic for the duration of the cure time. To expedite the work of butchering, it’s a good idea to have one or several friends or volunteers working on curing and packing bacon and ham while the other less labor intensive (processing wise, anyway) cuts are still underway.
Now that the bacon/belly has been removed, we saw through the ribs, starting about two inches from the backbone on the front side of the carcass (where the Boston butt and picnic have been removed). Sawing straight across lengthwise will separate the spare ribs from the rest of the loin. The spare ribs can now be further broken down into meal-sized portions and packaged, removing any remaining cartilage or fatty tissue along the sternum end of the ribs.
With only the loin section left, we cut the layer of back fat away from the rest of the meat cuts, using a sharp but flexible boning knife. The goal is to avoid cutting into the rest of the loin meat while removing the dense layer of fat that is attached to the hide.
Next we cut out the sirloin, identified by the curvy bulge at one end of the loin section. The cut is made where the bulge tapers back into the rest of the loin section, starting between two vertebrae of the backbone and working downward parallel with the ribs. The sirloin is then further broken down into boneless sirloin chops by cutting away the bony section and slicing chops from the large remaining steak. We cut these about an inch thick. Scraps are saved for sausage.
With the rest of the loin, we separate the ribs using the same technique as the spare ribs: by running a sharp boning knife along the border between the ribs and the loin meat. With this cut made, we flip the loin over and make the same cut from the outside, but this time following the edge of the backbone. The ribs are connected to the backbone at about a 90-degree angle. With a bone saw and a knife, we then subdivide the ribs into meal or portion-sized cuts.
After removing the remaining blade bone and striated fatty section from the tubular loin section, the loin is broken down into pork chops or sausage. We enjoy sausage more than chops and so tend to make only a few cuts for chops and/or larger loin roasts, and designate a greater proportion of the loin meat for sausage.
Any other scraps and remainders from earlier on in the process also make it into the sausage pile, where they will later be cut into about one-inch cubes and sorted according to whether they are primarily fat or lean.
In this post, I have attempted to outline our general process of making primal and retail cuts of pork, though I realize it is by no means a thorough or exhaustively technical description.
As previously noted, those who are interested in learning pork butchery would do well to also consult a video or book with many photos and diagrams before attempting to break down a side of pork. Even better, enlist the help of an experienced butcher for your first pig slaughter, as we did during ours.
In the next installment of this series, I will cover the general process of curing and smoking ham and bacon, and making sausage, as well as covering a few details on packaging and storing pork. At the end of that post, I will also provide a list of resources I have found helpful that pertain to all stages of slaughtering, butchering and processing pork.
Subscribe via RSS


Avoid importing anything from the 'sun.*' packages. These packages are not portable and are likely to change.
This rule is deprecated, use {rule:squid:S1191} instead.


Knowledge Graph¶
Table of Contents:
Schemas¶
Using schemas is a way to ensure your data to follow a set of rules.
-
nexussdk.schemas.
create
(org_label, project_label, schema_obj, schema_id=None)¶ Create a new schema
- Parameters
org_label – Label of the organization in which to create the schema
project_label – label of the project in which to create a schema
schema_obj – Schema, can be a dictionary or a JSON string
schema_id – OPTIONAL The view will be created with this specific internal id, if provided. Otherwise, an id will be generated by Nexus.
- Returns
payload of the schema as a Python dictionary. This payload is partial and contains only Nexus metadata. To get the full schema payload, use the fetch() method.
-
nexussdk.schemas.
deprecate
(schema, rev=None)¶ Flag a schema as deprecated. Schema cannot be deleted in Nexus, once one is deprecated, it is no longer possible to update it.
- Parameters
schema – payload of a previously fetched resource
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the schema argument will be used.
- Returns
A payload containing only the Nexus metadata for this deprecated schema.
-
nexussdk.schemas.
fetch
(org_label, project_label, schema_id, rev=None, tag=None)¶ Fetches a distant schema and returns the payload as a dictionary. In case of error, an exception is thrown.
- Parameters
org_label – The label of the organization that the resource belongs to
project_label – The label of the project that the resource belongs to
schema_id – id of the schema
rev – OPTIONAL fetches a specific revision of a schema (default: None, fetches the last)
tag – OPTIONAL fetches the schema version that has a specific tag (default: None)
- Returns
Payload of the whole schema as a dictionary
-
nexussdk.schemas.
list
(org_label, project_label, pagination_from=0, pagination_size=20, deprecated=None, full_text_search_query=None)¶ List all the schemas available.
- Parameters
org_label – Label of the organization to which listing the schema
project_label – Label of the project to which listing the schema
pagination_from – OPTIONAL The pagination index to start from (default: 0)
pagination_size – OPTIONAL The maximum number of elements to returns at once (default: 20)
deprecated – OPTIONAL Get only deprecated resource if True and get only non-deprecated results if False. If not specified (default), return both deprecated and not deprecated resource.
full_text_search_query – A string to look for as a full text query
- Returns
The raw payload as a dictionary
- Returns
List of schema and some Nexus metadata
-
nexussdk.schemas.
tag
(schema, tag_value, rev_to_tag=None, rev=None)¶ Add a tag to a a specific revision of the schema. Note that a new revision (untagged) will be created
- Parameters
schema – payload of a previously fetched schema
tag_value – The value (or name) of a tag
rev_to_tag – OPTIONAL Number of the revision to tag. If not provided, this will take the revision number from the provided schema payload.
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the schema argument will be used.
- Returns
A payload containing only the Nexus metadata for this schema.
-
nexussdk.schemas.
update
(schema, rev=None)¶ Update a schema. The schema object is most likely the returned value of a nexus.schema.fetch(), where some fields where modified, added or removed. Note that the returned payload only contains the Nexus metadata and not the complete resource.
- Parameters
schema – payload of a previously fetched resource, with the modification to be updated
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the schema argument will be used.
- Returns
A payload containing only the Nexus metadata for this updated schema.
Resolvers¶
This module provides a Python interface for operations on Resolvers. It is part of the Knowledge Graph API of Blue Brain Nexus v1. https://bluebrainnexus.io/docs/api/kg/kg-resolvers-api.html
-
nexussdk.resolvers.
create
(org_label: str, project_label: str, projects: List[str], identities: List[Dict], priority: int, id: str = None, resource_types: List[str] = None) → Dict¶ Create a cross-project resolver.
- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
projects – List of target projects, given with format
organization/project
.identities – List of identities the creator of the resolver has and which have the permission
resources/read
on the target projects.priority – Resolution priority.
id – (optional) User-defined ID of the resolver, given as an IRI which is not URL encoded.
resource_types – (optional) List of types of the resources to resolve, given as IRIs.
- Returns
The Nexus metadata of the created resolver.
-
nexussdk.resolvers.
create_
(path: str, payload: Dict, id: str = None) → Dict¶ Create a resolver (path version).
- Parameters
path – Full path of the project the resolver belongs to, URL encoded.
payload – Payload of the resolver.
id – (optional) User-defined ID of the resolver, given as an IRI which is not URL encoded.
- Returns
The Nexus metadata of the created resolver.
-
nexussdk.resolvers.
fetch
(org_label: str, project_label: str, id: str, tag: str = None, rev: int = None) → Dict¶ Fetch a resolver.
Raise an
Exception
ifrev
andtag
are used together.- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
id – ID of the resolver, given as an IRI which is not URL encoded.
tag – (optional) Tag of the resolver.
rev – (optional) Revision number of the resolver.
- Returns
The Nexus payload of the fetched resolver.
-
nexussdk.resolvers.
fetch_
(path: str, tag: str = None, rev: int = None) → Dict¶ Fetch a resolver (full path version).
Raise an
Exception
ifrev
andtag
are used together.- Parameters
path – Full path of the resolver (i.e. includes its ID), URL encoded.
tag – (optional) Tag of the resolver.
rev – (optional) Revision number of the resolver.
- Returns
The Nexus payload of the fetched resolver.
-
nexussdk.resolvers.
list
(org_label: str, project_label: str, pagination_from: int = None, pagination_size: int = None, deprecated: bool = None, type: str = None, created_by: str = None, updated_by: str = None, rev: int = None) → Dict¶ List resolvers corresponding to some criteria.
- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
pagination_from – (optional) Pagination index to start from. Default:
0
.pagination_size – (optional) Number of results to return per page. Default:
20
.deprecated – (optional) Deprecation status of the resolvers to keep.
type – (optional) Type of the resolvers to keep, given as an IRI.
created_by – (optional) Identity ID of the creator of the resolvers to keep, given as an IRI.
updated_by – (optional) Identity ID of the last identity which has updated the resolvers to keep, given as en IRI.
rev – (optional) Revision number of the resolvers to keep.
- Returns
A Nexus results list with the Nexus metadata of the matching resolvers.
-
nexussdk.resolvers.
list_
(path: str, pagination_from: int = None, pagination_size: int = None, deprecated: bool = None, type: str = None, created_by: str = None, updated_by: str = None, rev: int = None) → Dict¶ List resolvers corresponding to some criteria (path version).
- Parameters
path – Full path of the project the resolver belongs to, URL encoded.
pagination_from – (optional) Pagination index to start from. Default:
0
.pagination_size – (optional) Number of results to return per page. Default:
20
.deprecated – (optional) Deprecation status of the resolvers to keep.
type – (optional) Type of the resolvers to keep, given as an IRI.
created_by – (optional) Identity ID of the creator of the resolvers to keep, given as an IRI.
updated_by – (optional) Identity ID of the last identity which has updated the resolvers to keep, given as en IRI.
rev – (optional) Revision number of the resolvers to keep.
- Returns
A Nexus results list with the Nexus metadata of the matching resolvers.
-
nexussdk.resolvers.
update
(org_label: str, project_label: str, id: str, projects: List[str], identities: List[Dict], priority: int, rev: int, resource_types: List[str] = None) → Dict¶ Update a resolver.
- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
id – ID of the resolver, given as an IRI which is not URL encoded.
projects – List of target projects, given with format
organization/project
.identities – List of identities the creator of the resolver has and which have the permission
resources/read
on the target projects.priority – Resolution priority.
rev – Last revision of the resolver.
resource_types – (optional) List of types of the resources to resolve, given as IRIs.
- Returns
The Nexus metadata of the updated resolver.
-
nexussdk.resolvers.
update_
(path: str, payload: Dict, rev: int) → Dict¶ Update a resolver (full path version).
- Parameters
path – Full path of the resolver (i.e. includes its ID), URL encoded.
payload – Payload of the resolver.
rev – Last revision of the resolver.
- Returns
The Nexus metadata of the updated resolver.
-
nexussdk.resolvers.
tag
(org_label: str, project_label: str, id: str, tag: str, rev_to_tag: str, rev: int) → Dict¶ Tag a revision of a resolver.
- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
id – ID of the resolver, given as an IRI which is not URL encoded.
tag – Tag to set.
rev_to_tag – Revision number to tag.
rev – Last revision of the resolver.
- Returns
The Nexus metadata of the tagged resolver.
-
nexussdk.resolvers.
tag_
(path: str, payload: Dict, rev: int) → Dict¶ Tag a revision of a resolver (full path version).
- Parameters
path – Full path of the resolver (i.e. includes its ID), URL encoded.
payload – Payload of the tag.
rev – Last revision of the resolver.
- Returns
The Nexus metadata of the tagged resolver.
-
nexussdk.resolvers.
deprecate
(org_label: str, project_label: str, id: str, rev: int) → Dict¶ Deprecate a resolver.
- Parameters
org_label – Label of the organization the resolver belongs to.
project_label – Label of the project the resolver belongs to.
id – ID of the resolver, given as an IRI which is not URL encoded.
rev – Last revision of the resolver.
- Returns
The Nexus metadata of the deprecated resolver.
-
nexussdk.resolvers.
deprecate_
(path: str, rev: int) → Dict¶ Deprecate a resolver (full path version).
- Parameters
path – Full path of the resolver (i.e. includes its ID), URL encoded.
rev – Last revision of the resolver.
- Returns
The Nexus metadata of the deprecated resolver.
Views¶
A view is a way to access Nexus data and to perform queries. A view belongs to a specific project. By default, an ElasticSearch view and a SparQL view are provided. More ElasticSearch views can be created manually, hence providing a custom indexing and custom research capabilities.
-
nexussdk.views.
aggregate_es
(org_label, project_label, esviews, id)¶ Creates an aggregated view for ElasticSearch.
- Parameters
org_label – Label of the organization the view wil belong to
project_label – label of the project the view will belong too
esviews – list of ElasticSearch view payloads, most likely got with .fetch()
id – id to give to this aggregation id ElasticSearch views
- Returns
A payload containing only the Nexus metadata for this aggregated view.
-
nexussdk.views.
create_es
(org_label, project_label, view_data, view_id=None)¶ Creates an ElasticSearch view
- Parameters
org_label – Label of the organization the view wil belong to
project_label – label of the project the view will belong too
view_data – Mapping data required for ElasticSearch indexing
view_id – OPTIONAL if provided, the view will be created with the given id. Otherwise, an autogenerated one will be given by Nexus
- Returns
The payload representing the view. This payload only contains the Nexus metadata
-
nexussdk.views.
deprecate_es
(esview, rev=None)¶ Update a ElasticSearch view. The esview object is most likely the returned value of a nexus.views.fetch(), where some fields where modified, added or removed. Note that the returned payload only contains the Nexus metadata and not the complete view.
- Parameters
esview – payload of a previously fetched view, with the modification to be updated
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the view argument will be used.
- Returns
A payload containing only the Nexus metadata for this updated view.
-
nexussdk.views.
fetch
(org_label, project_label, view_id, rev=None, tag=None)¶ Fetches a distant view and returns the payload as a dictionary. In case of error, an exception is thrown.
- Parameters
org_label – The label of the organization that the view belongs to
project_label – The label of the project that the view belongs to
view_id – id of the view
rev – OPTIONAL fetches a specific revision of a view (default: None, fetches the last)
tag – OPTIONAL fetches the view version that has a specific tag (default: None)
- Returns
Payload of the whole view as a dictionary
-
nexussdk.views.
list
(org_label, project_label, pagination_from=0, pagination_size=20, deprecated=None, type=None, rev=None, schema=None, created_by=None, updated_by=None, view_id=None)¶ List the views available for a given organization and project. All views, of all kinds.
- Parameters
org_label – The label of the organization that the view belongs to
project_label – The label of the project that the view belongs to
pagination_from – OPTIONAL The pagination index to start from (default: 0)
pagination_size – OPTIONAL The maximum number of elements to returns at once (default: 20)
deprecated – OPTIONAL Get only deprecated view if True and get only non-deprecated results if False. If not specified (default), return both deprecated and not deprecated view.
type – OPTIONAL The view type
rev – OPTIONAL Revision to list
schema – OPTIONAL list only the views with a certain schema
created_by – OPTIONAL List only the views created by a certain user
updated_by – OPTIONAL List only the views that were updated by a certain user
view_id – OPTIONAL List only the view with this id. Relevant only when combined with other args
- Returns
The raw payload as a dictionary
-
nexussdk.views.
list_keep_only_es
(viewlist)¶ Helper function to keep only the ElasticSearch views metadata from the result of a .list() call.
- Parameters
viewlist – the payload returned by .list()
- Returns
the list of ElasticSearch view metadata (beware: not complete payloads like if it was the result of .fetch() calls)
-
nexussdk.views.
list_keep_only_sparql
(viewlist)¶ Helper function to keep only the SparQL views metadata from the result of a .list() call.
- Parameters
viewlist – the payload returned by .list()
- Returns
the list of SparQL view metadata (beware: not complete payloads like if it was the result of .fetch() calls)
-
nexussdk.views.
query_es
(org_label, project_label, query, view_id='documents')¶ Perform a ElasticSearch query.
- Parameters
org_label – Label of the organization to perform the query on
project_label – Label of the project to perform the query on
view_id – id of an ElasticSearch view
query – ElasticSearch query as a JSON string or a dictionary
- Returns
the result of the query as a dictionary
-
nexussdk.views.
query_sparql
(org_label, project_label, query)¶ Perform a SparQL query.
- Parameters
org_label – Label of the organization to perform the query on
project_label – Label of the project to perform the query on
query – Query as a string
- Returns
result of the query as a dictionary
-
nexussdk.views.
tag_es
(esview, tag_value, rev_to_tag=None, rev=None)¶ Add a tag to a a specific revision of an ElasticSearch view. Note that a new revision (untagged) will be created.
- Parameters
esview – payload of a previously fetched view (ElasticSearch)
tag_value – The value (or name) of a tag
rev_to_tag – OPTIONAL Number of the revision to tag. If not provided, this will take the revision number from the provided resource payload.
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the resource argument will be used.
- Returns
A payload containing only the Nexus metadata for this view.
-
nexussdk.views.
update_es
(esview, rev=None)¶ Update a ElasticSearch view. The esview object is most likely the returned value of a nexus.views.fetch(), where some fields where modified, added or removed. Note that the returned payload only contains the Nexus metadata and not the complete view.
- Parameters
esview – payload of a previously fetched view, with the modification to be updated
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the view argument will be used.
- Returns
A payload containing only the Nexus metadata for this updated view.
Files¶
Files are a particular kind of resource that contain binary data. In addition, like any other resource, they are bound to a project (and thus, an organization) and can be described with their metadata.
-
nexussdk.files.
create
(org_label, project_label, filepath, file_id=None)¶ This is the POST method, when the user does not provide a file ID.
- Parameters
org_label – The label of the organization that the file belongs to
project_label – The label of the project that the file belongs to
filepath – path of the file to upload
file_id – OPTIONAL Will use this id to identify the file if provided. If not provided, an ID will be generated
- Returns
A payload containing only the Nexus metadata for this updated file.
-
nexussdk.files.
deprecate
(file, rev=None)¶ Flag a file as deprecated. files cannot be deleted in Nexus, once one is deprecated, it is no longer possible to update it.
- Parameters
file – payload of a previously fetched file
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the file argument will be used.
- Returns
A payload containing only the Nexus metadata for this deprecated file.
-
nexussdk.files.
fetch
(org_label, project_label, file_id, rev=None, tag=None, out_filepath=None)¶ Fetches a distant file and returns the metadata of this file. In addition, if the argument out_filepath can be of three forms: - out_filepath=None (default): the binary is not fetched - out_filepath=”./some/folder/” the binary is fetched and written in this dir with it’s original filename - out_filepath=”./somefile.jpg” the binary is fetched and written under this exact filename
In case of error, an exception is thrown.
- Parameters
org_label – The label of the organization that the file belongs to
project_label – The label of the project that the file belongs to
file_id – id of the file
rev – OPTIONAL fetches a specific revision of a file (default: None, fetches the last)
tag – OPTIONAL fetches the file version that has a specific tag (default: None)
out_filepath – OPTIONAL the filename to write (default: None)
- Returns
Payload of the whole file as a dictionary
-
nexussdk.files.
list
(org_label, project_label, pagination_from=0, pagination_size=20, deprecated=None, type=None, rev=None, schema=None, created_by=None, updated_by=None, file_id=None)¶ List the files available for a given organization and project.
- Parameters
org_label – The label of the organization that the file belongs to
project_label – The label of the project that the file belongs to
pagination_from – OPTIONAL The pagination index to start from (default: 0)
pagination_size – OPTIONAL The maximum number of elements to returns at once (default: 20)
deprecated – OPTIONAL Get only deprecated file if True and get only non-deprecated results if False. If not specified (default), return both deprecated and not deprecated file.
type – OPTIONAL Lists only the file for a given type (default: None)
rev – OPTIONAL List only the resource with this particular revision
schema – OPTIONAL list only the views with a certain schema
created_by – OPTIONAL List only the file created by a certain user
updated_by – OPTIONAL List only the file that were updated by a certain user
file_id – OPTIONAL List only the file with this id. Relevant only when combined with other args
- Returns
The raw list payload as a dictionary
-
nexussdk.files.
tag
(file, tag_value, rev_to_tag=None, rev=None)¶ Add a tag to a a specific revision of the file. Note that a new revision (untagged) will be created
- Parameters
file – payload of a previously fetched file
tag_value – The value (or name) of a tag
rev_to_tag – OPTIONAL Number of the revision to tag. If not provided, this will take the revision number from the provided file payload.
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the file argument will be used.
- Returns
A payload containing only the Nexus metadata for this file.
List all the tags added to this file, along with their version numbers
- Parameters
file – payload of a previously fetched file
- Returns
payload containing the list of tags and versions
-
nexussdk.files.
update
(file, filepath, rev=None)¶ Update a file. The file object is most likely the returned value of a nexus.file.fetch(), where some fields where modified, added or removed. Note that the returned payload only contains the Nexus metadata and not the complete file.
- Parameters
file – payload of a previously fetched file, with the modification to be updated
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the file argument will be used.
- Returns
A payload containing only the Nexus metadata for this updated file.
Resources¶
A resource represents a set of organized data represented with JSON. Hence, a resource can handle data such as numbers, strings, arrays, boolean and complex objects made of those primitive types. In addition, Nexus adds some metadata. Resources belong to projects and their access rights are defined at the project level.
-
nexussdk.resources.
create
(org_label, project_label, data, schema_id='_', resource_id=None)¶ Create a resource. If resource_id is provided, this given ID will be used. If resource_id not provided, an ID will be automatically generated for this new resource.
- Parameters
org_label – The label of the organization that the resource belongs to
project_label – The label of the project that the resource belongs to
schema_id – OPTIONAL The schema to constrain the data. Can be None for non constrained data (default: “resource)
data – dictionary containing the data to store in this new resource
resource_id – OPTIONAL force the use of a specific id when creating the new resource
- Returns
A payload containing only the Nexus metadata for this updated resource.
If the data does not have a “@context” value, a default one is automatically added.
-
nexussdk.resources.
deprecate
(resource, rev=None)¶ Flag a resource as deprecated. Resources cannot be deleted in Nexus, once one is deprecated, it is no longer possible to update it.
- Parameters
resource – payload of a previously fetched resource
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the resource argument will be used.
- Returns
A payload containing only the Nexus metadata for this deprecated resource.
-
nexussdk.resources.
fetch
(org_label, project_label, resource_id, schema_id='_', rev=None, tag=None)¶ Fetches a distant resource and returns the payload as a dictionary. In case of error, an exception is thrown.
- Parameters
org_label – The label of the organization that the resource belongs to
project_label – The label of the project that the resource belongs to
resource_id – id of the resource
schema_id – OPTIONAL id of the schema (default: “_” means whatever)
rev – OPTIONAL fetches a specific revision of a resource (default: None, fetches the last)
tag – OPTIONAL fetches the resource version that has a specific tag (default: None)
- Returns
Payload of the whole resource as a dictionary
-
nexussdk.resources.
list
(org_label, project_label, pagination_from=0, pagination_size=20, deprecated=None, type=None, rev=None, schema=None, created_by=None, updated_by=None, resource_id=None)¶ List the resources available for a given organization and project.
- Parameters
org_label – The label of the organization that the resource belongs to
project_label – The label of the project that the resource belongs to
schema – OPTIONAL Lists only the resource for a given schema (default: None)
pagination_from – OPTIONAL The pagination index to start from (default: 0)
pagination_size – OPTIONAL The maximum number of elements to returns at once (default: 20)
deprecated – OPTIONAL Get only deprecated resource if True and get only non-deprecated results if False. If not specified (default), return both deprecated and not deprecated resource.
type – OPTIONAL Lists only the resource for a given type (default: None)
rev – OPTIONAL List only the resource with this particular revision
created_by – OPTIONAL List only the resources created by a certain user
updated_by – OPTIONAL List only the resources that were updated by a certain user
resource_id – OPTIONAL List only the resources with this id. Relevant only when combined with other args
- Returns
The raw payload as a dictionary
-
nexussdk.resources.
tag
(resource, tag_value, rev_to_tag=None, rev=None)¶ Add a tag to a a specific revision of the resource. Note that a new revision (untagged) will be created
- Parameters
resource – payload of a previously fetched resource
tag_value – The value (or name) of a tag
rev_to_tag – OPTIONAL Number of the revision to tag. If not provided, this will take the revision number from the provided resource payload.
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the resource argument will be used.
- Returns
A payload containing only the Nexus metadata for this resource.
List all the tags added to this resource, along with their version numbers
- Parameters
resource – payload of a previously fetched resource
- Returns
payload containing the list of tags and versions
-
nexussdk.resources.
update
(resource, rev=None)¶ Update a resource. The resource object is most likely the returned value of a nexus.resource.fetch(), where some fields where modified, added or removed. Note that the returned payload only contains the Nexus metadata and not the complete resource.
- Parameters
resource – payload of a previously fetched resource, with the modification to be updated
rev – OPTIONAL The previous revision you want to update from. If not provided, the rev from the resource argument will be used.
- Returns
A payload containing only the Nexus metadata for this updated resource.


face There are individual exercises in this section.
The past perfect tense can be used to describe an action that began in the past that preceded
another past action. The past perfect is formed by using the past form of the verb have, that is,
had, with the past participle of the main verb:


---
layout: post
title: Populating a drop down box from a comma delimited field
tags: []
status: publish
type: post
published: true
meta: {}
---
Occasionally you'll come across database fields that contains a list of keywords that are comma delimited. One instance would be for storing the style of a certain product. Take shoe as an example, you can have a trainer, walking, formal or work style for said shoe. These different styles in our case were stored in one field in database. However when it came to building the front end of the shopping cart we needed to allow the user to choose a specific style for said shoe. In the following I'll be explaining how populate a drop down box from a comma list of items stored in a database.Step 1, get the items of interest. Here we right a basic query that retrieves the contents of the field we wish to display, in our case the style of a shoe. The code below shows you how to do this:
[code]
select table.style
from table
where item = 'shoe'
[/code]
Here we select the content of a field called style in a table called table where the item value is equal to 'shoe'. Next we define a variable and store the results of aforementioned query in that variable.
[code]
[/code]
As result of this the variable keywords contains the following information (based on the above example: trainer, walking, formal, work. Now we need to extract that information and put into a drop down menu. To this end we will have to loop over that variable and display each and every item in an field. Thankfully allows you to specify a delimiter and in our case it would be a ','. So the entire Cold Fusion code would look something like this:
[code]
[/code]
And there you go, you know have broken down a comma delimited field into a drop down menu based on the content of a field in your database.


Preface
Training in data analysis often begins with Statistics 101 course. Students learn the “happy path” of answer data that adheres to specific assumptions (such as “independent and identically distributed with a Normal density”) and answers pre-specified questions (most notably, the infamous null hypothesis significance test). Then, they venture out into the world of real-world data analysis where non-experimental data is rarely so well behaved and the questions asked of it are far more nuanced.
No one course should aim to teach students everything they should know about statistics. In fact, one of the best parts about a career in statistics is the responsibility and privilege of life-long learning. However, the flaw of introductory statistics is not that it’s incomplete, but that it’s not obvious how it is not complete. Statistics is a bad salesman. There’s no season finale, no cliff hanger, no teasing and hinting and promising more and better to come. Student may leave their studies believing that answering more complex data analysis questions is trivially easy (by relying on the one-size-fits-all “panacea” that they learned) or intractably difficult (when the assumptions of that method are not met.)
This book attempts to add more color to all the dimensions of data analysis while showcasing the nuances throughout the true life cycle of data analysis using two strategies.
First, it attempts to highlight common pitfalls in all the parts of data analysis: from data management and computation to visualization, interpretation, and modeling and even to communication and collaboration. Data analysis is fundamentally a creative task, so there are rarely canonical one-size-fits-all solutions. Curiously, however, there are plenty of canonical issues even if they require different solutions in different settings. Thus, the goal of this book is to highlight common data disasters and, in doing so, help students cultivate an intuition for how to detect common problems before they occur in an important analysis.
Second, while exploring these data disasters, we humbly put forth a (woefully incomplete!) literature review of more advanced methods from statistics and other quantitative disciplines (e.g. economics, epidemiology), to help learners build a “mental index” of terms to search and techniques to study should they encounter a relevant problem.
0.1 Main Topics
In particular, we will aim to help you avoid ten types of data disasters:
- Data Dalliances: Misinterpreting or misuing data based on how it was collected or what it represents
- Computational Quandaries: Letting computers do what you said and not what you meant
- Egregious Aggregations: Losing critical information when information is condensed
- Vexing Visualization: Confusing ourselves or others with plotting choices
- Incredible Inferences: Drawing incorrect conclusions for analytical results
- Cavalier Causality: Falling prey to spurious correlations masquerading as causality
- Mindless Modeling: Failing to get the most value out of models by not tailoring the features, targets, and performance metrics
- Alternative Algorithms: Lacking an understanding of alternative methods which may be better suited for the problem at hand
- Futile Findings: Asking and answering questions that aren’t useful
- Complexifying Code: Making projects unwieldy or more difficult to understand than necessary
- Rejecting Reproducibility: Working inefficiently instead of an efficient, reproducible, and sharable workflow
0.2 Common Themes
In each chapter, we will see numerous examples of each disaster and consider strategies to help us mitigate. Along the way, we’ll emphasize:
- The importance of domain knowledge and the data-generating process to decide what it is you want to do
- The utility of simulation as a tool to explore if, in fact, you are doing it
- The exploration of counterexamples to build intuition for common patterns of problems even where common solutions don’t exist
As we go, we will notice how three common themes that challenge the focus of introductory statistics:
- Summary statistics mask interesting stories that we see when focusing on the variation
- Similarly, observations and variables are rarely independent; the story is in the covariance
- Assumptions of Normality, or more broadly symmetry, are often in appropriate in wonky, highly skewed world