Dispatchers
An Akka MessageDispatcher is what makes Akka Actors "tick", it is the engine of the machine so to speak. All MessageDispatcher implementations are also an ExecutionContext, which means that they can be used to execute arbitrary code, for instance Futures.
Default dispatcher
Every ActorSystem will have a default dispatcher that will be used in case nothing else is configured for an Actor. The default dispatcher can be configured, and is by default a Dispatcher with the specified default-executor. If an ActorSystem is created with an ExecutionContext passed in, this ExecutionContext will be used as the default executor for all dispatchers in this ActorSystem. If no ExecutionContext is given, it will fallback to the executor specified in akka.actor.default-dispatcher.default-executor.fallback. By default this is a "fork-join-executor", which gives excellent performance in most cases.
Looking up a Dispatcher
Dispatchers implement the ExecutionContext interface and can thus be used to run Future invocations etc.
// this is scala.concurrent.ExecutionContext
// for use with Futures, Scheduler, etc.
final ExecutionContext ex = system.dispatchers().lookup("my-dispatcher");
Setting the dispatcher for an Actor
So in case you want to give your Actor a different dispatcher than the default, you need to do two things, of which the first is is to configure the dispatcher:
my-dispatcher {
# Dispatcher is the name of the event-based dispatcher
type = Dispatcher
# What kind of ExecutionService to use
executor = "fork-join-executor"
# Configuration for the fork join pool
fork-join-executor {
# Min number of threads to cap factor-based parallelism number to
parallelism-min = 2
# Parallelism (threads) ... ceil(available processors * factor)
parallelism-factor = 2.0
# Max number of threads to cap factor-based parallelism number to
parallelism-max = 10
}
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 100
}
Note
Note that the parallelism-max does not set the upper bound on the total number of threads allocated by the ForkJoinPool. It is a setting specifically talking about the number of hot threads the pool keep running in order to reduce the latency of handling a new incoming task. You can read more about parallelism in the JDK's ForkJoinPool documentation.
And here's another example that uses the "thread-pool-executor":
my-thread-pool-dispatcher {
# Dispatcher is the name of the event-based dispatcher
type = Dispatcher
# What kind of ExecutionService to use
executor = "thread-pool-executor"
# Configuration for the thread pool
thread-pool-executor {
# minimum number of threads to cap factor-based core number to
core-pool-size-min = 2
# No of core threads ... ceil(available processors * factor)
core-pool-size-factor = 2.0
# maximum number of threads to cap factor-based number to
core-pool-size-max = 10
}
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 100
}
Note
The thread pool executor dispatcher is implemented using by a java.util.concurrent.ThreadPoolExecutor. You can read more about it in the JDK's ThreadPoolExecutor documentation.
For more options, see the default-dispatcher section of the Configuration.
Then you create the actor as usual and define the dispatcher in the deployment configuration.
ActorRef myActor =
system.actorOf(Props.create(MyUntypedActor.class),
"myactor");
akka.actor.deployment {
/myactor {
dispatcher = my-dispatcher
}
}
An alternative to the deployment configuration is to define the dispatcher in code. If you define the dispatcher in the deployment configuration then this value will be used instead of programmatically provided parameter.
ActorRef myActor =
system.actorOf(Props.create(MyUntypedActor.class).withDispatcher("my-dispatcher"),
"myactor3");
Note
The dispatcher you specify in withDispatcher and the dispatcher property in the deployment configuration is in fact a path into your configuration. So in this example it's a top-level section, but you could for instance put it as a sub-section, where you'd use periods to denote sub-sections, like this: "foo.bar.my-dispatcher"
Types of dispatchers
There are 3 different types of message dispatchers:
Dispatcher
This is an event-based dispatcher that binds a set of Actors to a thread pool. It is the default dispatcher used if one is not specified.
Sharability: Unlimited
Mailboxes: Any, creates one per Actor
Use cases: Default dispatcher, Bulkheading
- Driven by: java.util.concurrent.ExecutorService
specify using "executor" using "fork-join-executor", "thread-pool-executor" or the FQCN of an akka.dispatcher.ExecutorServiceConfigurator
PinnedDispatcher
This dispatcher dedicates a unique thread for each actor using it; i.e. each actor will have its own thread pool with only one thread in the pool.
Sharability: None
Mailboxes: Any, creates one per Actor
Use cases: Bulkheading
- Driven by: Any akka.dispatch.ThreadPoolExecutorConfigurator
by default a "thread-pool-executor"
CallingThreadDispatcher
- This dispatcher runs invocations on the current thread only. This dispatcher does not create any new threads, but it can be used from different threads concurrently for the same actor. See CallingThreadDispatcher for details and restrictions.
- Sharability: Unlimited
- Mailboxes: Any, creates one per Actor per Thread (on demand)
- Use cases: Testing
- Driven by: The calling thread (duh)
More dispatcher configuration examples
Configuring a dispatcher with fixed thread pool size, e.g. for actors that perform blocking IO:
blocking-io-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 32
}
throughput = 1
}
And then using it:
ActorRef myActor = system.actorOf(Props.create(MyUntypedActor.class)
.withDispatcher("blocking-io-dispatcher"));
Configuring a PinnedDispatcher:
my-pinned-dispatcher {
executor = "thread-pool-executor"
type = PinnedDispatcher
}
And then using it:
ActorRef myActor = system.actorOf(Props.create(MyUntypedActor.class)
.withDispatcher("my-pinned-dispatcher"));
Note that thread-pool-executor configuration as per the above my-thread-pool-dispatcher example is NOT applicable. This is because every actor will have its own thread pool when using PinnedDispatcher, and that pool will have only one thread.
Note that it's not guaranteed that the same thread is used over time, since the core pool timeout is used for PinnedDispatcher to keep resource usage down in case of idle actors. To use the same thread all the time you need to add thread-pool-executor.allow-core-timeout=off to the configuration of the PinnedDispatcher.
Contents


