Search This Blog

Monday, August 23, 2010

Web Query Hangs

23 August 2010

Introduction
Users of Microsoft Excel and other web query software, like IMACROS, often query websites to get the web information for stocks or other purposes. These users will write scripts to automate the process. Sometimes, the process will hang causing lost of data. This article will describe methods to overcome this problem.

Why it Hangs?The process will hang either because the website is down or because the web traffic is high. A webpage usually takes 5 to 6 seconds to download may take up to 10 minutes or even hours.

How to Over come?
The following methods have been tried without much success.

a) Introduce timeout events in scripts or VBAThe script is waiting for a webpage to download and will not activate the timeout under such events.

b) Ping the website before proceeding to download
This will only help if the website is down but it will not help when there is a delay due to heavy traffic.

The better method is to modify the window registry’s internet setting with a timeout of appropriate delay. This is because most browsers use this delay in the internet setting.

http://support.microsoft.com/kb/181050

How to Modify the Registry?
The timeout is not native in the registry’s internet setting. It will have to be created under
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]. The keyword is "ReceiveTimeout”. Its value will depend on normal delay in webpage download.

The Window default is

Internet Explorer 4.0 and Internet Explorer 4.01 --- 5 minutes
Internet Explorer 5.x and Internet Explorer 6.x---- 60 minutes
Internet Explorer 7 and Internet Explorer 8 ------- 60 minutes
In VBA, add the following code before downloading the data
Set myWS = CreateObject("WScript.Shell")'write registry keymyWS.RegWrite
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet " &
_"Settings\ReceiveTimeout", "15000", "REG_DWORD"
The value of “15000” means a delay of 15 seconds. Insert the same code just after the download script and change the value to suit normal surfing.

Saturday, August 21, 2010

Error Message for Dynamic Link Library mscvp90.dll

21 August 2010

Introduction

When installing Ad-aware program, one will get the following error message for some PCs:

"procedure entry point?_xfunc@tr1@std@@YAXXZ cannot be located in the dynamic link library MSVCP90.dll "

Why?
This error is due to a wrong version of msvcp90.dll being installed by some programs for some reasons.
The dll is one of the C Run-Time Libraries for Visual C++ and programs such as Ad-aware use them.
According to some descriptions, there are 2 versions of such dll having the same name, msvcp90.dll, one for 64 bits and the other for 32 bits machine. XP operating system is a 32 bit machine.

What Next?If one is using a XP operating system and has encountered the problem.

Step 1: Download the correct version of Microsoft Visual C++ 2008 Redistributable Package (x86) from the following website for XP machines

http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displayLang=en

Step 2 : Locate the directory C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRTxxxxx. In the directory, one should find 3 Nos of 90.dll files. Rename these files with an extension of .tmp. If one has 2 directories of similar name, do the same.

Step 3: Run the downloaded installation program called “credist_x86.exe”. The installation program will automatically uninstall and reinstall the correct version of 90.dll programs.

Step 4: Locate the directory C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRTxxxxx again. One will find the new 90.dll programs. Copy all the 3 programs to “c:\windows\system32”

Friday, August 20, 2010

Marina Barrage - Fighting With Nature

Introduction
There was recent spate of flooding in Singapore. The famous Orchard Road was under 300 mm of water. Some blamed the Marina Barrage that was completed 3 years ago. This article will examine how the barrage works and if it can alleviate flooding in low-lying areas.

The Marina Barrage
The Marina Barrage (Chinese:滨海堤坝) is a 350 metres low level dam in Singapore built across the mouth of the bay, between Marina East and Marina South. It was officially opened on 1 November 2008.

The barrage serves 3 purposes:-
a) Provide Water Supply
b) Perform Flood Control
c) Lifestyle Attraction

The video about the barrage can be found here

How the Barrage Works?


