Updates from January, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • danielsaidi 8:11 am on January 28, 2010 Permalink | Reply
    Tags: ,   

    MagSafe toggles green/orange (cont.) 

    I have some strange updates regarding the greeen/orange blinking MagSafe I wrote about yesterday.

    As I wrote, the LED on the MagSafe blinks between loaded (green) and loading (orange) even though my new battery is fully loaded.

    When I tried the battery in a friend’s computer, it worked…and while trying the battery at her place, it worked even in mine! Yet, when I returned home, the blinking re-appeared…and even continued when I tried another MagSafe connector. Straaaange times.

    However, an even stranger thing has happened since then. Before going to bed yesterday (after reading about exploding, blinking MagSafe connectors for hours) I decided to try installing OS X upgrades. They said something abot adjusting the computer for new hardware (strange) and then I shut it down for the night.

    When I started the computer this morning, the blinking had stopped! Either, my MagSafe connector is loose and the other I tried is loose or broken as well (quite unlikely), or I just had to install additional drivers for the battery. I do not understand a thing, but as long as the blinking have stopped, I am mr. Happy.

    Update: Now, at 10:30 am, the LED is blinking once again. It seems like the LED does not blink when I have had the MagSafe disconnected for a while…but since my neighbor’s MagSafe blinked with my computer, it seems to be an issue with either the computer or the battery.

    • Ergon 11:24 pm on November 9, 2011 Permalink | Reply

      Just a quick not for anyone who might be reading this down the track, a blinking green/amber light on your magsafe adapter can mean one of a few things.

      The error message itself is that power is not getting to the battery or logic board.

      Possible causes to this problem are:
      -Broken magsafe adapter
      -Faulty battery
      -Needs a replacement DC-IN chip, this is the small chip attached to the logic board that mounts the charging connection port that you connect your magsafe to, if you are confident and your machine is out of warranty, this can be purchased off the internet for ~$30 but the logic board must be removed to detatch this chip. DO NOT ATTEMPT THIS IF YOU DON’T KNOW WHAT YOU ARE DOING, YOU COULD VERY LIKELY DESTROY YOUR COMPUTER PERMANATELY.
      -The final problem being the most serious is a faulty logic board, if you have exhausted the above options, this is more than likely your problem and I would suggest you take it in to an apple repair centre for a repair quote.

      • danielsaidi 7:26 pm on November 10, 2011 Permalink | Reply

        Great comment – thank you for posting it! The strange thing for me was that the MB received power, but failed to load the last percentage…or rather, once the load progress reached 100%, the color toggling started. Hopefully, others with the same problem will find help solving it with your answer.

  • danielsaidi 7:48 am on January 28, 2010 Permalink | Reply
    Tags: xbmc, , xot-uzg   

    XOT-Uzg – TV streaming on your XBOX 

    I recently picked up my old, black beast from the basement, where it has lived in solitude‚ since I bought the Wii, which I now have sold. So, since the Wii left an empty space, I decided to fill it with an old friend.

    Since I do not game on my XBOX anymore, I use it to play around with the XBOX MediaCenter software, which is great for chipped XBOX consoles. After I upgraded XBMC to the latest version, a friend of mine told me about XOT-Uzg, which is a script that can be used to stream web TV.

    XOT-Uzg screenshot

    XOT-Uzr running on another XBOX

    So, after installing the script, I noticed how the wonders of the new world appeared before me…as XOT-Uzg let me stream TV shows from Swedish channels as well.

    Now, my 1 year old daugher is watching “In the Night Garden”, streaming on the XBOX. It is sooo smooth. If you have a chipped XBOX, it is your duty to try it out!

    The only problems I have detected so far are:

    • You can not pause for too long, or XOT-Uzg loses its connection and exits the show
    • You cannot skip forward/back or fast-forward/backward

    The two problems in combination are quite annoying for long shows, but what the hey!

    • Nisse 9:33 pm on January 6, 2012 Permalink | Reply

      Instead of pause you can stop and use the resume function in XBMC. Press PLAY instead of OK when you start and it will resume.

      Skip forward/back I can use and if I don’t I use the numbers and jump to the time I want to see (on my remote). You can edit the keymap.xml to add this feature. Beware of that other feature will not work like the volume and mute.

  • danielsaidi 8:31 pm on January 27, 2010 Permalink | Reply
    Tags: , macbook battery,   

    MagSafe toggles green/orange 

    In my last entry, I wrote about all my problems with my MacBook (strangely though, this computer is by far the best I’ve ever had…which says a LOT about PC:s 🙂

    The last problem in the long list was that my battery swelled and had to be replaced. So, instead of buying a new Apple battery for about $190, I found a web site that sold “unofficial” batteries for almost half the price. Nice!

    After installing the new batteri and calibrating it, I was confused to see that my MagSafe adapter started to toggle between orange (loading) and green (loaded) although the battery IS fully loaded. The indicator reaches 100%, drops to 99% and goes on like this…on and on. So, I received a replacement battery and installed and calibrated it, but the problem remained.

    The way I thought, the problem could be either:

    • The replacement battery (two in a row = unlikely)
    • The battery together with my computer model
    • My MagSafe adapter
    • My computer’s battery connection (due to the swollen battery)

    However, if my battery would be loose, it would not be able to load…so…strike out the last alternative.

    To investigate this further, I took my computer to a friend of mine and installed the battery in her MacBook, where it worked like a charm…see below:

    • Her computer, MagSafe and battery = OK
    • Her computer and battery, but MY MagSafe = OK
    • Her computer, but my battery and MagSafe = OK

    So, this did not seem so promising…but when I re-installed the battery into MY computer, using MY MagSafe…it suddenly worked! Baffled (yet lucky), I returned home, where everything continued to work…

    …for a while. After two hours or so, the indicator started to blink once again! It still does so, so I am once again stuck with a MacBook component that does not work.

    If we boil this down to a summary, the battery seems OK, since it worked in my friend’s computer. However, so did the MagSafe, but…….is it possible that the MagSafe is damaged and that it happened to be “not loose” when I tried it out at my friend’s place?

    I will call another friend and ask him to come over with his MagSafe. If it works, it seems like I have to go to the place where I bought my computer and keep on struggling with this odd odd ODD MacBook example.

    • Johan 7:50 am on January 28, 2010 Permalink | Reply

      I was confused by your sudden change av språk.

      • danielsaidi 8:00 am on January 28, 2010 Permalink | Reply

        Ha ha ha, seems like I left a residue from the opinion I wrote on the reseller’s web site 🙂 Thanks for noticing!

  • danielsaidi 7:15 pm on January 27, 2010 Permalink | Reply
    Tags: , swollen battery   

    MacBook – swollen battery 

    I have previously written about my numerous problems with my white MacBook, which I purchased in August 2007.

    For instance:

    • the fan roared like a truck
    • the audio out port shone with a red light and thought that I had plugged in an optical device (which I had not), which turned of all sounds from the internal speaker
    • the chassi cracked(!)
    • the color wheel of death appeared every now and then, freezing the computer
    • the computer stopped waking up from sleep
    • the computer stopped recognizing my hard drive and displayed a ? when booting up

    Fortunately, I had documented all these problems with pictures and videos and written a long issue report, which I intended to give to the reseller (in hope of a replacement computer). When the last problem occured, I was very glad that I had taken this step. The support person I gave the computer to doubted that I would get the errors accepted as a reclamation, but when I handed him the report, he said that it improved my chances drastically.

    And so it did…obviously, since I got the computed repaired. After that, it has worked like a charm…

    …until the battery swelled.

    I did not notice it at first, but after a slight bump in the battery, things quickly became worse, and before I knew it, the battery stood out quite a bit from the computer. Apple did NOT accept this complaint, so I had to buy a new battery. Luckily, I found a reseller that sold unofficial batteries.

    Still…(suprised that the problems keep washing over me?)…the new battery did not work as I had hoped. I will write about this in the next entry…the green/orange color toggle problem.

  • danielsaidi 2:33 am on January 26, 2010 Permalink | Reply
    Tags: assets, content, folder,   

    Load all content files in a folder in XNA 

    After playing around with XNA for a little while, I quickly realized how tedious it is to load all content manually, especially if the project uses a lot of images, sounds, textures etc.

    The method below is an extension method that can load all files within a folder into any content type. The method requires that the specified folder is relative to the Content.RootDirectory folder.

    public static Dictionary<String, T> LoadContent<T>(this ContentManager contentManager, string contentFolder)
       //Load directory info, abort if none
       DirectoryInfo dir = new DirectoryInfo(contentManager.RootDirectory + "\\" + contentFolder);
       if (!dir.Exists)
          throw new DirectoryNotFoundException();
       //Init the resulting list
       Dictionary<String, T> result = new Dictionary<String, T>();
       //Load all files that matches the file filter
       FileInfo[] files = dir.GetFiles("*.*");
       foreach (FileInfo file in files)
          string key = Path.GetFileNameWithoutExtension(file.Name);
          result[key] = contentManager.Load<T>(contentManager.RootDirectory + "/" + contentFolder + "/" + key);
       //Return the result
       return result;

    The function extends the ContentManager class, and can, for instance, be used by the main Game class like this:

    • var textures = Content.LoadContent<Texture2D>("Textures");
    • var models = Content.LoadContent<Model>("Models");
    • var songs = Content.LoadContent<Song>("Songs");
    • ...

    The method returns  a dictionary, so if you want to access the “warrior” model in the models dictionary, you just have to access it as such:

    • var warriorModel = models["warrior"];

    I am having some problems with pasting in code fragments into this blog, so if anyone can give me some tips for good plugins that can be used at wordpress.com, feel free to do so 🙂

    • EriX 1:17 am on August 10, 2010 Permalink | Reply

      This is great! thanks soooo much for that info 🙂

    • Gradius V 10:32 pm on February 8, 2011 Permalink | Reply

      Thanks for this tip =)

    • Cpt Fresh 7:06 pm on March 23, 2011 Permalink | Reply

      Thanks, this was actually exactly what I needed.

    • TXG1152 5:20 am on April 27, 2011 Permalink | Reply

      Thanks for the great solution. One note though, for XNA 4 it seems that the asset name in ContentManager.Load(asset) is relative to the content loader root directory. You will need to take contentManager.RootDirectory + “/” + out of the call or you will get an error. Try this instead:

      result[key] = contentManager.Load(contentFolder + “/” + key);

    • Andy 8:59 am on October 26, 2011 Permalink | Reply

      Thanks, nice tip, but i have a question:
      How can i convert this result (Dictionary) into Dictionary for example?
      Dictionary buttonList;
      buttonList = result; <— Error because of the conversion
      thank in advance =)

    • Andy 9:02 am on October 26, 2011 Permalink | Reply

      Hmm there was a problem displaying my question properly:
      “Dictionary(String, Texture2D) buttonList;”
      “Dictionary(String, T) result;”
      “buttonList = result;”

      • danielsaidi 9:37 am on October 26, 2011 Permalink | Reply

        Wow, I have not looked at this for a long while 🙂 However, let’s begin with – what is T in your example? Can T be cast to Texture2D?

    • Andy 10:32 am on October 26, 2011 Permalink | Reply

      T can be a Texture2D, SpriteFont or Sound or whatever
      here another example:
      buttonList is a Dictionary with String, Texture2D
      fontList is a Dictionary with String, SpriteFont
      and result is a Dictionary with String, T and T can be: SpriteFont, Texture2D, Sound
      case “Other”: buttonList = result;
      case “Font”: fontList = result;

    • danielsaidi 10:37 am on October 26, 2011 Permalink | Reply

      I may be wrong, but in order to make your code work, you need to constraint T so that it always can be cast to an Texture2D…at least for the example you provided. You can do this by adding “where T : Texture2D”. If T can be anything in your code, then buttonList will not be compatible with result.

      • Andy 11:29 am on October 26, 2011 Permalink | Reply

        “If T can be anything in your code, then buttonList will not be compatible with result.”
        yeah and i wanted to implement a qucik and nice solution for this problem,
        so that i dont have to look for the type of T , if its a Texture or Sound or a Font….
        do u have any idea how to convert this without using if or switch?

    • Victor 2:50 pm on November 3, 2011 Permalink | Reply

      Humm, i had to make the following changes before it works for me:

      result[key] = contentManager.Load(contentFolder + “\\” + key);

      • Victor 2:50 pm on November 3, 2011 Permalink | Reply

        my folder structure: Content\Set1\myFile.png

    • Steven 5:45 pm on March 6, 2012 Permalink | Reply

      This is exactly what I need, but I have a problem. I added the code as you wrote it and get no compilation errors. When I run the program I get a ContentLoadException, file not found, with result[key] = content.load &lt t>(contentManager.rootDirector + “/” + contentFolder + “/” + key);. I’ve tried making changes listed here but the same error comes up. I can’t figure it out. And the thing that baffles me the most is the fact that when I look at the file in the foreach loop, it shows that the file exists at that location.

      • Steven 10:54 pm on March 6, 2012 Permalink | Reply

        Thanks for the help that would have been given. I finally managed to figure out my issue. I has some weird things going on with my content directory, but a new project and it works fine. Thanks for the code.

        • danielsaidi 10:15 pm on March 9, 2012 Permalink

          Glad that it worked out! This was such a long time ago that it is great to hear that it is still a working way to handle content 🙂

  • danielsaidi 6:47 am on January 25, 2010 Permalink | Reply

    Doing my first XNA tutorial 

    After looking at my friend Jens’ XNA game framework, which really helps you get started with your XNA games, I think I’d benefit from reading a tutorial or two. The game project type is quite different from other types of software I usually develop, so I’d better read something before getting my hands dirty.

    I will start off with the Microsoft tutorial for getting a small 2D game up and running, with a bouncing sprite:


    After that, I will probably do a couple of more tutorials with 3D models and a bit more advanced functionality, before continuing with my “which-I-thought-would-be-quite-easy” game project.

  • danielsaidi 8:35 am on January 4, 2010 Permalink | Reply
    Tags: kobingo, ,   

    XNA – A first glance… 

    Two days ago, I started looking at XNA, which I’ve been longing to do for quite som time now. After installing Visual C# Express 2008 and XNA 3.1, my friend Jens came over to guide me some of the basics.

    After two minutes or so, we happily loaded a texture by pressing space. Although I’m sure that XNA has more to offer than this, I’m glad to be on my way to creating a crappy game that no one will ever download 😉

    Jens, on the other hand, has created quite a few nice games for XNA on his profile – kobingo. Make sure to check them out if you have an XBOX – especially the nice Painting Party 🙂

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc