Yesterday my Dell Precision M60 laptop suddenly developed a vertical blue line just to the right of the center of the screen. I did some research on the internet and searched Dell's forums to try to figure out how to get rid of it. Apparently you can't. According to this article, Dell has received many complaints about screens developing a blue line, so they are replacing the LCD of affected models, free of charge if purchased within the past 3 years. The affected models are:
Inspiron 6000 and 8600
Latitude D800 and D810
Dell Precision Mobile Workstation M60 and M70
They were shipped between December 2004 and December 2006.
I fired up Dell chat, talked with a service representative who had me connect my laptop to an external monitor to confirm it was the laptop's LCD which was bad. It was. He then sent my information to a technician who came to my house today and replaced the LCD. No more blue line. I was very surprised at the fast service and that a technician came right to my house to fix it.
I had debated as to whether or not I should just ignore the line or try to get it fixed. I figured I would have to send my laptop out for repair, which I didn't want to do, so I'm really glad I decided to get it fixed.
More Dell
Thursday, November 29, 2007
Wednesday, September 19, 2007
LG VX8300 and car kit
Just want to mention this cell phone tip. My cell phone is an LG VX8300. A few days ago the words car kit appeared on the display and I was unable to hear any sounds my phone made. The same thing happened a few weeks ago, but after several days my phone went back to normal. Well, it had been a couple of days & still nothing, so I did some research on the internet. I googled "lg vx8300" + "car kit" + remove and came across this site. I did the tip which involves clearing errors. Nothing, so I tried plugging in the charger and jiggling it around. Nothing. I don't have a car charger, so I tried plugging the phone into the data cable I use to upload photos to my computer. I jiggled the cable around & car kit briefly disappeared and then reappeared. I jiggled the cable some more & car kit disappeared again. It's been 6 hours and so far so good. Apparently the words car kit appear when the phone has been exposed to water. Have absolutely no idea how my phone may have gotten wet. Oh well. I'm just glad it's working again.
Cell phones
Cell phones
Friday, August 17, 2007
How to return multiple parameter values in Java
Here's a java tip I discovered.
Java doesn't allow functions to return multiple parameters. You can't pass by reference like in C/C++.
Say you have this function in C or C++:
int get(int a, int* b, int* c)
{
*b = 2 * a;
*c = 3 * a;
return 4 * a;
}
Now you want to write that function in Java. One option is to create an object which stores 3 integer values and return that.
An option involving less work, is the following:
Java lets you pass in an object, to which you can modify the content of the object, so:
First create a java class which stores an integer:
public class _Integer
{
public int _integer;
public _Integer
{
}
}
Now pass this object to your java function whenever you need to return more than one value:
int a = 1;
_Integer bInteger = new _Integer();
_Integer cInteger = new _Integer();
int d = get(a, bInteger, cInteger);
int get(int a, _Integer b, _Integer c)
{
b._integer = 2 * a;
c._integer = 3 * a;
return 4 * a;
}
If you need to pass doubles, create a _Double class, etc.
I thought that was a pretty cool workaround I came up with and just wanted to share.:)
More Java Info
Java doesn't allow functions to return multiple parameters. You can't pass by reference like in C/C++.
Say you have this function in C or C++:
int get(int a, int* b, int* c)
{
*b = 2 * a;
*c = 3 * a;
return 4 * a;
}
Now you want to write that function in Java. One option is to create an object which stores 3 integer values and return that.
An option involving less work, is the following:
Java lets you pass in an object, to which you can modify the content of the object, so:
First create a java class which stores an integer:
public class _Integer
{
public int _integer;
public _Integer
{
}
}
Now pass this object to your java function whenever you need to return more than one value:
int a = 1;
_Integer bInteger = new _Integer();
_Integer cInteger = new _Integer();
int d = get(a, bInteger, cInteger);
int get(int a, _Integer b, _Integer c)
{
b._integer = 2 * a;
c._integer = 3 * a;
return 4 * a;
}
If you need to pass doubles, create a _Double class, etc.
I thought that was a pretty cool workaround I came up with and just wanted to share.:)
More Java Info
Friday, August 10, 2007
How to get user defined environment variable in Java
I'm porting a C++ library over to Java 1.4.2 and I need to get the setting for a user defined environment variable. There used to be a very easy way, but it turns out some brilliant people decided to deprecate - get rid of - System.getenv for java 1.4. There must have been complaints because for Java 1.5 System.getenv is undeprecated. Unfortunately, I can't guarantee the users of my java software will be using java 1.5. Fortunately, there are people much smarter than I. I did some searching and found a website with some code which determines what system you are on and then calls the corresponding function to get all environment variables. You can then make a call to get the value of the environment variable you need. Here's the link to the site and the code itself:
import java.io.*;
import java.util.*;
public class ReadEnv {
public static Properties getEnvVars() throws Throwable {
Process p = null;
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
String OS = System.getProperty("os.name").toLowerCase();
// System.out.println(OS);
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set" );
}
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set" );
}
else {
// our last hope, we assume Unix (thanks to H. Ware for the fix)
p = r.exec( "env" );
}
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
}
return envVars;
}
public static void main(String args[]) {
try {
Properties p = ReadEnv.getEnvVars();
System.out.println("the current value of TEMP is : " +
p.getProperty("TEMP"));
}
catch (Throwable e) {
e.printStackTrace();
}
}
}
Java Resources
import java.io.*;
import java.util.*;
public class ReadEnv {
public static Properties getEnvVars() throws Throwable {
Process p = null;
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
String OS = System.getProperty("os.name").toLowerCase();
// System.out.println(OS);
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set" );
}
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set" );
}
else {
// our last hope, we assume Unix (thanks to H. Ware for the fix)
p = r.exec( "env" );
}
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
}
return envVars;
}
public static void main(String args[]) {
try {
Properties p = ReadEnv.getEnvVars();
System.out.println("the current value of TEMP is : " +
p.getProperty("TEMP"));
}
catch (Throwable e) {
e.printStackTrace();
}
}
}
Java Resources
Thursday, August 9, 2007
Copper.net
I think I've mentioned before that all I can get in my area for an internet connection is dial up. Really sucks, but maybe someday there will be a faster option. Anyways, I've been using NetZero's 3g high speed for the past 2 years without much of a problem. Lately though, the high speed part has been very flaky. It keeps disconnecting and speeds have been slow. The other day I got fed up and came across a couple of different providers with good reviews. One is Toast.net. I haven't tried it yet though. The one I'm trying now is Copper.net High Speed. They have a really good deal going on right now, which is why I tried it first. It's $1 for 3 months, after which you can cancel if not satisfied. So far it's not bad. Netzero would always take a long time to load certain sites, such as blogs, including this one. Copper.net doesn't seem to have that problem. My blog actually loads pretty quick. The only drawback so far is Copper.net's high speed also seems to have a problem staying connected initially. Once it gets going though it is fine. So far connection speeds seem a bit faster than Netzero.
Regular price for the high speed version is $14.95 per month. Without high speed, it's $9.95 per month. The customer service number is also free. Unlike Netzero, which charges $2 per minute. Most numbers are V.92. You get a free 25mb email address. There seem to be a lot of access numbers, although just 2 for my area, but it's rural. Copper.net connects faster than Netzero, since it uses the built in dial-up networking in Windows. Netzero has it's own java application, which is much slower. Copper.net also lets you stay connected for a maximum of 4 hours, whereas Netzero disconnects you after 3 hours. If you're looking for a new dial up isp or a backup internet connection, you might want to check out Copper.net.
BTW, Copper.net's high speed is also compatible with the wiflyer.
Regular price for the high speed version is $14.95 per month. Without high speed, it's $9.95 per month. The customer service number is also free. Unlike Netzero, which charges $2 per minute. Most numbers are V.92. You get a free 25mb email address. There seem to be a lot of access numbers, although just 2 for my area, but it's rural. Copper.net connects faster than Netzero, since it uses the built in dial-up networking in Windows. Netzero has it's own java application, which is much slower. Copper.net also lets you stay connected for a maximum of 4 hours, whereas Netzero disconnects you after 3 hours. If you're looking for a new dial up isp or a backup internet connection, you might want to check out Copper.net.
BTW, Copper.net's high speed is also compatible with the wiflyer.
Thursday, July 5, 2007
InstallAnywhere Now
I've been tasked with looking into an installer, which is supposedly free, called InstallAnywhere. Well, apparently it's not free. The free version is only a 21 day trial. However, tucked away on the zerog.com site is a free version called InstallAnywhere Now. The Windows version is 40mb, so I haven't downloaded or tried it yet, but will post when I do. There are also Mac, AIX, Solaris, Linux and Hp versions available.
In need of a new cell phone? Check out this site for some of the newest phones on the market.
Have you ever tasted a good cup of gourmet coffee? Chances are you haven't!
In need of a new cell phone? Check out this site for some of the newest phones on the market.
Have you ever tasted a good cup of gourmet coffee? Chances are you haven't!
Thursday, June 28, 2007
WiFlyer
I haven't mentioned the WiFlyer in a while, but I'm still amazed by it. It is so cool. I live in a rural area where the only internet connection I can get is dial up. I'm really glad I discovered the WiFlyer though. It is a small device which plugs into an electrical outlet and phone jack and turns a dial up connection into a wireless dial up connection. I finally bought myself a laptop, so now I can move all over the house and still be able to surf the web using a dial up connection. No more extra long phone wire and no more confinement to one spot. Very sweet. There is also a new version of the WiFlyer out. It has a few more features and has a longer range.
If interested, check it out here. There is also a promotional code to use on check out. For a standard WiFlyer enter: friendw and for a WiFlyer+v enter: friendv. If you're stuck with dial up, the WiFlyer is definitely worth checking out. BTW, it is also compatible with a broadband connection if you ever switch over. The WiFlyer is also ideal for those who travel frequently as it is very compact and some hotels only offer a dial up connection. It is very easy to setup and very easy to use. I am still amazed every time I use it.
Oh, and the WiFlyer works just fine with Windows Vista.
If interested, check it out here. There is also a promotional code to use on check out. For a standard WiFlyer enter: friendw and for a WiFlyer+v enter: friendv. If you're stuck with dial up, the WiFlyer is definitely worth checking out. BTW, it is also compatible with a broadband connection if you ever switch over. The WiFlyer is also ideal for those who travel frequently as it is very compact and some hotels only offer a dial up connection. It is very easy to setup and very easy to use. I am still amazed every time I use it.
Oh, and the WiFlyer works just fine with Windows Vista.
Thursday, June 21, 2007
UnsatisfiedLinkErrors with a jar file, JNI and C++
I've been busy porting legacy C code to C++. Yeah, real fun. I also have a java gui which calls the C code using the Java Native Interface (JNI). This layer also had to be updated in order to use the C++ code. Everything worked great on windows. I then had to make sure everything built and ran correctly on linux and solaris. I am just not a linux or solaris person. Never have been, never will be. However, I did discover something useful.
I built my jar file and shared objects relatively easily. Next I tried running the jar file. The jar file linked to my shared object ok, but it couldn't find the function being called. I kept getting an UnsatisfiedLinkError. I guessed the reason was due to C++ name mangling.
Javah is used to create the jni header files. When the header files are created, javah automatically adds:
#ifdef __cplusplus
extern "C" {
#endif
to prevent C++ from mangling function names. I believe the command I used to look at the function names in the shared object was nm. Weird thing is, the names kind of looked mangled. I did some research on the internet, but found nothing useful. Everything worked fine on Windows, the header files use #ifdef cplusplus to prevent name mangling, so how could the function names be mangled? I don't know. I was desperate, so took the #ifdef cplusplus and put it in the C++ source file too. Right at the top, after the includes and before the first function. I ended the #ifdef cplusplus at the very end of the file. I recompiled and tried running the jar file again. What do you know? No more UnsatisfiedLinkErrors. The jar file found the functions in the shared object just fine. Thank goodness.
I built my jar file and shared objects relatively easily. Next I tried running the jar file. The jar file linked to my shared object ok, but it couldn't find the function being called. I kept getting an UnsatisfiedLinkError. I guessed the reason was due to C++ name mangling.
Javah is used to create the jni header files. When the header files are created, javah automatically adds:
#ifdef __cplusplus
extern "C" {
#endif
to prevent C++ from mangling function names. I believe the command I used to look at the function names in the shared object was nm. Weird thing is, the names kind of looked mangled. I did some research on the internet, but found nothing useful. Everything worked fine on Windows, the header files use #ifdef cplusplus to prevent name mangling, so how could the function names be mangled? I don't know. I was desperate, so took the #ifdef cplusplus and put it in the C++ source file too. Right at the top, after the includes and before the first function. I ended the #ifdef cplusplus at the very end of the file. I recompiled and tried running the jar file again. What do you know? No more UnsatisfiedLinkErrors. The jar file found the functions in the shared object just fine. Thank goodness.
Sunday, May 27, 2007
Dell, Ebates
Finally broke down and bought a laptop. Won't get it for at least a week though. Dell's having a really good Memorial Day sale, ends May 31, 2007, 6am(CT). Here's the link if interested. Got the 14.1", Inspiron E1405, due to it's smaller size as I want something easily portable. Got it for $800 with another $60 in tax and 2% off from ebates. Saved a little over $400. The free 2gb of memory was the main draw for me. They also throw in the longer lasting 9 cell battery
Here's a tip if you're interested. The deal is only available from this link, so click on that, go configure your system. Sign in or create an account and save the cart or add to wishlist. Go to ebates, click on the dell link. That brings you to dell, sign in and check out the configured system to get the 2% discount. BTW,
I've been paid several times from ebates. Don't really do much shopping, mostly around the holidays, but when I do, I always go see if there is a discount available before placing an order.
Here's a tip if you're interested. The deal is only available from this link, so click on that, go configure your system. Sign in or create an account and save the cart or add to wishlist. Go to ebates, click on the dell link. That brings you to dell, sign in and check out the configured system to get the 2% discount. BTW,
I've been paid several times from ebates. Don't really do much shopping, mostly around the holidays, but when I do, I always go see if there is a discount available before placing an order.
Sunday, May 13, 2007
Speed up windows part 5
Next step in speeding up your Windows PC involves tweaking the registry.
First, you should create a system restore point, just in case something goes wrong:
Click Start and choose either Programs or All Programs.
Go to Accessories, then System Tools, and choose System Restore.
On the welcome screen, you’ll be asked whether you want to restore or create a restore point. Choose Create a Restore Point.
Name it something you’ll remember, such as “Before Changes.”
Click Create.
Now if something doesn’t work, you can repeat these steps and choose “Restore” instead, to return to the status you just saved.
Ok. Let's make some changes.
1. Make menus load faster:
Start regedit by clicking Start, Run and type regedit.
Navigate to the following key by clicking the plus signs next to the name of each level:
HKEY_CURRENT_USER / Control Panel
Click “Desktop.” A list of entries will appear on the right side.
Double-click “MenuShowDelay” and change the Value data to 0.
Click OK.
2. Free memory from closed programs. Windows sometimes keeps dll's in memory even after the application using the dll has been closed.
Start regedit, following the instructions in this lesson.
Navigate to the following key:
HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion
Under CurrentVersion, right-click on Explorer, then choose New->Key.
In the box that appears (”New Key #1″), change the name to AlwaysUnloadDLL.
Hit Enter. On the right side, double-click the word (Default).
For the value data, enter 1.
Click OK.
3. Speed up the startup of programs.
In regedit, navigate to the following key:
HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Control / Session Manager / Memory Management / PrefetchParameters
When you click PrefetchParameters, the right side of the editor will display a list of entries.
Double-click “Enable Prefetcher” and change the value data to 5 (in decimal, not hexadecimal).
Click OK.
4. Reduce time Windows spends updating “last accessed” time for a folder and it's subfolders.
In regedit, navigate to the following key:
HKEY_LOCAL_MACHINE / System / CurrentControlSet / Control
Under Control, right-click on FileSystem, then choose New, then DWORD Value.
Replace “New Value #1″ with NtfsDisableLastAccessUpdate and hit Enter.
Double-click NtfsDisableLastAccessUpdate and change the Value data to 1.
Click OK.
Close regedit.
5. Now let's use msconfig and do a final tweak to improve swapfile performance by telling Windows not to use the swapfile until the absolute last minute.
Click Start, then Run.
Enter msconfig in the box.
Click on the System.ini tab.
Click the plus sign next to 386enh.
Click New, then type “ConservativeSwapfileUsage=1″ in the box that appears.
Click OK.
All done. Reboot and see if you notice any speed improvements.
First, you should create a system restore point, just in case something goes wrong:
Click Start and choose either Programs or All Programs.
Go to Accessories, then System Tools, and choose System Restore.
On the welcome screen, you’ll be asked whether you want to restore or create a restore point. Choose Create a Restore Point.
Name it something you’ll remember, such as “Before Changes.”
Click Create.
Now if something doesn’t work, you can repeat these steps and choose “Restore” instead, to return to the status you just saved.
Ok. Let's make some changes.
1. Make menus load faster:
Start regedit by clicking Start, Run and type regedit.
Navigate to the following key by clicking the plus signs next to the name of each level:
HKEY_CURRENT_USER / Control Panel
Click “Desktop.” A list of entries will appear on the right side.
Double-click “MenuShowDelay” and change the Value data to 0.
Click OK.
2. Free memory from closed programs. Windows sometimes keeps dll's in memory even after the application using the dll has been closed.
Start regedit, following the instructions in this lesson.
Navigate to the following key:
HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion
Under CurrentVersion, right-click on Explorer, then choose New->Key.
In the box that appears (”New Key #1″), change the name to AlwaysUnloadDLL.
Hit Enter. On the right side, double-click the word (Default).
For the value data, enter 1.
Click OK.
3. Speed up the startup of programs.
In regedit, navigate to the following key:
HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Control / Session Manager / Memory Management / PrefetchParameters
When you click PrefetchParameters, the right side of the editor will display a list of entries.
Double-click “Enable Prefetcher” and change the value data to 5 (in decimal, not hexadecimal).
Click OK.
4. Reduce time Windows spends updating “last accessed” time for a folder and it's subfolders.
In regedit, navigate to the following key:
HKEY_LOCAL_MACHINE / System / CurrentControlSet / Control
Under Control, right-click on FileSystem, then choose New, then DWORD Value.
Replace “New Value #1″ with NtfsDisableLastAccessUpdate and hit Enter.
Double-click NtfsDisableLastAccessUpdate and change the Value data to 1.
Click OK.
Close regedit.
5. Now let's use msconfig and do a final tweak to improve swapfile performance by telling Windows not to use the swapfile until the absolute last minute.
Click Start, then Run.
Enter msconfig in the box.
Click on the System.ini tab.
Click the plus sign next to 386enh.
Click New, then type “ConservativeSwapfileUsage=1″ in the box that appears.
Click OK.
All done. Reboot and see if you notice any speed improvements.
Wednesday, May 2, 2007
Speed up windows part 4
Several more ways to speed up your windows PC include the following:
1. Delete unnecessary start up programs:
Click Start, then choose All Programs or Programs (depending on your setup).
Find the Startup folder on the list and hover your mouse over it.
The list of programs that automatically start will appear. Check this list, and if you see something you don’t want or need to start automatically--such as some Microsoft Office task--right-click it and choose Delete.
2. Stop programs which start automatically using EasyCleaner.
3. Stop services which start automatically - use caution as some services are needed in order for your computer to run.
To get to the list of services, click Start, then Run.
Enter services.msc in the box. The screen that pops up is a bit intimidating at first, but it’s actually pretty straightforward. It lists every service on your machine and tells you whether it starts automatically or manually, among other things.
Click the Extended tab on the bottom, which will create a space that will give you a description of each service.
Now click on the words “Startup Type” at the top of that column, which will sort the services. The ones that say “Automatic” are--obviously--the ones that start when Windows does. They’re the only ones you care about.
The following lists services you can probably do without. Of course, if you recognize one that you use such as Windows Messenger or Telnet, don’t turn it off.
Alerter
Clipbook
Computer Browser
Distributed Link Tracking Client
Error Reporting Service (if you don’t want to be asked to send error reports to Microsoft anymore)
Fast User Switching
Human Interface Access Devices
IPSEC Services
Messenger
NetMeeting Remote Desktop Sharing
Portable Media Serial Number
Remote Desktop Help Session Manager
Remote Procedure Call Locator
Remote Registry
Routing & Remote Access
Secondary Logon
Server
SSDP Discovery Service
Telnet
TCP/IP NetBIOS Helper
Upload Manager
Universal Plug and Play Device Host
Workstation
Pick one from the list and double-click it. You’ll see a drop-down menu next to “Startup type” that is currently set to Automatic.
Change it to Manual and click OK. This way the service will start only if it’s needed, not all the time.
4. Also considering disabling these services:
Indexing service - disable this if you don't use the Windows’ search function very often - Start, Run, enter services.msc -- see above), scroll down to Indexing Service, and set the Startup type to “Disabled
If you use the Windows Classic theme, free up some memory by scrolling down the list of services to Themes and set it to “Disabled.”
1. Delete unnecessary start up programs:
Click Start, then choose All Programs or Programs (depending on your setup).
Find the Startup folder on the list and hover your mouse over it.
The list of programs that automatically start will appear. Check this list, and if you see something you don’t want or need to start automatically--such as some Microsoft Office task--right-click it and choose Delete.
2. Stop programs which start automatically using EasyCleaner.
3. Stop services which start automatically - use caution as some services are needed in order for your computer to run.
To get to the list of services, click Start, then Run.
Enter services.msc in the box. The screen that pops up is a bit intimidating at first, but it’s actually pretty straightforward. It lists every service on your machine and tells you whether it starts automatically or manually, among other things.
Click the Extended tab on the bottom, which will create a space that will give you a description of each service.
Now click on the words “Startup Type” at the top of that column, which will sort the services. The ones that say “Automatic” are--obviously--the ones that start when Windows does. They’re the only ones you care about.
The following lists services you can probably do without. Of course, if you recognize one that you use such as Windows Messenger or Telnet, don’t turn it off.
Alerter
Clipbook
Computer Browser
Distributed Link Tracking Client
Error Reporting Service (if you don’t want to be asked to send error reports to Microsoft anymore)
Fast User Switching
Human Interface Access Devices
IPSEC Services
Messenger
NetMeeting Remote Desktop Sharing
Portable Media Serial Number
Remote Desktop Help Session Manager
Remote Procedure Call Locator
Remote Registry
Routing & Remote Access
Secondary Logon
Server
SSDP Discovery Service
Telnet
TCP/IP NetBIOS Helper
Upload Manager
Universal Plug and Play Device Host
Workstation
Pick one from the list and double-click it. You’ll see a drop-down menu next to “Startup type” that is currently set to Automatic.
Change it to Manual and click OK. This way the service will start only if it’s needed, not all the time.
4. Also considering disabling these services:
Indexing service - disable this if you don't use the Windows’ search function very often - Start, Run, enter services.msc -- see above), scroll down to Indexing Service, and set the Startup type to “Disabled
If you use the Windows Classic theme, free up some memory by scrolling down the list of services to Themes and set it to “Disabled.”
Tuesday, April 24, 2007
Convert FAT to NTFS, DMA
2 more ways to speed up your computer are the following:
1. Convert your drive to NTFS, if it's currently FAT32:
Shut down any running programs.
Click Start, then choose Run.
In the box, enter cmd, which will bring up a black command-line window. You’ll see a prompt that says something like “C:\WINDOWS” with a blinking cursor. (If you’ve ever used DOS, you’ll recognize this.)
Enter the following: convert c: /fs:ntfs (If your hard drive isn’t drive C:, substitute the correct letter, and don’t forget the space between the colon and the slash.)
When you press Enter, you’ll probably see a message saying the conversion will take place next time you start Windows. So click Start, choose Shut Down, and choose Restart. Windows will convert your drive--and it will also reboot your computer twice.
2. Use DMA (direct memory access):
Go to your Control Panel and double-click System, then choose the Hardware tab. Click Device Manager. This will bring up a list of every type of hardware your computer has, from “Computer” to “Disk Drives” to “Monitors,” and more.
Click the plus sign next to “IDE ATA/ATAPI Controllers.”
Double-click “Primary IDE Channel.” (If you have two of them, don’t worry. Just repeat this procedure.)
Click the Advanced Settings tab. You’ll probably see two devices listed (0 and 1).
For each one, click the drop-down arrow next to Transfer Mode and choose “DMA if available.” Then click OK. (If you have another Primary IDE Channel, repeat this procedure.)
Close Device Manager and reboot your computer.
1. Convert your drive to NTFS, if it's currently FAT32:
Shut down any running programs.
Click Start, then choose Run.
In the box, enter cmd, which will bring up a black command-line window. You’ll see a prompt that says something like “C:\WINDOWS” with a blinking cursor. (If you’ve ever used DOS, you’ll recognize this.)
Enter the following: convert c: /fs:ntfs (If your hard drive isn’t drive C:, substitute the correct letter, and don’t forget the space between the colon and the slash.)
When you press Enter, you’ll probably see a message saying the conversion will take place next time you start Windows. So click Start, choose Shut Down, and choose Restart. Windows will convert your drive--and it will also reboot your computer twice.
2. Use DMA (direct memory access):
Go to your Control Panel and double-click System, then choose the Hardware tab. Click Device Manager. This will bring up a list of every type of hardware your computer has, from “Computer” to “Disk Drives” to “Monitors,” and more.
Click the plus sign next to “IDE ATA/ATAPI Controllers.”
Double-click “Primary IDE Channel.” (If you have two of them, don’t worry. Just repeat this procedure.)
Click the Advanced Settings tab. You’ll probably see two devices listed (0 and 1).
For each one, click the drop-down arrow next to Transfer Mode and choose “DMA if available.” Then click OK. (If you have another Primary IDE Channel, repeat this procedure.)
Close Device Manager and reboot your computer.
Thursday, April 19, 2007
C++ tagged unions continued
I have received indirect confirmation that using structs with tagged unions in C++ is not object oriented, as I suspected, and is most likely a poor way of doing things. This is a C method, not C++. No objects, no encapsulation. Not my idea to do it like that anyways. My idea used nice C++ objects. Oh well. I'm just low man on the totem pole and do as told. lol.
Monday, April 16, 2007
Clean your hard drive tips
One way to make your computer speed up is to clean your hard drive. Hard drives run faster & more consistently when there is free space. You can free up space on your hard drive by doing the following:
Eliminate software you don't use
Eliminate unused fonts - Create a folder and use Windows Explorer to go to your C:\WINDOWS\FONTS folder, and drag any fonts you never use into the new folder.
Use disk cleanup - From My Computer, right-click on your hard drive.
Choose Properties.
Click “Disk Cleanup.”
Clean the registry - Try EasyCleaner, it's free and easy to use. Once installed, click the Registry button. Click the Find button on the bottom. EasyCleaner will search your Registry for the leftovers of old programs. When it’s done, click the Delete All button. Click Yes to confirm you really want to delete the bad entries.
Defrag your hard drive, which helps your computer spend less time accessing files.
That's it. You should now have a noticeable amount of free space on you hard drive.
Eliminate software you don't use
Eliminate unused fonts - Create a folder and use Windows Explorer to go to your C:\WINDOWS\FONTS folder, and drag any fonts you never use into the new folder.
Use disk cleanup - From My Computer, right-click on your hard drive.
Choose Properties.
Click “Disk Cleanup.”
Clean the registry - Try EasyCleaner, it's free and easy to use. Once installed, click the Registry button. Click the Find button on the bottom. EasyCleaner will search your Registry for the leftovers of old programs. When it’s done, click the Delete All button. Click Yes to confirm you really want to delete the bad entries.
Defrag your hard drive, which helps your computer spend less time accessing files.
That's it. You should now have a noticeable amount of free space on you hard drive.
Saturday, April 14, 2007
CNET, Speed Up Your Windows PC
I mentioned a while ago how CNET has free online courses. Many different topics and the information provided is worthwhile. I'm currently taking two courses, HDTV 101 and Speed Up Your Windows PC. I'm a bit behind in both courses, but one tip to speed up your pc has worked pretty good.
I use Webshots for my wallpaper and screensaver, which reminds me, I need to download some new scenes. I'm really not willing to part with Webshots, but if you are, one way to speed up your PC is to do this:
Go to Control Panel and choose Display (you may have to click Appearance and Themes first).
On the Themes tab, change your current theme to Windows Classic, which uses fewer resources than the new look does. You can then click the Appearance tab and change that look to suit yourself.
The following tip I did use and it seems to have sped things up a bit:
Go into Control Panel and choose System (you may have to click Performance and Maintenance first).
Click the Advanced tab.
In the Performance box, click Settings.
You can now select Adjust for best performance, or you can choose Custom and play around with the settings. The more you uncheck, the less work your computer will have to do.
If you are interested in speeding up your file browsing, you might want to try this:
Open My Computer.
Click the Tools menu.
Choose Folder Options.
Click the View tab.
Uncheck “Automatically search for network folders and printers.”
Click OK.
This prevents Windows from automatically searching your network for folders and files, unless you ask it to.
I use Webshots for my wallpaper and screensaver, which reminds me, I need to download some new scenes. I'm really not willing to part with Webshots, but if you are, one way to speed up your PC is to do this:
Go to Control Panel and choose Display (you may have to click Appearance and Themes first).
On the Themes tab, change your current theme to Windows Classic, which uses fewer resources than the new look does. You can then click the Appearance tab and change that look to suit yourself.
The following tip I did use and it seems to have sped things up a bit:
Go into Control Panel and choose System (you may have to click Performance and Maintenance first).
Click the Advanced tab.
In the Performance box, click Settings.
You can now select Adjust for best performance, or you can choose Custom and play around with the settings. The more you uncheck, the less work your computer will have to do.
If you are interested in speeding up your file browsing, you might want to try this:
Open My Computer.
Click the Tools menu.
Choose Folder Options.
Click the View tab.
Uncheck “Automatically search for network folders and printers.”
Click OK.
This prevents Windows from automatically searching your network for folders and files, unless you ask it to.
Wednesday, April 11, 2007
C++, Java Native Interface (JNI)
In my recent Java Native Interface (JNI) adventures, I have discovered that when calling the JNI function NewObject in C++, you need to cast the variables to their corresponding jni type. I didn't have to do this when using C and jni.
Example:
C++ struct ABC { double x, double y };
Using C++ create a jni object to pass to java:
jobject createABC( JNIEnv* env, jobject obj )
{
ABC abc;
a.x = 5.2;
a.y = 2.4;
jclass cls = env->FindClass( "ABC" ); // find the java ABC class
jmethodID mid = env->GetMethodID( cls, "", "(DD)V" );
jobject jabc = env->NewObject( cls, mid, (jdouble)a.x, (jdouble)a.y);
return jabc;
}
Example:
C++ struct ABC { double x, double y };
Using C++ create a jni object to pass to java:
jobject createABC( JNIEnv* env, jobject obj )
{
ABC abc;
a.x = 5.2;
a.y = 2.4;
jclass cls = env->FindClass( "ABC" ); // find the java ABC class
jmethodID mid = env->GetMethodID( cls, "
jobject jabc = env->NewObject( cls, mid, (jdouble)a.x, (jdouble)a.y);
return jabc;
}
Monday, April 9, 2007
C++ tagged unions
Here's a question I posted at The Scripts Forum:
I have a class which does coordinate conversions.
I have several different data structures which are used to pass data in and out of this class.
I have a setCoordinate function which I use to pass one of these data structures in, to set the input coordinates.
Here's my problem:
How do I define these data structures? Should they be a class or a struct?
They need to have a base class in order to be passed into the set coordinate function. The base class doesn't have any parameters or functions for the derived data structures to inherit.
XXX Base:{};
XXX A: Base
{
int x;
int y;
}
XXX B: Base
{
double la;
double lo;
}
setCoordinates( Base* ba );
Next question: Should these data structures be included in the header file where setCoordinates is defined or should each one have its own header file.
If each should have it's own header file, then it should be a class, but should they be classes?
If this is an object oriented design, then it seems like they should be classes, but all they do is pass data in and out of the conversion class.
Unfortunately, I did not receive a response.
I poked around the web a bit and came across this link. http://java.sun.com/developer/Books/shiftintojava/page1.html, the Replace Unions with Class Hierarchies section. In C, this tagged union method makes sense. However, I'm programming in C++. C++ is an object oriented programming language. Tagged unions are not object oriented. Classes are object oriented. From what I've read structs only exist in C++ for backwards compatibilty with C.
Anyways, here's what I ended up doing:
typedef struct {
int tag;
union U
{
struct A
{
int x;
int y;
}a;
struct B
{
doublela;
double lo;
}b;
circleDimensions_t circle;
} u;
} Base;
Tagged unions in C++ condense things, but I don't like it.
I have a class which does coordinate conversions.
I have several different data structures which are used to pass data in and out of this class.
I have a setCoordinate function which I use to pass one of these data structures in, to set the input coordinates.
Here's my problem:
How do I define these data structures? Should they be a class or a struct?
They need to have a base class in order to be passed into the set coordinate function. The base class doesn't have any parameters or functions for the derived data structures to inherit.
XXX Base:{};
XXX A: Base
{
int x;
int y;
}
XXX B: Base
{
double la;
double lo;
}
setCoordinates( Base* ba );
Next question: Should these data structures be included in the header file where setCoordinates is defined or should each one have its own header file.
If each should have it's own header file, then it should be a class, but should they be classes?
If this is an object oriented design, then it seems like they should be classes, but all they do is pass data in and out of the conversion class.
Unfortunately, I did not receive a response.
I poked around the web a bit and came across this link. http://java.sun.com/developer/Books/shiftintojava/page1.html, the Replace Unions with Class Hierarchies section. In C, this tagged union method makes sense. However, I'm programming in C++. C++ is an object oriented programming language. Tagged unions are not object oriented. Classes are object oriented. From what I've read structs only exist in C++ for backwards compatibilty with C.
Anyways, here's what I ended up doing:
typedef struct {
int tag;
union U
{
struct A
{
int x;
int y;
}a;
struct B
{
doublela;
double lo;
}b;
circleDimensions_t circle;
} u;
} Base;
Tagged unions in C++ condense things, but I don't like it.
Tuesday, April 3, 2007
SVG Logos
If you work with Scalable Vector Graphics (SVG), you might be interested to know there are now SVG logos. I believe they were created by Harvey Rayner. They are available here. Very cool!
Sunday, April 1, 2007
Apache Batik 1.7beta1
The latest version of Apache Batik has been released.
Here is the announcement I received:
The Apache Batik team is proud to announce the long-awaited release of
Apache Batik version 1.7beta1, a Java-based toolkit for processing SVG.
This is the first release of Batik in approximately two years, and
brings many new features and improvements over version 1.6. Notable new
features include:
* DOM Level 3 Core/Events/XPath support
* Improved WMF transcoder support
* Near complete SMIL Animation support
* A few SVG 1.2 features, such as:
* resource documents
* shapechange and RenderedBBoxChange events
* SVGGlobal startMouseCapture/stopMouseCapture methods
* handler elements
Batik can be downloaded from here:
http://xmlgraphics.apache.org/batik/download.cgi
For the full list of improvements and bug fixes over version 1.6, click
on the â€Å“release change log†link from that page.
The reasoning behind having a beta release rather than a full release is
that there has been a great deal of changes since version 1.6, and while
we believe the code to be reasonably stable, it would be beneficial to
get feedback from users on any bugs that may have been missed. We plan
to have a full 1.7 release in a month or two.
If you find any problems, please file bug reports:
http://issues.apache.org/bugzilla/
And for more information, see the Batik project website:
http://xmlgraphics.apache.org/batik/
Here is the announcement I received:
The Apache Batik team is proud to announce the long-awaited release of
Apache Batik version 1.7beta1, a Java-based toolkit for processing SVG.
This is the first release of Batik in approximately two years, and
brings many new features and improvements over version 1.6. Notable new
features include:
* DOM Level 3 Core/Events/XPath support
* Improved WMF transcoder support
* Near complete SMIL Animation support
* A few SVG 1.2 features, such as:
* resource documents
* shapechange and RenderedBBoxChange events
* SVGGlobal startMouseCapture/stopMouseCapture methods
* handler elements
Batik can be downloaded from here:
http://xmlgraphics.apache.org/batik/download.cgi
For the full list of improvements and bug fixes over version 1.6, click
on the â€Å“release change log†link from that page.
The reasoning behind having a beta release rather than a full release is
that there has been a great deal of changes since version 1.6, and while
we believe the code to be reasonably stable, it would be beneficial to
get feedback from users on any bugs that may have been missed. We plan
to have a full 1.7 release in a month or two.
If you find any problems, please file bug reports:
http://issues.apache.org/bugzilla/
And for more information, see the Batik project website:
http://xmlgraphics.apache.org/batik/
Thursday, March 29, 2007
Java finalize function
Using peer classes and implementation pointers to call C++ classes from java using JNI seems to work out ok so far. Forget the finalize function I talked about in my last post though. Apparently sometimes the finalize function is called and sometimes the finalize function is not called. It's very unpredictable. This behavior was verified when I did some debugging. My finalize function never got called, so the implementation pointer I created in the JNI was never released.
Instead you need to specify a Java function in your peer class to release the memory in the JNI and explicitly call it yourself. For my java application, I have a JFrame to which I added a windowClosing action listener:
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
// call the destroy method of the Java peer class
peerclassname.destroy();
System.exit(0); //calling this method is a must
}
});
This function is automatically called when the JFrame exits. The destroy function in the peer class calls the JNI destroy function which releases the C++ pointer.
Instead you need to specify a Java function in your peer class to release the memory in the JNI and explicitly call it yourself. For my java application, I have a JFrame to which I added a windowClosing action listener:
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
// call the destroy method of the Java peer class
peerclassname.destroy();
System.exit(0); //calling this method is a must
}
});
This function is automatically called when the JFrame exits. The destroy function in the peer class calls the JNI destroy function which releases the C++ pointer.
Tuesday, March 27, 2007
JNI, C++ object instantiation
So my next task is to create a java gui using a C++ library.
The library is pretty simple. There is one main class with a few supporting classes. The supporting classes are basically just structs which hold variables.
The first thing to be done is create a Java class similar to the main C++ class. This is called a peer class. The methods in the java class are native functions whose implementations will be done using the Java Native Interface (JNI).
In the java class constructor, a jni call to create the C++ class will need to be made. The java class will also need to override the finalize function in which it will have a jni call to delete the C++ class.
The java class also needs to contain a variable which will be used to contain the pointer to the C++ class.
Now my first problem: How do I implement the JNI function which creates the C++ class? If anyone knows the answer, feel free to leave me a comment.
According to this link, a reinterpret cast is involved.
C++ class:
#include "CPPObject.h"
#include
CppObject::CppObject(int aFoo) {
foo = aFoo;
}
void CppObject::printFoo() {
printf ("Value of foo is: %i\n", foo);
}
Java peer class:
public class CppObjectPeer {
static {
System.loadLibrary("cppobjects");
}
protected long ptr;
public CppObjectPeer(int aFoo) {
this.ptr = createCppObject(aFoo); //create object in native code
}
public void printFoo() {
printFoo(this.ptr); //print from native code
}
//native methods
private final native long createCppObject(int aFoo);
private native void printFoo(long ptr);
}
Jni implementations:
JNIEXPORT jlong JNICALL Java_CppObjectPeer_createCppObject
(JNIEnv *env, jobject obj, jint fooValue) {
CppObject *cppObj = new CppObject(fooValue);
return reinterpret_cast(cppObj);
}
JNIEXPORT void JNICALL Java_CppObjectPeer_printFoo
(JNIEnv *env, jobject obj, jlong ptr) {
CppObject *cppObj = reinterpret_cast(ptr);
cppObj->printFoo();
}
Well, it looks simple enough. Just not sure why the book: Essential Jni: Java Native Interface (Essential Java), by Rob Gordon doesn't use this technique. Is this a new technique?
The book uses a Registry class and a hash code function to store the pointer to the C++ object. This method seems like a lot of work for what I need. As an alternative, he suggests using get/setCID functions which call get/setLongField functions. The set functions requires an int val be passed in and I don't understand where the val comes from. I guess for now I'm going to try the reinterpret_cast method.
Stay tuned for how it works out.
The library is pretty simple. There is one main class with a few supporting classes. The supporting classes are basically just structs which hold variables.
The first thing to be done is create a Java class similar to the main C++ class. This is called a peer class. The methods in the java class are native functions whose implementations will be done using the Java Native Interface (JNI).
In the java class constructor, a jni call to create the C++ class will need to be made. The java class will also need to override the finalize function in which it will have a jni call to delete the C++ class.
The java class also needs to contain a variable which will be used to contain the pointer to the C++ class.
Now my first problem: How do I implement the JNI function which creates the C++ class? If anyone knows the answer, feel free to leave me a comment.
According to this link, a reinterpret cast is involved.
C++ class:
#include "CPPObject.h"
#include
CppObject::CppObject(int aFoo) {
foo = aFoo;
}
void CppObject::printFoo() {
printf ("Value of foo is: %i\n", foo);
}
Java peer class:
public class CppObjectPeer {
static {
System.loadLibrary("cppobjects");
}
protected long ptr;
public CppObjectPeer(int aFoo) {
this.ptr = createCppObject(aFoo); //create object in native code
}
public void printFoo() {
printFoo(this.ptr); //print from native code
}
//native methods
private final native long createCppObject(int aFoo);
private native void printFoo(long ptr);
}
Jni implementations:
JNIEXPORT jlong JNICALL Java_CppObjectPeer_createCppObject
(JNIEnv *env, jobject obj, jint fooValue) {
CppObject *cppObj = new CppObject(fooValue);
return reinterpret_cast
}
JNIEXPORT void JNICALL Java_CppObjectPeer_printFoo
(JNIEnv *env, jobject obj, jlong ptr) {
CppObject *cppObj = reinterpret_cast
cppObj->printFoo();
}
Well, it looks simple enough. Just not sure why the book: Essential Jni: Java Native Interface (Essential Java), by Rob Gordon doesn't use this technique. Is this a new technique?
The book uses a Registry class and a hash code function to store the pointer to the C++ object. This method seems like a lot of work for what I need. As an alternative, he suggests using get/setCID functions which call get/setLongField functions. The set functions requires an int val be passed in and I don't understand where the val comes from. I guess for now I'm going to try the reinterpret_cast method.
Stay tuned for how it works out.
Thursday, March 22, 2007
Sketsa 4.2
The SVG graphics editor Sketsa 4.2 has been released.
It includes the following updates:
- Add Dropper Tool
- Add Canvas PopupMenu
- Add Menu - File - Revert
- Small Text Tool improvement
- Some Optimisation
- Fix startup active TopComponent
- Fix DocumentLoader
- Fix some memory leak
- Other bug fixes and enhancements
You can download it here. In order to run Sketsa, you will need Java 1.5 installed.
It includes the following updates:
- Add Dropper Tool
- Add Canvas PopupMenu
- Add Menu - File - Revert
- Small Text Tool improvement
- Some Optimisation
- Fix startup active TopComponent
- Fix DocumentLoader
- Fix some memory leak
- Other bug fixes and enhancements
You can download it here. In order to run Sketsa, you will need Java 1.5 installed.
Monday, March 19, 2007
AVG Anti-Virus, Anti-Spyware
My sister bought a new Dell desktop about 6 months ago. It came with free virus software for 6 months. 6 months is about over, so she was wondering where to get free unlimited virus software. I referred her to AVG Anti-Virus. I've been using it for a few months now and have had no problems with it. Daily updates are automatically done, so that's good.
I also use AVG's free Anti-Spyware software. Definitely a must have if you dowload and install files or even just surf the web.
Lots of MySpace profiles have comments about downloading profile watcher 2.0, which turns out to be spyware. You have to be careful, you just never know what you could be getting. The only place I trust to download programs from is download.com I've been using them for years without a problem.
Some of the best software is free.
I also use AVG's free Anti-Spyware software. Definitely a must have if you dowload and install files or even just surf the web.
Lots of MySpace profiles have comments about downloading profile watcher 2.0, which turns out to be spyware. You have to be careful, you just never know what you could be getting. The only place I trust to download programs from is download.com I've been using them for years without a problem.
Some of the best software is free.
Friday, March 16, 2007
Use C++ to pass a function a base class and return a derived class, user defined variables
Sorry I haven't had any new apache batik/svg updates.
I'm into some C++ work now and haven't had time to work on it.
Pointers, I hate them, definitely a pain in the butt.
I searched all day on the internet and couldn't find any examples showing me how to do what I wanted. I finally took a look at some old third party code I have & figured out what I needed.
So here's a rundown of what I was trying to do and what I figured out.
I have a base class A with an int x.
I have a bunch of derived classes of A, each with their own set of variables.
Let's work with derived class B, which has a double i.
I have a function which accepts an A and sets an array of user defined variables for each derived class.
The array type is a struct, part of which is a union made up of pointers to each derived class.
class A
{
int x;
}
class B : public A
{
double i;
}
union P
{
B* b;
.
.
.
.
}
struct Row
{
int status;
P p;
}
Row values[2];
void setInfo( int index, A* _a )
{
// just for this example, i know _a is a B
values[index].p.b = static_cast(B*)(_a);
}
I call setInfo like this:
B* b1 = new B( 4, 5.2 ); // 4 gets passed to base class A, so x = 4, i = 5.2
BTW setInfo lives in another class c, so
c->setInfo( 0, b1 );
Ok. Now I want a get function to return B, but I need it returned in the parameter list, not the easy way by using the function return value. The reason for this is in my real work, I have multiple values which need to be returned.
So here's what my get function looks like:
getInfo( int index, A& _a )
{
// just for this example, i know _a is a B
(static_cast(A&)(_a)) = (*values[index].p.b);
}
I call getInfo like this:
B b2;
c->getInfo( 0, b2 );
Beautiful.
So this is how I pass a function multiple base class parameters and return multiple derived class parameters containing user defined variables. Easy enough I guess. I still hate pointers though.
I'm into some C++ work now and haven't had time to work on it.
Pointers, I hate them, definitely a pain in the butt.
I searched all day on the internet and couldn't find any examples showing me how to do what I wanted. I finally took a look at some old third party code I have & figured out what I needed.
So here's a rundown of what I was trying to do and what I figured out.
I have a base class A with an int x.
I have a bunch of derived classes of A, each with their own set of variables.
Let's work with derived class B, which has a double i.
I have a function which accepts an A and sets an array of user defined variables for each derived class.
The array type is a struct, part of which is a union made up of pointers to each derived class.
class A
{
int x;
}
class B : public A
{
double i;
}
union P
{
B* b;
.
.
.
.
}
struct Row
{
int status;
P p;
}
Row values[2];
void setInfo( int index, A* _a )
{
// just for this example, i know _a is a B
values[index].p.b = static_cast(B*)(_a);
}
I call setInfo like this:
B* b1 = new B( 4, 5.2 ); // 4 gets passed to base class A, so x = 4, i = 5.2
BTW setInfo lives in another class c, so
c->setInfo( 0, b1 );
Ok. Now I want a get function to return B, but I need it returned in the parameter list, not the easy way by using the function return value. The reason for this is in my real work, I have multiple values which need to be returned.
So here's what my get function looks like:
getInfo( int index, A& _a )
{
// just for this example, i know _a is a B
(static_cast(A&)(_a)) = (*values[index].p.b);
}
I call getInfo like this:
B b2;
c->getInfo( 0, b2 );
Beautiful.
So this is how I pass a function multiple base class parameters and return multiple derived class parameters containing user defined variables. Easy enough I guess. I still hate pointers though.
Tuesday, March 13, 2007
Firefox, FasterFox, Firetune, Maxthon
Firefox is a pretty popular browser, but I've just never been able to use it. I only have a dial up connection and Firefox just goes too slow & sometimes it times out before it even loads the page. I did install FasterFox. It is a plug in designed to load webpages faster. I guess it makes a difference, but pages still tend to not load. The other day I came across another Firefox plug in designed to load pages faster. This one is called FireTune. I installed it and so far it does seem to have made a difference. I haven't had a page not load yet. The page loading speed is better than it was too. I'm probably still not going to use Firefox full time though.
It's just not as fast as the browser I currently use, Maxthon. Maxthon is based on the Internet Explorer browser engine, but has more features such as:
Tabbed Browsing Interface
Mouse Gestures
Super Drag&Drop
Privacy Protection
AD Hunter
RSS Reader
IE Extensions Support
External Utility Bar
Skinning
On the downside, Maxthon does have a tendency to crash once in a while.
On the plus side, the tabbed browsing alone makes it worth the switch, not to mention the faster page loading. Maxthon is free, so if you're looking for a different browser, you might want to give this one a try.
It's just not as fast as the browser I currently use, Maxthon. Maxthon is based on the Internet Explorer browser engine, but has more features such as:
Tabbed Browsing Interface
Mouse Gestures
Super Drag&Drop
Privacy Protection
AD Hunter
RSS Reader
IE Extensions Support
External Utility Bar
Skinning
On the downside, Maxthon does have a tendency to crash once in a while.
On the plus side, the tabbed browsing alone makes it worth the switch, not to mention the faster page loading. Maxthon is free, so if you're looking for a different browser, you might want to give this one a try.
Saturday, March 10, 2007
Winamp
Well, if you took my advice and checked out Limewire, then you may need a media player. Windows comes preloaded with the Windows MediaPlayer. News Year Eve was the first time I actually used it in a few years. I was really surprised. It's come a long ways. You can create libraries, do sorting. A decent little app.
The reason for my non use of the Windows MediaPlayer, is because years ago I was turned onto another media player by a former coworker. What is this media player?
Winamp. It's very cool. It appears to be able to do all the things Windows MediaPlayer does and more. The part I like the best is you can change the skins. There are some really cool ones available.
Winamp can be broken down into 5 different sections.
Main Window:
Winamp 5 features our new Modern Skin that's easier to use and more powerful than ever
Easily access the Media Library (ML), Playlist Editor (PL), integrated Video or Visualizations (Video/Vis Drawer), or the EQ, Skin Options, and Color Themes (Config Drawer) from the Main Window
Includes over 50 color themes that suit nearly every mood or occasion!
Winamp 5 carries forward the unobtrusive "Window Shade"
Playlist Editor:
Drag and drop media directly into a Playlist from Windows Explorer or the Media Library
Jump directly to an item within the list by double clicking it or selecting the item and press Enter
Sort Playlists by title, file name, or path and file name
Easily Open and Save Playlists from the Manage Playlist button
Library:
Organize and find your favorite songs and videos in ONE place
Rip your favorite music CDs into AAC or MP3 (Ripping limited to 2x speeds for free users. MP3 encoding is only available in Winamp Pro)
Burn your favorite music compilations to CD (limited to 2x for free users)
Media Library "Views" allow you to easily create rule based lists of your media
Easily modify your music collections tags (Artist, Album, Song name, etc.)
Internet Radio and TV
Easily tune into user created Internet TV and Radio stations
Over 4000 Internet Radio stations and 40 Internet TV channels to choose from
Bookmark your favorite stations and channels for future access
Winamp Now Playing
View album art, artist biographies, discographies
Keep track of your favorite artists by browsing fan sites and news articles presented in the client
Easily buy your favorite CDs, memorabilia, or just sell your own
Video:
Play many major video formats (NSV, WMV, MPG, etc.) with ease
Easily resize video playback using the 1x, 2x, and Maximize window buttons
Watch your favorite videos in Full Screen mode
Quick access to dozens of Internet TV stations created by users
Detach the video window from the main player
Visualizer:
Winamp 5 comes bundled with the latest version of the ground breaking AVS (Advanced Visualization Studio) and Milkdrop visualizers
Enjoy over 100 bundled visualization presets created by users
Switch between presets manually or sit back and watch your presets on Random
Easily jump to Full Screen mode
Download new visualizations and presets from Winamp.com
Equalizer:
Shift the sound from both speakers to left or right using the Balance slider
Enable Cross Fading to transition the audio smoothly from one song to another
Select from the dozens of EQ presets to tune the sound
Create your own EQ settings and save them for future use
Version 5.33 has just been released. Did I mention you get this media player with all these features for free? Yup, Winamp is a free download, so check it out.
BTW, there is a pro version with even more features:
Unrestricted CD Burning
Winamp Pro enables you to burn your favorite music compilations at your computer's full potential. Once registered, Winamp Pro will allow you to burn your CDs at speeds up to 48x, 9 times the speed of Winamp 5! (Actual speeds may differ, depending on your computer's specifications.)
MP3 Encoding
With Winamp Pro, you can rip all your favorite music CDs into the industry leading MP3 format. When all your songs are encoded in MP3, it provides you the freedom to play them in all MP3 capable hardware and software media players.
Unrestricted CD Ripping
Buying Winamp Pro enables you to convert all of your favorite music CDs into digital files at your computer's maximum potential. Once registered, Winamp Pro can rip your CDs at speeds up to 48x, 9 times the speed of Winamp 5! (Actual speeds may differ, depending on your computer's specifications.)
The reason for my non use of the Windows MediaPlayer, is because years ago I was turned onto another media player by a former coworker. What is this media player?
Winamp. It's very cool. It appears to be able to do all the things Windows MediaPlayer does and more. The part I like the best is you can change the skins. There are some really cool ones available.
Winamp can be broken down into 5 different sections.
Main Window:
Winamp 5 features our new Modern Skin that's easier to use and more powerful than ever
Easily access the Media Library (ML), Playlist Editor (PL), integrated Video or Visualizations (Video/Vis Drawer), or the EQ, Skin Options, and Color Themes (Config Drawer) from the Main Window
Includes over 50 color themes that suit nearly every mood or occasion!
Winamp 5 carries forward the unobtrusive "Window Shade"
Playlist Editor:
Drag and drop media directly into a Playlist from Windows Explorer or the Media Library
Jump directly to an item within the list by double clicking it or selecting the item and press Enter
Sort Playlists by title, file name, or path and file name
Easily Open and Save Playlists from the Manage Playlist button
Library:
Organize and find your favorite songs and videos in ONE place
Rip your favorite music CDs into AAC or MP3 (Ripping limited to 2x speeds for free users. MP3 encoding is only available in Winamp Pro)
Burn your favorite music compilations to CD (limited to 2x for free users)
Media Library "Views" allow you to easily create rule based lists of your media
Easily modify your music collections tags (Artist, Album, Song name, etc.)
Internet Radio and TV
Easily tune into user created Internet TV and Radio stations
Over 4000 Internet Radio stations and 40 Internet TV channels to choose from
Bookmark your favorite stations and channels for future access
Winamp Now Playing
View album art, artist biographies, discographies
Keep track of your favorite artists by browsing fan sites and news articles presented in the client
Easily buy your favorite CDs, memorabilia, or just sell your own
Video:
Play many major video formats (NSV, WMV, MPG, etc.) with ease
Easily resize video playback using the 1x, 2x, and Maximize window buttons
Watch your favorite videos in Full Screen mode
Quick access to dozens of Internet TV stations created by users
Detach the video window from the main player
Visualizer:
Winamp 5 comes bundled with the latest version of the ground breaking AVS (Advanced Visualization Studio) and Milkdrop visualizers
Enjoy over 100 bundled visualization presets created by users
Switch between presets manually or sit back and watch your presets on Random
Easily jump to Full Screen mode
Download new visualizations and presets from Winamp.com
Equalizer:
Shift the sound from both speakers to left or right using the Balance slider
Enable Cross Fading to transition the audio smoothly from one song to another
Select from the dozens of EQ presets to tune the sound
Create your own EQ settings and save them for future use
Version 5.33 has just been released. Did I mention you get this media player with all these features for free? Yup, Winamp is a free download, so check it out.
BTW, there is a pro version with even more features:
Unrestricted CD Burning
Winamp Pro enables you to burn your favorite music compilations at your computer's full potential. Once registered, Winamp Pro will allow you to burn your CDs at speeds up to 48x, 9 times the speed of Winamp 5! (Actual speeds may differ, depending on your computer's specifications.)
MP3 Encoding
With Winamp Pro, you can rip all your favorite music CDs into the industry leading MP3 format. When all your songs are encoded in MP3, it provides you the freedom to play them in all MP3 capable hardware and software media players.
Unrestricted CD Ripping
Buying Winamp Pro enables you to convert all of your favorite music CDs into digital files at your computer's maximum potential. Once registered, Winamp Pro can rip your CDs at speeds up to 48x, 9 times the speed of Winamp 5! (Actual speeds may differ, depending on your computer's specifications.)
Wednesday, March 7, 2007
Askville
Amazon has just launched a new website called Askville.
"Askville is a place where you can ask any question on any topic and get real answers from real people. It’s a fun place to meet others with similar interests to you and a place where you can share what you know. You can learn something new everyday or help and meet others using your knowledge. It's new, and best of all, it's free!"
Lots of different categories with some good questions.
"Askville is a place where you can ask any question on any topic and get real answers from real people. It’s a fun place to meet others with similar interests to you and a place where you can share what you know. You can learn something new everyday or help and meet others using your knowledge. It's new, and best of all, it's free!"
Lots of different categories with some good questions.
Sunday, March 4, 2007
Daylight Savings Time
Daylight savings time is 3 weeks early this year, March 11, and will last a week later, November 4. You know what that means? Potential computer problems, that's what. It could also affect VCR's, TiVo, Mac's & Windows PCs. Good news for Windows PCs. There is an update available. For Windows, go to: support.microsoft.com/kb/928388. Recently purchased Macs, should already have been updated. For all other devices, you will probably have to adjust the time manually. See the product website or manual for device specific info.
BTW, "this extra month of daylight is supposed to save energy by shifting the warmer part of the day an hour later".
BTW, "this extra month of daylight is supposed to save energy by shifting the warmer part of the day an hour later".
Thursday, March 1, 2007
Limewire
Downloading free music. Yup, it's illegal, but people still do it. Once in a blue moon, I will download a song. New Year's Eve I was introduced to a file sharing application I had never heard of called Limewire. I tried it out & it works good. There is a free version & a paid version. I used the free version and was able to download songs relatively quickly, despite my dial up connection. You can also download other types of media, such as videos. It is also open source. Limewire contains the following features:
NO BUNDLED SOFTWARE OF ANY KIND!
No spyware. No adware. Guaranteed.
Firewall to Firewall Transfers.
Since about 60% of users are currently firewalled, this feature greatly increases the amount of content on the network.
Faster network connections.
Using new "UDP Host Caches", LimeWire starts up and connects faster then ever before!
Universal Plug 'N Play.
UPnP support allows LimeWire to find more search results and have faster downloads.
iTunes Integration.
Windows users can now take advantage of LimeWire's iTunes integration.
Creative Commons Integration.
LimeWire now recognizes OGGs and MP3s licensed under a Creative Commons License.
"What's New?" feature.
Users can browse the network for the most recent content additions.
Search drill down results.
Searches in LimeWire now immediately display the artists, albums and other information that fully describes files.
Proxy support.
Users can now use web proxies to route their downloads to protect their identity.
Support for International searches and International groups.
Users can now search in any language, and LimeWire ensures that a user will be connected to other users with their own language to aide international users to receive search results in their native language and to find content from sources that are close to home.
LimeWire still has the following great features:
Ease of use. Just install, run, and search.
Ability to search by artist, title, genre, or other meta-information.
Elegant multiple search tabbed interface.
"Swarm" downloads from multiple hosts help you get files faster.
iTunes integration for Mac users.
Unique "ultrapeer" technology reduces bandwidth requirements for most users.
Integrated chat.
Browse host feature. Even works through firewalls.
Added Bitzi metadata lookup.
International versions: Now available in many new languages.
Connects to the network using GWebCache, a distributed connection system.
Automatic local network searches for lightning-fast downloads. If you're on a corporate or university network, download files from other users on the same network almost instantaneously!
Support for MAGNET links that allow you to click on web page links that access Gnutella.
NO BUNDLED SOFTWARE OF ANY KIND!
No spyware. No adware. Guaranteed.
Firewall to Firewall Transfers.
Since about 60% of users are currently firewalled, this feature greatly increases the amount of content on the network.
Faster network connections.
Using new "UDP Host Caches", LimeWire starts up and connects faster then ever before!
Universal Plug 'N Play.
UPnP support allows LimeWire to find more search results and have faster downloads.
iTunes Integration.
Windows users can now take advantage of LimeWire's iTunes integration.
Creative Commons Integration.
LimeWire now recognizes OGGs and MP3s licensed under a Creative Commons License.
"What's New?" feature.
Users can browse the network for the most recent content additions.
Search drill down results.
Searches in LimeWire now immediately display the artists, albums and other information that fully describes files.
Proxy support.
Users can now use web proxies to route their downloads to protect their identity.
Support for International searches and International groups.
Users can now search in any language, and LimeWire ensures that a user will be connected to other users with their own language to aide international users to receive search results in their native language and to find content from sources that are close to home.
LimeWire still has the following great features:
Ease of use. Just install, run, and search.
Ability to search by artist, title, genre, or other meta-information.
Elegant multiple search tabbed interface.
"Swarm" downloads from multiple hosts help you get files faster.
iTunes integration for Mac users.
Unique "ultrapeer" technology reduces bandwidth requirements for most users.
Integrated chat.
Browse host feature. Even works through firewalls.
Added Bitzi metadata lookup.
International versions: Now available in many new languages.
Connects to the network using GWebCache, a distributed connection system.
Automatic local network searches for lightning-fast downloads. If you're on a corporate or university network, download files from other users on the same network almost instantaneously!
Support for MAGNET links that allow you to click on web page links that access Gnutella.
Monday, February 26, 2007
Netzero, Windows Vista
If you use Netzero for your dial up internet connection and plan on upgrading to Windows Vista you may want to postpone the upgrade for a bit. As I talked about in my last post, upgrading to Windows Vista is causing all sorts of incompatibility problems. Apparently the Norton AntiVirus and Internet Security products are not compatible with Vista. The makers of Norton AntiVirus and Internet Security will be providing NetZero an updated version in the coming weeks, so if you do upgrade, send Netzero an email to request a CD with the updated security software.
I think I'm going to wait until at least the spring before I order my new laptop.
BTW, check out this blog for more Windows Vista woes.
I think I'm going to wait until at least the spring before I order my new laptop.
BTW, check out this blog for more Windows Vista woes.
Friday, February 23, 2007
Windows Vista
I was thinking of buying myself a laptop when I receive my tax refund. Maybe I should have bought one before Windows Vista came out though. A recent review I read reports many problems with Vista. Apparently "upgrades can be a pain, games might not play properly, a financial software, Quickbooks, for businesses can fail, MP3 players might not work & even software architects use, CAD, may slow to a crawl". Hmmm, well that's not good.
Apparently Korea's banking system has already suffered sporadic computer failures. Vista's security restrictions are causing the gaming problems.
Microsoft took out an option allowing easy upgrades from one version of Windows to a newer version. Apparently now in order to upgrade to Vista, you need an old version installed first. So if your hard drive with XP crashes you can't just upgrade to Vista while you're fixing everything. First you have to reinstall XP & then upgrade to Vista. That's a pain in the butt.
Well, here's a link to a Vista guide if you do decide to upgrade. I may wait until the spring before buying my laptop. Maybe most of Vista's problems will be fixed by then. One can hope anyways.
Apparently Korea's banking system has already suffered sporadic computer failures. Vista's security restrictions are causing the gaming problems.
Microsoft took out an option allowing easy upgrades from one version of Windows to a newer version. Apparently now in order to upgrade to Vista, you need an old version installed first. So if your hard drive with XP crashes you can't just upgrade to Vista while you're fixing everything. First you have to reinstall XP & then upgrade to Vista. That's a pain in the butt.
Well, here's a link to a Vista guide if you do decide to upgrade. I may wait until the spring before buying my laptop. Maybe most of Vista's problems will be fixed by then. One can hope anyways.
Wednesday, February 21, 2007
SVG, Apache Batik
The Java Drawing with Apache Batik tutorial book I ordered from Amazon arrived, very fast by the way. It seems pretty good. I think it is a must have for anybody starting out with batik. I'm only half way through, but so far I'm glad I bought it. Examples are good. Covers the main parts of Batik: Generator, Transcoder, PrettyPrinter, JSVGCanvas. Also covers DOM, how to save to a file. Doesn't seem to do much with glyphs though or get into how to use it in specific areas such as GIS. Although I'm not finished yet, so maybe in later chapters. Here's the table of contents:
Introduction
Chapter 1 Getting Started with Batik
Batik Overview
Batik in Real World Projects
Your First SVG Document
Using SVG Rasterizer
Using Pretty-Printer
What Else Comes with Batik?
Summary
Chapter 2 Creating SVG
Drawing in Java
Using SVG Creator
Other Features of SVG Generator
Summary
Chapter 3 Viewing SVG
Displaying Generated SVG Documents
JSVGCanvas Interactivity
Saving the Generated Document
Displaying an SVG File
Summary
Chapter 4 Working with Transcoders
The Transcoder API
Using Transcoders in Applications
Setting the Area of Interest
Using the SVGTranscoder for Pretty Printing
The Enhanced Version of the SVG File Viewer
Summary
Chapter 5 Document Object Model
SVG Document as a DOM Tree
Creating Documents with the DOM API
Building an SVG Document
Working with Gradients
Using the DOM API
Other Thoughts
Summary
Chapter 6 Working with Text and Fonts
Using the text Element
SVG Fonts
Using the Font Converter
Using SVG Fonts in a Document
Text Workbench: SVG Writer
Text Elements, Text Nodes, and Text Content
Characters Positioning
Using tspan elements
Text Layout
Text on A Path
Text Selection
Summary
Chapter 7 Batik on the Server Side
The SVG Graph Web Application
SVG Filter Effects
SVG Filters Web Application
Summary
Chapter 8 Batik Interactive
SVG and Scripts
Interactivity
Animation
Scripting Alternatives
Using Java for Scripting
Adding Animation 205 Summary
Appendix A Introduction to XML
Benefits of XML
Well-Formed XML Documents
Validating XML Documents
Related XML Resources
Appendix B Introduction to JavaScript
Your First Script
Variables
Arrays
Operators
Loops
Branching in JavaScript
Functions
Objects
and a description:
This guide to Apache Batik, the Java library that can be used to read SVG files and translate the instructions in the files into graphics, shows how Batik can also be used to save the graphics as JPEG, TIFF, PNG, GIF, and other formats, so that the graphics can be transferred. Using Batik to create animation similar to Flash movies and its use for creating a drawing program such as Corel DRAW are also covered.
Scalable Vector Graphics (SVG) is an XML-based language for describing two-dimensional vector graphics and vector/raster graphics. The SVG specification describes in great detail how different shapes can be created, manipulated, transformed, and animated. In particular, SVG 1.1 defines:
Basic shape elements such as rectangle, circle, ellipse, line, polyline, and polygon.
Basic data types, such as integer, number, length, and angle.
The structure of an SVG document.
How to apply styles in an SVG document.
How to deal with text and how to use fonts.
How to work with colors, gradients, and patterns.
How and in which order elements should be rendered.
Which filter effects should be available and how to apply them.
How to animate images.
Apache Batik is a free and open-sourced implementation of SVG. It comes with tools and sample applications that demonstrate the power of SVG and Batik. This book is an easy-to-read tutorial on Batik. It teaches you how to use the tools in Batik and gets you started with Batik programming. In addition, it explains the following topics:
Batik implementation of the SVG specification
Batik API
SVG viewer
Transcoder and image format transcoding
Rasterizer
Document Object Model API
Text and fonts
Using Batik on the server side
Interactivity
Animation
Gradients
Filter effects
This info was taken from here.
Yes, I was able to get batik to draw a polygon, using an svg as the stroke and to do it correctly, not with the fill setting.
What you do is, first create a skeleton svg which contains a script to get the paths, calculate each path length, get the width of the svg you want to use as stroke. Divide path length by that to get the number of glyphs & then do a loop creating the glyph string.
?xml version="1.0" standalone="no"?>
!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
svg onload="load(evt)" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
script type="text/ecmascript">![CDATA[
var svgNS = "http://www.w3.org/2000/svg";
function load(evt)
{
var doc = evt.target.ownerDocument;
var geometryGroup = doc.getElementById("geometryGroup");
var pathList = geometryGroup.getElementsByTagNameNS(svgNS, "path");
var numPaths = pathList.length;
for (var i = 0; i < numPaths; i++)
{
var path = pathList.item(i);
var pathLength = path.getTotalLength();
//var pt = path.getPointAtLength(dist);
var glyphDefs = doc.getElementById("glyphDefs");
var symbolSVG = glyphDefs.getElementsByTagNameNS(svgNS, "svg").item(0);
var widthAttribute = symbolSVG.getAttributeNS(null, "width");
var patternWidth = parseFloat(widthAttribute.substring(0, widthAttribute.length - 2));
var numGlyphs = Math.floor((pathLength / patternWidth) * 2);
var glyphsStr = "";
for (var j = 0; j <= numGlyphs; j++)
{
glyphsStr += "A";
}
var glyphTextPath = document.getElementById("glyphTextPath" + i);
glyphTextPath.appendChild(document.createTextNode(glyphsStr));
}
}
]]>/script>
defs id="glyphDefs">
font id="myFont">
font-face font-family="myFont"/>
missing-glyph/>
glyph unicode="A">
g>
use/>
/g>
/glyph>
/font>
/defs>
g id="geometryGroup">
/g>
Using batik, you create a group for each path, add that info to the skeleton svg using the dom, add the svg you want to use as the stroke to the defs section, fill in units-per-em & horiz-adv-x info & any other missing info. Add that to the canvas & draw. Very cool.
This site is also invaluable.
Introduction
Chapter 1 Getting Started with Batik
Batik Overview
Batik in Real World Projects
Your First SVG Document
Using SVG Rasterizer
Using Pretty-Printer
What Else Comes with Batik?
Summary
Chapter 2 Creating SVG
Drawing in Java
Using SVG Creator
Other Features of SVG Generator
Summary
Chapter 3 Viewing SVG
Displaying Generated SVG Documents
JSVGCanvas Interactivity
Saving the Generated Document
Displaying an SVG File
Summary
Chapter 4 Working with Transcoders
The Transcoder API
Using Transcoders in Applications
Setting the Area of Interest
Using the SVGTranscoder for Pretty Printing
The Enhanced Version of the SVG File Viewer
Summary
Chapter 5 Document Object Model
SVG Document as a DOM Tree
Creating Documents with the DOM API
Building an SVG Document
Working with Gradients
Using the DOM API
Other Thoughts
Summary
Chapter 6 Working with Text and Fonts
Using the text Element
SVG Fonts
Using the Font Converter
Using SVG Fonts in a Document
Text Workbench: SVG Writer
Text Elements, Text Nodes, and Text Content
Characters Positioning
Using tspan elements
Text Layout
Text on A Path
Text Selection
Summary
Chapter 7 Batik on the Server Side
The SVG Graph Web Application
SVG Filter Effects
SVG Filters Web Application
Summary
Chapter 8 Batik Interactive
SVG and Scripts
Interactivity
Animation
Scripting Alternatives
Using Java for Scripting
Adding Animation 205 Summary
Appendix A Introduction to XML
Benefits of XML
Well-Formed XML Documents
Validating XML Documents
Related XML Resources
Appendix B Introduction to JavaScript
Your First Script
Variables
Arrays
Operators
Loops
Branching in JavaScript
Functions
Objects
and a description:
This guide to Apache Batik, the Java library that can be used to read SVG files and translate the instructions in the files into graphics, shows how Batik can also be used to save the graphics as JPEG, TIFF, PNG, GIF, and other formats, so that the graphics can be transferred. Using Batik to create animation similar to Flash movies and its use for creating a drawing program such as Corel DRAW are also covered.
Scalable Vector Graphics (SVG) is an XML-based language for describing two-dimensional vector graphics and vector/raster graphics. The SVG specification describes in great detail how different shapes can be created, manipulated, transformed, and animated. In particular, SVG 1.1 defines:
Basic shape elements such as rectangle, circle, ellipse, line, polyline, and polygon.
Basic data types, such as integer, number, length, and angle.
The structure of an SVG document.
How to apply styles in an SVG document.
How to deal with text and how to use fonts.
How to work with colors, gradients, and patterns.
How and in which order elements should be rendered.
Which filter effects should be available and how to apply them.
How to animate images.
Apache Batik is a free and open-sourced implementation of SVG. It comes with tools and sample applications that demonstrate the power of SVG and Batik. This book is an easy-to-read tutorial on Batik. It teaches you how to use the tools in Batik and gets you started with Batik programming. In addition, it explains the following topics:
Batik implementation of the SVG specification
Batik API
SVG viewer
Transcoder and image format transcoding
Rasterizer
Document Object Model API
Text and fonts
Using Batik on the server side
Interactivity
Animation
Gradients
Filter effects
This info was taken from here.
Yes, I was able to get batik to draw a polygon, using an svg as the stroke and to do it correctly, not with the fill setting.
What you do is, first create a skeleton svg which contains a script to get the paths, calculate each path length, get the width of the svg you want to use as stroke. Divide path length by that to get the number of glyphs & then do a loop creating the glyph string.
?xml version="1.0" standalone="no"?>
!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
svg onload="load(evt)" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
script type="text/ecmascript">![CDATA[
var svgNS = "http://www.w3.org/2000/svg";
function load(evt)
{
var doc = evt.target.ownerDocument;
var geometryGroup = doc.getElementById("geometryGroup");
var pathList = geometryGroup.getElementsByTagNameNS(svgNS, "path");
var numPaths = pathList.length;
for (var i = 0; i < numPaths; i++)
{
var path = pathList.item(i);
var pathLength = path.getTotalLength();
//var pt = path.getPointAtLength(dist);
var glyphDefs = doc.getElementById("glyphDefs");
var symbolSVG = glyphDefs.getElementsByTagNameNS(svgNS, "svg").item(0);
var widthAttribute = symbolSVG.getAttributeNS(null, "width");
var patternWidth = parseFloat(widthAttribute.substring(0, widthAttribute.length - 2));
var numGlyphs = Math.floor((pathLength / patternWidth) * 2);
var glyphsStr = "";
for (var j = 0; j <= numGlyphs; j++)
{
glyphsStr += "A";
}
var glyphTextPath = document.getElementById("glyphTextPath" + i);
glyphTextPath.appendChild(document.createTextNode(glyphsStr));
}
}
]]>/script>
defs id="glyphDefs">
font id="myFont">
font-face font-family="myFont"/>
missing-glyph/>
glyph unicode="A">
g>
use/>
/g>
/glyph>
/font>
/defs>
g id="geometryGroup">
/g>
Using batik, you create a group for each path, add that info to the skeleton svg using the dom, add the svg you want to use as the stroke to the defs section, fill in units-per-em & horiz-adv-x info & any other missing info. Add that to the canvas & draw. Very cool.
This site is also invaluable.
Monday, February 19, 2007
IrfanView
IrfanView. This is a free image viewing program I have been using for a very long time. I mainly use it to crop and resize images and to batch convert one image form to another. Many image types are supported, too many to list. Apparently you can also create slideshows and use it as a multimedia player. Great product and it's free.
Here's a tip. See an image you like? Ctrl+prt screen will copy into memory the active window. Ctrl+V into IrfanView. will paste the active screen, allowing you to save or crop & edit as you wish.
Here's a tip. See an image you like? Ctrl+prt screen will copy into memory the active window. Ctrl+V into IrfanView. will paste the active screen, allowing you to save or crop & edit as you wish.
Wednesday, February 14, 2007
Apache Batik, Element ID, Width value
Using Apache Batik & need to get the ID of an element? Try doing this:
// Get ID of first g element
NodeList gElements = symbolSVGRoot.getElementsByTagNameNS(svgNS, "g");
Element firstGElement = (Element)gElements.item(0);
String gID = firstGElement.getAttribute("id");
Need to get the width value of the svg element? Try doing this:
String widthAttribute = symbolSVGRoot.getAttribute("width");
If the value has units specified, such as mm, do this to get the actual value:
String patternWidth = widthAttribute.substring(0, widthAttribute.length()-2);
Now to figure out my next problem:
How to use Batik to get the total length of a path. Apparently you can use SVGPathElement.getTotalLength, but it's just not working for me yet.
// Get ID of first g element
NodeList gElements = symbolSVGRoot.getElementsByTagNameNS(svgNS, "g");
Element firstGElement = (Element)gElements.item(0);
String gID = firstGElement.getAttribute("id");
Need to get the width value of the svg element? Try doing this:
String widthAttribute = symbolSVGRoot.getAttribute("width");
If the value has units specified, such as mm, do this to get the actual value:
String patternWidth = widthAttribute.substring(0, widthAttribute.length()-2);
Now to figure out my next problem:
How to use Batik to get the total length of a path. Apparently you can use SVGPathElement.getTotalLength, but it's just not working for me yet.
Tuesday, February 13, 2007
Apache Batik, VMWare Workstation
Ah ha, I figured out why I couldn't get apache batik to draw. In the java code, I was adding a child element to the wrong parent. Did discover batik doesn't support the textpath method=stretch feature and the font-face font-stretch feature. That sucks. For the most part, what I'm getting looks good, but there's either a gap or an overhang due to not being able to stretch the glyph. Let's hope at least one of those features becomes available in a future batik release.
Oh, and I discovered the batik mail archive is searchable at a different link than what's given at the batik site. Try this site or this site. What a puzzle. Thank goodness for the internet. I really hope the batik tutorial book I ordered is useful.
VMWare Workstation. One of the best tools ever. It's an application which lets you run one operating system on another. For example, I have the windows version of vmware. Inside that I can run linux, solaris, or another version of windows. I can run multiple operating systems at once too, share files between windows & linux, access the internet. It's awesome! Pretty cheap too, for what it does. There's a free VMWare Player available which gives you an idea what VMWare Workstation does. Check it out if you're interested in running linux, but also want to use windows, or vice versa. If you're a developer, it comes in really handy testing your applications on multiple platforms. One thing to note: solaris support is still limited.
Oh, and I discovered the batik mail archive is searchable at a different link than what's given at the batik site. Try this site or this site. What a puzzle. Thank goodness for the internet. I really hope the batik tutorial book I ordered is useful.
VMWare Workstation. One of the best tools ever. It's an application which lets you run one operating system on another. For example, I have the windows version of vmware. Inside that I can run linux, solaris, or another version of windows. I can run multiple operating systems at once too, share files between windows & linux, access the internet. It's awesome! Pretty cheap too, for what it does. There's a free VMWare Player available which gives you an idea what VMWare Workstation does. Check it out if you're interested in running linux, but also want to use windows, or vice versa. If you're a developer, it comes in really handy testing your applications on multiple platforms. One thing to note: solaris support is still limited.
Friday, February 9, 2007
Batik Tutorial, Dell Small Business 360
So I ordered the batik tutorial book from Amazon. I hope it comes soon because it's a pain in the butt trying to figure things out without a good tutorial. After wasting all day debugging, it looks like batik doesn't like my custom font-family definition. Syntax looks fine, function calls seem. Just don't know yet what's wrong.
Dell has opened a free small business advice site. Has links to dell forums, info on starting a business. Seems like it might be useful once it gets going. You can check it out here.
Dell has opened a free small business advice site. Has links to dell forums, info on starting a business. Seems like it might be useful once it gets going. You can check it out here.
Thursday, February 8, 2007
Glyphs along a path, Apache Batik, SVG, Memory test
Finally got glyphs along a path working using hard coded values in an svg. Now I have to port it to batik to make things dynamic. Having problems so far. The svg has been ported over using all the hard coded values, but the applet won't init. I've got things narrowed down & it appears to have something to do with the textPath. I really wish you could search the apache batik mailing list. If anyone knows how, please let me know, maybe I'm missing something.
I did discover the syntax needed when nesting an svg within a defs statement:
defs.appendChild(internalSVGDoc.importNode(symbolDoc.getRootElement(), true));
Somebody really needs to write an in depth batik book or tutorial on how calls such as this are made. The batik javadoc is useless for beginners. Us beginners need to know how to put calls together. We need links to dom tutorials. Something good to get us started. It's tough putting pieces together.
Wow, I spoke too soon. This book at Amazon is finally available. Woohoo, guess I know what I'll be ordering next. Looks like it is going fast, only 3 left in stock.
If you are in need of more memory for your computer, check out this site. It will analyze your system & tell you how much memory you have & how much more you could add. Pretty cool. I have a gig, but could max out at 4 gig. The more memory, the better. Definitely a worthwhile investing if you're planning on keeping your machine for a while.
I did discover the syntax needed when nesting an svg within a defs statement:
defs.appendChild(internalSVGDoc.importNode(symbolDoc.getRootElement(), true));
Somebody really needs to write an in depth batik book or tutorial on how calls such as this are made. The batik javadoc is useless for beginners. Us beginners need to know how to put calls together. We need links to dom tutorials. Something good to get us started. It's tough putting pieces together.
Wow, I spoke too soon. This book at Amazon is finally available. Woohoo, guess I know what I'll be ordering next. Looks like it is going fast, only 3 left in stock.
If you are in need of more memory for your computer, check out this site. It will analyze your system & tell you how much memory you have & how much more you could add. Pretty cool. I have a gig, but could max out at 4 gig. The more memory, the better. Definitely a worthwhile investing if you're planning on keeping your machine for a while.
Tuesday, February 6, 2007
Microsoft, Zip software, Download.com
Did you know Microsoft automatically sets aside 20% of your bandwidth for things such as windows updates? I didn't either until I read it here. I did what the post said to, but I haven't really noticed any difference in my connection speed. It's worth a try though.
I've been using winzip for a long time & it's always been free. Well, no longer. The last upgrade I did now says my 45 day trial has expired & I can no longer unzip files with it. I am now in search of a free zip program. So far I have tried coffee cup. That's a pain because you have to restart the application for every new zip file you want to open. 7-Zip looked good until I needed to unzip a file in the top level Desktop/MyDocuments directory. It wasn't listed, just C:\ so I had to dig down to find the file. If anyone has any recommendations, let me know. I'll have to visit download.com and see what else they have. By the way, that is the best site for downloads. They have everything you need in terms of free software. The software is also free of viruses, spyware, etc. Great site.
I've been using winzip for a long time & it's always been free. Well, no longer. The last upgrade I did now says my 45 day trial has expired & I can no longer unzip files with it. I am now in search of a free zip program. So far I have tried coffee cup. That's a pain because you have to restart the application for every new zip file you want to open. 7-Zip looked good until I needed to unzip a file in the top level Desktop/MyDocuments directory. It wasn't listed, just C:\ so I had to dig down to find the file. If anyone has any recommendations, let me know. I'll have to visit download.com and see what else they have. By the way, that is the best site for downloads. They have everything you need in terms of free software. The software is also free of viruses, spyware, etc. Great site.
Monday, February 5, 2007
Glyphs and TextPath, Open Office
Got some good tips from the batik users group mailing list on how to solve my pattern along a path problem. One tip involves using glyphs and textPaths thanks to Andreas Neumann. Here's an example. Played around a bit & have gotten the basic idea working, need to tweak it though as far as glyph spacing. The other tip involves markers. Haven't tried it yet though. SVG is very cool. There's a ton of stuff you can do with it. One bad thing is you can't link to an external svg element. Say you have a moon defined in one svg. You can't link directly to that moon element from another svg. SVG is still evolving though, so maybe in a future release that will be supported.
When I get my income tax check, I'm planning on buying myself a laptop. Not sure yet what I'm going with though. My desktop is a Dell I bought a little over a year ago. Adding Microsoft Office was an extra couple hundred dollars. I was on a budget, so I went with Microsoft Works Suite. That includes Microsoft Word. The spreadsheet program doesn't support tabbed worksheets though. For me, that's a problem. I decided to look into open office. It's free, I think open source too. That is a great product. It includes programs which are similar to word, excel, power point, access. The spreadsheet program also supports tabbed worksheets. These imitation programs seem to do pretty much what the more expensive programs do, so when I get my laptop I don't think I will even bother with Works Suite. I'm just going to download the latest free, version of open office and save myself some money. Some of the best software is free. Stay tuned for links to other useful free software.
When I get my income tax check, I'm planning on buying myself a laptop. Not sure yet what I'm going with though. My desktop is a Dell I bought a little over a year ago. Adding Microsoft Office was an extra couple hundred dollars. I was on a budget, so I went with Microsoft Works Suite. That includes Microsoft Word. The spreadsheet program doesn't support tabbed worksheets though. For me, that's a problem. I decided to look into open office. It's free, I think open source too. That is a great product. It includes programs which are similar to word, excel, power point, access. The spreadsheet program also supports tabbed worksheets. These imitation programs seem to do pretty much what the more expensive programs do, so when I get my laptop I don't think I will even bother with Works Suite. I'm just going to download the latest free, version of open office and save myself some money. Some of the best software is free. Stay tuned for links to other useful free software.
Friday, February 2, 2007
Apache Batik
I'm currently using Apache Batik to draw an svg in the browser window. Part of what I need to do is create a pattern for an area using a third party svg. I was having problems creating the image tag in batik. Apparently for images you need to explicitly set the namespace for the attribute like this:
Element image = document.createElementNS("http://www.w3.org/2000/svg","image");
image.setAttributeNS(null,"width",imageWidth);
image.setAttributeNS(null,"height",imageWidth);
image.setAttributeNS("http://www.w3.org/1999/xlink","href","name.svg");
parentGroup.appendChild(image); //parentGroup needs to be an existing
node reference to a group where the images should be appended
Cool. Works now, just wish I could find a site with some good advanced batik tutorials. Like where do I find info that tells me images need the namespace explicitly set. The batik site has a few tutorials, but are basically getting started tutorials. BTW, the Apache Batik site has been re-designed. I definitely like it better than the old design.
Element image = document.createElementNS("http://www.w3.org/2000/svg","image");
image.setAttributeNS(null,"width",imageWidth);
image.setAttributeNS(null,"height",imageWidth);
image.setAttributeNS("http://www.w3.org/1999/xlink","href","name.svg");
parentGroup.appendChild(image); //parentGroup needs to be an existing
node reference to a group where the images should be appended
Cool. Works now, just wish I could find a site with some good advanced batik tutorials. Like where do I find info that tells me images need the namespace explicitly set. The batik site has a few tutorials, but are basically getting started tutorials. BTW, the Apache Batik site has been re-designed. I definitely like it better than the old design.
Thursday, February 1, 2007
Inkscape, Sketsa 4.0
So I downloaded the latest .45 pre-release version of Inkscape, so I could check out the pattern along path option. Drop down options in dialog box are empty, do some searching & turns out you'll need to edit pathalongpath.inx in the share/extensions subdirectory of your installation directory. Change all _item values to item and restart Inkscape if running. Voila, options. Played around a bit, seems to do what I need. Looks like the source code to do it is included in the download in pathalongpath.py. It's a python script. Took a look. Hard to decode, but looks like it's doing what I thought you'd need to do. Divide the path into small pieces, rotate, translate your symbol along the path. The key part, use a group for the symbol, which is what these 3rd party svg's I have use. I think I can do it, but I need to play around a little more.
The latest version of the svg graphics editor, Sketsa 4.0 has been released. I've got the old version. It's a good tool, but you need java 1.5 in order to install it.
The latest version of the svg graphics editor, Sketsa 4.0 has been released. I've got the old version. It's a good tool, but you need java 1.5 in order to install it.
Wednesday, January 31, 2007
Inkscape, CNET
Apparently the new version of Inkscape, .45, has a menu option to draw a pattern along a path. Exactly what I've been trying to do, except I need to be able to code it. There is a pre-release version of .45 available, so I'm going to download it & maybe I can figure out how they are doing it. I've kind of got an idea of how to do it, but I'm hoping there's an easier way.
Am looking forward to CNET's Wireless Basics course. Hopefully I'll learn how to share files between my laptop and desktop using the wiflyer. Right now I'm taking a pc gaming course. Pretty interesting. Here are a couple of useful sites which check to see how good your computer system is for gaming: Gamespot and Futuremark.
Remember, these courses are free, except for your time. There are a variety of courses. They are not the most in depth, but do contain useful info.
Am looking forward to CNET's Wireless Basics course. Hopefully I'll learn how to share files between my laptop and desktop using the wiflyer. Right now I'm taking a pc gaming course. Pretty interesting. Here are a couple of useful sites which check to see how good your computer system is for gaming: Gamespot and Futuremark.
Remember, these courses are free, except for your time. There are a variety of courses. They are not the most in depth, but do contain useful info.
Monday, January 29, 2007
SVG, Line, Symbol
Ok, so I have a symbol and a line. I want to use the symbol as the stroke of the line to create an svg. No problem, create a pattern using the symbol and set the stroke to the pattern. Seems easy enough, but no go, it doesn't work right. The symbol needs to follow the curve of the path. As the line changes directions, the symbol needs to also change it's direction. The symbol needs to outline the curve of the path. So, anyone have any ideas as to how to do that? That will be my research topic for tomorrow.
By the way, Windows Vista is on sale tomorrow atAmazon.
By the way, Windows Vista is on sale tomorrow atAmazon.
Thursday, January 25, 2007
Windows Vista, Applet, Toast.net, Wiflyer
Now available for prelaunch at Amazon is Windows Vista and its full line of Office 2007 products which will be launching on January 30. I'm planning on buying myself a laptop and debated whether I should get one now with XP installed or wait and get one with Vista installed. If I got one now, I could get a free upgrade to Vista, but installing an operating system scares me, so I'm waiting until Vista comes out. I'm interested in seeing what it's like. Security features should be better and menus for the office products will be completely different. Not sure what else, but should be interesting to see reviews.
So my svg, batik project, I built an applet on a laptop running java 1.4.2_09. Bring it over to my desktop running java 1.5.0_09 and it won't init. In the jsp which calls the applet, I was using ./ before the codebase path and archive jar file paths. Once I removed all instances of ./, the applet ran beautifully under java 1.5.0_09. Strange.
By the way, the wiflyer is still awesome. I haven't been able to connect at a speed greater than 26400 bps though. Still have other settings to try though. You can buy the wiflyer here or at Amazon.
Has anyone tried the dial up isp toast.net? Speed tests at cnet list it as being the fastest dial up isp. Reviews are good and it has a lot of access numbers in my area. Cheaper than netzero too. One drawback though is the terms say plans are not meant for always on access. Connections idle for 30 minutes or lasting more than 4 hours will be dropped. Yet the plans include unlimited access. Doesn't sound very unlimited to me if you can't leave your connection on as long as you want to, which is what I do. Guess this isn't the best isp for me. I don't know if toast.net is compatible with the wiflyer either.
So my svg, batik project, I built an applet on a laptop running java 1.4.2_09. Bring it over to my desktop running java 1.5.0_09 and it won't init. In the jsp which calls the applet, I was using ./ before the codebase path and archive jar file paths. Once I removed all instances of ./, the applet ran beautifully under java 1.5.0_09. Strange.
By the way, the wiflyer is still awesome. I haven't been able to connect at a speed greater than 26400 bps though. Still have other settings to try though. You can buy the wiflyer here or at Amazon.
Has anyone tried the dial up isp toast.net? Speed tests at cnet list it as being the fastest dial up isp. Reviews are good and it has a lot of access numbers in my area. Cheaper than netzero too. One drawback though is the terms say plans are not meant for always on access. Connections idle for 30 minutes or lasting more than 4 hours will be dropped. Yet the plans include unlimited access. Doesn't sound very unlimited to me if you can't leave your connection on as long as you want to, which is what I do. Guess this isn't the best isp for me. I don't know if toast.net is compatible with the wiflyer either.
Wednesday, January 24, 2007
CNET classes
If you are interested in increasing your computer knowledge, CNET classes are a great way to start. So far I've taken a couple about digital photography, search engine marketing, and combating spyware & adware. The classes aren't very in depth, but they give you a good overview with tips and links to relevant websites and applications. I just signed up for wireless basics and playing games on your pc. One upcoming one I will be signing up for is about making money online. Each course lasts 2 weeks and has 6 lessons. At the end of each lesson, you receive an email with an assignment. Basically you just have to post your answers to each question for that lesson. At the end of the course, you get a certificate to download. I don't think they check if you don't complete assignments. I was enrolled in one around the holidays & just didn't have time to do the assignments. Nobody seemed to notice.
Tuesday, January 23, 2007
Wiflyer
Well, the Wiflyer I ordered came today and it is awesome! A wireless internet connection using dial up. So cool! I was amazed at how small the wiflyer is. It's about 3" x 5" x 3/4". Small and compact. All you do is plug it in to an electrical outlet and plug in the supplied phone cord to the phone jack on the wall. My laptop automatically detected wiflyer's wireless network. One thing to make sure of is to close all mail applications such as eudora, outlook etc. and close all browsers and reboot just to be safe. Next, you open up a web browser. It automatically takes you to the wiflyer configuration page where you choose your isp, access number, isp username and password. Save that & hit dial. One thing to note, when you select an access number from the supplied list, the number dialed will include the area code. I couldn't get through, so once I deleted the area code I was able to connect. One thing I like is, the wiflyer tells you at what speed you are connected. The wiflyer has an init string with some predefined values for tweaking the speed. I need to play around with it some more. The fastest I could get was 19200. I only tried a couple of the options though, so I hope I can get it a little faster. It's still not bad though. Definitely usable.
I can't connect to the wiflyer using my desktop yet though. I have to install a network card. I bought a $15 wired card at Walmart. I bought a wired card only because my desktop and wiflyer are in the same location & I don't forsee moving either one. You never though, someday I may need to break down & get a wireless card.
Anyways, if you are stuck with dial up & want to go wireless, I highly recommend the wiflyer.
I can't connect to the wiflyer using my desktop yet though. I have to install a network card. I bought a $15 wired card at Walmart. I bought a wired card only because my desktop and wiflyer are in the same location & I don't forsee moving either one. You never though, someday I may need to break down & get a wireless card.
Anyways, if you are stuck with dial up & want to go wireless, I highly recommend the wiflyer.
Subscribe to:
Posts (Atom)