Namespace
Methods
- A
- B
- E
- R
- S
- T
Instance Public methods
after_teardown()
Link
Source: show
# File<EMAIL_ADDRESS>line 830 def after_teardown super teardown_fixtures end
before_setup()
Link
Source: show
# File<EMAIL_ADDRESS>line 825 def before_setup setup_fixtures super end
enlist_fixture_connections()
Link
Source: show
# File<EMAIL_ADDRESS>line 973 def enlist_fixture_connections ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection) end
run_in_transaction?()
Link
Source: show
# File<EMAIL_ADDRESS>line 922 def run_in_transaction? use_transactional_fixtures && !self.class.uses_transaction?(method_name) end
setup_fixtures(config = ActiveRecord::Base)
Link
Source: show
# File<EMAIL_ADDRESS>line 927 def setup_fixtures(config = ActiveRecord::Base) if pre_loaded_fixtures && !use_transactional_fixtures raise RuntimeError, 'pre_loaded_fixtures requires use_transactional_fixtures' end @fixture_cache = {} @fixture_connections = [] @@already_loaded_fixtures ||= {} # Load fixtures once and begin transaction. if run_in_transaction? if @@already_loaded_fixtures[self.class] @loaded_fixtures = @@already_loaded_fixtures[self.class] else @loaded_fixtures = load_fixtures(config) @@already_loaded_fixtures[self.class] = @loaded_fixtures end @fixture_connections = enlist_fixture_connections @fixture_connections.each do |connection| connection.begin_transaction joinable: false end # Load fixtures for every test. else ActiveRecord::FixtureSet.reset_cache @@already_loaded_fixtures[self.class] = nil @loaded_fixtures = load_fixtures(config) end # Instantiate fixtures for every test if requested. instantiate_fixtures if use_instantiated_fixtures end
teardown_fixtures()
Link
Source: show
# File<EMAIL_ADDRESS>line 959 def teardown_fixtures # Rollback changes if a transaction is active. if run_in_transaction? @fixture_connections.each do |connection| connection.rollback_transaction if connection.transaction_open? end @fixture_connections.clear else ActiveRecord::FixtureSet.reset_cache end ActiveRecord::Base.clear_active_connections! end


Easyjet becomes first major airline to go carbon neutral
by Alex DanielEasyjet has become the world’s first major airline to offset all carbon emissions given off by its flights, as the aviation industry comes under mounting pressure to reduce its environmental impact.
The budget carrier said the measure, which involves stopping deforestation in South America, installing solar panels in India and reducing wood-burning water sanitation in Uganda, would cost around £35m a year until 2022.
Read more: Easyjet buys Thomas Cook slots at Gatwick and Bristol
But chief executive Johan Lundgren said the firm would shoulder the cost because it is “the right thing to do”.
The promise came as the airline reported a 26 per cent fall in profit to £427m over the last year, which was at the upper end of expectations.
Lundgren added: “We recognise that offsetting is only an interim measure, but we want to take action on our carbon emissions now.”
Commercial flights make up about two per cent of global carbon emissions, with airlines increasingly responding to the growing “flight shame” movement, which originated from Lundgren’s native Sweden.
British Airways last month announced its own plans to offset emissions from all its domestic flights from next year, while its owner, IAG, became the first group to commit to net zero carbon flying by 2050.
Read more: Easyjet prepares to take more Thomas Cook market share
Lundgren said that although Easyjet could benefit commercially from its flights being less detrimental to the environment than others, this was not the reason for the decision.
“Customers increasingly expect companies to do something about [climate change]. But fundamentally, it’s just the right thing to do,” he said.


FAQ
Questions about Questions
-
How do we define user-led organisations?
User-led organisations are organisations that are run by and controlled by people who use support services. You can find user-led organisations in GrantNav by typing ‘user-led’ in the grants description field. If you are using other datasets, we allow a broad understanding of the term, e.g. user-led, community-led, patient-led, youth-led. Please provide a short justification of your chosen groups, explaining how they fall into the user-led category.
-
How many years should I be looking at?
It depends. Different grantmakers publish data covering different years. Because the 360Giving dataset varies across time, you can select the time period you want to analyse.
-
Are there any themes you want us to consider?
We want to you define the theme or themes you want to focus on and justify your choice in accordance with the data you decide to use.
-
What is considered to be a “data visualisation?"
A data visualisation is representation of data in a visual format that aims to convey difficult concepts in the underlying dataset in a more user-friendly form.
-
Can I use additional datasets?
All entries must use the 360Giving dataset, but the use other datasets is encouraged in order to fully answer the Challenge questions.
-
What form can my visualisation take?
We will accept a range of media including interactive web applications, graphic images and videos. If you do create an interactive application (Javascript, Flash, etc.), it must function in a normal browser environment and you must host it on your own site.
-
Under what copyright should my visualisation be released?
Since we promote open data and a sharing culture, your entry must be provided under a Creative Commons 4.0 license.
-
Can I submit more than one entry?
You can submit up to two data visualisations, one for each question.
-
Are team entries allowed?
Yes, we accept entries from teams of up to eight people.
-
Can I submit my own entries in addition to my team’s entries?
Yes, but you can only submit two entries in total.
-
Can I edit my entry after I have submitted it?
No.
-
When is the deadline for submissions?
31th July 2018 at 11:59:59 pm British Summer Time (BST).
-
How will the winning entries be selected?
An expert panel will assess all submissions against the following criteria:
- The applicant’s ability to answer the Challenge question correctly and clearly
- Aesthetics and creativity
- How innovative it is compared to current visualisations
-
When will you announce the results?
Finalists will be notified between 1st August and 1st September 2018. The winners will be announced in September.
-
What are the prizes?
It is our intention - depending on the number of submissions and their quality - to make an award of between £100 and £500 to each entry that meets our submission criteria. Grand awards of £6,000, £4,000 and £2,000 will be announced in September.
-
I have more questions about the competition. Who should I contact?
Please post any questions about the competition on our Discussion Forum, where they will be answered promptly: https://forum.threesixtygiving.org
-
How will my submission be hosted?
Your visualisation will be hosted on our submissions site. See the Terms & Conditions for more details.
-
I have more questions about the competition. Who should I contact?
You can also email us at labs@threesixtygiving.org


