-
Nested fluent builders
Crossposted from the Transylvania JUG website. Builders have become commonplace in current Java code. They have the effect of transforming the following code: new Foo(1, 5, “abc”, false); Into something like Foo.builder() .count(1) .priority(5) .name(“abc”) .canonical(true) .build(); This has the advantage of being much easier to understand (as a downside we can mention the fact…
-
Passing UTF-8 trough HTTP
These days we should write every code as if it will be used by international people with a wide variety of personal information (just look at Falsehoods Programmers Believe About Names for some headscratchers). I would like to do add my small contribution to this by showing how UTF-8 encoded strings can be passed into…
-
Connecting to the MtGox market data feed using Perl
For a recent project I needed some realistic market data for an electronic exchange. Seeing how MtGox provides free and open access to theirs (thank you!) I chose them. However none of the examples floating around the internet seemed to work, so I whipped one up using Net::Async::WebSocket::Client. Enjoy: use IO::Async::Loop; use Net::Async::WebSocket::Client; my $client…
-
Converting datetime to UTC in python
So you need to convert a python datetime object which has a timezone set (“aware” in the Python nomenclature) to an UTC one with no timezone set (“naive”), for example because NDB on GAE can’t store anything else. The solution will look something like this: date = date.astimezone(tz.tzutc()).replace(tzinfo=None) For searcheability: the exception thrown by NDB…
-
Recovering your RoTLD password for domains registered trough Gandi.NET
If you need to “recover” your RoTLD password when the .RO domain is registered trough Gandi.NET (I say “recover” because you didn’t set it in the first place :-)) – do this: In the Gandi interface go to Account Management -> Update account information and set “Anti-spam system” to No Go to the RoTLD password…
-
Free software for Windows
Inspired by this post I decided to list the software I use/recommend under Windows. Free/Libre Open Source Software: LibreOffice (for of OpenOffice) – a very capable office solution. Most people don’t need anything more than this. If you are installing it for a non-technical user, make sure to set the default file formats to the…
-
What every programmer should know about X
Piggybacking on some memes floating around on the internet I would like to publish my list of “what every programmer should know”. A couple of introductory words: in my opinion the two most important things to learn for new programmers are terminology – to know what things / ideas / algorithms / concepts are called…
-
Ensuring the order of execution for tasks
This post was originally published as part of the Java Advent series. If you like it, please spread the word by sharing, tweeting, FB, G+ and so on! Want to write for the Java Advent blog? We are looking for contributors to fill all 24 slot and would love to have your contribution! Contact Attila…
-
Java Runtime options
This post was originally published as part of the Java Advent series. If you like it, please spread the word by sharing, tweeting, FB, G+ and so on! Want to write for the Java Advent blog? We are looking for contributors to fill all 24 slot and would love to have your contribution! Contact Attila…
-
Changes to String.substring in Java 7
This post was originally published as part of the Java Advent series. If you like it, please spread the word by sharing, tweeting, FB, G+ and so on! Want to write for the Java Advent blog? We are looking for contributors to fill all 24 slot and would love to have your contribution! Contact Attila…