OpenGoddard package¶
Submodules¶
OpenGoddard.optimize module¶
OpenGoddard.optimize - Optimal Trajectories module with PseudoSpectral Method
-
class
OpenGoddard.optimize.
Condition
(length=0)¶ Bases:
object
OpenGoddard.optimize Condition class
thin wrappper of numpy zeros and hstack
Examples
for examples in equality function.
Initial condtion : x[0] = 0.0
Termination Condition : x[-1] = 100
>>> result = Condition() >>> result.equal(x[0], 0.0) >>> result.equal(x[-1], 100) >>> return result()
for examples in inequality function
Inequation condtion : 0.0 <= x <= 100
>>> result = Condition() >>> result.lower_bound(x, 0.0) >>> result.upper_bound(x, 100) >>> return result()
-
add
(arg, unit=1.0)¶ add condition
Parameters: arg (array_like) – condition
-
change_value
(index, value)¶
-
equal
(arg1, arg2, unit=1.0)¶ add equation constraint condition in Problem equality function
arg1 = arg2
Parameters: - arg1 (float or array_like) – right side of the equation
- arg2 (float or array_like) – left side of the equation
- unit (float, optional) – argX / unit (default : 1.0)
Notes
It must be used in equality function.
-
lower_bound
(arg1, arg2, unit=1.0)¶ add inequation constraint condition in Problem inequality function
arg1 >= arg2
Parameters: - arg1 (array like) – arg1 is greater than or equal to arg2
- arg2 (float or array like) – arg1 is greater than or equal to arg2
- unit (float, optional) – argX / unit (default : 1.0)
Notes
It must be used in inequality function.
-
upper_bound
(arg1, arg2, unit=1.0)¶ add inequation constraint condition in Problem inequality function
arg1 <= arg2
Parameters: - arg1 (array like) – arg1 is less than or equal to arg2
- arg2 (float or array like) – arg1 is less than or equal to arg2
- unit (float, optional) – argX / unit (default : 1.0)
Notes
It must be used in inequality function.
-
-
class
OpenGoddard.optimize.
Dynamics
(prob, section=0)¶ Bases:
object
OpenGoddard.optimize Condition class.
thin wrapper for dynamics function. Behave like a dictionary type.
Examples
Dynamics class must be used in dynamics function. It is an example of the equation of motion of thrust and free fall. Thrust is controllable.
\[ \begin{align}\begin{aligned}\dot{x} &= v\\\dot{v} &= T/m - g\end{aligned}\end{align} \]>>> def dynamics(prob, obj, section): >>> x = prob.states(0, section) >>> v = prob.states(1, section) >>> T = prob.controls(0, section) >>> g = 9.8 >>> m = 1.0 >>> dx = Dynamics(prob, section) >>> dx[0] = v >>> dx[1] = T / m - g >>> return dx()
-
class
OpenGoddard.optimize.
Guess
¶ Bases:
object
Class for initial value guess for optimization.
Collection of class methods
-
classmethod
constant
(time, const)¶ return constant values that array size is same as time length
Parameters: - time (array_like) –
- const (float) – set value
Returns: (N, ) ndarray
-
classmethod
cubic
(time, y0, yprime0, yf, yprimef)¶ return cubic function values that array size is same as time length
Parameters: - time (array_like) – time
- y0 (float) – initial value
- yprime0 (float) – slope of initial value
- yf (float) – final value
- yprimef (float) – slope of final value
Returns: (N, ) ndarray
-
classmethod
linear
(time, y0, yf)¶ return linear function values that array size is same as time length
Parameters: - time (array_like) – time
- y0 (float) – initial value
- yf (float) – final value
Returns: (N, ) ndarray
-
classmethod
plot
(x, y, title='', xlabel='', ylabel='')¶ plot wrappper
Parameters: - x (array_like) – array on the horizontal axis of the plot
- y (array_like) – array on the vertical axis of the plot
- title (str, optional) – title
- xlabel (str, optional) – xlabel
- ylabel (str, optional) – ylabel
-
classmethod
zeros
(time)¶ return zeros that array size is same as time length
Parameters: time (array_like) – Returns: (N, ) ndarray
-
classmethod
-
class
OpenGoddard.optimize.
Problem
(time_init, nodes, number_of_states, number_of_controls, maxIterator=100, method='LGL')¶ Bases:
object
OpenGoddard Problem class.
Parameters: - time_init (list of float) – [time_start, time_section0, time_section0, , , time_final]
- nodes (int) – number of nodes
- number_of_states (list) – number of states
- number_of_controls (list) – number of controls
- maxIterator (int) – iteration max
Variables: - nodes (int) – time nodes.
- number_of_states (int) – number of states.
- number_of_controls (int) – number of controls
- number_of_section (int) – number of section
- number_of_param (int) – number of inner variables
- div (list) – division point of inner variables
- tau – Gauss nodes
- w – weights of Gaussian quadrature
- D – differentiation matrix of Gaussian quadrature
- time – time
- maxIterator (int) – max iterator
- time_all_section – all section time
- unit_states (list of float) – canonical unit of states
- unit_controls (list of float) – canonical unit of controls
- unit_time (float) – canonical unit of time
- p ((N,) ndarray) – inner variables for optimization
- dynamics (function) – function list, list of function of dynamics
- knot_states_smooth (list of True/False) – list of states are smooth on phase knots
- cost (function) – cost function
- running_cost (function, optional) – (default = None)
- cost_derivative (function, optional) – (default = None)
- equality (function) – (default = None)
- inequality (function) – (default = None)
-
controls
(control, section)¶ getter specify section controls array
Parameters: - control (int) – control number
- section (int) – section number
Returns: 1-D array of controls
Return type: controls (ndarray)
-
controls_all_section
(control)¶ get controls array
Parameters: control (int) – control number Returns: 1-D array of all section control Return type: controls_all_section ((N, ) ndarray)
-
index_controls
(control, section, index=None)¶
-
index_states
(state, section, index=None)¶ get index of state at specific section
Parameters: - state (int) – state
- section (int) – section
- index (int, optional) – index
Returns: index of states
Return type: index_states (int)
-
index_time_final
(section)¶
-
method_LG
(n)¶ Legendre-Gauss Pseudospectral method Gauss nodes are roots of \(P_n(x)\).
Parameters: n (int) – number of nodes Returns: nodes, weight, differentiation_matrix Return type: ndarray, ndarray, ndarray
-
method_LGL
(n)¶ Legendre-Gauss-Lobatto Pseudospectral method Gauss-Lobatto nodes are roots of \(P'_{n-1}(x)\) and -1, 1.
Parameters: n (int) – number of nodes Returns: nodes, weight, differentiation_matrix Return type: ndarray, ndarray, ndarray References
Fariba Fahroo and I. Michael Ross. “Advances in Pseudospectral Methods for Optimal Control”, AIAA Guidance, Navigation and Control Conference and Exhibit, Guidance, Navigation, and Control and Co-located Conferences http://dx.doi.org/10.2514/6.2008-7309
-
method_LGR
(n)¶ Legendre-Gauss-Radau Pseudospectral method Gauss-Radau nodes are roots of \(P_n(x) + P_{n-1}(x)\).
Parameters: n (int) – number of nodes Returns: nodes, weight, differentiation_matrix Return type: ndarray, ndarray, ndarray
-
plot
(title_comment='')¶ plot inner variables that to be optimized
Parameters: title_comment (str) – string for title
-
set_controls
(control, section, value)¶ set value to control at all section
Parameters: - control (int) – control
- section (int) – section
- value (int) – value
-
set_controls_all_section
(control, value_all_section)¶ set value to control at all section
Parameters: - control (int) – control
- value_all_section (int) – value
-
set_states
(state, section, value)¶ set value to state at specific section
Parameters: - state (int) – state
- section (int) – section
- value (int) – value
-
set_states_all_section
(state, value_all_section)¶ set value to state at all section
Parameters: - state (int) – state
- value_all_section (int) – value
-
set_time_final
(section, value)¶ set value to final time at specific section
Parameters: - section (int) – seciton
- value (float) – value
-
set_unit_controls
(control, section, value)¶ set a canonical unit value to the control at a specific section
Parameters: - control (int) – control
- section (int) – section
- value (float) – value
-
set_unit_controls_all_section
(control, value)¶ set a canonical unit value to the control at all sections
Parameters: - control (int) – control
- value (float) – value
-
set_unit_states
(state, section, value)¶ set a canonical unit value to the state at a specific section
Parameters: - state (int) – state
- section (int) – section
- value (float) – value
-
set_unit_states_all_section
(state, value)¶ set a canonical unit value to the state at all sections
Parameters: - state (int) – state
- value (float) – value
-
set_unit_time
(value)¶ set a canonical unit value to the time
Parameters: value (float) – value
-
solve
(obj, display_func=<function Problem._dummy_func>, **options)¶ solve NLP
Parameters: - obj (object instance) – instance
- display_func (function) – function to display intermediate values
- ftol (float, optional) – Precision goal for the value of f in the stopping criterion, (default: 1e-6)
- maxiter (int, optional) – Maximum number of iterations., (default : 25)
Examples
“prob” is Problem class’s instance.
>>> prob.solve(obj, display_func, ftol=1e-12)
-
states
(state, section)¶ getter specify section states array
Parameters: - state (int) – state number
- section (int) – section number
Returns: 1-D array of state
Return type: states ((N,) ndarray)
-
states_all_section
(state)¶ get states array
Parameters: state (int) – state number Returns: 1-D array of all section state Return type: states_all_section ((N,) ndarray)
-
time_final
(section)¶ get time at section “end”
Parameters: section (int) – section Returns: time at section end Return type: time_final (int)
-
time_final_all_section
()¶ get time at “end”
Parameters: section (int) – section Returns: time at end Return type: time_final_all_section (int)
-
time_knots
()¶ get time at knot point
Returns: time at knot point Return type: time_knots (list)
-
time_start
(section)¶ get time at section “start”
Parameters: section (int) – section Returns: time at section start Return type: time_start (int)
-
time_to_tau
(time)¶
-
time_update
()¶ get time array after optimization
Returns: - (N,) ndarray
- time array
Return type: time_update
-
to_csv
(filename='OpenGoddard_output.csv', delimiter=', ')¶ output states, controls and time to csv file
Parameters: - filename (str, optional) – csv filename
- delimiter – (str, optional) : default ”,”


” Every story has an end. But in life, every ending is just a new beginning. “
” Life was like a box of chocolate, you never know what you’re gonna get. “
test | Jun 3, 2015 • Ding Jiao
” Every story has an end. But in life, every ending is just a new beginning. “
” Life was like a box of chocolate, you never know what you’re gonna get. “


{% extends 'layout.html' %} {% block pageTitle %} NHS.UK prototype kit - Gitpod installation guide {% endblock %} {% block beforeContent %} {{ breadcrumb({ items: [ { href: "/docs", text: "Home" } ], href: "/docs/install", text: "Install" }) }} {% endblock %} {% block content %}
Start your local server by entering in the terminal:
npm run watch
After the kit has started, you should see a message telling you that the kit is running:
{{ pagination({ "previousUrl": "install-kit", "previousPage": "Install the kit", "nextUrl": "check-kit", "nextPage": "Check it works" }) }}


Sounds OK but complicated.
(Explanations on shortenings and stuff like that below. This will be a college alike thing for the first period of the roleplay! Romance is therfor also allowed if ye want to. Please read the plot explanation before ragequitting! And please, if you find grammatical or spelling mistakes, TELL ME! I want to become better at English while having fun )
On the planet earth, a new group with unknown purposes, are rising faster than they should. Gaining control of several secret and undiscovered places on earth, they started to need even more people, to feed their growth.
But first things first... Humanity has spread throughout the galaxy, and have in total, somewhat settled on 27 different planets. The deomocracy is in ruins, and the UC have lost the most of their control on all of the planets under their control and supervision to the EF. The EF holds them in tight positions, where if they as much as move a muscle in the wrong direction the workers will be shot. Another group of rebels have taken up the war, but they are loosing their planets as well, faster than should be possible with the technology they have at the present time.
But rebels are coming to get the EF, and before they know it...
The secret organization have successfully kept a hidden acedemy, 500 feet below the earths surface for 10 years. Now what would an organization need an academy for?
They need pilots, agents and soldiers to take the controls of different kinds of mechas and exoskeletons. They are building up manpower enough to destroy the UC from the inside, and they are using the other rebelling group as a distraction. But due to the UC's progress, they've made haste. They needed to take more people in at the academy than those who had the maximal potential. Several strange invites were send to people all over the world.
The invite is a simple letter with a strange handwrote note in it.
"We, the ones who will save this galaxy from the dangers to come, invite you to take the train or ferry. Pack your belongings, and wait outside your house at 12PM. Tell no one about it, or we won't be able to ensure their safety"
Those who do agree, is escorted by a member from the secret organization, to either an underground trainstation, or to a small submarine. Once inside, they will be locked in a room with no windows, so that they can't tell where they are going. In other words- There is no turning back.

Those who go by sea, will be forced to walk, unable to see the outside of the academy, to go inside the academy, through a big door. Once inside, is a big hall called "The welcoming hall"
Now you have gotten an invite. will you take it? Will you leave it, and never take the chance of becoming a hero or a villain? will you go against the order when you grow up? Or will you go against the EF as you're supposed to?
Explanations:
Exoskeletion: A robotic suit, fitting tightly to the body, enabling the person inside to gain incredible athletic abbilities. that, and some even enable space travelling.
Mecha: A robot controlled by a pilot like seen in many animes. (Just a bit more realistic size)
UC: United colonies.
EF: Earth forces.
Story and plot explanations:
You, we, all of us, are, or will become, students of the secret academy. Wether you're on of those whom have great potential, or those they took because they just needed you. The plot will advance with weekly events, that WILL affect your characters. In some cases you have to actively accept the difficulties, and in others you will be forced to join the event (Since invasions on the academy and stuff, arn't very easy to avoid~)
this, however in the first 3 months, will be a RP in an academy, with both females AND males! So romance is definitly allowed! It might make part two even more intersting.
Once a month, a year is about to end. In other words- You will only stay at the academy for three years to study.
Once those three months end, the real deal will start. And the academy quickly will turn into your, or your enemies headquarters!
The academy:
Basement:
The basement is a gigantic underground trainstation, where the secret society's teachers and so on, arrive in from their normal lives. Students are not allowed to be in the basement, and the security is difficult to get through. Not saying it's impossible though...
First floor: The first floor is one gigantic hall, with a lot of tables and so on. This is used as the dinning hall, and the party hall, and the "welcome!" hall. There isn't a lot to describe here, except the nice little bar, and the high ammount of toilets.
Second floor: Students quarters. Here you live, breathe, eat, kiss, make out- whatever you want to. As long as you don't injure anyone else, the secret organization couldn't care less. But if you do, it might not be very nice to be you...
Third floor: The third floor is used for practicing. Classes takes place here. On this floor, you can find simulation rooms, and exoskeleton-traning modules. From there, you can also access the arena, through a long window-less hall. In other words, the third floor, is for traning you in using the machines.
The Arena: The arena a fully interactive hall, where everything can be changed to any setting you want to. Sadly, it takes some time to set up settings, so often when teachers uses the hall, they use the "blank" version, with only steel boxes and so on to train their students. Near the arena, a storage with traning and spare robots and exoskeltons can be found, often used to train students. That, and some goggles that are to train agents to focus in different situations and to train them in getting the enemy closer...
Fourth floor: Fourth floor is the boring floor. A lot of classrooms and so on, where math and other things like that, will be given to the students brains, wether they like it or not.
Fifth floor and above: Who knows? It's all extremely restricted once you get here. But rumours say, that the second and third year students can be found up there...
And thats that!
Any questions or comments: I will gladly respond! Actually, please send me something. It gets boring when you're alone! :P
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
Goals for this summer:
Spoiler
Sounds OK but complicated.
Livinginthe80sDarling
Audrey Hepburn*1929-1993*ForeverMyIdol.
Haha, yesh. I tend to make things more complicated than they are. W- did you just read it all? o.o';...
But to make it short, it's a secret organization, who are having an academy, where we will be living!
But with that, you cut hundreds of details. :P
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
Goals for this summer:
Spoiler
O.o Ya I did read it all! And I'm in. This sounds cool.
CS?
Livinginthe80sDarling
Audrey Hepburn*1929-1993*ForeverMyIdol.
I usually don't make a CS before it'l go somewhere, but i guess it would be something like:
Name:
Sex:
Age: (16-22)
Political view: (Liberalist, communist, rebel, socialist?)
Personality:
Want to be: (Agent,pilot,soldier)
Looks: (Real picture, Anime or descriptions accepted)
But i'm not quite sure yet. :P
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
 Homework! YAY!
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
Goals for this summer:
Spoiler
Cool! Yes, I read the whole thing, and I am totally in!!^^
www.freerice.com
Try it!
-Improve and expand your vocabulary
-Test your knowledge in multiple subjects
-Help feed the hungry
For EVERY WORD you get right, sponsors of freerice DONATE TEN GRAINS of rice to the HUNGRY of the world!!
It may not seem like much, but it adds up. For parents with a starving child, a full bowl of rice is the best gift in the world. Take some time to give them that gift!!
Click to give!! You can help rescued animals by simply clicking every day. Each time you click, sponsors of the cause pay for food and care of rescued animals. It costs you nothing more than a few seconds, and goes a very long way!!
Random note: I AM A FEMALE!!!!! Ok, spazz over. Just didn't want people making the BIG MISTAKE, as many have done before. ^^
Spoiler
YES! FINALLY!
Uhh, ehh... I mean... Ofcourse you like it...
Good to know we have one more on the "team" :P
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
Goals for this summer:
Spoiler
lol, I can't wait to start! *glares inwardly at self for joining rps that will distract me from hw and other activities and will become addicting, make my grades drop, and keep me up until two in the morning trying to write a half-decent post when I had convinced myself I would have enough willpower to resist joining any more rps than the one my sis and I are starting because of the aforementioned reasons and because I will hate myself for it.* ^^
www.freerice.com
Try it!
-Improve and expand your vocabulary
-Test your knowledge in multiple subjects
-Help feed the hungry
For EVERY WORD you get right, sponsors of freerice DONATE TEN GRAINS of rice to the HUNGRY of the world!!
It may not seem like much, but it adds up. For parents with a starving child, a full bowl of rice is the best gift in the world. Take some time to give them that gift!!
Click to give!! You can help rescued animals by simply clicking every day. Each time you click, sponsors of the cause pay for food and care of rescued animals. It costs you nothing more than a few seconds, and goes a very long way!!
Random note: I AM A FEMALE!!!!! Ok, spazz over. Just didn't want people making the BIG MISTAKE, as many have done before. ^^
Spoiler
Trust me Cat... I know the feeling. :P
"Support bacteria; it is the only culture we have left" ;D
I dislike the simple/cliche and love the mysterious.
I'm also a socialist. Because I care. :3
Anyone want to play a RPG with a combat system and dices? PM me! :3
Goals for this summer:
Spoiler


