Welcome To My Blog

This blog contains posts that may benefit ordinary visitors or programmers (particularly .NET programmer).
To view posts related to particular subjects, click the link under Labels.

Wednesday, July 6, 2011

How to configure your streamyx modem

Hi everybody,

Are you a Telekom Malaysia (TM) streamyx subscriber (Malaysia No 1 Internet Provider)? If you received a Wifi/Router Modem from TM, you can configure it using any computer. How to do it?

The steps are as follow:


  1. Connect the UTP cable from your computer to the modem.

  2. Open your browser, for example Internet Explorer.

  3. Enter the IP address, http://192.168.1.1/

  4. You'll see login screen which is actually login for the router/modem configuration interface. Normally, we enter "tmuser" both for the username and password.

  5. If the login is successful, you'll get the next screen displaying the device information. At the top right hand corner you can see the Wizard button. Click that button, if you want to use the Wizard to configure the wifi network setting such as Network Name (SSID) and the Network Key (to prevent unauthorized user from accessing your network).

  6. Once you have finished with the configuration, you may need to restart the modem to use the new settings.

That's all.

Friday, June 24, 2011

Paparkan Semula Folder Yang Tersembunyi

Salam sejahtera semua.

Pernahkah anda alami situasi di mana pendrive anda dijangkiti sejenis virus yg mana semua folder yg berada di root folder di sembunyikan dan digantikan dgn shortcut? Walau pun virus berjaya dihapuskan dari pendrive dan sistem komputer tapi anda masih gagal memaparkan semula folder-folder tersebut.

Bagaimana anda atasi masalah tersebut?

Ada pelbagai cara yg dicadangkan di forum-forum internet. Antaranya kita diminta mengubah registry dgn menggunakan arahan regedit.

Saya mencuba kaedah-kaedah yg dicadangkan malangnya ia gagal memaparkan semula folder-folder yg tersembunyi tersebut.

Rupanya ada cara yg lebih mudah dan berkesan untuk mengatasi masalah tersebut iaitu dgn menggunakan arahan DOS yg namanya ATTRIB.

Arahan ATTRIB ialah arahan utk setkan attribute sesuatu folder dgn H (hidden), S (system), A (archive), dan/atau R (read only).

Cara penggunaannya:

Utk sistem Windows XP,
  1. Klik Start => Run...
  2. Dlm kotak Run, taip cmd dan tekan Enter.
  3. Anda akan melihat Command Window yg berwarna hitam.
  4. Jika pendrive adalah F:, taipkan arahan berikut di command prompt dan akhiri dgn menekan Enter:
  • attrib -s -h f:\*.* /s /d
(Arahan di atas bermaksud buangkan attribute System dan Hidden dari semua fail termasuk directory dan sub-directory yg berada di drive F:.)

Utk sistem Windows 7, gantikan arahan di langkah (1) & (2) di atas dgn langkah berikut:
  1. Klik butang Start
  2. Dlm kotak Search, taip cmd dan tekan Enter.


Friday, June 17, 2011

Calculating Dates with Years and Months

Hi. Good day everybody...

Some people may wonder how to calculate the date difference between two date values in Excel. It may be easy if you just want to show the difference in floating number (number with decimal). For example, if the first date is a birth date stored in cell B1 and you want to show the difference in cell B2 as number of years, you can simply write the expression in cell B2 as the following:

=(TODAY()-B1)/365

On the other hand, if you want to show the answer as number of years and months, it's not that simple. The expression can be as long as the following (or may be even longer):

=IF(MONTH(TODAY())>=MONTH(B1),
(YEAR(TODAY())-YEAR(B1))&" years "&(MONTH(TODAY())-MONTH(B1))&" months ",
(YEAR(TODAY())-YEAR(B1)-1)&" years "&(12+MONTH(TODAY())-MONTH(B1))&" months ")

Anyway, what the above expression means ...
IF the MONTH in today's date is greater than or equal to the MONTH in cell B1, calculate number of years using the YEAR in today's date minus the YEAR in cell B1 and calculate number of months using the MONTH in today's date minus the MONTH in cell B1. Otherwise, if the MONTH in today's date is less than the MONTH is cell B1, calculate number of years using the YEAR in today's date minus the YEAR in cell B1 minus 1 and calculate number of months using the MONTH in today's date minus the MONTH in cell B1 plus 12. In other words, if the person's birth date not yet reach its anniversary, we have to minus 1 to the difference of years and add 12 to the difference of months.

Tuesday, July 13, 2010

Missing Icons in Windows 7

Salam sejahtera semua...

Sudah agak lama saya tidak update blog ni iaitu semenjak syarikat saya bekerja menggunakan internet filtering yang mana kebanyakan laman tidak boleh lagi dibuka termasuklah laman blog ni.

Nak gunakan Celcom broadband untuk update pun tak berapa sesuai. Nama aje broadband tapi apa yang saya dapat macam narrowband aje. Lembab sungguh hingga saya tak ada mood nak menulis blog.

Baru-baru ni saya telah membeli sebuah notebook baru jenama Toshiba model Satellite M500. Ia menggunakan operating system Windows 7 Home Premium. Seperti biasa, saya ni pantang dapat notebook atau handphone baru. Selagi boleh saya akan cuba install macam-macam aplikasi ke dalamnya.

