Just blogging

The hell of a blog

Skip to: Content | Sidebar | Footer

Two unallocated parts on hard drive

15 May, 2012 (00:14) | Computers | By: ondy1985

I just spent like 2 hours over this, so I thought I would share.

The story is, I had a laptop notebook with Win XP on it on one partition, and some data on a second partition. The notebook was old so I took out the disk and put it into a external drive case. I deleted both partitions and… what the fuck? There were two separated parts of unallocated space!

I couldn’t figure out why or how to merge them. I was able to create partition from either of them, but not merge them together. After creating and deleting those partitions for like 1000th time, I noticed that on one of them, it only allowed me to create logical partition, while on the other only primary.

So I created a primary partition and a logical partition and searched for a way to convert the logical partition into a primary. Then I found an article on EaseUs partition manager homepage describing how to convert Logical Partition to Primary Partition.

So finally, using EaseUS partition manager I was able to convert the logical partition to primary and then merge both partitions into one.

Oh God, I hate computers…

Sony, WTF?

18 December, 2011 (13:58) | PlayStation 3 | By: ondy1985

Firstly, I want to tell you that my excitement about solving PS3 slow wifi problem was premature. It worked for a while, but now it doesn’t and I’m really desperate… Wonder why there is no official statement from SONY regarding this issue.

The next thing is the latest firmware release. Yeah, we finally got to the 4.0. But when I see the list of new features, I can’t hold the tears. Another useless shit which is only a pain in the ass to download using PS3’s wifi and adds nothing useful whatsoever…

PS3 slow WiFi download - SOLVED :-)

28 June, 2011 (22:59) | PlayStation 3 | By: ondy1985

Since I moved my PS3 from my parents house to my flat, I’ve experienced a fucking slow download speed from PSN. Today it took about 12 hours to download inFamous (8 gigs). I was so pissed I just had to find the solution.

All I had to do was set my wifi router to 802.11g only (it was in the mixed mode before) and it works like a charm now.

CodeIgniter: simple i18n support

1 September, 2010 (10:54) | CodeIgniter | By: ondy1985

Yesterday I downloaded CodeIgniter and I quickly realized, there is no built in support for multiple languages. Of course you can create a controller for each language, that would load the corresponding language files, but that’s not what I wanted.

I needed the language to be present in the url (e.g. http://example.com/en/controller/method/), so I created a hook for this. What it does is basically it takes the URI before it is processed by the router and if the first segments is a 2 letter language code, it changes the default language in the config class and also appends the language code to the base_url, then strips the language code from the URI and then let it process by the Router. Notice you can’t use 2 letter controller names (unless you route them), but why would you? ;-)

The first step is downloading the hook and unzipping it into your application/hooks folder.

To tell the hook, which language to use, you have to create a new entry in your application/config/config.php file:

$config['available_languages'] = array(
‘en’=>’english’,
’sk’=>’slovak’
);

Keys of that array are language codes, that will be accepted. The values are corresponding languages. If a not specified language code is detected, language code corresponding to $config['language'] value will be used.

Also, while you are editing the config file, make sure you have set the enable_hooks property to TRUE and the uri_protocol to either REQUEST_URI, PATH_INFO or ORIG_PATH_INFO, because the hook will not work with the AUTO nor the QUERY_STRING setting.

The last step is creating an entry in your application/config/hooks.php file:

$hook['pre_system'][] = array(
‘class’ => ‘Ondy1985_Language_Hook’,
‘function’ => ‘grabLanguageCode’,
‘filename’ => ‘language.php’,
‘filepath’ => ‘hooks/ondy1985′,
);

$hook['pre_controller'][] = array(
‘class’ => ‘Ondy1985_Language_Hook’,
‘function’ => ’setLanguage’,
‘filename’ => ‘language.php’,
‘filepath’ => ‘hooks/ondy1985′,
);

Now you should be all set. The current language will be available in your controllers through $this->config->item(’language’). The actual language code will be stored in $GLOBALS['language_code'] if you ever need it.