BASIC Computer Programming Part I : Understanding Programming Concept

May 19, 2011 at 1:37 pm (BASIC / Visual Basic, Programming, Uncategorized) ()

Foreword:

I guess I’m a bit old now that I cannot remember almost half of my computer knowledge. So now I decide to write things that I still can remember before they gone with the wind. And now I’ll write about BASIC computer programming. It’s a bit of old school, but I thing it can help you if you just starting to learn about computer programming.

Ok, I think everybody know that Programmer” is someone who creates computer programs – also known as “software”. If you read up to this point, you might get interested to be a programmer, so I’ll try my best to guide you to be one. But, before we start creating a computer program we need to know more about programming it self.

Basically computer are doing “processing” to create “output”. This processing happens internally on computer’s processing unit and then the result will be presented on output devices – eg. monitor, speaker, printer, etc. There is one more element of computer’s work flow called “input”, but we’ll come to it later.

Computer cannot think by it self to create the output. So here come the programmer’s part to tell the computer’s processing unit what to do to get the desired output. Yes, that simple.

To be able to tell computer what to do, one needs to speak – or write, to be exact – computer’s language.

Programmers divides computer level of language into a bunch of catagories, but I divide this computer language into 2 levels to make thing easier:

  1. Low level = language that provide communications (almost) directly to hardware. By saying that, it means this language is specific for each processor. With low level language, programmers tell the processor exactly what to do. It’s very hard to master (for me at least).
  2. High level = language that very close to human language, usually easy to understand and easy to write. But programs written in high level language needs to be interpreted to low level language before it can instruct processor what to do. So by using high level language, programmer need other tools called “interpreter” or “compiler”. I’ll write the differences between these two tools if I have more time later. There are hundreds of high level programming languages. Some of the famous ones are BASIC, C++, Java, Perl, and Phyton.

On part 2, we’ll start to learn using a high level programming language that I’m most familiar with, which is BASIC programming language.

Thanks for reading, comments and critics are welcome.

Permalink Leave a Comment

How To Save Youtube videos (and other streaming videos) In Windows 7 and Vista

April 24, 2010 at 3:30 pm (Uncategorized)

If you have Windows 7 or Windows Vista, you can save videos from Youtube and other similar website by copying Internet Explorer temporary file.

There is no benefit compared to other method of downloading streaming media other than you can impress your novice computer user friends when you do this on their computer LOL.

Okay, this is how to do it step by step:

- Firstly, make sure you can view hidden and system files:
Click Start/Orb -> Computer
Click Organize -> Folder and search option
A new window should be appear. Choose View
Click on Show hidden files, folder, and drives
Remove the tick on Hide protected operating system files tickbox.
For novice user: With this setting,  you will be able to remove system files, so make sure not to remove any files!
For expert user: You wouldn’t be here reading this blog hehe :p  

Now you are ready to download the video.

- Open the videos that you want to save in Internet Explorer.
- Wait until the video is fully buffered (ie. in youtube the seeker bar is fully red)
- Click Start/Orb  -> Computer
- Type / paste this text to your address bar:

C:\Users\XXXXXX\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5

but replace the XXXXXX with your Personal Folder name. (See notes below if you dont know the name)
After you finished typing/pasting the address, press enter

You should see folders named with random alphanumeric character. Your video is inside one of those folders.
(to avoid doing this in future, I suggest you put a shortcut to this folder in your Windows desktop)

Open those folders one by one (if security dialog box appear just click Yes), and sort the files by Size and Descending so you can easily recognize your downloaded video. If said video is from youtube, file name should be something like “videoplayback[x]” ( the x in brace will be a number).

If you can’t see said file, go back (press backspace or back button) and open another folder.

Once you found the file, rename it (press F2) and add .flv at the end of the file name so the file name would be something like videoplayback[1].flv

you can rename it to anything as long as the extension is .flv

Open that file, and it should be played with your media player.
Move the file to other folder. If you don’t move it, it might be removed by Internet Explorer after certain time.

Note : if you dont know your pesonal folder name, click Start/Orb -> Computer , open your root drive (usually C:\) and open folder”Users”. Your Personal Folder is the one that is not “All User”, “Default”, “Default User”, “Public”.

Thanks for reading, feel free to ask if anything is not clear for you.

Permalink 8 Comments

Fixing Windows Server 2003 That Keep Running Out Of Free Space

January 2, 2009 at 10:28 am (Windows, Windows XP) (, , )

I have a Windows 2003 server in one of my office that works primarily as a mail server (MDaemon 9.5), anti virus server (Symantec Endpoint Protection), and plain print/file server.

It run smoothly on it first 6 months, but somehow the hard drive is getting full in unbelievable rate. I saw it has about 1GB free space one day, but a week later  it only has 100MB free space left!

The low disk space notification appear every time, and then all of the sudden Mdaemon stop working, Symantec stop updating, print spooler refuse to works, Pringles  out of stock, Heroes story getting worse… ahhhh… headache!

So I create some junction point using “Junction Link Magic”you can get it for free from  http://www.rekenwonder.com/linkmagic.htm – for some Symantec folders (linked them to external hard drive) to fix this issue. That’s help a lot, I got plenty of free space after that and everything back to work normally… but only for one month.

Something is still hiding in the corner eating all the yummy space.

Mmm. MDaemon looks suspicious…  lets check… folder size is about 5GB – it is ridiculously big….

Aha! I found one subfolder in “MDaemon” folder named “Preprocess” (like C:\MDaemon\Preprocess\) that contains thousand of email files that I dont know why they all still there. They are the ones that eating my hard drive behind my back!

