Index - Tool Configuration
- AnyLogic 6 Mac Preferences screen (October 27, 2012)
- I am learning AJAX (September 24, 2012)
- No STARTTLS command has been given. (August 09, 2012)
- Sweet Hibernate links (July 11, 2012)
- RunTheModel.com (June 07, 2012)
- Java Comparator (March 26, 2012)
- Monte Carlo analysis in AnyLogic (March 17, 2012)
- Windows Server 2008 Ports (February 27, 2012)
- Constraint Programming with Java (February 25, 2012)
- MySQL privileges (February 24, 2012)
- How to obtain a node's prerequisite nodes (February 11, 2012)
- How to turn an AnyLogic population into a DAG (February 04, 2012)
- MySQL import (January 18, 2012)
- MySQL crazy symbol problems (January 11, 2012)
- AnyLogic and Databases (January 07, 2012)
- Apache Commons Java Statistical Sample Awesomeness (January 03, 2012)
- Anylogic and JPA (October 08, 2011)
- SequelPro cutting off LONGBLOB when I export (August 27, 2011)
- PL-PLAN, a Java Open-Source AI Planner (August 21, 2011)
- RedirectMatch (July 27, 2011)
- Example of Rustiness: SSH vs Samba in Terminal (June 14, 2011)
- JAXB, I love you (June 09, 2011)
- Apache htdocs folder on OSX (May 20, 2011)
- Buckets (May 15, 2011)
- iPod iTunes sync problem fixed (April 27, 2011)
- Apple Mail - "From" dropdown box (April 15, 2011)
- ssh and sftp:// (February 23, 2011)
- http_referer vs remote_host (February 14, 2011)
- Syntax highlighter (January 28, 2011)
- Can't even articulate this one (January 20, 2011)
- BUILD FAILED - ${tomcat.home} not found (January 18, 2011)
- SequelPro (December 28, 2010)
- MySQL installation (November 13, 2010)
- CoRD - Remote Desktop Client (September 26, 2010)
- JESS (September 17, 2010)
- Keener - class project (September 04, 2010)
- create jar file (August 12, 2010)
- Apache virtual hosts (August 04, 2010)
- Subversion errors (July 23, 2010)
- Adventures with ANT, Part 8 (July 09, 2010)
- Adventures with ANT, Part 7 (July 08, 2010)
- mysql connector (July 02, 2010)
- lost MySQL admin password (July 02, 2010)
- Adventures with ANT, Part 6 (June 28, 2010)
- My ANT series (June 28, 2010)
- Adventures with ANT, Part 5 (June 28, 2010)
- Adventures with ANT, Part 4 (June 28, 2010)
- Adventures with ANT, Part 3 (June 28, 2010)
- Adventures with ANT, Part 2 (June 25, 2010)
- Adventures with ANT, Part 1 (June 25, 2010)
- Tomcat filters (June 02, 2010)
- enabling PHP on my mac (April 04, 2010)
- Maven & Ant, II (March 08, 2010)
- Good Jersey links (March 08, 2010)
- My first Jersey app (March 01, 2010)
- Maven, Ant (March 01, 2010)
- Jersey (February 26, 2010)
- catching up: jQuery (February 22, 2010)
- Java versions in OSX (February 18, 2010)
- MovableType: Immediately publish comments from... (April 11, 2009)
- Microsoft Access and Temporary files (March 07, 2007)
- Filesystem permissions on LDB file: connection pooling and Tomcat clustering (February 03, 2007)
- BibTeX 101 (September 02, 2006)
- Adobe SVG Viewer on OS X - Intel Mac (April 16, 2006)
- Haystack on OS X Intel Mac (April 15, 2006)
- Broken Java applications on OS X - Intel Mac (April 08, 2006)
- Firefox - "Piggy Bank" plugin on Mac OS X (April 05, 2006)
October 27, 2012
AnyLogic 6 Mac Preferences screen
Hahaha! This got me stumped for about 20 minutes! LOL!
I wanted to adjust a setting on my AnyLogic 6 for Mac OS X. To do this, I had to go into the AnyLogic Preferences screen.
So, I went into the AnyLogic menu at the top of my screen then --> Preferences and nothing happened. I closed all my other windows and tried to figure out where the heck my Preferences window went. It was gone! I googled with nothing helpful.
Finally, I found that if you go under Tools --> there is ANOTHER Preferences option, and this one worked.
I think that Apple has documentation on how applications should work with OS X. I suspect this is a convention imposed by Apple but not recognized by AnyLogic. Apple thought that AnyLogic would put their Preferences screen under the AnyLogic menu (because that's where most OSX applications put their Preferences windows) but AnyLogic didn't do that, they put it under Tools.
Anyway, works now.
The whole reason I wanted to get into Preferences was because the Code Completion feature wasn't working on my AnyLogic. (I got a new computer so I had a new AnyLogic installation, and was trying to make the settings work how I'm used to.)
I figured out that my code completion wasn't working because it was set to Alt + Space instead of Control + Space.
Wheee!
|
Posted by Frozone Permalink on October 27, 2012 12:06 PM
| Comments (0)
|
|
| Tweet | |
September 24, 2012
I am learning AJAX
I just wanted to put these links somewhere I wouldn't forget. I guess I should learn to use delicious or something like that. Deja vu. OH well. Gotta run, here they are.
http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript
http://stackoverflow.com/questions/6182028/how-to-return-an-array-from-a-javascript-facebook-api-request
This one is awesome, too: It speaks EXACTLY to my "era", gently guiding me from early 00's technology into modern times...
http://www.ibm.com/developerworks/web/library/wa-ajaxintro2/
|
Posted by Frozone Permalink on September 24, 2012 02:27 PM
| Comments (0)
|
|
| Tweet | |
August 09, 2012
No STARTTLS command has been given.
I don't have much experience debugging SMTP. A colleage of mine (thanks GV!) figured out how to enable debugging so we could actually see the the SMTP transactions.
Anyway, this morning I was getting the SMTP error, "No STARTTLS command has been given."
I was like, um, dude, I am doing this:
props.put("mail.smtp.starttls.enable", "true");
But then the error went away when I deleted mail.jar from my build path, and made sure the path only contained mailapi.jar and smtp.jar. Go figure!!!
|
Posted by Frozone Permalink on August 09, 2012 12:57 PM
| Comments (0)
|
|
| Tweet | |
July 11, 2012
Sweet Hibernate links
A while ago, I learned about Jersey and started a blog post to keep track of links. (Hmm, perhaps i should get with the times and start using some kind of online bookmark management service?)
Until I figure that out, and as I focus on learning Hibernate, here's my collection of Hibernate links!
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html#tutorial-firstapp
This one is JPA, not hibernate, but related:
http://openjpa.apache.org/builds/1.2.3/apache-openjpa/docs/jpa_overview_persistence.html
|
Posted by Frozone Permalink on July 11, 2012 10:05 AM
| Comments (0)
|
|
| Tweet | |
June 07, 2012
RunTheModel.com
When you're working on a simulation model and are not sure how to do something, or whether something is even possible, sometimes what you really need is an example.
I just learned about this site on the AnyLogic newsletter -- this looks AWESOME and may satisfy my ravenous cravings for examples of simulation models!!!
|
Posted by Frozone Permalink on June 07, 2012 12:28 PM
| Comments (0)
|
|
| Tweet | |
March 26, 2012
Java Comparator
I am lovin this today:
(i.e. lovin' both the javadeveloper tutorial site as well as the java.util.Comparator itself -- howcome I didn't know about this before? LOL)
http://www.javadeveloper.co.in/java-example/java-comparator-example.html
|
Posted by Frozone Permalink on March 26, 2012 02:59 PM
| Comments (0)
|
|
| Tweet | |
March 17, 2012
Monte Carlo analysis in AnyLogic
I struggled for a long time to get my own Monte Carlo analysis working in AnyLogic. Here are the tricks I don't want to forget.
When you create a new experiment, be sure to pick the "Paramaters Variation" kind. This will let you set the number of replications you want (i.e. the number of times you want the simulation to run though and to average the results).
The other important part is to check out the Sample Model, "influenza", and look at the Advanced tab on the MonteCarlo experiment. See how they create a new dataSet after each run and fill the 2D dataset on the presentation stage? The 2D dataset, in turn, is hooked up to the grid display.
|
Posted by Frozone Permalink on March 17, 2012 12:25 PM
| Comments (0)
|
|
| Tweet | |
February 27, 2012
Windows Server 2008 Ports
At work, a colleague and I were having trouble making a database connection to our server. We had php files on a developer's localhost and the test database was on a development server. But we kept getting:
Lost connection to MySQL server at 'reading initial communication packet', system error: 110
I thought, hum, is that port even listening? So I opened up my terminal and did this:
telnet my.server.ca 3306
and of course I got, "Operation timed out" and "telnet: Unable to connect to remote host".
So I went to the Windows Server 2008 Server Manager to check on the port: Go under Configuration, Windows Firewall with Advanced Security, Inbound Rules. It confused me at first because this came up blank and I thought I was in the wrong spot, but after a minute or so all of our ports show up and you can click on MySQL on 3306. It says it allows TCP connections from anyone. So..... Dude, it says the ports are open. What gives?
And here is the answer. There is a magical other secret window with MORE port configurations. Thanks, Microsoft for this bizarre obscurity. Here is what you do.
1. Go to Run and type in "firewall.cpl"
2. Click on the Exceptions tab, click Add Port, type in MySQL is 3306 on TCP, then OK
3. It works now
Alas. :)
|
Posted by Frozone Permalink on February 27, 2012 09:47 AM
| Comments (0)
|
|
| Tweet | |
February 25, 2012
Constraint Programming with Java
I was looking into how I could do some constraint satisfaction stuff using Java (because my simulation model is in Java). Here is a link to an awesome example that helped me get started. This uses a library called JaCoP (Java Constraint Programming solver); here's a link to the APIs.
|
Posted by Frozone Permalink on February 25, 2012 03:52 PM
| Comments (0)
|
|
| Tweet | |
February 24, 2012
MySQL privileges
GRANT ALL PRIVILEGES ON dbnam.tables TO 'username'@'whatev.edu or %' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
|
Posted by Frozone Permalink on February 24, 2012 02:04 PM
| Comments (0)
|
|
| Tweet | |
February 11, 2012
How to obtain a node's prerequisite nodes
Last time, (blog post: How to turn an AnyLogic population into a DAG). I wanted to be able to generate a few random parents for each node, adding edges all the while, but I wanted to guarantee that the overall resulting graph would be a directed acyclic graph (DAG). So, in the blog post last time I explained how to connect the agents within a population to each other using a DAG. The tools I'm using are AnyLogic for the agent based modelling and jGraphT for the DAG java library.
In my application, my agents symbolize Learning Objects and I wanted to generate a DAG to represent prerequisite relationships between them. This is an abstract model (i.e. not based on an actual learning object repository). The idea is to be able to generate a "random" abstract graph given the particular parameters you want to study. For example, you might want to see how learners behave when you have 1000 learning objects verses only 10, or, what happens when each Learning Object has on average 2 prerequisites vs. an average of 10 prerequisites.
Anyway, today I wanted to write a method like learner.meetsPrerequisites(learning_object). In other words, for any learner, I wanted to be able to hold up a learning object and say if they had all the prerequisites or not. This involves looking at all the prerequisites that the learning object has, and, checking to make sure they are all in the learner's browsing history.
Given a learning object, you can "kind of" obtain the prerequisites using the jgraphT method,
(.......... ok I am planning to place a code snippet here but i do not have access to my model right now and I don't remember the method name!! ....._
However, this only gives you a Set of objects of type DefaultEdge. This isn't quite good enough if you want the Agent objects themselves so you can grab all the nodes that are pointing to it. (Also, note the subtlety that since it is a directed graph, we only want the TO nodes, not the FROM nodes.)
It took me a while to figure this out, but here's how you can get those references. Go back up to the DirectedAcyclicGraph object and use the method getEdgeSource(). As an argument to this method, you have to provide a reference to the DefaultEdge object we got above. So, just iterate through the set of DefaultEdges, and for each item you will call graph.getEdgeSource(item) to obtain the reference to the perquisite agent.
This link helped me figure out the getEdgeSource() part. Thanks demo!!!
http://massapi.com/source/jgrapht-0.8.2/src/org/jgrapht/demo/CompleteGraphDemo.java.html
|
Posted by Frozone Permalink on February 11, 2012 08:13 PM
| Comments (0)
|
|
| Tweet | |
February 04, 2012
How to turn an AnyLogic population into a DAG
Want to know how to turn an AnyLogic population into a Directed Acyclic Graph? This is even better than a new pair of heels!
A zillion thank yous to the JGraphT project founders and maintainers and also to Peter Giles at U Washington for contributing the dynamic DAG implementation. WOWZA this rocks! I had a rough time finding the javadocs on the jgrapht site, but there seem to be some javadocs here.
So... I have a population of Agents in Anylogic. I would like to arrange them in a random Directed Acyclic Graph.
Here is what I did.
1. In Main, under the advanced tab, import:
import org.jgrapht.demo.*;
import org.jgrapht.*;import org.jgrapht.graph.*;
import org.jgrapht.experimental.*;
import org.jgrapht.experimental.dag.DirectedAcyclicGraph.CycleFoundException;
import org.jgrapht.experimental.dag.DirectedAcyclicGraph.*;import org.jgrapht.experimental.dag.*;
2. Download jGraphT and add the Jar to the Anylogic Dependencies. You can do this by clicking on your project name and there is a Dependencies tab. http://www.jgrapht.org/
3. Set the Replication of your agent population to be myAgent.size() where myAgent is the variable name you gave to the population.
4. Create a loop from 0 to whatever number of agents you want, and for each iteration go like
MyAgent newLO = add_myAgent("parameter1", "parameter2");
directedAcyclicGraph.addVertex(newLO);
... where MyAgent is whatever kind of Java class that your population is. And directedAcyclicGraph is a variable in your Main of type
DirectedAcyclicGraph< MyAgent, DefaultEdge >which you just imported from the JGraphT library. You can set the Initial Value to be
new DirectedAcyclicGraph< LearningObjectAgent, DefaultEdge >(DefaultEdge.class);
The method add_myAgent is automaticaly created for you by AnyLogic and you can find it in Main. Whatever the arguments are to the constructor are whatever the Parameters are that you put into that agent type.
5. So if you want to add some random edges to the DAG just pick any member of the MyAgent population, pick a random neighbour and badda bing badda boom
MyAgent randomNeighbour= myAgent.random();
try {
directedAcyclicGraph.addEdge(myAgent,randomNeighbour); //myAgent and randomNeighbour are both of type MyAgent
myAgent.connectTo(randomNeighbour); //i just did this so it could print a pretty graph.
//unfortunately, I have only drawn regular lines between nodes, so there is no way to tell the edge direction from the visualization... u have to rely on the edge-printout which uses an ordered pair like (sourcenode, destinationnode)
} catch (IllegalArgumentException dcfe) {
//oops, this means that connecting to this particular random neighbour would have created a cycle
myAgent.disconnectFrom(randomNeighbour);
}
shaZAHM!
|
Posted by Frozone Permalink on February 04, 2012 04:58 PM
| Comments (0)
|
|
| Tweet | |
January 18, 2012
MySQL import
Another one of those things I've done a dozen times but can't remember the details...
cd /usr/local/mysql/bin (unneccessary but including this so i can remember where the heck it is installed lol) mysql -u username -p dbname < dbname.sql
Booya
|
Posted by Frozone Permalink on January 18, 2012 01:27 PM
| Comments (0)
|
|
| Tweet | |
January 11, 2012
MySQL crazy symbol problems
Thanks to Chris P. for letting me know how to fix crazy symbol problems in MySQL by changing the character set to be utf8. The default is like latin sweedish or something.
(Reference:
http://kb.siteground.com/article/How_can_I_change_my_MySQL_database_collation.html)
Here's the actual SQL to do it (because frequently I don't have phpmyadmin installed):
ALTER DATABASE 'databasename' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
Posted by Frozone Permalink on January 11, 2012 02:57 PM
| Comments (0)
|
|
| Tweet | |
January 07, 2012
AnyLogic and Databases
Weird....
in AnyLogic, you can include Startup Code, and AnyLogic will execute it as it boots up your simulation model. So, I have a function called startUp() which calls all of the other functions in the correct order that I want. Two of these functions include MySQL database calls.
This has happened to me a couple of times so I thought I'd write it down. I noticed that for whatever bizarre reason, the functions inside startUp() that did database work were basically being ignored. Naturally this messed up a lot of my other stuff. I didn't notice this was happening, because it was working perfectly, until I started "clean up" and was deleting buttons from my interface and just adding the functions into my startUp() because I knew I wanted the stuff to run as part of my default model setup.
Since code works perfectly if I execute those functions with a button press instead of including them in my startUp(), my solution is to take the code back out of startUp(), create special buttons just for those, and press them every single time I boot up my model.
Annoying and weird, but at least it works.
By the way, if you don't know what AnyLogic is and are interested, I highly recommend Dr. N. Osgood's online resources which include some information about using AnyLogic with databases. (Material for Agent-Based Modeling Bootcamp for Health Researchers 2011Click the first link that reads, "lecture slides"). I learned about AnyLogic myself from taking his class, Computer Science 858 at the University of Saskatchewan, during the Winter (January) Term in 2011.
|
Posted by Frozone Permalink on January 07, 2012 02:14 PM
| Comments (0)
|
|
| Tweet | |
January 03, 2012
Apache Commons Java Statistical Sample Awesomeness
Oh my gosh! This is so awesome!
Say you want to generate a set of numbers, but they are not totally random numbers. For example, in my case, I wanted the random number to be 2 most of the time, but I wanted a bunch of 3's and 1's in there, maybe the odd 0 or 4, and I wanted to allow even more extreme higher and lower numbers than the 1, but for those to be very rare.
How do you do this? Well, you just dream up a Normal Distribution, set the mean to be 1, standard deviation to be like 0.5, and badda bing badda boom, do this for as many "random" numbers as you want:
double sort-of-random-num = normalDistribution.sample();
And how do you obtain the mythical normalDistribution object, you ask? Why, I will show you:
import org.apache.commons.math.distribution.NormalDistributionImpl; NormalDistributionImpl normalDistribution = new NormalDistributionImpl(2, 0.5); //(mean, stddev)
Of course, you will have to download the library jar from the Apache website and make it visible to your JVM. Mine is called commons-math-2.2.jar
Then, each time you call .sample() you get a new number. After rounding off, here's what I got:
3
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
1
1
1
1
3
1
2
2
1
etc.
Sweetie beans!
|
Posted by Frozone Permalink on January 03, 2012 04:24 PM
| Comments (0)
|
|
| Tweet | |
October 08, 2011
Anylogic and JPA
(Very rough notes this time -- sorry!)
- in anylogic, i have a path for each learner visiting an LO
- each visit has a pre and post assessment
- therefore, by summing the difference of (post - pre) over each assessment, each path can be given a utility score (useful paths having a positive number, detrimental paths having a negative)
- in anylogic, I couldn't align learning objects sequentially (for a given learner) and graph the score for each one.
- so I started trying to use JPA (Java Persistence API) so I could dump the scores into a database and then take them out again for analysis in the dimension that I want. Anylogic tools would only allow me to sample the SUM, Average, Min or Max of ALL paths. I want a vector of each path.
- But I can't get JPA to work with Anylogic because I can't get anylogic to see the persistence.xml (at least I believe this is teh problem because I am getting a java exception: javax.persistence.PersistenceException: No Persistence provider for EntityManager named ...)
- Therefore I decided to backtrack away from JPA. Next time, I should resume what I was doing but instead of using JPA, manually inject to MySQL.
- (!) Or, I could ditch anylogic and try to get my JPA working only from command line and THEN see if I can hook it up to Anylogic.
- But before I do this, I need to articulate what I plan to query out again.
That is what I accomplished today! I wish that I could come back and continue working on this right away. :(
Here are some of the JPA articles I was using:
- http://schuchert.wikispaces.com/JPA+Tutorial+1+-+Getting+Started
- http://stackoverflow.com/questions/3739387/javax-persistence-persistenceexception-no-persistence-provider-for-entitymanager
- http://www.myhomepageindia.com/index.php/2009/04/02/jpa-hibernate-with-oracle-on-eclipse.html
- http://javahowto.blogspot.com/2006/07/helloworld-with-jpa-hibernate-and.html
|
Posted by Frozone Permalink on October 08, 2011 04:27 PM
| Comments (0)
|
|
| Tweet | |
August 27, 2011
SequelPro cutting off LONGBLOB when I export
I love my SequelPro database client, but it's trimming off data whenever I try to export, and I don't want it to do that. This post is how I found a work-around.
So, I have a table in the database that has a LONGBLOB field. I want to export all of these to a human readable file. CSV will be fine, I can just read it in Excel, or even SQL is fine, or even XML. I just want to read the results of the darn query in a file that I can email to someone in its entirety. Unfortunately, no matter how i try to export, it cuts off the entries after the first sentences (maybe 255 characters if I had to take a guess?).
The secret is to go into SequelPro, go into Content view, click the row, press Command + C to "Copy" then paste it into a text file. Do this for each row. This will give you ALL the content for the LONGBLOB field.
|
Posted by Frozone Permalink on August 27, 2011 04:59 PM
| Comments (0)
|
|
| Tweet | |
August 21, 2011
PL-PLAN, a Java Open-Source AI Planner
Oh, oh! I am excited about this:
PL-PLAN, a Java Open-Source AI Planner
|
Posted by Frozone Permalink on August 21, 2011 01:08 PM
| Comments (0)
|
|
| Tweet | |
July 27, 2011
RedirectMatch
I had occasion to learn a new little trick today.
Suppose I have a system that has links like this:
www.mysystem.ca/folder/subfolder/file.php?somevariable=1235CRYPTICNUMBER678
Suppose circumstances arise that I must absolutely change the name of "folder" to "speedboat". I want the Apache to still accept all incoming links, including the cryptic numbers in the links, but just redirect them to the system in the new folder.
For example, the following link must get translated to the one above:
www.mysystem.com/speedboat/subfolder/file.php?somevariable=1235CRYPTICNUMBER678
I never know what that cryptic number is going to be because it is generated automatically by some system. But the number must get translated exactly.
So here is the Apache directive to do that. Use:
RedirectMatch /folder/subfolder /speedboat/subfolder
That is all you need to do.
|
Posted by Frozone Permalink on July 27, 2011 11:21 AM
| Comments (0)
|
|
| Tweet | |
June 14, 2011
Example of Rustiness: SSH vs Samba in Terminal
I talk a lot on this blog about being the sort of person with respectable age and experience (I have a comfortable decade behind me of computer geekdom) while struggling with forgetting critical details. I feel anxiety when I get into a situation where I KNOW I knew the answer at one time, and I prided myself on my familiarity with it, and yet, I have forgotten. What does it matter if you once knew; the only thing that matters is if you can help someone solve it when they need it, right?
Sure, details can be easily remembered and refreshed, but they definitely cause barriers and slow-down, and even prevent me from getting deeper into projects when I forget how to walk the walk.
Now I have a concrete example to share. A couple months ago I was trying to help a friend with a file permissions problem. Chown was not working. Why? Because I had instructed her to go to Terminal, then change directory to the mounted drive and execute the command. This failed. The correct approach would have been to SSH into the remote server and THEN do the chown.
In retrospect, it is glaringly obvious to me now about the different domains and "which user I actually am" when executing the terminal commands in these two different contexts.
But at the time, it had been months or years since I'd had the chance to go back and forth between Samba mounts, SSH sessions, etc. on a regular basis, and I was so preoccupied with the chown syntax I just forgot.
I am clinging for dear life to the idea that I can still keep my techno skills from dulling too much, even while I grow into leadership positions, and while my research is getting a little more theoretical/abstracted.... It must be possible to live in such conflict, it must! Because the techno stuff is the whole reason (for me) for pursuing the abstract. It creates possibility.
Ahh, I do enjoy being human.
Also, I am indebted to the two technical people who re-taught me this lesson. Maybe I will remember next time.
|
Posted by Frozone Permalink on June 14, 2011 12:12 PM
| Comments (0)
|
|
| Tweet | |
June 09, 2011
JAXB, I love you
Dear JAXB, I love you.
Thanks to my friend Collene for introducing me to JAXB. (Pronounce "Jack's Bee", only without the pause between words). I think that I will keep JAXB by my side for many years to come.
JAXB is the Java Architecture for XML Binding. It is an easy way to load the data from an XML document into a class. You just annotate the class to show which attributes match up with which fields in the XML.
For example, say this is your xml file:
Jane Doe
Now, this is your java class:
@XmlRootElement
public class Person {
private String firstName;
private String lastName;
@XmlElement(name = "first-name")
public String getFirstName() {
return firstName;
}
@XmlElement(name = "last-name")
public String getLastName() {
return lastName;
}
}
To automatically spit out the XML file, just use the JAXB Marshaller. Or, if you want to go the other way - turn an XML file into an instance of a class - use the Unmarshaller. See: http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing2.html
|
Posted by Frozone Permalink on June 09, 2011 06:47 AM
| Comments (0)
|
|
| Tweet | |
May 20, 2011
Apache htdocs folder on OSX
I keep forgetting this so I am blogging it to be able to look it up later.
The Apache htdocs folder on OSX is /Library/WebServer/Documents.
So if I need to quick and dirty run PHP code locally, send it here.
|
Posted by Frozone Permalink on May 20, 2011 04:21 PM
| Comments (0)
|
|
| Tweet | |
May 15, 2011
Buckets
Here is a great idea for a software application. It's called Buckets, and it's like a big canvas that lets you drag around "Buckets" (they can be squares or circles or rectangles, whatever) and organize them into categories, order them alphabetically, put time ranges on them. Around the perimeter of the canvas are thousands of little slips of paper; these too you can categorize, order, timestamp. The purpose of the software application is to allow you to drop the papers into the buckets to organize them. You can pick if the slips of paper are only allowed in one bucket at a time or if they can exist in multiple buckets concurrently.
The software will give you reports and summaries. It lets you build online forms to let people create their own slips of paper, assigning those to buckets. Say, if each bucket were a timeslot, and the people were volunteers, you could use this as a means of letting people "grab" volunteer spots. You could put maximums for the number of slips of paper allowed in a given bucket.
|
Posted by Frozone Permalink on May 15, 2011 09:30 PM
| Comments (0)
|
|
| Tweet | |
April 27, 2011
iPod iTunes sync problem fixed
Whew! 'Finally fixed a problem that was causing me significant irritation. :)
I had just purchased a new album on the iTunes store and wanted to sync to my iPod. However, whenever I plugged the iPod into the computer, iPhoto would pop up. When I went to iTunes, the iPod wasn't showing up under Devices.
I figure that most people in this situation would be able to remember the last time they performed an iPod sync and be able to figure out the cause of the problem based on recent changes to their computer. Unfortunately, I am not in that situation -- I am torn so far away from the familiarity with my own machine's configuration that I might as well be using a stranger's computer. Have I mentioned how much this irritates me? LOL! Someday, I hope to be able to spend time on my computer again and configure it the way I want. Moping aside, here is how I solved the problem.
First, you can get iPhoto out of the way by going into iPhoto --> Preferences --> General and then on the dropdown menu for "Connecting camera opens:" change from iPhoto to "No application". This will be a pain in the butt the next time you want to sync photos from your camera, but we want to sync up our iTunes so we'll worry about that later.
Second, I found this helpful article on Apple's support site. I reset my iPod, performed a software update - which restarted my imac - and then it worked. Whew!
|
Posted by Frozone Permalink on April 27, 2011 07:29 AM
| Comments (0)
|
|
| Tweet | |
April 15, 2011
Apple Mail - "From" dropdown box
Yay! This great web page solved a problem I was having:
http://www.michaelvoong.com/2008/01/19/multiple-from-address-in-apple-mail/
See, I was sending out e-mail, and when people replied to me, the message went to the wrong account. I keep separate e-mail address for work and for personal. I was getting work messages at home, and, I was also uncomfortable with my home email address being sent around to professional colleagues. (I mean, I trust every single one of them, it's jsut that I rarely, rarely get a chance to work on my e-mail at home, so, if they sent me something it could be weeks before I notice.)
Anyway, ever since this started happening I started feeling anxiety every time I sent out email: What is my "From" address? How do I know what the mail client is using?? So, all I had to do was create an alias, i.e. if my e-mail address is stephanie.frost at usask.ca, I simply created steph.frost at usask.ca that would go to the same account. Then, you put in both of these addresses separated by commas according to the directions in the link above. When there is more than one address for the same account, then a From drop-down box will automatically appear, confirming which email address is being used.
This seems sort of a weird solution because I don't really care which of the 2 email addresses is used (stephanie.frost or steph.frost), I just wanted verification that it's one of those, and not my other account!!
|
Posted by Frozone Permalink on April 15, 2011 07:05 AM
| Comments (0)
|
|
| Tweet | |
February 23, 2011
ssh and sftp://
What is the difference between ssh and sftp???
If I ever learn the answer, I will come back and write it here.
P.S. I love CyberDuck for Mac! MacFusion is good, too. I have had problems with both (unexplainable buggyness). But between the two of them, I can usually get by.
|
Posted by Frozone Permalink on February 23, 2011 10:21 AM
| Comments (0)
|
|
| Tweet | |
February 14, 2011
http_referer vs remote_host
I don't know PHP very well. But today I learned the difference between $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_REFERER'].
Basically, the former works at the Transport layer (ex: TCP/IP) and the latter works at the Application layer (ex: HTTP).
If you want to check your traffic for "user is coming from" type data, the former is secure, and the latter is absolutely NOT (because clients can be easily faked).
I am having a very difficult time obtaining documentation for the former. I believe that REMOTE_ADDR is the IP number taken from TCP/IP (or UDP, or whatever). I guess this would have to be built into the web server somehow, which would have to peel the headers off of incoming requests and make them available within the PHP environment.
The second one is easy. Here is what an HTTP packet might look like; this would be generated by a web browser:
GET /path/to/myscript.php?argument1=value HTTP/1.1 Host: www.mysite.ca Connection: close User-agent: Mozilla/5.0 Accept-language:en Referer: http://whateverIwant.ca
The browser normally sets the Referer to be the "current" page when the HTTP request is initiated by clicking the link to /path/to/myscript.php. So it tells you the last page the user could have been looking at. You can set the Referer to be anything you want with a Firefox plugin.
So, there. I know a little more about PHP. I wonder how this distinction would look in Java/JSP/Tomcat, hmm! I am much more comfortable with servlets, contexts, and web applications!
|
Posted by Frozone Permalink on February 14, 2011 02:58 PM
| Comments (0)
|
|
| Tweet | |
January 28, 2011
Syntax highlighter
The tool, Syntax Highlighter looks really awesome. I would like to try it out on this blog. I am having trouble getting it working, but here is a start. UPDATE: Okay, I got it working! I had the path to the script wrong; the one I copied from the instructions was a relative path, assuming you had downloaded the scripts and were hosting them on your own server. I am linking directly to Gorbatchev's hosted version. If I continue to use this service I will likely send him some a donation.
Example:
/** this is a comment */ this is some code
|
Posted by Frozone Permalink on January 28, 2011 11:23 AM
| Comments (0)
|
|
| Tweet | |
January 20, 2011
Can't even articulate this one
I just spent about 1.5 hours (YES!!! I love it when I have time for programming. But it does suck when you get tripped up for extended periods of time. But it is necessary.) trying to figure out why my web app wouln't deploy. I got it working, but I am not sure why.
THe problem was that my context.xml was not getting updated. When I did a clean, dist, deploy, it worked. But when I only did a dist, deploy, it was not working.
The file was in my tomcat_home/conf/Catalina/localhost/webapp.xml. I have no idea how my ANT is accessing this file; I can't pick it out of the xml. All I know is I have to Clean if I want this to get updated. I think. Actually, I may have had to fix the xml manually???
????
Oh well. Perhaps some light will be shed on this at a later time, when I am older and wiser.
|
Posted by Frozone Permalink on January 20, 2011 03:38 PM
| Comments (1)
|
|
| Tweet | |
January 18, 2011
BUILD FAILED - ${tomcat.home} not found
BUILD FAILED - ${tomcat.home} not found
When I was first learning how to use ANT, I got this error while I was trying to get my environment set up. And then I fixed it! Unfortunately, I had written down the error with the intention of blogging about it in case I ever ran into it again, but, I forgot how I solved it, and couldn't remember how to reproduce the problem.
Today, I remain uncertain about whether the "tomcat.home" notation is local to the developers I learned these conventions from, or, if it's a convention used more generally by hundreds of Tomcat + ANT + Eclipse + Java/JSP + Subversion developers.
Fortunately (ha?) I ran into the problem again. It didn't take me nearly as long to fix it this time, and, I am lucky to have the time and opportunity this time around to blog about it before I forget.
Without further ado: The reason I got the error is that I had my build file pointing to the wrong configuration files folder.
That is, in build dot xml, the folder value in the following line was wrong:
(ugh, why is it so hard to include code snippets in a blog entry?? That was a rhetorical question. UPDATE: Problem solved!)
So, the basedir is the home folder of your web application, I think. Whenever I am using ANT with my developer configuration files, I usually change directory up one level in order to find my subversion checkout folder (because we have a separate repo for configuration files.) If you are using Subversion within Eclipse, then your checkout files are likely in your Eclipse workspace folder. (at least, that's how I set up mine). When you are changing from development to production, you just change the directory above to point to the production set of build configuration files and you're done. The error means that this file path is wrong and it can't see any of your build configuration files.
Wooo! I had 2 cups of coffee today, (which is 1 more than usual) and it doesn't feel like it was enough.
|
Posted by Frozone Permalink on January 18, 2011 02:42 PM
| Comments (0)
|
|
| Tweet | |
December 28, 2010
SequelPro
My current favourite MySQL GUI client is SequelPro. I am accustomed to using MySQL at the command line, but if all you want to do is browse your data and review the database structure, I prefer usng SequelPro. Even better -- free download! (at the time of this writing)
The reason for this blog entry is that I have needed to install this program several times (computer at home, computer at work, laptop) and I want to be sure I remember the link. I am considering donating some cash for this nice software.
|
Posted by Frozone Permalink on December 28, 2010 11:21 AM
| Comments (0)
|
|
| Tweet | |
November 13, 2010
MySQL installation
Over the last decade, I have installed MySQL dozens of times on dozens of computers using several different operating systems. However, when the time comes that I need to do it again, I can never freaking remember how to do it quickly and easily. Often, I find myself reading about building make files and setting up aliases through unix-style filesystems. I am aware that I have done this successfully many times, and I wish it could just "stay" done so that I do not have to expend this effort over and over. However, as I change jobs and change computers over time, it seems any optimization is unlikely.
Therefore, for my notes I supply this link that helped me perform an installation today. Perhaps it will help to jog memory next time.
In other words, this is a very good link explaining how to get a mySQL server up running quickly and easily on your mac.
http://www.bos89.nl/install-mysql-on-mac-osx/
|
Posted by Frozone Permalink on November 13, 2010 09:08 PM
| Comments (0)
|
|
| Tweet | |
September 26, 2010
CoRD - Remote Desktop Client
I am in love with this great Remote Desktop Client, CoRD.
For many years, I only used Microsoft's Remote Desktop Client. It made sense when I was a Windoze user. And when I switched to Mac I simply used the same software, downloaded the Mac version.
But this morning I got really fed up. See, version 2 of the Microsoft Remote Desktop Client tries to "save" my credentials in an application window. This is a huge pain because I have a half dozen servers I need to access, and the software forces me to erase the user and domain name from the previous session each time. Also, I have a crappy memory and I really do like seeing the Server's actual login prompt to help me jog my memory, instead of being forced to enter the credentials in the application-specific menu each time. Version 1 of the software was better because it did send you to the server's local login screen, but unfortunately I can't download it; I can only find Version 2. Luckily, I had an older computer with Version 1, so I have been using that for several months.
But today I got fed up. I should be able to remote in from my new computer. So after a bit of Googling, I discovered CoRD and now I am happy and in love. :)
|
Posted by Frozone Permalink on September 26, 2010 09:44 AM
| Comments (0)
|
|
| Tweet | |
September 17, 2010
JESS
If I lived in a fantasy world and I had spare time, I would build a little application using JESS to get some experience with rule-based systems.
In the real world, a 30-second blog entry will have to suffice. ;)
|
Posted by Frozone Permalink on September 17, 2010 03:45 PM
| Comments (0)
|
|
| Tweet | |
September 04, 2010
Keener - class project
The first day of class isn't until Tuesday, but I have already been fantasizing a little bit about the term project. My supervisor tells me the project will be "to build an eLearning system" (as I understood, sort of jokingly about the broadness of the project description but quite serious about the room for creativity and freedom.)
I would like to contribute something to do with agent programming with hopes of experiencing some game theoretic concepts.
I am looking forward to our first project meeting to learn what my team members will be interested in incorporating into our collective endeavor.
Agents, Concept maps, the ecological approach... I have always wanted to try and build something in Second Life to take advantage of the immersive environment. Reward functions, storyline progression... looking forward to seeing where this will go!
|
Posted by Frozone Permalink on September 04, 2010 07:01 AM
| Comments (0)
|
|
| Tweet | |
August 12, 2010
create jar file
I am always forgetting this.
To create a jar file, go
jar -cf myfile.jar *.class
(see javacoffeebreak.com)
The "c" means you are CREATING a new jar. The "f" means output to file instead of output to terminal. (see Oracle's resources for more option descriptions.)
|
Posted by Frozone Permalink on August 12, 2010 09:20 AM
| Comments (0)
|
|
| Tweet | |
August 04, 2010
Apache virtual hosts
I should start using delicious or something for all these links I wish to keep.
Here is a good one for Apache virtual hosts. I need to know how to do this for my job, but I don't do it frequently enough to memorize the syntax nor techniques.
http://www.unix-girl.com/geeknotes/apache_virtual_host_conf.html
|
Posted by Frozone Permalink on August 04, 2010 11:00 AM
| Comments (0)
|
|
| Tweet | |
July 23, 2010
Subversion errors
I had to move my Subversion repository to a new server. After I set it up, I could Browse the repo just fine, and do checkouts. Unfortunately, whenever I tried to Commit anything (via HTTP), I was getting these Subversion errors:
Permission denied
svn: Commit failed (details follow):
svn: Can't open file '/mysvnrepo/db/txn-current-lock': Permission denied
Permission denied
svn: Commit failed (details follow):
svn: Could not open the requested SVN filesystem
Permission denied
svn: Commit failed (details follow):
svn: Can't make directory '/mysvnrepo/dav/activities.d': Permission denied
I solved them by executing the following command (which I explain below):
cd /
sudo chown -R www:www mysvnrepo
chmod -R 664 *
The first line -- you have to change to the parent directory that holds your SVN repo.
The second line -- the "sudo" part of the command is when you want to invoke administrator power to let you perform this command (which otherwise would give you an Operation Not Permitted error). The "chown" command means you are going to change some file permissions. The -R means "recursive", i.e. apply the changes to everything downward in the directory hierarchy. The "www:www" means owner/group. If you don't know what yours are, check your Apache's httpd.conf file. Finally, "mysvnrepo" is the name of the folder that contains all of the back-end SVN stuff in it.
The third line gives read/execute to Owner and Group and Read to everyone else.
I love you, StackOverflow. Why didn't you exist when I was a young programmer? heh
|
Posted by Frozone Permalink on July 23, 2010 11:24 AM
| Comments (0)
|
|
| Tweet | |
July 09, 2010
Adventures with ANT, Part 8
Okay, I fixed my web.xml problem. All I had to do was go into the correct version of the XML file, add a carriage return and save. Maybe the system was looking at the timestamp on the file.
I also learned that after I hit "build" I should look in the "dist" folder at my context.xml and web.xml to make sure they are the correct versions. Because this is the folder that gets uploaded to the production server.
|
Posted by Frozone Permalink on July 09, 2010 08:45 AM
| Comments (0)
|
|
| Tweet | |
July 08, 2010
Adventures with ANT, Part 7
Ugh, I messed up.
I deployed my latest (working) version of my app to production. I was perfect on localhost, so, it seemed logical to go live, right?
Stupidly, I deployed without checking the time. It was 4:24 p.m.. Every day I leave in a rush to go pickup my daughter from daycare. I do not have the luxury of working late. (but I love what I do and I wish I could)
Anyway, for some reason my dev web.XML went to production instead of the production copy. Obviously my build.XML is pointing to the wrong version, except that I double-checked the path and it is pointing to the correct version.
So I don't know what is going to happen. I have to trace the steps, but my day is jam-packed full of meetings tomorrow.
Sigh. It is very hard being both Management and Server Admin.
|
Posted by Frozone Permalink on July 08, 2010 06:10 PM
| Comments (0)
|
|
| Tweet | |
July 02, 2010
mysql connector
In my new local Tomcat environment, I was trying to set up some database connection pooling and I kept getting this error:
Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
I solved it by adding the jar file for the MySql JDBC connector into this folder:
TOMCAT6_HOME/lib
Then you have to STOP and then re-START Tomcat so it can load up the new libraries.
This is something that my ANT didn't take care of!!!
|
Posted by Frozone Permalink on July 02, 2010 03:43 PM
| Comments (0)
|
|
| Tweet | |
lost MySQL admin password
I can't believe this happened to me because I am such a careful and organized person. But, I lost an admin password.
I created a MySQL database server on my local workstation for development purposes. Years went by where I did not do any development and I did not need to use my local database server. But now I am programming again and I need to run a local version of a system for work-in-progress. I require access to my local database server.
But the password I could have sworn I'd set wasn't working. I questioned whether I was actually connecting to the correct database server. (Who knows? Maybe I had 2 mysql servers installed on my workstation and forgot about one. It could happen!)
Anyway, the following link helped me get around my forgotten admin password.
http://lists.mysql.com/mysql/171366
I am summarizing the steps below in case the link above gets busted.
1) Stop the service
2) run mysqld_safe --skip-grant-tables &
3) mysql -u root mysql (i.e. log in with root and use the database, "mysql")
4) issue the following:
UPDATE user SET password=PASSWORD("newpassword") WHERE user="root";
FLUSH PRIVILEGES;
5) Log in again with your new credentials:
mysql -u root -p
Enter password: (new password)
USE DATABASE mysql;
You should be in!
|
Posted by Frozone Permalink on July 02, 2010 10:46 AM
| Comments (0)
|
|
| Tweet | |
June 28, 2010
Adventures with ANT, Part 6
In this entry, I share a trick about debugging ANT build.xml files.
Normally, when you run ANT in the command line, it can do the equivalent of System.out.print lines. Similarly, in your Eclipse environment, it prints status (ex. BUILD SUCCESSFUL) in the console.
If you want to debug, you can see values of your configurations by putting echos into your config file, like this:
Just replace the name of the variable you wish to see. :)
Another good ANT tip -- if it gives you a "Bad Class Version" type error, do an ANT - Clean and try again. See, ANT usually only re-complies the files that have changed recently, not ALL files. But if you change your Java version somewhere in between, and then ANT compiles a subset of your project with this new version (but the rest of your files are still compiles in the old Java version) then you can get an error. So, since "ANT Clean" deletes all the class files, the next time you run ANT it will compile ALL your Java, this time everything with the same version, and the error will go away.
|
Posted by Frozone Permalink on June 28, 2010 04:12 PM
| Comments (0)
|
|
| Tweet | |
My ANT series
I am feeling a little odd about my Adventures with ANT series on this blog because these are more than "Technical How To's". The notes I write here are cultural conventions passed on through organizations and/or mentorship. It's not the only way to do things, and may not even be the best way of doing things. It feels kind of sacred to me. I'm very grateful and lucky to have had a mentor teach these things to me! (Thank you, GvdV, if you are reading this. :D)
And yet as I write it's coming out in a broken sort of way, not very well explained. There is no foresight or structure in my writing. I haven't done this knowledge justice!
But I'm writing this stuff down like crazy now, and may come back later to write something that is useful to someone other than myself. heh. This stuff is the Craft or the Art part of software development.
But for now it will remain scratch notes.
|
Posted by Frozone Permalink on June 28, 2010 03:56 PM
| Comments (0)
|
|
| Tweet | |
Adventures with ANT, Part 5
In this entry, I want to talk about creating local conf files for your development environment.
Recall this subtree from my other entry.
- Project1/
- conf/
- myconf/
- conf/
In your svnconfigs checkout, you can create another folder, "myconf" which will only ever be local. Copy/paste all the conf files and comb through them and re-route all the connections to your local environment. If you want, configure your Subversion to ignore this folder.
Also configure subversion to ignore your "dist" folder. The dist folder is created in your local environment for production of files for distribution; this would never be committed to the repo.
Change your build.xml file to point to the new config files.
A good convention is always to "dist" before you "deploy". This lets you test out your new configuration before affecting the live system.
Logging, in log4j.properties: different options are DEBUG (usually for development), INFO (if you're watching), WARN (this is usually for production level) and FATAL (which I assume only shows you fatal errors?)
- web.xml is for filtering, CAS, etc.
- note about localhost and CAS... might just want to comment it out, where CAS returns to after it's done, note to self, line 42
|
Posted by Frozone Permalink on June 28, 2010 03:47 PM
| Comments (0)
|
|
| Tweet | |
Adventures with ANT, Part 4
Next I want to talk about deploying WARs to a Tomcat.
Add the following to your local tomcat/conf/tomcat-users.xml
Now, whenever you go to your Tomcat Manager (http://localhost:8080/manager/html) you can use this username and password.
This is also the same username and password you add to build.properties so that ANT can send your stuff to your Tomcat (either local or production) using the automagical Tomcat HTTP deploy mechanism. Note that build.xml gets its values from build.properties. You have 1 build.xml per project and you just re-route this to dev or production as required. The re-routing points to different sets of configuration files; one member of this set is build.properties. Therefore you have 1 build.properties for dev and a separate one for production.
If you attempt to ANT deploy, but it hangs on you, then make sure the Tomcat manager is running! If it isn't then try start/stopping your tomcat.
Another note about .properties files. ResourceBundle is a Java class that you can use to pull info from property files and bring it into your java. For example if you needed to save credentials for connecting to external systems, or save URLs for web services or whatever, they can go here.
The .properties files could be saved in TOMCAT_HOME/webapps/ocw/WEB-INF/classes/
Don't forget you can deploy without needing to change your build.xml file -- just use ANT at the command line.
ant -Dconf.home=../path/to/configs deploy
Also, I didn't realize the -D was custom parameters. I had seen that around before but forgot what it meant. Old memories coming back.
You can even use the ant command line deployment in Scheduled Tasks for overnight scripts.
|
Posted by Frozone Permalink on June 28, 2010 02:20 PM
| Comments (0)
|
|
| Tweet | |
Adventures with ANT, Part 3
Next I would like to talk about Tomcat and how a Context relates to your Eclipse Project structure.
Recall my project tree from last time. Each project also has an "src" file and a "web" file, mapping to java and jsp code respectively. Think about how these map to Tomcat deployment folders within the context: to TOMCAT_HOME/webapps/project1/ for JSP and TOMCAT_HOME/webapps/project1/WEB-INF/classes or lib for your java.
The build.xml file in the root of your project folder comes from SVN and will originally be pointing to the conf/example config files. When you check out the build.xml, you will re-route it to your local config files, and you won't re-commit your build.xml to the repository.
For a dev/deploy cycle, you would point your build.xml to dev, and when you are ready to go, you would change the deploy path in your build.xml, and that's all -- everything would automatically deploy to production and you only have to change 1 path. It is so beautiful! The reason this is beautiful is that there is high overhead in changing your deploy environments because systems these days are so complex. If you can configure all of these once, and then just change the path, it makes it easier for you to switch back and forth.
And the reality is that many folks are not "pure" managers, developers, testers, designers or whatever. Often your position is fudged into a mixture of these and more, and you have to be able to hack your way through life in an elegant sort of way. :)
Or at least that's how my life is working out right about now.
|
Posted by Frozone Permalink on June 28, 2010 01:50 PM
| Comments (0)
|
|
| Tweet | |
June 25, 2010
Adventures with ANT, Part 2
This time, I would like to talk about my development environment and how I weave the ANT tool into my workflow.
As I mentioned earlier, I am using Eclipse and Subclipse for Subversion.
As part of every project, I have learned from a colleague that it can help to include a conf/example/ folder. All of the config files in conf/example/ would be set as needed for production *except for the one thing* that the admin credentials are not hard coded in.
So, when you checkout all your source code, the first thing you should do is copy/paste all the example config files, and then hook them up to your local development environment (database, Tomcat, etc.).. Note: the actual credentials and final deployment configurations could be kept in a separate Subversion repository, call it "svnconfigs".
For my personal development environment, on Eclipse I created a separate Eclipse Projects for each, well, project in the Subversion repo. Each project has a corresponding config file in svnconfigs. Therefore, my Eclipse navigation looks like this:
- Project1/
- build.xml
- conf/example/
- Project2/
- build.xml
- conf/example/
- Project3/
- build.xml
- conf/example/
- Project4/ (etc..)
- build.xml
- conf/example/
- svnconfigs/
- Project1/
- conf/
- Project2/
- conf/
- Project3/
- conf/
- Project4/
- conf/
- Project1/
Note, that only the people with the responsibility to deploy to production would need to have the svnconfigs subtree. Nobody else should really have that -- those developers instead merge to trunk in the SVN repo (or to the latest release tag, or however you do it).
So this can get confusing: You have config files defined in /svnconfigs -- these are the "perfect" ones for production, with all production credentials. Then you have the "example" config files bundled with the source code in the repo. Then you have your development config files, which were cloned from the repo but used only on your dev machine.
So, my dev code will be in Eclipse workspace/Project1, which is synchronized with Subversion. When I commit code, I only commit *code*, and I wouldn't re-commit the build files or anything that I had adapted for my local environment.
|
Posted by Frozone Permalink on June 25, 2010 03:00 PM
| Comments (0)
|
|
| Tweet | |
Adventures with ANT, Part 1
I was reading about ANT and I got stuck on the part, "Make sure the path to your ANT install folder is located in your classpath".
I paused because I remembered how to update the classpath on Windows/DOS but I couldn't remember what to do on my beautiful new Mac using Eclipse.
But here is how it works. In your Project, go to Properties and under "Java Build Path" there is a tab, "Libraries". Add everything here. Eclipse will make sure that when it starts the java it includes these in the classpath for you. This seems sort of weird to me because I'm not using ANT APIs in my project for anything, I'm not developing ANT or interfacing with ANT... I am just using it as a deployment tool. But I guess you need the JAR in your project libraries anyway. I'm not 100% clear why.
For ANT deployment, I predict that you would have to tell ANT (via the build.xml file?) about all the pointers to all the Jars that are located in your Eclipse project library. i.e. Ant would have to retrieve all these dependent files that you had marked in your development environment and package them into the WAR before it uploads the WAR to your production server. I will continue to read on to figure out how this works.
By the way, after you install Tomcat, the command you do on startup.sh and shutdown.sh is "chmod 775". This makes it executable. I perform this often enough that I need to know the command, but I do not perform this enough to have memorized it!
|
Posted by Frozone Permalink on June 25, 2010 02:45 PM
| Comments (0)
|
|
| Tweet | |
June 02, 2010
Tomcat filters
I have never actually used a Filter in Tomcat before, but I was just talking with a colleague about them and wanted to record what I learned.
Filters are set up in Tomcat's web.xml, and they are context-sensitive.
Two examples of how you might use filters:
1) If your system uses authentication, like CAS, you can set up a filter that boots the person to a login page if they do not have a session established, otherwise it sends you to the appropriate JSP page for in the webapp. I guess this server configuration would save you some setup work in your jsp. I am not sure how this works, design-wise. Would this be making your JSP code rely on your Tomcat config? I guess this isn't so bad since Tomcat is "The" application server for JSP. But still, it's a different kind of business logic processing, isn't it? Maybe yes maybe no, I'm not certain.
2) Hiding folders in directory structure browsing.
Here is a relevant article on java.sun.com: The Essentials of Filters
I still get the willies when I see "Oracle" plastered across the top of java.sun.com's pages. I don't know the story behind that. I can only assume that the company Oracle made some sort of deal with Sun Microsystems. Anyway. Back to work. Bye.
|
Posted by Frozone Permalink on June 02, 2010 10:17 AM
| Comments (0)
|
|
| Tweet | |
April 04, 2010
enabling PHP on my mac
Although PHP was never my first choice for a web scripting language, it is used widely-enough that it's important to know the basics! I had to do some tinkering in PHP today. Here is how I enabled PHP on my mac at home.
1. Open the file /private/etc/apache2/httpd.conf.
2. Search for the line that says "#LoadModule php5_module libexec/apache2/libphp5.so" and un-comment it.
3. In System Preferences, go to "Sharing" and un-check and re-check "Web Sharing".
Done!
I love my mac!
|
Posted by Frozone Permalink on April 04, 2010 01:35 PM
| Comments (0)
|
|
| Tweet | |
March 08, 2010
Maven & Ant, II
Thanks to my dad for explaining Maven and Ant to me!
Both are used for gathering up your source code, funneling it though the compiler, and producing the executable files in the format you want. Obviously this can be done manually, but in a typical project with lots of revisions, you have to compile & assemble so many times that it's nice to streamline the process using Maven or Ant.
Maven provides some structures to help you get up and running faster. But your application has to conform to the structure. I understand that Ant is more flexible but takes more work to get set up.
Maven can bring in external source code as well, like importing dependencies. This may or may not be desirable.
|
Posted by Frozone Permalink on March 08, 2010 12:09 PM
| Comments (0)
|
|
| Tweet | |
Good Jersey links
I am packing up my "Learning Jersey" project for now but wanted to keep these links somewhere.
- Model View Controller and Jersey - Earthly Powers blog
- oriley book talking about the same thing - http://books.google.ca/books?id=_jQtCL5_vAcC&pg=PA183&lpg=PA183&dq=jersey+viewable+download&source=bl&ots=cJgs8fUU7_&sig=WGuGkjk1kHpE7L7bICnoc-rtjwM&hl=en&ei=te9CTf-hE5PSsAOTsM3fCg&sa=X&oi=book_result&ct=result&resnum=7&ved=0CEMQ6AEwBjgK#v=onepage&q=jersey%20viewable%20download&f=false
- http://blog.docuverse.com/2009/08/04/using-jsp-with-jersey-jax-rs-implementation/
- http://docs.sun.com/app/docs/doc/820-4867/ggrby?l=en&a=view
- http://jersey.java.net/documentation/1.1.0-ea/user-guide.html#d4e31 (@Path args)
- http://blog.spaceprogram.com/2008/01/getting-started-with-jax-rs-and-jersey.html
- http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features
- http://www.vogella.de/articles/REST/article.html#installation_jersey
- download zip of Jersey JARs - http://jersey.java.net/nonav/documentation/latest/chapter_deps.html
- Another place to download jars: http://jersey.java.net/nonav/documentation/latest /chapter_deps.html
- URL template examples: http://download.oracle.com/javaee/6/tutorial/doc/gilik.html
- Easy Getting Started http://www.suryasuravarapu.com/2009/02/rest-jersey-configuration-on-tomcat.html
- Freaking awesome Bruce Phillips REST walkthrus
- session variable management in jersey - whopass example http://stackoverflow.com/questions/909185/jersey-security-and-session-management
- Servlet initialization: http://jersey.576304.n2.nabble.com/Initialization-at-startup-as-opposed-to-first-request-td5164440.html
- More servlet init: http://www.ibm.com/developerworks/websphere/library/bestpractices/using_httpservlet_method.html
- Good Web.XML example: http://www.skill-guru.com/blog/2010/12/29/creating-your-firs-rest-service-with-jersey/
- Software Architecture and back=end logic with Jersey http://download.oracle.com/docs/cd/E19776-01/820-4867/ggrby/index.html
- tutorial http://www.vogella.de/articles/REST/article.html
- tutorial https://jersey.java.net/nonav/documentation/latest/client-api.html
|
Posted by Frozone Permalink on March 08, 2010 11:24 AM
| Comments (0)
|
|
| Tweet | |
March 01, 2010
My first Jersey app
Okay, so I built my first web app that uses Jersey, following this guide.
At first I was a little weirded out. What the heck is a pom? (It's an XML file, I know that much. I assume it's a config file, but I don't know what the heck it is configging.)
What the heck is a Grizzly? Oh, I just have to import it. Right, sweet, I remember how to import stuff.
import com.sun.grizzly.*;
import com.sun.grizzly.http.SelectorThread;
Same with the Jersey stuff.
import com.sun.jersey.*;
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory;
Obviously, if I am importing stuff in my code, I need to match up the JAR files. I used to go into my OS and update the PATH variable, but before I retired I started using an IDE, which performed this magic for me. So I add the JARs to the IDE. Mental note that I will also have to add these JARs to my deployment environment, if I use them in production. Okay, so in Eclipse you go Project --> Properties --> Java Build Path --> Libraries --> Add external JARs. Whew, that part hasn't changed much since my day.
'Kay, now, run your app. In Eclipse, go to your class with the main method, then click Run As --> Java Application. Good, good, I see positive feedback in the console, the app is running. Kudos for me for hooking up all the dependencies correctly!
Now what does the tutorial say? Go to http://localhost:9998/helloworld. WTF? I don't have a web server running on my port 9998. Oh, wait, that's what Grizzly is. A web server. heh. Okay. Let's see what it does.
Internal error? Console says class not found. Oh, whoops, I forgot to change the pacakge name from the original tutorial's com.sun.jersey.samples.helloworld.resources to the package heirarchy I created for myself. Let's fix that, compile, Run again...
Sweet! Hello world!
Okay, there we go. It took me approximately 45 minutes to build my first Jersey app.
I still don't know what that @ syntax is all about.
@GET
@Produces("text/plain")
Like, I had to import java classes for those, in the same class as the @ calls.
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
My guess is that they are rapid-fire method constructors, or something. Don't know yet.
Re-reading the getting started guide, 'seems I didn't need the "pom" after all. I still don't know what that is.
All in all, this is WAY more than I expected to get done THIS WEEK. I am very pleased with myself right now. And my first meeting isn't for an hour. Maybe I have time to write some LDAP connectivity libs.
|
Posted by Frozone Permalink on March 01, 2010 09:38 AM
| Comments (1)
|
|
| Tweet | |
Maven, Ant
Maven and Ant are two tools that I hear LOTS about, but I've never used. I think the reason is that for most of my time as a software engineer, I was the only full-time programmer employed by the company. It seems to me that Maven and Ant are coordination tools. I don't know very much about them yet, but I suspect (this is becoming a running theme) that they formalize and optimize many of the things that I was doing manually. For example, to deploy the latest version of a web application, I would manually drag and drop files. Now-a-days, I don't expect that developers do this as much.
Through experience, I hope to learn the difference between Maven and Ant, but I'll leave it at that for now. I will come back and edit this entry.
UPDATE: Check out this newer entry.
|
Posted by Frozone Permalink on March 01, 2010 09:10 AM
| Comments (0)
|
|
| Tweet | |
February 26, 2010
Jersey
I have never used Jersey before and I want to learn more. I am starting by trying to relate this new stuff to what I already know. I ask myself, "How would Jersey have fit into some of the systems I built in the past?".
I read Chapter 1 of the RESTful Web Services Developer's Guide. Also this article is well-written.
I think maybe, just maybe, Jersey (which is an implementation of REST) is formalizing what I used to do manually with session variable passing.
|
Posted by Frozone Permalink on February 26, 2010 10:56 AM
| Comments (0)
|
|
| Tweet | |
February 22, 2010
catching up: jQuery
Back in 2006, I was a pretty mean DHTML programmer. Check it out.
I remember wanting to address an inefficiency with the layout I refer to in that old entry because I felt it caused too many redundant server asks and page loads. Despite off-loading images, CSS scripts and most of the javaScript to an Apache HTTP server and leaving my Tomcat to process only JSP, I still had a stupid memory problem. When the user clicked on a checkbox, my system triggered an HTTP GET message to the Servlet, which would pass the request to java libraries for a database query, then, upon receiving a success message, the classes would all high five back to each other until ultimately the screen re-loaded showing the checkbox was "ON". The problem is that the whole page was re-sent to the client. Also remember that each blank checkbox had a (albeit gentle, well-designed :-) ) verification that the value was in fact "not checked". Although there wasn't any noticeable lagging from the user's perspective, as an engineer this inefficiency bothered me.
And then along came Ajax. Well, I guess Ajax was released a few months before that blog post. Call me a late adopter. ;-) Ajax was invented to address the problem I described that I, like so many other web developers had encountered.
Fast forward about 3 years. I just read the intro docs for jQuery, which I understand is another layer on top of Ajax. The jQuery APIs are straightforward and appear well-designed. I'm impressed!
I feel less intimidated about these flashy new Web 2.0 effects, that I don't have to spend the time writing them. Just call the libs. Love it!
Thank you to my friend and Software Engineer Collene for the heads up about this new tool!
|
Posted by Frozone Permalink on February 22, 2010 02:05 PM
| Comments (0)
|
|
| Tweet | |
February 18, 2010
Java versions in OSX
Another important Java on OSX tool I forgot about:
Go to Applications --> Utilities --> and double-click on Java Preferences.app. This is AWESOME because it lets you point your VM to the different versions you have installed on your machine ( 1.3, 1.4, 1.5, 1.6, etc...)
Ahh, I remember when I was just a baby coder they were upgrading from Java 1.1 to Java 1.2...
|
Posted by Frozone Permalink on February 18, 2010 11:09 AM
| Comments (0)
|
|
| Tweet | |
April 11, 2009
MovableType: Immediately publish comments from...
This has been a (very minor) thorn in my virtual side for a little while now. I want to get my blog, which is powered by MovableType, to automatically accept comments from trusted folks. This is not working yet, but I thought I would write down my steps here to document what I've tried, and when I finally get it working, hopefully this post will help someone else in the same boat.
Here's what I've done so far.
1. In MovableType, go to Settings, then click the "Feedback" tab.
2. Under, "Immediately publish comments from:" choose "Trusted Commenters Only"
(I had gotten this far before, but for some reason it still wasn't working. I assumed that once I had approved a person's comment, the would thereafter be "Trusted". However, I was wrong, and the system is still requiring that I manually approve each comment.)
3. Click "Comments". Next, click the checkmark in the header which highlights all of your comments. You will see a drop-down box that reads "More actions.."; in here, choose "Trust Commenter(s)" then click Go.
4. You might have to do step 3 several times if you have multiple pages of old comments.
(I thought, "For sure, this should do it!" but no luck yet.........)
Here is the MovableType documentation on the "Immediately publish comments from..." feature. Of course it is completely unhelpful, but maybe I can submit some feedback to them to improve their docs if I ever figure this out.
And, yes AC, I am thinking about your teaching me how to play Piano Man on the guitar as I type this. heh heh (I "approved" this comment this morning.)
|
Posted by Frozone Permalink on April 11, 2009 09:53 AM
| Comments (2)
|
|
| Tweet | |
March 07, 2007
Microsoft Access and Temporary files
Hum, just when I thought I had complained enough about Microsoft Access, I get to do it again! Hurray! *giggle*
Okay, so I've been getting these bizarre error messages that have been a - quote from an Assistant Principal - "...source of frustration for some students." No kidding. Here are the beauties:
1)
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'myDatabaseTableName'. Make sure it exists and that its name is spelled correctly.
2)
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.)
3)
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Disk or network error.
4)
[Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission on 'myDatabaseTableName'.
5)
[Microsoft][ODBC Microsoft Access Driver] Too many client tasks.
Note, error #2 - the one about exclusive access - is discussed in my other post:
Filesystem permissions on LDB file: connection pooling and Tomcat clustering (Update, March 2007 -- Or, if you are getting this error by trying to open a Microsoft Acces 97 database using Access 2003, then go try and install Access 97 on a different computer and open the file that way. It will let you in, despite the LDB file! (At least it did for me!) Somehow Acess 97 is able to open locked databases despite the lingering LDB file. )
As for the other ones, I learned something new today about Microsoft Access. In addition to the .LDB files, Access also uses temporary files with names like 'Jet1F9C.tmp'. These files are located on the same machine as the Access database inside either C:\WINDOWS\Temp or C:\WINNT\Temp depending on the OS of the server. There were over 100 of these files on my server. I had no idea they were there; it gives me the willies. (What other system resources are being used out there that I don't know about?? )
I have developed the sneaky suspicion that some of those errors are due to a missing filesystem permission on those Temporary folders. I discovered by trial and error that ODBC connections run under the "Users" group on the server's local domain. For example, if your server's name is MYSERVER, then the username would be MYSERVER\Users . So, you have to grant this user Read, Write, and List Folder Contents permissions on the Temp folder. It looks like you might also have to set a Windows environment varabile %TEMP% to point to the temp folder. 'Not sure if this is a requirement or not. Don't forget that you have to re-boot your server in order for new environment variables to take effect.
For more on this, check out:
"Disk or Network Error" -- Good description about TEMP / TMP Environment variable requirements: [KB_43] - Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Disk or network error.
.... also worth reading:
Microsoft Help & Support: You receive a database results error message when you connect to database from an ASP page in FrontPage
I also suspect that you also need to grant Full Permission for MYSERVER\Users on the entire folder in which the Access file is sitting. You need the entire folder so that the LDB file can be created/edited/deleted. For more on this refer to my other entries: Filesystem permissions on LDB file: connection pooling and Tomcat clustering . and
Database connection pooling and clustered Apache Tomcats
My next question about Access is.... Why does the file size get so huge so quickly? For example, more than one of my databases can grow from 50MB up to 900MB in less than 2 weeks. This has happened several times and is getting annoying, especially because I have to kick off my users in order to compress the database.
Some handy dandy links:
Microsoft Help & Support: How to optimize Microsoft Access when using ODBC data sources
Maximum 1GB size on Access 97 databases - Microsoft Help & Support: You may receive an "Invalid argument" error message when you run an append query, run a make-table query, or import data in a large Access database file
|
Posted by Frozone Permalink on March 07, 2007 10:11 AM
| Comments (0)
|
|
| Tweet | |
February 03, 2007
Filesystem permissions on LDB file: connection pooling and Tomcat clustering
Before moving on to more interesting/important things, I've just got one last note about Database connection pooling & clustered Apache Tomcats for anyone who may have been following along.
'Summary from last time: My database connection pool was leaving a lingering LDB file after it had opened a connection, ran a query, then closed it again with a java.sql.Connection.close(). This meant that while my Tomcat was running, I couldn't open up the database using the Microsoft Access application to view any of the tables or data or anything. Instead, I would get the error, "The database that you are trying to open or convert is currently in user, or you do not have permission to open it exclusively". Shutting down my Tomcat service still wouldn't make the lock file go away.
To run an ideal test case, I created a new separate web application whose purpose was to test this 1 exact thing. With only 1 database and only 1 connection call, the LDB file was STILL there -- so I could guarantee that I didn't have any loose connections in my own software. This was no programming error; there was definitely something wrong either with my connection pool setup or with Microsoft Access itself.
The answer to this whole bloody problem caused me to sprout my second-ever gray hair at the lovely young age of twenty-five.
The answer? Navigate through your filesystem and "delete" the LDB file.
URGAH!
So, there we have it. My software is fine, my Tomcat clustering & database connection pooling is set up properly, and all the locks were in fact closing properly.
I suspect that the process running my Tomcat server simply doesn't have the filesystem permissions required to perform the Modify/Delete functions required to update that lock file. Apparently Access isn't smart enough to figure out if there are actually any connections open on the database or not -- it simply looks at the lock file and believes what is written in there. Here is an article from Microsoft about LDB files. According to this article, my Tomcat will need the "Full Control" permission to update the LDB file. (At least, I assume it is the Tomcat process that needs the permisssion.... it may also be the local ODBC process on the database server; I'll have to test both.)
During my search, I also stumbled upon this series of articles -- I enjoyed them very much:
A day in the life of a memory leak hunter
Yet another day in the life of a memory leak unter
Memory leak hunting still doesn't end, or: Serialization also requires a bit of manually imposed amnesia.
|
Posted by Frozone Permalink on February 03, 2007 10:22 AM
| Comments (0)
|
|
| Tweet | |
September 02, 2006
BibTeX 101
I have a paper in my hand. I've read it. I may need to use it as a reference later on. So, how do I add an entry for this paper in my BibTeX database?
When I search for a paper on CiteCeer ( example) it does not always provide BibTeX code for me to copy/paste into my database. (Example of a paper that DOES have BibTeX provided.) So, what do I do? Can I arbitrarily create my own BibTeX key, or, are these regulated somehow? For now I rely on Spotlight to search through all the papers I have saved on my computer - which does an excellent job, by the way -- but it will not automatically build a references section for me.
Ah well. I'm sure I'll figure this stuff out eventually.
|
Posted by Frozone Permalink on September 02, 2006 10:39 AM
| Comments (0)
|
|
| Tweet | |
April 16, 2006
Adobe SVG Viewer on OS X - Intel Mac
I tried running the foafnaut so I could experience first-hand the Friend of a Friend project. The foafnaut requires Adobe's SVG Viewer browser plugin.
"Fair enough," I thought, and I downloaded it.
The darned thing doesn't work. After the dowload, I ran the executable and then clicked "Click here to test your plugin."
Here is what my web browser told me:
"The page “Scalable Vector Graphics” has content of an unspecified MIME type. Because you don’t have a plug-in installed for this MIME type, this content can’t be displayed."
Obviously, the plugin-install didn't work. I shut down the browser, tried again; same result. I tried a couple of different browsers. No luck.
Right-clicking on the SVG plugin application does not tell me if the app uses a Universal or a PowerPC binary. Since it's not specified, I assume that it is not a Universal app. I am hoping that Adobe will release a Universal version of this plugin so that it will work with my intel mac (assuming that that's the problem in the first place).
Sigh! =(
Too bad, FOAF; we had a good run, as short as it was. I even tried using FOAF webview interface but it appears to be disabled.
I will try to find a different RDF-based application that does not require me to install a new piece of software , unlike FOAF and Haystack. I found a reference on W3's site about RDF-based applications; maybe I'll find something there.
The fact that I'm doing this research project right at the same time that I switched computers from a PowerPC chip to an Intel Dual Core chip is just bad luck.
To conclude with something positive: My husband gave me a dozen roses for Easter. That makes me feel better! =D =D
|
Posted by Frozone Permalink on April 16, 2006 10:49 PM
| Comments (2)
|
|
| Tweet | |
April 15, 2006
Haystack on OS X Intel Mac
I ran the installer as per instructions and the "Haystack" menu is not appearing in Eclipse's menu bar. *sniffle, cry*
Could I be seeing the same problem as before? Is Haystack written using PowerPC binaries instead of Universal binaries....?
Ah, maybe Haystack is not running in eclipse because I am missing the "GEF feature" , which stands for Graphical Editing Framework and has a page under eclipse.org.
According to these other Haystack install instructions, I can find out if I have the "GEF feature" by looking in Eclipse under Help --> Software Updates --> Manage Configureation. I don't see "GEF" anywhere, do you?

Assuming that the absense of GEF is actually my problem, I went to the official GEF download page on eclipse's site. Latest version appears to be 3.1.1. I downloaded the GEF runtime. Gah! In the readme, it seems that GEF is only available for PowerPC...

I also went under eclipse: Help --> Software Updates --> Find and Install on "Eclipse.org update site" and it told me, "No features found on the selected site(s). Choose a different site or site category."
Somebody out there please tell me that GEF is available out there somewhere in a Universal binary!
* * *
*Sigh!* After another couple of hours of Googling for answers, Haystack still won't run. So, I've officially decided to choose a different RDF-based applicataion to examine. It was a difficult decision to make after I've invested so many hours in trying to get it to run, but I simply have to move on. On the bright side, I did discover a new and excellent Java development tool - Eclipse. I've decided to adopt this tool instead of my current one.
So, next time, I'll try to examine the adoption of RDF into a different tool. I think that the FOAF project might be cute.
|
Posted by Frozone Permalink on April 15, 2006 04:57 PM
| Comments (0)
|
|
| Tweet | |
April 08, 2006
Broken Java applications on OS X - Intel Mac
I left off trying to get the Firefox extension, Piggy Bank, to run. This post describes my journey to get it working again.
After the Piggy Bank install, I was supposed to restart Firefox and then some sort of wizard was supposed to appear. But it didn't. Instead it crashes. Grrrr.
I thought, "Maybe it's because I've got this new dual-core Intel processor in my Mac...? Probably not, but this is crazy enough to arouse superstition." Little did I know, I was right.
First, I discovered that there is a known issue with Piggy Bank on Mac OS X. The solution is to let the installer run for a long time, because the problem is simply caused by a slow installer script. I let mine run for an hour, but it sitll didn't work.
- I noticed that I still had java 1.4.2. I upgraded to java 1.5 for Mac OS X Tiger but that still didn't help.
- At this point I noticed that my JBuilder & Eclipse were also fried. These java applications would simply hang (like Firefox does) when I tried to open them. Oddly, using java in the Terminal seemed to work fine.
- I tried setting JAVA_HOME, CLASSPATH and PATH environment variables, like this:
setenv JAVA_HOME /System/Library/frameworks/JavaVM.framework/Home
Then, I put it in my login script like this:
cd ~
vi .login
setenv JAVA_HOME /System/Library/frameworks/JavaVM.framework/Versions/1.5/Home
setenv PATH $JAVA_HOME/bin:$PATH
There, now each time when you log in and echo $JAVA_HOME, you get the correct path. You also get the correct path when you go "which java" and "java -version". (References: Mac OS X & Java: Where's my $JAVA_HOME? and Better MacOSX Java 1.5 Installation
Unfortunately, that didn't help either.
Then I found out that 64-bit Eclipse does need a 64-bit JRE, but I didn't know how to tell if I have a 64-bit JRE or not. (My husband later pointed out to me that I have 2 32-bit processors, so, no, I didn't need the 64-bit JRE anyway.)
I did some digging into crash files. Here's what I got:
On Eclipse:
java.lang.UnsatisfiedLinkError: /Applications/eclipse/configuration/org.eclipse.osgi/bundles/63/1/.cp/libswt-pi-carbon-3139.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1495)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.carbon.OS.
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:856)
at org.eclipse.swt.widgets.Display.create(Display.java:836)
at org.eclipse.swt.graphics.Device.
at org.eclipse.swt.widgets.Display.
at org.eclipse.swt.widgets.Display.
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:394)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:155)
at org.eclipse.ui.internal.ide.IDEApplication.createDisplay(IDEApplication.java:128)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:79)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
On JBuilder:
Java for ppc cannot run in this configuration.
Please consult documentation.
VM creation failed.
On Firefox:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
The JBuilder note was the most helpful. It seemed to confirm that something at the java level was designed for the PowerPC processor.
I re-installed Mac OS X Tiger again (using Archive & Install), did the Software Update again. Still nothing.
Then I read a blog posting (I will try to find it again so I can link it) that told me to check the info window on my java applications. Ahhhh, HA!!!!!!!!!!!!! (see how it says that the app is for the PowerPC processor? LOL)

