Thursday, 6 November 2014

Computer construction for laymen

Now picture this. As an IT person and an old geek I have always found it quite simple to tell how computer is built and what are its parts for. But then I met some people and they asked me a very simple question: Yeah I know there's a processor in, but what does it actually do?

I went on about computing power, and data and all I got were blank stares.

I needed some example most people can relate to, and it actually is very simple.

So what are those parts of the computer most similar to? There we go:



Looks familiar right? :) Human body analogy, by Ishtar (there are other approaches of course)

So there we go:


As you can see there are some cryptic abbreviations in this picture. You may meet them when talking about computers so why not find out what they mean?

HUMAN BODY PARTCOMPUTER PART NAMESHORT DESCRIPTION & FUNCTION
BrainCPUCentral Processing Unit, or processor is like the prefrontal cortex in brain, responsible for thinking/processing and execution of data.
GPUGraphics Processing Unit - like occipital lobe in brain processes and makes sense of visual data, GPU is usually "the processor on a graphics card"
Sound Chipin other words "the sound processor" is a part sometimes present on motherboards, especially in cheaper laptops but most of the time on a sound card, and is a bit like temporal lobe in brain responsible for processing sound.
Short term memoryRAMRAM means Random access memory and is the kind of memory in computer that gets wiped if you switch computer off, but is needed to help processors process data, or save it to disk, so really like our short term memory.
Long term memoryHDD or SDDHDD is an abberviation used for traditional hard disk drives, while SDD is for more modern solid state disk drives. Function of both is the same. Keep data saved even when computer is off. Exactly like long term memory.
EyesCamera & Scannerused to collect visual images, and pretty much nothing else. All transfer and processing is done by bus (see below) and GPU.
EarsMicrophoneUsed to collect sounds. Ears have slightly more complicated function as well, because they also help establish your position, so they are also a bit like mobile phones and laptops position sensors.
Mouth and LipsSpeaker & HeadphonesWhen used to emit sound lips and mouth are the equivalent of sound output devices of your computer. Actual processing is done by brain or sound chip.
Nerves, nervous systemData busAll elements of computer attached to motherboard are connected via multitude of links allowing them to communicate with each other, if you look at the motherboard some of those pretty metallic lines on the surface are a part of bus, much like little nerves in our bodies.
Heart, Lungs and StomachPSUPSU stands for Power Supply Unit and is essentially the bulky piece all external power cables are connected to in a desktop computer, and all small power cables inside of it. It essentially manages the electric power so that all parts of your computer have when and as much as needed. Much like Lungs and Stomach give us air and food and heart pumps them to all body parts. Funny thing is that you computer if attached with a PSU not able to support all devices (with too little power output) will starve them pretty much like you can starve your body, and those devices will malfunction or stop functioning at all.
Digestive system and veinsPower cablesafter reading the above this seems pretty simple. Just like your gastric parts and veins distribute food and air though you body, power cables distribute electricity inside your computer.
Hands and FingersKeyboard and MouseNow this is simplifying what your hands can do, but they are indeed input devices.
Inside of your bodyMotherboard and ControllersAll of the computer components are attached to motherboard. Motherboard is like the base for all buses, input interfaces and all communication devices. It is like the complicated suspension mechanism you actually have in your body making all you internal organs fit in place and take pretty much the same space. If you need to add some very special device to this system you have tu use controller, which may be built in the motherboard or come separately as a card. Now this our body can't do yet ;)
Outside of your bodyComputer casenothing to add really. You can have a tough "case", or a pretty one. No matter what all of them will have input and output holes and a lot of slots for extra accessories/peripherals ;)
CPU CoolingOur skull!Believe it or not, but our skull is the place we lose a lot of heat through. Even though our brains do not overheat we too have systems to remove excess heat. Computers can get damaged if they overheat, so nowadays pretty much every processor (CPU, GPU) has cooling system, so does the entire machine (fans, water cooling).
I hope this manual will help you understand your machine better.

And if you're a computer GURU and think you can improve this text, don't hesitate to comment.


