Oct. 12th, 2014

andrewducker: (witch)
On the way into town for breakfast at the Edinburgh City Cafe, I spotted a symbol on the outside of a block of flats that I didn't recognise, but looked like Arabic to me.



I posted it on Facebook, and got a bunch of suggestions as to what it might be, and who might be able to help - including a few that it might be Hebrew instead.

Hebrew looks like this:

while Arabic looks like this:


And the symbols in the image looked more like the curves of Arabic than the angles of Hebrew. But a few people also suggested Masonic symbols, so I walked back down the road after we got home and took another, better photo:
The mystery....resolved! )
andrewducker: (Zim Doom)
Every time I use Java I find myself wondering whether the people in charge of its libraries are determined to make everything harder than necessary.

In JavaScript I can use promises and chain code together like so:

http.fetchSomething(myUrl)
.then(function(result){return saveTheResultAsynchronously(result);})
.then(function(furtherResult){displayTheResult(furtherResult);});

And provided the various methods return promises each "then" will be called once the previous bit of functionality has finished running, allowing them to be chained together really easily.

C# uses async/await for make things easy too.

Java, on the other hand, has "Future" as a type, which is the equivalent of a JS Promise - but one that doesn't allow for callbacks. Your options are to either poll "is it done yet?" repeatedly or to block the thread. There's no equivalent of "Then", which makes it really hard to run code when something finishes, let alone chain asynchronous methods together one after another.

You'd think that "Do X, and then when X is done, do Y" would be a basic requirement for any kind of asynchronous processing, but apparently the Java library creators disagree...

April 2025

S M T W T F S
   1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 2223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 23rd, 2025 08:03 am
Powered by Dreamwidth Studios