During heavy rain, the series of 9 crest gates at the dam will be opened to release flood water into the open sea when the tide is low. The 7 Nos of 40 m3/s (about 2.5 MW @ 3.5 m head) pumps, capable of pumping an Olympics-size swimming pool per minute will work when the tide is high. This mechanism is supposed to alleviate flooding in the low-lying areas in the city such as Chinatown, Boat Quay, Jalan Besar and Geylang.

The video of the crest gate and the pumps can be found here and here.


The Marina Basin



The Marina Basin has a surface area of about 240 ha (240,000 m2). It is linked to a 100-km2 rain catchment area shown green in the attached model. During raining days, the drains and canals will channel the flood water into the Marina Basin.


The flood
A series of flood occurring after the Barrage was completed



Can the Marina Barrage Cope?
The Barrage and the basin will not eliminate flooding totally if there is a very heavy downpour and the tide is high. This is because the rain fall from the water catchment, if more than those on 17 July, may raise the water level Marina Basin by more than 4.0 metres (discounting the retained water on the surface of the catchment and the buffer in drains/canals/river) during a heavy downpour as shown in table 1.


2o August 2010
What Can We Do?
a) Reduce the Water Catchment Area
If we were to reduce the catchment area by 40%, this will reduce the water level rise in the basin by about the same proportion to 4.5 metres per hour without pumps and 4.0 metres per hour with pumps in full operation. The alternative is to regulate the flood water flow from higher areas.

b) Allow More Buffer Capacity In Basin
With the present barrage, there is a limit on how much a buffer can be created in the basin because the gates are not totally water tight. There will be seawater leeching into the basin if there is large difference in the level of water in the basin and the open sea; also, the pumping electricity cost would be high if we keep the water level in the basin low.

Reducing the water catchment area appears to be a better of the 2 solutions for the present setup at the Marina Barrage.

Sunday, July 25, 2010

Where Long Term Funds Park Their Money

25 July 2010

The Long Term Funds in US

The Investment Company Institution (ICI) keeps in touch with the Fund Managers (The Funds), their shareholders, directors and investment advisers regularly. They aim to facilitate the effective functioning of Funds under the U.S. legislative and regulatory framework. They keep and release the Funds' investment in local as well as in foreign countries. This article will aim to introduce ICI as well as to analyse the data they have collected for the information of the readers.

The Data Collections

The data collected by ICI can be found here in this PDF file.
The data tabulated out how much the Funds have invested in Foreign and Domestic equities as well as in bonds and other investment vehicles.

Graphical Plot
The following is a graphical plot of the data kept by ICI for Foreign and domestic equities.


(Doubleclick to enlarge)
The chart shows that the US Long Term Fund (LTF) has withdrawn about US$300 bln from the domestic equity market since January 2007. Lately, they withdrew a total of US$ 50 bln in May 2010 and June 2010. They increased their withdrawal and withdrew about US$ 7.0 bln in the first 2 weeks of July 2010. As for the Foreign Equity investment, LTF maintained their funds at around US$ 150 bln to US$ 200 bln during the periods shown.
Divergence Between Equities and Funds

There is a divergence between DOW and the US domestic funds as shown in the following graph. This graph illustrates that the US domestic equity Funds decreases as DOW increases in value during the period between March 2009 and April 2010. The LTF withdrew even more funds from the domestic equity market during period between April 2010 to present date.
(Doubleclick to enlarge)

Where LTF Parks their Money ?
To find out, please click here

Conclusion
LTF are buying bonds instead of equities ever since the last recession that started in 2007/2008. The pattern appears to have the tendency of repeating again.

Thursday, July 1, 2010

Keeping Virus Away The Easy Way

Introduction
Computer viruses often attack the Registry of the XP operating system, making computer going hire-wired; sometimes, it immobilizes the computer and make them hanged. Often, users just have to re-install a new copy of the XP operation system but one will have to re-install all the programs and all other stuffs in the computer. This article tells how one can restore the computer to its original condition when such viruses attacked.

