Category Archives: Programlama

Programlama kategorisi

GODISNOWHERE: A look at a famous question using Python, Google and natural language processing

Are there any commonalities among human intelligence, Bayesian probability models, corpus linguistics, and religion? This blog entry presents a piece of light reading for people interested in a combination of those topics.
You have probably heard the famous question:

       “What do you see below?”


The stream of letters can be broken down into English words in two different ways, either as “God is nowhere”   or as “God is now here.” You can find an endless set of variations on this theme on the Internet,  but I will deal with this example in the context of computational linguistics and big data processing.


When I first read the beautiful book chapter titled “Natural Language Corpus Data” written by Peter Norvig, in the book “Beautiful Data“, I’ve decided to make an experiment using Norvig’s code. In that chapter, Norvig showed a very concise Python program that ‘learned’ how to break down a stream of letters into English words, in other words, a program with the capability to do ‘word segmentation’.

Norvig’s code coupled with Google’s language corpus, is powerful and impressive; it is able to take a character string such as


and return a correct segmentation:

‘when’, ‘in’, ‘the’, ‘course’, ‘of’, ‘human’, ‘events’, ‘it’, ‘becomes’, ‘necessary’

But how would it deal with “GODISNOWEHERE”? Let’s try it out in a GNU/Linux environment: Read the rest of this entry »


Posted by on March 1, 2014 in Linguistics, Programlama, python


Tags: , , , , , , , ,

Scala versus Python and R: software archaeology in bioinformatics

When one of the scala-user members has mentioned a bioinformatics package called GATK (Genome Analysis Toolkit) and its use of Scala recently, I’ve decided to take a further look into this matter. Thanks to the valuable Ohloh service, amateur software archaeology has never been easier! After a brief visit to I’ve learned that GATK software has had 12,871 commits made by 77 contributors  within the last 5 years, representing 99,078 lines of code.

I wanted to learn more about its source code languages, and decided to drill down by visiting What I have discovered was surprising. Let me share the facts I’ve found so far: The project did not have any Scala code until recently, for example in July, 2009, it had no Scala, whereas it contained 4410 lines of Python and 56 lines of R code:


Read the rest of this entry »

Leave a comment

Posted by on February 16, 2014 in Programlama


Tags: , , , ,

Can LinkedIn endorsements be motivating? A case for Coursera’s Machine Learning class

Any self-respecting social media savvy professional knows that LinkedIn endorsements are the result of a hideous gamification experiment gone wrong (on many levels), except when they think it is a straightforward abuse of human psychology. Some computer programmers even try to give it a backlash by writing automated scripts to endorse profiles with totally absurd ‘skill sets‘.

On the other hand, in some unexpected cases, these endorsements can be very motivating, which is what happened to me a few months ago, back in October, 2013. To cut a long story short, when I came across the following endorsements by some of my LinkedIn contacts, my reaction was something that even surprised me:


It went like that: “Machine Learning! Should I accept that endorsement? I mean, I did small projects related to machine learning, such as Poor Man’s TV program Recommender that utilized Support Vector Machines, and a cross-cultural and cross-domain recommendation system using a semantic graph database such as AllegroGraph; but apart from an AI course that I had while studying for my cognitive science degree, I haven’t taken any Machine Learning course. On the other hand, Andrew Ng’s famous Machine Learning course at Coursera is about to start, so maybe that’s a nice opportunity! Why not? If I can finish the course successfully, then accepting such an endorsement will be a bit meaningful, at least from a practical, or academic point of view.” Read the rest of this entry »


Posted by on January 19, 2014 in e-Learning, Programlama


Tags: , , , ,

How to use extractors in Scala for powerful pattern matching – Devoxx style

A few months ago, Joshua D. Suereth gave a very nice technical talk at Devoxx 2013, titled “How to wield Scala in the trenches“, which was full of functional programming & Scala gems. The last slides of his presentation were dedicated to a very powerful style of using extractors and pattern matching. I liked his example so much that I wanted to understand it better and note it down in my blog so that I can apply it in many similar cases.

The basic motivation comes from the following question. Assume you have a List of objects, e.g. People, who can have more than one residence; and you want to select the ones based on a condition, e.g. the ones living in Istanbul. There are of course different ways to traverse the list and filter the ones you are looking for: Read the rest of this entry »


Posted by on January 4, 2014 in Programlama


Tags: , ,

Book review: Java Performance

9780137142521Drinking from the Firehose

Even though the Java platform (along with JVM) is one of the most ubiquotus software develoment platforms, it was surprisingly difficult to find a self-contained book dedicated to performance aspects of Java platform. “Java Performance” by Charlie Hunt and Binu John can be considered the only solid and contemporary reference in the domain of performance analysis and tuning of Java based systems. No matter which programming language you use to run on JVM, this book is the essential reference until something better comes along.

On the other hand, make no mistake, this is not a lightweight book, or a cookbook which you can consult for a few performance tuning recipes. Reading Java Performance is more like drinking from the firehose. Whether you are a beginner, or a seasoned developer, it will take time to digest the gory details presented. Luckily, the book’s logical organization is close to perfect and some of the chapters are pretty self-contained.

