Seva at Eclipse

Seva Lapsha working on Eclipse PDT project

Iterators in PHP

Recently, while playing with Scala/Python/PHP comparative implementation of lazy algorithms (I will hopefully describe them some days later) with colleague and friend of mine Michael Fuks, I sorrowfully discovered that, despite there are several SPL units, which define basic Iterator interfaces and functionality, most of the functionality available for arrays is missing for Iterators.

So I decided to fill the gap and started to reimplement for Iterators the applicable non-trivial array functions and also started trying to simulate iterator comprehension (generator routines) in PHP which is missing there too. For this reason I opened a GoogleCode project of php-iterator-utils - please observe my first experiments here.

In addition I need to notice that latest NetBeans build (6.8) branch has great PHP 5.3 support and feels more stable, fast and functional than Eclipse PDT :(

Programming in Scala

Got the Programming in Scala eBook. I hope to get time and build an experimental Eclipse Plugin with it.

The Java Explorer

I’m happy to announce that Eyal Schneider, the collegue of mine, has been finally convinced to open a blog to share his knowledge and experience.

Eclipse Galileo RC1 Update Manager RT Equinox P2 is still not good enough for me yet

I’ve just failed to install JDT over clean Eclipse Platform RC1 (and this time a bug has been opened):

An error occurred while installing the items
session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install, operand=null –> [R]org.eclipse.ant.ui 3.4.0.v20090504, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
Error while loading manipulator.
Error while loading manipulator.

Retrying causes the message immediately. Reverting to the previous installation stage does not help. Restarting does not help either.

It’s very sad that what they call Release Candidate is still rare. Waiting for the release…

Speaking at …

Reading blog rolls for years, I rather often meet posts of different “socially recognized” ones, which proudly inform us, that they are going to speak at some conference. And what’s very common is that the subject of their messages are literally that they are “speaking”.

What does that mean? That the main fact they provide us is that “they are speaking”, and not that “some important subject will be explained in their speeches”. Otherwise they would say that first.

What can I conclude? That most of them are just egoistic monkeys that in fact using the corresponding issues to promote themselves and collect more bananas, rather than they are really interested in sharing their information, which is (according to my understanding) the purpose of the conferences.

Other monkeys use the chance to participate in such sessions to promote themselves by asking “interesting” questions in these sessions…

It’s funny that some people thought that socializing the network may boost building selfless society. As I see it, it’s just a way for offline losers to find the bunch of other losers of the same kind and to gain respect among them to feed their ill and hungry ego with fast junk.

Well, personally I don’t mind. What I’m truly happy about is that people I respect for real are trying to spread the good by deed, rather by dissimulating word.

Eclipse Maven Integration

Honestly, I was pretty unsure regarding Maven at all. “Why should I port my projects from Ant, where everything is plain, simple and predictable? Single point integration jars are connected to their dependent projects, shared ones are extracted to a Libraries project. Deployment is as easy as checkout and build…” - I convinced myself.

But soon I’ve realized that if our team’s Product is no more than a chain in the string of Products and Components which are unified into the Solution, than why the hell should our code base not to be like that? It’s so nice that lots of Environments has their packaging systems which make installation simple and aesthetic… So if you work in Java and harmony and beauty are not just senseless terms for you, believe me, you should use Maven.

The main Maven’s advantage over Ant is that each dependency, called artifact can be (and commonly is) an independent project with its own history of versions and dependencies. So, if you want your project to be dependent of any library, you can just find it in one of major Maven repositories, add its id to your pom and - voila! it works.

Then, when time comes to deploy your stuff, you pack it and do the same - upload your stuff to another maven repository. Here the cycle closes and the universal happiness has been achieved.

Now, regarding the subject. There are 2 Maven Eclipse plug-ins in the market - m2eclipse and q4eclipse. Both of them recently were accepted as Eclipse native incubation projects as M2E and IAM. I tried them both starting from the second, but as it always happens, the first was the better one. M2E is very stable, comfortable and easy to understand w/o any documentation, while IAM is pretty buggy and unclear.

So I chose M2E to work with and it took just about 3 hours to convert all my projects to poms, configuring all their dependencies and then converting the projects into Maven managed ones. With the last action, all the Eclipse dependencies convert into Maven dependencies, the build is replaced with Maven build and it guarantees that there will be no surprises in production builds. And then you can proceed with LB/Continuum/CC with no time spent to understand why nothing doesn’t get built correctly.

Now what’s remaining is to reintegrate the changes from the sandbox branch and help the team to not be too scared of the changes :)

Last Singleton

Hooray!

Today I’ve eliminated the last misused occurance of singleton pattern in the monsterous project I’m currently involved in.

Aptana “steals” PDT code

Long time ago I set up Google alerts to receive new search results related to myself. And today I’ve discovered that Aptana steals prepares derivative work of PDT code.

The only visible “derivation” there is they changed package names, though. :)

Design Patterns

Recently I’ve seen the inter-blog discussion by some PHP guys I don’t know which touches among other things the issue of design patterns. And when they define design patterns they use some canonical or less definitions which seem a bit fuzzy to me.

When I think of design patterns, I always think about patterns of design, thus to define them you first need to define both of them well. With design it’s pretty easy. So let’s talk about patterns.

Pattern, as you surely know, my dear friend, is nothing but a recurring event. But how would you detect recurring events? To do that you need first to detect events, which are no more than time objects. And detecting recurring objects requires memory and ability to compare, which in one word is “intelligence”. Now, knowing the known patterns is nothing but remembering them, which doesn’t require intelligence, while detection of them actually is their usage, since using patterns is already a pattern.

Therefore, design patterning is a way of making designing and observing the design to beĀ  more harmonious, or a way of saving designer’s and observer’s intelligence. However, it’s very simple to save intelligence by just not designing the creation. But bad design is nothing but just a very complex design. A design which is created unconsciously is actually a noise and is not harmonious. So using/creation of design patterns is an investment of intelligence in order to save it in the future.

And when not to use patterns then? Only when you:

1. Know to do it perfectly.
2. And you don’t really care if anyone would observe the done.
3. And you will never need to make a similar deed.

I know only one such a task: physiological dying.

Prototype styled Google Analytics javascript snippet

Recently I’ve created a prototype styled javascript snippet to enable google analytics on one of my sites. Save this code in google.analytics.js file and include it from the head tag of the page just after including of the prototype.js:

gaTrackerId = 'ss-ddddddd-d'; // insert your tracker id here

document.observe('dom:loaded', function() {
var gaJsHost = (
('https:' == document.location.protocol)
? 'https://ssl.'
: 'http://www.'
) + 'google-analytics.com/ga.js';
var script = new Element('script', { 'src': gaJsHost});
var gaTrack = function() {
if (
!script.readyState
|| /loaded|complete/.test(script.readyState)
) {
var pageTracker = _gat._getTracker(gaTrackerId);
pageTracker._trackPageview();
}
};
script.observe('load', gaTrack);
script.observe('readystatechange', gaTrack);
document.body.appendChild(script);
});

Recent Posts

Archives

Categories

Meta