- 10:24 After a few print scans with 8800F, quality is good, but even at 2400dpi boy it takes time. Recommend:5% contr., 5% light, 5-10% saturation. #
Yet another rarely read blog.
Posted by zmeeagain from twitter at 12:41 pm 0 comments
Posted by zmeeagain from twitter at 12:41 pm 0 comments
Posted by zmeeagain from twitter at 12:41 pm 0 comments
Posted by zmeeagain from twitter at 12:41 pm 0 comments
Posted by zmeeagain from twitter at 12:41 pm 0 comments
Posted by zmeeagain from twitter at 12:41 pm 0 comments
It's been almost a month since my old K700i was put to rest for good and I bought the Samsung Omnia. I picked WM 6.1 as my first mobile OS, instead of Apple's OS X or Symbian or Linux. There are numerous reviews out there (check out gsmarena for example), but most concentrate on superficial first day use characteristics and specs instead of functional deficiencies, usability concerns, business aspects or programmatic abilities. This post is a personal account of the shortcomings and strengths I found in using Omnia daily in this past month. First of all this is not just a phone, this is mostly a PDA, so if all you want is a simple phone with a good camera, players etc go look somewhere else. It gets a lot of getting used to to familiarise yourself with Omnia. Although it's loaded with some great features, it requires someone quite comfortable with Windows OS, with installing custom applications, tweaking settings and generally good at finding their way in internet forums for help, apps, tips, hacks, solutions etc etc. Observations I bothered to collect:
Posted by zmeeagain at 8:49 pm 0 comments
Posted by zmeeagain from twitter at 5:55 am View Comments
Posted by zmeeagain from twitter at 1:33 pm View Comments
Posted by zmeeagain from twitter at 12:59 pm View Comments
Posted by zmeeagain from twitter at 1:05 pm View Comments
I've been using ISO paper sizes (A4, A3, etc) since the dawn of (my) time. I have even worked for a company that makes optimisation software for paper industries around the world. But I have never ever questioned the rationale behind their sizes. Well it turns out that the sizes are such that if you take any paper sheet of size An and fold it across the long side you'll get two An+1 sheets. So, if An has (x, y) dimensions, then An+1 will have (y, x/2) dimensions. Keeping the ratio constant gives us x/y = y/(x/2) or x/y = 2y/x hence x/y=sqrt(2)! So the aspect ratio of the sides for every paper size is 1:sqrt(2). In other words the ratio of any square's side to its diagonal. Given that A0 has this ratio and an area of 1sqm, we get the (0.841, 1.189) dimensions, and applying the halving process we reach the all too familiar A4 paper size of (0.210, 0.297). Since the sqrt(2) is an irrational number (1,4142135623730950488016887242097...), actual dimensions are always rounded to the nearest millimetre; there's even a type for calculating that but I'll spare you the details. ISO 216 has all that and more. For a free summary of the standard you may also have a look at Wikipedia.
Posted by zmeeagain at 11:40 am 0 comments
A friend of mine wondered the other day if one-pass tree pruning was possible. Common sense dictates that a two-pass algorithm is required to first mark the subtrees due for deletion and then a second walk to do the actual pruning. I have since revisited this thought and managed to get a one-pass proof of concept:
boolean pruneTree(Iterator parentIterator, TreeNode root, Set allowedNodeValues) {
boolean pruneNode = true;
Iterator nodeIterator = root.getChildren().iterator();
while (nodeIterator.hasNext()) {
TreeNode child = nodeIterator.next();
pruneNode = pruneTree(nodeIterator, child, allowedNodeValues) && pruneNode;
}
pruneNode = pruneNode && !allowedNodeValues.contains(root.getValue());
if (pruneNode && parentIterator != null) {
parentIterator.remove();
}
return pruneNode;
}
This will remove parts of the tree whose node values are of no interest to us, otherwise retaining the same structural properties as those of the original tree:
a a
/ \ / \
b c b c
/ \ | \ pruneTree(it, a, {a,b,c,d}) --> / |
d e b e d b
| / \
c d f
To make sure this was doing what was meant to do, a pretty print method was necessary. I used indentation and nested parentheses (with slight adjustments from Knuth's original):
void printTreeIndented(TreeNode root, int currentDepth) {
System.out.println();
for (int i = 0; i < currentDepth - 1; i++) {
System.out.print("\t");
}
System.out.print(root.getValue());
currentDepth++;
for (TreeNode node : root.getChildren()) {
printTreeIndented(node, currentDepth);
}
}
void printTreeParenthesized(TreeNode root) {
System.out.print(root);
List children = root.getChildren();
if (children.size() == 0) {
return;
}
System.out.print('(');
printTreeParenthesized(children.get(0));
for (int i = 1; i < children.size(); i++) {
System.out.print(", ");
printTreeParenthesized(children.get(i));
}
System.out.print(')');
}
The first one will print:
a
b
d
e
c
c
b
e
d
f
while the second will print a(b(d, e(c)), c(b, e(d, f)))
.
Unfortunately after some runs I realised that the tree pruning algorithm's performance is dismal; it prunes by removing nodes bottom up, one by one. After all, it has no other way of knowing what to prune in one pass. Compare this with a fast mark pass and a second prune pass whereby whole sub-trees can be pruned. What's worse, as it's written, it runs out of heap space for large trees with more than a handful of levels. I guess the question is, does anybody know of any fast one-pass tree pruning algorithm?
Posted by zmeeagain at 5:58 pm View Comments
Posted by zmeeagain from twitter at 1:12 pm View Comments
Posted by zmeeagain from twitter at 1:07 pm View Comments
Posted by zmeeagain from twitter at 1:23 pm View Comments
Posted by zmeeagain from twitter at 1:22 pm View Comments
Posted by zmeeagain from twitter at 11:42 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
How many times have you received an image-laden email that can't quite show itself properly and instead you get the source? This is a recent email I received in Outlook:
Return-Path: <sender@gmail.com>
X-Original-To: you@somedomain.com
Delivered-To: you@somedomain.com
Received: from localhost (localhost [127.0.0.1])
.
.
.
by Subject: More 3D Chalk Drawings by Julian Beever!
In-Reply-To: <BAY123-DS3D0865B1F4499DF30C37EA6310@phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_66037_8745117.1224059387776"
References: <BAY123-DS3D0865B1F4499DF30C37EA6310@phx.gbl>
To: undisclosed-recipients:;
------=_Part_66037_8745117.1224059387776
Content-Type: multipart/alternative;
boundary="----=_Part_66038_2852077.1224059387777"
------=_Part_66038_2852077.1224059387777
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Excellent, as usual!
------=_Part_66038_2852077.1224059387777
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<div dir="ltr"><div class="gmail_quote"><br><br><br>
.
.
.
</div><br></div>
------=_Part_66038_2852077.1224059387777--
------=_Part_66037_8745117.1224059387776
Content-Type: image/jpeg; name=image008.jpg
Content-Transfer-Encoding: base64
Content-ID: <image008.jpg@01C92D89.A8F97520>
X-Attachment-Id: 0.8
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
.
.
.
d1qMmLqKKoagXqjRKiijQgpXJWePioorETGoxVvRRRUf/9k=
------=_Part_66037_8745117.1224059387776--
This is a mime-multipart html mail, that's got a few image/jpeg parts. To get the image(s) out of it, save it as .msg
somewhere and open it with an editor (e.g. Notepad++). Look for the image part you're interested in:
Content-Type: image/jpeg; name=image008.jpg
Content-Transfer-Encoding: base64
Content-ID:
Then strip everything off leaving only the base64-encoded image payload that appears beneath (the one that starts with /9j/
and ends in /9k=
in our example). Save as say img-base64.txt
. This should now look like:
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7
...
JW+6Mj+7T9ixQoEAUFQTiqxPzn61zyep0QWhE4PULioGUk8mrjAbajYcGkiim2egpsSkvz0qcgUi
EjpSY0i1Gp2/KpxRUauxH3jRUG1j/9k=
This is your image, base64 encoded. The "save as .msg
" bit was necessary as what's shown in Outlook is fiddled with and will not decode properly.
Now there are several options on how best to proceed. You may use Notepad++ builtin base64 decoding capabilities (TextFX, TextFX Tools, Base64 Decode) and save it as .jpg
. Or, if Notepad++ is not available, you may use a command line utility for that, like the excellent base64 by John Walker.
Few people are aware though that the base64 payload can be used directly into html pages, letting the browser do all the hard work! The simplest way is putting the payload in an <img>
element:
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA...UG1j/9k="/>
Likewise in a CSS background:
div.image {
background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA...UG1j/9k=);
}
This paradigm applies to other types of entities not just images. CSS stylesheets and javascript scripts can also appear as base64 encoded payloads in html pages. I will simply reiterate here two examples by Grey Wyvern:
<link rel="stylesheet" type="text/css" href="data:text/css;base64,LyogKioqKiogVGVtcGxhdGUgKioq..." />:
<script type="text/javascript" href="data:text/javascript;base64,dmFyIHNjT2JqMSA9IG5ldyBzY3Jv..."></script>
Now, I don't know why anyone would want to do that with javascript in particular, since base64 encoding bloats original size by a factor of 4/3, other than a perverse pleasure of tinkering about.
Posted by zmeeagain at 8:46 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
I thought that spamming was an issue of the past. Not because spammers have ceased bombarding email addresses with all sorts of unthinkable propositions, but because now we have the means to render their assaults harmless. It's been ages since the last time a spam email transpired into my [Inbox] instead of going straight to [Spam]. Some people though employ this and that in a vain attempt to hold back the very dumbest of spammers out there hunting for valid email addresses. Historically, the most popular way of hiding an email is by replacing @ and . characters with words:
zmeeagain[at]gmail[dot]com
One can think many variations on this, but they all obey the same principle. I read a personal page the other day using a context-sensitive approach:
mylastname@domain.com
This obviously can be used in conjunction with the previous technique. Some organisations have also relied upon context to camouflage their emails by omitting the domain part altogether, so firstname.lastname@domain.com
becomes simply firstname.lastname
and they do not allow employees to maintain contact lists in their email clients; marvellous.
Instead of disclosing their email addresses many incompetent companies provide a mostly ill-designed kind of contact form that does not let you use any other client or know whether a man or /dev/null is handling your email.
More recently, emails have started to appear as distorted images of the actual email text, much like a simple captcha:
Alternatively, one may want to prepare a static flash file specifically for hiding your email.
Carnegie Mellon have taken this a step further with their reCAPTCHA Mailhide application. The email (or part of it) is replaced with a link that shows you a captcha. If you solve the captcha then the full email address is shown to you, otherwise you are asked to solve another captcha. All challenges are random and you can switch to audio challenges too:
zmee...@gmail.com
Others have come as far as suggesting using Javascript XORing. The idea is you take a normal email link like <a href=mailto:zmeeagain@gmail.com>zmeeagain@gmail.com</a>
, XOR each character with some key to get the XORed version, and then serve that together with a script that will dynamically XOR this back to the original link using the same XOR key of course. The idea is to make life difficult for scouting bots since the html page will only have the script and the XORed email. Anoop Sankar demonstrates an example of that technique.
Sarven Capadisli reports a few other options. One notable example uses CSS to reverse the direction of text in a inversely written email:
span.codedirection { unicode-bidi:bidi-override; direction: rtl; }
<p><span class="codedirection">moc.liamg@niagaeemz</span></p>
As for myself, I've already made it readily available to spammers worldwide. Here it is once more: zmeeagain@gmail.com.
Posted by zmeeagain at 9:44 pm View Comments
Posted by zmeeagain from twitter at 11:42 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:42 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:41 am View Comments
Posted by zmeeagain from twitter at 11:40 am View Comments
Posted by zmeeagain from twitter at 1:43 pm View Comments
Posted by zmeeagain from twitter at 11:37 am View Comments
How I've always hated all those people using TinyURL versions of otherwise perfectly legible urls in the vast white expanses of their normal 1280x1024 web pages. This moronic habit made you think that these links were most likely cover ups for god-knows-what phishing, porn, cracks, illegal pills sites they led to. Until Twitter came about and TinyURLs made sense all of a sudden. There's a great Firefox add-on for that, TinyUrl Creator by Jeremy Gillick. Can't tweet without it I tell you that.
Posted by zmeeagain at 7:13 am View Comments
Funny how the name of the Byzantine Generals Problem came about. This is an account by Leslie Lamport:
There is a problem in distributed computing that is sometimes called the Chinese Generals Problem, in which two generals have to come to a common agreement on whether to attack or retreat, but can communicate only by sending messengers who might never arrive. I stole the idea of the generals and posed the problem in terms of a group of generals, some of whom may be traitors, who have to reach a common decision. I wanted to assign the generals a nationality that would not offend any readers. At the time, Albania was a completely closed society, and I felt it unlikely that there would be any Albanians around to object, so the original title of this paper was The Albanian Generals Problem. Jack Goldberg was smart enough to realize that there were Albanians in the world outside Albania, and Albania might not always be a black hole, so he suggested that I find another name. The obviously more appropriate Byzantine generals then occurred to me.
Posted by zmeeagain at 6:58 am View Comments
I recently had to move all of my Outlook 2007 stuff to 2002. First issue: Outlook 2007 does not give you any option to export to an older data file format. The one used by 2002 has smaller capacity (read: different format) and no Unicode support. There is a way around this: create a data file in the older Outlook 97-2002 Personal Folders file (.pst
) format and import items from the newer data file format to the older .pst
file format. Then import that .pst
into Outlook 2002. You can read more about .pst
data files in different versions of Outlook here.
Posted by zmeeagain at 8:53 am View Comments
This is a diagram from Reviel Netz and William Noel's book [The Archimedes Codex] How a Medieval Prayer Book Is Revealing the True Genius of Antiquity's Greatest Scientist . It's part of Archimedes' proof that a parabolic segment is four-thirds the triangle it encloses and it's particularly astonishing. Most of us I'm sure have the silly figure of a naked man jumping out of a bath shouting "eureka" in our minds when we hear the word Archimedes. This extraordinary little book does a great job revealing the magnitude of this genius. I was shocked at how much I didn't know about who Archimedes was and what he had accomplished...
Posted by zmeeagain at 7:46 pm View Comments
I am very happy with Google Calendar's syncing with my Outlook. I don't have Microsoft Exchange at work so I can only share my calendar through Google. That is all right, after all that's the whole point of having your calendar online. Or, is it? Not quite! Whenever you go to Google Calendar's first page, and you're not logged in, you have two options: log in or sign up. Yes, no search for somebody else's public calendar. You have to go through the usual Google search route for that. You can send your friends an html link (mine is here) or an ical entry of your calendar, but that's certainly not practical. What's more, each calendar has its own unique link (fine) but what happens if someone wants to see your merged public agenda? To top it all, a private event with "Show me as busy" in a public calendar still shows up when shared, complete with the event's time info and a telling, for-those-in-the-know (or for-those-in-the-law at other times, depending on the event), "busy" title. That's not very private to me.
Posted by zmeeagain at 6:29 pm View Comments
For all tea aficionados, this Darjeeling Fine Tippy Golden Flowery Orange Pekoe is the "champagne" of teas, as Fortnum & Mason calls it. It is Darjeeling 1st & 2nd flush only, grown on the Himalayan foothills, one of the highest-grown and a rather lighter black, almost greyish tea, that, simply put, has no rival. Even at double the cost of other good quality teas this variety is in a league of its own, and one will have to search high and low to find a better one.
Posted by zmeeagain at 7:21 pm View Comments
After 9 years of what I, back then, thought of as an absolutely superb pair of headphones, both in looks and in sound quality, I went ahead and replaced them with the ones in the picture above. Friends usually accuse me of overreaching myself. This purchase was definitely a case in point. I started out considering a good pair of audiophile headphones, then I found out that I could afford a much better set if ordered on the web, for the same price, like the Sennheiser HD595. Next thing I know, I was already ordering the top of the range Sennheiser HD650 from eBay... Going from a 40 euro to a $600 piece is like going from a Citroen 2CV to a Bugatti Veyron so my blog entry may not attest to their astonishing sound. Here's some hard facts:
Posted by zmeeagain at 7:49 pm View Comments
When chairman Greenspan speaks, the world listenssaid Bill Clinton back in May 2000, and this statement alone is bold enough for this book to be high on one's reading list. I am not going to comment on whether the actual economic policies during his tenure were right or wrong. Greenspan presents his support for free markets in a persuasive manner and the analysis of the US and world economy's underlying principles and powers both in a historical and recent context is particularly illuminating. I guess the writing, compared to the Fedspeak many people were used to, is unencumbered by such things as, well, the Fed Chairmanship. However, don't hold your breath for any spectacular revelations; the style is rather dry but lucid. Perhaps the most fascinating aspect of this book is his observations on past presidents, from Nixon to Bush II. The analysis of other main economies in Europe and elsewhere is also very interesting, though it appeals more to non-US readers. Definitely worth reading.
Posted by zmeeagain at 12:19 pm View Comments