So the simple solution is to create another junction point for this folder and put the actual folder in another hard drive (external hard drive in my case). This is giving me 4.5GB freespace, and I dont have to worry that the disk will be full within next 2 years hahaha.

Anyway, I still dont know what is the MDaemon\Preprocess\ folder function, but I regularly clean up this folder to remove files older than 30 days.

Permalink Leave a Comment

Fixing Slow MySQL SELECT Query That Contains “ORDER BY”

November 19, 2008 at 1:33 pm (Database, MySQL) ()

Last night I was dealing with a very slow SELECT query with MySQL database.
The query itseft is a SELECT of multiple table (using JOIN) and has an “ORDER BY” clause.

Lets say that the table name is X, A, B, C, and D.
Table X contains foreign keys that linked to table A, B, C, and D (lets just say that table X contains column A, B, C, D, for the foreign key and column E, F, and G)

I tried to remove the “ORDER BY”, and the query is run amazingly fast !

That made me think “this could be related to the index or primary key”
So, i check the primary key on table X.
Haha! Immediately i found the problem.

The sequence of primary key indexing was different than the sequence of the query !

For example in this case :
Index sequence of table X primary key is C, D, B, A  and PK name is PK_X
ORDER BY sequence is table X column A, B, D

Here are some options to speed up the query :

Use “IGNORE KEY(PK_X)” after the FROM X clause
(i.e.  SELECT ……. FROM X IGNORE KEY(PK_X) JOIN A ……….)
The query speed up but still a bit slow.

Remove column “C” from PK_X
Somewhat faster query time that the “IGNORE KEY” fix, but i dont think this is the correct approach.

Rearrange the PK_X sequence to A,B,C,D
Waaaay faster that other fix, so i choose this approach.

Just for reference, before applying this fix the query time is about 6 second
With the first option it speed up to 3second.
With the second option it speed up to 2.1second.
And with the last option i get incredible 0.03 second.

Permalink Leave a Comment

Driver For Lite-On USB Wireless 802.11 b/g Network Adapter

August 26, 2008 at 3:16 pm (Windows XP) (, , )

Today, I have done an OS downgrade project (Vista to XP) on a built up compact PC for my client.

Everything went smoothly… dual boot working OK,  motherboard drivers OK, sound card OK, wifi O… ugh NOT WORKING!!!! Btw, the adapter is a Lite-On 802.11 b/g wireless network adapter

So I went to that compact PC manufacturer website looking for correct driver. Unfortunately, they don’t support Windows XP, so no XP driver to download. Lite On not listing any driver for wireless network adapter.

Google… Google… Google… ahhh…. could not imagine live without one.

After countless hour fiddling with drivers from several websites, I nearly gave up.
Then I realized how stoopid I am…

Ugh, restart the machine, go to Vista, see the device manager …. ta da!!! The wireless adapter is not using a Lite-On driver. It uses a Ralink driver. Ah… beautyfull!

The rest is eazy… go to the Ralink site and find the correct driver (do I even need to say that?).

http://www.ralinktech.com/ralink/Home/Support/Windows.html
EDIT : Link expired, try this one (thanks to ckan):

http://www.ralinktech.com/support.php?s=1

(Big thanks to Ralink)

Permalink 49 Comments

Windows XP : Mengatasi Masalah “Unable to log you on …” Saat Automatic Logon Aktif

July 23, 2008 at 2:31 pm (Windows XP) (, , )

Kasus :

Komputer menggunakan OS Windows XP Professional. Terdapat beberapa user account, dan logon menggunakan classic windows logon prompt.

Setiap kali komputer dinyalakan, muncul pesan error “Unable to log you on … dst… dst…”


Classic Windows Logon Prompt

Penyebab :

Registry menyimpan informasi logon yang salah. Pada saat auto logon mencoba logon dengan informasi tersebut, Windows menolaknya dan menampilkan logon error “Unable to log you on … dst.. dst…”

Solusi 1 :

  1. Buka registry editor (Start -> Run, ketik regedit , tekan Enter
  2. Buka lokasi key berikut :
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Cari dan double click entry DefaultUserName
  4. Tuliskan user nama default yang ingin anda munculkan di logon prompt. Klik OK, atau tekan Enter.
  5. Cari dan double click entry DefaultPassword . Apabila tidak ada, buat entry ini dengan jenis String Value (klik Edit -> New -> String Value, ketik DefaultPassword , tekan Enter, double click entry yang sudah jadi)
  6. Ketik password yang sesuai dengan username pada entry DefaultUserName , click OK atau tekan Enter

Tutup registry editor. Masalah sudah teratasi.

Catatan : Apabila entry AutoAdminLogon terisi dengan nilai 1 (satu), maka automatic logon dalam kondisi aktif. Untuk mematikan automatic logon, ganti valuenya dengan nilai 0 (nol)

Solusi 2:

Solusi ini lebih mudah, namun hanya dapat dilakukan di Windows XP Professional.

  1. Klik Start -> Run
  2. ketik control userpasswords2 , tekan Enter
  3. Hilangkan tanda check pada “Users must enter a user name and password to use this computer” checkbox, kemudian munculkan kembali.
  4. Klik Apply
  5. Isi username dengan username yang benar, dan password (dan confirm password) dengan password yang sesuai untuk user name tersebut. Klik OK atau tekan Enter.
  6. Klik OK untuk menutup window User Account.

Masalah pesan error sudah teratasi. Apabila ingin mematikan automatic logon, cukup dengan menghilangkan tanda check pada “Users must enter a user name and password to use this computer” checkbox.

referensi : http://support.microsoft.com/default.aspx?scid=kb;en-us;315231

Permalink 2 Comments

Follow

Get every new post delivered to your Inbox.