Next, I read that there is a different version of eclipse that supports Intel Macs. Kewl. I followed the link to download it.
114 MB Dowload later: HOLY DOODLES!!!!!!!!!! It frickin' worked.
*sobs of joy*
And it only took 7 hours.
Now to install Firefox for my Intel Mac.
|
Posted by Frozone Permalink on April 08, 2006 01:09 PM
| Comments (7)
|
|
| Tweet | |
April 05, 2006
Firefox - "Piggy Bank" plugin on Mac OS X
Ah, I think that I have found a solution for my RDF-generation problem: I need a "Screen Scraper". It seems that for each page that needs the domain knowledge extracted from the pedagogical technique you need a different Screen Scraper. There appears to be a really good Screen-Scraper-generator available called Solvent.
(Ooooh. I have just installed it. Dude, this is SO COOL!)
At present, all of our course material is set up into web pages, but no RDF information has been explicitly left behind. We do have teacher blog feeds being published using RDF files, but we want to represent domain knowledge itself, not just blog entries. I want to see if I can "Scrape" some domain knowledge off of one of our teacher's lesson pages. Then I can start looking at how an AI engine might travel through such domain knowledge and use it for teaching purposes.
(Pause while I go "scrape" my first web page.)
I scraped the list of Cyber School course offerings for the 2005-06 school year (currently in progress). 'Not really educational material but at least it is structured information, which makes it easy for my purposes.
(Here is where I had loads of trouble getting Piggy Bank to run. In short - I had recently upgraded my computer from a PowerPC iMac to an Intel iMac using and "Archive and Install" OS upgrade. After I upgraded all my applications from their PowerPC versions to the Universal versions, I was okay. You can read about the details in my other post.)
|
Posted by Frozone Permalink on April 05, 2006 07:50 AM
| Comments (0)
|
|
| Tweet | |
Index to Steph's Notes
Feb. 24th 2007 - Weee! This new part of my website is not an entry, but rather a permanent fixture whose purpose is to "Look Down on All Those Notes With Some Grand Vision of Organization". Wish me luck. LOL- Representing meta-data (fuel) & the different kinds of "hooks" that intelligent systems can use (how fuel is injected into the motor of the engine)
- Motivation: Semantic net / Rationalizable to a machine
- Semantic network
- Genetic graph
- Prerequisite AND/OR graph
- Constraint Satisfaction Problems
- Bayesian networks / causal graphs
- Technology & Philosophy: RDF, modus ponens,
- Predicates, Logic & situation calculus
- What kinds of data? - What kinds of meta-data would an AIEd system possibly need, and how is it represented?
- task domain knowledge
- "is-prerequisite-to"-type knowledge
- interactions with learning objects & other learners - (location, composition is-a/part-of, sequencing by restricting navigation, personalization, ontologies for LO context)
- lesson plans, curriculum plans, practicing sessions (What is stored, what is generated on the fly? What is remembered?)
- How to organize it - When is it stored in a database? Meta-data? Agent memory banks? Protocols? Repositories? XML files? Home-servers? WSDL services? Frameworks? Portable banks? P2P access?
- Database of object-agent interactions
- Concept of "Home" on a P2P network -- maybe the bulk of a learning object's usage data is on its home server and can be queried using WSDL or something ? Similar homes for each student's usage history, etc. Baggage problem.
- Links to the ontologies
- referring to a concept/relationship - ex. AgentOwl?
- Generation of this data
- Rationalization: For use by other AIEd systems
- What is generated - discuss items under part I.C.
- When it's generated - describe procedural model, which parts of the engine generate what (isa-part-of data, XML feeds, web services, meta data bout groups and collaboration, protocols, examples Friend of A Friend FOAF project)
- Technical notes of HOW it's generated: JENA, issues of implementation demo, my Hermione & Ron agent examples, lol
- Usage of this generated data - see part IV. A.
- Given the engine, who uses it?
- Students / Learners / "Me"
- instructional planning, student model, pre-requisites, tutoring, coaching, collaboration,constructivism
- Teachers / Educators / "Me"
- putting together lessons
- be able to browse through task domain knowledge in an objective / encyclopaedia format, then be able to pick-and-choose what you need for your students
- compose examples, design explanations, pull together diagrams, learning objects, etc. Haystack Relo?
- Administration / Governement / Structure / Crowd Control
- as restrictions/obstacles/sand pit to the robot in agent environment
- can't just have a swarm of students and teachers out there -- need structure of courses, curriculum, objectives, requirements (at least, we do in this day and age!) - Report cards, evaluation, feedback
- government, marks, certificates, requirements, funding, curriclum, attendance, delinquent, non-attending, motivation
- school''s images, goals, strengths, payroll, HR, security, accounts, permissions, privacy
- registration, failed courses
- User Environment -- How does this engine work? What does the user see on the screen?
- Introduction - Given a background in educational psychology, how does the system present itself -- what does the user see, and were does this data come from? Links to thoughts from part I.)
- Task Domain Browsing - Suppose you're you're just idly browsing through the "raw" content. How would it look when it's not wrapped around a learning-context or lesson or tutorial or anything. 'Cross between browsing a raw task domain ontology and browsing a learning object repository.
- Cleaning up the data -- Visualizing the data for humans to pick through the task domain and work on it. Suppose the "Subject Expert" discovers an advancement in science and needs to update the "world's" domain knowledge. (I used the "Subject Expert" terminology from Ontologies to Support Learning Design Context - Thanks Chris) How would they make corrections to ontologies and learning objects, or at least point the users of "old" objects towards adopting the newer ones.
- "Modes" - Learning & Lessons / Checklist - Homework, Assignments, Courses being taken / Collaborative mode / Teaching mode / Calendar- email -adminisrative mode -- See also the different kinds of scenarios in the ActiveMath system
- Evolution of this engine
- target some key implementation hooks discussed in part I - design an experiment/demo
- scrape a page - (Note, scraping can only give objective data, not in-context dat)
- LO repository - related to browsing the task domain?
- a learners "To Do" list - where does it come from? Assignments, courses.
- sample group scenario
- sample teacher lesson planning
- sample data "left behind"
- sample use of that data
- Data mining (for what? lol )
- discovery / generation of ontologies - when do you need to hunt for them, and when do you have to have a solidly-known & predictable ontology?
- I/O - where it happens, which languages, protocols, which agents perform i/o and when, precepts, actuators
- Role Assignments
- My Environment Adapts to me
- Displaying feedback from the server on JSP pages (Software engineering considerations)
- Sketching out a design (Content planning vs. Delivery planning)
- agent negotiations / social structures / ummm... Web 2.0 ?
- garbage collection of meta data
- Artificial Intelligence & Evolution
- Memory Culling: Necessary part of intelligence? (artificial or human)
- Applications for the Genetic/Evolutionary algorithm
- open learning environments
- Agents, pets, grouping, Community modelling
- Protocols - finding groups, cyber dollars, state diagrams (?)
- "Community Studies" - graphs & communication hubs, types of communities (free-for-all, hierarchy of authority, etc.)
- implications of joining a community - what do you share, which parts of your student model are relevant
- Walls & sand traps -- deliberate restrictions as problem-solving for learning
- Communication channels - individual-to-individual, individual-to-community, chat channels, agent-only "administrative" communications, ex. requests for related learning objects in a particular community, etc.
- Educational/Pedagogical focus (this part probably shouldn't be its own section but rather incorporated into the whole picture, but it's separate for me right now because I'm still only just starting to learn about it.)
- Semantics - what there is to talk about in Education
- ex. Merril's First Principles of Instruction, linking educational terms to AI terms
- Pedagogical skills for tutors -- supporting human *and* artifical tutors
- Student modelling - what the machine needs to know about the student, pedagogically-speaking, about learning history/preferences
- Roles - Simulated students, Coaches, Tutors, Teachers,
Syndicate this site (XML)

