Far Cry 2 Will Not Start

Far Cry 2 splash screen

I was pretty happy when I managed to snag Far Cry 2 for a low price on Steam, a month or so ago. Unfortunately, when I went to run the game, it never launched successfully. The splash screen appeared, and the game did momentarily appear in the task bar – but after that, the screen turns black for about 2 seconds, and then everything disappears. Kind of a disappointing experience for a newly purchased game, but it wasn’t the first time I encountered a game that refused to start.

Solution

To solve this, I had to carefully trigger a keyboard shortcut at the right moment.

1) Launch Far Cry 2. In my case, the splash screen appeared, and then it disappeared.

2) Wait until the screen turns black completely, and then press ALT+ENTER. If your timing is right, you should see Far Cry 2 appear in a window.

3) Press ALT+ENTER again, and then game should switch to full screen mode, allowing you to play.

I hope this trick works for you too… I use it every time I want to run the game. Annoying, yes, but I’m not sure that UbiSoft is to blame – I think it might be my fault for using beta NVIDIA drivers (195.55 for Windows 7) rather than the lame Dell drivers I should be using. Oh, and it in case this is relevant, my resolution is 1680 by 1050.

To Love and Hate NoScript

Mozilla Firefox has always been one of my favorite browsers. The only contender that was able to knock it from its #1 position was Google Chrome. Even though Chrome is still lacking in a few departments (extensions, bookmark management), I swear by it because of the overall performance. Plus, whenever they release a major version, I know they’ll have further performance enhancements – that’s just what they do. I also prefer the minimalistic nature of their user interface – which, as it turns out, also integrates beautifully with my operating system, Windows 7.

Despite Firefox dropping to #2 in my list, I still use it regularly for web development. They have plenty of extensions to keep me coming back: Firebug, Web Developer, ColorZilla, HTML Validator, and… well, NoScript. All of those extensions are excellent; however, NoScript sometimes irritates me.

NoScript Firefox extension provides extra protection for Firefox, Flock, Seamonkey and other mozilla-based browsers: this free, open source add-on allows JavaScript, Java and Flash and other plugins to be executed only by trusted web sites of your choice (e.g. your online bank), and provides the most powerful Anti-XSS protection available in a browser.

NoScript’s unique whitelist based pre-emptive script blocking approach prevents exploitation of security vulnerabilities (known and even not known yet!) with no loss of functionality…

Certainly sounds great – and it works very well too. I really get a sense of safety in knowing I can selectively enable specific elements on webpages, blocking everything else by default. The functionality they offer is great. The problem I have is more with the developers, not the extension. You see, here’s the problem: NoScript is regularly updated, so you’re very likely to see this on a regular basis:

NoScript is updated often - each time you choose to install an update, you have to restart Firefox.

Kind of annoying, but by itself, not a deal breaker. After an restarting Firefox due to the update, I’m immediately greeted by the following page:

The NoScript homepage - content aggressively mixed with advertising, affiliation links, and donation buttons.

Let me state this very clearly: Every time I update NoScript, I’m thrown to that page. Ugh.  Sure, they show me the change log, news, and more – but they also show me ads… a lot of them. Let’s start by looking at how much of the site is devoted to ads. I’ll highlight pure advertisements in red, affiliations in pink, and donation controls in orange:

The NoScript homepage with the advertising, donation controls, and affiliation links highlighted.

Another aspect of their advertising that particularly bothers me is how they claim to be “your friendly web cop”, keeping you safe, and yet, they are suggesting software that they probably never even tried. I’m particularly referring to the “PC slowing you down? Free scan” and “Top tip! Click here to check if your drivers are up-to-date!” ads. I would never click on those things… but I know some people that might, especially if they are shown on a security-related site. At first glance, even I have to ask myself if it is an ad – it almost looks like it could be another software offering from the same company. Things like that really make me want to start using AdBlock Plus again… and that’s not cool, since I am a web developer myself.