Epitome
"You underestimate the power of the Dark Side. If you will not fight, then you will meet your destiny!" Darth Vader, Star Wars
Untitled - 2013
"Some birds aren't meant to be caged. Their feathers are just too bright."
Arnold Bennett, The Shawshank Redemption
Untitled - 2012
"Happiness can be found even in the darkest of times. If one only remembers to turn on the light."
Albus Dumbledore, Harry Potter and the Prisoner of Azkaban
Kraken
"A laugh can be a very powerful thing. Why, sometimes in life, it's the only weapon we have."
Roger Rabbit, Who Framed Roger Rabbit?
Untitled - 2013
"It's only a passing thing, this shadow. Even darkness must pass. A new day will come. And when the sun shines it will shine out the clearer."
Samwise Gamgee, The Lord of the Rings: The Two Towers
Arrow
"Do, or do not. There is no 'try'."
Yoda, Star Wars
Untitled - 2013
I just the took to calling it the Bat.
Lucius Fox, The Dark Knight Rises
Untitled - 2012
"The past is just a story we tell ourselves."
Samantha, Her
Jenny - Portrait
"It's not who I am underneath, but what I do that defines me."
Batman, Batman Begins
Untitled - 2014
"Some men aren't looking for something logical, some men just want to watch the world burn"
Alfred Pennyworth, The Dark Knight
Unititled - 2013
"Every man dies, not every man really lives."
William Wallace, Braveheart
Untitled - 2014
"We used to look up at the sky and wonder at our place in the stars. Now we just look down, and worry about out place in the dirt"
Interstellar
Gerado
"Our lives are defined by opportunities. Even the ones we miss."

What a Girl Wants


<EMAIL_ADDRESS>Currently I am a master student in Electrical Engineering and Information Technology at ETH Zurich. I received my B.Eng in Automation from Xi’an Jiaotong University.
I am interested in topics including 1) optimization in machine learning and 2) dynamics of gradient algorithms.
ETH Zurich
2017.9 - Now
MSc in Electrical Engineering and Information Technology
Xi’an Jiaotong University
2013.9 - 2017.6
BEng in Automation
I love classical music, especially of Baroque era. J.S.Bach, A.Caldara and A.Hasse are among my favorate composers.
I am crazy fan of both Chinese Kunqu opera and western opera.
I know mandarin chinese, Wu chinese, english, latin and some ancient greek. If possible, I would like to learn more about greek and akkadian.
It was once my dream to major in paryrology, epigraphy or old Chinese phonology.
【折桂令】问秦淮旧日窗寮，破纸迎风，坏槛当潮，目断魂消。当年粉黛，何处笙箫？罢灯船端阳不闹，收酒旗重九无聊。白鸟飘飘，绿水滔滔，嫩黄花有些蝶飞，新红叶无个人瞧。
【太平令】行到那旧院门，何用轻敲，也不怕小犬哰哰。无非是枯井颓巢，不过些砖苔砌草。手种的花条柳梢，尽意儿采樵，这黑灰是谁家厨灶？


