Thursday, December 29, 2005

CRYSTAL: EOleSyserror Exception - Class Not Registered

In the Windows environment DLLs consist of two things, classes (blueprints that objects are made from) and functions.

Windows provides a way to register a DLL using C:\WINDOWS\SYSTEM32\REGSVR32.EXE. As I understand it, this makes the classes and functions in that DLL available for use.

Recently I was faced with a problem where there was a delphi application which used Crystal Reports 9.0 which when it was ran on a non-developer machine gave an error: EOleSyserror Exception - Class Not Registered. I did some research and found that the application used the classes CRAXDRT_LIB, OleServer, and OleCtrls. My research also told me that Crystal Reports runtime uses ActiveX Controls and components. I went to the a help pdf on businessobjects.com and found a number of DLLs.

I eventually found that I could fix the problem with the following steps:
1. Find crviewer9.dll on a machine that has crystal reports installed.
2. Copy it into a folder like C:\WINDOWS\SYSTEM32
3. In the Windows Start Menu go to "Run".
4. type "cmd" at the prompt and click Ok.
5. type "C:\WINDOWS\SYSTEM32\REGSVR32.EXE C:\WINDOWS\SYSTEM32\crviewer9.dll"

Solved.

Friday, December 09, 2005

PHP: Hide Progress Bar After Page Fully Loaded

How do you show a progress bar when something has partially loaded, and get rid of it on the same page when it is done loading?

<?php
echo "<div id='a'><center>Processing Data<br>";
echo "<img src='http://www2.bulkregister.com/images/progressbar.gif'">;
echo "</center></div>";
flush();
sleep(5);//do real work or just sleep (for testing)
echo "Afterwords: <br>";
$js="'document.getElementById(\"a\").style.display=\"none\"'";
echo "<img src='http://www.cwts.nl/ed/buttons/completed.gif'
onload='$js'>"
;
?>

Thursday, November 17, 2005

HUMOR: Switch to Linux Cartoon

http://www.ubergeek.tv/article.php?pid=54 has a nice flash cartoon advertising the benefits of linux.

For the true geek/nerd in all of us.

Monday, November 14, 2005

REG: Remove Dangling Shared Folders in XP

Problem:
On my local area network (LAN) in windows, I had shared a folder, then deleted it. From another machine, it still shows that the folder is shared, yet is inaccessible, how can I remove it?

Solution:
Windows settings are in the registry editor. This includes shared folders which are just keys in the registry.

In Windows, in your Start Menu, click on [Run], type "regedit" and click OK. Using the registry key below, you can find your a registry entry for your shared folder. Remove the registry entry/key with your shared folder's name and it will remove the shared folder.

HKEY_LOCAL_MACHINE
\SYSTEM
\ControlSet001
\Services
\lanmanserver
\Shares

Tuesday, November 08, 2005

REG: Missing System Tray Icons in Windows XP

If you google the topic you will find this link:
http://www.techzonez.com/forums/archive/index.php/t-16911.html

It looks all professional, but it isn't actually helpful.

The cause of the problem for me was when I was setting automatic login on my laptop to true (with a password), then later going in and disabling the automatic login.

I did however find a solution.

In your registry editor, search for keys named "NoTrayItemsDisplay", and delete them.
ie:

HKEY_LOCAL_MACHINE
\SOFTWARE
\Microsoft
\Windows
\CurrentVersion
\Policies
\Explorer
"NoTrayItemsDisplay"=dword:00000000

or

HKEY_CURRENT_USER
\SOFTWARE
\Microsoft
\Windows
\CurrentVersion
\Policies
\Explorer
"NoTrayItemsDisplay"=binary:00000000


source: http://www.techzonez.com/forums/archive/index.php/t-16911.html

Wednesday, October 26, 2005

SQL: Migrating MySQL scripts to MS SQL

I had some database table creation scripts to migrate from MySQL to MS SQL.

Primary Key:
MySQL allows a primary key on the either of NULL, and NOT NULL declarations.
MSSQL only allows primary keys on fields that are NOT NULL

Date Fields:
MySQL uses a DATE field
MSSQL uses a DATETIME field

Table Creation with AutoIncrement:
MySQL uses keyword AUTO_INCREMENT
example:
CREATE TABLE mytable (
myfield1 integer(12) NOT NULL AUTO_INCREMENT,
myfield2 CHAR(9) NULL,
myfield3 CHAR(6) NULL,
PRIMARY KEY(myfield1)
);


MSSQL uses keyword IDENTITY(1,1)
example:
CREATE TABLE mytable (
myfield1 int IDENTITY(1,1) NOT NULL,
myfield2 CHAR(9) NULL,
myfield3 CHAR(6) NULL,
PRIMARY KEY(myfield1)
);