Professor of GIS
Cayuga Community College
197 Franklin Street, Auburn, NY 13210
Live:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>Office: M274 Main Building
Mastering ArcGIS - Maribeth Price, 7th Edition, McGraw Hill (required)
This is a senior level GIS course that will focus on advanced topics in GIS including planning, management, raster-vector integration, and data quality issues. Students will learn how to do customization, spatial modeling, advanced editing and database query mainly in ArcGIS environment. Basic techniques of GPS data collection will also be introduced. Students will learn how to bring all the pieces of Geographic Information Technologies together for advanced analysis and modeling.
At the conclusion of this course, students will:
Each lab assignment is due in the following week and late submission will not be accepted except in case of an emergency. Completing all the assignments will keep you occupied and it will require several hours beyond the class time.
An important objective of the GIS Project is to gain practical experience in solving real world problems with real data. This will be a capstone project, which will bring together all of the skills and techniques that students have learned over the past few semesters in GIS, GPS, Remote Sensing, and in other related fields.
| Component | Weight |
|---|---|
| Exams & Project | 50% |
| Lab exercises | 40% |
| Quizzes | 10% |
*** The above grading is subject to change at the instructor's discretion ***
| Week | Topic |
|---|---|
| Week 1 | Course Introduction and Demonstration |
| Week 2 | Geocoding in ArcGIS (Chapter 10) |
| Week 3 | Introduction to Spatial Analyst |
| Week 4 | Spatial operation with Map Algebra |
| Week 5 | Modeling in ArcGIS |
| Week 6 | Spatial Prediction |
| Week 7 | MIDTERM |
| Week 8 | Building Geodatabase |
| Week 9 | Creating and editing features in Geodatabase |
| Week 10 | SPRING BREAK |
| Week 11 | Basic Editing in ArcMap |
| Week 12 | Advanced Editing Technique |
| Week 13 | Advanced Mapping Techniques |
| Week 14 | Introduction to GPS |
| Week 15 | GPS data collection and processing |
| Week 16 | Review & Project Presentation |
| Week 17 | FINAL EXAM |


What is an execution stack
The javascript code needs to be executed in a specific environment for it to work and this environment is called the execution
context, we can imagine this as a box that contains our code, variables etc. Here where our code is executed.
How code is executed
- In javascript functions create a scope which means that all codes declared outside a function is associated to the
global object
and in javascript a browser is global object
represented by window object
, so if you create a variable in the global object
you automaticaly add a property
to the window object
because variable are like properties in object.
- So in our example above, we create a variable in our
global context
so she's stores in the global context
, then we declare three functions in the global context
so they are stores into this one.
- After that still in our
global context
we call the first() function
up until this point our execution stack now contain on top the
first() execution context
which means that now javascript will run the code inside thefirst() function
.
- Now that we are in the
first() function execution
we store variable a
and then we call the second() function
so now on top of our execution stack we have the second() function
.
- We call the variable
b
and then the third() function
so execution stack on top is now third() function execution context
.
- And then javascript stores variables
c and z
, our third function is now done so the third() execution context
on the stack is now push outside, we're now back on the second() execution context
we store the variable z
and then we push out the second() execution context
.
- Back in our
first() function context
we can now stores the last variable x
and push out the first() function context
.


Sky's Buttons
These are some CSS buttons that I've designed and used in my projects.
These are some CSS buttons that I've designed and used in my projects.


How do you get to HackCU?
The main event will be located in the Wolf Law building at:
2450 Kittredge Loop Dr.Parking will be available in the parking lot outside of Wolf Law on Kittredge Loop Dr. Be sure to follow directions on the signs to make sure you are not in permit only parking.
There is a bus, the RTD AB line, that runs from the airport to our university campus. Find the bus schedule and fares here. Get off at the Baseline and Broadway stop, and follow the route from the bus stop to the Wolf Law building just 4 minutes away.
If you take an Uber or Lyft from DIA (Denver International Airport), save your receipt to be used for your travel reimbursement if you were approved.
If you are traveling farther than 25 miles from the University of Colorado Boulder, you are eligible for travel reimbursement. To receive reimbursement, you must:
We will be offering flight reimbursements on a first come first serve basis with the amount reimbursed affected by distance traveled. Once approved by our admin team via email, you will be required to submit travel receipts on our travel reimbursement form. Your entire flight may or may not be covered by reimbursements.
We love international participants! Unfortunately, HackCU cannot provide assistance for international travel or visa paperwork. However, if you do make it to HackCU, send us an email at contact[at]hackcu.org with the subject line: "International Participant" and we can put in a request for reimbursement.
Have any questions that were not answered here? Feel free to contact us here or email us at contact@hackcu.org.


An interactive list of projects will go here. For now, a simple list.
An interactive list of companies I've worked for will go here. For now, a simple list.
I'll have a simple profile up here. For now, um...
var helloMessage = 'Hello world!'; console.log(helloMessage);