Images used:
"Wheel mouse" by Qurren (Qurren's file) [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons

Picture of the Bose Computer MusicMonitor speaker system by Ben Stassen's [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons

"Black-white 2 Vista" icon theme by DBGthekafu [GPL (http://www.gnu.org/licenses/gpl.html)], via Wikimedia Commons

Dieses Bild zeigt eine SATA-Festplatte (Western Digital WD740 - 10.000 U/Min - 74 GB). by Darkone  [CC-BY-2.5 (http://creativecommons.org/licenses/by/2.5)], via Wikimedia Commons

A photo of a DDR SDRAM.By Utente:Sassospicco (Own work) [CC-BY-SA-2.5 (http://creativecommons.org/licenses/by-sa/2.5)], via Wikimedia Commons

The pin grid array at the bottom of a Motorola XC68020 (prototype of the MC68020) by David Monniaux [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons

All other images are public domain

Tuesday, 4 November 2014

LG G2 review half a year later - massive memory issues

It was the Phone of the year when released and indeed LG G2 sports some fabulous stats. It looks good, feels good, operates good and overall was a great mobile phone vastly superior to my favourite line of Samsungs I've been using before.





One thing I have overlooked was the lack of memory card slot. But with 32GB storage and 2GB RAM this seemed not to be a problem. Wrong!

A several months of using it and I run into such massive problems that only a full factory reset and following careful application grooming helped me regain control over the device.
It must have been a more common problem, because newer LG G3 already has a memory slot.

What were the symptoms?

  1. Tapping stopped waking up display. - I thought... oh well this is nouvelle, maybe it wasn't tested for that many taps and it died... I can survive it. Yes I am that lazy when it comes to call service desks :D
  2. Phone started getting very slow, then gave me a message that it has full memory. - I have promptly removed almost all of my photos (quite a lot of them), all videos, all downloads and documents. And it started working, but still quite slow. I kept checking for syncs, missed data. Old applications storage... Nothing helped.
  3. Waking up the phone took a trial and error approach, it would sometimes wake up after pressing the buttons at the back, but most of the times it would not. When it would it would tell me I have no connection, while on WiFi and full bars, or would just display completely unresponsive screen and then time it out and die.
After a lot of tries I have decided to connect it to my computer (while it still sort of worked) and in a painfully long process (it kept hanging and disconnecting) back up all my stuff (yes LG backup stopped working) and perform a factory reset. My reasoning was: If the phone is broken the problem will manifest itself with only a handful basic apps within the first week. If not, then it must have been one of the applications.

I was wrong. After gradually adding applications I noticed that LG G2 can't gracefully handle a lot of installed applications. Many processes running in background, a lot of cached data will pretty much brick it.

At this point it seems like the only solution is to keep number of the installed applications managed. And to be honest for me, who uses a lot of applications on daily basis this is a no go. I need to be able to keep more than 40 apps on my device. And currently this seems to be the level my mobile handles OK. It may be different for other users, because not all applications are the same, some don't run processes, some store less data.

Another option is to regularly delete application cache. Also not perfect. I like some apps to keep my data, it makes it quicker to work with them.

With no option to expand memory I am now just waiting until my contract is finished so I can replace this phone.

Friday, 31 October 2014

Background image in android apps for portrait and landscape view

In order to have background image displayed in an Android activity, it is enough to copy your image to: /res/drawable/ it will get copied across the other drawable-* directories.

Of course you should create versions for all resolutions/densities you want you app to work with, but for testing purposes one image will suffice.

Let's say you have image called: bg01.jpg

To show it as a background, you should add to you Layout definition:

android:background="@drawable/bg01"

No extension. If you have two files with the same name and different extensions, the behaviour of your application will be erratic at least. Try and avoid it. Even though your IDE may not spit any errors, and you device will handle it gracefully, other might not. If you absolutely need to have same names, for reference for example, keep them in different directories.

If your project is missing the res/drawable directory, you may either create it or forget it and use drawable-ldpi for example. If you decide to create it and use Eclipse or Zend, don't forget to run Project->Clean...

So lets's say You've added that background and it looks great in portrait view, but gets stretched terribly in landscape view:




Without messing with code and creating very complicated rules to find out what view are you using, just create directory res/drawable-land (from landscape), or res/drawable-land-ldpi and in it add a version of the background created for landscape view (turned by 90 degrees most likely). It has to have the same name as its portrait equivalent.
Directory names work the same for portrait views: drawable-port, drawable-port-ldpi.

The result will be:


Beautiful background taken from: http://tiled-bg.blogspot.co.uk/ a gallery of free tile-able website backgrounds.

Monday, 30 June 2014

Dell Latitude X1 manuals

This is an old machine. And even though it sort is in fashion now there's less and less on it in the web.
So before they disappear from the net I present you LX1 manuals ;)

Dell Latitude X1 Service Manual PDF (1441 KB)
Dell Latitude X1 User's Guide PDF (1089 KB)

Time to upgrade CrunchBang!

New version of #! as well as debian are out.
Time to get up to speed!

And with that I've found a very nice suggestion on how to do it really quickly here.

Mind you this is sugesting upgrade to unstable version, and you may not want it.

Happy upgrading.

Friday, 23 May 2014

Illustrators - Sergio Diaz

There you have it, an impossible blend of vivid yet toned down (how is that even possible?!) colours and rather dark imagination.

I personally love these works for their uniqueness.

Which picture brought me to Sergio's website?
And then I found this:


Amazing isn't it?

Go check www.sergiodiaz.com.ar yourself.

Friday, 2 May 2014

Illustrators - Dave Paget

I have definitely forgotten about "flowers" from the internet. To fix that I will start sharing blogs and private webpages of some amazing artists I came across internet.

And I've instantly fallen in love with this image:

Belle
Amazing blend of very modern, futuristic even fabrics, ethnic silhouette and markings, such as tattoo and dress/trousers design. And only just a touched face, but so full of unspoken feelings.

Truly one of the best illustrations I've ever seen. And it comes from Happy Mutt Design which belongs to Dave Paget.

Dave in my eyes is one of the rare illustrators, who not only have amazing skills (more of them out there) but also unparalleled imagination (and that is an outstanding mix).

It is also quite clear from his blog, that every piece of work follows a thorough research a lot of tries. I love the way he presents his creation process. Take a look yourself!


Wednesday, 30 April 2014

Google fonts not displaying on HTML5 canvas

I have been developing a web page and needed to use google fonts on canvas with elements added dynamically via js (jquery and kineticjs).

But they weren't logging as the browser gets the .woff files last no matter what you do.

There are a lot of suggestions how to organize your css files, when to include them and so on, none of these tackled the problem for me.
Working solution was actually simple.

Make sure that you execute all canvas related js code after the page has stopped loading, so either enclose it in:
window.onload=function(){
YOUR CODE HERE
};
or for jquery:
$(window).load(function() {
YOUR CODE HERE
});

Monday, 7 April 2014

World of Warcraft under SUSE 13.1

Do not even try VirtualBox. Not worth the hassle.

Install wine.
Download and install the executable from battle.net.
If you have 64bit system you will most likely see the game crash with Error #132 (0x85100084) Fatal exception!

If that is the case, before any weird changes in config files try simply making sure that you run the 32it executable.

And no, for some reason flag -noautolaunch64 isn't enough.

open console and type:

cd ~
cd ".wine/drive_c/Program Files (x86)/World of Warcraft/"
mv Wow-64.exe Wow-64.exe.bak
wine Wow.exe

If you can play, then you may want to change the link on your screen if you have it
Right click on the icon.
open with Kate or any other editor and change Exec line to:

Exec=/usr/bin/wine "/home/[your user]/.wine/drive_c/Program Files (x86)/World of Warcraft/Wow.exe"

Happy farming :)

Of course this may not work for you because error #132 means memory problems of any type... But there are a lot of other helpers in the internet if it doesn't help you.

Monday, 31 March 2014

KDE Plasma desktop crash on start (faulty widget)

I have placed a rather nice looking world clock widget on my screen the second I found it, unfortunately after some time it broke down, and no cache clearing helped.

What did help me was:
  1. in console, move the offending widget to temporary location:
    mv /usr/share/kde4/services/plasma-applet-worldclock.desktop /tmp/
  2. CTRL+ALT+DELETE -> Log out
  3. Select KDE session (Failsafe)
  4. Log back in
  5. I could see an empty "widget window", which now could be removed from the screen.
  6. again log out, 
  7. Chose normal KDE session
  8. log back in
  9. mv /tmp/plasma-applet-worldclock.desktop /usr/share/kde4/services/
  10. chose the widget from the widget list and place it back on the screen

Note, that your widget might be in different location, but this should help with most of them.




Sunday, 30 March 2014

Dual monitor display with GeForce GTX 590 under openSUSE 13.1 linux


Hi.
Windows on my desktop is no more. And not that I really miss it, even though as always with a fresh linux installation there's a lot to configure.

I've always wanted to try openSUSE so this time I've downloaded the live version of the newest and... Install was easy, quick  and flawless, only... I had no display on my second monitor.

I have a great GPU, able to run all games I play flawlessly, with SLI technology and so on. It can also give you stunning 3D Vision Surround, where if you plug 3 monitors to it your view will expand over three screens.

However I am only using two. Don't play games which would benefit from the above, but as a programmer I simply find it a must, to have another display.

Windows has always shown image on my two monitors, occasionally spitting bluescreen, so I was sure that it is maybe a "slightly faulty" GPU. You can never be sure with Windows... And now that I've noticed that Linux is not showing anything I got pretty much sure, but still decided to try, especially that nothing in the error logs indicated any hardware failures.

Apparently if everything is fine, then your openSUSE install, even with nouveau drivers (which are installed as default) should recognize your monitors and cards and work without problems.
However I had image only on one screen, the other remaining blank and showing "No signal" upon manual powerup.

I installed xrandr and it told me that:

DVI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 
   1920x1080      60.0*+
   1440x900       59.9  
   1280x800       59.8  
   1152x864       75.0  
   1024x768       70.1     60.0  
   800x600        60.3     56.2  
   640x480        66.7     60.0  
   720x400        70.1
DVI-1 disconnected (normal left inverted right x axis y axis)

Which wasn't true! I had both monitors plugged in.

I have ventured to Nvidia page, to check the drivers, because for some more advanced features I found proprietary drivers to work better in the past.
Besides on top of the above I should be seeing more than one disconnected monitor for this card, which meant that nouveau didn't recognize the card perfectly.

On GEFORCE site, they've suggested:
Also note that SuSE users should read the SuSE NVIDIA Installer HOWTO before downloading the driver.

I've found that HOWTO is for older versions, but it also said that already for versions 12 of openSUSE I'd be better to download drivers from the repository.

I chose the simplest way, because I didn't want to recompile drivers after every kernel update!
  1. Update your Kernel via YOU (YaST Online Update)
  2. Use YaST -> Software -> Software Repositories -> Add

  3. Protocol: HTTP
    Server Name: : download.nvidia.com
    Directory on Server: /opensuse/13.1

    to add the NVIDIA http server as additional installation source.

  4. Use YaST -> Software -> Software Management
  5. The appropriate NVIDIA packages should be autoselected, if your card is supported, for me it was: x11-video-nvidiaG03.... version of the drivers.
Now I could see all connections on my card, but they were still disconnected, however this time I've seen the correct order of the connectors! And I had my monitors plugged into the top and bottom DVI sockets, which is wrong for a two-monitor setup!

If you missed it, make sure, that for two monitors, you plug them into two slots which are in line, the order actually is important!

Tuesday, 25 February 2014

htaccess authentication and cancel

It was driving me nuts.

I have this one website I'm working on now and I wanted to protect it from the unwanted eyes.
I still wanted my admin and tester to be able to look at it, and that was easy. There a plenty tutorials out there which help you set up .htaccess file, create the passwords and so on. Just look at the Apache one.

But what was happening when someone just clicked cancel? They could still see most of the page content!

So instead of protecting my development I was making it more interesting for spying eyes.

None of the tutorials tell you how to disallow access to the website when someone clicks "cancel" instead of entering password.

And it actually is quite simple.

Instead of using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
Require valid-user

You should be using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
<files '*'>
Require valid-user
</files>

Thank you Apache for NOT making it obvious.

Thursday, 20 February 2014

LX1 graceful retirement

OK, the time came when I have actually decided my little LX1 should retire.
But as I'm still quite attached to it I do not just want to bin it, that feels wrong.

I've decided to:

Use it as my home server / development box

With so many free cloud-based free solutions it might seem and overkill, but it was actually quite useful.
It's much easier for me to set up a VM and test certain setups in a non-state-of-art environment (much more life-like than most professional tools). After all it's easier to emulate network connectivity problems at home, or even DDoS your own computer to see how it behaves.   

Expose it to the world so that I can have insight into what's happening at my home (though it's really hard to get this little processor to stream live camera images, but work is ongoing)

I have always liked the idea of being able to just switch on browser (or in this case my mobile) anywhere and see, how the weather looks like at home, or if my cats are behaving ;)

Keep it in the kitchen so it works as a clock/calender/task manager - so far the most useful and appreciated function. Everyone loves it ;) I will share the application when I tidy it up.

I had several wall clocks failing during the year. And for me it's crucial that I have a clock and ideally a digital timer in my kitchen! So I've invented (quickly, so the code is not worth sharing yet) a sort of a proof of concept application showing current time (big enough so that I can see it from the living room, and because of the simple fact that it's a lit monitor it also works at night), date, weather information, my appointments, tasks and friends' birthdays from Google calendar and on top of that sun rise and sunset times and moon phase just for fun.

Check the screenshot. I think it's quite neat with Google fonts and HTML5 extras Do you like it?


Real Time Web Analytics