|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Quaternion class. More...
#include <Dcm.hpp>
Public Types | |
| typedef Matrix< Type, 4, 1 > | Matrix41 |
| typedef Matrix< Type, 3, 1 > | Matrix31 |
| Public Types inherited from matrix::Vector< Type, 4 > | |
| typedef Matrix< Type, M, 1 > | MatrixM1 |
Public Member Functions | |
| Quaternion (const Type *data_) | |
| Constructor from array. More... | |
| Quaternion () | |
| Standard constructor. More... | |
| Quaternion (const Matrix41 &other) | |
| Constructor from Matrix41. More... | |
| Quaternion (const Dcm< Type > &R) | |
| Constructor from dcm. More... | |
| Quaternion (const Euler< Type > &euler) | |
| Constructor from euler angles. More... | |
| Quaternion (const AxisAngle< Type > &aa) | |
| Quaternion from AxisAngle. More... | |
| Quaternion (const Vector3< Type > &src, const Vector3< Type > &dst, const Type eps=Type(1e-5)) | |
| Quaternion from two vectors Generates shortest rotation from source to destination vector. More... | |
| Quaternion (Type a, Type b, Type c, Type d) | |
| Constructor from quaternion values. More... | |
| Quaternion | operator* (const Quaternion &q) const |
| Quaternion multiplication operator. More... | |
| void | operator*= (const Quaternion &other) |
| Self-multiplication operator. More... | |
| Quaternion | operator* (Type scalar) const |
| Scalar multiplication operator. More... | |
| void | operator*= (Type scalar) |
| Scalar self-multiplication operator. More... | |
| Matrix41 | derivative1 (const Matrix31 &w) const |
| Computes the derivative of q_21 when rotated with angular velocity expressed in frame 1 v_2 = q_21 * v_1 * q_21^-1 d/dt q_21 = 0.5 * q_21 * omega_2. More... | |
| Matrix41 | derivative2 (const Matrix31 &w) const |
| Computes the derivative of q_21 when rotated with angular velocity expressed in frame 2 v_2 = q_21 * v_1 * q_21^-1 d/dt q_21 = 0.5 * omega_1 * q_21. More... | |
| void | invert () |
| Invert quaternion in place. More... | |
| Quaternion | inversed () const |
| Invert quaternion. More... | |
| void | rotate (const AxisAngle< Type > &vec) |
| Rotate quaternion from rotation vector. More... | |
| Vector3f | conjugate (const Vector3f &vec) |
| Rotates vector v_1 in frame 1 to vector v_2 in frame 2 using the rotation quaternion q_21 describing the rotation from frame 1 to 2 v_2 = q_21 * v_1 * q_21^-1. More... | |
| Vector3f | conjugate_inversed (const Vector3f &vec) const |
| Rotates vector v_2 in frame 2 to vector v_1 in frame 1 using the rotation quaternion q_21 describing the rotation from frame 1 to 2 v_1 = q_21^-1 * v_1 * q_21. More... | |
| void | from_axis_angle (Vector< Type, 3 > vec) |
| Rotation quaternion from vector. More... | |
| void | from_axis_angle (const Vector< Type, 3 > &axis, Type theta) |
| Rotation quaternion from axis and angle XXX DEPRECATED, use AxisAngle class. More... | |
| Vector< Type, 3 > | to_axis_angle () const |
| Rotation vector from quaternion XXX DEPRECATED, use AxisAngle class. More... | |
| Vector3< Type > | imag () const |
| Imaginary components of quaternion. More... | |
| Vector3< Type > | dcm_z () const |
| Corresponding body z-axis to an attitude quaternion / last orthogonal unit basis vector. More... | |
| Quaternion | from_dcm (Matrix< Type, 3, 3 > dcm) |
| XXX DEPRECATED, can use assignment or ctor. More... | |
| Dcm< Type > | to_dcm () |
| XXX DEPRECATED, can use assignment or ctor. More... | |
| Public Member Functions inherited from matrix::Vector< Type, 4 > | |
| Vector () | |
| Vector (const MatrixM1 &other) | |
| Vector (const Type *data_) | |
| Type | operator() (size_t i) const |
| Type & | operator() (size_t i) |
| Type | dot (const MatrixM1 &b) const |
| Type | operator* (const MatrixM1 &b) const |
| Vector | operator* (float b) const |
| Type | norm () const |
| Type | norm_squared () const |
| Type | length () const |
| void | normalize () |
| Vector | unit () const |
| Vector | unit_or_zero (const Type eps=Type(1e-5)) |
| Vector | normalized () const |
| Vector | pow (Type v) const |
| Public Member Functions inherited from matrix::Matrix< Type, M, 1 > | |
| Matrix () | |
| Matrix (const Type data_[][N]) | |
| Matrix (const Type *data_) | |
| Matrix (const Matrix &other) | |
| Type * | data () |
| Accessors/ Assignment etc. More... | |
| const Type * | data () const |
| Type | operator() (size_t i, size_t j) const |
| Type & | operator() (size_t i, size_t j) |
| Matrix< Type, M, N > & | operator= (const Matrix< Type, M, N > &other) |
| void | copyTo (Type(&dst)[M *N]) const |
| void | copyToRaw (Type *dst) const |
| void | copyToColumnMajor (Type(&dst)[M *N]) const |
| Matrix< Type, M, P > | operator* (const Matrix< Type, N, P > &other) const |
| Matrix Operations. More... | |
| Matrix< Type, M, N > | operator* (Type scalar) const |
| Scalar Operations. More... | |
| Matrix< Type, M, N > | emult (const Matrix< Type, M, N > &other) const |
| Matrix< Type, M, N > | edivide (const Matrix< Type, M, N > &other) const |
| Matrix< Type, M, N > | operator+ (const Matrix< Type, M, N > &other) const |
| Matrix< Type, M, N > | operator+ (Type scalar) const |
| Matrix< Type, M, N > | operator- (const Matrix< Type, M, N > &other) const |
| Matrix< Type, M, N > | operator- () const |
| Matrix< Type, M, N > | operator- (Type scalar) const |
| void | operator+= (const Matrix< Type, M, N > &other) |
| void | operator+= (Type scalar) |
| void | operator-= (const Matrix< Type, M, N > &other) |
| void | operator-= (Type scalar) |
| void | operator*= (const Matrix< Type, N, P > &other) |
| void | operator*= (Type scalar) |
| Matrix< Type, M, N > | operator/ (Type scalar) const |
| void | operator/= (Type scalar) |
| bool | operator== (const Matrix< Type, M, N > &other) const |
| bool | operator!= (const Matrix< Type, M, N > &other) const |
| void | write_string (char *buf, size_t n) const |
| Misc. More... | |
| void | print () const |
| Matrix< Type, N, M > | transpose () const |
| Matrix< Type, N, M > | T () const |
| Matrix< Type, P, Q > | slice (size_t x0, size_t y0) const |
| void | set (const Matrix< Type, P, Q > &m, size_t x0, size_t y0) |
| void | setRow (size_t i, const Matrix< Type, N, 1 > &row) |
| void | setCol (size_t j, const Matrix< Type, M, 1 > &col) |
| void | setZero () |
| void | zero () |
| void | setAll (Type val) |
| void | setOne () |
| void | setIdentity () |
| void | identity () |
| void | swapRows (size_t a, size_t b) |
| void | swapCols (size_t a, size_t b) |
| Matrix< Type, M, N > | abs () const |
| Type | max () const |
| Type | min () const |
Additional Inherited Members | |
| Public Attributes inherited from matrix::Matrix< Type, M, 1 > | |
| Type | _data [M][N] |
Quaternion class.
The rotation between two coordinate frames is described by this class.
| typedef Matrix<Type, 3, 1> matrix::Quaternion< Type >::Matrix31 |
Definition at line 58 of file Quaternion.hpp.
| typedef Matrix<Type, 4, 1> matrix::Quaternion< Type >::Matrix41 |
Definition at line 57 of file Quaternion.hpp.
|
inline |
|
inline |
Standard constructor.
Definition at line 73 of file Quaternion.hpp.
Referenced by matrix::Quaternion< Type >::from_dcm(), and matrix::Quaternion< Type >::inversed().
|
inline |
Constructor from Matrix41.
| other | Matrix41 to copy |
Definition at line 88 of file Quaternion.hpp.
|
inline |
Constructor from dcm.
Instance is initialized from a dcm representing coordinate transformation from frame 2 to frame 1.
| dcm | dcm to set quaternion to |
Definition at line 101 of file Quaternion.hpp.
References matrix::SquareMatrix< Type, 3 >::trace().
|
inline |
Constructor from euler angles.
This sets the instance to a quaternion representing coordinate transformation from frame 2 to frame 1 where the rotation from frame 1 to frame 2 is described by a 3-2-1 intrinsic Tait-Bryan rotation sequence.
| euler | euler angle instance |
Definition at line 146 of file Quaternion.hpp.
References matrix::Euler< Type >::phi(), matrix::Euler< Type >::psi(), and matrix::Euler< Type >::theta().
|
inline |
Quaternion from AxisAngle.
| aa | axis-angle vector |
Definition at line 171 of file Quaternion.hpp.
References f(), matrix::Vector< Type, 3 >::norm(), and matrix::Vector< Type, 3 >::unit().
|
inline |
Quaternion from two vectors Generates shortest rotation from source to destination vector.
| dst | destination vector (no need to normalize) |
| src | source vector (no need to normalize) |
| eps | epsilon threshold which decides if a value is considered zero |
Definition at line 197 of file Quaternion.hpp.
References matrix::Matrix< Type, M, 1 >::abs(), matrix::Vector3< Type >::cross(), matrix::Vector< Type, 3 >::dot(), dt, matrix::Vector< Type, 3 >::norm(), and matrix::Vector< Type, 3 >::norm_squared().
|
inline |
Constructor from quaternion values.
Instance is initialized from quaternion values representing coordinate transformation from frame 2 to frame 1. A zero-rotation quaternion is represented by (1,0,0,0).
| a | set quaternion value 0 |
| b | set quaternion value 1 |
| c | set quaternion value 2 |
| d | set quaternion value 3 |
Definition at line 245 of file Quaternion.hpp.
|
inline |
Rotates vector v_1 in frame 1 to vector v_2 in frame 2 using the rotation quaternion q_21 describing the rotation from frame 1 to 2 v_2 = q_21 * v_1 * q_21^-1.
| vec | vector to rotate in frame 1 (typically body frame) |
Definition at line 380 of file Quaternion.hpp.
Referenced by ManualSmoothingXY::_getHeadingToWorldFrame(), FlightTaskManualStabilized::_updateThrustSetpoints(), main(), and MathlibTest::testQuaternionRotate().
|
inline |
Rotates vector v_2 in frame 2 to vector v_1 in frame 1 using the rotation quaternion q_21 describing the rotation from frame 1 to 2 v_1 = q_21^-1 * v_1 * q_21.
| vec | vector to rotate in frame 2 (typically reference frame) |
Definition at line 396 of file Quaternion.hpp.
Referenced by ManualSmoothingXY::_getWorldToHeadingFrame(), and main().
|
inline |
Corresponding body z-axis to an attitude quaternion / last orthogonal unit basis vector.
== last column of the equivalent rotation matrix but calculated more efficiently than a full conversion
Definition at line 496 of file Quaternion.hpp.
Referenced by MulticopterAttitudeControl::control_attitude(), and main().
|
inline |
Computes the derivative of q_21 when rotated with angular velocity expressed in frame 1 v_2 = q_21 * v_1 * q_21^-1 d/dt q_21 = 0.5 * q_21 * omega_2.
| w | angular rate in frame 1 (typically body frame) |
Definition at line 314 of file Quaternion.hpp.
Referenced by MatrixTest::attitudeTests(), and main().
|
inline |
Computes the derivative of q_21 when rotated with angular velocity expressed in frame 2 v_2 = q_21 * v_1 * q_21^-1 d/dt q_21 = 0.5 * omega_1 * q_21.
| w | angular rate in frame 2 (typically reference frame) |
Definition at line 329 of file Quaternion.hpp.
Referenced by main().
|
inline |
Rotation quaternion from vector.
The axis of rotation is given by vector direction and the angle is given by the norm.
| vec | rotation vector |
Definition at line 413 of file Quaternion.hpp.
References matrix::Vector< Type, M >::norm().
Referenced by MatrixTest::attitudeTests(), and main().
|
inline |
Rotation quaternion from axis and angle XXX DEPRECATED, use AxisAngle class.
| axis | axis of rotation |
| theta | scalar describing angle of rotation |
Definition at line 436 of file Quaternion.hpp.
References f().
|
inline |
XXX DEPRECATED, can use assignment or ctor.
Definition at line 513 of file Quaternion.hpp.
References matrix::Quaternion< Type >::Quaternion().
Referenced by main(), MathlibTest::testQuaternionfrom_dcm(), and MathlibTest::testQuaternionfrom_euler().
|
inline |
Imaginary components of quaternion.
Definition at line 483 of file Quaternion.hpp.
Referenced by MulticopterAttitudeControl::control_attitude(), and main().
|
inline |
Invert quaternion.
Definition at line 349 of file Quaternion.hpp.
References matrix::Quaternion< Type >::Quaternion().
Referenced by MatrixTest::attitudeTests(), MulticopterAttitudeControl::control_attitude(), Ekf2::get_vel_body_wind(), matrix::Quaternion< Type >::invert(), main(), and Standard::update_vtol_state().
|
inline |
Invert quaternion in place.
Definition at line 339 of file Quaternion.hpp.
References matrix::Quaternion< Type >::inversed().
Referenced by MatrixTest::attitudeTests(), and main().
|
inline |
Quaternion multiplication operator.
| q | quaternion to multiply with |
Definition at line 261 of file Quaternion.hpp.
|
inline |
Scalar multiplication operator.
| scalar | scalar to multiply with |
Definition at line 289 of file Quaternion.hpp.
|
inline |
Self-multiplication operator.
| other | quaternion to multiply with |
Definition at line 277 of file Quaternion.hpp.
|
inline |
Scalar self-multiplication operator.
| scalar | scalar to multiply with |
Definition at line 300 of file Quaternion.hpp.
|
inline |
Rotate quaternion from rotation vector.
| vec | rotation vector |
Definition at line 365 of file Quaternion.hpp.
Referenced by MatrixTest::attitudeTests(), and main().
|
inline |
Rotation vector from quaternion XXX DEPRECATED, use AxisAngle class.
The axis of rotation is given by vector direction and the angle is given by the norm.
Definition at line 463 of file Quaternion.hpp.
References matrix::wrap_pi().
Referenced by MatrixTest::attitudeTests(), and main().
|
inline |
XXX DEPRECATED, can use assignment or ctor.
Definition at line 520 of file Quaternion.hpp.
Referenced by main().