@RestController
@RequestMapping(value="/api")
public class WatchedEpisodeResource
extends java.lang.Object
| Constructor and Description |
|---|
WatchedEpisodeResource(WatchedEpisodeService watchedEpisodeService) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<WatchedEpisode> |
createWatchedEpisode(@Valid WatchedEpisode watchedEpisode)
POST /watched-episodes : Create a new watchedEpisode.
|
org.springframework.http.ResponseEntity<java.lang.Void> |
deleteWatchedEpisode(java.lang.Long id)
DELETE /watched-episodes/:id : delete the watchedEpisode by "id".
|
java.util.List<WatchedEpisode> |
getAllWatchedEpisodes()
GET /watched-episodes : get all the watchedEpisodes.
|
java.lang.Float |
getAverageRate(java.lang.Long id)
GET /watched-episodes/:id/average-rate : Get an average rate for episodes, which id is episodeId
|
java.lang.Integer |
getRateCount(java.lang.Long id)
GET /watched-episodes/:id/rate-count : Get a count of how many users watched episode, which id is episodeId
|
org.springframework.http.ResponseEntity<WatchedEpisode> |
getWatchedEpisode(java.lang.Long id)
GET /watched-episodes/:id : get the watchedEpisode by "id".
|
org.springframework.http.ResponseEntity<WatchedEpisode> |
getWatchedEpisodeForEpisodeId(java.lang.Long id)
GET /watched-episodes/episode/:id : get the watchedEpisode by "id".
|
org.springframework.http.ResponseEntity<WatchedEpisode> |
updateWatchedEpisode(@Valid WatchedEpisode watchedEpisode)
PUT /watched-episodes : Updates an existing watchedEpisode.
|
public WatchedEpisodeResource(WatchedEpisodeService watchedEpisodeService)
@PostMapping(value="/watched-episodes") @Timed public org.springframework.http.ResponseEntity<WatchedEpisode> createWatchedEpisode(@Valid @RequestBody @Valid WatchedEpisode watchedEpisode) throws java.net.URISyntaxException
watchedEpisode
- the watchedEpisode to createjava.net.URISyntaxException
- if the Location URI syntax is incorrect@PutMapping(value="/watched-episodes") @Timed public org.springframework.http.ResponseEntity<WatchedEpisode> updateWatchedEpisode(@Valid @RequestBody @Valid WatchedEpisode watchedEpisode)
watchedEpisode
- the watchedEpisode to update@GetMapping(value="/watched-episodes") @Timed public java.util.List<WatchedEpisode> getAllWatchedEpisodes()
@GetMapping(value="/watched-episodes/{id}") @Timed public org.springframework.http.ResponseEntity<WatchedEpisode> getWatchedEpisode(@PathVariable java.lang.Long id)
id
- the id of the watchedEpisode to retrieve@GetMapping(value="/watched-episodes/episode/{id}") @Timed public org.springframework.http.ResponseEntity<WatchedEpisode> getWatchedEpisodeForEpisodeId(@PathVariable java.lang.Long id)
id
- the id of the episode in the watchedEpisode to retrieve@GetMapping(value="/watched-episodes/{id}/average-rate") @Timed public java.lang.Float getAverageRate(@PathVariable java.lang.Long id)
id
- the id of the watchedEpisode to check@GetMapping(value="/watched-episodes/{id}/rate-count") @Timed public java.lang.Integer getRateCount(@PathVariable java.lang.Long id)
id
- the id of the watchedEpisode to retrieve@DeleteMapping(value="/watched-episodes/{id}") @Timed public org.springframework.http.ResponseEntity<java.lang.Void> deleteWatchedEpisode(@PathVariable java.lang.Long id)
id
- the id of the watchedEpisode to delete


XXX
`Prev `__
X
`Next `__
--------------
**XXX**: /X·X·X/, n.
A marker that attention is needed. Commonly used in program comments to
indicate areas that are kluged up or need to be. Some hackers liken
‘XXX’ to the notional heavy-porn movie rating. Compare
`*FIXME* <../F/FIXME.html>`__.
--------------
+-------------------------+----------------------------+--------------------------+
| `Prev `__ | `Up <../X.html>`__ | `Next `__ |
+-------------------------+----------------------------+--------------------------+
| xref | `Home <../index.html>`__ | xyzzy |
+-------------------------+----------------------------+--------------------------+


| Star | Watch | Fork |
| Home |
|---|
| User Guide |
| Examples |
| About |
In this example, the portfolio construction problem discussed in the previous sections is solved by a robust optimization approach introduced in the paper The Price of Robustness. The robust model is presented below.
\[\begin{align} \max~&\min\limits_{\pmb{z}\in\mathcal{Z}} \sum\limits_{i=1}^n\left(p_i + \delta_iz_i \right)x_i \\ \text{s.t.}~&\sum\limits_{i=1}^nx_i = 1 \\ &x_i \geq 0, ~\forall i = 1, 2, ..., n, \end{align}\]where the affine term \(p_i + \delta_iz_i\) represents the random stock return, and the random variable is between \([-1, 1]\), so the stock return has an arbitrary distribution in the interval \([p_i - \delta_i, p_i + \delta_i]\). The uncertainty set \(\mathcal{Z}\) is given below,
\[\begin{align} \mathcal{Z} = \left\{\pmb{z}: \|\pmb{z}\|_{\infty} \leq 1, \|\pmb{z}\|_1 \leq \Gamma\right\}, \end{align}\]where \(\Gamma\) is the budget of uncertainty parameter. Values of the budget of uncertainty and other parameters are presented as follows.
\[\begin{align} & \Gamma = 5 &\\ & p_i = 1.15 + i\frac{0.05}{150}, &\forall i = 1, 2, ..., n \\ & \delta_i = \frac{0.05}{450}\sqrt{2in(n+1)}, &\forall i = 1, 2, ..., n. \end{align}\]The robust optimization model can be implemented by the following Python code.
from rsome import ro
from rsome import grb_solver as grb
import rsome as rso
import numpy as np
n = 150 # Number of stocks
i = np.arange(1, n+1) # Indices of stocks
p = 1.15 + i*0.05/150 # Mean returns
delta = 0.05/450 * (2*i*n*(n+1))**0.5 # Deviations of returns
Gamma = 5 # Budget of uncertainty
model = ro.Model()
x = model.dvar(n) # Fractions of investment
z = model.rvar(n) # Random variables
model.maxmin((p + delta*z) @ x, # The max-min objective
rso.norm(z, np.infty) <=1, # Uncertainty set constraints
rso.norm(z, 1) <= Gamma) # Uncertainty set constraints
model.st(sum(x) == 1) # Summation of x is one
model.st(x >= 0) # x is non-negative
model.solve(grb) # Solve the model by Gurobi
Being solved by Gurobi...
Solution status: 2
Running time: 0.0038s
The optimal investment decision can be visualized by the diagram below.
import matplotlib.pyplot as plt
obj_val = model.get() # The optimal objective value
x_sol = x.get() # The optimal investment decision
plt.plot(range(1, n+1), x_sol,
linewidth=2, color='b')
plt.xlabel('Stocks')
plt.ylabel('Fraction of investment')
plt.show()
print('Objective value: {0:0.4f}'.format(obj_val))
Objective value: 1.1709