What is Registry and How Viruses Can attack it?
Registry is a place where XP keeps all the information about the computer's hardware and software. It is being used by all the users including 3rd party hardware and software to find where data are stored in the harddisk. If a new program has just been installed or files added, it will update its record. Registy is the one place where it is most vulnerable to virus attacks. Once the viruses reside in the registry, they can be loaded into the computer memory. It will then take over the computer's operation. Sometimes, using normal methods just cannot get rid of these viruses.

What can we do to prevent virus attacks?
We can install virus protection software, firewalls, virus scanning software etc; however, this will never be able to keep all the viruses away. Some viruses have learning capabilities and may lock themselves such that it will prevent users or any virus software from detecting and deleting them.

However, we can do the following to prevent these viruses from attacking the computer:-

a) Regular maintenance. Scanning, detecting, preventing and deleting the existence of viruses using one or more of the following programs
1) Virus Shield, such as norton, trendmircro, Macfee shields etc
2) Spyware and Malware Scanner, such as Adaware
3) Hijackthis

Run these program once everyday or every other day. On detection of the viruses, scan the computer in full using Virus full scanning programs

b) Regularly saving a copy of the registry, booting files and other information so that one can restore them. There are a few alternatives

1. Registry Saving and Restoration
XP can save a copy of the registry automatically whenever there is a change in the registry such as after each installation of a new program. These registry files are installed in the "System Volume Information" folder.
When there is need to restore the registry or when virus attack the computer, one can restore the registry to the saved position. For instruction. follow this link.
Alternatively, one can save a copy of the registry manually by using the "export" function of the Registry Editor. To access the Registry Editor, click Start button and then in the dropdown box, enter "Regedit" (without quotes) and click ok.

2) Backup a copy of System State
This will save not only a copy of the Registry but also the booting files and the COM+ files. The complete system state for the restoration of the XP system. One would need a free disk space of about 600 MB.


Step 1: Backing Up

1. Make sure the computer is not infested with viruses by performing all the necessary virus or spyware scans available.
2. Click Start, then in the All program/Accessories/System Tool folder, select the Backup program and finally, reaching the following screen.


Select "Let me choose what to backup" and click Next. Now, expand My Computer folder and then select to put a tick in the "System state" folder as shown and click Next



Choose a place to store the backup files using Browse button and then enter a name for this backup file. It is good to store the backup file in a thumbdrive or RW CD or another harddisk so that it can be read and the backup file restored in case of harddisk failures. Note that the backup file can be more than 500 MB
Click Next


Select Advance button and Normal in dropdown box of the subsequent screens, one would reach the following screen to select the verification of file after backup. Tick the box and then Next. The computer will do the rest of job.

Step 2: Restoring the backup files
1. After having installed a new XP operating system in the existing harddisk and provided one has not erase or change any program or file, one can restore the XP system to its orginal condition
2. Following Step 1-2, then choose restore files and settings instead, one should reach the following screen. Browse to the directory of the backup file and doubleclick it, a new screen should show the folder "System State". Tick the box to select and click Next. Click advance in the next screen. Change the default setting if necessary.







NOTE: The backup program, NTBACKUP, is not installed by default in Windows XP Home Edition. Install it using the instructions available at: Q302894.






Select the System State check box

NOTE: If you want to back up your system settings as well as your data files, you should back up all the data on your computer plus the System State data, which includes such things as the registry, the COM+ class registration database, files under Windows File Protection, and boot files.

In the Backup destination list, click the backup destination that you want to use.

If you clicked File in the previous step, type the full path and file name that you want in the Backup media or file name box. Note that you can also specify a network share as a destination for the backup file. Click Start Backup . The Backup Job Information dialog box appears. Under If the media already contains backups, use one of the following steps:

If you want to append this backup to previous backups, click Append this backup to the media.
If you want to overwrite previous backups with this backup, click Replace the data on the media with this backup .
Click Advanced. Select the Verify data after backup check box.