One on the challenges we were working on required us to create a function that took a string( a sentence ) and remove the word buzz from it. Some sentences contained the word multiple times. I worked through and was able to write the function to remove buzz but was stuck on the final test as the word buzz was written with capital letters. I thought maybe I could convert the text to all lower case but that also failed the test. I started by googling how I could check the word buzz without converting it all to lower case. I looked for a while with no luck. I then called my girlfriend to take to her about it( she knows nothing about coding just needed a vent). While talking to her I realised I could use an if statement and that if the word was changed to lower case was not equal to buzz return the word. I found this process surprisingly funny. I felt like I had done the hard part and now I was stuck on something simple I should of been faster to pick up. What I learn’t from this process was a better understanding of built in methods and functions. I had spent the extra time googling than I otherwise would. Also came across arrow functions and I started to read there.
I’m not sure there is anything particularly elegant about my code at the moment so ill write about when I solved a problem confidently. During the same challenge as above we had to take a string and return it with the first letter of each word changed to a capital. I started the task by writing a list of small steps I needed to achieve and decided that after each step I would use console.log to check if I was on the right path. This was my favourite task as I was able to complete it without getting stuck for to long at each point. It gave me a great deal of confidence as it felt like the hard work was sinking in. What I learnt was to not get to cocky. I came off this task thinking I had cracked it to spend about 3 hours on the following task.
There have been some techniques I have used more than others and I feel that might be because they are more intuitive. I was quick to turn to google and ask my facilitator for help. After spending more time on the katas, I found that console.log was probably the most important tool I had at this stage and when I was moving nicely it was something I was using often.Pseudocode and the rubber ducky technique are also techniques I’m starting to see value in. I think in the next sprint I will start the minesweeper task by writing pseudocode. Reflection and asking my peers for help are the two I have done less on. I felt like I didn’t want to distract my peers from their study but in reality them helping me would probably help them cement their knowledge.
Home


Weather Dashboard
Search for a City:
Search
City
Temperature:
Humidity:
Wind Speed:
Uv Index:
5-Day Forecast:


Home
ISL
ISL Details
Loading ISL
.
.
.
SOURCE DETAILS
Port:
Switch Id:
Name:
DESTINATION DETAILS
Port:
Switch Id:
Switch Name:
ISL DETAILS
Speed:
Latency:
Cost:
Available Bandwidth:
State:
GRAPH
ISL Latency Graph
Source Graph
Destination Graph
Forward
Reverse
Timezone:
UTC
My Timezone
From:
To:
Downsample:
Autoreload(Sec):
Graph:
ISL Latency Graph
Source Graph
Destination Graph
Metric:
×
Confirmation
Are you sure you want to change the cost?


黒の手番です。61 はどう動かしますか？


Clearing all data for this user will remove all vehicles, fuel logs and any other loggable data. You will not be able to recover this data. This does not reset any unit preferences.
Danger zone: Deleting this user will purge all data relating to this user from Clarkson. If you delete yourself, you will not be able to recover the data.


README¶
Library for comparing sequence classifiers¶
Installation¶
Manual installation¶
- Download or clone this repository:
git clone https://github.com/pmiara/Sequence-Classification.git
- Go to downloaded directory:
cd Sequence-Classification
- Install dependencies:
pip3 install -r requirements.txt
Docker¶
- Install Docker and docker-compose on your machine.
- Download or clone this repository:
git clone https://github.com/pmiara/Sequence-Classification.git
- Go to downloaded directory:
cd Sequence-Classification
- Run docker-compose:
docker-compose up
- If you add any new dependency you have to rebuild docker image. To do so type:
docker image rm -f sequences
docker-compose up
Google Colab¶
- Go to: https://colab.research.google.com/github/pmiara/Sequence-Classification/blob/master/usage_example.ipynb
- Click ‘COPY TO DRIVE’.
- Click ‘OPEN IN NEW TAB’.
- Create new cell above and run this code in it:
!git clone https://github.com/pmiara/Sequence-Classification
!pip install -q mlxtend
%cd Sequence-Classification
- Run remaining cells. Don’t run again the cell you’ve just added, because it would cause some errors.
Authors¶
- Jakub Berezowski
- Magda Lipowska
- Piotr Miara
- Grzegorz Szczepaniak
- Maciej Piernik - supervisor
License¶
This project is licensed under the MIT License - see the LICENSE file in the repository’s main directory for details.


Find your Dream Vacation
Bahamas Destination
Carabian Destion
Disney cruise
Dream Destination Finder
Select a animal
select an item
select a activity
Select a live show
What's your favorite color?
Your perfect Dream Vacation location is the Bahamas!
Your perfect Dream Vacation location is the Caribbean
Your perfect Dream Vacation location is the Memediterranean cruise


-
I am originally from a small border town in Arizona called Yuma, and proud of it! I love the desert. I have been married for four years to my wife, Taylor. We are expecting our first child in February.
Education
-
I attended college at Brigham Young University in Provo, Utah. I always planned on being an active duty Army officer, so I chose history as a major because it aligned with my interests and would allow me to quickly begin my Army career.
Job Experience
-
I worked as a Pricing Analyst at Zillow Offers, then moved into an analytical/account management role in Renovations. I also have worked as an light infantry and mechanized infantry platoon leader in the SC and AZ Army National Guard.
Goals
-
I will become a software engineer at Zillow. Eventually, I would like to experience more of what the software engineering world has to offer, such as roles in product management or life at a startup.
My Favorite Books
-
The Way of Kings
-
Starship Troopers
-
The Words of Radiance
-
Oathbringer
-
The War of Art
-
The Alloy of Law
-
Mistborn
-
The Lies of Locke Lamora
-
Salt, Fat, Acid, Heat
-
Dinosaur Training: Lost Secrets of Strength and Development