This year I repeated my strategy of “Don’t go to any recorded sessions,” and also did more volunteering (one of these was at the green room, and again one of the session chairs failed to show up so you’ll see me introducing three of the talks).
Dinners
In the past I’ve kind of stumbled into dinner groups, but not always. This time I made more of an effort and was rewarded with dinner friends every night. I think, however, that I’d like to make more of an effort to pre-plan these next year somehow, perhaps using some online tool. Admittedly this could reduce the chances for serendipity, but once a core of people are going to dinner it’s not usually hard to add others.
I wonder if there’s already an app for setting up group dinners. One of the hopeful things that happened is that I discovered that someone I have started to know is a web developer and we’ve agreed to do some experiments. I’ve been approached by any number of people over time who want to build web projects, but these are invariably people who have figured out how to configure a technology (often Wordpress, which I’ve come to loathe) and recommend that I use that particular technology. But in this case, I’ve got a real programmer who can adapt to my arcane needs. As a result, I’ve started imagining asking him to create all kinds of new experiments, and one of these could be a dinner planner app for conferences. The possibilities for this and other ideas are very exciting.
Hunting for Self-Guided Tutorials
For years, many people in Crested Butte have expressed to me an interest in learning to program, while declaring they know nothing about it. Perhaps the idea gestated long enough, or some other experience triggered this, but I recently began formulating a free class for new programmers that relies completely on self-guided tutorials. The benefit of this is that people do not get driven away by the class going either too fast or too slow; by its nature it adapts to the learning experience of each individual. In addition, once anyone has solved one of the steps, they can help their classmates solve that step (indeed, they are probably better at it, being closer to “beginner’s mind”).
The site is EveryoneProgram.com and might still be rough when you look at it, but the content is basically there, including links to the tutorials.
While at Pycon I talked to various folks who are in education to try to see if there were other, better tutorials and ended up with the ones you see on the site. Of course it’s an experiment so we’ll adjust it depending on how things work and new discoveries.
One of my goals is to create new coaches from the people that attend the class. There are other folks in town who can help and take over if I’m traveling, as well.
Open Spaces
Although I attended more open spaces than the ones described here, these were the ones I found most engaging.
Inclusion
This was convened by a young woman who had a poor experience in a workshop. From the context, I don’t think it was one of the pre-conference tutorials; I think it had happened awhile ago but it had left a mark and she needed to discuss it. Others in the session shared similar experiences.
I have not found these kinds of discussions at other conferences. One of the unique things about Pycon is that it (intentionally) has a very high percentage of women attendees and speakers. Guido’s stated goal is 50% and it seems like that number is fairly close in terms of speakers, and I might guess the women attendees could be as high as 35% or more. Minorities of various kinds are also becoming more represented. I wonder if one reason Python’s popularity keeps rising is its inclusiveness.
What Confuses You About Concurrency?
I held this session to gather more ideas to support the development of Concurrent Python. You can find my notes from this session here by scrolling down to that heading.
Improve Your Writing
This was requested directly to me by one person (who ended up not being able to make the session). I had actually submitted a session proposal for something similar, but it wasn’t accepted. We had about 10 people.
To keep it simple I gave three core ideas I think make the biggest impact on someone’s writing:
Less is More. The more words you have, the more work your reader must do. Shorter sentences are easier to read and understand. Multiple editing passes are usually required to achieve short sentences.
Active Voice. You can find some examples here, although these are rather basic. Perhaps we need another category of “super- active” or “direct” voice, as it’s usually possible to make your sentences even more immediate – although it takes even more work to get there. Active voice helps a lot with point
1
, because active sentences are almost always shorter than passive sentences.Read It Aloud. This is a trick I learned from a friend many years ago. When you read silently, your mind tends to skip and skim. When you read every single word out loud, it forces you to scrutinize your prose. Problems jump out at you and you’re surprised you missed such glaring errors. It takes a lot of time (especially for book chapters) but it pays off.
I tried to keep the description of these points short and take questions. Afterward there was general Q&A and discussion.
Starting Teal Organizations
I never know what’s going to happen when I hold one of these sessions. Usually I get curious folks and it gives me practice in explaining the concepts, which you can find at Reinventing Business.
The turnout was larger than I expected, perhaps 8 folks, and we had a stimulating discussion. At this point I’m trying to discover the details, things not covered in the Reinventing Organizations book, such as bringing people into and out of the organization, payment, investing, and things like that. Frederic Laloux (the author) says these topics are different from one Teal organization to another and chooses not to cover them for that reason. But if you’re starting such an organization, you need those structures, even if you just use them as a starting point. I think I can make an important contribution to this field by discovering, collecting and passing on such information.
While I was in Portland I was able to attend a separate one-day open-spaces event around non-violent communication, and there I also held a “Starting Teal Organizations” session, which produced more good discussion.
Sprint days
Last year was my first experience sprinting (If you don’t include what was arguably the very first sprint, coached by Jim Fulton at Zope Corp in Virginia after one of the D.C. Pycons – but I can’t remember much from that one; I do know he tried to teach us Git). Then I went to many different projects and contributed a little to each one, primarily either documentation or testing their onboarding process, but in a few cases I added code. I learned a great deal through this sampling process, but this year I ended up spending all three days (and wishing I had the fourth) on a single project: Beeware.
I’ve been experimenting with and using a small decorator framework for building command-line applications, much like (for example) Click although mine is much simpler. I have a friend or two who would like some automation, so I’ve been imagining that a command-line system would work for them.
Then a friend pointed out that most people have no idea what the shell is, and are unfamiliar with command-line applications. At Pycon it occurred to me that it might be possible to use the same decorator approach, but instead of producing a command-line option, the decorator would insert a menu item in a windowed program, and thus be easier and more familiar for the vast majority of users, while at the same time making the creation of such a program far easier. I went to the Beeware booth and ask the creator, Russell Keith-Magee (whom I had met and spent time with at PyCarribbean), if he thought this was possible and he said yes.
It turns out his answer was a bit … premature. When you go to the Beeware Site, it can be hard to discover where to start. There’s a reason for that: this is a collection of projects, so you must first (A) Know that and (B) Decide what project fits your needs. And even then, some parts of the project are still more visionary than completely fleshed out, so you won’t always find a tutorial or example of what you’re looking for.
I quite like the vision of BeeWare: make Python work everywhere. I think it will get there. We even had some discussions about funding so Russell (and ideally other programmers) could work on it full time, and get it there faster. But be warned that at this writing the vision is only partly there.
The sub-project that met my needs is called Toga, with Docs here. The first thing I discovered was that there were menus for the Mac and I think Linux, but not for Windows. Thus, my effort was spent on learning the Toga architecture and figuring out how to add menus for Windows apps. This was tremendously educational but I’m still not close to creating my “decorators for menus.” However, I’d rather continue working on Beeware until it gets to the point where I can, rather than building something from scratch. This way I’ll produce results that works across platforms, by taking advantage of the Beeware architecture.
Virtual Environments Revisited
Setting up the virtual environment for this project was one of my learning
experiences. When you install a package that you want to modify and test, it
turns out you must make it editable using the -e
flag, as in pip install
-e
. Otherwise your changes won’t be used, and only the original installation
will ever be seen when you run your program. Without knowing this I
experienced some frustration until Russell walked me through it.
In the process, I ended up making multiple installations and building the
virtual environment multiple times. I also realized that I sometimes hesitate
to build a virtual environment because I must look up and re-learn the
configuration commands, and running the activate
script is always a bother.
If only we could get the computer to do annoying, repetetive things for us!
Here’s a Windows batch file that does the trick (anyone with basic shell
skills can create the equivalent for Mac/Linux):
@echo off
rem venv.bat
rem Works if you're outside the starting directory:
if defined VIRTUAL_ENV (
deactivate.bat
) else (
rem Only works inside starting directory, otherwise
rem creates a new virtual environment:
if exist virtualenv (
virtualenv\Scripts\activate.bat
) else (
python -m venv virtualenv
virtualenv\Scripts\activate.bat
)
)
I’m choosing to call my virtual environment directory virtualenv
, and so can
use that directory’s existence to indicate whether there’s an installed
virtual environment.
You can place venv.bat
somewhere in your Windows PATH
and use it anytime
you want to create and use virtual environments. Note that for it to work
correctly, you must call it from the directory where the virtualenv
subdirectory will be created or already exists.
activate.bat
sets VIRTUAL_ENV
and deactivate.bat
clears it, so
VIRTUAL_ENV
means that the virtual environment has been activated. This way,
running venv
just turns it on if it’s off, and off if it’s on, so that’s
two less commands I need to remember.
If the virtual environment doesn’t exist, it is created and activated. But
while working on Toga, I needed the special -e
editable installations in
that new environment, so I created a local venv.bat
and added the following
lines after the virtual environment creation and activation:
cd src\core
pip install -e .
cd ..\winforms
pip install -e .
cd ..\..
pip install -e .
Notes
The rest of the time I sought out experiences and interactions. And this is a place where the smart phone really has enhanced my life: whenever anyone said something interesting, I pulled out the phone and entered it in a list in Google Keep. I used to write notes and then set them aside and forget them, but entering them in Keep and knowing they will show up on all my other devices seems to really make the key difference.
Here are my notes, in no particular order:
Online book: Supporting Python 3
Insert this in your code where you suspect a bug:
import pdb; pdb.set_trace()
Work is Not a Dare by Shawn Rider from the Open Source and Feelings conference. Slides Video.
A practice during discussions: “step up/step back” – if you normally speak a lot, speak less; if you normally don’t talk, speak more. (I think Shawn told me about this).
PyInstaller for creating easy end-user installers.
Trinket.io Python learning tool.
Pint a units library for working with physical quantities.
Bypthon. Another Python REPL prettifier. Alas, says it works on Windows but doesn’t. Remember, roughly 95% of the machines out there run Windows, so saying that whatever machine you are using “is better and everyone should just use it” doesn’t really help promote Python. PtPython does work on Windows, for example.
The Fish shell. Doesn’t work on Windows, but should work on Windows Bash. Recommended by one of the speakers.
The prompt_toolkit for building interactive command lines.
Scikit-Learn, an open-source machine learning library.
Python Koans An interactive tutorial for learning the Python programming language by making tests pass.
PythonAnywhere Host, run, and code Python in the cloud, free basic plan. Possibly useful for classroom situations.
Asana, A Trello-like product.
PollEV.com instant polling during presentations.
Roost stand to bring laptop screen up to eye level.
The Concurrent Python Project
I’ve started working on a big, ambitious Python project: a book called Concurrent Python which assumes you know Python but that you don’t know anything about concurrency. I considered writing yet another introductory book, but realized there are already plenty of good ones and that I wouldn’t contribute much there. Concurrency, however, is a topic I’ve struggled with over the years and I know I could add some value to that discussion. It also presents opportunities for much more interesting training, conferences, speaking and consulting (these days I’m far more invested in discovering stimulating experiences, instead of just any experiences).
The first chapter has mostly been taken from the Concurrency chapter in On Java 8, which is now available in beta (as in “nearly finished”) form but still requires a little more work. The Atomic Kotlin book has also inserted itself in my schedule. So don’t expect a lot of progress right now, although I am thinking about it and watching for ideas, tools and libraries which I’m capturing in the 00_Notes.md file – feel free to make pull requests or add issues if you think something belongs there.


