plywood

Members
  • Content count

    248
  • Joined

  • Last visited

Community Reputation

103 Neutral

About plywood

  • Rank
    Member
  1. Eclipse build path blues

    I am new to Eclipse and would like to set up a specific directory structure for my packages. For example, for my project MyProj (which uses the default MyProj/src and MyProj/bin for I/O), I want the following structure: com.myproj.core com.myproj.core.utils com.myproj.core.widget com.myproj.testing com.myproj.xml So the 'core' package needs to have two "nested" packages named utils and widget. So I right-click my core package in Package Explorer, go to New >> Package. The dialog that pops up (New Java Package) has 2 textfields and a Browse button. One text field is for defining the Source Folder that the package will live in, the other field is for naming the package. The default values for the Source Folder are MyProj/src, and the default name is already populated as "core". When I try to Browse for another package, it doesn't see anything below MyProj/src, and when I try to manually type in MyProj/src/core it gives me an error of Source folder is not on the build path. I have double-checked to make sure that the core package is properly set up to be a top-level package in the src folder. When I right-click MyProj and go to Build Path >> Configure Build Path, it won't let me add core to the build path, giving me an error of Cannot nest 'MyProj/src/core' ins... exclude 'core/' from MyProj/src What is going on here? I just want to add utils and widget to core!?!?
  2. svn server help

    I have never installed SVN before and am trying to use it, but the instructions I've found aren't answering some basic questions. I have successfully configured Subversive inside Eclipse, and my *understanding* is that I can now use the Subversive plugin to browser and manipulate SVN repositories that are either local on my machine, or living remotely on a server. I have a web server with a reputable hosting company, and would like to install svn server on it; this is where I want my repository to live. I figured I could download the server's binary(ies) and then ftp them into the web root where I want them to reside. Then all I should need to do is configure Subversive to point to that URL, credentials and repository, and I should be in business. The only thing I'm leary about is whether or not I can install svn server without contacting their tech support first, but that's a separate issue altogether. The first thing I need to do is *find* the svn server binary. Going to tigris' website, it looks like the project has been adopted/bought by Apache. Since I have both a Windows dev machine and web server, I am limited to a set of 4 or 5 available svn server wrappers (CollabNET, VisualSVN Server, etc.). But I don't think these are what I want: they all seem like client-side GUI apps for controlling your remote svn server, just like Subversive already does. How can I find and install the svn server binaries to my web server (assume this doesn't cause a problem with tech support)? Thanks, ply
  3. How code actually gets "rolled out"

    coderx75 - Thanks for the good link, I will start digesting it this weekend! Although I'm very interested in release strategies "best practices", I think everybody is so far ahead of me here, that my real question is being overlooked! All I'm asking is: how does code get migrated from a test server to a production server? Is it really just a copy-n-paste? I would think that there would be some automated check to ensure that only the most current release code gets rolled out to prod, eliminating the possibility of (mistakenly) rolling a 5.0 config back to a 2.3 version (which could very well happen if you have human beings copying and pasting targets between directories, etc.). Let's say, just pretend here!, that we had a SVN repo for our project called myproject. And in this repo were many folders, but only the wombat\ folder contained code that should always be in production. When you're ready to launch, your buildmeister uses SVN move to copy files into wombat\. Now then, how do we update production with the configuration that is in wombat\ ?
  4. How code actually gets "rolled out"

    What if I want to do the code migration manually? I'm struggling with how code gets "pushed out" (copied, checked out, whatever the applicable term is!) from one environment to the next. For instance, let's say we were ready for a 1.0 release. The tested code is already in SVN and is ready to get copied/checked out/rolled out from the test server to the production server. How does one do this manually?
  5. So, using SVN as an example: "MyProject" has a svn repo called myproject. Inside of this, in keeping with standard SVN/VC practices, I create three folders: trunk\, branches\ and tags\. Let's say the project is a web application and so has a dedicated test server for its "testing" environment, as well as a production server for prod. Code needs to migrate from individual developers' sandboxes (say, Apache running as localhost on each dev machine) to the test server, then on to the production server. My *understanding* is that there is only 1 repo per project regardless of however many environments (sandbox, testing, production, etc.) you have configured. This means that if code is declared as being ready for testing, the buildmaster (or whoever has the appropriate privs) must "move"/"copy"/"checkout" code from, say, branches\dev\ to the project root residing on the appropriate server (test server or prod). How does this "rollout" take place, and similarly, "rollbacks" when unstable code is replaced with a stable, previous version? Does SVN have an "export" tool that allows you to copy/deploy one of its folders (branches\dev) to a particular URL? I'm sure everybody does it differently, so I'm just looking for what the normal procedures are for this. Thanks, ply
  6. Free XML generator for Windows and/or *nix?

    Sorry I wasn't clear! I have a schema, let's call its widget.xsd. This schema dictates the formatting for the XML that my application consumes. My application accepts widget.xsd-validated XML ("Widget XML") and uses it. My schema is very complicated and results with fairly large XML files. Writing sample/dummy XML by hand for testing purposes will be tedious and time-consuming. Many commercial XML editors have "XML Generator" features that allow you to point them to a schema (widget.xsd) and will use the rules of that schema to generate dummy XML for testing purposes. I've been looking all day, and can't find any for Windows or Linux that are free - and this is the basis of my original post. Hope this helps! ply
  7. So I have a very complex XSD and I'd like to generate dummy XML for testing with my application. "Big Applications" like Stylus, Oxygen and Altova all have XML generation features, but they're fairly expensive for a poor, dirt-broke soul such as myself. I'll be needing this tool for a *long time*, so downloading trial versions of these programs really isn't feasible for me. Any open-source or freeware generators you all can recommend? Thanks, ply
  8. Why use bash?

    Well, more specifically, why use any shell in favor of a GUI such as Gnome or KDE? I am a *brand new* Linux (Ubuntu) user trying to give Linux an honest chance, and so far, I absolutely love it. I love how easy it is to search for & install applications, the enormous myriad open source tools, the concept of user- and group-ownership over file system object permissions, etc. But for the life of me, I can't figure out what the added benefit is to opening a bash terminal and meticulously keying in "sudo mkdir opt\a\b\c\my\directory" vs. just doing the same thing with a few clicks of a GUI desktop system. I'm sure 40,000 Linux users can't be wrong, so there must be some big benefit to scripting shell commands vs. using visual desktops to do trivial work tasks. But I can't see it, and was hoping a some of you could nudge me in the right direction here. Thanks! ply
  9. I am trying to make some heavy modifications to an open source Flash-based graphing utility called FusionCharts Free. For my particular application, I need a way (in ActionScript) to access the last frame of the animation, and get at the actual image file/pic that was used for that last frame. I am not an ActionScript developer, and all my attempts to find an answer on my own have been futile. The closest methods I was able to find were gotoAndPlay(scene,frame) and gotoAndStop(scene, frame). Both return nothing and simply advanced the playhead to a specific scene or frame. To reiterate, let's say I have 100 images that I want to put into a Flash animation (.SWF file) at the rate of 10 fps (with their being a 1:1 image:frame ratio, of course). Then we would have a 10-second animation, with 10 fps, and in the first second we might see the following images "scroll through": 1. ./images/frame00.gif 2. ./images/frame01.gif 3. ./images/frame02.gif 4. ... 10. ./images/frame09.gif In this example, we might expect the last frame to be ./images/frame99.gif (the 100th image in the 100th frame). I need a way to get at that frame99.gif in ActionScript! Because I'm not an ActionScripter, here is some pseudo-code that summarizes what I need to do; I'm not really worried about the semantics/syntax of AS right now as I'm confident I can figure the mechanics out once I know what methods to call: // Obtain the image file var imageFile = getLastFrame(); Thanks for any suggestions or input - thanks!
  10. Hi I'm trying to build a simple website to host my Java game. I have a decent amount of Java/OOP development experience but am very weak when it comes to anything web-related. I know that the modern standard is to make horizontal navigation menus using unordered lists (ul tags) combined with CSS. I've read several tutorials but none of them seem to be working for me. I'm using FF 3.6 over Windows XP (not that the OS really makes a difference, or so I think). I'm trying to create a horizontal menu that has drop-down submenus. Both the menu tabs as well as individual items on each of their submenu are links that bring you to a different page. Here is my HTML: <ul id="tabs"> <li>Menu Tab #1</li> <ul> <li>Submenu Item #1</li> <li>Submenu Item #2</li> </ul> <li>Menu Tab #2</li> <ul> <li>Submenu Item #1</li> <li>Submenu Item #2</li> </ul> </ul> Here is my CSS: ul#tabs { margin: 0; padding: 0; list-style: none; width: 150px; } ul#tabs li { position: relative; list-style-type: none; display: inline; } li ul { position: absolute; left: 149px; top: 0; display: none; } Despite specifying my lists to be "inline" and to have no list-style, what I'm getting is just an indented set of links, but they are still vertical, like lists are set to do by default. My menu tabs ("ul#tabs") are in line with the left border of the page, underneath one another, and each of their submenus are simply indented underneath each respective menu tab, like you would normally get when you put a list inside of another list. Can anybody see anything wrong with my CSS? My HTML? Thanks!
  11. Design pattern check...

    Thank you rip-off & OrangyTang. OrangyTang, how would the code look via reflection? Let's say our Widget had a protected int member named xType: public abstract class Widget { protected int xType; // ... } Now let's say, that the doSomething() method in each subclass simply sets xType to a different value, particular to that class. How would we define a reflection-based model in the Widget superclass?
  12. Design pattern check...

    [Java] I have an abstract base class and several child classes: public abstract class Widget { // ... public abstract void doSomething(); } public class Fidget extends Widget { // ... public void doSomething() { // ... } } public class Foo extends Widget { // ... public void doSomething() { // ... } } public class Fizz extends Widget { // ... public void doSomething() { // ... } } As you can see, Fidget, Foo and Fizz all extend Widget and override its abstract doSomething() class. In my driver, I need to load and invoke the doSomething() method of a class that is dependent on user input. My solution (so far) has been to create a WidgetFactory class that takes the user input and returns an instance of the appropriate class: int x = getUserInput(); Widget widget = WidgetFactory.getWidget(x); widget.doSomething(); My question is: is this the "correct" way of doing things? If not, what is and why?
  13. I'm looking for a good Java code analyzer, and all my preliminary research has turned back mediocre results for each prospective utility. Here are some things I am looking for: (1) I'd like it to have an eclipse plug-in that is invocable from Ant (2) I'd like good coverage of design-quality metrics (3) Good ratings & user reviews (4) It *must* be open source! (5) I'd like it to be an active project that gets updated regularly; the few good ones I was able to find on my own (JCSC, etc.) haven't been updated in 5+ years I appreciate any and all suggestions! Thanks, ply
  14. Build management example

    I'm interested in how learning & using a build management tool (like ant, maven, etc.) can help: (1) make me a better developer, and (2) improve control over my projects. I'm currently reading the Apache Ant tutorial, and for the most part I'm understanding everything just fine... But I'm having a tough time seeing how build systems are really useful as opposed to just compiling my code through an IDE. And, every Google search for "build tool examples" or "ant example" just brings me back to a tutorial for how to use the tool (i.e., write the xml config file properly, etc.). I'm not looking for a tutorial on how to use a hammer properly. I'm looking for a reason for why I would need to use a hammer in the first place. I'm wondering if anybody can give me a simple example of how a build management tool is superior to raw compilation. Note: I'm not trying to dispute the usefulness of a build system here. I'm *sure* there are loads of benefits... I just don't see them yet. Thanks, ply
  15. I am new to the Java DOM (package org.w3c.dom) and have read several tutorials on its basic use, but cannot find the answers to what I feel are some very basic questions. In org.w3c.dom (the "Java DOM"), Documents, Elements and Nodes are interfaces all representing the components of an XML document, which is a tree structure where each node can have 0+ children (representing the recursive nature of XML itself). The Document interface represents the entire document, whereas Elements (which extend Nodes) represent a specific tag/element in an XML document, and all of its children (the subtree extending from the Element). QUESTION #1: What *class*, then, actually represents the tree data structure of the XML document? Document, Element and Node are interfaces, meaning they can only provide abstract methods and static members. For instance, Node has a method called "getFirstChild()"... since this is an interface method, it has to be abstract... so where is it defined? Another way to look at this question is: noises.xml ======== <animals> <cow noise="moo"/> <dog noise="woof"/> </animals> DomTestDriver.java ================== DocumentBuilderFactory dbf = new DocumentBuilderFactory() DocumentBuilder db = dbf.newInstance(); Document doc = db.parse("noises.xml"); Element root = doc.getRoot(); Element cow = root.getFirstChild(); Here I have read/parsed noises.xml into a Document object. I am now free to explore the document, modifying it as I wish, etc. When I call root.getFirstChild(), somewhere, somehow, a tree structure is holding an in-memory version of noises.xml, and getFirstChild() queries that structure for the correct Node to return... +what is this structure?!?+ It must be a class... so what is it??? ***End of Question #1*** Second, it would be nice if I could modify a Document object or Element at runtime. For instance: Element horse = new Element(); horse.setTagName("horse"); horse.setAttribute("noise", "naaay"); root.replaceChild(horse, cow); // Now, the 'doc' Document object, which originally parsed noises.xml, looks like: /* <animals> <horse noise="naaay"/> <dog noise="woof"/> </animals> */ Several problems with the code sample above: (1) Element is an interface! I can't instantiate it like "Element horse = new Element();" (2) Neither Element nor Node specify a "setTageName(String)" method, telling me that Java does not want me using the Java DOM like this... why?!?! QUESTION #2: So, if my code sample above doesn't work, how do I create new Element objects and insert them into my Document object, or into another Element's subtree?