Archive for the ‘Computers’ Category

Computers Nyan Cat The Excel Macro!

0 Comments

If you’ve seen my previous post you’d know that Excel can be fun sometimes. Last time I used Excel to draw images using the cells as pixels. Today though we have a fully animated Nyan cat wohooo! NANA NANANA NANAN NANANANA NANA NA NA NA

Ok enough! Heard the song enough during testing.

And YES those are Excel cells being updated regularly for the animated cat!

Download 

 

Main Window

Program Running

 

Tags: , , , ,

Computers Excel Art

0 Comments

After my presentation of Excel macros at BarCamp Kuwait a friend sent me this link (http://imgclean.com/?p=2149) on Twitter and said that this was much better than my excel macro. I told him challenge accepted and spent a week and a half trying to figure out how I’m going to to what I had in mind. The Excel macro I had in mind would let you choose an image, it will import it, read pixels and use the colours to colour excel cells & make an image out of them.

At the end, the program works as follows:

  1. Open a UserForm to enable user to import an image.
  2. Image Control in the UserForm will zoom the image so it all shows inside the Image Control.
  3. Handle the UserForm and use GetPixel function to get the pixel colours as “Long” integers.
  4. A function will extract individual RGB colours.
  5. A new WorkBook is opened, rows/cols will be re-sized and Sheet is zoomed out.
  6. Cells will be coloured with the previously extracted RGB values.
Problems encountered:
  • You cannot draw an image twice in one Excel sheet. It seems that Excel runs in an issue with large number of formatted cells. That’s why I’m using a new Work Book each time, it’s actually good too so you can save it for the image only.
  • VB has a Picture Box Control which is not available in VBA, Excel has only an Image Control which doesn’t have all the functions of a Picture Box. I’m not an expert on this since it’s the first time I use Forms and Controls so I cannot tell the difference. All what I can say is after hundreds of searches online many people were looking for Picture Box Control in Excel but it’s simply not there. I had to use Image Control and create a handle for the UserForm, declare GetPixel function, import libraries and then use the GetPixel to get all the pixel colours for the image.
  • RGB colour conversion used to over-flow so the negative numbers were set to 0 and numbers above 255 are set to 255. Now one might say when it goes negative it should be set to 255 because it over-flows. I’m not sure I just got bored of all the searches I’ve done so I don’t really care how they work. Yes not ALL pixels are going to be perfect but hey its giving great results!
  • When using the GetPixel function with loop I used to get part of the image while all other pixels give “-1” value. After long debugging I discovered that when Excel goes into a loop and for long time it gives a “Not Responding” message then starts being responsive after it finishes. This causes the GetPixel to get bad pixels from handle of the UserForm. A work around would be a small 10 ms delay in the loop or a progress bar box which was done using UserForm.
This program is not written to be perfect it has bugs and it definitely could be better.

Images:

Excel Art Load Image

Excel Art Loading Image
Excel Art Result

Excel Art Result

Excel Art Result Zoomed

Excel Art Result Zoomed

Download Source File

Tags: , , , , , , , , ,

Computers Firefox Beats Other Browsers

0 Comments

A friend of mine sent me this a while ago, Firefox & IE statistical graphs have crossed, with Firefox taking the lead in Nov 2009.

Worldwide Web Browsers Statistics

The Firefox’s graph is still rising above others. Take that Microsoft!

Statistics source

Firefox has proven it’s self as a reliable browser over time, even Google have built Chrome using Firefox’s technology. Web developers should now focus on compatibility, since many websites might be targeted to work on IE, which is most of the time incompatible with any other browser.

Now with the upcoming release of Chrome OS, the whole idea of the Operating System is around the browser, that’s the future of internet computing. Now Microsoft will be trying to catch up & I don’t see them catching up anytime soon if they ever will!

Computers What Happens When You Send Me a Virus?

4 Comments

One guy thought he could trick me & infect my pc through sending me a link to a website that downloads malware to your computer.
I bet he regrets that now.

  1. Website reported to Google & Firefox “Web Forgery Team”.
  2. Website reported to “McAfee site advisor”
  3. Virus sample sent & Antivirus vendors informed of the threat:
  • Avira
  • Avast
  • Bitdefender
  • AVG
  • F-Prot
  • Aladdin
  • Symantec (Norton)
  • NOD32
  • Clamav
  • eTrust
  • GData
  • F-Secure
  • And others through sharing submitted samples.

Note: Samples sent to AV vendors that couldn’t identify the threat.

Results: website has been blocked, more AV engines can recognize the threat.
Muhaha nice try!

The guy probably didn’t know I’m a Linux guy, otherwise he wouldn’t have sent it in the 1st place.