In the Backup Type box, click the type of backup that you want. When you click a backup type, a description of that backup type is displayed under "Description." Click OK , and then click Start Backup . A Backup Progress dialog box appears, and the backup starts. When the backup is complete, click Close.

Important Note:
Viruses sometimes reside in the Registry and also the booting files. It is important to make sure that when one save a copy of the Registry or booting files, one does not save also the viruses. To make sure

a) Clean the computer before saving;
b) Always save new copies in different names;

c) Make a copy just after a reinstallation of the XP system

Enabling DVI Interface in LCD Monitor

Introduction


LCD Monitors are cheap and commonly available nowadays. The latest ones come with DVI-D as well as the normal VGA connections for each monitor. When connected to the DVI-D, some do not get any signal. This article will describe why.





What is DVI and VGA?


These are video interfacing system between the device and the video equipment. DVI stands for Digital Video Interface whereas VGA stands for Video Graphic Adaptor; the former is a newer system. VGA are mainly used in the CRT and earlier models of LCD monitor. One can find more information about DVI system in here.


Which System is Better?


Many said that there is no appreciable differences between the two when comparing them in a monitor that has DVI as well as VGA inputs; however, when one compares them between monitor to monitor, one might find the differences. If your monitor has DVI inputs, it would better to use these inputs.






Why No Signal in DVI Inputs?


The computer's graphic card must have the DVI output for one to display the pictures in digital mode. Rightly speaking, when one connect up the DVI cable, one should have signal. There may be time that we test the LCD first with VGA cable and the computer installed the VGA drivers and when the LCD is re-connected to the DVI output and started up with the VGA cable disconnected, the LCD monitor cannot get the correct signal.


What to do Next?


Either reconnect the VGA cable or have both VGA and DVI cables connected to the LCD monitor before starting up the computer; thereafter,


  • Enter Device Manager by clicking Start button, then select run, in the dropdown box, enter "devmgmt.msc" (without quotes) and click ok.

  • In the Monitors folder, one should find some monitor drivers and a driver called "Plug and Play Monitor". Remove all the monitor drivers, left except the "Plug and Play Monitor". One can easily remove the drivers by right clicking and then either disable or uninstall the drivers.

  • Switch off the monitor and computer. Remove the VGA cable and install or left the DVI cable attached to the monitor.

  • Re-start the computer, one should boot up with signal

  • Install the DVI software as provided by the manufacturer. Check the Display property to ensure that the DVI software is properly installed.


Cannot find "Plug and Play Monitor"

Install the "Plug and Play" driver first before shutting down and re-starting the computer. This can be done by




  • doubleclicking the VGA driver and in the "Driver" tab,




  • select "Update Driver" and then




  • select "No, no this time", click next




  • select "install from a list or specific location", click next




  • select "Don't search, I will choose the driver to install" click next




  • finally, select "Plug and Play monitor" and click next to install .



























Window 7 reinstallation problem

Introduction



Windows 7 is fast and easy to use but many users said they have tried and go back to XP and they said Windows 7 was not stable. Some complained that program could not run or run even slower than XP after some usage. Reinstallation of these programs often failed. This article will describe a way to solve some of these problems.



Why?



One of the problems is the denial of access to change certain keys required by the programs in the Registry. After some period, the ownership or the permission of the Registry key has been changed for some reasons and the programs lost the privilege to access and change these keys for normal operation. The solution is to restore the ownership and permission of these keys.



How ?



a)Prepare to check which key was denied the access.



1. Download Process Monitor
2. Unzip and run ProcessMonitor.exe

3. In the “Filter” menu, select “Filter”

4. In the Architecture dropdown box, select “Result” and type in “ACCESS DENIED” in the box as shown



5. Click ok. The monitor is ready to capture any access denial case for study.



b) Run the faulty application or installation or any program at fault and check if there are Registry keys being denied access to change and note down this key and use “Regedit” to reclaim ownership or permission to change these keys.





What about multiple Registry Corrections?