Overall, if their site was more tastefully presented, and the ads were more respectful in number and placement, I’d have less of a problem with them showing me their page every time I update. In its current state, it is just so obvious to me that they are money-hungry – to the point where they put little thought behind the resulting user experience.  Even with that aspect improved,  a pretty page could still be an annoyance if you are automatically thrown to it once a week. Thankfully, the NoScript guys have a way for you to disable the feature. Hurrah!

SolutionHow to make it so the NoScript page does not automatically appear whenever you update.

With the latest version of NoScript installed (In my case, 1.9.9.15):

1) Right-click the NoScript icon, and select Options.

2) Click the “Notifications” tab.

3) Find the checkbox titled “Display the release notes on updates”, and uncheck it.

4) Click “OK”.

That’s it! The NoScript page should no longer be force-fed to you after every update. Take a moment to truly enjoy that fact.

If you’re ever wondering about what they added in a particular update, you can check the update-specific release notes from within Firefox itself. In the Add-ons Manager, click the “Updates” tab, select the NoScript update, and click the “Show Information” button at the bottom of the dialog. Once clicked, you’ll see additional information about the update:

You can view an extension's release notes right in Firefox.

Now… remind me, NoScript developers, why I need to see your homepage every time you release a new minor version? For the sake of your advertising revenue, perhaps?

A Good Place to Find Free Loading Animations

As I was working on one of my personal web development projects today, I realized I would need a loading animation. Thankfully, I remembered a very useful web service I discovered a long time ago – AjaxLoad.info. The site is specifically designed to provide free, customizable loading animations – in GIF format.  They have at least 25 different types of loading animations – so if you’re looking for one, I recommend you check what they have to offer.

Screenshot of the webpage.

As for the “free” factor – in case you’re wondering: there aren’t any specific licenses associated with the images, but the front page clearly states that “generated gifs are totally free for use”. That said, enjoy.

An Easier Way to Search for Domain Names

In the past, whenever I wanted to search for available domain names, I checked with individual domain registrars. While this worked, it really wasn’t optimal- every time I wanted to check another domain’s availability, I had to press Back in my browser, re-enter a domain, re-submit the request, and then I’d know. Most websites were set up like this, unfortunately. Furthermore, if I wanted to compare domain registration fees, I’d have to check multiple websites.

I’m happy to say that these inconveniences are now no longer an issue. The solution lies in a site called Instant Domain Search. The webpage aims to facilitate the process of searching for a domain, and to do so, it:

  • searches automatically as you type
  • lists different rates from leading registrars
  • lists domains names that are for sale

Check it out:

Personally, I’m never going back to the old method.

The Wall of Cookies

Back in June 2008, I invited a friend of mine to an Iron Maiden concert here in Montreal. Since he lives in Nova Scotia, this meant that he’d be staying at my place for a few days. Over the years I’ve known him, it was very clear to me that he really enjoyed cookies… so I thought I should be equipped for his arrival:

The cabinet was almost completely full – each package you see in the photo had another identical one right behind it. Needless to say, we didn’t finish all the cookies – I had to give them away to friends and family.

Blocking Websites with the Windows Hosts File

Sometimes I decide that I never want to re-visit a particular website ever again, and I want a way to block it indefinitely. Normally, I just learned to ignore a website simply out of self-discipline. Lately, I decided I wanted something more secure. After all, even with self-discpline, I could still accidentally visit said site from a link found on another unblocked site. I figured out a good solution: the Windows hosts file.

Windows features a special file simply called “hosts”, without an extension. This file allows users to map hostnames to IP addresses. More importantly, however, is that when Windows tries to locate nodes on any given network, it will take the hosts file into consideration. It will actually consider the hosts file prior to querying DNS server, and any mappings found within will override those in the DNS. This effectively allows us to write custom redirections that affect the entire system – this was the key to blocking the website. To demonstrate how I used this to my advantage,  here’s what the default HOSTS file looks like in Windows 7:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

If I wanted to permanently block:

  • kanyewest.com
  • kanyeuniversecity.com

I would add the following entries to the file, in bold:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 kanyeuniversecity.com
127.0.0.1 www.kanyeuniversecity.com
127.0.0.1 kanyewest.com
127.0.0.1 www.kanyewest.com

