Posts tagged “in English” 
-
Computer
-
PHP
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:
«…»
|
Read rest of this entry
»
-
My programs
-
Web
A personal RSS/Atom feed in every home.
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 2012 – version 1.1.
«…»
|
Read rest of this entry
»
-
Visual Novels
General overview of the game protection and some helpful files.
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.
«…»
|
Read rest of this entry
»
-
Computer
-
HTML
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.
|
Show this entry
»
-
Computer
-
HTML
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:
|
Show this entry
»
-
Computer
-
FreeBSD
Today I got finally tired of constant server hangs because of Apache's httpd process' segfaults (signal 15) every one-two days and decided to rebuild all ports I have installed because, as I know, segfauls happen when binaries/shared libraries were built on a different system than on the one they're ran at. Or if they were linked to old library versions before an upgrade, for instance.
So I did this with shportupgrade -rRfbuv apache option which took the server roughly 8 hours to complete. However, after that I got zillion of Cyrus messages in my error log saying things like:
These lines quickly filled the logs resulting in 690 Megabytes (!). I didn't have a clue for some time and restarting Cyrus, Postfix or the entire server yielded no visible changes. Then I looked further into the log file – somewhere in the middle there turned out to be several lines like this:
I tried to execute the listed command from under the cyrus user and got this message:
«…»
|
Read rest of this entry
»
-
Computer
-
Enchanting
Albeit there's no built-in command for sleeping in Windows you can use ping to simulate it.
There's no standard Windows command to delay batch file execution – however, as suggested on this article we can use ping command present in most Windows installations (those having netutils). The syntax is:
Here we try to ping an IP from the private range (10.254.3.174) which isn't likely to exist on your network (if it does just change the command).
- -w specifies timeout in milliseconds – this is effectively out sleep delay
- -n 1 sets number of pockets – this is our delay multiplier
- >NUL 2>&1 suppresses ping output (it will complain about unreachable address and such)
So to sleep for 1.2 seconds you can use this command:
|
Show this entry
»
-
Computer
-
Enchanting
Explains how to customize File | New templates of Windows Explorer using TweakUI and Registry Editor (regedit.exe).
I have known and still know many people who were claiming that Windows Explorer is terrible, unfriendly and actually slow while oldy Norton Commander was a piece of usability art and FAR or Total Commander as its reincarnations are what Windows should have instead of its ugly Explorer. They actually do say «ugly», huh.
That's something I can't really understand albeit I have worked with Norton Commander myself many years ago – and since the time of my first Windows installation I've been using standard Explorer which is quite a convenient tool, I would say. More convenient in GUI environments than Norton is anyway.
One of its useful features are file templates that you can invoke using either File main menu or folder context menu (see the screenshot on the left). There are at least 3 ways of customizing it:
- Using TweakUI – a freeware Microsoft tool with useful features making up for some would-be Control Panel options. Among other things it provides means for creating and deleting file templates.
- Editing files in %AllUsersProfile%\Templates and %UserProfile%\Templates – this is where all users' and current user's templates are stored; however, it only works for already created file templates and won't necessary work for new ones even if they belong to a registered file type.
- Directly editing the registry – this is the low-level way of customizing templates and it's what I will explain below.
«…»
|
Read rest of this entry
»
Недавние комментарии
«Stage Once» – a Visual Novel hacking tutorial
Part 1 – the Bruteforce
Today's vectors
Encoding choices as a secure string
Рога и копыта