Press "Enter" to skip to content

Richy's Random Ramblings

Film and TV: No more Narnia movies and no more Project Runway

In a move designed to upset my my other half on Christmas Eve (mhahaha – it’s my evil deed for the week >-) ), I’m passing on the news that it looks very unlikely that Disney will be making any more Narnia movies (source Defamer.com who cite HollywoodReport.com as a source: but also see NationalPost, CinemaBlend, TotalFilm and E!Online – although they all say pretty much the same thing) and Jezebel is reporting that the new series (6) of Project Runway (which Katy watches a lot) is in legal problems which may stop its production.

Merry Christmas! 😀

Facebook: Copyrighted Content

I’ve just answered a post on LinkedIn where somebody asked (in the “Casual Games” discussion group):

“There is a hacked flash version of one of our games listed as an application at facebook. I could not find any real support contact information at the facebook website. Just FAQs and canned responses. Do you know anybody working at facebook whom I could contact in this matter? Thank you!”

As I think this may be an issue I’ll have to look at in the future, I’m copying my reply here:

You’ll probably be best sending them a DMCA (Digital Millennium Copyright Act) request as detailed on http://www.facebook.com/copyright.php and their form on http://www.facebook.com/copyright.php#/copyright.php?notify=1 . (See also http://www.facebook.com/help.php?topic=copyright )

As long as you provide the full details requested (including detailing the exact URL the content can be found: “A page on your site…” isn’t detailed enough to be an official request). Basically, if the DMCA is sent and is correctly detailed (see http://www.blogherald.com/2008/08/04/dmca-safe-harbor-part-two-the-dmca-checklist/ ), then Facebook may then become liable for any penalties for copyright breaches from 14 working days from that point (as, by notifying them via a DMCA complaint, they then lose the “safe harbour” provision for user generated content).

If the content is hosted by a third party (which may be difficult to tell if it is integrated using the FBML canvas frame method: if it’s integrated via an iFrame, it should be easier to tell: if you want assistance, feel free to contact me with the page on Facebook and I’ll try to help), then you can also contact the third party webhost/ISP for assistance.

Joke: Computer Problem Report Form

Computer Problem Report Form

1. Describe your problem:

2. Now, describe the problem accurately:

3. Speculate wildly about the cause of the problem:

4. Problem Severity:

A. Minor__
B. Minor__
C. Minor__
D. Trivial__

5. Nature of the problem:

A. Locked Up__
B. Frozen__
C. Hung__
D. Strange Smell__

6. Is your computer plugged in? Yes__ No__

7. Is it turned on? Yes__ No__

8. Have you tried to fix it yourself? Yes__ No__

9. Have you made it worse? Yes__

10. Have you had “a friend” who “Knows all about computers” try to fix
it for you? Yes__ No__

11. Did they make it even worse? Yes__

12. Have you read the manual? Yes__ No__

13. Are you sure you’ve read the manual? Maybe__ No__

14. Are you absolutely certain you’ve read the manual? No__

15. If you read the manual, do you think you understood it? Yes__ No__

16. If ‘Yes’ then explain why you can’t fix the problem yourself.

17. What were you doing with your computer at the time the problem occurred?

l8. If you answered ‘nothing’ then explain why you were logged in?

l9. Are you sure you aren’t imagining the problem? Yes__ No__

20. Does the clock on your home VCR blink 12:00? Yes__ What’s a VCR?__

21. Do you have a copy of ‘PCs for Dummies’? Yes__ No__

22. Do you have any independent witnesses to the problem? Yes__ No__

23. Do you have any electronics products that DO work? Yes__ No__

24. Is there anyone else you could blame this problem on? Yes__ No__

25. Have you given the machine a good whack on the top? Yes__ No__

26. Is the machine on fire? Yes__ Not Yet__

27. Can you do something else instead of bothering me? Yes__

PHP: md5 hashes, base_convert and 32 bit limitations

I’ve had cause to convert an md5 hash from the standard hexadecimal base 16 to base 36 (mainly to make it shorter for presentation purposes). However, using base_convert in PHP proved unreliable as the string wouldn’t always convert back correctly. This is on 64 bit Linux, but I’m not certain PHP has been compiled with 64 bit support (so it is probably defaulting to 32bit).

However, thanks to this post on the PHP documentation, I’ve changed the code to use:

/*use gmp library to convert base. gmp will convert numbers > 32bit*/
if (!function_exists('gmp_strval')) {
    trigger_error('GMP does not appear to be compiled into PHP');
}
function gmp_convert($num, $base_a, $base_b)
{
        return gmp_strval ( gmp_init($num, $base_a), $base_b );
}

To test this, here’s the code I used:
function testconvert() {
    $a=Array(10,23,46,239423, PHP_INT_MAX, 323927832, 174623748237, PHP_INT_MAX.PHP_INT_MAX);
    foreach ($a as $key) {
        $converted=gmp_convert($key,10,36);
        $phpstandard=base_convert($key,10,36);
        print 'key='.$key.'. Convert: '.$phpstandard.','.$converted;
        if (!(base_convert($phpstandard,36,10)==$key)) { print '<strong>Standard PHP Failed</strong>'; }
        if (!(gmp_convert($converted,36,10)==$key)) { print '<strong>GM PHP Failed</strong>'; }
        print '<br>';
    }
    foreach ($a as $skey) {
        $key=md5($skey);
        $converted=gmp_convert($key,16,36);
        $phpstandard=base_convert($key,16,36);
        print 'key='.$key.'. Convert: '.$phpstandard.','.$converted;
        if (!(base_convert($phpstandard,36,16)==$key)) { print '  <strong>Standard PHP Failed</strong>'; }
        if (!(gmp_convert($converted,36,16)==$key)) { print '  <strong>GM PHP Failed</strong>'; }
        print '<br>';
    }
}

e-Commerce: ClickCartPro making all product ids safe

Basically, in ClickCartPro product “identifers” can not have spaces, commas, full stops or brackets in them (basically only the letters A-z, numbers and underscores) and they have to be a maximum length (I’m not sure what the exact maximum is).

If you are maintaining an “established” store (i.e. one with products) where a number of products are showing up on the front end, but when you try to “Add to cart” they don’t appear in the cart then this is probably the problem. To “fix” it (this is more a work around), run the following UNREVERSABLE MySQL code (i.e. make sure you have a backup before hand):

create table temp_replacetest(id varchar(250),hash char(32));
INSERT INTO temp_replacetest (SELECT id,md5(id) from gbu0_prod);
update gbu0_prod,temp_replacetest SET gbu0_prod.xprod=replace(gbu0_prod.xprod,temp_replacetest.id,temp_replacetest.hash) where temp_replacetest.id IN (gbu0_prod.xprod);
drop table temp_replacetest;
update gbu0_prod set id=md5(id);
select id,xprod from gbu0_prod

This will set all product ids to be md5 hashes which, since they only consist of 32 numbers or the letters a-f, are “safe” to use as product identifiers.