By doing this, I’m telling Windows that whenever it encounters one of those domains, it should immediately resolve them to the IP 127.0.0.1, rather than querying the DNS server for the IP. The IP 127.0.0.1 is a special “loopback” IP – it pretty much points to whatever machine you are currently using. That’s how these domains are blocked – Windows will actually be told to use 127.0.0.1, which will definitely not work (since the local machine is not a web server, and is not configured to serve such content). This exact technique is used by Spybot Search & Destroy‘s Immunize feature – so when you open your HOSTS file, you might already see a bunch of entries blocked.

Notice, also,  how I added two entries per website I want to block – one with “www.”, and one without it. I considered this necessary because of the following: from the point of view of a DNS server, “www.websitenamehere.com” and “websitenamehere.com” are two completely different domains; however, in most cases, on the Internet, they tend to be configured to point to the same IP address, so we rarely see instances where they behave differently. Still, since they are different at the DNS level, both possibilities needed to be added to HOSTS file.

Ultimately, once configured, the end result is this: whenever you try to access a blocked site, you’ll get this type of error:

Error seen when attempting to visit a site that has been blocked via the Windows hosts file. This example showcases Firefox, but keep in mind that the block is system-wide. Other browsers will react similarly.

There you have it – a way to block websites in Windows, and a browser-independent one at that. As for the procedure for editing the HOSTS file, it differs depending on which version of Windows you are using – simply include the Windows version when you Google.

Pear: “go-pear.phar” Does Not Have a Signature

As I was trying to install Pear for my WampServer 2.0i installation today, I encountered a problem. When I ran the typical “go-pear.bat” script – I was hit with this message:

phar "C:wampbinphpphp5.3.0PEARgo-pear.phar" does not have a signaturePHP W arning:  require_once(phar://go-pear.phar/index.php): failed to open stream: pha r error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C: wampbinphpphp5.3.0PEARgo-pear.phar on line 1236

Solution

Thankfully, after searching around – I found the solution from a blogger named Latyr, who blogs in French. Since I speak French, I thought I should offer his solution in English. I expanded it into a few steps, for those that aren’t familiar with WAMP and PHP.

1) Locate the “php.ini” file.  In my case, I found it at this path:

C:wampbinphpphp5.3.0php.ini

Don’t use the WAMP system tray icon to edit this file. It didn’t work when I tried – you have to manually locate it.

2) Find the following line, in bold:

; http://php.net/phar.require-hash
;phar.require_hash = On

; http://php.net/phar.require-hash

;phar.require_hash = On

3) Uncomment the “;phar.require_hash = On”line by removing the semi-colon.

4) Change “On” to “Off”.

; http://php.net/phar.require-hash

phar.require_hash = Off

5) Save the file.

After I performed those steps, “go-pear.bat”  began working normally again.

In case you’re wondering about  the phar.require_hash option we just disabled, here’s the php.net description:

This option will force all opened Phar archives to contain some kind of signature (currently MD5, SHA1, SHA256 and SHA512 are supported), and will refuse to process any Phar archive that does not contain a signature.

See Also

The solution offered here was made possible by Latyr’s original blog post, entitled “Bug dans PHP5.3.0 Pear.bat”.

UPDATE January 8, 2023 – Old comments posted to my previous site can be seen here.

Powerful Mail

A friend recently sent me a package – I couldn’t help but laugh when I saw it:

I wasn’t home when this package arrived, and that meant the mailman had to leave note informing me that a package for “Refghi Power” would be waiting for me at the local post office. When I went to get it, I tried to contemplate how I would prove that I am “Refghi Power”, as all my IDs claim I’m “Matt Refghi”. Also, keep in mind that mostly everyone around here speaks French. Thankfully, the guy at the post office laughed and said he got it.

Yahoo! Answers: Suing Facebook

I was genuinely trying to find out if there was a way to have certain pictures of myself removed from Facebook, until I found this:

I like how all the others answers were, for the most part, completely correct – and yet the chosen “best answer” is ridiculous.

UPDATE January 19, 2013: Question was deleted, removed link.