Pada suatu hari saya dapati ada antara image untuk shortcut(icon) yang dipaparkan dalam Start Menu, di atas Desktop dan Taskbar hilang. Walau bagaimana pun shortcut tu masih berfungsi seperti biasa untuk jalankan aplikasi yang sepatutnya. Saya agak keliru tapi saya malaslah nak tanya rakan sekerja. Jadi saya tanya pakcik Google - teman sejati saya.

Alhamdulillah, jumpa beberapa link yang berkaitan dengan masalah yang saya hadapi. Link yang saya cuba datangnya dari Windows 7 Forums. Ia benar-benar membetulkan masalah yang telah saya hadapi. Apa yang saya buat ialah saya telah padamkan IconCache.db yang menyimpan image untuk setiap icon yang digunakan di atas Desktop, Start Menu dan Taskbar. Dalam Windows 7, iconcache ini spesifik untuk setiap user. Kalau dipadam, Windows 7 akan buat semula secara automatik.




Langkah yang patut anda ikuti untuk bina semula IconCache.db:
  1. Buka Start Menu. Kemudian taip cmd dalam kotak Search dan tekan Enter.

  2. Buat seperti dalam gambar bila tetingkap command prompt keluar.
  3. Log off kemudian log on supaya Windows 7 bina semula iconcache.db yang baru untuk menggantikan iconcache.db yang telah terpadam.
    - atau -
    Anda juga boleh bina semula tanpa log off dengan mengikuti langkah berikut:

a) Tekan Ctrl+Shift+Esc untuk keluarkan Windows Task Manager.

b) Dari senarai Processes, pilih explorer.exe dan kemudian tekan butang End Process. Desktop akan menjadi kosong.

c) Di Windows Task Manager, buka menu File dan pilih arahan New Task (Run...)

d) Dalam kotak dialog Create New Task, taip explorer dan tekan OK. Desktop akan kembali seperti sedia kala. #

Sekarang anda akan lihat setiap shortcut memaparkan semula icon yang sepatutnya. Senang aje kan?

Sila klik sini untuk lihat kaedah lain dari Windows 7 forum.

Monday, August 10, 2009

Using Web Service in ASP.NET

A Web Service (also Webservice) is defined by the W3C (World Wide Web Consortium) as "a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL - Web Service Description Language). Other systems interact with the Web service in a manner prescribed by its description using SOAP (Simple Object Access Protocol)-messages, typically conveyed using HTTP (Hyper Text Transfer Protocol) with an XML (Extended Markup Language) serialization in conjunction with other Web-related standards."


Please follow this link to get additional information about the web service from Wikipidia.


What is a web service in the context of ASP.NET? A web service can be considered as a remote software component. In this case, the component that resides in a hosting server offers functionalities that can be consumed by any application remotely via the internet.



CREATING A WEB SERVICE FILE


In ASP.NET, we can create a web service file with the extension ".asmx". We can use any of the .NET supported languages to write the codes. However, it is recommended to use C# programming language due to its efficiency and strong type support.

The picture below shows an example of a web service file.
As you can see from the picture, the web service file (asmx) has a page directive such as

<% @ WebService Language="VB" class="TestWS" %>

which describes the language used in the page and name of the class. In this case the language is VB.Net and the class name is TestWS.

Every method that you want to expose as a web method must be declared with the webmethod attribute and public access modifier. Once a method is declared as a web method, it can be called remotely by any other application via the web/internet.

Since the web service is using HTTP, it must be placed in a web application folder of the web server. This works almost similar to the ordinary web application.


CONSUMING THE WEB SERVICE

To consume a web method in the web service file, we must first create a proxy file in our machine using the WSDL tool that comes with Visual Studio. The following is an example how to use the WSDL command-line tool to create the proxy file (note that D:\webservice> is the DOS command prompt where you type the command -- D:\ is the drive and webservice is the folder name),

D:\webservice>wsdl http://www.wakiltakaful.com/mywebservice/testws_vb.asmx
/language:vb /namespace:safuan

In this case, the default output file that is created will be named TestWS.vb and the content is as shown as in the picture below.

Now we can use the VB command-line compiler to compile the proxy file to an assembly as shown below:
D:\webservice>vbc testws.vb /target:library
The output file will be testws.dll.

Once you have the assembly, you may make reference to it in your winform or webform application. If you use Visual Studio, the assembly will be copied locally in the bin folder of the application folder.

The picture below shows how the proxy is added to a web application folder.
And the picture below shows the VB code to use the proxy.
And finally the picture below shows how the web service works!
Remember that the assembly only contains the definition not the actual program logics. The program logics is in the web service file located in the remote server. In other words, you still must have a working internet in order to use the web methods.

Tuesday, August 4, 2009

Opening A Web Application From VS2005


Welcome back... In this article I would like to tell how to open a web application that you have copied from somebody else from Visual Studio 2005. I am assuming that you have a running Internet Information Services (IIS) in your system.

