This fragment is about to be reported (you'll remain on this page):

You can enter a comment to clarify the mistake if you would like to:

Posts composed in 2012 RSS20

Encoding choices as a secure string

Inspired by this post on Laravel forums.

In short, suppose you're writing a simple oldschool browser quest game where the user makes choices to advance in the story. Or perhaps you're making an online testing resource and want the user to be able to save his progrss without the need to register or keep track of his sessions – by simply bookmarking the current page.

Choices can be saved directly like this:

…However, it's not really great:

«…»

Has 4 comments | Read rest of this entry »

Bullfinches

Bullfinches

I still have two feeding boxes hanging besides my kitchen window – surprisingly, birds are still helping themselves. Looks like the ground is too cold yet for easy feeding… albeit people are already planting out the seedlings.

And just recently I've seen a flock of bullfinches – I thought they would fly away when the air becomes warm but looks like I was wrong.

No comments yet | Show this entry »

PHP Feeder

A personal RSS/Atom feed in every home.

PHP Feeder

Feeder is a syndication framework for PHP 5+. It generates RSS 0.92, RSS 2.0 and Atom feeds from single data source. Bundled Text Feeder generates feeds from text files so you don't have to do any coding at all to get your channel running. And, since it's part of Feeder, it outputs in all three supported feed formats.

Download & license

All Feeder classes and related data is released under public domain. If you use it I'll appreciate a backlink to this page; if you have feedback – feel free to drop a comment.

Last Feeder update was on 9 May 2012version 1.1.

«…»

No comments yet | Read rest of this entry »

Reversing «Kimi ga Aruji»

General overview of the game protection and some helpful files.

Reversing «Kimi ga Aruji»

One of the readers of my visual novel hacking tutorial has asked me to check on the protection of «Kimi ga Aruji de Shitsuji ga Ore de» (君が主で執事が俺で). Here goes a brief technical overview and some handy files to help in the translation of this game for those who're interested.

Update: thanks to someone's comment it's now clear that Kimi uses an industrial cryptography which is the same both on its .nsa archives and nscript.dat. Here is located the tool for decrypting them – run it as shdecrkansa.exe arc.nsa decoded.nsa and use any standard NSA extractor like NSAOut from Insani.

nscripter.dat can be decoded in a similar manner except that you'll need to use a hex editor to apply bitwise XOR by key 0x84 on each of the decoded file byte.

And since this is symmetrical cryptography you can encode the edited files back into original format by passing it to decrkansa again.

«…»

Popular post (6 comments) | Read rest of this entry »

Raw feast

Raw feast

Today my family is celebrating some important date (try your deduction skills on that number «3»). Sure, we don't have sweets and chocolates – just different tastes…

Has 3 comments | Show this entry »

Using CSS after pseudoclass to clear floats

Using CSS after pseudoclass to clear floats

It's quite often to have floating blocks and it almost equally often you need to clear them (i.e. let the following content start after their end). However, it's not always possible to insert <div style="clear: both"></div> all around your page's code simply because you might have no control over its generation.

Luckly for us, major browsers support a nifty CSS 2 selector – :after pseudoclass. And we can use it to simulate a trailing clearing <div> just like shown before.

Here's the sample code:

And here's what it produces – paragraphs have red background and divs have white. The first div isn't cleared so its content overflows the bottom border while the second successfully clears the contained left-floating image.

Padding will also work if applied to the last div.

No comments yet | Show this entry »

Git deal

Git deal

Последние несколько дней я основательно познакомился с набирающей обороты новой системой контроля версия – она же git и её вёб-хранилище – GitHub.com.

До сих пор я знал только одну VCSSubversion, с которой работал последние три года. Как оказалось, по сравнению с git (да и с Mercurial, судя по всему, тоже) она крайне простая и… не хочу сказать примитивная, потому что свои задачи она решает более чем успешно – скорее просто VCS с другим принципом работы (начать с того, что она централизованная, как CVS)

При первом же знакомстве git меня удивил тем, что большинство операций там делается через командную строку – собственно, набор утилит git под Windows – ничто иное, как портированный bash с основными утилитами Unix. При этом GUI-инструменты git (например, SmartGit) мало того, что просто интерфейсы к git.exe, так ещё и понять, что именно они делают можно только уже познакомившись с работой с git из командной строки.

Во всяком случае таковы мои первые впечатления. Subversion благодаря всей своей простоте вообще не требует особого обучения, и уж тем более работы с командной строкой – благо там всего две команды, которые крайне нужны для работы – commit и update, и то первая вызывает последнюю, поэтому начать можно вообще не особо напрягаясь.

«…»

No comments yet | Read rest of this entry »

Removing bottom margin in Firefox image links

Removing bottom margin in Firefox image links

Firefox (since at least FF 2) has a strange habit of adding a small (3-pixel) margin to the bottom of images if they're part of a link (<a><img /></a>). Recently I went googling for the solution and found it (somewhere, the link is now lost): this only happens in XHTML documents so you have 2 options: to remove the DTD completely (something you'd avoid by all means) or to make the img tag block using CSS.

This isn't an obvious solution but who cares as long as it works…

Sample code:

No comments yet | Show this entry »