Graphviz online
JNDI, Tomcat, and ClassLoaders
public <T> void bind(String name, Class<T> valueClass, T value) throws NamingException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Context c = new InitialContext();
Thread.currentThread().setContextClassLoader(valueClass.getClassLoader());
c.bind(name, value);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
public <T> T lookup(String name, Class<T> valueClass) throws NamingException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Context c = new InitialContext();
Thread.currentThread().setContextClassLoader(valueClass.getClassLoader());
return (T) c.lookup(name);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
I am passing the valueClass to bind() so that an interface can be used if wanted.
Problems of a modern, digital, open office
Off-shore oil rigs
When I was a kid in the 1970's I was fascinated with off-shore oil rigs. I was living in the UK and there was much news about developing the North Sea oil reservers. I would see short snippets on the TV of rigs on maiden voyages, and exciting photographs in magazines highlighting their intricacies. By today's availability of information these few images were as ephemeral as smoke on the wind. So off-shore rigs had a mystery and a fantasy around them. Earthbound space colonies. Nevertheless, I was, and continue to be, inspired by their engineering and the unmitigated confidence needed to build them.Now, of course, an internet search finds enough information to become an armchair expert in the off-shore oil industry. There are models to build. There is even, it seems, a sub-culture of 3D renders of them and other industrial sites (eg).
Photograph is of Norway's Draugen Oil Platform (src).
Computer assisted support for historical wargames will happen if...
My favorite wargames podcast is Meaples & miniatures. The hosts are all wargaming butterflies, and I mean this kindly, and so there is a good amount of new and old discussed and compared. Their 250th episode is their last of the Summer as they take a break to, well, rest and renew like the rest of the northern hemisphere. For this episode they are answering questions from their audience. I've not finished listening yet, but felt the need to bring a different perspective to one of their answers.
The question was whether or not an assistant computer application would be used in historical wargaming? Apps are appearing more regularly now for boardgames. Some of these boardgames have game mechanics and parts that are very close to those of miniature wargames. Even the forthcoming X Wing 2 is supposed to be app assisted. So, there is a trend in apps and there is a trend in wargames to be more like boardgames (in their initial costs and time commitments). An overlap is inevitable.
The hosts' common answer was one having to do with implementation rather than game play. They discussed how an app is dependent upon a general device, and a large networking and computing infrastructure. The general device being your phone which, for all practical purposes, you own but have little control over its OS or applications suite. The infrastructure being mostly the publisher's backend servers in data centers that run the core of the game programming; which, again, you have no practical control over. The hosts see these dependencies as the achilles heal of apps. They suggest that only large publishers have the money to continue to support a game that has passed its peek sales and so must sustain the game's implementation on smaller, incremental sales. While not said, and I expect that the hosts would agree, that it is optimistic to expect that any publisher would continue to support a game beyond its suitable profitability; ie, if profitability is too small then the company is better of discontinuing the game and use the freed-up resources on higher profit games. So apps are doomed!
Not so. There are implementations that do not require the publisher's continued support. First, some assumptions.
1. A phone or tablet is cheap enough to have a single, specialized use. The device is the game and it is the "rule book." Rule books are around US $15 to $50 these days. The device would be the same. The device will never be upgraded so the apps on it will continue working baring mechanical failure.
2. The device needs access to a messaging network. The messaging network is one where every device has a unique address and that a message can be sent to that address. If players are not colocated then a wide area network would be needed. The Simple Message System (SMS, ie texting) is one such network. There are others, but SMS is by far the most common, well supported, and almost future-proof given the world's telecoms commitment to it.
In many ways, the Kindle with 3G is an archetypal example of this device and network.
With such a device and network you can implement a multiplayer game very successfully. All the algorithms needed, eg peer to peer and modular co-operating services, are battle tested and open. The device's computational and storage requirements are minimal. The networking bandwidth needed is small, eg a few kilobytes, irregularly sent around to all player devices [1]. Embedded systems manufacturers have been designing and massively deploying just this kind of environment for years.
So, if you consider this different implementation of computer assisted support for historical wargames then the answer is yes, just as soon as gaming companies have lead engineers and architects that have a broader view of the devices and their communication. Now the real and important question can be asked, is historical wargames game play enhanced by having this assistant?
See my earlier posting $0.43 for Psychotherapist Barbie services about funding backend servers for toys.
[1] MMOs, massive multiplayer, online games, is a different beast. These systems do need a central or federated infrastructure.
Fourier Transform & Dubstep Drops
Two of my favorite recent finds.
But what is the Fourier Transform? A visual introduction.
12 years training for this role!
So far, my children's senior year of high school has been mostly wasted time. This is especially so as their graduation day comes ever closer. I propose that we alter senior year from one of listening from the back of the classroom to one of teaching from the front. It should be year when the seniors go out into all the lower grades, K through 11, and be teachers's assistants. Who else has a better understanding of how to be useful and successful in schools than do these young adults that have spent 12 years training for this role?
Sleeping dogs
Struggling to load Arabic text into MySql 5.6
- Ensure your database, table, and column use uft8mb4 character set.
create database XXXX character set 'utf8mb4' collate 'utf8mb4_unicode_ci'; create table ( ... ) ... character set 'utf8mb4' collate 'utf8mb4_unicode_ci';
- Ensure that the data file you are loading is UTF-8 encoded.
- Run the mysql client with the binary character set.
mysql ... --default-character-set=binary ...
- Load the data with the binary character set.
loading load data local infile 'XXXX.DAT' into table XXXX character set binary ( ... );
Good Terraform and AWS tutorial
The only trouble I had with the examples was that the initial ones assume that you have IP access via the AWS default security group. That might not be the case and so you will need to use the AWS console to allow your machine's public IP address ingress. To do this, go to the AWS Console, then to the EC2 dashboard, then to the Security Groups resource, and in that dialog select the default security group and add an Inbound rule for your public IP address.
Two masters
Patreon's self-inflicted death wound
I like that the Patreon service exists, but am just now discovering what a rip-off it has been for creators. When I give $1 to a creator Patreon takes a 5% cut, which was acceptable (if high), but then Patreon charges the creator for serving the payment. The servicing cost is between between 7-15%. I had no idea that Patreon did not assume the cost of service fees as part of their 5% cut. Now they want to shift the service fee to the patron via a 2.9% fee plus 35 cents on each pledge. My $1 is now going to be $1.38 (ie 100 + 2.9 + 35)! Patreon needs to rethink this change or discover how quickly they will be replaced as an intermediary.
See Funny money, Patreon Style.
Update: Patreon responds We messed up. We’re sorry, and we’re not rolling out the fees change.
Two kinds of noise
Three tweets in 100 square inches of screen space. (Large editorial photos and illustrations do not count as content.)
Which did you read first?
- I swear that no one reads email anymore.
- Anything after the first sentence, nay the first line, is never read.
- Perhaps I should only communicate via bullet points.
The quiet crisis unfolding in software development
4 skills you need to be successful in software development
The article is a half truth. There are 4 skills you need to be successful in software development. Two of these skills are needed to be successful anywhere and they are (1) coherent written & oral communications and (2) working well with others. Any university degree will develop these skills. The other two necessary skills are (3) having broad software development experience (both re/ tasks and teams) and (4) actually knowing the foundations of computer science. A useful programmer can get by for a long time having only skills 1, 2, and 3 but a successful programmer has skill 4. Critical thinking skills alone do not design a successful system nor do they diagnose the root cause of a problem.
I have been developing software programs and software systems for 37 years. I have met lots of very useful software developers in that time. I have met only a handful of successful software developers.
I would never build a team of only useful programmers.
Running out of entropy
You check on how many bytes of entropy are available using
cat /proc/sys/kernel/random/entropy_avail
Our counts are always less than 200. That is not enough. And so my concern is that I have a system that depends on random UUIDs that does not have enough entropy and so, so as not to block, it is using math to get randomness. I don't trust math randomness.
I don't yet have the full picture yet. Hopefully I will soon.
See Check available entropy in Linux.
Update: We have deployed haveged and available entropy is always over 1,000.
Slides for your generic talks
Recently we had the generic TED talk. I think I am going to start collecting the images that seem to be used by all talks. The inaugural image is, without a doubt the most used in more slides than any other, the iceberg.
