Archive

Archive for January, 2010

Just finished Call of Duty: Modern Warfare 2

January 16, 2010 erdincyilmazel Leave a comment

I think this is amongst the best FPS games ever. The first game of the series was also very nice. The story really gets you into the game. The only thing I can think of as a negative is that the single player campaign mode is a bit short. (Maybe I felt that way because of the excitement). Looking forward for a third game of the franchise.

Categories: Games Tags: ,

Working on tinymashup.com

I’ve always enjoyed building domain specific languages. The most advanced language that I’ve developed so far comes handy when I need to extract some information from any web page or document. I call this system “Content Retrieval Engine”. You can execute CRE scripts in a single thread to open web pages, extract some information from them and use the retrieved information as an input to another document.

Here is an example to get the search result urls of a query that is made on google:

url = "http://www.google.co.uk/search?hl=en&q=${1}&btnG=Search&meta=&aq=1";
query = "erdinc yilmazel";

echo "opening " + url(query.urlEncode());

open url(query.urlEncode()) as input;
read input {
   locate "<h2 class=hd>Search Results</h2>";
   do {
      locate "<li class=g>";
      locate "<h3 ";
      locate "<a href=\"";
      capture as link until "\"";
      echo link;
      links += link;
   } until "</ol> </div> <!--z-->";
}

The script above prints every url that is gathered to the output and also collects them in a list named as links (Actually an ArrayList in Java). At the time of writing executing the script gives the following output:

opening http://www.google.co.uk/search?hl=en&amp;q=erdinc+yilmazel&amp;btnG=Search&amp;meta=&amp;aq=1

http://tr.linkedin.com/in/erdincyilmazel

http://www.facebook.com/erdincyilmazel

http://blog.erdincyilmazel.com/2010/01/05/open-sourcing-some-projects/

http://developer.amazonwebservices.com/connect/message.jspa?messageID=147347

http://markmail.org/message/x6irtpux7euhnptj

http://www.vclcomponents.com/PHP/Development_Tools/Libraries_and_Classes/MyObjects-info.html

http://www.aboutus.org/erdinc.yilmazel.com

http://groups.google.com/group/javawug/browse_thread/thread/6e0a171748a8b735

http://vaadin.com/forum/-/message_boards/message/89339

http://www.myobjects.org/

The thing about “Content Retrieval Engine” is that it doesn’t have to read all the document and get it into memory to do data extraction. It does everything in a single pass while reading from the input stream. This allows it to run very fast and very memory efficient. You can extract information from huge documents that are several gigabytes.

So what is tinymashup.com? I am planning it to be a hosted service to run CRE scripts. You can write your scripts, run them against any web page and get the output in any format you like such as XML, JSON, plain text etc. You will be able to write scripts and share them with others. I am also planning on licensing the technology to people who need it. (I can also open source it too, haven’t decided yet :) )

Categories: Projects Tags: ,

Open sourcing some projects

January 5, 2010 erdincyilmazel 1 comment

I recently started two new open source projects on googlecode.com. One of them is JdbcHelper which helped me a lot in working on the last project that I was developing. JdbcHelper is a very small library for performing common JDBC tasks. It is similar to Spring Framewors Jdbc Template module, but does not depend on any external library, so it may be your library of choice if you want a lightweight solution.

The other project, which is currently in active development is the Cambridge Template Engine. It is a template framework for Java which I’ve been dreaming about for more than a year. I started working on Cambridge in mid 2008. To be honest, I wasn’t able to devote enough time for it to make it a usable product for a long time. A few months ago, while struggling with JSP, I decided to get back on it and I’ve been working hard for a stable version. One of my colleagues working on istanbul.net already started using Cambridge in a project which will soon become online.

What makes Cambridge different from other template engines like Freemarker or Velocity? Well, first of all Cambridge was designed to generate especially HTML or other markup documents like XML. Cambridge knows the tag structure of your template documents even if they are not well formed. This allows you, as a developer, to use the scope of html tags that is already in the document instead of wrapping your html with external code or tags.

For instance, if you want a portion of html to be viewed based on a condition you would write something like this in JSP

<s:if test="conditionMet">
<div id="someDiv">
<strong>Some content</strong>
</div>
</s:if>

or

<%
if(conditionMet) {%>
<div id="someDiv">
<strong>Some content</strong>
</div>
<% } %>

It would also look like the one above if you were using PHP too. On the other hand, Cambridge knows where the div element starts and ends. So the same code in cambridge is written as this:

<div a:if="conditionMet" id="someDiv">
<strong>Some content</strong>
</div>

The code above is a simple html document which can be viewed in any browser or html authoring tool without a problem. Unless absolutely necessary, Cambridge does not introduce any new tags to the template file. You only need to add extra attributes to your tags to associate some behaviours.

I am currently trying to improve the documentation for Cambridge and I need feedback for both of the libraries. Please report any bugs, feature requests or comments on the project pages.