Making the most out of Docker
Some options that might increase performance, some that don’t.
Network
Containers get connected to a bridge network by default.
A software bridge that allows communication between containers running on the same host & bridge.
We can also create and use custom bridges, to create isolated groups of containers.
To allow connections from outside, we must map the host’s ports to a container’s with -p
(publish e.g. -p 3306:3306)
This is easy and flexible, but it makes Docker start an additional process (docker-proxy), which can use a non-trivial amount of CPU.
What’s the alternative? Consider using --net=host
, which connects the container network directly the host.
In my experience, a considerable boost can be gained, specially when there are multiple connections.
The downside of this is that we run the risk of inadvertently exposing ports to the outside world. Moreover, changing service ports is, yet again, a hassle. We’ll need to deal with configuration settings inside the container.
How much more we can get out of Docker? I ran a sysbench OLTP read+write test with 8 threads on MariaDB 10.3.12 to see.
In my test, host network means about a 37% TPS increase.
Storage
Containers are made up of several layers, the top one is the only one that can be written into. Once a container is stopped and removed, this layer is lost. The layers are managed by one of Docker’s storage drivers, which does copy-on-write. Docker’s documentation states that this feature reduces performance.
To provide permanent storage we can use volumes and bind mounts. Volumes are managed by Docker itself, whereas bind mounts provide a way to map directory or file between the host and the container. In theory, these methods should be more efficient because they bypass Docker’s storage driver.
I was curious about a case in which I had to write lots of data but I didn’t need persistence. The best solution would have been to a tmpfs mount, being memory storage, it’s the fastest. But we don’t always have enough memory. What’s the best other alternative?
I tested random write speed with fio on an EC2 host with an io1 1000 IOPS volume.
As you can see, the mount option really makes no difference for write speeds.
To put things into perspective I repeated the test with a tmpfs mount. I had to use a log scale to even see the slower options.
Use Limits
Containers, by default, don’t have any limits. Any of them can hoard all the host system’s resources. This may be well and fine for development, but a potential disaster for production.
Thus, a final recommendation: set limits for production containers. At the very least a memory limit. To avoid swapping and containers getting killed by out of memory errors. We can also set limits for CPU and disk I/O.
First, we need to find out suitable limits. We can start the container normally and check resource usage:
docker stats <CONTAINER_ID>
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
529ea41caf55 jolly_borg 3.36% 5.016MiB / 983.9MiB 0.51% 0B / 0B 36.1MB / 24.4GB 7
A lot of details can be found under the /sys/fs/cgroup filesystem. For example, we can get a great deal of interesting memory counters.
-> cat /sys/fs/cgroup/memory/docker/<FULL_CONTAINER_ID>/memory.stats
cache 41623552
rss<PHONE_NUMBER>
rss_huge 0
shmem 15343616
mapped_file 24809472
dirty 0
writeback 0
swap 122916864
pgpgin 91463838
pgpgout 91185552
pgfault 165685756
pgmajfault 3525
inactive_anon 373063680
active_anon 738381824
inactive_file 10625024
active_file 15716352
unevictable 0
hierarchical_memory_limit<PHONE_NUMBER>854771712
hierarchical_memsw_limit<PHONE_NUMBER>854771712
total_cache 41623552
total_rss<PHONE_NUMBER>
total_rss_huge 0
total_shmem 15343616
total_mapped_file 24809472
total_dirty 0
total_writeback 0
total_swap 122916864
total_pgpgin 91463838
total_pgpgout 91186010
total_pgfault 165685756
total_pgmajfault 3525
total_inactive_anon 373063680
total_active_anon 738381824
total_inactive_file 10625024
total_active_file 15716352
total_unevictable 0
To get the full container id:
docker ps --no-trunc
Once we have an estimation, we can try starting a new container with some limits.
For a hard memory limit, we can use --memory
.
Use --cpus
to limit the amount of CPUs available.
When setting a memory limit, Docker will set a swap limit of
--memory
* 2. This can be changed with--memory-swap
: total swap allowed =--memory
---memory-swap
.
Container limits can even be changed while they are running.
We don’t need to restart containers as
Docker can change limits at runtime: docker update
# set limits, 4 CPUs, 4G of memory, 1G of swap
docker run -it --cpus=4 --memory=4G --memory-swap=5G ubuntu:latest bash
# increase memory limits, 8G memory, 1G of swap
docker update --memory=8G --memory-swap=9G <CONTAINER_ID>
Related links
- Benchmark data: https://github.com/TomFern/benchmark-data/tree/master/docker-perf-tips
- https://docs.docker.com/network/
- https://docs.docker.com/storage/
- https://docs.docker.com/config/containers/resource%5Fconstraints/
- https://docs.docker.com/config/containers/runmetrics/
See you.
Tomas


| Total net profit | -60.99 | Gross profit | 3.26 | Gross loss | -64.25 |
| Profit factor | 0.05 | Expected payoff | -2.18 | ||
| Absolute drawdown | -60.99 | Maximal drawdown (%) | 59.56 (-4165.03%) | ||
| Total trades | 28 | Profit trades (% of total) | 1 (3.57%) | Loss trades (% of total) | 27 (96.43%) |
| Long positions (won %) | 24 (4.17%) | Short positions (won %) | 4 (0.0%) | ||
| Largest | profit trade | 3.26 | loss trade | -14.12 | |
| Average | profit trade | 3.26 | loss trade | -2.38 | |
| Minimum | profit trade | 3.26 | loss trade | -0.64 | |
| Maximum | take profit in pips | 1588.0 | stop loss in pips | -2013.6 | |
| Average | take profit in pips | 282.3 | stop loss in pips | -403.8 | |
| Minimum | take profit in pips | -690.7 | stop loss in pips | -139.8 | |
| Maximum | Reward-Risk | 7.2 | Duration in minutes | 625 | |
| Average | Reward-Risk | 1.4 | Duration in minutes | 52.5 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0 | |
| Maximum | consecutive wins (profit in money) | 1.0 (3.26) | consecutive losses (loss in money) | 20.0 (-49.5) | |
| Average | consecutive wins | 1.0 | consecutive losses | 20.0 |
| Total net profit | -51.06 | Gross profit | 3.26 | Gross loss | -54.32 |
| Profit factor | 0.06 | Expected payoff | -2.13 | ||
| Absolute drawdown | -51.06 | Maximal drawdown (%) | 49.63 (-3470.63%) | ||
| Total trades | 24 | Profit trades (% of total) | 1 (4.17%) | Loss trades (% of total) | 23 (95.83%) |
| Largest | profit trade | 3.26 | loss trade | -14.12 | |
| Average | profit trade | 3.26 | loss trade | -2.36 | |
| Minimum | profit trade | 3.26 | loss trade | -0.64 | |
| Maximum | take profit in pips | 1588.0 | stop loss in pips | -2013.6 | |
| Average | take profit in pips | 259.3 | stop loss in pips | -373.7 | |
| Minimum | take profit in pips | -690.7 | stop loss in pips | -139.8 | |
| Maximum | Reward-Risk | 5.9 | Duration in minutes | 625.0 | |
| Average | Reward-Risk | 1.2 | Duration in minutes | 53.0 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0.0 | |
| Maximum | consecutive wins (profit in money) | 1.0 (3.26) | consecutive losses (loss in money) | 20.0 (-49.5) | |
| Average | consecutive wins | 1.0 | consecutive losses | 20.0 |
| Total net profit | -9.93 | Gross profit | 0.0 | Gross loss | -9.93 |
| Profit factor | 0.0 | Expected payoff | -2.48 | ||
| Absolute drawdown | -9.93 | Maximal drawdown (%) | 6.45 (-185.34%) | ||
| Total trades | 4 | Profit trades (% of total) | 0 (0.0%) | Loss trades (% of total) | 4 (100.0%) |
| Largest | profit trade | 0.0 | loss trade | -3.73 | |
| Average | profit trade | 0.0 | loss trade | -2.48 | |
| Minimum | profit trade | 0.0 | loss trade | -1.14 | |
| Maximum | take profit in pips | 1158.2 | stop loss in pips | -1413.5 | |
| Average | take profit in pips | 420.7 | stop loss in pips | -584.3 | |
| Minimum | take profit in pips | -470.9 | stop loss in pips | -161.5 | |
| Maximum | Reward-Risk | 7.2 | Duration in minutes | 147.0 | |
| Average | Reward-Risk | 2.6 | Duration in minutes | 49.8 | |
| Minimum | Reward-Risk | Duration in minutes | 3.0 | ||
| Maximum | consecutive wins (profit in money) | 0.0 (0.0) | consecutive losses (loss in money) | 4.0 (-9.93) | |
| Average | consecutive wins | 0.0 | consecutive losses | 4.0 |


Single-origin coffee pickled messenger bag, artisan raw denim readymade biodiesel williamsburg listicle cronut mixtape leggings vaporware narwhal.  Retro ennui taiyaki succulents normcore. Cornhole food truck la croix hexagon jean shorts chambray cronut kogi. Enamel pin organic pork belly disrupt, hashtag taxidermy single-origin coffee paleo farm-to-table. Fingerstache single-origin coffee vaporware williamsburg jianbing twee trust fund man braid chillwave taxidermy viral tumblr you probably haven't heard of them.


JavaScript Intro
Else condition
Goal
Support multiple logical paths with conditional else statements
Technologies
JavaScript
Live demo


Import, build, test and export responsive newsletter templates faster than ever using the GrapesJS Newsletter Builder.
Drag and drop built-in blocks from the right panel and style them in a matter of seconds
Build a good looking newsletter even without images enabled by the email clients
You can send email tests directly from the editor and check how are looking on your email clients
Using the device manager you'll always send a fully responsive contents


Rules:
Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold"
- If the player rolls a 1, they score nothing and it becomes the next player's turn.
- If the player rolls any other number, it is added to their turn total and the player's turn continues.
- If a player chooses to "hold", their turn is added to their score, and it becomes the next player's turn.
The first player to score 100 or more points wins.
Click this link to learn more about pig dice game.
Let's play!


To run a query based on an Access command
1 In the runtime list, select one or more entities, for example, one or more classes.
2 Select Access > Query.
The Query dialog box appears.
3 In the text box, enter a legal Access/sw command, for example, the command is get_friends.
To view a list of previously entered queries, click the arrow to the right of the text box.
4 Click OK.
The results appear in the runtime list.
For a description of Access/sw and a list of commands, see the DIScover Access Guide.


Thanks for taking the time to help.
Please select your name, and the subset of events you want to label:
Waiting for backend to wake up...
(This should take about 10 seconds)
Information about what you see in the plots can be found under the "Info" button.
Thanks again and good luck!
Each event in the list at the top is represented by two voltage traces: one from an electrode in the pyramidal cell layer (the top trace), and one from an electrode in the stratum radiatum.
The large plot at the bottom gives more comprehensive view of the current event: all 16 channels are plotted (instead of only two), and the plot ranges from 1000 ms before to 1000 ms after the event.
In this large plot, the blue vertical line marks the currently active event. The grey vertical lines correspond to other detected events. The scalebar at the beginning of this plot represents 1 mV.


Checks whether a language-injection annotation (@Language or derived ones) is valid to be applied to the annotated element. Only elements of type String and String[] may be annotated.
@Language
String
String[]
Powered by IntelliLang