|
| static IEnumerable< T > | CSVFileToEnumerableObject< T > (string path, string delimiter="auto", bool hasHeaders=true, bool ignoreQuotes=false, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Reads CSV file and returns deserialised object T. Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e: More...
|
| |
| static dynamic | CSVFileToDynamicObject (string path, string delimiter="auto", bool hasHeaders=true, bool ignoreQuotes=false, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Reads CSV file and returns dynamic object Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e: More...
|
| |
| static DataTable | CSVFileToDataTable (string path, string delimiter="auto", bool hasHeaders=true, bool ignoreQuotes=false, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Read CSV File and convert to DataTable object Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e: More...
|
| |
| static void | ToCSVFile< T > (IEnumerable< T > obj, string path, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Write IEnumerable object to CSV file More...
|
| |
| static string | ToCSVString< T > (IEnumerable< T > obj, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Write IEnumerable object to CSV file More...
|
| |
| static void | ToCSVFile< T > (List< T > list, string path, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Write List to CSV file More...
|
| |
| static string | ToCSVString< T > (List< T > list, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Write List to CSV file More...
|
| |
| static void | ToCSVFile (DataTable dt, string path, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Converts DataTable to CSV and write to file More...
|
| |
| static string | ToCSVString (DataTable dt, char delimiter=',', bool hasHeaders=true, bool quoteAllFields=true, CSVTrimOptions trimOptions=CSVTrimOptions.TrimFields) |
| | Converts DataTable object to CSV type string More...
|
| |
| static List< string > | GetCSVHeaderNames (string path, string delimiter="auto") |
| | Returns a list of CSV headers More...
|
| |
| static char | TryDetectDelimiter (string[] lines) |
| | Tries to auto detect CSV delimiter (tends to do a very good job of it). More...
|
| |
Read CSV File and convert to DataTable object Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e:
public class Foo
{
[Index(0)]
public int Id { get; set; }
[Index(1)]
public string Name { get; set; }
}
You can also map by a different header name to your class properties by adding the 'Name' attribute to your properties. I.e:
public class Foo
{
[Name("id")]
public int Id { get; set; }
[Name("name")]
public string Name { get; set; }
}
Other attributes include:
[BooleanTrueValues("yes")]
[BooleanFalseValues("no")]
[Optional]
[Ignored]
More information available at: https://joshclose.github.io/CsvHelper/getting-started
- Parameters
-
| path | File path of CSV file |
| delimiter | (Optional) - Single character seperator, i.e: ";" "," "\t" (tab) or "auto" to try and detect |
| hasHeaders | (Optional) - Does the CSV file have headers or not? |
| ignoreQuotes | (Optional) - If true, quotation marks are treated like any other character |
| trimOptions | (Optional) - Trim inside quotes, trim fields, don't trim |
- Returns
- DataTable result
| static dynamic JBToolkit.CSV.CSVHelper.CSVFileToDynamicObject |
( |
string |
path, |
|
|
string |
delimiter = "auto" , |
|
|
bool |
hasHeaders = true , |
|
|
bool |
ignoreQuotes = false , |
|
|
CSVTrimOptions |
trimOptions = CSVTrimOptions.TrimFields |
|
) |
| |
|
static |
Reads CSV file and returns dynamic object Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e:
public class Foo
{
[Index(0)]
public int Id { get; set; }
[Index(1)]
public string Name { get; set; }
}
You can also map by a different header name to your class properties by adding the 'Name' attribute to your properties. I.e:
public class Foo
{
[Name("id")]
public int Id { get; set; }
[Name("name")]
public string Name { get; set; }
}
Other attributes include:
[BooleanTrueValues("yes")]
[BooleanFalseValues("no")]
[Optional]
[Ignored]
More information available at: https://joshclose.github.io/CsvHelper/getting-started
- Template Parameters
-
| T | Type of object to deserialise to |
- Parameters
-
| path | File path of CSV file |
| delimiter | (Optional) - Single character seperator, i.e: ";" "," "\t" (tab) or "auto" to try and detect |
| hasHeaders | (Optional) - Does the CSV file have headers or not? |
| ignoreQuotes | (Optional) - If true, quotation marks are treated like any other character |
| trimOptions | (Optional) - Trim inside quotes, trim fields, don't trim |
- Returns
- Dynamic result
Reads CSV file and returns deserialised object T. Note, if the CSV file has no header, then be sure to include 'Index' attributes on your class properties. I.e:
public class Foo
{
[Index(0)]
public int Id { get; set; }
[Index(1)]
public string Name { get; set; }
}
You can also map by a different header name to your class properties by adding the 'Name' attribute to your properties. I.e:
public class Foo
{
[Name("id")]
public int Id { get; set; }
[Name("name")]
public string Name { get; set; }
}
Other attributes include:
[BooleanTrueValues("yes")]
[BooleanFalseValues("no")]
[Optional]
[Ignored]
More information available at: https://joshclose.github.io/CsvHelper/getting-started
- Template Parameters
-
| T | Type of object to deserialise to |
- Parameters
-
| path | File path of CSV file |
| delimiter | (Optional) - Single character seperator, i.e: ";" "," "\t" (tab) or "auto" to try and detect |
| hasHeaders | (Optional) - Does the CSV file have headers or not? |
| ignoreQuotes | (Optional) - If true, quotation marks are treated like any other character |
| trimOptions | (Optional) - Trim inside quotes, trim fields, don't trim |
- Returns
- IEnumerable result


Who I am
I'm a reflective girl who is passionate about prayer, meditation and having a quiet time with God. Long nature walks and safari drives are my all time favourite past time. I love new challenges that will improve my scope in life. My quest for improvement is my greatest drive.


Reports any implementations of Iterator.hasNext()
which call next() on themselves. While this is a common
mistake, such calls are almost certainly in error, as hasNext()
should not modify the iterators state, while next() should.
Powered by InspectionGadgets


We will now consider how Game Theory can be used to study evolutionary processes. The main difference is that we now consider not two player games but game with an infinite population. The strategies will make up a dynamic population that changes over time.
Consider a simple model of population growth: let $x(t)$ denote the size of the population at time $t$ and let as assume that the rate of growth is $a$ per population size:
$$\frac{dx}{dt}=ax$$Note that from here on we will refer to this rate as a fitness.
The solution of this differential equation is:
$$x(t)=x_0e^{at}\text{ where }x_0=x(0)$$import sympy as sym
sym.init_printing()
x = sym.Function('x')
t, a = sym.symbols('t, a')
sym.dsolve(sym.Derivative(x(t), t) - a * x(t), x(t))
(This is exponential growth.)
We can also use scipy to solve this differential equation numerically (relevant for more complex dynamics):
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.integrate import odeint
t = np.linspace(0, 10, 100) # Obtain 100 time points
def dx(x, t, a):
"""Define the derivate of x"""
return a * x
If $a=10>0$:
a = 10
xs = odeint(func=dx, y0=1, t=t, args=(a,))
plt.plot(xs);
If $a=-10<0$:
a = -10
xs = odeint(func=dx, y0=1, t=t, args=(a,))
plt.plot(xs);
Reproduction alone is not enough to study evolutionary processes. Let us consider a population made up of two types of individuals:
Let us assume the same expressions for the as before:
$$\frac{dx}{dt}=ax\qquad\frac{dy}{dt}=by$$both these population will increase or decrease independantly so there's not much of interest there but if we introduce the following:
$$ \rho(t) = \frac{x(t)}{y(t)} $$then $\lim_{t\to\infty}\rho(t)$ indicates which type takes over the population over time.
We have:
$$ \frac{d\rho}{dt} = \frac{\frac{dx}{dt}y - \frac{dy}{dt}x}{y ^ 2} = \frac{xy(a - b)}{y^2} $$which gives:
$$ \frac{d\rho}{dt} = (a-b)\rho $$which has solution (this is just the same differential equation as the previous section):
$$ \rho(t) = \rho_0e^{(a-b)t}\text{ where }\rho_0=\rho(0) $$note that even if both population grow, but one grows faster than the other (eg $a > b$) then the overall population will grow but one will take over:
def drho(rho, t, a, b):
"""Define the derivate of x"""
return (a - b) * rho
a, b = 10, 5
rhos = odeint(func=drho, y0=1, t=t, args=(a, b))
plt.plot(rhos);
Let us consider the case of $x(t) + y(t)=1$: so the case of a constant population size (choosing a constant of 1 is just a question of scale). For this to be possible, the rates need to reduced:
$$\frac{dx}{dt}=x(a - \phi)\qquad\frac{dy}{dt}=y(b - \phi)$$because $x(t) + y(t)=1$:
$$\frac{dx}{dt} + \frac{dy}{dt} = 0$$also:
$$\frac{dx}{dt} + \frac{dy}{dt} = ax + by - \phi(x + y)= ax + by - \phi$$thus $\phi=ax+by$ (this corresponds to the average of the fitness).
Substituting $y=1-x$ we have:
$$\frac{dx}{dt}=x(a - ax-b(1-x))=x(a(1 - x)-b(1-x))$$giving:
$$\frac{dx}{dt}=x(a-b)(1-x)$$We do not need to solve this differential equation. There are two stable points:
Also:
def dxy(xy, t, a, b):
"""
Define the derivate of x and y.
It takes `xy` as a vector
"""
x, y = xy
phi = a * x + b * y
return x * (a - phi), y * (b - phi)
a, b = 10, 5
xys = odeint(func=dxy, y0=[.5, .5], t=t, args=(a, b))
plt.plot(xys);
a, b = 10, 5
xys = odeint(func=dxy, y0=[1, 0], t=t, args=(a, b))
plt.plot(xys);
a, b = 10, 5
xys = odeint(func=dxy, y0=[0, 1], t=t, args=(a, b))
plt.plot(xys);
a, b = 5, 5
xys = odeint(func=dxy, y0=[.5, .5], t=t, args=(a, b))
plt.plot(xys);
Source code: @drvinceknight Powered by: Python Mathjax Github pages Skeleton css


This vignette demonstrates predicting compound mechanism-of-action using morphological profiling data. The data is “cleaned up” using the similarity network fusion algorithm (SNF). This vignette bases on the vignette predict_moa
. See the vignette single_cell_analysis
for details about this dataset.
library(dplyr)
library(magrittr)
library(ggplot2)
library(stringr)
library(cytominergallery)
library(SNFtool)
Per-well profiles computed in single_cell_analysis
are loaded, as well as metadata associated with these profiles (obtained from BBBC021). This is the same data as used in the vignette predict_moa
.
profiles <-
readr::read_csv(system.file("extdata", "ljosa_jbiomolscreen_2013_per_well_mean.csv",
package = "cytominergallery"))
moa <-
readr::read_csv(system.file("extdata", "BBBC021_v1_moa.csv",
package = "cytominergallery")) %>%
rename(Image_Metadata_Compound = compound,
Image_Metadata_Concentration = concentration,
Image_Metadata_MoA = moa
)
metadata <-
readr::read_csv(system.file("extdata", "BBBC021_v1_image.csv",
package = "cytominergallery")) %>%
rename(Image_Metadata_Plate = Image_Metadata_Plate_DAPI,
Image_Metadata_Well = Image_Metadata_Well_DAPI
) %>%
select(matches("^Image_Metadata")) %>%
inner_join(moa) %>%
distinct()
profiles %<>%
inner_join(metadata)
variables <-
colnames(profiles) %>%
str_subset("^Nuclei_|^Cells_|^Cytoplasm_")
Next, lets filter the set of features based on various measures of quality
Remove features that have poor correlation across replicates. To do so, lets first compute the correlations.
doParallel::registerDoParallel(cores = 4)
feature_replicate_correlations <-
profiles %>%
cytominer::variable_importance(
variables = variables,
strata = c("Image_Metadata_Compound", "Image_Metadata_Concentration"),
replicates = 3,
cores = 2)
Similar to the predict_moa
vignette, we select a threshold and remove features that have a replicate correlation lower than that threshold.
profiles %<>%
select_(.dots = setdiff(x = colnames(profiles),
y = feature_replicate_correlations %>%
filter(median < 0.5) %>%
magrittr::extract2("variable"))
)
variables <-
colnames(profiles) %>%
str_subset("^Nuclei_|^Cells_|^Cytoplasm_")
Filter based on correlation between features, similar to predict_moa
.
profiles <-
cytominer::variable_select(
population = profiles,
variables = variables,
sample = profiles,
operation = "correlation_threshold",
cutoff = 0.95) %>%
collect()
## INFO [2018-02-14 17:00:21] excluded:
## INFO [2018-02-14 17:00:21] Cells_AreaShape_MaximumRadius
## INFO [2018-02-14 17:00:21] Cells_AreaShape_MeanRadius
## INFO [2018-02-14 17:00:21] Cells_AreaShape_MedianRadius
## INFO [2018-02-14 17:00:21] Cells_AreaShape_MinFeretDiameter
## INFO [2018-02-14 17:00:22] Cells_AreaShape_MinorAxisLength
## INFO [2018-02-14 17:00:22] Cells_Intensity_MaxIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_MaxIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MeanIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MeanIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_MeanIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MedianIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_MedianIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MinIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_StdIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_StdIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_StdIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_StdIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_UpperQuartileIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_UpperQuartileIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Neighbors_NumberOfNeighbors_3
## INFO [2018-02-14 17:00:22] Cells_Texture_SumVariance_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cells_Texture_Variance_CorrActin_10_0
## INFO [2018-02-14 17:00:22] Cells_Texture_Variance_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cells_Texture_Variance_CorrTub_10_0
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_Area
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MajorAxisLength
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MaxFeretDiameter
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MaximumRadius
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MeanRadius
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MedianRadius
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MinFeretDiameter
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_MinorAxisLength
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_Solidity
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_Zernike_0_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_IntegratedIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_IntegratedIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_IntegratedIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MADIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MADIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MassDisplacement_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MassDisplacement_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MaxIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MaxIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MaxIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MeanIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MeanIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MeanIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MeanIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MedianIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MedianIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MinIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MinIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MinIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MinIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_StdIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_StdIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_StdIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_StdIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_UpperQuartileIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_UpperQuartileIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_DifferenceEntropy_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_DifferenceVariance_CorrTub_10_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_DifferenceVariance_CorrTub_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_InfoMeas2_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_SumAverage_CorrTub_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_Variance_CorrTub_10_0
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MajorAxisLength
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MaxFeretDiameter
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MeanRadius
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MinorAxisLength
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Perimeter
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_3_3
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_4_4
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_5_3
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_6_6
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_7_3
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_7_5
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_7_7
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_9_7
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_9_9
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_IntegratedIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_IntegratedIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_IntegratedIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_IntegratedIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_LowerQuartileIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_LowerQuartileIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MADIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MADIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensityEdge_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MeanIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MedianIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MedianIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MedianIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MinIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MinIntensityEdge_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MinIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MinIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MinIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_StdIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_StdIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_StdIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_StdIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_UpperQuartileIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_UpperQuartileIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_UpperQuartileIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Nuclei_Neighbors_PercentTouching_10
## INFO [2018-02-14 17:00:22] Nuclei_Texture_InfoMeas2_CorrDAPI_3_0
## INFO [2018-02-14 17:00:22] Nuclei_Texture_Variance_CorrDAPI_3_0
## INFO [2018-02-14 17:00:22] Cells_AreaShape_Area
## INFO [2018-02-14 17:00:22] Cells_AreaShape_MajorAxisLength
## INFO [2018-02-14 17:00:22] Cells_AreaShape_MaxFeretDiameter
## INFO [2018-02-14 17:00:22] Cells_Intensity_LowerQuartileIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_MADIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MaxIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MinIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MADIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Neighbors_AngleBetweenNeighbors_10
## INFO [2018-02-14 17:00:22] Cells_Neighbors_FirstClosestDistance_10
## INFO [2018-02-14 17:00:22] Cells_Neighbors_NumberOfNeighbors_10
## INFO [2018-02-14 17:00:22] Cells_Neighbors_SecondClosestDistance_10
## INFO [2018-02-14 17:00:22] Cells_Texture_Contrast_CorrTub_10_0
## INFO [2018-02-14 17:00:22] Cells_Texture_InfoMeas1_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cells_Texture_SumVariance_CorrTub_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_AreaShape_Extent
## INFO [2018-02-14 17:00:22] Cells_AreaShape_Perimeter
## INFO [2018-02-14 17:00:22] Cells_Intensity_IntegratedIntensity_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_MeanIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Intensity_LowerQuartileIntensity_CorrTub
## INFO [2018-02-14 17:00:22] Cytoplasm_Intensity_MaxIntensityEdge_CorrTub
## INFO [2018-02-14 17:00:22] Cells_Intensity_MaxIntensityEdge_CorrActin
## INFO [2018-02-14 17:00:22] Cells_Texture_AngularSecondMoment_CorrTub_3_0
## INFO [2018-02-14 17:00:22] Cells_Texture_Contrast_CorrActin_10_0
## INFO [2018-02-14 17:00:22] Cells_Texture_DifferenceVariance_CorrActin_10_0
## INFO [2018-02-14 17:00:22] Cells_Texture_DifferenceEntropy_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Cytoplasm_Texture_AngularSecondMoment_CorrTub_10_0
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MaximumRadius
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_MedianRadius
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_3_1
## INFO [2018-02-14 17:00:22] Nuclei_AreaShape_Zernike_5_5
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MADIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensityEdge_CorrDAPI
## INFO [2018-02-14 17:00:22] Nuclei_Intensity_MaxIntensity_CorrDAPI
## INFO [2018-02-14 17:00:22] Cells_Neighbors_AngleBetweenNeighbors_3
## INFO [2018-02-14 17:00:22] Nuclei_Neighbors_AngleBetweenNeighbors_10
## INFO [2018-02-14 17:00:22] Cells_Neighbors_FirstClosestDistance_3
## INFO [2018-02-14 17:00:22] Nuclei_Neighbors_FirstClosestDistance_10
## INFO [2018-02-14 17:00:22] Cells_Neighbors_SecondClosestDistance_3
## INFO [2018-02-14 17:00:22] Nuclei_Neighbors_SecondClosestDistance_10
## INFO [2018-02-14 17:00:22] Nuclei_Texture_AngularSecondMoment_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Nuclei_Texture_InfoMeas1_CorrActin_10_0
## INFO [2018-02-14 17:00:22] Nuclei_Texture_InfoMeas1_CorrActin_3_0
## INFO [2018-02-14 17:00:22] Nuclei_Texture_InfoMeas1_CorrTub_3_0
There may be plate-to-plate variations, which can be compensated for to some extent by normalizing the features with respect to the DMSO wells per plate.
profiles <-
cytominer::normalize(
population = profiles,
variables = variables,
strata = c("Image_Metadata_Plate"),
sample = profiles %>% filter(Image_Metadata_Compound == "DMSO")
)
profiles <-
cytominer::variable_select(
population = profiles,
variables = variables,
operation = "drop_na_columns"
)
variables <-
colnames(profiles) %>%
str_subset("^Nuclei_|^Cells_|^Cytoplasm_")
We have selected features and normalized the data. We can now compute treatment profiles by averaging across replicates.
profiles <-
cytominer::aggregate(
population = profiles,
variables = variables,
strata = c("Image_Metadata_Compound",
"Image_Metadata_Concentration",
"Image_Metadata_MoA"),
operation = "mean"
)
variables <-
colnames(profiles) %>%
str_subset("^Nuclei_|^Cells_|^Cytoplasm_")
Let’s visualize this data using t-SNE.
profiles %<>%
filter(Image_Metadata_Compound != "DMSO")
correlation <-
profiles %>%
select(one_of(variables)) %>%
as.matrix() %>%
t() %>%
cor()
mechanism <- as.character(profiles$Image_Metadata_MoA)
plot_tsne <- function(correlation, mechanism){
set.seed(42)
df <-
tibble::as_data_frame(
tsne::tsne(as.dist(1 - correlation))
) %>%
mutate(mechanism = mechanism)
p <-
ggplot(df, aes(V1, V2, color = mechanism)) +
geom_point() +
ggtitle("t-SNE visualization of compound profiles clean using SNF")
print(p)
}
plot_tsne(correlation = correlation, mechanism = mechanism)
As we saw in predict_moa
, the data clusters into mechanisms quite nicely. Let’s quantify this by evaluating how well we can predict mechanism-of-action by simply assigning a treatment the mechanism of its nearest neighbor. NOTE: A common mistake when analyzing this dataset is to not exclude other concentrations of the same compound when looking up the nearest neighbor. That is cheating! mask
in the code below addresses this.
predict_moa <- function(correlation, compound, mechanism){
mask <- as.integer(outer(compound, compound, FUN = "!="))
mask[mask == 0] <- -Inf
correlation_masked <- correlation * mask
return(sapply(1:nrow(correlation_masked),
function(i) mechanism[order(correlation_masked[i,],
decreasing = TRUE)[1]])
)
}
compound <- profiles$Image_Metadata_Compound
prediction <- predict_moa(correlation, compound, mechanism)
confusion_matrix <- caret::confusionMatrix(prediction, mechanism)
What’s the classification accuracy?
evaluate_prediction <- function(confusion_matrix ){
tibble::frame_data(
~metric, ~value,
"Accuracy", sprintf("%.2f", confusion_matrix$overall["Accuracy"]),
"95% CI", sprintf("(%.2f, %.2f)", confusion_matrix$overall[["AccuracyLower"]],
confusion_matrix$overall[["AccuracyUpper"]])
)
}
evaluate_prediction(confusion_matrix) %>%
knitr::kable(digits = 2)
| metric | value |
|---|---|
| Accuracy | 0.82 |
| 95% CI | (0.73, 0.89) |
What does the whole confusion matrix look like?
| Actin disruptors | Aurora kinase inhibitors | Cholesterol-lowering | DNA damage | DNA replication | Eg5 inhibitors | Epithelial | Kinase inhibitors | Microtubule destabilizers | Microtubule stabilizers | Protein degradation | Protein synthesis | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Actin disruptors | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Aurora kinase inhibitors | 0 | 12 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Cholesterol-lowering | 0 | 0 | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| DNA damage | 0 | 0 | 0 | 8 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| DNA replication | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Eg5 inhibitors | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 0 | 2 | 0 | 0 | 0 |
| Epithelial | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 |
| Kinase inhibitors | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | 0 |
| Microtubule destabilizers | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 0 | 12 | 0 | 0 | 0 |
| Microtubule stabilizers | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 1 | 0 |
| Protein degradation | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 5 | 0 |
| Protein synthesis | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
Next we test the similarity network fusion (SNF) algorithm to clean the data.
distance <- 1-correlation
affinity <- affinityMatrix(distance, K = 20, sigma = 0.5)
snf_distance <- SNF(list(affinity, affinity), K = 20, t = 20 )
Do we get better results using SNF?
prediction <- predict_moa(snf_distance, compound, mechanism)
confusion_matrix <- caret::confusionMatrix(prediction, mechanism)
evaluate_prediction(confusion_matrix) %>%
knitr::kable(digits = 2)
| metric | value |
|---|---|
| Accuracy | 0.84 |
| 95% CI | (0.76, 0.91) |
Visualize the results using t-SNE.
Now let’s split the data by the feature categories, compute a similarity matrix per category, then combine these matrices using SNF.
feature_label = list("_AreaShape_", "_Intensity_","_Texture_","_Neighbors_")
feature_names_list <- lapply(feature_label, function(x) (
profiles %>%
select(matches(x)) %>%
colnames())
)
correlation_matrices <- lapply(feature_names_list, function(x) (
profiles %>%
select(one_of(x)) %>%
as.matrix() %>%
t() %>%
cor())
)
affinity_list <- lapply(correlation_matrices, function(x) (
affinityMatrix(1 - x, K = 20, sigma = 0.5 ))
)
snf_distance <- SNF(affinity_list, K = 20, t = 20 )
How is the performance?
prediction <- predict_moa(snf_distance, compound, mechanism)
confusion_matrix <- caret::confusionMatrix(prediction, mechanism)
evaluate_prediction(confusion_matrix) %>%
knitr::kable(digits = 2)
| metric | value |
|---|---|
| Accuracy | 0.77 |
| 95% CI | (0.67, 0.84) |
Again plot using t-SNE
Now let’s split the data by the cell constituents, and as before, compute a similarity matrix per constituent, then combine these matrices using SNF.
#profiles %<>%
# filter(Image_Metadata_Compound != "DMSO")
constituents = list("Cells", "Nuclei","Cytoplasm")
feature_list <- lapply(constituents, function(x)
(profiles %>%
select(matches(x)) %>%
colnames())
)
correlation_matrices <- lapply(feature_list, function(x) (
profiles %>%
select(one_of(x)) %>%
as.matrix() %>%
t() %>%
cor())
)
affinity_list <- lapply(correlation_matrices, function(x) (
affinityMatrix(1 - x, K = 20, sigma = 0.5 )
))
snf_distance <- SNF(affinity_list, K = 20, t = 20 )
Do we get better results?
prediction <- predict_moa(snf_distance, compound, mechanism)
confusion_matrix <- caret::confusionMatrix(prediction, mechanism)
evaluate_prediction(confusion_matrix) %>%
knitr::kable(digits = 2)
| metric | value |
|---|---|
| Accuracy | 0.83 |
| 95% CI | (0.74, 0.89) |


Before Change
feature_ranges = self.trained_pipeline.named_steps["final_model"].feature_ranges
print("feature_ranges")
print(feature_ranges)
for col_idx, feature_name in enumerate(trained_feature_names):
print(feature_name + ": " + str(trained_coefficients[col_idx]))
After Change
summary_tuple = (feature_name, trained_coefficients[col_idx], potential_impact)
feature_summary.append(summary_tuple)
sorted_feature_summary = sorted(feature_summary, key=lambda x: x[2])
for summary in sorted_feature_summary:
print(summary[0] + ": " + str(summary[1]))
print("The potential impact of this feature is: " + str(summary[2]))
else:
ppl.fit(X, y)
self.trained_pipeline = ppl


黒の手番です。64 はどう動かしますか？


This is an ideal make-ahead brunch recipe; the luscious ratatouille tastes even better when made the
day before.
3/4 cup extra-virgin olive oil, plus more for drizzling
3 medium tomatoes, seeded and cut into 1/2-inch dice
5 garlic cloves
1 1/4 teaspoons crushed red pepper
Kosher salt
One 12-ounce eggplant, seeds cut out and flesh cut into 1/2-inch dice (2 cups)
2 small zucchini, cut into 1/2-inch dice (2 cups)
2 large red onions, cut into 1/2-inch dice
1 red bell pepper, cut into 1/2-inch dice
1 bay leaf
1 cup chopped basil, plus more for garnish
Freshly ground black pepper
6 large eggs
Six 1/2-inch-thick slices of sourdough bread, toasted
Directions
Step 1
In a large skillet, heat 2 tablespoons of the olive oil. Add the tomatoes, 1 garlic clove and 1/4
teaspoon of the crushed red pepper and season with salt. Cook the tomatoes over moderate heat, stirring
occasionally, until just softened, about 5 minutes. Scrape the tomatoes into a medium saucepan and
discard the garlic clove. Wipe out the skillet. Repeat with the eggplant, zucchini, onions and red bell
pepper, cooking each vegetable separately in 2 tablespoons of oil with 1 garlic clove, 1/4 teaspoon of
crushed red pepper and a generous pinch of salt until just tender and lightly browned, about 7 minutes
per vegetable. Add the cooked vegetables to the tomatoes in the saucepan.
Step 2
Add the bay leaf, 1/2 cup of the basil and 1/3 cup of water to the saucepan with the vegetables. Cover
and cook over moderately low heat, stirring occasionally, until the vegetables are very tender, about 20
minutes. Discard the bay leaf and stir in the remaining 1/2 cup of basil. Season the ratatouille with
salt and pepper and let cool slightly.
Step 3
Meanwhile, in a large nonstick skillet, heat the remaining 2 tablespoons of olive oil over moderate
heat. Crack 3 of the eggs into the skillet and fry until the whites are firm and the yolks are runny, 3
to 5 minutes. Transfer the eggs to a plate, season with salt and pepper and keep warm. Repeat with the
remaining 3 eggs.
Step 4
To serve, spoon the ratatouille onto the toasts and top with the eggs. Drizzle with olive oil and
chopped basil and serve.


--- title: "Event page: The LAST ONE" caption: "/img/caption-tlo.png" externalLink: "http://www.osmoz2009.com/TLO/" date: 2010-03-19 ---
This page was built for a special occasion: the last party organised by the student office I was part of, THE LAST ONE.
The main goal of this page was to promote the party both inside and outside the campus. It had to be a big party right? :)
I started with the PSD of the official flyer, and had to imagine how to adapt it to the web medium.
Another interesting part of this work was the implementation of an online system
to book the tickets for the party, secured via Paypal. (closed by now)


Seasonal lighting celebration downtown starting this weekend
Shine on Madison kicks off with night market
by Maija InveissMADISON, Wis. - The holiday season is kicking off Saturday in Downtown Madison.
According to a release, the Central Business Improvement District's seasonal celebration "Shine On Madison" starts Nov. 16 with a seasonal lighting celebration, window display competition and Winter Madison Night Market.
This year there are 10 new community light displays and 13 decorated areas. They also have a tour of 10 community planters that have been "adopted" by local nonprofit organizations including Goodman Community Center, Grace Food Pantry, Madison Reading Project and The Beacon.
All displays will be turned on Saturday at 6:08 p.m., a nod to the 608 area code, and will stay up through Jan. 6, 2020.
More than 40 vendors will be showcasing their products at the Winter Madison Night Market on the 100 block of State Street Nov. 16 from 4-8 p.m.
Businesses are also taking part in a Window Display Competition. People can pick up and drop off a ballot at the Downtown Visitors Center or at participating businesses. There will also be digital voting starting Nov. 16.
During the six weeks of "Shine On Madison," there will be numerous events and holiday festivities throughout downtown.


Week 4: Ruby - Arrays and Hashes
November 13, 2015
This week we learned about arrays and hashes in Ruby, and got a sense of some examples where we would use both of these concepts in our programs.
Arrays are collections of elements enclosed by brackets and separated by commas. The elements can be numbers, strings, integers, etc. Elements of an array are indexed at zero, and if we want to access a particular element of an array, we can write array[position]. In the example below, we could enter the following to obtain the first element of the array (1):
my_numbers = [1,2,3,4,5] puts my_numbers[0]
Hashes are a collection of pairs, called keys and values. Each key maps to one value, and the pairs in a hash are not indexed, which is different than an array. For example, the array below maps each month of the year to its numerical value. If we want to know what month March is, we type the following:
months = { 'January' => 1, 'February' => 2, 'March' => 3, 'April' => 4, 'May' => 5, 'June' => 6, 'July' => 7, 'August' => 8, 'September' => 9, 'October' => 10, 'November' => 11, 'December' => 12 } months['March']


Preconditions:
- An Amazon AWS account
- A prepared AMI image
- A prepared security group
Preparations:
Boot an EC2 instance with a clean Ubuntu image. Tiny will probably suffice, however if you are still using the free tier, you can also use the micro instances and take advantage of the free hours.
1) Configure the static texts and consent form
Modify the static texts in landing/webpage/static/{intro,consent,howTo}.php and place a pdf of the consent form in landing/webpage/static/ConsentForm.pdf
2) Prepare a token server
The landing server will verify tokens for each participant and invalidate them after usage.
The protocol for this procedure is simple:
- A token always consists of 2 parts, each being 12 letter long with only alpha-numeric values
- A URL is called to verify a token:
/gettoken/<string:token>/<string:token2>
. The return value is either "Valid", "Expired" or "Invalid"
- A URL is called to invalidate a token after usage:
/settoken/<string:token>/<string:token2>
A token server is not part of Developer Observatory. UIDs and tokens are expected to be 12 letter alpha numeric lowercase strings. You can generate such a token for example with
random = str(uuid.uuid4()).replace('-', '')[0:12]
. If you do not want to have a token management, then assign the UID and token randomly when a participant starts and create a URL that always returns
Valid
.
3) Modify configuration
Most settings can be found in setupLandingScript.sh
The relevant settings are:
- finalSurveyURL - url to the exit survey
- dailyMaxInstances - The amount of instances that can be started by a single IP.
- maxInstances - The amount of participants that may start the study - Signing the consent form counts as starting
- recaptchaSiteKey+recaptchaSecret - Api keys for reCAPTCHA - Register API keys at https://www.google.com/recaptcha/admin
- awsAccessKey+awsSecretKey - Access tokens for Amazon
- awsRegion - Region to start the instances in
- awsImageId + awsInstanceType + awsSecurityGroupID - Settings for the task instance
- poolSize - The amount of instances+1 to hold in the pool. Note that this will start instances, but not shut them down.
- tokenGetUrl+tokenSetUrl - Token URLs to verify and invalidate tokens of participants.
4) Run the setup script:
The next step is to run the setup script, it will install all necessary tools, dependencies and configure the services.
Execute: sudo ./setupLandingServer.sh
5) Enable cronjobs
The landing server is now ready, you may test it by invoking
php /var/www/tools/checkServerPool.php
once. You should now have a single instance running in EC2 called "StudyPool".
Go to the landing URL and use
?token=1234567890ab&token2=ba0987654321
as parameter to test the remaining part.
The following lines can be added to the crontab.
*/5 * * * * nohup php /var/www/tools/checkServerPool.php >> /home/ubuntu/cronServer.log 2>&1 & echo $!
2,17,32,47 * * * * nohup php /var/www/tools/resetCounter.php >> /home/ubuntu/cronServer.log 2>&1 & echo $!
5,25,45 * * * * nohup php /var/www/tools/killUnusedInstances.php >> /home/ubuntu/cronKillInstance.log 2>&1 & echo $!
6) Weighting of conditions:
If you notice that certain conditions have a higher dropout ratio than others, you might want to assign more participants to those conditions.
The /var/www/html/howTo.php file contains code to assign more participants to certain code. Uncomment line 100-120, 141, 169 and switch the condition numbers accordingly. Line 122-129, 140, 168 have to be removed then.

Results can be found in the postgres database "notebook" and the tables:
"createdInstances", "jupyter" and "copy_pasted_code".


• What are the benefits of version control?
Version Control allows you to keep track of changes in your work. This way, you can always go back to previous saved versions of document, file or project. If you make errors or are simply curious, you can "go back in time" to view a snapshot of your work or continue from a different point.
• How does git help you keep track of changes?
Once you make changes to a file or piece of code, you can stage the changes to be saved using git add
• Why use GitHub to store your code?
Once you push your committed changes to a GitHub repository, they are saved on the internet remotely. Additionally, using GitHub your collaborators can see and edit your work without overwriting or potentially ruining it. Just like locally when you make branches using git, your collaborators can make branches from your work and eventually merge all these changes back to one master copy.


Hermit Santiago:
To properly use the powers of the gods, you must first understand their nature. That learning process can be quite intense. Many have tried and failed... What is your decision? Will you accept my teachings?
Say you will take the Trial of the Pilgrim


Navigator list is derived from AtomListBox and it adds UI Navigation similar to what is found in common mobile application. This control simplifies Master Detail View. When we select an item or add new item, detail view is slided in. And by clicking on back button, list will appear again.
Navigator list contains Data Pager as well.
List view is outlined as shown in following image. This is default view, navigator list starts with following view. You can customize template as per your requirements.
When we click on an item, detail view opens and it is outlined as follow.


Please excuse the incredible ugly code, declaring global, etc., with constant API issues, this seemed like enough time for this exercie...


We get a 3rd cat (what's one more when a cute gray tabby needs a home, eh?)
Matt pops the Big Question! (Yana says "YES").
Our second international trip - to Costa Rica. Yana got to pet a sloth (major life milestone).
Move into a rental house.
We move in together into an apartment that was way too small for our computers, workout stuff, and two cats.
Our first trip out of the country together, to Mexico. We were both very worried we'd hate each other by the end of it, but instead we realized we are the best travel buddies!
The official first date! We went to see the movie Thor.
First time we met. Yana messaged Matt on OkCupid. That's not the actual start of the story, though, as it was not meant-to-be for a little while...


1 Introduction
Command Line Interface (CLI) definition language is a domain-specific language (DSL) for defining command line interfaces of C++ programs. CLI definitions are automatically translated to C++ classes using the CLI compiler. These classes implement parsing of the command line arguments and provide a convenient and type-safe interface for accessing the extracted data.
Beyond this guide, you may also find the following sources of information useful:
- CLI Compiler Command Line Manual
- The
INSTALL
file in the CLI distribution provides build instructions for various platforms. - The
examples/
directory in the CLI distribution contains a collection of examples and a README file with an overview of each example. - The cli-users mailing list is the place to ask technical questions about the CLI language and compiler. Furthermore, the cli-users mailing list archives may already have answers to some of your questions.
2 Hello World Example
In this chapter we will examine how to define a very simple command
line interface in CLI, translate this interface to C++, and use the
result in an application. The code presented in this chapter is based
on the hello
example which can be found in the
examples/hello/
directory of the CLI distribution.
2.1 Defining Command Line Interface
Our hello
application is going to print a greeting
line for each name supplied on the command line. It will also
support two command line options, --greeting
and --exclamations
, that can be used to
customize the greeting line. The --greeting
option allows us to specify the greeting phrase instead of the
default "Hello"
. The --exclamations
option is used to specify how many exclamation marks should
be printed at the end of each greeting. We will also support
the --help
option which triggers printing of the
usage information.
We can now write a description of the above command line interface
in the CLI language and save it into hello.cli
:
include <string>; class options { bool --help; std::string --greeting = "Hello"; unsigned int --exclamations = 1; };
While some details in the above code fragment might not be completely
clear (the CLI language is covered in greater detail in the next
chapter), it should be easy to connect declarations in
hello.cli
to the command line interface described in
the preceding paragraphs. The next step is to translate this
interface specification to C++.
2.2 Translating CLI Definitions to C++
Now we are ready to translate hello.cli
to C++.
To do this we invoke the CLI compiler from a terminal (UNIX) or
a command prompt (Windows):
$ cli hello.cli
This invocation of the CLI compiler produces three C++ files:
hello.hxx
hello.ixx
, and
hello.cxx
. You can change the file name extensions
for these files with the compiler command line options. See the
CLI
Compiler Command Line Manual for more information.
The following code fragment is taken from hello.hxx
; it
should give you an idea about what gets generated:
#include <string> class options { public: options (int argc, char** argv); options (int argc, char** argv, int& end); // Option accessors. // public: bool help () const; const std::string& greeting () const; unsigned int exclamations () const; private: .. };
The options
C++ class corresponds to the options
CLI class. For each option in this CLI class an accessor function is
generated inside the C++ class. The options
C++ class also
defines a number of overloaded constructs that we can use to parse the
argc/argv
array. Let's now see how we can use this generated
class to implement option parsing in our hello
application.
2.3 Implementing Application Logic
At this point we have everything we need to implement our application:
#include <iostream> #include "hello.hxx" using namespace std; void usage (ostream& os) { os << "usage: driver [options] <names>" << endl << "options:" << endl; options::print_usage (os); } int main (int argc, char* argv[]) { try { int end; // End of options. options o (argc, argv, end); if (o.help ()) { usage (cout); return 0; } if (end == argc) { cerr << "no names provided" << endl; usage (cerr); return 1; } // Print the greetings. // for (int i = end; i < argc; i++) { cout << o.greeting () << ", " << argv[i]; for (unsigned int j = 0; j < o.exclamations (); j++) cout << '!'; cout << endl; } } catch (const cli::exception& e) { cerr << e << endl; usage (cerr); return 1; } }
At the beginning of our application we create the options
object which parses the command line. The end
variable
contains the index of the first non-option argument. We then access
the option values as needed during the application execution. We also
catch and print cli::exception
in case something goes
wrong, for example, an unknown option is specified or an option value
is invalid.
2.4 Compiling and Running
After saving our application from the previous section in
driver.cxx
, we are ready to build and run our program.
On UNIX this can be done with the following commands:
$ c++ -o driver driver.cxx hello.cxx $ ./driver world Hello, world! $ ./driver --greeting Hi --exclamations 3 John Jane Hi, John!!! Hi, Jane!!!
We can also test the error handling:
$ ./driver -n 3 Jane unknown option '-n' usage: driver [options] <names> options: --help --greeting <arg> --exclamations <arg> $ ./driver --exclamations abc Jane invalid value 'abc' for option '--exclamations' usage: driver [options] <names> options: --help --greeting <arg> --exclamations <arg>
2.5 Adding Documentation
As we have seen in the previous sections, the options
C++ class provides the print_usage()
function which we
can use to display the application usage information. Right now this
information is very basic and does not include any description of
the purpose of each option:
$ ./driver --help usage: driver [options] <names> options: --help --greeting <arg> --exclamations <arg>
To make the usage information more descriptive we can document each option in the command line interface definition. This information can also be used to automatically generate program documentation in various formats, such as HTML and man page. For example:
include <string>; class options { bool --help {"Print usage information and exit."}; std::string --greeting = "Hello" { "<text>", "Use <text> as a greeting phrase instead of the default \"Hello\"." }; unsigned int --exclamations = 1 { "<num>", "Print <num> exclamation marks instead of 1 by default." }; };
If we now save this updated command line interface to
hello.cli
and recompile our application, the usage
information printed by the program will look like this:
usage: driver [options] <names> options: --help Print usage information and exit. --greeting <text> Use <text> as a greeting phrase instead of the default "Hello". --exclamations <num> Print <num> exclamation marks instead of 1 by default.
We can also generate the program documentation in the HTML
(--generate-html
CLI option) and man page
(--generate-man
CLI option) formats. For example:
$ cli --generate-html hello.cli
The resulting hello.html
file contains the following
documentation:
This HTML fragment can be combined with custom prologue and epilogue
to create a complete program documentation
(--html-prologue/--html-epilogue
options for the HTML
output, --man-prologue/--man-epilogue
options for the
man page output). For an example of such complete documentation see
the CLI
Compiler Command Line Manual and the cli(1)
man
page. For more information on the option documentation syntax,
see Section 3.3, Option Documentation.
3 CLI Language
This chapter describes the CLI language and its mapping to C++. A CLI file consists of zero or more Include Directives followed by one or more Namespace Definitions or Option Class Definitions. C and C++-style comments can be used anywhere in the CLI file except in character and string literals.
3.1 Option Class Definition
The central part of the CLI language is option class. An option class contains one or more option definitions, for example:
class options { bool --help; int --compression; };
If we translate the above CLI fragment to C++, we will get a C++ class with the following interface:
class options { public: options (int& argc, char** argv, bool erase = false, cli::unknown_mode opt_mode = cli::unknown_mode::fail, cli::unknown_mode arg_mode = cli::unknown_mode::stop); options (int start, int& argc, char** argv, bool erase = false, cli::unknown_mode opt_mode = cli::unknown_mode::fail, cli::unknown_mode arg_mode = cli::unknown_mode::stop); options (int& argc, char** argv, int& end, bool erase = false, cli::unknown_mode opt_mode = cli::unknown_mode::fail, cli::unknown_mode arg_mode = cli::unknown_mode::stop); options (int start, int& argc, char** argv, int& end, bool erase = false, cli::unknown_mode opt_mode = cli::unknown_mode::fail, cli::unknown_mode arg_mode = cli::unknown_mode::stop); options (cli::scanner&, cli::unknown_mode opt_mode = cli::unknown_mode::fail, cli::unknown_mode arg_mode = cli::unknown_mode::stop); options (const options&); options& operator= (const options&); public: static void print_usage (std::ostream&); public: bool help () const; int compression () const; };
An option class is mapped to a C++ class with the same name. The
C++ class defines a set of public overloaded constructors, a public
copy constructor and an assignment operator, as well as a set of public
accessor functions and, if the --generate-modifier
CLI
compiler option is specified, modifier functions corresponding to option
definitions. It also defines a public static print_usage()
function that can be used to print the usage information for the options
defined by the class.
The argc/argv
arguments in the overloaded constructors
are used to pass the command line arguments array, normally as passed
to main()
. The start
argument is used to
specify the position in the arguments array from which the parsing
should start. The constructors that don't have this argument, start
from position 1, skipping the executable name in argv[0]
.
The end
argument is used to return the position in
the arguments array where the parsing of options stopped. This is the
position of the first program argument, if any. If the erase
argument is true
, then the recognized options and their
values are removed from the argv
array and the
argc
count is updated accordingly.
The opt_mode
and arg_mode
arguments
specify the parser behavior when it encounters an unknown option
and argument, respectively. The unknown_mode
type
is part of the generated CLI runtime support code. It has the
following interface:
namespace cli { class unknown_mode { public: enum value { skip, stop, fail }; unknown_mode (value v); operator value () const; }; }
If the mode is skip
, the parser skips an unknown
option or argument and continue parsing. If the mode is
stop
, the parser stops the parsing process. The
position of the unknown entity is stored in the end
argument. If the mode is fail
, the parser throws the
cli::unknown_option
or cli::unknown_argument
exception (described blow) on encountering an unknown option or argument,
respectively.
Instead of the argc/argv
arguments, the last overloaded
constructor accepts the cli::scanner
object. It is part
of the generated CLI runtime support code and has the following
abstract interface:
namespace cli { class scanner { public: virtual bool more () = 0; virtual const char* peek () = 0; virtual const char* next () = 0; virtual void skip () = 0; }; }
The CLI runtime also provides two implementations of this interface:
cli::argv_scanner
and cli::argv_file_scanner
.
The first implementation is a simple scanner for the argv
array (it is used internally by all the other constructors) and has the
following interface:
namespace cli { class argv_scanner { public: argv_scanner (int& argc, char** argv, bool erase = false); argv_scanner (int start, int& argc, char** argv, bool erase = false); int end () const; ... }; }
The cli::argv_file_scanner
implementation provides
support for reading command line arguments from the argv
array as well as files specified with command line options. It is
generated only if explicitly requested with the
--generate-file-scanner
CLI compiler option and has
the following interface:
namespace cli { class argv_file_scanner { public: argv_file_scanner (int& argc, char** argv, const std::string& option, bool erase = false); argv_file_scanner (int start, int& argc, char** argv, const std::string& option, bool erase = false); struct option_info { // If search_func is not NULL, it is called, with the arg // value as the second argument, to locate the options file. // If it returns an empty string, then the file is ignored. // const char* option; std::string (*search_func) (const char*, void* arg); void* arg; }; argv_file_scanner (int& argc, char** argv, const option_info* options, std::size_t options_count, bool erase = false); argv_file_scanner (int start, int& argc, char** argv, const option_info* options, std::size_t options_count, bool erase = false); ... }; }
The option
argument in the first two constructors and
the options
and options_count
arguments
in the last two are used to pass the option name(s) that should be
recognized as specifying the file containing additional options.
Such a file contains a set of options, each appearing on a
separate line optionally followed by space and an option value. Empty lines
and lines starting with #
are ignored. Option values can
be enclosed in double ("
) or single ('
)
quotes to preserve leading and trailing whitespaces as well as to
specify empty values. If the value itself contains trailing or leading
quotes, enclose it with an extra pair of quotes, for example
'"x"'
. Non-leading and non-trailing quotes are interpreted
as being part of the option value.
The semantics of providing options in a file is equivalent to providing the same set of options in the same order on the command line at the point where the options file is specified, except that the shell escaping and quoting is not required. Multiple files can be specified by including several file options on the command line or inside other files.
The parsing constructor (those with the argc/argv
or
cli::scanner
arguments) can throw the following exceptions: cli::unknown_option
,
cli::unknown_argument
, cli::missing_value
, and
cli::invalid_value
. The first two exceptions are thrown
on encountering unknown options and arguments, respectively, as
described above. The missing_value
exception is thrown when
an option value is missing. The invalid_value
exception is
thrown when an option value is invalid, for example, a non-integer value
is specified for an option of type int
.
Furthermore, all scanners (and thus the parsing constructors that
call them) can throw the cli::eos_reached
exception
which indicates that one of the peek()
, next()
,
or skip()
functions were called while more()
returns false
. Catching this exception normally indicates an
error in an option parser implementation. The argv_file_scanner
class can also throw the cli::file_io_failure
exception
which indicates that a file could not be opened or there was a reading
error as well as the cli::unmatched_quote
exception
which indicates that an unmatched leading or trailing quote was
found in an option value.
All CLI exceptions are derived from the common cli::exception
class which implements the polymorphic std::ostream
insertion.
For example, if you catch the cli::unknown_option
exception as cli::exception
and print it to
std::cerr
, you will get the error message corresponding
to the unknown_option
exception.
The exceptions described above are part of the generated CLI runtime support code and have the following interfaces:
#include <exception> namespace cli { class exception: public std::exception { public: virtual void print (std::ostream&) const = 0; }; inline std::ostream& operator<< (std::ostream& os, const exception& e) { e.print (os); return os; } class unknown_option: public exception { public: unknown_option (const std::string& option); const std::string& option () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class unknown_argument: public exception { public: unknown_argument (const std::string& argument); const std::string& argument () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class missing_value: public exception { public: missing_value (const std::string& option); const std::string& option () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class invalid_value: public exception { public: invalid_value (const std::string& option, const std::string& value); const std::string& option () const; const std::string& value () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class eos_reached: public exception { public: virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class file_io_failure: public exception { public: file_io_failure (const std::string& file); const std::string& file () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; class unmatched_quote: public exception { public: unmatched_quote (const std::string& argument); const std::string& argument () const; virtual void print (std::ostream&) const; virtual const char* what () const throw (); }; }
3.2 Option Definition
An option definition consists of four components: type,
name, default value, and documentation.
An option type can be any C++ type as long as its string representation
can be parsed using the std::istream
interface. If the option
type is user-defined then you will need to include its declaration using
the Include Directive.
An option of a type other than bool
is expected to
have a value. An option of type bool
is treated as
a flag and does not have a value. That is, a mere presence of such
an option on the command line sets this option's value to
true
.
The name component specifies the option name as it will be entered
in the command line. A name can contain any number of aliases separated
by |
. The C++ accessor and modifier function names are
derived from the first name by removing any leading special characters,
such as -
, /
, etc., and replacing special
characters in other places with underscores. For example, the following
option definition:
class options { int --compression-level | --comp | -c; };
Will result in the following accessor function:
class options { int compression_level () const; };
While any option alias can be used on the command line to specify this option's value.
If the option name conflicts with one of the CLI language keywords, it can be specified as a string literal:
class options { bool "int"; };
The following component of the option definition is the optional default
value. If the default value is not specified, then the option is
initialized with the default constructor. In particular, this means
that a bool
option will be initialized to false
,
an int
option will be initialized to 0
, etc.
Similar to C++ variable initialization, the default option value can be specified using two syntactic forms: an assignment initialization and constructor initialization. The two forms are equivalent except that the constructor initialization can be used with multiple arguments, for example:
include <string>; class options { int -i1 = 5; int -i2 (5); std::string -s1 = "John"; std::string -s2 ("Mr John Doe", 8, 3); };
The assignment initialization supports character, string, boolean, and simple integer literals (including negative integers) as well as identifiers. For more complex expressions use the constructor initialization or wrap the expressions in parenthesis, for example:
include "constants.hxx"; // Defines default_value. class options { int -a = default_value; int -b (25 * 4); int -c = (25 / default_value + 3); };
By default, when an option is specified two or more times on the command
line, the last value overrides all the previous ones. However, a number
of standard C++ containers are handled differently to allow collecting
multiple option values or building key-value maps. These
containers are std::vector
, std::set
, and
std::map
.
When std::vector
or std::set
is specified
as an option type, all the values for this option are inserted into the
container in the order they are encountered. As a result,
std::vector
will contain all the values, including
duplicates while std::set
will contain all the unique
values. For example:
include <set>; include <vector>; class options { std::vector<int> --vector | -v; std::set<int> --set | -s; };
If we have a command line like this:
-v 1 -v 2 -v 1 -s 1 -s 2 -s 1
, then the vector returned
by the vector()
accessor function will contain three
elements: 1
, 2
, and 1
while
the set returned by the set()
accessor will contain
two elements: 1
and 2
.
When std::map
is specified as an option type, the option
value is expected to have two parts: the key and the value, separated
by =
. All the option values are then parsed into key/value
pairs and inserted into the map. For example:
include <map>; include <string>; class options { std::map<std::string, std::string> --map | -m; };
The possible option values for this interface are: -m a=A
,
-m =B
(key is an empty string), -m c=
(value
is an empty string), or -m d
(same as -m d=
).
The last component in the option definition is optional documentation. It is discussed in the next section.
3.3 Option Documentation
Option documentation mimics C++ string array initialization:
it is enclosed in {}
and consists of one or more
documentation strings separated by a comma, for example:
class options { int --compression = 5 { "<level>", "Set compression to <level> instead of 5 by default. With the higher compression levels the program may produce a smaller output but may also take longer and use more memory." }; };
The option documentation consists of a maximum of three documentation
strings. The first string is the value documentation string.
It describes the option value and is only applicable to options
with types other than bool
(options of type
bool
are flags and don't have an explicit value).
The second string (or the first string for options of type
bool
) is the short documentation string. It
provides a brief description of the option. The last entry
in the option documentation is the long documentation string.
It provides a detailed description of the option. The short
documentation string is optional. If only two strings are
present in the option documentation (one string for options
of type bool
), then the second (first) string is
assumed to be the long documentation string.
Option documentation is used to print the usage information
as well as to generate program documentation in the HTML and
man page formats. For usage information the short documentation
string is used if provided. If only the long string is available,
then, by default, only the first sentence from the long string
is used. You can override this behavior and include the complete
long string in the usage information by specifying the
--long-usage
CLI compiler option. When generating
the program documentation, the long documentation strings are
always used.
The value documentation string can contain text enclosed in
<>
which is automatically recognized by the CLI
compiler and typeset according to the selected output in all three
documentation strings. For example, in usage the level
value for the --compression
option presented above
will be displayed as <level>
while in the HTML and
man page output it will be typeset in italic as
level
. Here is another example using the
std::map
type:
include <map>; include <string>; class options { std::map<std::string, std::string> --map { "<key>=<value>", "Add the <key>, <value> pair to the map." }; };
The resulting HTML output for this option would look like this:
As you might have noticed from the examples presented so far, the
documentation strings can span multiple lines which is not possible
in C++. Also, all three documentation strings support the following
basic formatting mechanisms. The start of a new paragraph is indicated
by a blank line. A fragment of text can be typeset in monospace font
(normally used for code fragments) by enclosing it in the
\c{}
block. Similarly, text can be typeset in bold or
italic fonts using the \b{}
and \i{}
blocks,
respectively. You can also combine several font properties in a single
block, for example, \cb{bold code}
. If you need to include
literal }
in a formatting block, you can use the
\}
escape sequence, for example,
\c{int a[] = {1, 2\}}
. The following example shows how we
can use these mechanisms:
class options { int --compression = 5 { "<level>", "Set compression to <level> instead of 5 by default. With the higher compression levels the program \i{may} produce a smaller output but may also \b{take longer} and \b{use more memory}." }; };
The resulting HTML output for this option would look like this:
3.4 Include Directive
If you are using user-defined types in your option definitions,
you will need to include their declarations with the include
directive. Include directives can use < >
or
" "
-enclosed paths. The CLI compiler does not
actually open or read these files. Instead, the include directives
are translated to C++ preprocessor #include
directives
in the generated C++ header file. For example, the following CLI
definition:
include <string>; include "types.hxx"; // Defines the name_type class. class options { std::string --string; name_type --name; };
Will result in the following C++ header file:
#include <string> #include "types.hxx" class options { ... const std::string& string () const; const name_type& name () const; ... };
Without the #include
directives the std::string
and name_type
types in the options
class would
be undeclared and result in compilation errors.
3.5 Namespace Definition
Option classes can be placed into namespaces which are translated directly to C++ namespaces. For example:
namespace compiler { namespace lexer { class options { int --warning-level = 0; }; } namespace parser { class options { int --warning-level = 0; }; } namespace generator { class options { int --target-width = 32; }; } }
The above CLI namespace structure would result in the equivalent C++ namespaces structure:
namespace compiler { namespace lexer { class options { int warning_level () const; }; } namespace parser { class options { int warning_level () const; }; } namespace generator { class options { int target_width () const; }; } }


Please log in first. If you don't have an account, please sign up.
Your email or password is incorrect.
Perfect for both the new player and the returning veteran!
alwaysrolls20 - purchased 6/15/16
Finally got around to joining a session that my friends have been running for a while now. Having a blast with it. This book helped me understand how everything works.
level1cleric - purchased 5/11/17
Not convinced? Want to know more? Don't take our word for it, visit the official website!
For the player, this book will explain everything you need to know about the "world's best roleplaying game."
The art inside the book looks great, and really gives you insight as to what this fantasy world holds.
In the back of the book is a character sheet where you can write down all of your character's relevant infomation.


Unaffacted by :unresolved
I'm red because I matches x-foo:unresolved
I'm green because I am now resolved.


Scope is what we have acces to and where. There are two types of scope, global and local.
Global is when a variable is declared outsite of any function, meaning that it can be accessed from anywhere. Local is when a varible is declared within a function and can only be accessed within that function.
A way to look at it would be if you save a file somewhere on the internet that you can access it with any devise, this would be global. However if you save it only on your desktop it would only be accessable through your desktop, therefore it would be local.


I am a Full stack web developer adept at building responsive web application from front to back. Passionate about learing teachnologies, bring ideas to life, and working with delicated teams to build efficient and robust application suited to the user's needs.
Skill:HTML, CSS, Javascript, MongoDB, Express, React, Node, AJAX, JQuery, SQL, Git
Education:University of Connecticut(Full Stack Web Development Bootcamp) An intensive 6-month long coding bootcamp in which I learned to design and build web application from the front-end to back-end with the MERN stack (MongoDB, Express.js, Node.js).
Rajamangala University of Technology Bangkok Thailand(Bachelor's in Information Systems Technology BICIS).