Syntax:
get-internal-real-time <no arguments> => internal-time
Arguments and Values:
internal-time---a non-negative integer.
Description:
get-internal-real-time returns as an integer the current time in internal time units, relative to an arbitrary time base. The difference between the values of two calls to this function is the amount of elapsed real time (i.e., clock time) between the two calls.
Examples: None.
Side Effects: None.
Affected By:
Time of day (i.e., the passage of time). The time base affects the result magnitude.
Exceptional Situations: None.
See Also:
internal-time-units-per-second
Notes: None.


ChainZilla provides the most efficient and flexible end-to-end blockchain solutions. These include project onboarding, tokenization, app development, ICO management, and blockchain migrations.
100 messages
Before 05-Dec-19 12:00 AM
Komodo-BotBOT20-Sep-18 08:56 PM
[PTYX#6840] I've not looked I to IPFS' ddos resilience
Latin America is poised to take full advantage of blockchain, with dozens of entrepreneurs and startups already creating world-class solutions that will change the way we use the technology.
Komodo-BotBOT21-Sep-18 05:46 AM
[Instel7#1416] The first one is a great article there!
Last version of our #cryptowallet in Google Play store! Congrats to @utrumdotio @VerusCoin @Chainzillaio @OfficialEQL as they will join the #Pungowallet familly very soon. Our #PGT sale is live @ https://t.co/l3idywLtpN join & get a free debit card (EU only)
Komodo-BotBOT21-Sep-18 06:53 PM
[Instel7#1416] @tungbt94@namhoang28 Hello and welcome to our discord channel! Let us know if you need help
We are making it rain 100$ worth of ChainZilla tokens before the ICO. Join our Airdrop
1 - Download the Agama wallet and get your $KMD address
2 - Join Discord https://t.co/rutzRRSZkA
3 - Paste your $KMD Address in the general channel.
The two winners will be pick...
[PTYX#6840] .airdrop 100 0.0
[ChainZilla Bot#7671] Payout must exceed 0
[PTYX#6840] @everyone We are making it rain 100$ worth of ChainZilla tokens before the ICO. Join our Airdrop 1 - Download the Agama wallet and get your $KMD address 2 - Join Discord https://discord.gg/GABK5ya 3 - Paste your $KMD Address in the general channel. The two winners will be picked in the next 24 hours
[PTYX#6840] @Unknown@zatJUM@Unknown@Unknown@Unknown@Unknown@umitkara48@Eugen S@DCAL4@Unknown A big Hello to all of you. Welcome to the ChainZilla channel. The winners of the airdrop will be picked later today


Go Back
Factorio Blueprint:
Blueprint String
Raw Items Sorted in Descending Order:
Example Result (does not include modules): 30 iron-ore 15 copper-ore
Calculate Raw Item Count


Ocean [ah40], ocean, in The Inner Sea
Last updated Turn #108
Ocean [ah40], ocean, in The Inner Sea
------------------------------------------------------------------------
11: Whalebone [fe4m], ship, 6 hulls, 1 rowing port, 18 sails, arrived from
11: Ocean [ah41], owner:
11: Toulouse [h1q], Pen, with 20 sailors, 15 lt. xbowmen,
11: accompanied by:
11: Jonathan [h9k], Pen, duke, with 39 pikemen
11: Halmary [f9m], Pen, with one worker, 15 lt. xbowmen
12: Whalebone [fe4m], ship, 6 hulls, 1 rowing port, 18 sails, departed for
12: Ocean [ah39].
Routes leaving Ocean:
North, to Ocean [ag40], Crystal Sea, 6 days
East, to Ocean [ah41], 6 days
South, to Ocean [ai40], 6 days
West, to Ocean [ah39], 6 days
Inner locations:
Island [aa2h], island, 1 day, owner:
Cyclops [jt3b], cyclops, number: 18


This is the pack Charge Current Limit. The value is, by default, reported as a positive value from 0 to whatever the maximum charge current limit is set to.


Llama Trekking
Come and trek with totally awesome llamas in the beautiful countryside. Walk side-byside with these calm and docile animals and learn fun llama facts at the same time.
Come and trek with totally awesome llamas in the beautiful countryside. Walk side-byside with these calm and docile animals and learn fun llama facts at the same time.


This illustrates the fact that
$\mathbb{R}^2\setminus\text{point}$ is homotopy equivalent to
$S^1$. The key ingredient is the map
$h\colon [0,1]\times\mathbb{R}^2\setminus\text{point}\to\mathbb{R}^2\setminus\text{point}$
given by
$$ h(t,(x,y)) = \left(1-t + \frac{t}{\sqrt{x^2+y^2}}\right) (x,y), $$
so that $h(0,(x,y))=(x,y)$ and $h(1,(x,y))=(x,y)/\sqrt{x^2+y^2}\in S^1$.


The Luggage: An Introduction
09 Aug 2013If you’ve managed OS X for any amount of time, chances are you’ve needed to deploy software. And chances also are that you’ve come across a vendor (I’m looking at you, Adobe) that seems to be incapable of distributing their software in a useful manner. Or maybe you’ve got your own scripts or software that you need to get installed on the machines that you look after - either way, you’re going to want to build a package.
You’ve got a few options - Iceberg, Packages, Composer, you’ve even got Package Maker. However, my personal choice is The Luggage. It has a few advantages over the alternatives:
- It’s all text files: You’re building software distributions, you should be checking the files in to build the packages into version control, such as Git. Text files are ideal for checking into version control.
- It’s free: if it costs nothing, there’s no reason it can’t be installed on everyone’s machine.
- It’s (still) all text files: Want to see what will be in the package without any extra work? Crack open the Makefile and you can see straight away what will be in the package.
- The Luggage has a metric buttload of shortcuts built in: it does the hard work, so you don’t have to.
- It’s repeatable: Have you ever tried to talk someone through a series of windows and buttons to get the same result as you’re getting? Every time you run The Luggage, you will get the same result.
- It’s (really, still) all text files: It’s the most precise tool I’ve used - you only package exactly what you need, no cruft is left behind.
 We’ll be going through more advanced workflows in future posts, but let’s get started with using The Luggage.
Getting set up
We’re going to grab the current version of The Luggage from the git repository. If you don’t have git, you can install the Command Line Tools from within Xcode’s preferences if you don’t have it. If you don’t have Xcode, and the Command Line Tools installed, very little is going to work, so go and install it. It’s ok, I’ll wait.
Now we are going to use The Luggage to install itself (oooh, meta). You’ll be asked for your password, as it will need to perform some tasks as root.
Your first Makefile
Now you’ve got everything set up, we’re going to write our first Makefile. We’re going to make a package to deploy Nate Walck’s awesome scriptRunner.py. Everything prefaced with a $
should be typed into your Terminal window.
First we’re going to grab the repository from GitHub:
Now we’re going to make a directory to work in for our package and copy scriptRunner.py into it.
So far so good. Now for the actual Makefile. Create a file in your favourite editor (I recommend TextMate 2), save it as Makefile in ~/src/scriptRunnerPkg
and put in the following content:
Let’s go through this line by line. First, we’re overloading a default variable. Back in the day, The Luggage used Package Maker to perform the actual build of the package. This has been deprecated by Apple, replaced with pkgbuild and productbuild. We’re just telling The Luggage to go straight ahead and use pkgbuild.
We’re then including the main Makefile, which contains all of the pre-built work that we can extend with our own Makefiles.
TITLE
and REVERSE_DOMAIN
are exactly that - the title and reverse domain of the package.
Finally, we’re specifying what our payload is going to consist of - in this case, just scriptRunner. Line 8 is using the foundation that The Luggage has already built - installing software into /usr/local/bin
is pretty standard, so we don’t need to reinvent the wheel here - we just need to tell The Luggage what to do with the one file we’re installing, it will work out the rest.
An important note on Makefiles
Makefiles are really picky about formatting and spacing - if you get strange errors, make sure you are using tab characters rather than spaces for example. and make sure you’ve not missed off a colon or a back-slash anywhere.
Prepare the build!
We’re ready to build. Let’s do it. No need to run this as sudo, The Luggage will ask for your password if it needs it.
If everything has gone well, some text will scroll into your Terminal window and you’ll be left with a package sitting in ~/src/scriptRunnerPkg
.
That’s all well and good, but we need a LaunchAgent to run the script when someone logs in. Save the following in ~/src/scriptRunnerPkg
and name it com.grahamgilbert.scriptrunner.plist
.
This will tell scriptRunner.py to run everything in /Library/Management/scriptRunner/once
once per use and everything in /Library/Management/scriptRunner/every
each and every single time the user logs in.
That’s nice, but how do we get it into our package? Change the payload section to look like this:
And now rebuild the package:
And that’s it! As putting a plist into /Library/LaunchAgents
is as common as a BSOD on Vista, it’s built right into The Luggage. A list of most of the available payload additions can be found on the wiki - this isn’t everything though. Have a nose through /usr/local/share/luggage/luggage.make
to see everything you can do.
This is obviously a working solution, but there are many manual steps needed if we are sharing our code with others. We’ll look into automating some of the steps and deploying a script that scriptRunner.py can work with.


--- layout: page permalink: "/community-commissioned/seesaw/" ---
An Oxfordshire Support group for grieving children and their families, helping them to move forward to face the future with hope.
Seesaw commissioned me to help young people to explore the use of photography, composition and lighting to express some of the feelings they have experienced during their bereavement.


14 June 2005
The Ministry of Health in Viet Nam has confirmed an additional 3 human cases of infection with H5N1 avian influenza. The cases were detected during the last two weeks of May. All three patients are from Hanoi and remain alive. No further data about these cases have been provided.
The newly confirmed cases bring the total, in Viet Nam, since mid-December 2004 to 55 cases. Of these patients, 18 have died and three are currently undergoing treatment at a hospital in Hanoi.


dataset init COLLECTION_NAME [DSN_URI]
init creates a collection. Collections are created on local disc.
The following example command create a dataset collection named “data.ds”.
dataset init data.ds
NOTE: After each evocation of dataset init
if all went
well you will be shown an OK
if everything went OK,
otherwise an error message.
By default dataset cli creates pairtree collections. You can now optionally store your documents in a SQL database (e.g. SQLite3, MySQL 8). This can improve performance for large collections as well as support multi-user or multi-process concurrent use of a collection. To use a SQL storage engine you need to provide a “DSN_URI”. The DSN_URI is formed by setting the “protocl” of the URL to either “sqlite://” or “mysql://” followed by a DSN (data source name) as described by the database/sql package in Go.
This examples shows using SQLite3 storage for the JSON documents in a “collection.db” stored inside the “data.ds” collection.
dataset init data.ds "sqlite://collection.db"
Here’s a variation using MySQL 8 as the storage engine storing the collection in the “collections” database.
dataset init data.ds "mysql://DB_USER:DB_PASSWD@/collections"


Less than a year ago Oracle announced the Java EE and GlassFish Server Roadmap Update, which defined the end of commercial support for the Oracle Glassfish Server , which is (was) the fully supported release of the GlassFish Server Open Source Edition. In the last few months there has been plenty of comments about this move, some of the most remarkable are:
- GlassFish reduced to “toy product” as commercial offering axed
- GlassFish Commercial is Dead, WildFly and JBoss EAP to the Rescue
- Oracle removed GlassFish plugin for Eclipse
The motivation around this move are probably about Oracle not being keen on supporting two full app server implementations, Glassfish and Weblogic, which apparently makes sense from a commercial point of view. The problem here is that the two products are very different, and if you liked Glassfish usually hated Weblogic (but has somebody ever genuinely liked Weblogic anyway?). Glassfish is a lightweight, easy to install, fast to start, open source product, with a community around, while Weblogic is IMO one of the most bloated piece of software ever: the two products were addressing two very different Java EE markets, being Weblogic's the most lucrative one.
A reply to community's concerns, apparently from an Oracle representative:
"... GlassFish and WebLogic share quite a bit of code, and that helps with application and configuration portability between the two. So, organizations can continue to develop on GlassFish and leverage that development by deploying on WebLogic."
This is one of the most laughable sentences I have read in years: can anyone seriously think a company could develop and test in one application server but then deploy in production with another? Can anyone really assert that Glassfish and Weblogic are that similar? Just try to install both and judge yourself: you could start developing your first Glassfish application while Weblogic installer is still downloading...
Glassfish has always been a minor commercial player, but reducing the available options has never been a successful strategy for any ecosystem, and Oracle is supposed to lead this one. Below are the results of this leadership:
| glassfish, jboss, weblogic, websphere Job Trends | Glassfish jobs - Jboss jobs - Weblogic jobs - Websphere jobs |
If you care about open source but want / need to deploy into a commercially supported Java EE app server, you now have basically only a couple of options left: RedHat's JBoss EAP and Tomtribe's TomEE. Despite both are fine options, pulling out a minor but strategic member doesn't help arresting the progressive shrinking of the Java EE ecosystem, as differentiation and competition are king.
This is a pity, because Java EE is becoming more and more lean and easy.


Data-Driven Documents
JavaScript library for manipulating documents based on data
It allows to bind data to a Document Object Model (DOM)
It helps to bring data to life using HTML, SVG, and CSS
It’s functional style allows code reuse
It is extremely fast, supporting large datasets and dynamic behaviors for interaction and animation
Selections
Enter, Update and Exit
Transitions
Scales and Axes
SVG elements
Shapes
5 rectangle elements
select all rectangle elements that exist
"bind" data to the selections
Loop through each rectangle selection
Get passed in (data, index)
No rectangle elements??!
So what are we even selecting?
- An empty selection
"Magic"
var bars = svg.selectAll('rect')
.data(data, d => d);
bars.exit().remove();
var enter = bars.enter().append('rect')
.attr('width', rectWidth)
.attr('stroke', '#fff');
bars = enter.merge(bars)
.attr('x', (d, i) => i * rectWidth)
.attr('y', d => height - d)
.attr('height', d => d)
.attr('fill', d => colors(d));
Key function: controls which datum is assigned to which element
d3.scaleLinear()
.domain([min, max]) // input
.range([min, max]); // output
scale: mapping from data attributes (domain) to display (range)
var min = d3.min(data, d => d[city]);
var max = d3.max(data, d => d[city]);
var extent = d3.extent(data, d => d[city]);
var yScale = d3.scaleLinear()
.domain(extent)
.range([height, 0]);
Often used scales:
d3.scaleLinear()
d3.scaleLog()
d3.scaleTime()
d3.scaleBand()
var yAxis = d3.axisLeft()
.scale(yScale); // pass in a scale
d3.select('svg')
// create a group element we can translate
// so that the axis will be visible in SVG
.append('g')
.attr('transform', 'translate(40, 20)')
// selection.call(yAxis) is the same as yAxis(selection)
// and an axis will be created within the selection
.call(yAxis);
Define transition, syncs animation everywhere it's used
Animate height down to 0 before removing
Animate remaining < rect >'s height to their next state
Attributes set before .transition(): state A to transition from
If attributes not specified for A, d3 extrapolates from default
Everything after .transition(): state B to transition to


This specification describes support for rendering content for a WebXR session with WebGPU.
Status of this document
This section describes the status of this document at the time of its publication. Other
documents may supersede this document. A list of current W3C publications and the latest revision of this
technical report can be found in the W3C technical
reports index at http://www.w3.org/TR/.
Publication as an Editors' Draft does not imply endorsement by the W3C Membership. This is a draft document and may
be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any
patent disclosures made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has actual knowledge of a
patent which the individual believes contains Essential
Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
WebGPU is an API for utilizing the graphics and compute capabilities of a device’s GPU more efficiently than WebGL allows, with an API that better matches both GPU hardware architecture and the modern native APIs that interface with them, such as Vulkan, Direct3D 12, and Metal.


robotfindskitten v1.0.405
Move the robot (gray '#' character) around the screen using the arrow keys, WASD keys, vi
controls, or by swiping in the game area. Touch unidentified objects to identify them.
The game ends when you find kitten. Press "New Game" or the "ESC" key to start a new game.
Good luck, robot.


#include "superlu_ddefs.h"
Functions/Subroutines | |
| void | GetDiagU (int_t n, LUstruct_t *LUstruct, gridinfo_t *grid, double *diagU) |
-- Auxiliary routine in distributed SuperLU (version 1.0) -- Lawrence Berkeley National Lab, Univ. of California Berkeley. Xiaoye S. Li April 16, 2002
| void GetDiagU | ( | int_t | n, | |
| LUstruct_t * | LUstruct, | |||
| gridinfo_t * | grid, | |||
| double * | diagU | |||
| ) |
Purpose =======
GetDiagU extracts the main diagonal of matrix U of the LU factorization.
Arguments =========
n (input) int Dimension of the matrix.
LUstruct (input) LUstruct_t* The data structures to store the distributed L and U factors. see superlu_ddefs.h for its definition.
grid (input) gridinfo_t* The 2D process mesh. It contains the MPI communicator, the number of process rows (NPROW), the number of process columns (NPCOL), and my process rank. It is an input argument to all the parallel routines.
diagU (output) double*, dimension (n) The main diagonal of matrix U. On exit, it is available on all processes.
Note ====
The diagonal blocks of the L and U matrices are stored in the L data structures, and are on the diagonal processes of the 2D process grid.
This routine is modified from gather_diag_to_all() in pdgstrs_Bglobal.c.