FROM gcr.io/distroless/java:11
COPY target/mvc-demo-bootable.jar /app/main.jar
WORKDIR /app
CMD ["main.jar"]
02 June 2021
Containerization of Java applications is as easy as copying the application's Jar file into a JRE equipped base image. But choosing the right base image can be hard and have a big impact on performance, effectiveness of resource utilization, security and costs. This Blog Post discusses the trend to Distroless base images.
If you’re looking around for an appropriate base image to package your application, you may stumble into the term distroless image. This term was coined by Google, which describes it as
Distroless images contain only your application and its runtime dependencies. They do not contain package managers, shells or any other programs you would expect to find in a standard Linux distribution.
The described approach is best practice and basically means to restrict what’s going into your runtime container to precisely what’s necessary for the application.
Although, distroless images are rather a general principal, Google is still the major supplier of such images. Google provides images for different languages like
Java
Python
JavaScript/NodeJS
Golang
Technically, the distroless base images contain mainly the language platform components, i.e. in case of Java the JDK. Because the JDK is dynamically linked to system libraries like GlibC, these libraries are also contained in the image.
|
The list of supported languages even includes Go. This may be surprising
a little bit at the first glance, because Go applications are usually
linked statically and can be packaged into images |
Before discussing the benefits of applications packaged with distroless images, let’s have a look at the containerization of a sample Java application. I’ll use the Jakarta MVC demo application of one of the last Blog posts, which is packaged as Wildfly Bootable JAR, i.e. as a Single Fat Jar.
The following Dockerfile
just copies the application’s Jar file into the image,
which is based on Google’s distroless image for Java 11:
FROM gcr.io/distroless/java:11
COPY target/mvc-demo-bootable.jar /app/main.jar
WORKDIR /app
CMD ["main.jar"]
Because the java
command is defined as entrypoint of the image, the
application’s Jar can be provided as command.
The regular docker build
command creates the image:
$ docker build -t mvc-app .
Sending build context to Docker daemon 204.7MB
Step 1/4 : FROM gcr.io/distroless/java:11
---> 6395a77cb03c
Step 2/4 : COPY target/mvc-demo-bootable.jar /app/main.jar
---> 2209115d4185
Step 3/4 : WORKDIR /app
---> Running in 5faa7537ec9b
Removing intermediate container 5faa7537ec9b
---> a81720f1f285
Step 4/4 : CMD ["main.jar"]
---> Running in 944c9a473721
Removing intermediate container 944c9a473721
---> d21a6c599d58
Successfully built d21a6c599d58
Successfully tagged mvc-app:latest
This containerized application can be executed on Linux by:
$ docker run --sysctl net.ipv4.ip_forward=1 --network=host -p 8080:8080 --rm -it mvc-app:latest
WARNING: Published ports are discarded when using host network mode
05:26:38,437 INFO [org.wildfly.jar] (main) WFLYJAR0007: Installed server and application in /tmp/wildfly-bootable-server5397933122926229342, took 932ms
05:26:38,684 INFO [org.wildfly.jar] (main) WFLYJAR0008: Server options: [--read-only-server-config=standalone.xml]
05:26:38,806 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
05:26:38,814 INFO [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
05:26:38,979 INFO [org.jboss.as] (MSC service thread 1-3) WFLYSRV0049: WildFly Full 22.0.1.Final (WildFly Core 14.0.1.Final) starting
05:26:39,967 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 15) WFLYRS0016: RESTEasy version 3.14.0.Final
05:26:39,988 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.2.4.Final starting
...
05:26:43,418 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "mvc-demo.war" (runtime-name : "ROOT.war")
05:26:43,449 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
05:26:43,451 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 22.0.1.Final (WildFly Core 14.0.1.Final) started in 4761ms - Started 144 of 149 services (23 services are lazy, passive or on-demand)
Beside the simple and straightforward image build, the generated images are surprisingly small compared to Java application images built on top of distribution based images:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mvc-app latest d21a6c599d58 4 minutes ago 265MB
...
From my experience, the size of application images based on a Linux distribution is about 200 MB larger - the only exception of this are Alpine Linux based images, but these have other drawbacks…
Distroless best resembles the origins of application containers, i.e. packaging applications with its required runtime components in order to
isolate applications in the best possible way
allow resource management like CPU and memory quotas on a per application basis
At the same time it refutes the widespread misconception that containers are a replacement for VMs.
The main attribute of distroless image applications is their small size. And size actually matters because of:
Images are copied, transmitted and launched by fleet managers like Kubernetes. In addition, fitting more containers into one machine means less machine spawns.
Improved security by minimizing the attack surface, because everything in your container, e.g. shells, not used by your application can still be used by attackers.
Fitting more containers into one machine (AKA worker node in Kubernetes) reduces the bill from your cloud provider.
There are situations, in which a shell access to an application’s container may
be convenient. For such situations Google offers a debug version of their
distroless containers, which includes a busybox
in addition. But usually
containerized applications should go without a shell. This may be not possible
for legacy applications brought to the cloud applying a Lift-and-Shift
approach. But cloud-native applications should be designed and implemented in
a way, that shells and other components of a Linux distribution are not required.


