This summer, I worked on a project that required the usage of Google Visualizations. At first, by looking at the way the javascript was set up, it looked very easy! But.... I pretty much got blindsided with a brick to the face.. :(
The main problem I had with Google Vis, is the inability to change different aspects of the graph that you would think would be the easiest to change. It turns out, some parts like the label, horizontal axis title, font size... etc cannot be changed! I tried so many different ways but ended up with nothing :( Eventually, I just added the titles and labels using html. I guess it kinda disappointed me.
Another part that I thought was weird is when my website tried to shuffle through multiple divs, with google visualization attached to it. Some of the google visualization didn't work! I used Jquery to make a container for several divs. Whats interesting is that the ones that worked... worked perfectly.
Here is the container that I used:
$('container').addClass('js');
$(function() {
var timer = setInterval( showDiv, 2000);
var counter = 1;
function showDiv() {
$('div','#container')
.stop()
.hide()
.filter( function() { return this.id.match('div' + counter); })
.load()
.show('fast');
counter == 8? counter = 1 : counter++;
}
});
The code above is awesome if you want to do quick changes between divs.
Anywho, Google Visualization disappointed more than it impressed. However, it is still a great API to used in any website. Just for the purposes of a building a billboard... it may not be the best. I recommend playing around with the Google Playground. Its a great feature imo.
That is my rant for now. Thank you for listening :)
-TK
Punch Start
Wednesday, September 8, 2010
Friday, September 3, 2010
log4j
When I first tried to implement this, my mind was about to explode. The tutorials for these seem rather complex for first time users. Anywho, the main reason I wanted to implement this API was to have a log of what the user did to the database in the application. It's kind of embarrassing to say how long it took me to set that up. I would say it took at least 2-3 hours. First the installation was confusing, according to a website, you needed to download the whole folder into the src directory and link that folder to the application. In the end, all I had to do is add the .jar file to the build path! Then the properties file..... ooooh the properties file.. by taking one look at it, I feel like most people would think its jibberish. Just like any programming language, I pushed through and figured out how to make a log file for the program. It came out to be something in the lines of :
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.FileAppender
log4j.appender.stdout.File=log.log
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} : %L - %m%n
log4j.rootLogger=debug, stdout
I am very happy with the results. The part that I love about the log4j aside from the setting up and writing the properties is the ease of usage in the program. It takes one line to set up the logger which is:
private static org.apache.log4j.Logger log = Logger.getLogger("classname");
and bam! now log.info("blah");
The information is logged into the log!
I should probably look more into how the layout can be changed....
But for now, I am done.
Peace out!
Taka
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.FileAppender
log4j.appender.stdout.File=log.log
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} : %L - %m%n
log4j.rootLogger=debug, stdout
I am very happy with the results. The part that I love about the log4j aside from the setting up and writing the properties is the ease of usage in the program. It takes one line to set up the logger which is:
private static org.apache.log4j.Logger log = Logger.getLogger("classname");
and bam! now log.info("blah");
The information is logged into the log!
I should probably look more into how the layout can be changed....
But for now, I am done.
Peace out!
Taka
Wednesday, September 1, 2010
JSwing
I never thought that I would use JSwing in any of my applications but this summer, JSwing has been my bamboo.
I love how easy it is to create Swing applications using GUI components. I have used it in four applications so far; 2 very simple and 2 somewhat complicated. The main purpose of the 2 very simple applications were to parse information from a certain file and convert it into another. With JSwing, I added a console that can help the user figure out where in the file the program is currently looking at. I felt like the idea was good, however, the program parsed the file in couple seconds.....so the console was useless :( ....maybe if they try to parse a much LARGER file..... Anywho, the only thing that disappoints me about JSwing is the inability to use undo action on JTables. The two complicated project uses JTable to communicate with the information and I saw that one of them needed an undo function. After 30 minutes of searching for a solution, I ended up creating my own version that would undo anything except creating a row and deleting a row.
Overall, I feel like JSwing is a very important part of learning how to use Java. If anyone is starting to use Java I recommend looking into it.
Taka, out.
I love how easy it is to create Swing applications using GUI components. I have used it in four applications so far; 2 very simple and 2 somewhat complicated. The main purpose of the 2 very simple applications were to parse information from a certain file and convert it into another. With JSwing, I added a console that can help the user figure out where in the file the program is currently looking at. I felt like the idea was good, however, the program parsed the file in couple seconds.....so the console was useless :( ....maybe if they try to parse a much LARGER file..... Anywho, the only thing that disappoints me about JSwing is the inability to use undo action on JTables. The two complicated project uses JTable to communicate with the information and I saw that one of them needed an undo function. After 30 minutes of searching for a solution, I ended up creating my own version that would undo anything except creating a row and deleting a row.
Overall, I feel like JSwing is a very important part of learning how to use Java. If anyone is starting to use Java I recommend looking into it.
Taka, out.
Subscribe to:
Posts (Atom)