When there is a lot of keys to reclaim ownership or permission, it may be necessary to reset the entire Registry to the defaulted ownership or permission.



How?



1. Download SubInACL http://www.microsoft.com/downloads/details.aspx?FamilyId=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en which is a program that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain.

2. Unzip and install SubInACL that will create a folder called “Windows Resource Kits” in the program files (x86) folder.

3. Start up “NotePad”. Copy and paste the following



subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f

subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f

subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f

subinacl /subdirectories %SystemDrive% /grant=administrators=f

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f

subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f

subinacl /subdirectories %SystemDrive% /grant=system=f



4. Save NotePad file as “Reset.cmd” in the “Windows Resource Kits/tools” folder.

5. In the box of the Windows Startup Button, enter “cmd” (without quotes) and rightclick “cmd.exe” when the file appears at the top and select to run as Administor.



6. Type in “cd C:\Program Files (x86)\Windows Resource Kits\Tools” at the prompt and then “reset.cmd”



7. The program will run for about 3 minutes to change all the ownership and permission of the entire keys in the Registry to the default value

Saturday, June 19, 2010

Will History Repeat Itself?

19 June 2010

Introduction
Many used to say that history will repeat itself in the stock markets; what has happened will happen again. Therefore, Technical Analysis Technicians have come out with many shapes, patterns, trendlines and formations to predict the futures of a stock or currency market. This article will examine the DOW index from a technical prospective and check if it is possible for DOW to repeat itself.

What will be used?
Trendlines. There are many different types of trendline; some are called necklines, others are just simple trendlines. Necklines are usually found when there is a “head and shoulder” formation. Once a neckline or trendline is broken, there will be large movements in prices.

The Occasions
There are 2 occasions recently when DOW broke necklines or trendlines and sent stocks plunging. One was in January 2010 due to debt crisis in Dubai; the other was in May 2010 when debts in Greece shocked the markets.

In both occasions, the necklines were broken. The Dubai incident was soon forgotten. Will they forget the Greece incident?

The Technical Analysis
The Dubai and the Greece incidents are shown in the following chart marked wave 3-4 and wave 5-1 respectively.

a) The similarities1) A “dead cross” when the 20-day MA crossed under the 50-day MA.
2) A broken neckline.
3) At the point where index regained and touched the neckline (As shown in blue vertical line)
a. The stochastic was oversold and just about to cross under its own moving average
b. The Bollinger bands had just contracted
c. The 20-day MA had just flattened with the 50-day MA reducing its decline

b) The differences
1) The Greece’s 20-day MA moved further down from the 50-day MA
2) DOW and its 20-day MA in the Greece incident crossed below the 200-day MA
3) The Greece’s depth of fall from its neckline did not satisfy the conditions of the “head and shoulder”. The depth of fall must be equal or more than the height of “head” measured from the base of the neckline.



(Double click for larger image)

Will DOW Break the Neckline This Time?Similar pattern and lots of similarities occurred in Nov/Dec 2007 when the credit crisis caused a plunge in the markets. For example, DOW broke a trendline sending index plunging below the 200-day MA and regained to touch the trendline. This pattern is more similar to the Greece incident.

The analysis suggests that DOW is more likely to reflect from its neckline than to break the neckline.


(Double click for larger image)


When Will DOW Makes the Decision?

The candlestick chart shows that DOW has made 3 spinning tops in the last 3 sessions. The appearance of a spinning top candlestick always signify that there is indecision in the market. The following chart suggested that DOW would be making a decision pretty soon if history is repeating itself.


(Double click for larger image)

What to Do Next?
If one is long, it would be prudent to “buy insurance” by hedging or other similar methods. It is recommended to stay away from the markets until DOW’s 20-day MA crosses over the 50-day MA. Even then, it is good to check if the neckline has been broken.