Create Table 'IF NOT EXISTS'
MySQL uses keywords IF NOT EXISTS
example:
CREATE TABLE IF NOT EXISTS mytable (
myfield1 CHAR(9) NOT NULL,
myfield2 CHAR(6) NULL,
PRIMARY KEY(myfield1)
);


MSSQL uses a query into a system table
example:
IF NOT EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'mytable')
CREATE TABLE mytable (
myfield1 CHAR(9) NOT NULL,
myfield1 CHAR(6) NULL,
PRIMARY KEY(myfield1)
);


More information on autoincrement fields in MSSQL can be found at
an article on http://www.databasejournal.com

HUMOR: Anti- telemarketer Strategy (Counterscript)

http://www.xs4all.nl/~egbg/counterscript.html

A script to use vs. telemarketers calling to harrass you.

Monday, October 24, 2005

CSS: Force a Fixed Width HTML Webpage

Cross-browser content layout fix for variable-length content using CSS

BACKGROUND:
Firefox browser page has no vertical scrollbar unless the content exceeds the browser window height. IE always has a vertical scrollbar, it is merely greyed out when the content doesn't exceed the browser window height.

PROBLEM:
This can be a problem if you have some centered content in pages with the same layout but some content fits in the browser window and on other pages the content is taller than the window. Navigating from one page to the other appears as if the centered content is misaligned.

SOLUTION:
Include this stylesheet in your html code of the webpage to force a scrollbar even when its not necessary, for regular width pages.

<style type="text/css">
html { height: 100.1%; }

</style>

Friday, October 21, 2005

JAVASCRIPT: Make a pop up window

The following HTML code:

<form><input type=button value="Open new window"
onClick="myRef = window.open(self.location,'mywin',
'left=20,top=20,width=800,height=500,toolbar=1,
resizable=0');myRef.focus()"
></form>


Generates this:

Friday, October 14, 2005

COBOL: EBCDIC File Formats

I had some file formats I had to import into a database for work and it was in a strange format I had never seen before.

05 RECORD1-RAW                          PIC X(17).
05 RECORD1-AREA REDEFINES RECORD1-RAW
10 REC2-RAW PIC 9(9).
10 REC2-AREA REDEFINES REC2-RAW
15 REC3-F1 PIC X(3).
15 REC3-F2 PIC X(2).
15 REC3-F3 PIC X(4).
10 REC2-FOOTER PIC S9(6)V99.


I saw the word EBCDIC, and I was clued in that I was not using ASCII. I read somewhere that Mac still uses EBCDIC.

http://www.natural-innovations.com/computing/asciiebcdic.html is Google's top link for EBCDIC. But here is a cleaner looking table comparing ascii and ebcdic: http://www.simotime.com/asc2ebc1.htm

Wikipedia's link: http://en.wikipedia.org/wiki/EBCDIC

But what finally helped was when I found: http://www.discinterchange.com/reading_COBOL_layouts_.html

and then used http://www.discinterchange.com/TechTalk_signed_fields_.html to figure out signed fields like above.

Monday, October 03, 2005

APP: Backup DVDs to your hard drive (like ripping CDs)

After you've ripped you CD collection to your hard drive so you can listen to them whenever you want, you realize you have this hefty DVD collection and you wouldn't mind ripping this onto your hard drive. But DVDs don't have to take up a ton of space on your hard drive, just like audio CDs don't have to take up 700MB per CD.

Most DVDs for sale in North America are NTSC set at 720x480 resolution and can take up to 9.4 GB on a dual layer DVD, but with DivX or Xvid compression you can backup a DVD onto your computer to sizes between 700MB and 1400MB without significant quality loss.

Make a DVD Backup/How to rip the DVD

Download and install
DVD Decrypter and Auto Gordian Knot

Copy to Computer
Use DVD Decrypter to copy the DVD files to you computer's hard drive (minus encryption). These often take around 6-8GB but you can erase them when you're done.

Compress
Next, run AutoGK. Select the decoded DVD files on your computer. Select an output .avi file. Additionally, AutoGK allows you to choose the file size of your output file, in case you want to compress and back it up onto a CD or other media.

AutoGK is a front-end programs which actually runs a few other programs in the background to perform different tasks in video compression like audio compression, and codec specific tasks etc.

Play it
Now to play the .avi file in windows, all you need is something like Winamp 5.1 installed with video support(or windows media player if you must).

Housekeeping
Now, don't forget to erase the files generated by DVD Decryptor, once you have the output .avi file and you've test it and it works. These files take up a 6-8GB normally, so you really out to clear them off before doing another disc.

Saturday, October 01, 2005

APP: Make PDFs from any document (Windows)

PDF Creator an open source project is a great way to create PDFs for free.

A PDF is a platform independent document with fixed formatting, and once created, it cannot be edited, making it excellent for copyrighted material.

Install it, and it will create a new 'printer'. To create a PDF of a document, go to print the document, and select PDFCreator as the printer. When it goes to print it will ask you where you want to save the PDF.

