Tag: glitch

  • WordPress ja “bad headers Non-encoded 8-bit data”

    Jyväskylän yliopiston atk-keskus paikkasi ilmeisesti spamassassinissa (tiedote on niin mitäänsanomaton, että edes tästä ei saa selvää) havaitun aukon asetuksella, joka rikkoo skandeja sisältävät sähköpostiviestien otsikot. WordPress narahti tähän tietysti heti ensimmäisenä: skandeja sisältävällä otsikolla varustettuihin merkintöihin tulevat kommentit heittävät laidasta lukien “bad headers Non-encoded 8-bit data” -herjaa. Kyhäsin pluginintekeleen joka korvaa otsikoiden skandit a:lla ja o:lla WP:n sähköpostittamissa kommenteissa.

  • Tietokoneen ostettu ominaisuus

    “Fujitsu Siemens Amilo M 43 -sarjan tietokonetta on markkinoitu multimediatehopakkauksena. Osalle ostajista todellisuus on ollut karvas, ja yksi heistä on Jussi Aho. Itse ongelman hän havainnollistaa tallenteella.

    – Kuva pysähtyy yhtäkkiä sekunniksi ja ehkä lyhyemmäksikin ajaksi. Samalla kuuluu sellainen BRRRRR-ääni, joka ei esimerkiksi elokuvaan kuulu. Tämän jälkeen kone toimii normaalisti jonkin aikaa, kunnes jälleen sama toistuu.

    – Mulla meni hermot ihan täydellisesti. Mä soitin ensin ystävällisessä hengessä, että mitä me teemme tämän ongelman kanssa? Tuesta vastattiin, että tämä nykiminen on koneen ominaisuus, eikä sun kannettavaasi vaihdeta.”

    Kuningaskuluttaja

  • Belkin varoittaa sähköiskuvaarasta

    Tietokoneiden oheislaitteita valmistava Belkin pyytää palauttamaan virtalähteen ja adapterin, jotka on toimitettu Belkin Hi-Speed USB 2.0 Notebook Card F5U222yy -sovittimen mukana. Sähköturvallisuustarkastuksessa on ilmennyt, että tuotteen mukana tuleva virtalähde ja adapteri […] saattavat aiheuttaa sähköiskun.

    digitoday

  • How to Crash Internet Explorer

    Ever wish you could make your friends and family switch away from Internet Explorer? Perhaps the ability to make it spontaneously crash (and I mean totally crash) just by sending them a link might sway them…

    Modern Life Is Rubbish via Juha
    link added

  • UTF-8 substr fot PHP

    “[Pulling] out an arbitrary substring which happens to cut a 2 byte UTF-8 sequence breaks the string;

    <?php
    header ('Content-type: text/html; charset=utf-8');
     
    $haystack = 'Iñtërnâtiônàlizætiøn';
     
    // Position 13 is in the middle of the ô char
    $substr = substr($haystack, 0, 13);
     
    print "Substr: $substr<br>";

    $substr now contains badly formed UTF-8 and your browser should display something wierd as a result (probably a ?)”

    Handling UTF-8 with PHP”
    phpwact.org

    a comment moved due to layout issues

    To go around this limitation, I used the following replacement substr code, which I extracted from “UTF-8 friendly replacement functions” v0.2, by Niels Leenheer & Andy Matsubara. For some reason, at the time of writing this, Google only seems to find a PDF version of this document.

    function substr($str, $start , $length = NULL) {
    
                 preg_match_all('/[\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF]/', $str, $arr);
    
                 if (is_int($length))
    
                       return implode('', array_slice($arr[0], $start, $length));
    
                 else
    
                       return implode('', array_slice($arr[0], $start));
    
          }
  • Apple Recalls iBook, PowerBook Batteries Due To Fire Hazard

    Name of Product: Rechargeable, lithium-ion batteries with cells manufactured by Sony for certain previous iBook G4 and PowerBook G4 notebook computers only.

    Units: About 1.1 million battery packs (an additional 700,000 battery packs were sold outside the U.S.)

    Battery Cell Manufacturer: Sony Energy Devices Corp., of Japan

    Computer Manufacturer: Apple Computer Inc., of Cupertino, Calif.

    Hazard: These lithium-ion batteries can overheat, posing a fire hazard to consumers.”

    CPSC

  • Theme Switcher: fixing the theme editor breakage

    Version 2.0 of Mr Peer’s Theme Switcher is would be perfect, if it weren’t for the unfortunate breaking of WordPress’ built-in theme editor, causing all requests to open files for editing be redirected to the home page. The problem seems to be the theme parameter, which is used by both the built-in editor and Theme Switcher.

    Fixing this issue seemed to be as simple as replacing all isolated mentionings of theme in the plugin source with a new, non-ambiguous keyword. I chose switchto, and the resulting code is available behind the previous link.

    So, the parameter to switch themes with this modified version of the plugin is switchto=themename, and this eliminates the problem with the theme editor. Otherwise it should be identical to the original in functionality.

  • Recent Comments Plugin and trackback titles

    I’m using the excellent Recent Comments plugin by Krischan Jodies on my other blog. It’s been working perfectly until I got the first pingback without a » (a &raquo;) in the $comment->comment_author field. That caused it to echo “Anonymous” instead of the actual title of blog doing the pingback.

    Strangely, of the macros defined by Recent Comments, %trackback_title seems to have the correct title already for the one ping coming from outside my site, but for in-site pings it displays the title of the post being pinged, so replacing %comment_author with %trackback_title wouldn’t help.

    So I edited the plugin to fix this. $comment_author is set on line 659:

    659			$comment_author =
    				trim(substr($comment_author,0,strpos($comment_author,'»')));

    Apparently, if the title doesn’t have a &raquo; in it, this nullifies comment_author, causing the soon to follow if (! $comment_author) test to fail and subsequently $comment_author being set to “Anonymous”.

    So I wrapped the trimming clause (the one on line 659 in the original) inside a conditional, which tests for the presence of &raquo;:

    659			if (strpos($comment_author,'»') !== false) {
    660				$comment_author =
    					trim(substr($comment_author,0,strpos($comment_author,'»')));
    661			}

    Now the title of the page doing the pingback is preserved in %comment_author.

  • Gaim Crash w/MSN login

    “Yesterday [15.8.2006], Gaim started crashing for a bunch of people (most notably Windows users) when trying to connect a MSN account. […]

    Gaim 2.0.0beta3.1 has been released which fixes this and other bugs in beta3. You can download it from its SourceForge file release page.”

    Gaim via S. Harman

    I’ve been suffering from this too. There was one day since the problem began, when I was able to login to MSN using Gaim, but thereafter it’s been crashing each time again.

    Just tried the new Beta, and it does fix this as promised.