#2.0.1 Provider Basics
- Format mimics relational db
- Primary Key not mandatory **
** The exception is if data is bound to a ListView
#<IP_ADDRESS> Accessing Providers
- Requires ContentResolver object
- Provides basic CRUD operations
- Support services (change notifications)
- Exposes ContentProvider methods
- Handles IPC to provider (queries)
#<IP_ADDRESS> ContentResolver
// Get Content Resolver from component "Context"
resolver = getContentResolver();
// Queries the user dictionary and returns results
mCursor = resolver.query(
UserDictionary.Words.CONTENT_URI, // Content URI of table (data)
mProjection, // Columns to return in result
mSelectionClause // Selection criteria condition
mSelectionArgs, // Selection criteria args
mSortOrder // Sort order for results (rows)
);
#<IP_ADDRESS> Core Content Providers
- Browser (bookmarks, history)
- Calendar (events, attendees)
- CallLog (calls received, placed)
- Contacts (address book profiles)
- MediaStore (metadata for audio, video, images)
- Telephony (mms or sms sent, received)
- UserDictionary (predictive text)
See list here
content://user_dictionary/words/4
- Unique data identifier
- Scheme = provider indicator (content://)
- Authority = provider ID ("user_dictionary")
- Path = data name,type ("words")
- ID = specific data item (ID=4)
#<IP_ADDRESS> Retrieving Data
Request access permissions. Construct and run query.
/**
* STEP 1: Request access permissions for specified data
*
* Done in AndroidManifest.xml by declaring
* where requested permission strings are obtained from the list
* declared by the ContentProvider being interacted with
*
*/
/** STEP 2: Construct your query
*
* Running the query returns a results "Cursor" you step through
*
* Analogous to SQL
* SELECT _ID, word, locale --> projection
* FROM words --> content URI
* WHERE word = --> selection clause, args
* ORDER BY word ASC; --> result sort order
*/
// A "projection" defines the columns that will be returned for each row
String[] mProjection =
{
UserDictionary.Words._ID, // Contract class constant for the _ID column name
UserDictionary.Words.WORD, // Contract class constant for the word column name
UserDictionary.Words.LOCALE // Contract class constant for the locale column name
};
// Defines a string to contain the selection clause
String mSelectionClause = null;
// Initializes an array to contain selection arguments
String[] mSelectionArgs = {""};
// Gets a word from the UI
mSearchString = mSearchWord.getText().toString();
// Remember to insert code here to check for invalid or malicious input.
// If the word is the empty string, gets everything
if (TextUtils.isEmpty(mSearchString)) {
// Setting the selection clause to null will return all words
mSelectionClause = null;
mSelectionArgs[0] = "";
} else {
// Constructs a selection clause that matches the word that the user entered.
mSelectionClause = UserDictionary.Words.WORD + " = ?";
// Moves the user's input string to the selection arguments.
mSelectionArgs[0] = mSearchString;
}
// Does a query against the table and returns a Cursor object
mCursor = getContentResolver().query(
UserDictionary.Words.CONTENT_URI, // The content URI of the words table
mProjection, // The columns to return for each row
mSelectionClause // Either null, or the word the user entered
mSelectionArgs, // Either empty, or the string the user entered
mSortOrder); // The sort order for the returned rows
// Some providers return null if an error occurs, others throw an exception
if (null == mCursor) {
/*
* Insert code here to handle the error. Be sure not to use the cursor! You may want to
* call android.util.Log.e() to log this error.
*
*/
// If the Cursor is empty, the provider found no matches
} else if (mCursor.getCount() < 1) {
/*
* Insert code here to notify the user that the search was unsuccessful. This isn't necessarily
* an error. You may want to offer the user the option to insert a new row, or re-type the
* search term.
*/
} else {
// Insert code here to do something with the results
}
#<IP_ADDRESS> Display Query Results
Cursor = random read access to returned result set.
/**
* Cursor returns list of results (rows).
* Bind to ListView with SimpleCursorAdapter (auto-populates list)
*/
/* Defines a list of columns to retrieve from the Cursor and load into an output row */
String[] mWordListColumns =
{
UserDictionary.Words.WORD, // Contract class constant containing the word column name
UserDictionary.Words.LOCALE // Contract class constant containing the locale column name
};
/* Defines a list of View IDs that will receive the Cursor columns for each row */
int[] mWordListItems = { R.id.dictWord, R.id.locale};
/* Creates a new SimpleCursorAdapter */
mCursorAdapter = new SimpleCursorAdapter(
getApplicationContext(), // The application Context object
R.layout.wordlistrow, // A layout in XML for one row in the ListView
mCursor, // The result from the query
mWordListColumns, // A string array of column names in the cursor
mWordListItems, // An integer array of view IDs in the row layout
0); // Flags (usually none are needed)
/* Sets the adapter for the ListView */
mWordList.setAdapter(mCursorAdapter);
#<IP_ADDRESS> Inserting Data
ContentResolver.insert() --> get URI for inserted item
/**
* Returned value of insert is a content URI to new item in format:
* Uri newItem = content://user_dictionary/words/
* Provider here automatically generates new _ID for item and creates Uri
*
* To retrieve the _ID from this use
* ContentUris.parseId(newUri)
*/
/* Defines a new Uri object that receives the result of the insertion */
Uri mNewUri;
...
/* Defines an object to contain the new values to insert */
ContentValues mNewValues = new ContentValues();
/*
* Sets the values of each column and inserts the word. The arguments to the "put"
* method are "column name" and "value"
*/
mNewValues.put(UserDictionary.Words.APP_ID, "example.user");
mNewValues.put(UserDictionary.Words.LOCALE, "en_US");
mNewValues.put(UserDictionary.Words.WORD, "insert");
mNewValues.put(UserDictionary.Words.FREQUENCY, "100");
mNewUri = getContentResolver().insert(
UserDictionary.Word.CONTENT_URI, // the user dictionary content URI
mNewValues // the values to insert
);
#<IP_ADDRESS> Updating Data
/*
* Defines an object to contain the updated values
* Each object corresponds to one data row
*/
ContentValues mUpdateValues = new ContentValues();
/* Defines selection criteria for the rows you want to update */
String mSelectionClause = UserDictionary.Words.LOCALE + "LIKE ?";
String[] mSelectionArgs = {"en_%"};
/* Defines a variable to contain the number of updated rows */
int mRowsUpdated = 0;
...
/*
* Sets the updated value and updates the selected words.
*/
mUpdateValues.putNull(UserDictionary.Words.LOCALE);
/* Method returns number of rows updated */
mRowsUpdated = getContentResolver().update(
UserDictionary.Words.CONTENT_URI, // the user dictionary content URI
mUpdateValues // the columns to update
mSelectionClause // the column to select on
mSelectionArgs // the value to compare to
);
#<IP_ADDRESS> Deleting Data
/* Defines selection criteria for the rows you want to delete */
String mSelectionClause = UserDictionary.Words.APP_ID + " LIKE ?";
String[] mSelectionArgs = {"user"};
/* Defines a variable to contain the number of rows deleted */
int mRowsDeleted = 0;
...
/*
* Deletes the words that match the selection criteria
* Returns number of rows deleted
*/
mRowsDeleted = getContentResolver().delete(
UserDictionary.Words.CONTENT_URI, // the user dictionary content URI
mSelectionClause // the column to select on
mSelectionArgs // the value to compare to
);
#<IP_ADDRESS> Alternative Access Options
- Batch Accesses (1 transaction, Array result)
- Asynchronous Queries (CursorLoader)
- Via Intents (Delegation) **
Caller can get limited access to specific data without user permission
Ex: Request another app with permissions to do the work and return results
The called app can grant caller permissions to access 'only' these uris by setting flag in Intent result.
The permissions then last only until the current Activity is complete.


An unexpectedly bad situation, program, programmer, or person. Someone
who habitually loses. (Even winners can lose occasionally.) Someone who
knows not and knows not that he knows not.  See `*luser* `__.
--------------
+------------------------------+----------------------------+---------------------------+
| `Prev `__ | `Up <../L.html>`__ | `Next `__ |
+------------------------------+----------------------------+---------------------------+
| lose lose | `Home <../index.html>`__ | losing |
+------------------------------+----------------------------+---------------------------+


2 dead in camper trailer, possible carbon monoxide poisoning
THE DALLES, Ore. (AP) - Authorities say two people and a dog were found dead in a camper trailer outside The Dalles and that carbon monoxide poisoning may have been a factor in their deaths.
Wasco County Sheriff’s detective Sgt. Jeff Hall says Yamhill County authorities on Tuesday requested help to find 47-year-old Deon Louise Patterson and 48-year-old Brian Thomas Paulsen who had been reported missing by family members.
Hall says deputies went to an area outside The Dalles where Patterson was known to camp and found Paulsen’s pickup and camper trailer on a property near a cabin.
TOP STORIES
Reckoning coming for Adam Schiff for impeachment inquiry
Franklin Graham calls on nation to pray for Trump as impeachment effort gains speed
Trump 'war room' launches scathing Pelosi video
Hall says deputies found them dead in the trailer along with a dog. He says evidence suggests carbon monoxide was a factor.
Law enforcement and medical examiners are investigating.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Line Items
Description
Quantity
Cost {{currencySymbol}}
Total
Sub Total
{{invoiceSubTotal() | currency: currencySymbol}}
Tax(%):
{{calculateTax() | currency: currencySymbol}}
Grand Total:
{{calculateGrandTotal() | currency: currencySymbol}}


Trump says daughter Ivanka has created "created 14 million jobs"
by Mark FrauenfelderTrump spoke at the Economic Club of New York today and surprised attendees with the good news that his daughter Ivanka has created "created 14 million jobs" in the United States. That's almost 10% of the US workforce. Thanks, Ivanka!
From The Intelligencer:
At a speech to the Economic Club of New York today, President Trump declared that his daughter, Ivanka, has personally created 14 million new jobs. The president announced this figure — so astonishingly ludicrous it would embarrass a Stalin-era pronouncement — and then repeated it twice more as the crowd applauded politely.
The entire U.S. economy has created fewer than 6 million new jobs since Trump took office. So Trump is crediting his daughter with having personally created more than 200 percent of all new jobs in the United States. This is like supply-side economics but for authoritarian nepotism.
Image: Mark Frauenfelder. Attribution 2.0 Generic (CC BY 2.0)


Two boxes below should be stacked vertically at the top, the third should be at the bottom of its container


outerHeight() - returns the outer height of an element (includes padding and border).
outerHeight(true) - returns the outer height of an element (includes padding, border and margin).


To predict whether Income of a person lies in the category of "<=50K" or ">50k" by training the model with different Machine Learning classification algorithms using the given columns of information.
Adult Income dataset was extracted by Barry Becker from 1994 US Census Database.This dataset consists of anonymous information such as age, occupation, education, race, work class, native_country, capital gain and loss and census income of two categories i.e, ">50K" or "<=50K".
Get the best algorithm model that predicts the Annual Income the best and Save that Model for future Deployement.
| Name | Description |
|---|---|
| Age | Age |
| Work Class | Work Catetegory |
| fnlwgt | Final Weight |
| Education | Highest Education Persued |
| Education Number | Number Acc. to Education |
| Marital Status | Marital Status |
| Occupation | Occupation |
| Relationship | Each Adult's Relation in their family |
| Race | Race of individual |
| Sex | Gender of Individual |
| Capital Gain | Capital Gain of Adult |
| Capital Loss | Capital Loss of Adult |
| Hours per Week | Individual Adult's Working Hours per Week |
| Native Country | Native Country |
| Census Income | Annual Income of Adult |


Veteran with service dog denied entry to Pittsburgh restaurant
by Gerren Keith GaynorA combat veteran who suffers from PTSD said he was denied access to a Pittsburgh restaurant on Thursday because of his service dog.
Kris Jones accused the owner of The Huddle restaurant of stopping him; his Dutch Shepherd, Chopper; and a friend from entering the establishment.
"He's very important to me. He's definitely my lifeline," Jones said about his furry companion, according to WTAE.
TEXAS POLICE ASK PUBLIC FOR HELP AFTER VETERAN'S SERVICE DOG STOLEN
"He makes me feel safe. A lot of veterans, you don't want to be alone, when you're going into a public place or a restaurant, it can be pretty stressful.”
Jones enlisted in the Marines after the Sept. 11 attacks. He was injured during combat and later diagnosed with PTSD.
Chopper, he said, changed his life for the better.
STATUE OF SULLY, SERVICE DOG FOR LATE GEORGE H.W. BUSH, TO BE UNVEILED NEXT MONTH
Jones admitted Chopper wasn’t wearing his service dog vest but did have on his collar. However, he said was never given a chance to show documentation that Chopper was a service dog.
The owner of The Huddle, Pete Wagner, later said that he made a mistake.
Wagner said his business often accommodates service dogs, but he failed to realize Chopper was a service dog because the restaurant was crowded on the night Jones came in, due to a Steelers game.
Jones said he wants the incident to be a lesson to others about the reality for many veterans and people suffering from PTSD.
FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS
"I want business owners, people, everywhere, children, everywhere to know that PTSD is a big thing,” he said.
“A lot of veterans come home and people can look OK and look fine, but you don’t know what’s going on on the inside.”


|
LUFA Library
111009
|
USB Host definitions for the AVR8 microcontrollers. More...
Macros | |
| #define | USB_HOST_DEVICEADDRESS 1 |
| #define | HOST_DEVICE_SETTLE_DELAY_MS 1000 |
Enumerations | |
| enum | USB_Host_ErrorCodes_t { HOST_ERROR_VBusVoltageDip = 0, HOST_ERROR_VBusVoltageDip = 0 } |
| enum | USB_Host_EnumerationErrorCodes_t { HOST_ENUMERROR_NoError = 0, HOST_ENUMERROR_WaitStage = 1, HOST_ENUMERROR_NoDeviceDetected = 2, HOST_ENUMERROR_ControlError = 3, HOST_ENUMERROR_PipeConfigError = 4, HOST_ENUMERROR_NoError = 0, HOST_ENUMERROR_WaitStage = 1, HOST_ENUMERROR_NoDeviceDetected = 2, HOST_ENUMERROR_ControlError = 3, HOST_ENUMERROR_PipeConfigError = 4 } |
Functions | |
| static uint16_t | USB_Host_GetFrameNumber (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
| static void | USB_Host_EnableSOFEvents (void) ATTR_ALWAYS_INLINE |
| static void | USB_Host_DisableSOFEvents (void) ATTR_ALWAYS_INLINE |
| static void | USB_Host_ResetBus (void) ATTR_ALWAYS_INLINE |
| static bool | USB_Host_IsBusResetComplete (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
| static void | USB_Host_ResumeBus (void) ATTR_ALWAYS_INLINE |
| static void | USB_Host_SuspendBus (void) ATTR_ALWAYS_INLINE |
| static bool | USB_Host_IsBusSuspended (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
| static bool | USB_Host_IsDeviceFullSpeed (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
| static bool | USB_Host_IsRemoteWakeupSent (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
| static void | USB_Host_ClearRemoteWakeupSent (void) ATTR_ALWAYS_INLINE |
| static void | USB_Host_ResumeFromWakeupRequest (void) ATTR_ALWAYS_INLINE |
| static bool | USB_Host_IsResumeFromWakeupRequestSent (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE |
Architecture specific USB Host definitions for the Atmel 8-bit AVR microcontrollers.
| #define HOST_DEVICE_SETTLE_DELAY_MS 1000 |
Constant for the delay in milliseconds after a device is connected before the library will start the enumeration process. Some devices require a delay of up to 5 seconds after connection before the enumeration process can start or incorrect operation will occur.
The default delay value may be overridden in the user project makefile by defining the HOST_DEVICE_SETTLE_DELAY_MS
token to the required delay in milliseconds, and passed to the compiler using the -D switch.
| #define USB_HOST_DEVICEADDRESS 1 |
Indicates the fixed USB device address which any attached device is enumerated to when in host mode. As only one USB device may be attached to the AVR in host mode at any one time and that the address used is not important (other than the fact that it is non-zero), a fixed value is specified by the library.
Enum for the error codes for the EVENT_USB_Host_DeviceEnumerationFailed() event.
| Enumerator | |
|---|---|
| HOST_ENUMERROR_NoError | No error occurred. Used internally, this is not a valid ErrorCode parameter value for the EVENT_USB_Host_DeviceEnumerationFailed() event. |
| HOST_ENUMERROR_WaitStage | One of the delays between enumeration steps failed to complete successfully, due to a timeout or other error. |
| HOST_ENUMERROR_NoDeviceDetected | No device was detected, despite the USB data lines indicating the attachment of a device. |
| HOST_ENUMERROR_ControlError | One of the enumeration control requests failed to complete successfully. |
| HOST_ENUMERROR_PipeConfigError | The default control pipe (address 0) failed to configure correctly. |
| HOST_ENUMERROR_NoError | No error occurred. Used internally, this is not a valid ErrorCode parameter value for the EVENT_USB_Host_DeviceEnumerationFailed() event. |
| HOST_ENUMERROR_WaitStage | One of the delays between enumeration steps failed to complete successfully, due to a timeout or other error. |
| HOST_ENUMERROR_NoDeviceDetected | No device was detected, despite the USB data lines indicating the attachment of a device. |
| HOST_ENUMERROR_ControlError | One of the enumeration control requests failed to complete successfully. |
| HOST_ENUMERROR_PipeConfigError | The default control pipe (address 0) failed to configure correctly. |
Enum for the error codes for the EVENT_USB_Host_HostError() event.
|
inlinestatic |
Clears the flag indicating that a Remote Wakeup request has been issued by an attached device.
|
inlinestatic |
Disables the host mode Start Of Frame events. When disabled, this stops the firing of the EVENT_USB_Host_StartOfFrame() event when enumerated in host mode.
|
inlinestatic |
Enables the host mode Start Of Frame events. When enabled, this causes the EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus, at the start of each USB frame when a device is enumerated while in host mode.
NO_SOF_EVENTS
compile time token is defined.
|
inlinestatic |
Returns the current USB frame number, when in host mode. Every millisecond the USB bus is active (i.e. not suspended) the frame number is incremented by one.
|
inlinestatic |
Determines if a previously issued bus reset (via the USB_Host_ResetBus() macro) has completed.
true
if no bus reset is currently being sent, false
otherwise.
|
inlinestatic |
Determines if the USB bus has been suspended via the use of the USB_Host_SuspendBus() macro, false otherwise. While suspended, no USB communications can occur until the bus is resumed, except for the Remote Wakeup event from the device if supported.
true
if the bus is currently suspended, false
otherwise.
|
inlinestatic |
Determines if the attached device is currently enumerated in Full Speed mode (12Mb/s), or false if the attached device is enumerated in Low Speed mode (1.5Mb/s).
true
if the attached device is enumerated in Full Speed mode, false
otherwise.
|
inlinestatic |
Determines if the attached device is currently issuing a Remote Wakeup request, requesting that the host resume the USB bus and wake up the device, false otherwise.
true
if the attached device has sent a Remote Wakeup request, false
otherwise.
|
inlinestatic |
Determines if a resume from Remote Wakeup request is currently being sent to an attached device.
true
if no resume request is currently being sent, false
otherwise.
|
inlinestatic |
Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host. USB bus resets leave the default control pipe configured (if already configured).
If the USB bus has been suspended prior to issuing a bus reset, the attached device will be woken up automatically and the bus resumed after the reset has been correctly issued.
|
inlinestatic |
Resumes USB communications with an attached and enumerated device, by resuming the transmission of the 1MS Start Of Frame messages to the device. When resumed, USB communications between the host and attached device may occur.
|
inlinestatic |
Accepts a Remote Wakeup request from an attached device. This must be issued in response to a device's Remote Wakeup request within 2ms for the request to be accepted and the bus to be resumed.
|
inlinestatic |
Suspends the USB bus, preventing any communications from occurring between the host and attached device until the bus has been resumed. This stops the transmission of the 1MS Start Of Frame messages to the device.


Almost to the Cookie
Could you type your name:
Note: This site is using Google Drive as a server which does not yet support Python cgi files.
To test this funtionality, please go
here
.


Product Illustrations for Swipes Simple illustrations of the Alexander Nevski Cathedral and the National Palace of Culture in Sofia, Bulgaria and the Rosenborg castle in Copenhagen, Denmark.Exploring different architectural styles.
Vacationing with your pet Just you and your pet, no work, no "no pets allowed signs" and presumably a lot of cool selfies.
Simple Building illustration Simple illustrations of the Alexander Nevski Cathedral and the National Palace of Culture in Sofia, Bulgaria and the Rosenborg castle in Copenhagen, Denmark.Exploring different architectural styles.


Lifion by ADP is a company who has a metadata driven platform that places importance on scalable Human Capital Management solutions. Their Standout product drives conversations around work priorities, needs, and accomplishments on web and mobile.
React Native, Android Studio, Xcode, Mobile APIs, Jira, Trello, Confluence
Technical Product Owner, Product Management, Mobile Development, Product Design
4 Month Internship
During this internship, I got to drive and own the weekly check-in feature set within the mobile domain.
The Weekly Check-in mobile product was a complex product set that was executed across multiple teams.
By the end of the internship, the weekly check-in features were planned for release including historical check-ins, which included previous conversations between
team lead and team member.
I was tasked to launch and release most weekly check-in features by the end of my coop term. This involved working with senior engineers, collaborating with subject matter experts across the organization and working with designers to
build out a synchronized cross-device experience for both mobile and web.
Build out Weekly Check-in features for the Lifion mobile application.
At Lifion by ADP, I was given the oppourtunity to:
The Lifion App has been released to the Google Play store and the App store with full-fledged weekly check-in features.
The features aim to drive work conversations and retain talent at workplaces.
Weekly Check-in consisted of various features which included a team member's ability to complete a check-in, the conversational experience
between a team member and their team leaders, and the ability to acknowledge and mark priorities as completed. In addtion to current check-ins, it was important to build
out the historical check-ins experience where a team lead and team manager can view past check-ins, but not have a conversational experience.
The sub-set of features included an end-to-end completion of weekly check-in, commenting and replying to an overall check-in or specific priorities, and
historical check-ins. I can speak to each part of the design process, but this would take all day!
So, check out the functionality study of the designs from a team member and team leader prespective which was helps understand the weekly check-in features!


The CSlib currently supports 4 messaging protocols or "modes" of code-to-code coupling:
The file mode sends messages by writing/reading binary files.
The zmq mode is implemented using the open-soure ZeroMQ socket library, referred to in this manual as ZMQ.
The two mpi modes send messages via the distributed-memory message passing interface (MPI). They differ only in how the two applications (apps) are launched via MPI's mpirun or mpiexec command and in how the MPI_COMM_WORLD communicator and processor ranks are assigned to each app.
From the app's persepective (client or server code) all these modes function identically. The same calls are made to the CSlib, other than arguments to the constructor that chooses the messaging mode. For the "mpi/one" mode each application may also want to split the MPI communicator (MPI_COMM_WORLD) so that each app runs in its own communicator. This is discussed in this section.
In the CSlib, a "message" has a numeric ID and can contain zero or more "fields". A field contains zero or more datums of a single "type". A type is an integer or floating-point value with 32-bit or 64-bit precision. Character strings are also supported. Arbitrary byte sequences may be supported in a future release.
When a client or server code is run in parallel as a distributed-memory app, using MPI, only one of its processors participates in the CSlib messaging. In MPI parlance, the proc 0 of one code communicates with the proc 0 of the other, either by files, via a socket, or via MPI sends and receives.
However, all processors in each app call the CSlib functions simultaneously. They can format their messages in one of 2 ways. For sending, all processors can provide a copy of the same send data. Or if the data is distributed across the processors, each can provide its portion to the send() call. Likewise when the recv() is called, all processors can receive a copy of the entire message. Or if the data is meant to be distributed, each can receive its portion. The CSlib communicates data via MPI within the client and server apps to accomplish this.


sphinxSimDoc¶
A collection of simple docs built from scratch using sampledocs from Sphinx and also by using Sphinx.
Details¶
| Author: | Anirban Roy Das |
|---|---|
| Email: |<EMAIL_ADDRESS>|
| Copyright(C): | 2016, Anirban Roy Das<EMAIL_ADDRESS>|
Check sphinxSimDoc/LICENSE file for full Copyright notice.
Overview¶
Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license.
Sphinx is far and away the most popular Python documentation tool. Use it. It converts reStructuredText markup language into a range of output formats including HTML, LaTeX (for printable PDF versions), manual pages, and plain text.
reStructuredText¶
Most Python documentation is written with reStructuredText. It’s like Markdown with all the optional extensions built in.
The reStructuredText Primer and the reStructuredText Quick Reference should help you familiarize yourself with its syntax.
Technical Specs¶
| sphinx: | The Documentation building tool |
|---|---|
| python: | The python language implementation |
| pip: | The python package installation tool (Optional but recommended) |
Installation¶
pip install sphinx
For installing pip, follow the bellow methods:
- Method 1 - https://pip.pypa.io/en/stable/installing/
- Method 2 - http://ask.xmodulo.com/install-pip-linux.html
- Method 3 - If you installed python on MAC OS X via
brew install python
, then pip is already installed along with python.
Usage¶
Go to the documentation page created by this documentation itself, its recursive, but the documentation helps in created this doumentation itself.
TODO¶
- Add Blog Post regarding this topic.


Summer Sets
Makeup sets allow for an all-in-one product that places our favorite products and colors together. Not only are these efficient,
keeping items neatly together amidst other products in your beauty collection, but these kits have been expertly crafted by our store.
Product description
Murad Set
Skin care products with lipstick
Quick viewFresh
Makeup Gift Set
Quick viewLiving Proof
Ban Brassiness Mini Transformation Kit
Quick viewOur Promise
Inspired by nature and its rich elements in sustaining life, our shop
unfolds nature's boundless secrets and delivers the gift of vitality to your skin.


Keep Password
Yes
No
Log Level
Trace
Info
Error
Max Protocol Version
SMB1/CIFS
SMB2
LMCompatibilityLevel
0
1
2
3
4
5
Service List


An article
13th October 2017
I’ve heard the comment more than once that tinned pears are the least exciting of the tinned fruits….pale, bland, only good when topped with ice cream. I had a hunch that this was wrong, but how to prove it? By coupling tinned pears with brown sugar, butter and cinnamon, that’s how.


US Open
Introduction
The American FootGolf League (AFGL) and River Ridge Golf Course hosted the 2018 U.S. Open in Oxnard, CA on April 26th - 29th. The tournament saw players attend from all over the world for the first major of the FIFG World Tour. The course was very difficult as it was both long (~3600 yds), sloped, fast, and occassionally windy.
I played in the tournament myself, albeit not well, and anecdotally found that certain holes were more troublesome than others, especially depending on time of day (ex, windy). As is the case in all tournaments there is always commiseration after the round and talk about the holes that ruined it all. I thought to myself, I wonder if the scores would reflect the sentiment people had of certain holes? Did a majority also suffer on Hole X? Did the time of day affect that?
This little analysis seeks to help shed some light on that as well as other fun statistics about the event. Hope you enjoy.
Data
All the charts you see here are created from a limited dataset. The dataset consists of the top 100 men’s players. This is for few reasons: 1) It’s difficult and takes time to scrape, clean, and format the data 2) 100 players is a reasonable enough sample size 3) I needed a large enough sample size of players kicking from the same tees in case I wanted to do significance testing. Unfortunately Senior’s or Women’s division couldn’t provide that. I’m optimistic that will change in the future.
Summary Stats
| hole | par | avg.score | better | eagles | birdies | pars | bogeys | doubles | worse | par.avg |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 4 | 5.363 | 0 | 0 | 1 | 57 | 143 | 62 | 37 | 1.363 |
| 2 | 4 | 4.407 | 0 | 2 | 27 | 144 | 104 | 20 | 3 | 0.407 |
| 3 | 4 | 3.080 | 0 | 69 | 164 | 48 | 14 | 3 | 2 | -0.920 |
| 4 | 5 | 5.900 | 0 | 1 | 6 | 91 | 148 | 39 | 15 | 0.900 |
| 5 | 3 | 3.140 | 0 | 0 | 26 | 213 | 54 | 7 | 0 | 0.140 |
| 6 | 5 | 5.423 | 0 | 1 | 44 | 113 | 113 | 27 | 2 | 0.423 |
| 7 | 4 | 4.757 | 0 | 0 | 9 | 117 | 123 | 43 | 8 | 0.757 |
| 8 | 3 | 3.793 | 0 | 0 | 5 | 87 | 175 | 31 | 2 | 0.793 |
| 9 | 4 | 5.110 | 0 | 0 | 4 | 66 | 149 | 61 | 20 | 1.110 |
| 10 | 4 | 4.650 | 0 | 1 | 11 | 131 | 120 | 25 | 12 | 0.650 |
| 11 | 5 | 4.927 | 0 | 8 | 92 | 131 | 55 | 12 | 2 | -0.073 |
| 12 | 3 | 3.340 | 0 | 1 | 19 | 185 | 70 | 22 | 3 | 0.340 |
| 13 | 4 | 3.863 | 0 | 3 | 88 | 169 | 31 | 5 | 4 | -0.137 |
| 14 | 5 | 4.617 | 0 | 10 | 132 | 122 | 35 | 1 | 0 | -0.383 |
| 15 | 4 | 4.337 | 0 | 4 | 40 | 140 | 90 | 20 | 6 | 0.337 |
| 16 | 4 | 4.020 | 0 | 1 | 78 | 154 | 52 | 11 | 4 | 0.020 |
| 17 | 4 | 4.203 | 0 | 0 | 35 | 179 | 76 | 10 | 0 | 0.203 |
| 18 | 3 | 2.920 | 0 | 2 | 55 | 212 | 28 | 2 | 1 | -0.080 |
How were the scores distributed per round?
Mean scores per round were near identical with day 2 showing slightly, but not significant, improved results. Day 3 was the worst.| round | mean.score |
|---|---|
| 1 | 0.325 |
How were the scores distributed per hole?
Holes 1 and 9 show the highest mean scores. The series of 7,8,9 was quite a gauntlet on it’s own as well. Hole 3 was the easiest.
| hole | mean.score |
|---|---|
| 1 | 1.3633333 |
| 2 | 0.4066667 |
| 3 | -0.9200000 |
| 4 | 0.9000000 |
| 5 | 0.1400000 |
| 6 | 0.4233333 |
| 7 | 0.7566667 |
| 8 | 0.7933333 |
| 9 | 1.1100000 |
| 10 | 0.6500000 |
| 11 | -0.0733333 |
| 12 | 0.3400000 |
| 13 | -0.1366667 |
| 14 | -0.3833333 |
| 15 | 0.3366667 |
| 16 | 0.0200000 |
| 17 | 0.2033333 |
| 18 | -0.0800000 |
How were the scores distributed per hole per round?
The holes played pretty consistently over the three rounds. Hole 1 on round 1 and round 3 seems to have caused a lot of trouble.
| hole | round | mean.score |
|---|---|---|
| 1 | 1 | 1.3633333 |
| 2 | 1 | 0.4066667 |
| 3 | 1 | -0.9200000 |
| 4 | 1 | 0.9000000 |
| 5 | 1 | 0.1400000 |
| 6 | 1 | 0.4233333 |
| 7 | 1 | 0.7566667 |
| 8 | 1 | 0.7933333 |
| 9 | 1 | 1.1100000 |
| 10 | 1 | 0.6500000 |
| 11 | 1 | -0.0733333 |
| 12 | 1 | 0.3400000 |
| 13 | 1 | -0.1366667 |
| 14 | 1 | -0.3833333 |
| 15 | 1 | 0.3366667 |
| 16 | 1 | 0.0200000 |
| 17 | 1 | 0.2033333 |
| 18 | 1 | -0.0800000 |
Did time of day have an impact on scoring?
Although I haven’t run any significance testing on it, it seems that the time of day one played the hole did have an impact on certain holes. On Hole 1 for example, we can see that the mean score went from near 1 over par in the morning to 2 over par by 1pm. Other holes had the opposite results. Hole 11 seems to have gotten better later in the day.


Shifts in China’s wealth landscape
by Ko Tin-yauFor the year ended 2018, Hurun has pointed out some interesting changes in China’s wealth distribution.
While the number of Chinese families owning at least 6 million yuan (US$853,500) has increased, the population of super and ultra-rich families has shrunk, according to the China-based research house and wealth tracker.
Hurun divides Chinese households into four groups, namely rich families (6 million yuan assets), high-net worth families (10 million yuan assets), ultra-high net worth families (assets worth 100 million yuan) and international high net worth families (assets of US$30 million).
By the end of last year, there were 3.92 million rich families, 1.58 million high-net worth families, 105,000 ultra-high net worth families and 69,000 international high-net worth families.
The number of rich families increased 1.3 percent last year while the other three groups showed contraction of 1.8 percent, 5.1 percent and 6 percent respectively.
How should we interpret this data?
Last year, the Shanghai and Shenzhen stock markets slumped 24.6 percent and 34.4 percent respectively, against the backdrop of US-China trade tensions and weakening global economic growth. As a result, China’s overall stock market capitalization dropped by 14 trillion yuan.
As the super-rich tend to allocate more assets to the stock market and many wealthy people are themselves major shareholders of listed companies, the very-high net worth people are naturally more affected.
But at the same time, as China’s economy continued to grow against all odds, the number of middle class families kept swelling, as reflected in the gain of rich families as defined by Hurun.
This year, the Shanghai and Shenzhen markets have jumped 17.3 percent and 38.4 percent respectively so far. A rebound in the number of super and ultra-rich families is almost a given.
This article appeared in the Hong Kong Economic Journal on Nov 21
Translation by Julie Zhu
– Contact us at<EMAIL_ADDRESS>RC


$\mu_q$:
0
$\sigma_q$:
$c$:
Current $\sum_{i=1}^{M} x_i$:
0.0
Current $M$:
Current estimate of $\mathbb{E}_{x \sim p} [x]$:
Current acceptance rate:
Error: there are regions where $c\widetilde{q\hspace{0.15em}}(x) \leq \widetilde{p\hspace{0.1em}}(x)$. Try increasing $c$.


Course: Software Project Development Management
Role: Project Manager / UX Designer
Team: Kuba Haladus, Stephanie Hudon Hagan, John Valin, Kayanne Bryant, Noah Berthusen, Mohona Sengupta
Objectives: Create a startup to deliver a technological product to the city of Leganes, aiming to enhance the infrastructure in some significant way.
Read on to understand the business, or skip to the UX Ideation
All my team started with was a list of possible categories that our product could span. We realized that our business could define itself a health and welfare application that would aggregate similar concerns under a single domain. We created InteliMed, a tech firm that would deliver a complete application for the city board to distribute to their citizens.
Our business had to follow the European business standard in Madrid. Rather than using Agile, we were using the ESA methodology, an European waterfall-like process that centers around heavy documentation. Out of the twelve documents, I've highlighted the three that I was responsible for as PM and UX Designer:
I found very little time to truly ideate on the design of the application, as most of the semester was focused on the business side of our product.
However, eventually it came time to put together an interactive high fidelity wireframe.
Our user interviews gave us a good idea of what the application would need in order to be useful for the people of Leganes.
From those insights, my team and I were able to come up with a list of features per each category.
My next problem was deciding the hierarchy of options. If you were a normal person living in Leganes,
what would you want to see first? Why are you looking at the app in the first place? My main problem was that
I had to step into the mindset of not just a different person, but a different culture. So, I fell back on what I did know: personas.
Takeaways: My personas help me arrive at a few important insights: safety is a big concern, especially in a city.
The alert system would be most important to see immediately, so families feel that they know what’s going on in their neighborhood.
All the time-sensitive features, like daily goals and quick chat options must be easily found. I also realized that navigation must be easily
understandable and airtight, so every citizens from an elderly grandma to a teen could quickly find what they need.
I finally had an idea of how the information in the application should be organized, so I began sketching out the possibilities.
As a team, we decided that the interaction we wanted to showcase most was a user logging in to their home page,
swiping away an alert notification, and entering the quick chat feature with a doctor. I tried to iterate through ideas of how to lay out
the home page, as it felt like the hardest challenge.
Finally, I was ready to begin work on the high fidelity wireframes.
This was one of the most difficult projects I’ve produced, and doubly so because I was producing for a userbase that I didn’t quite understand. Study abroad not only brought me a better understanding of Spanish culture, but of the European business standard. The UX was honestly the easiest part—being a PM was tougher than I ever imagined. This was my first experience with budgeting for business, with directing a team, and making sure we not just delivered on time but on quality as well. At the end of the semester, not only was I incredibly proud of the product, but I was incredibly proud of my team as well.


--- layout: default route: changelog title: Changelog subtitle: Find the record of all the changes made to the template, such as new features, bug fixes, improvements, etc. ---
Initial release


Segmenting NBA players into groups with similar traits.
NBA: Grouping Players with K-Means
Segmenting NBA players into groups with similar traits.
1. The Data
We will be using the dataset of player performance from the 2013-2014 season.
Below is our Data Dictionary:
| Columns | Definition |
|---|---|
| player | name of the player |
| pos | the position of the player |
| g | number of games the player was in |
| pts | total points the player scored |
| fg. | field goal percentage |
| ft. | free throw percentage |
import numpy as np
import pandas as pd
nba = pd.read_csv("nba_2013.csv")
nba.head(3)
| player | pos | age | bref_team_id | g | gs | mp | fg | fga | fg. | ... | drb | trb | ast | stl | blk | tov | pf | pts | season | season_end | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Quincy Acy | SF | 23 | TOT | 63 | 0 | 847 | 66 | 141 | 0.468 | ... | 144 | 216 | 28 | 23 | 26 | 30 | 122 | 171 | 2013-2014 | 2013 |
| 1 | Steven Adams | C | 20 | OKC | 81 | 20 | 1197 | 93 | 185 | 0.503 | ... | 190 | 332 | 43 | 40 | 57 | 71 | 203 | 265 | 2013-2014 | 2013 |
| 2 | Jeff Adrien | PF | 27 | TOT | 53 | 12 | 961 | 143 | 275 | 0.520 | ... | 204 | 306 | 38 | 24 | 36 | 39 | 108 | 362 | 2013-2014 | 2013 |
3 rows × 31 columns
2. Point Guards
Point guards play one of the most crucial roles on a team because their primary responsibility is to create scoring opportunities for the team. We are going to focus our lesson on a machine learning technique called clustering, which allows us to visualize the types of point guards as well as group similar point guards together. For point guards, it’s widely accepted that the Assist to Turnover Ratio
is a good indicator for performance in games as it quantifies the number of scoring opportunities that player created. We will also use Points Per Game
, since effective Point Guards not only set up scoring opportunities but also take a lot of the shots themselves.
point_guards = nba[nba['pos'] == 'PG']
2.1 Points Per Game
Our dataset doesn’t come with Points Per Game values, so we will need to calculate those values using each player’s total points (pts
) and the number of games (g
) they played.
point_guards['ppg'] = point_guards['pts'] / point_guards['g']
# Double check and make sure ppg = pts/g
point_guards[['pts', 'g', 'ppg']].head()
| pts | g | ppg | |
|---|---|---|---|
| 24 | 930 | 71 | 13.098592 |
| 29 | 150 | 20 | 7.500000 |
| 30 | 660 | 79 | 8.354430 |
| 38 | 666 | 72 | 9.250000 |
| 50 | 378 | 55 | 6.872727 |
2.2 Assist Turnover Ration
We also need to create a column, atr
, for the Assist Turnover Ratio, which is calculated by dividing total assists (ast
) by total turnovers (tov
):
point_guards = point_guards[point_guards['tov'] != 0]
point_guards['atr'] = point_guards['ast'] / point_guards['tov']
2.3 Visualizing Point Guards
Using matplotlib we can create a scatter plot with Points Per Game (ppg)
on the X axis
and Assist Turnover Ratio (atr)
on the Y axis
.
import matplotlib.pyplot as plt
plt.scatter(point_guards['ppg'], point_guards['atr'], c='y')
plt.title("Point Guards")
plt.xlabel('Points Per Game', fontsize=13)
plt.ylabel('Assist Turnover Ratio', fontsize=13)
plt.show()
3. Clustering Players
There seem to be 5 general regions, or clusters, that the point guards fall into (with a few outliers). We will use a technique called clustering to segment all of the point guards into groups of alike players. While regression and other supervised machine learning techniques work well when we have a clear metric we want to optimize for and lots of pre-labelled data, we need to instead use unsupervised machine learning techniques to explore the structure within a data set that doesn’t have a clear value to optimize.
There are multiple ways of clustering data, here we will utilize centroid based clustering. Centroid based clustering works well when the clusters resemble circles with centers (or centroids). The centroid represent the arithmetic mean of all of the data points in that cluster.
K-Means
Clustering is a popular centroid-based clustering
algorithm that we will use. The K
in K-Means
refers to the number of clusters we want to segment our data into. The key part with K-Means
(and most unsupervised machine learning techniques) is that we have to specify what k
is. There are advantages and disadvantages to this, but one advantage is that we can pick the k
that makes the most sense for our use case. We will set k
to 5
since we want K-Means
to segment our data into 5 clusters
.
4. The Algorithm
K-Means
is an iterative algorithm that switches between recalculating the centroid of each cluster and the players that belong to that cluster. To start, we will select 5 players at random and assign their coordinates as the initial centroids of the just created clusters.
Our course of action is followed:
Step 1
(Assign Points to Clusters) For each player, we will calculate the Euclidean distance between that player’s coordinates, or values for atr
& ppg
, and each of the centroids’ coordinates. Assign the player to the cluster whose centroid is the closest to, or has the lowest Euclidean distance to, the player’s values.
Step 2
(Update New Centroids of the Clusters) For each cluster, we will compute the new centroid by calculating the arithmetic mean of all of the points (players) in that cluster. We calculate the arithmetic mean by taking the average of all of the X values (atr
) and the average of all of the Y values (ppg
) of the points in that cluster.
Finally we will iterate/repeat steps 1 & 2 until the clusters are no longer moving and have converged.
num_clusters = 5
# Use numpy's random function to generate a list, length: num_clusters, of indices
random_initial_points = np.random.choice(point_guards.index, size=num_clusters)
# Use the random indices to create the centroids
centroids = point_guards.loc[random_initial_points]
4.1 Visualize Centroids
We will plot the centroids
, in addition to the point_guards
, so we can see where the randomly chosen centroids started out.
plt.scatter(point_guards['ppg'], point_guards['atr'], c='yellow')
plt.scatter(centroids['ppg'], centroids['atr'], c='red')
plt.title("Centroids")
plt.xlabel('Points Per Game', fontsize=13)
plt.ylabel('Assist Turnover Ratio', fontsize=13)
plt.show()
4.2 Assigning a Unique Identifier
While the centroids
data frame object worked well for the initial centroids, where the centroids were just a subset of players, as we iterate the centroids’ values will be coordinates that may not match another player’s coordinates. Moving forward, we will use a dictionary object instead to represent the centroids.
We need a unique identifier, like cluster_id
, to refer to each cluster’s centroid and a list representation of the centroid’s coordinates (or values for ppg
and atr
). We will create a dictionary then with the following mapping:
- key:
cluster_id
of that centroid’s cluster - value: centroid’s coordinates expressed as a list (
ppg
value first,atr
value second )
To generate the cluster_ids
, we will iterate through each centroid and assign an integer from 0 to k-1
. For example, the first centroid will have a cluster_id
of 0, while the second one will have a cluster_id
of 1. We will write a function, centroids_to_dict
, that takes in the centroids
data frame object, creates a cluster_id
and converts the ppg
and atr
values for that centroid into a list of coordinates, and adds both the cluster_id
and coordinates_list
into the dictionary that’s returned.
def centroids_to_dict(centroids):
dictionary = dict()
# iterating counter we use to generate a cluster_id
counter = 0
# iterate a pandas data frame row-wise using .iterrows()
for index, row in centroids.iterrows():
coordinates = [row['ppg'], row['atr']]
dictionary[counter] = coordinates
counter += 1
return dictionary
centroids_dict = centroids_to_dict(centroids)
5. Step 1: Euclidean Distance
Before we can assign players to clusters, we need a way to compare the ppg
and atr
values of the players with each cluster’s centroids. Euclidean distance
is the most common technique used in data science for measuring distance between vectors and works extremely well in 2 and 3 dimensions. While in higher dimensions, Euclidean distance can be misleading, in 2 dimensions Euclidean distance is essentially the Pythagorean theorem.
We can create a function and call it calculate_distance
, it will takes in 2 lists (the player’s values for ppg
and atr
and the centroid’s values for ppg
and atr
).
import math
def calculate_distance(centroid, player_values):
root_distance = 0
for x in range(0, len(centroid)):
difference = centroid[x] - player_values[x]
squared_difference = difference**2
root_distance += squared_difference
euclid_distance = math.sqrt(root_distance)
return euclid_distance
q = [5, 2]
p = [3,1]
# Sqrt(5) = ~2.24
print(calculate_distance(q, p))
2.23606797749979
5.1 Assigning Data Points to Clusters
Now we need a way to assign data points to clusters based on Euclidean distance. Instead of creating a new variable or data structure to house the clusters, we will create a new column in our point_guards
data frame that contains the cluster_id
of the cluster it belongs to.
# Add the function, `assign_to_cluster`
# This creates the column, `cluster`, by applying assign_to_cluster row-by-row
# Uncomment when ready
# point_guards['cluster'] = point_guards.apply(lambda row: assign_to_cluster(row), axis=1)
def assign_to_cluster(row):
lowest_distance = -1
closest_cluster = -1
for cluster_id, centroid in centroids_dict.items():
df_row = [row['ppg'], row['atr']]
euclidean_distance = calculate_distance(centroid, df_row)
if lowest_distance == -1:
lowest_distance = euclidean_distance
closest_cluster = cluster_id
elif euclidean_distance < lowest_distance:
lowest_distance = euclidean_distance
closest_cluster = cluster_id
return closest_cluster
point_guards['cluster'] = point_guards.apply(lambda row: assign_to_cluster(row), axis=1)
5.2 Visualizing Clusters
# Visualizing clusters
def visualize_clusters(df, num_clusters):
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']
for n in range(num_clusters):
clustered_df = df[df['cluster'] == n]
plt.scatter(clustered_df['ppg'], clustered_df['atr'], c=colors[n-1])
plt.xlabel('Points Per Game', fontsize=13)
plt.ylabel('Assist Turnover Ratio', fontsize=13)
plt.show()
visualize_clusters(point_guards, 5)
6. Step 2: Recalculate Centroids
def recalculate_centroids(df):
new_centroids_dict = dict()
# 0..1...2...3...4
for cluster_id in range(0, num_clusters):
# Finish the logic
return new_centroids_dict
centroids_dict = recalculate_centroids(point_guards)
def recalculate_centroids(df):
new_centroids_dict = dict()
for cluster_id in range(0, num_clusters):
values_in_cluster = df[df['cluster'] == cluster_id]
# Calculate new centroid using mean of values in the cluster
new_centroid = [np.average(values_in_cluster['ppg']), np.average(values_in_cluster['atr'])]
new_centroids_dict[cluster_id] = new_centroid
return new_centroids_dict
centroids_dict = recalculate_centroids(point_guards)
7. Repeat Step 1
point_guards['cluster'] = point_guards.apply(lambda row: assign_to_cluster(row), axis=1)
visualize_clusters(point_guards, num_clusters)
8. Repeat Step 1 and Step 2
centroids_dict = recalculate_centroids(point_guards)
point_guards['cluster'] = point_guards.apply(lambda row: assign_to_cluster(row), axis=1)
visualize_clusters(point_guards, num_clusters)
9. The Challenges of K-Means
As you repeat Steps 1 and 2 and run visualize_clusters
, you will notice that a few of the points are changing clusters between every iteration (especially in areas where 2 clusters almost overlap), but otherwise, the clusters visually look like they don’t move a lot after every iteration. This means 2 things:
- K-Means doesn’t cause massive changes in the makeup of clusters between iterations, meaning that it will always converge and become stable
- Because K-Means is conservative between iterations, where we pick the initial centroids and how we assign the players to clusters initially matters a lot
10. Overcoming the Challenges with Scikit-Learn
To counteract these problems, the sklearn
implementation of K-Means
does some intelligent things like re-running the entire clustering process lots of times with random initial centroids so the final results are a little less biased on one passthrough’s initial centroids.
from sklearn.cluster import KMeans
kmeans = KMeans(n_clusters=num_clusters)
kmeans.fit(point_guards[['ppg', 'atr']])
point_guards['cluster'] = kmeans.labels_
visualize_clusters(point_guards, num_clusters)


Home
Page Contents
Comments
Page Contents
Tags
Page Contents
Feed
Page Contents
Settings
Page Contents


Tot ziens
{% trans "Thanks for spending some quality time with the Web site today." %}
{% extends "base.html" %} {% load i18n %} {% block breadcrumbs %}
{% endblock %} {% block content %}{% trans "Thanks for spending some quality time with the Web site today." %}


Privex Privex documentation¶
Welcome to the documentation for Pyrewall - a Python tool for managing iptables firewalls.
This documentation is automatically kept up to date by ReadTheDocs, as it is automatically re-built each time a new commit is pushed to the Github Project


Conflict at the workplace seems to always be a never ending cycle. The difficulty of working with others is that at some point you will find an occassion to disagree or to misunderstand one anothers intentions. In my previous jobs, I often came into conflict with those who I felt, directed their anger towards others. I have very few pet peeves but one that always bothers me is when one is unable to control their temper and they either throws tantrums or direct their anger towards others. These usually occur because a deal didn't fall through, there were delays in creating a report or general impatience.
The emotions I feel around these people are withdrawal, anxiety and over-all dis-comfort. It generally makes the environment a uncomfortable and toxic environment to work in. The way I would usually try to resolve these issues with people would be, to talk out their frustrations. This usually gave me a better understanding of why they are upset and why they might be projecting.
While speaking was helpful in understanding them and their motivations, it did not always resolve the conflict within me. Often times these would be temporary measures that may alleviate the person until they find another reason to become upset and project their frustrations. If I can go back and change anything now, it would be that I would identify early on who these people are, and distance myself from them.
I learned that while my intentions and hopes may be that these people be able to realize their own follies; it is not my purpose to pursue the reconciliation of their character. I find that I have better peace of mind when I dettach myself from these situations and tactically choose times for discussion, reconciliation or confrontation versus treating each occassion as must fix scenario.