Java Stream Methods and Unix Pipeline Commands: A Dictionary
While preparing my class notes for functional programming in Java
I was struck between the neat correspondence between many Java Stream
methods and Unix commands.
I decided to organize the most common of these in a dictionary form
that allows the mapping between the two.
I’d very much welcome comments regarding common patterns that I’ve missed.
Continue reading "Java Stream Methods and Unix Pipeline Commands: A Dictionary"Last modified: Thursday, December 6, 2018 9:42 pm
Programming Languages vs. Fat Fingers
A substitution of a comma with a period in project Mercury's working Fortran code compromised the accuracy of the results, rendering them unsuitable for longer orbital missions.
How probable are such events and how does a programming language's design affect their likelihood and severity?
In a paper I recently presented at the
4th Annual International Workshop on Evaluation and Usability of Programming Languages and Tools
I showed results obtained by randomly perturbing similar programs written in
diverse languages to see whether the compiler or run-time system
would detect those changes as errors,
or whether these would end-up generating incorrect output.
Continue reading "Programming Languages vs. Fat Fingers"Last modified: Wednesday, December 5, 2012 10:40 am
Why are AWS Command-Line Tools so Slow?
Amazon's Elastic Compute Cloud command-line tools are useful building
blocks for creating more complex shell scripts.
They allow you to start and stop instances, get their status,
add tags, manage storage, IP addresses, and so on.
They have one big disadvantage: they take a long time to run.
For instance, running ec2-describe-instances for six instances
takes 19 seconds on an m1.small AWS Linux instance.
One answer given,
is that this is caused by JVM startup overhead.
I found that hard to believe,
because on the same machine a Java "hello world" program executes in 120ms,
and running ec2-describe-instances --help takes just 321ms.
So I set out to investigate, and, using multiple tracing tools and techniques,
this is what I found.
Continue reading "Why are AWS Command-Line Tools so Slow?"Last modified: Saturday, June 2, 2012 0:14 am
How to Decrypt "Secrets for Android" Files
Secrets for Android
is a nifty Android application that allows you to securely store
passwords and other sensitive data on your Android phone.
Your data are encoded with your supplied password using strong
cryptography and are therefore protected if your phone gets stolen.
Although the application offers a backup and an export facility,
I found both wanting in terms of the availability and confidentiality
associated with their use.
Continue reading "How to Decrypt "Secrets for Android" Files"Last modified: Thursday, February 9, 2012 0:19 am
A Tiny Review of Scala
Earlier today I finished reading the
Programming in Scala book.
My review of the book should appear soon in the
reviews.com site and the
ACM Computing Reviews.
Here I outline briefly my view of the
Scala language.
Continue reading "A Tiny Review of Scala"Last modified: Wednesday, July 22, 2009 7:32 pm
Greek Numerals in OpenOffice.org
OpenOffice.org
doesn't support Greek numerals,
and this is a problem for its Greek localization,
because such numerals are often used for section and list numbering.
As an exercise in large scale
code reading and in the
writing of code I'm supposed to teach to undergraduate students,
I decided to contribute an implementation to OpenOffice.org.
Continue reading "Greek Numerals in OpenOffice.org"Last modified: Thursday, June 25, 2009 9:27 pm
Fixing the Orientation of JPEG Photographs
I used to fix the orientation of my photographs through an application
that would transpose the compressed JPEG blocks.
This had the advantage of avoiding the image degradation of a
decompression and a subsequent compression.
Continue reading "Fixing the Orientation of JPEG Photographs"Last modified: Sunday, June 14, 2009 8:20 pm
A Tiling Demo
Over the past (too many) days I've been preparing my presentation for the
ACCU 2009
conference.
At one point I wanted to show how loop tiling increases locality of reference
and therefore cache hits.
Surprisingly, I could not find a demo on the web, so I built one from scratch.
Here are two applets demonstrating memory accesses during a matrix raise to the
power of two operation.
Continue reading "A Tiling Demo"Last modified: Tuesday, April 21, 2009 5:39 pm
UMLGraph Version 5.1
Over the summer two articles presented
UMLGraph to the masses.
Paul Duvall wrote on IBM developerWorks an article titled
Automation for the people: Pushbutton documentation, and
Meera Subbarao published on DZone Javalobby another piece on how to
reverse-engineer source code into UML diagrams.
In addition, I received a number of interesting patches and contributions.
As a result I decided it was time to release UMLGraph version 5.1.
Continue reading "UMLGraph Version 5.1"Last modified: Wednesday, August 27, 2008 8:28 pm
The Mysterious TreeMap Type Signature
For my lecture notes on file handling
I wrote a small Java program to display the number of characters
that fall in each
Unicode block,
and got bitten by an unexpected
runtime error.
Angelika Langer,
a wizard of Java Generics, kindly provided me with an explanation
of the JDK design,
which I'd like to share.
Continue reading "The Mysterious TreeMap Type Signature"Last modified: Wednesday, January 23, 2008 11:34 am
Curing MIDlet Bluetooth Disconnects
Over the last few days I've been writing a
MIDlet
to collect GPS coordinates and cell identifiers.
I'm doing this
in an effort to look at what algorithms might be needed
in order to implement something similar to Google's
My Location
service.
Here is a Google Earth example of the data I'm collecting.
Yesterday,
I reached a point where I was collecting all the information I needed,
but the program was often plagued by random disconnections of the Bluetooth
link to the GPS.
Continue reading "Curing MIDlet Bluetooth Disconnects"Last modified: Friday, January 4, 2008 1:13 pm
An Update on UMLGraph
Today I released version 5.0 of UMLGraph.
This release contains a couple of important changes: six new shapes
(components, nodes, collaborations, use cases, notes, and active classes),
a facility for adding notes, and the hosting and packaging under its
own domain name umlgraph.org
.
Continue reading "An Update on UMLGraph"Last modified: Thursday, November 29, 2007 5:40 pm
Using the Open-Sourced Java Platform
Having access to a system's source code is liberating.
I've felt this since I first laid my eyes on the source code of the
9th Edition Unix in 1988, and I saw this again as I used the freshly
open-sourced Java platform
to implement a UMLGraph
feature that has been bugging me for more than a month.
Continue reading "Using the Open-Sourced Java Platform"Last modified: Thursday, May 10, 2007 5:23 pm
Make vs Ant: Observability
I've long felt uncomfortable with ant
as a build management tool.
I thought that my uneasiness stemmed from the verbose XML used for
describing tasks, and the lack of default dependency resolution.
Today, email from a UMLGraph user
struggling with a complex ant task
made me realize another problem:
lack of observability.
Continue reading "Make vs Ant: Observability"Last modified: Thursday, March 15, 2007 4:04 pm
The Verbosity of Object-Oriented Code
As I refactored a piece of code from an imperative to an
object-oriented style I increased its clarity and reusability,
but I also trippled its size.
This worries me.
Continue reading "The Verbosity of Object-Oriented Code"Last modified: Monday, September 25, 2006 0:32 am
Code Quality: The Open Source Perspective
My new book
Code Quality: The Open Source Perspective
got published,
three years after I started writing it.
The book owes more to open source software than any of the books
dealing with Linux, PHP, Apache, Perl or any other book covering
a specific technology.
Continue reading "Code Quality: The Open Source Perspective"Last modified: Wednesday, April 12, 2006 12:05 am
Efficiency Will Always Matter
Many claim that today's fast CPUs and large memory capacities make
time-proven technologies that efficiently harness a computer's power irrelevant.
I beg to differ, and my experience in the last three days demonstrated
that technologies that originated in the 70s still have their place today.
Continue reading "Efficiency Will Always Matter"Last modified: Monday, April 3, 2006 0:42 am
Supporting Java's Foreach Construct
Java 1.5 supports a new
foreach
construct for iterating over collections.
The construct can be used on arrays and on all classes in Java's Collection
framework.
I searched the internet for an example on how to make my own
classes iterable with this construct, but could not find an example.
Continue reading "Supporting Java's Foreach Construct"Last modified: Sunday, November 13, 2005 10:27 pm
Warum einfach, wenns auch kompliziert geht?
(Why make it simple, when you can also make it complicated?)
Consider the task of associating code with specific data
values.
Using a multi-way conditional can be error-prone, because
the data values become separated by the code.
It can also be inefficient in the cases where we have to use cascading
else if
statements, instead of a switch
,
which the compiler can optimize into a hash table.
In C I would use an array containing values and function pointers.
My understanding is that the Java approach involves using the
Strategy pattern: a separate class for each case,
and an interface "to rule them all".
Continue reading "Warum einfach, wenns auch kompliziert geht?"Last modified: Friday, May 13, 2005 9:54 am
Java Makes Scripting Languages Irrelevant?
Simplicity does not precede complexity, but follows it.
— Alan J. Perlis
Continue reading "Java Makes Scripting Languages Irrelevant?"Last modified: Tuesday, December 12, 2006 8:20 pm
UMLGraph Update
I have updated the UMLGraph program to
run under Java 1.5.
Continue reading "UMLGraph Update"Last modified: Saturday, March 26, 2005 5:29 pm
The Efficiency of Java and C++, Revisited
A number of people worked on replicating the results and optimizing
the programs I listed in my earlier blog entry.
Continue reading "The Efficiency of Java and C++, Revisited"Last modified: Tuesday, February 15, 2005 8:42 am
An Open Source Java Metrics Toolset Is Hard to Find
I spent many hours looking for a stand-alone open source metrics toolset
for Java programs.
Unfortunately, I was not able to find a single tool that would
fit my (relatively modest) requiremets.
Continue reading "An Open Source Java Metrics Toolset Is Hard to Find"Last modified: Thursday, March 31, 2005 11:49 pm
The Efficiency of Java and C++
I seem to have trouble convincing my neo-Turk students that Java's design makes
it inherently less efficient than C++.
The arguments often and up in an exchange of comments like:
— This (micro) benchmark executes with the same speed when written in Java and C.
— Yes, but a realistic application, like Eclipse takes ages to start up.
— You are only complaining about the cost of the runtime startup
costs and JIT compilation, which are quickly amortized, and, anyway,
Eclipse offers many more features than other IDEs.
and so on.
I therefore wrote a small program to demonstrate the exact problems of
Java's design decisions.
Continue reading "The Efficiency of Java and C++"Last modified: Tuesday, February 15, 2005 8:40 am
Java: the New Straightjacket
I first learned to program on a home computer in Basic. At first
it was fun, but after a point it became frustrating, when I realized
that I was living inside a walled garden. Many interesting programs,
such as those interfacing with the display controller, simply could
not be written in standard Basic. Luckily, this limitation forced me
to move to Pascal, assembly code, and C.
Continue reading "Java: the New Straightjacket"Last modified: Thursday, January 20, 2005 3:29 pm
Computer Languages Form an Ecosystem
(This is a copy of an
article I posted on
slashdot on March 15th,
in response to a discussion titled
C Alive and Well Thanks to Portable.NET.
Many posters argued that the C language is dead.
I add my response here, because one month after its original slashdot submission,
I am still getting web site hits from it.)
Continue reading "Computer Languages Form an Ecosystem"Last modified: Sunday, April 18, 2004 1:10 pm