David Welton: Hecl Java Integration
Yesterday, I took the Java integration I'd been building into the Hecl Android port, and moved it into its own directory, so now it's built in to the command line/j2se (non JavaME) version of Hecl for people to experiment with. Here's a slightly modified version of my posting on the subject:
I created a java/ subdirectory with an org.hecl.java package that does a few things. The core of the system is in JavaCmd and Reflection. The first creates commands out of Java classes. It utilizes, obviously, the reflection stuff in Reflection. Both are, at the moment, sort of hacky and tentative, but work. For instance, I checked in this bit of test suite today:
test java-2
java java.util.Hashtable ht
set hasht [ht -new ]
$hasht put foo "bar"
$hasht get foo
bar
The 'java' command takes a class, and string, and creates a new Hecl command 'ht' that is tied to the Hashtable class.
ht -new (could have been -new [list]) is how we call the constructor. After this, $hasht points to a Hashtable, and we can utilize its methods. Up to a point, at least - there have to be mappings in Reflection to deal correctly with types. For instance, there isn't a mapping for Enumeration right now, so calling the
.keys() method wouldn't do the right thing.
There are some more bits and pieces of magic:
- Static methods are called like this:
Which callsjava java.lang.System sys sys gcSystem.gc(). - Static fields, for now, are called like this, although once again, I'm still thinking about the syntax:
Which is of coursesys -field errSystem.err - In addition to -new, when you instantiate an object, you can pass in things like
-text "foo", and that will attempt to callsetText("foo"). This is a convenient way, in Android, at least, of setting up an object from within Hecl, without requiring the use of the XML layout files. - Furthermore, in order to deal with constants in a convenient way, something that's reasonably common in certain types of API's (like Android), the following pieces of code are equivalent:
What's happening in the Hecl code is that VERTICAL is looked up in the context of the class that's calling it, so as to avoid having to do [layout -field VERTICAL] to fetch the value. This won't work everywhere, and I suppose it could be criticized as too much 'magic'. Naturally, these sorts of things will evolve as the code does, and survive if they're useful and don't create problems, or die out if they cause bugs and aren't utilized.layout.setOrientation(LinearLayout.VERTICAL); $layout setorientation VERTICAL
- I like the API for already instantiated objects, but I'm not 100% wedded to the idea of -new for instantiation. The fact that it takes a list is also a bit tricky, because if you want to do something like construct an argument to be passed in, you might end up with something like this:
which I don't find all that pleasant. You can't just docallback -new [list [list SelectDemo $spinner]]-new [list SelectDemo $spinner]because then it thinks it's got two arguments, when it really only has one, which happens to be a list. - The APIs created like this tend to follow Java pretty closely, for obvious reasons, and can be a bit verbose at times. I'm still thinking about this. One idea might be to provide Hecl wrappers that make common operations easier.
I'm looking for a scanner, with the following requirements:
Introducing biometric authentication in our systems is a very good idea. It is the key to
Congratulations to Yves-Alexis Perez (Corsac), Nicolas Fran ois (Nekral) and Sune Vuorela (Pusling) too \o/
Finally, some accounts (~30 ?) were created and i’m in.
Thanks to all people involved in Debian and Kubuntu. In particular (no order) my co-maintainers, sponsors, helpers and application manager:
Someone commented rightfully that I should explain how I got debian installed on the DG33TL.
* I was too tired to write this yesterday. Yes, it was very hectic day (but great fun!). Things started very well. Sam and Bubulle did great presentations (specially,
I spend quite a long time to fully configure my new Thinkpad X60s laptop. This will be my work computer and i wish to use Debian Etch on it. Since it is for my job, i want to use a stable debian release. The aim of this laptop is to always have something that works -- to keep focus on my job.
The configuration was tricky because there is a lot of people reporting that everything works with this laptop, but not a lot of people describing problems they encounter. Here is a list:
Sound:
The people who think the default wiki.d.o theme is nice, should think again. Thanks to an anonymous reader I was pointed to
Like most things, the scale of decisions that have to be made by a person
or organisation fall across a wide spectrum. At one end, you've got the
fine-detail work: lines of code, individual config settings, IP addresses,
that sort of thing. This is crucial work, because it's this detail that
ultimately produces saleable results. Travelling all the way to the other
end, there's the "big picture" decisions: the "visionary" stuff. What
market segment will we target? What will we do (in large-scale terms)
to get there?
I am convinced that individuals naturally gravitate towards one end of this
spectrum or the other, depending on their psychology. While people usually
can work at all scales, they have a "most comfortable" point where they
work the most naturally. The further away from this point they are pushed,
the less comfortable and effective they are.
No level of thinking is better or worse than the other; they're just
different. While "large scale thinker" and "small scale thinker"
could be taken as being insulting, I certainly don't mean it that way.
I should point out that "Strategy" isn't (just) about setting goals. A
strategist isn't someone who comes out with grand pronouncements like "By
the end of next year this company should be providing telecommunications
services to 20% of the Fortune 500" without knowing how to get there.
That's not a strategist, that's a poor-quality management consultant.
People whose only skill is making vague pronouncements should just be taken
out and shot. They're not doing anything useful for anyone.
A strategist is someone who is good at planning the goal of "20%
of the Fortune 500". They're thinking about the big picture issues,
without getting bogged down in the minutiae. A tactician, given the job of
planning something at the macro scale, will chase some good idea down an
intricately detailed rabbit hole, and miss the other dozen or so large
issues that need to be considered. The strategist's planning needs to stop
at a certain level and let other people take on the detail work.
Conversely, a good tactician can focus on the individual details
without getting distracted by the big picture. A strategist put into a
tactical role will miss all the important minutiae because they're working
out how their little part fits into the big picture, instead of working out
how to make their little part work, in and of itself.
It's important, for individual happiness, to try and work out what level
you're most comfortable thinking at, and then trying to find a job that
puts you there. It's almost as important to make sure that the people who
are working at the more and less detail levels around you are equally
comfortable.
Take, for example, the micromanager. We've all either been there ourselves
or have heard multiple stories on the subject. I think the micromanager is
nothing more than a person who wants to work at a smaller scale than they're
being forced to by their organisational rank. Since they can't do
the detail work any more, their only outlet is working vicariously through
their subordinates. Voila! Instant micromanagement.
An even more painful case of micromanagement would be when the subordinate
wants to think at a larger scale than the superior. In that case, the
subordinate will naturally be thinking large scale, and will miss the
details. To the small scale thinking superior, that is incompetence, and
will naturally be dealt with by more micromanagement. In reality, both
parties are incompetent at their jobs, and they should really swap roles,
so that everyone is in their element.
It would be nice if companies stopped thinking hierarchically in this way
-- that a more "senior" person has to think at larger levels. Just because
you've been somewhere longer (or have been working in an industry longer, or
got higher marks, or whatever), it doesn't mean that you're more of a
strategist. This is probably the Peter Principle restated: people get
promoted to a level where they just can't comfortably think at the necessary
scale any more. If instead people were put into a planning hierarchy based
on their natural scale of thinking, we'd all be a lot better off. There'd
be a lot less power games, though, which makes me think it's not going to
happen any time soon.
A business, at whatever size it might be, needs an appropriate mix of
strategists and tacticians. A really small business (1-10 people) can get
away without needing large scale thinkers, in the same way that a really
small boat can get away without needing a rudder or pilot. If a really
small boat gets itself into trouble, everyone on board can grab an oar or
bucket and help get the boat out it's predicament -- it's small and nimble
enough to be able to do that.
As the company expands, though, it's important to make sure you've got some
strategists around. If you don't have anyone to keep an eye out for
problems and plan around them, your small-to-medium sized boat is likely to
have a hole punched in it by a submerged rock. Even if somebody on board
happens to notice the rock before you actually hit it, once you get to a
certain size you can't physically stop or turn the boat in time.
If you don't understand the growth issues in the company, you might not
even realise that you're no longer the nimble and low-inertia dinghy until
you're up to your knees in sea water.
Although an obvious solution to this problem might be to say that all
businesses should be small and nimble ones, it's as impractical as saying
that all boats should be dinghies. A fleet of dinghies isn't going to be
able to support the worldwide sea freight market, and a fleet of small
companies doesn't have the necessary resources on hand to take on the big
projects that are so often needed. Also, a dinghy is at risk of being
swamped by one freak wave, while a larger ship can weather significant
storms without going under.
Regardless of the size of the business, there always needs to be a good
supply of tacticians. A boat (of whatever size) full of people who are all
looking out for rocks isn't going to go anywhere, because nobody's making
the thing move. Similarly, a company full of strategists isn't
going to be doing any of the day-to-day work that actually earns money, and
no money means no company.
The single most important thing, though, is be self-aware enough to know
what sort of person you are, and try to find something that lets you work at
the level you're most comfortable at. Otherwise you're just setting
yourself up for unhappiness.




I'm organizing a micro-
If you're interested in working upon your CV/Resume, as
New Gammu testing versions is out. This time there are no exciting new
features, I still continue in bug fixing mode and cleaning up things. Full
list of changes:
It was a very long time ago since I did my last resume and never found the energy to update (or translate it to English) so I thought it was nice to have this kind of information about myself. It was nice since it gave to me a nice impressions of events I participated and like.
I’ve decided to do my resume using LaTeX (I use it for majority of my documents) and started to browse the web to find something useful to use as basis. I ended up finding
… or something like that… I planned to write a short note about how to start with using git-svn so I can provide a pointer to some of my colleagues. It turned out that git has too many nice features that you should be aware of. 