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.

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.

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.

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.

SVG Programming: The Graphical Web, WiFlyer

Well, SVG Programming: The Graphical Web by Kurt Cagle seems to be a pretty useful book in learning svg. My only complaint, I wish the pictures were in color. There’s a section which talks about how to create colors with several examples. The example pictures are pretty useless since they are black & white. The info itself seems pretty good though.

I have a dial up connection using Netzero’s 3g highspeed. After installing TZConnectionBooster & CableNut, the connection speed is not bad. I still have room to make it faster, but am leaving it for now. I have a desktop & a laptop, so now I decided I wanted to network them. Did some research & it sounded like a real pain in the butt. Then I came across a router, external modem, access point all rolled into one device. What is this cool device? It’s the wiflyer. Reviews I read were all good, so I ordered it over a week ago and am waiting for its arrival. Stayed tuned for my review.

Welcome, Apache Batik, SVG

Welcome to my tech tips blog!
I am a programmer and will mainly focus on new software information I learn in my day to day work. I will also post about any new, cool computer products I hear about and any other computer related information I find useful. Enjoy & feel free to leave comments any time.
Apache Batik, a toolkit for drawing svg in java. It also does other miscellaneous svg related things such as generating an svg or converting an svg to jpeg, gif or png. It’s very cool. All free and open source, my favorite kind of software. Ok, so I’ve been trying to define a stroke in svg, a line in java & use batik to draw the line using the defined stroke in a web browser. There’s very little online in terms of tutorials for batik. The batik site is about the only one for tutorials. Well, I managed to get it working. SVG is very cool! In the svg I created a cdata section, defining 3 strokes like this:
.black12 {stroke:rgb(0,0,0);stroke-width:12}
.yellow8 {stroke:yellow;stroke-width:8}
.red2 {stroke:red;stroke-width:2}
Then add a group section:
g id=”street”>
use xlink:href=”#geometry_path” class=”black12″ />
use xlink:href=”#geometry_path” class=”yellow8″ />
use xlink:href=”#geometry_path” class=”red2″ />
/g>

Note: < needs to be added to the front of each line. I'm having problems displaying the lines when I use <. In java, I create an applet in which I do the following: String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
String uri = getCodeBase()+”svg/stroke.svg”;
SVGDocument doc = (SVGDocument)f.createDocument(uri);

// get the root element (the svg element)
Element svgRoot = doc.getDocumentElement();

Element defs = doc.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, “defs”);

// create a line
Element line = doc.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, “line”);
line.setAttributeNS(null, “id”, “geometry_line”);
line.setAttributeNS(null, “x1”, “10”);
line.setAttributeNS(null, “y1”, “20”);
line.setAttributeNS(null, “x2”, “150”);
line.setAttributeNS(null, “y2”, “100”);

defs.appendChild(line);

// attach the rectangle to the svg root element
svgRoot.appendChild(defs);

svgCanvas = new JSVGCanvas();
// Set size of svg canvas
svgCanvas.setMySize(new Dimension(500, 500));
// Set background color of svg canvas
svgCanvas.setBackground(new Color(255, 255, 255));
svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
svgCanvas.setDoubleBufferedRendering(true);
svgCanvas.setSVGDocument(doc);

One thing I learned is the stroke id names can’t contain an underscore. Example black12 can’t be black_12. Interesting.
Anyways, if you’re interested in learning svg, check out this book:SVG Programming: The Graphical Web by Kurt Cagle. I just ordered and it seems pretty useful. I’m also thinking about ordering this book: Java Drawing with Apache Batik: A Tutorial by Alexander Kolesnikov, Budi Kurniawan, Paul Deck. Other than the batik site, this is the only other batik tutorial I have found. Please let me know if you know of any other batik books or sites.