From start to finish, it is not difficult to see that if you want to consider yourself a serious Java performance engineer, you need to master the majority of the book. Chapter 2 starts with an overview of the basics of operating systems performance and monitoring, setting the stage for the upcoming chapters and acting as a refresher. The authors are very careful to explain concepts concretely by giving examples from Linux, Solaris and MS Windows systems, which makes sense given the portability of JVM. Chapter 3 and 4, if taken together, provide the most comprehensive technical explanation of Java Virtual Machine and Just-in Time compilation from a performance perspective. Even if you are not facing performance problems (yet), this two chapters make a very solid and clear reference for understanding JVM and JIT technology. The terminology, concepts and details in these chapters are very important: Without a solid understanding of them, it is not easy to understand the discussions in the following chapters.

Read the rest of this entry »

Leave a comment

Posted by on December 8, 2013 in Books, java, Programlama


Tags: , , , ,

Java 8, Lambda Expressions and the Psychology of the Masters of the Universe (devoxx style)

A quick quiz: Take a look at the words / phrases below and tell me in what kind of talk can you hear them?

scary, scared, lazy, don’t want to scare, risk, risky, ivory tower, functional, real life, scary, no functional, reality, customers, complex

Those are some of the words I remember from the keynote given by Mark Reinhold and Brian Goetz, and titled “Java 8 and Beyond” at Devoxx 2013 conference. And I think this fact shows the real and biggest difference between designing a programming language and marketing one.

Let me explain: Devoxx, which does not need much introduction, is the biggest Java conference in Europe, including anything related to Java, JVM, Android, languages running on JVM (and even Microsoft, this year). Close to 4000 Java developers, as well as team leads, and software project managers come together from all over the world for 5 days. And just like Devoxx, Brian Goetz, one of the keynote speakers, does not need much introduction: He is a Java and concurrency expert, having written one of the best books in this field, and  serving many JCP Expert Groups and working at Oracle as the Java Language Architect. In other words, when a heavyweight Java expert such as Goetz gives a keynote at a conference such as Devoxx, and talks about the upcoming version of Java 8, and stressing features such as lambda expressions and streams, thousands of developers do listen, and they listen very carefully.

So far, so good. But there is one thing surprising. Some of those developers, I, for example, feel like listening to the aspects of human psychology and the finer points of marketing to the masses, albeit technical masses. The reasons I felt like that can be summarized as the following:

devoxx_java8_1 Read the rest of this entry »


Tags: , , , , , , , , , , ,

Do not touch that stone – Do not touch that IDE

What’s the relationship between the ancient game of GO and writing software code?

It is possible to draw various analogies between these two sophisticated, intellectual human activities, but I simply wanted to note down a simple connection that has jumped into my mind recently. It can be summarized as a Go proverb:

Do not touch that stone.

And it can also be summarized as a programming  motto:

Do not touch that IDE.

What is the meaning of those sayings, other than being Zen-like statements? How and why did I come up with them? What are the context, story and history behind them? And most importantly, can they help us to be better programmers at all?


Read the rest of this entry »

1 Comment

Posted by on November 15, 2013 in CogSci, philosophy, Programlama, psychology


Tags: , , , , , , , , ,

Book review: The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming

Very well balanced in its breadth, somehow lacking in depthwell_grounded_java

If you have ever had the chance to witness the live performance of the authors, you know what a dynamic duo they are, taking a no-nonsense, pragmatic and very down to earth attitude towards the perils and treasures of modern day Java development. It is easy to see that almost every page of ‘The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming‘ is full of that energy.

The world of Java development is wide and this book is very well-balanced in its selection of topics. In other words, almost any serious Java development team would welcome a new developer well versed in the topics of this book, or to put it differently, unless you don’t know much about most of those topics, do not consider yourself fit for a sharp and focused Java development team. Read the rest of this entry »

1 Comment

Posted by on September 30, 2013 in Books, java, Programlama


Tags: , , , , , , , ,

Book review: The Design of Design

Definitely not required reading for all designers but a pleasant and useful one for some of them nevertheless

For some people there comes a time when they have spent more than five decades in their career and they can have a deep look at various projects they have accomplished, and talk about the common themes, as well as the distilled lessons they learned throughout a lifetime. If they also happen to be good writers as well as having lots of very successful achievements in industrial settings as well as academic and personal ones, then the reader of their work is lucky indeed. The Design of Design is one such book, at least for some readers.TheDesignOfDesign

Even though the book has many qualities, I consider it important to warn the casual reader: You are facing a book full of deep principles and abstractions. No matter how many concrete examples you may encounter in different chapters, the discussion of principles behind those examples are not to be taken lightly, Brooks often refers to the works of Christopher Alexander, an architect, designer, mathematician and cognitive scientist, not only famous for his work in architecture and design, but also for inspiring the famous “Design Patterns: Elements of Reusable Object-Oriented Software” book as well as his non-mainstream writings. This alone should be enough evidence for the knowledgeable reader that this book aims to be something more than a passing attempt at discussing a few design principles. Read the rest of this entry »

Leave a comment

Posted by on September 25, 2013 in Books, Programlama


Tags: , , , , , , ,


Get every new post delivered to your Inbox.

Join 53 other followers