Disclaimer:
Information here is for sharing and learning. It is not intended to give any advice on any stock or movement or trend of any index. If a price or movement of a stock/index is given, it is only intended for illustration. The reader shall verify the information given here before using them.

Sunday, March 28, 2010

How To Replace Hard Drive in Laptops

28 March 2010

Introduction


Have a faulty hard drive? Want to replace it? This article will how to replace the hard drive in Fujitec S7110 laptop that has a SATA drive.

What is SATA drive?
SATA is a interface standard that allows connection between the hard drive and the motherboard's hard drive controller. SATA stands for Serial Advanced Technology Attachment or Serial-ATA.

What’s needed?

a) A small Philip screw driver; and for those who need to modify or clone the old hard drive;
b) A workable desktop with a spare SATA connection;

  1. For those who need to convert the SATA hard drive using software, such as Hitachi or IBM drives;
  2. For those who needs to clone the hard drive – will need a software such as Acronis True Image or Partition Magic or equivalent

Degree of Difficulty

a) Just to replace the hard drive - Easy
b) To modify or clone the hard drive - Need to read up the software instruction sheet.

Why Need to Convert Hard Drive?

Newer hard drive most likely comes with SATA II or SATA III hard drive interface that enable faster transfer speed. Unfortunately, laptop of more than 3 years old have SATA I standard interface and it may not be able to detect or recognize the newer interface.

How to Convert the Hard Drive

If the hard drive comes with extra jumpers, it would be as easy as reconfiguring of this jumper to convert the hard drive to SATA I interface. However, when you have Hitachi or IBM hard drive that does not come with the extra jumper, a conversion software will be required. In this case, follow the instructions given in the "Change SATA Settings" by the software. Select 1.5 Mb/sec and disable the "Spread Spectrum Clocking".

To Remove the Hard Drive
a) Remove the 2 screws securing the cover and slide the cover in the direction shown
b) Remove the 3 screws and remove the bracket that attach the hard drive to the laptop
c) Pull the plastic tag to the left to disengage the hard drive from the laptop.
d) Remove the hard drive pocket from the laptop and remove the hard drive. Pay particular attention to the contact blade.

To Re-install the Hard Drive
Reverse the step as described in the section “To remove the hard drive” stands for Serial-ATA

Monday, January 4, 2010

Web Query of Excel Hanged

4 January 2010

Introduction

We often use the Web Query function of Microsoft Excel to extract data such as stock quotes from various websites. Many a time, Excel just hang without reporting any error message. The only way to resolve the problem is to terminate the Microsoft Excel application program. This article presents a simple and effective way of resolving this problem.

What’s Required?

Some experiences in macro or VBA programming.

What Has Been Tried?

The Web offered many solutions to resolve this problem but none could work better; either because the solutions, such as introduction of scheduled (OnTime) procedure, do not work or they have complicated macros or VBAs that no one can understand. Error trappings using Error handling loops do not help either because the Website being queried was only down and not out.

What is the Solution?

Write a short macro to “ping” the website before initiating the web query command.

How?

a) Using the API function of VBA and putting a Public declaration in the top or heading of the macro or VBA.


Private Declare Function InternetCheckConnection Lib "wininet.dll" _
Alias "InternetCheckConnectionA" _
(ByVal lpszUrl As String, _
ByVal dwFlags As Long, _
ByVal dwReserved As Long) As Long

Private Const FLAG_ICC_FORCE_CONNECTION = &H1

b) Writing or using the recording function of Excel to create a macro for the Web Query and insert the following macro to the Web Query VBA

Sub downloading()
Dim sUrl As String
sUrl = “http://yahoo.com”
but = InternetCheckConnection(sUrl, FLAG_ICC_FORCE_CONNECTION, 0&)
If but Then
…initiate web queries
Else
… announce website is down
End If
End Sub

Simple and Easy Way To Backup Photos, Movies and Documents from handphones

 2 December 2023 In the past,  we used iTunes when we wanted to transfer or backup our photos,  movies, and documents from iPhones or Androi...