foreach is an MVP pattern implementation

The foreach, enhanced for statement, is a perfect example of an MVP pattern implementation.

Read more…

Efficient git filter-branch and --index-filter implementation

    Tags : 

About two years ago I posted a post that described how you can use Git and Mercurial to create encrypted repositories. Back to then, I claimed that the encryption cannot be changed and the encryption method will be constant for the entire repository lifecycle. Well, sort of, from the user's perspective (at least if you don't use versioned .gitattributes that refer different crypto-filters). Using and maintaining such repositories can be not a fun, and you might want to decrypt the whole repository some rainy day.

git filter-branch (a bit of a cryptic name, as well, yeah?) is a right tool. It features a lot of filtering options that can transform the original repository from scratch, and we're going to use --index-filter...

Read more…

The Java language seems to go a wrong way

I'm not sure if the Java language goes a right way. The new Java language features look really not I would like to have in Java.

Read more…

Detecting excessively suppressed redirects in MediaWiki

A simple Python script to detect excessively redirected pages in MediaWiki.

Read more…

Unique code search algorithm rewritten in almost pure ReQL

In my previous post regarding generating the unique codes out of the free codes. That implementation was based on a JavaScript function that accepted a strategy to be invoked each time a binary search iteration is in progress. I also mentioned that due this it will do log n queries to the RethinkDB database, and I assumpted that it can be fully ReQL based. Yes, it can be executed fully on the RethinkDB side being re-implemented in pure ReQL. Almost. Let's see how.

Read more…

Finding a unique code in a code pool in RethinkDB

My recent project had a lot of fun to work with. And, as I said before, working with RethinkDB was fun too. Since that project implemented a virtual file system, it also had to share a file by a unique file by a unique code (say, kl2890aj or 2opOZxk1).

How did it share a file by a unique code similarly to what Dropbox or YouTube do?

Read more…

Making a unique filename by adding a copy number in RethinkDB

RethinkDB is a beautiful document-oriented database I was lucky to use for my most recent project. Unfortunately, I don't work for that project anymore, but I would like to share some ideas I implemented while working on that project.

That project implemented a virtual file system table in a RethinDB database, and one of the requirements while creating a new file entry was making its filename unique. A usual filename generated chain named as if you downloading a same-named file: file.ext, file (1).ext, file (2).ext and so on.

Read more…

Optional tends to be used in a wrong way

Want to explicitly declare a nullability contract? You probably might want to use Optional<T>, but it does not seem to be the best way. I've got some cons against it.

Read more…

Highlight with grc

I use my terminal emulators a lot. I just love command-line interface because I really feel much more freedom than I have in GUI applications. However the most command-line applications do not highlight their output making it hard to read. Let's fix it?

Read more…

Visualizing pages graph in MediaWiki

The original question was originally posted on April 11, 2016 at MediaWiki Support Desk

I edit MediaWiki based wikis. MediaWiki is a very powerful system and besides the web-based administration toolkit there are also a big number of maintenance scripts that are accessible via shell. One of the scripts is dumpLinks.php that generates a plain text links dump.

Read more…