SourceForge.Net Project site:
http://sourceforge.net/projects/pdfcreator

Wednesday, September 28, 2005

RSS: Add RSS feed as a Bookmark in Firefox

You can add this blog as a Live Bookmark in Firefox.

What is a Live Bookmark? It is a folder of bookmarks, where each bookmark is a link to an article or posting in the RSS feed. It can be added to your Bookmarks Toolbar folder in Mozilla so you can skip bookmark menus.

Go to: Bookmarks > Manage Bookmarks
Now go to: File > New Live Bookmark...
Feed Location: http://whitemarker.blogspot.com/atom.xml

Now under Manage Bookmarks, drag and drop it into your Personal Toolbar folder or Bookmarks Toolbar folder.

OPINION: Blu-ray or HD-DVD

The epic battle of good versus evil is only eclipsed by the epic battle between good and good. Two new technologies, HD-DVD and Blu-Ray are both determined to be the next video standard. Part of the problem is that the entertainment industry is totally split on the issue with major heavyweights of the industry on each side. Recently, Microsoft and Intel have taken sides. In terms of single layer capacity, HD-DVD has 15GB compared with Blu-Ray at 25GB. Additionally, Blu-Ray is also more expensive to mass produce. A main concern of consumers seems to be the DVD compatibility issue, but both sides have said they will offer video content in DVD format on one side and their format on the other.

The war to become the next big standard is reminiscent of the VHS-Beta war of the 70s and 80s. Some important lessons we can learn from the past, are that the best technology won't necessarily prevail, and that production costs are a significant factor. Both of these reasons point away from Blu-ray but it doesn't matter anyway. Other than the ability to record HD-TV, there is no other driving force for adopting a new disc technology. HD-TV has a few more years before it is widely accepted, and current DVDs are so cheap to produce that they will be used in place of a higher standard for years. HD-DVD is only 3 times the size of current DVDs, which isn't big enough for people to make the move. When it comes down to it though, there is one trick that VHS and Betamax could never do: Offer a disc with HD-TV on one side and Blu-ray on the other.

Tuesday, September 27, 2005

REG: Remove WMP Explorer Shell Extensions

HARD WAY:
Remove Windows Media Player (WMP) Explorer Shell Extensions From the Context Menu

Go into your registry editor, and remove the following keys to remove "Add to Playlist" from your context menu for video files.

This may also be done for:
Add to Now Playing List
Add to Sync List
Add to Burn List
Play on My TV

;Remove Add to Now Playing List and Add to Playlist for WMV files
[HKEY_CLASSES_ROOT\WMVFile\shellex\ContextMenuHandlers\WMPAddToPlaylist]

;Remove Add to Now Playing List and Add to Playlist for MPEG AND MPG Files
[HKEY_CLASSES_ROOT\mpegfile\shellex\ContextMenuHandlers\WMPAddToPlaylist]

;Remove Add to Now Playing List and Add to Playlist for ASF Files
[HKEY_CLASSES_ROOT\ASFFile\shellex\ContextMenuHandlers\WMPAddToPlaylist]

;Remove Add to Now Playing List and Add to Playlist for Avi Files
[HKEY_CLASSES_ROOT\AVIFile\shellex\ContextMenuHandlers\WMPAddToPlaylist]

;This key also needs to be removed along with any of the 4 keys above
;It is found in HKEY_CLASSES_ROOT
[...root\SystemFileAssociations\video\shellex\ContextMenuHandlers\WMPAddToPlaylist]


You can do the same for audio files.

EASY WAY:
download ShellExView and disable WMP extensions.

Friday, September 23, 2005

APP: Bart's Preinstalled Environment

I included a link to Bart's Preinstalled Environment
http://www.nu2.nu/pebuilder/
because it looks like a pretty good tool for sysadmins. The tom's hardware article says that you can load it onto a 256 meg USB drive, and boot into it that way.


http://www.tomshardware.com/howto/20050909/index.html


This is a useful tool if you want to boot into a windows type environment from a CD or USB drive. (if you are a top secret guy using a public computer and you want no traces left behind).

Also check out portableapps.com

Thursday, September 22, 2005

CSS: Hide blocks of a webpage when printing

When printing a webpage, how do you hide certain elements of the page?

There is no onprint action in Javascript that I am aware of.

The key is to use css:

Note: In css '#' denotes an ID selector, '.' denotes a class selector.
<style type="text/css">
@media print
{
div.headerbox{ display:none; }
}
</style>

<
div class="headerbox">...
hidden when printed</div>
<
div class="otherbox">...
not hidden when printed</div>

or

<style type="text/css">
@media print
{
div#headerbox{ display:none; }
}
</style>

<
div id="headerbox">... hidden when printed</div>
<
div id="otherbox">... not hidden when printed</div>