Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Clojure & Java Interop

About a year ago I got a phone call asking if I wanted to join another team at DRW. The team supports a (primarily) Java application, but the performance requirements would also allow it to be written in a higher level language. I'd been writing Clojure (basically) full-time at that point - so my response was simple: I'd love to join, but I'm going to want to do future development using Clojure.A year later we still have plenty of Java, but the vast majority of the new code I add is Clojure. One of the big reasons I'm able to use Clojure so freely is the seamless interop with Java.Execute Cloj...

3,652 0       JAVA FUNCTION CALL CLOJURE INTEROPRABILITY COMMIT


  Python threads: communication and stopping

A very common doubt developers new to Python have is how to use its threads correctly. Specifically, a large amount of questions on StackOverflow show that people struggle most with two aspects:How to stop / kill a threadHow to safely pass data to a thread and backI already have a blog post touching on these issues right here, but I feel it’s too task-specific for sockets, and a more basic and general post would be appropriate. I assume the reader has a basic familiarity with Python threads, i.e. has at least went over the documentation.So, without further ado, here’s a sample "w...

2,936 0       PYTHON MULTITHREADING COMMUNICATION SYNCHRONIZE


  Perl Documentation in Terms of Tasks

The core Perl community—if you care to draw lines around a group ofpeople who use Perl seriously and call that a community—is like manyother core F/OSS communities. Real work happens on mailing lists and IRC. Iunsubscribed from several mailing lists and deliberately spent as little timeon IRC as possible this year, for various uninteresting reasons. (I haven'teven made it to the Portland Perl Mongersmeetings for several months.)While that's been good for my productivity, it's also produced aninteresting s...

2,279 0       PROCESS PERL DOCUMENTATION


  A Perl Regular Expression That Matches Prime Numbers

perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"'Can you figure out how it works? I give an explanation below, but try to figure it out yourself. Here is what happens when you run it:$ perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"'122 is prime33 is prime455 is prime677 is prime89101111 is primeHere is how it works.First, the number is converted in its unary representation by (1x$_). For example, the number 5 gets converted into 1x5, which is 11111 (1 repeated 5 times.)Next, the unary string gets tested against the regular expression. If it matches, the number is ...

5,289 0       REGULAR EXPRESSION PERL REGEX PRIME NUMBER ONE LINE


  The ugliest C feature:

<tgmath.h> is a header provided by the standard C library,introduced in C99 to allow easier porting of Fortran numerical software to C.Fortran, unlike C, provides “intrinsic functions”, which are a part of the language and behave more likeoperators. While ordinary (“external”) functions behave similarly to C functions with respect to types(the types of arguments and parameters must match and the restult type is fixed), intrinsic functions accept arguments of several types and their return type may depend on the type of their arguments.For example Fortran 77 provid...

45,693 0       C FORTRAN INTRINSIC FUNCTIONS C99 UGLY


  Writing API clients in Perl and Python

I recently released a couple of API clients for the Ge.tt file sharing service, one in Perl and one in Python. (I am just a fan of the service, not an employee or contractor.) I would judge myself an "intermediate" pythonista mostly due to inexperience. It's a culture shock coming from a background of CPAN. The old joke is that Perl is just a life support system for CPAN and that is arguably true, but I am here to tell you: you may not appreciate how good Perl hackers have it with respect to CPAN and the culture around documenting, packaging and testing distros once they're on CPAN.It's hard ...

4,952 0       PATTERN PYTHON API PERL API WRITING


  On Erlang's Syntax

I first planned to release this text as an appendix entry for Learn You Some Erlang, but considering this feels more like editorial content and not exactly something for a reference text, I decided it would fit better as a blog post.Many newcomers to Erlang manage to understand the syntax and program around it without ever getting used to it. I've read and heard many complaints regarding the syntax and the 'ant turd tokens' (a subjectively funny way to refer to ,, ; and .), how annoying it is, etc.As mentioned at some point in the book, Erlang draws its syntax from Prolog. While this gives a r...

3,536 0       ERLANG SYNTAX ERROR


  Build your own internet search engine - Part 2

After having started to build my own internet search engine as described in a previous blog post, I now have read some papers and books about web search engine architecture and information retrieval to complete my hobby project. Here is a list of papers and books that I highly recommend to anybody who is interested in this topic:1. Google: data structures and algorithms by Petteri Huuhka2. The Anatomy of a Large-Scale Hypertextual Web Search Engine by the Google founders Sergey Brin and Lawrence Page3. Introduction to Information Retrieval by Christopher D. M...

3,366 0       DATABASE SEARCH ENGINE PAPER DATA STRUCTURE