Cache Bundle for Symfony

Have you ever felt that your classes are burdened with caching logic instead of proper logic? I know you did, and so did I. In an effort to improve readability and quality of the code, me and my colleagues at eMAG have developed internally a library that will remove all the extra logic for caching from method body.

And after some time we have decided to open source it, so that others can also use it and help develop it.

The library is available on github: https://github.com/eMAGTechLabs/cachebundle . Also there is available also a small use guide.

 

Why Scala is not so cool

A friend of mine is currently attending a Scala course on courseraand she showed me one of her issues searching for an advice. Unfortunately for her after 5 minutes i was leaving the desk as i was unable to come up with any idea.

Based on this experience i tried to have a look at Scala docummentation, so i’ve started with introduction and first thing i’ve seen was that is Java based. Considering my previous experience with a programming language writen over Java, Coldfusion(a huge resource consumer), this wasn’t the best “nice to meet you” conversation. Basically Scala is compiling your code into Java binary compatible file.

Scala programs run on the Java VM, are byte code compatible with Java

A plus was the fact that major companies were already using Scala.

For example, at Twitter, the social networking service, Robey Pointer moved their core message queue from Ruby to Scala. This change was driven by the company’s need to reliably scale their operation to meet fast growing Tweet rates, already reaching 5000 per minute during the Obama Inauguration. Robeys thinking behind the Twitter Kestrel project is explained in the developers live journal. His concise 1500 lines of Scala code can be seen as he has generously made them available as an open source project.

So far introduction hasn’t brought very much confidence in continuing, so i asked my friend to give me some key points that would represent the an advantage of using it in a real case. First and only point(due to lack of time) mentioned was a better stack management while using recursive functions. At this point i said that all recursive methods can be implemented also iterative in order to avoid stack problems while using large volumes of data. On the other hand this may raise complexity of the code.

This conversation being over i’ve came back to Scala site searching for some code examples. Look what i found:

Any method which takes a single parameter can be used as an infix operator in Scala. Here is the definition of classMyBool which defines three methods andor, and negate.

class MyBool(x: Boolean) {
  def and(that: MyBool): MyBool = if (x) that else this
  def or(that: MyBool): MyBool = if (x) this else that
  def negate: MyBool = new MyBool(!x)
}
def not(x: MyBool) = x negate; // semicolon required here
def xor(x: MyBool, y: MyBool) = (x or y) and not(x and y)

Why a programming language requires such a feature? Why don’t they like obj.method(param) ?

Mare grija cand alegeti numele domeniului!

Mare grija cand alegeti numele domeniului! :)) Extract din wikipedia:
Intercapping is often used to emphasize the meaning of a domain name. However, DNS names are case-insensitive, and some names may be misinterpreted in certain uses of capitalization, creating slurls. For example: Who Represents, a database of artists and agents, chose whorepresents.com, which can be misread as whore presents. Similarly, a therapists’ network is named therapistfinder.com. In such situations, the proper meaning may be clarified by use of hyphens in the domain name. For instance, Experts Exchange, a programmers’ discussion site, for a long time used expertsexchange.com, but ultimately changed the name to experts-exchange.com.

Genial! =))

iPhone and Android = iDroid

I just installed iDroid(Android 2.2) on my iPhone 3G. I must note that this is my first encounter with Android 2.

Beside the disadvantages given by the fact that it’s not a native environment(camera not working, 3G internet doesn’t seem to be working, buttons seems a bit strange, no sound support for alerts) there is one more issue: Android Market is missing.

As a pro i can say that sync with Gmail is very easy and works pretty good. The emails are rendered extremely fast 😮

As a final conclusion i think it works pretty good on a native system, but before i get one i’ll make one more test on a HTC Diamond that is somewhere in the house… relaxing…

Continue reading iPhone and Android = iDroid