Simply follow the steps below:
  1. Copy the folder containing the web application to the \Inetpub\wwwroot folder. (This is the default folder for IIS.)Note: Actually, you may copy the application folder to any folder in any drive but it will be easier if you copy it to the default folder used by IIS.
  2. Open IIS. In IIS, expand the Default website folder until you see the application folder you just copied. (It may appear with yellow folder icon.) Right click the folder name and choose Properties from the context menu that appears. Click the Create button from the dialog box followed by the OK button.

    The yellow folder icon changed to an opened package icon as shown below.
  3. Open Visual Studio 2005. In VS2005, open the File menu and choose Open Web Site. In the Open web site dialog box, click the Local IIS tab and select the web site you want to open followed by the Open button.

Thursday, March 19, 2009

ADAB MENDENGAR AZAN

ADAB MENDENGAR AZAN

Kematian itu pasti menjelma. Hanya masa Dan waktunya Yang tidak Kita ketahui.Cuba Kita amati. Mengapa Kebanyakan orang yg nazak, hampir ajal tidak dapat Berkata apa-apa.. Lidahnya kelu, keras Dan hanya mimik Mukanya yang menahan kesakitan ' sakaratul maut' .

Diriwayatkan sebuah hadis yg bermaksud:

'Hendaklah Kamu mendiamkan diri ketika azan, jika tidak Allah Akan kelukan lidahnya ketika maut menghampirinya. '

Ini jelas menunjukkan, Kita disarankan agar mendiamkan Diri, jangan berkata apa-apa pun semasa azan Berkumandang . Sebagai orang beragama Islam Kita wajib Menghormati azan Banyak fadhilatnya .

Jika lagu Kebangsaan Kita diajar agar berdiri tegak Dan diamkan Diri. Mengapa ketika azan Kita tidak boleh mendiamkan diri? Lantas sesiapa yang berkata-kata ketika azan, Allah Akan kelukan lidahnya ketika nazak . Kita takut dengan Kelunya lidah Kita semasa ajal hampir tiba maka Kita Tidak dapat mengucap kalimah 'Lailahaillallah. .' yang Mana sesiapa yang dapat mengucapkan kalimah ini ketika Nyawanya akan dicabut Allah dgn izinNya menjanjikan Syurga untuk mereka.

Dari itu marilah kita sama-sama menghormati azan dan mohon kepada Allah supaya lidah ini tidak kelu semasa nyawa kita sedang dicabut. 'Ya Allah! Anugerahkanlah kematian kami dengan kematian yang baik lagi mulia, lancarkan lidah kami mengucap kalimah 'Lailahaillallah. .' semasa sakaratul maut menghampiri kami.. Amin... amin.. amin Yarobbala'lamin. .'

Sesuatu yang tak pernah terjangkau dek akal fikiran ku ini. Subhanallah. ..

Ketahuilah bahawa pada setiap waktu, ribuan bilal di merata dunia akan melaungkan azan, mengakui 'Bahawa Allah Sahaja Yang Patut Disembah, dan Nabi Muhammad Adalah Rasul Allah.'Dimulakan dengan Indonesia yang terletak dibahagian timur dengan ratusan kepulauan-nya dan jumlah penduduknya seramai 180 juta.

Sebaik masuk waktu Subuh, Azan mula berkumandang dari kawasan ini dengan ribuan Bilal yang akan melaungkan Ke-Agungan Allah S.W.T Dan Nabi Muhammad S.A.W.
Proses ini akan bergerak kearah barat kepulauan Indonesia . Perbezaan masa antara timur dan barat Indonesia adalah 1-1/2 jam.Belumpun laungan Azan dimerata Indonesia selesai, ianya bermula pula di Malaysia.Berikutnya di-Burma dan dalam masa satu jam selepas Azan dilaungkan di-Jakarta, tiba giliran Dacca di Bangladesh.Berikutn ya laungan akan kedengaran di Calcutta dan terus ke Srinagar dibarat India.

Perbezaan waktu dikota-kota Pakistan adalah 40 minit jadi dalam jangka masa ini, Azan akan berkumandang diseluruh Pakistan.Belum berakhir di-Pakistan, Azan akan bermula pula di Afghanistan dan Muscat.Perbezaan waktu antara Muscat dan Baghdad adalah satu jam. Dalam jangka masa ini, Azan akan berterusan dilaungkan di UAE, Makkah, Madinah, Yaman, Kuwait dan Iraq .

Proses ini berterusan setiap detik sehingga ke pantai timur Atlantik.Jarak masa Azan mula dilaungkan di Indonesia sehingga ke pantai timur Atlantik adalah 9-1/2 jam.Belumpun Azan Subuh berkumandang di pantai Timur Atlantik, Azan Zuhur kini sudah mula dilaungkan di Indonesia. Ini berterusan bagi setiap waktu sembahyang, tidak putus-putus.

Subhanallah, begitu hebat dan agungnya Islam!
Kalaulah setiap kawasan boleh memasang pembesar suara (yang power habis!), akan bergegar satu dunia dengan laungan Azan tidak putus-putus.

Allahu Akhbar!

p/s Petikan di atas di ambil dari e-mail yang dihantar kepada saya.