comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * generating soccer fixtures from a list of teams - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3bc75ad6573fd908 * Homework - Was Re: java programe help - 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fddd0a49ac12937 * tomcat 4.x : setting mime type for a directory or setting a default mime type - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/967946fe70b1bf90 * Append one array to another array - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d * jar file, not being accessed - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7be536529d2ceb23 * Developing MIDlet for PDAs and cell phones - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d0109d66581670e * Deploying MIDlet via cable? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/939c5a9412e6b4a8 * regex: remove file ext - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9292732e966a520c * Best references for buidling a webcrawler - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/794947bf20d69623 * Does this finally get executed ? - 7 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e0d9fa26e656cf72 * multiple forms and one servlet - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4dacdcfce2b3903e * Setting up a filter based on server name - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/801866155eeb6057 ========================================================================== TOPIC: generating soccer fixtures from a list of teams http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3bc75ad6573fd908 ========================================================================== == 1 of 2 == Date: Fri, Oct 29 2004 10:23 am From: "zcraven" <[EMAIL PROTECTED]> ok forget all that code before, it was crap. The problem is that it is not updating the dates as I want it to. The first error (see printout below) occurs here: Man Utd vs Arsenal @ Old Trafford 24-May-2004 @ 15:00 (03-May-2004 @ 15:00 is correct) Basically I want to create a whole fixture list, and I dont want the same club to have two games on the same date. Whats wrong with my maths? This is the code: public void createFixtureList() { // set up todays date for later reference Calendar today = new GregorianCalendar(); today.set(Calendar.MONTH, 2); //temp today.set(Calendar.HOUR_OF_DAY, 15); today.set(Calendar.MINUTE, 00); today.set(Calendar.SECOND, 00); //set up 'matchdate' as a date object with todays date, and 15:00 Calendar matchdate = new GregorianCalendar(); matchdate.set(Calendar.MONTH, 2); //temp matchdate.set(Calendar.HOUR_OF_DAY, 15); matchdate.set(Calendar.MINUTE, 00); matchdate.set(Calendar.SECOND, 00); int j = league.size(); j--; // no need to create fixtures for last club in league, as all will have been generated already by previous clubs for (int i=0; i<j; i++) { //get a CLUB(i) and create all possible fixtures for it Club c1 = (Club)league.get(i); System.out.println(" i=" + i); for (int x=i+1; x<league.size(); x++) { // get an opponent club - CLUB(x) to create 2 fixtures (home/away) with club(i) Club c2 = (Club)league.get(x); // HOME GAME - CLUB(i) vs CLUB(x) // set game date for one week after the previous club(i) matchdate (or today if this is 1st game) matchdate.add(Calendar.DATE, 7); Fixture f1 = new Fixture(c1.getGround(), matchdate, c1, c2); fixtures.add(f1); System.out.println(f1.getFixtureClubs() + " @ " + f1.getFixturePlace()); f1.displayFixtureDate(); // AWAY GAME CLUB(x) vs CLUB(i) // set away game for exactly 6 months after the home game // awaydate = homedate; matchdate.add(Calendar.MONTH, 6); Fixture f2 = new Fixture(c2.getGround(), matchdate, c2, c1); fixtures.add(f2); System.out.println(f2.getFixtureClubs() + " @ " + f2.getFixturePlace()); f2.displayFixtureDate(); matchdate.add(Calendar.MONTH, -6); } // before getting next club(i), give two weeks space to avoid having 2 matches on the same date matchdate = today; matchdate.add(Calendar.DATE, 14); System.out.println("reset date to today, then added 14"); } printFixtureList(); } this is the system.out: [ league1.createFixtureList() ] i=0 Liverpl vs Chelsea @ Anfield 05-Apr-2004 @ 15:00 Chelsea vs Liverpl @ chelseas ground 05-Oct-2004 @ 15:00 Liverpl vs Man Utd @ Anfield 12-Apr-2004 @ 15:00 Man Utd vs Liverpl @ Old Trafford 12-Oct-2004 @ 15:00 Liverpl vs Arsenal @ Anfield 19-Apr-2004 @ 15:00 Arsenal vs Liverpl @ Highbury 19-Oct-2004 @ 15:00 Liverpl vs Newcastle @ Anfield 26-Apr-2004 @ 15:00 Newcastle vs Liverpl @ St.James Park 26-Oct-2004 @ 15:00 reset date to today, then added 14 i=1 Chelsea vs Man Utd @ chelseas ground 19-Apr-2004 @ 15:00 Man Utd vs Chelsea @ Old Trafford 19-Oct-2004 @ 15:00 Chelsea vs Arsenal @ chelseas ground 26-Apr-2004 @ 15:00 Arsenal vs Chelsea @ Highbury 26-Oct-2004 @ 15:00 Chelsea vs Newcastle @ chelseas ground 03-May-2004 @ 15:00 Newcastle vs Chelsea @ St.James Park 03-Nov-2004 @ 15:00 reset date to today, then added 14 i=2 Man Utd vs Arsenal @ Old Trafford 24-May-2004 @ 15:00 Arsenal vs Man Utd @ Highbury 24-Nov-2004 @ 15:00 Man Utd vs Newcastle @ Old Trafford 31-May-2004 @ 15:00 Newcastle vs Man Utd @ St.James Park 30-Nov-2004 @ 15:00 reset date to today, then added 14 i=3 Arsenal vs Newcastle @ Highbury 20-Jun-2004 @ 15:00 Newcastle vs Arsenal @ St.James Park 20-Dec-2004 @ 15:00 reset date to today, then added 14 == 2 of 2 == Date: Fri, Oct 29 2004 10:53 am From: Bruno Grieder <[EMAIL PROTECTED]> zcraven wrote: > ok forget all that code before, it was crap. The problem is that it is not > updating the dates as I want it to. The first error (see printout below) > occurs here: > > Man Utd vs Arsenal @ Old Trafford > 24-May-2004 @ 15:00 > > (03-May-2004 @ 15:00 is correct) > > Basically I want to create a whole fixture list, and I dont want the same > club to have two games on the same date. Whats wrong with my maths? > > This is the code: > > > public void createFixtureList() > { > // set up todays date for later reference > Calendar today = new GregorianCalendar(); > today.set(Calendar.MONTH, 2); //temp > today.set(Calendar.HOUR_OF_DAY, 15); > today.set(Calendar.MINUTE, 00); > today.set(Calendar.SECOND, 00); > > //set up 'matchdate' as a date object with todays date, and 15:00 > Calendar matchdate = new GregorianCalendar(); > matchdate.set(Calendar.MONTH, 2); //temp > matchdate.set(Calendar.HOUR_OF_DAY, 15); > matchdate.set(Calendar.MINUTE, 00); > matchdate.set(Calendar.SECOND, 00); > > int j = league.size(); > j--; // no need to create fixtures for last club in league, as all > will have been generated already by previous clubs > for (int i=0; i<j; i++) > { > //get a CLUB(i) and create all possible fixtures for it > Club c1 = (Club)league.get(i); > System.out.println(" i=" + i); > for (int x=i+1; x<league.size(); x++) > { > > // get an opponent club - CLUB(x) to create 2 fixtures > (home/away) with club(i) > Club c2 = (Club)league.get(x); > > // HOME GAME - CLUB(i) vs CLUB(x) > // set game date for one week after the previous club(i) > matchdate (or today if this is 1st game) > matchdate.add(Calendar.DATE, 7); > Fixture f1 = new Fixture(c1.getGround(), matchdate, c1, c2); > fixtures.add(f1); > System.out.println(f1.getFixtureClubs() + " @ " + > f1.getFixturePlace()); > f1.displayFixtureDate(); > > // AWAY GAME CLUB(x) vs CLUB(i) > // set away game for exactly 6 months after the home game > // awaydate = homedate; > matchdate.add(Calendar.MONTH, 6); > Fixture f2 = new Fixture(c2.getGround(), matchdate, c2, c1); > fixtures.add(f2); > System.out.println(f2.getFixtureClubs() + " @ " + > f2.getFixturePlace()); > f2.displayFixtureDate(); > matchdate.add(Calendar.MONTH, -6); > } > // before getting next club(i), give two weeks space to avoid > having 2 matches on the same date > matchdate = today; > matchdate.add(Calendar.DATE, 14); > System.out.println("reset date to today, then added 14"); > } > printFixtureList(); > } > > > > > this is the system.out: > > [ league1.createFixtureList() ] > i=0 > > Liverpl vs Chelsea @ Anfield > > 05-Apr-2004 @ 15:00 > > Chelsea vs Liverpl @ chelseas ground > > 05-Oct-2004 @ 15:00 > > Liverpl vs Man Utd @ Anfield > > 12-Apr-2004 @ 15:00 > > Man Utd vs Liverpl @ Old Trafford > > 12-Oct-2004 @ 15:00 > > Liverpl vs Arsenal @ Anfield > > 19-Apr-2004 @ 15:00 > > Arsenal vs Liverpl @ Highbury > > 19-Oct-2004 @ 15:00 > > Liverpl vs Newcastle @ Anfield > > 26-Apr-2004 @ 15:00 > > Newcastle vs Liverpl @ St.James Park > > 26-Oct-2004 @ 15:00 > > reset date to today, then added 14 > > i=1 > > Chelsea vs Man Utd @ chelseas ground > > 19-Apr-2004 @ 15:00 > > Man Utd vs Chelsea @ Old Trafford > > 19-Oct-2004 @ 15:00 > > Chelsea vs Arsenal @ chelseas ground > > 26-Apr-2004 @ 15:00 > > Arsenal vs Chelsea @ Highbury > > 26-Oct-2004 @ 15:00 > > Chelsea vs Newcastle @ chelseas ground > > 03-May-2004 @ 15:00 > > Newcastle vs Chelsea @ St.James Park > > 03-Nov-2004 @ 15:00 > > reset date to today, then added 14 > > i=2 > > Man Utd vs Arsenal @ Old Trafford > > 24-May-2004 @ 15:00 > > Arsenal vs Man Utd @ Highbury > > 24-Nov-2004 @ 15:00 > > Man Utd vs Newcastle @ Old Trafford > > 31-May-2004 @ 15:00 > > Newcastle vs Man Utd @ St.James Park > > 30-Nov-2004 @ 15:00 > > reset date to today, then added 14 > > i=3 > > Arsenal vs Newcastle @ Highbury > > 20-Jun-2004 @ 15:00 > > Newcastle vs Arsenal @ St.James Park > > 20-Dec-2004 @ 15:00 > > reset date to today, then added 14 > > > > > No suprise that the issue happens when Arsenal is playng Man U ;-) matchdate = today hmmm.. aren't you then moving today when playing with matchdate afterwards? I would clone(). bruno ========================================================================== TOPIC: Homework - Was Re: java programe help http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fddd0a49ac12937 ========================================================================== == 1 of 4 == Date: Fri, Oct 29 2004 12:26 pm From: Alex Hunsley <[EMAIL PROTECTED]> Yogo wrote: > "Alex Hunsley" wrote: > >>>>>Being sometimes a little bit more tolerant wouldn't hurt anyone. We're >>>>>not talking about rapists and murderers here. >>>> > >>The point isn't that you said the exact word "murderer" or "rapist" - it's >>that you implied that some people treat posters here as they would >>"murderers or rapists (or insert other word indicating extremely reviled >>persons)". The point is that those are strong, strong concepts, and >>completely over the top. >> > > > The point was about being sometimes a little bit more tolerant... And, > please, try to calm down a bit... I think it's you who should calm down a bit and not imply the regulars here of replying to posters as if they are "murderers and rapists". You owe people here an apology for that implication. >>>>But I'm talking more about the exact style of the response, and not the >>>>nature of the reponse.. I think the nature of regulars responses are fine >>>>for the majority. >>> >>> >>>Yes, I think that's more the problem. >> >>Wht, you mean the style of the response is the problem? >> > > > Yes, I think that's more the problem. Hmm, haven't I said that already? > > >>>I should blame the original poster because I'm annoyed by YOUR reply? :-) >> >>Yes. > > > Nope. How convenient for you - to snip the rest of my paragraph and make it look like "Yes" is all I wrote. >>And as for the nature of the replies being annoying (not the actual >>message behind it) - as Andrew asked, exactly how polite should the >>responses be? What length of reply or words would be 'rude' etc.? >> > I already respond to that in an other message, please read the messages > posted in the group before posting... Ok, you responded by saying "What about just posting a link to the faq .." It's a given that not many people are going to be bothered reading through the entire faq and absorbing. A large article like that will be summarily ignored by most of them. >>>I'm not certain of this. I think after a while they'll just stop posting >>>or start asking why they never get answers (and that would a great time >>>to tell them why). >> >>At which point you will see the replies that will annoy you, except that >>there will more than one original post for every reply. More pollution. > > > Less annoying pollution... So says you. Everyone else in this discussion seems to think it would be more annoying, however. >>>But I don't think they read the group before posting anyway. >> >>I think a lot of them don't read much before posting, that much is true. >>I still reckon the group is much better off with the way regulars behave >>now. > > > I don't. Bully for you. Things just work a certain way around here, and you being annoyed at that isn't going to change it - usenet tends to work by majority and you're in the minority. Live with it. This conversation ceases to be of any value since we've reached a certain point where we know that you are annoyed at how this group works and now we all know that. Hunky dory. You just be annoyed there and we'll get on with helping people. alex == 2 of 4 == Date: Fri, Oct 29 2004 12:32 pm From: Alex Hunsley <[EMAIL PROTECTED]> Alex Hunsley wrote: > Bully for you. > Things just work a certain way around here, and you being annoyed at > that isn't going to change it - usenet tends to work by majority and > you're in the minority. Live with it. > > This conversation ceases to be of any value since we've reached a > certain point where we know that you are annoyed at how this group works > and now we all know that. Hunky dory. You just be annoyed there and > we'll get on with helping people. One last thing Yogo: Your concerns would carry more weight if you were one of the people regularly helping people here. Being a regular, getting a feel for the group and actually helping others tends to put you in a better position to be criticising regular helpers. == 3 of 4 == Date: Fri, Oct 29 2004 12:56 pm From: "Yogo" <n o s p a m> "Alex Hunsley" wrote: > > I think it's you who should calm down a bit and not imply the regulars > here of replying to posters as if they are "murderers and rapists". You > owe people here an apology for that implication. > I don't owe an apology to anyone for this. If you can't read / think properly that's not my problem... >>>>I should blame the original poster because I'm annoyed by YOUR reply? >>>>:-) >>> >>>Yes. >> >> >> Nope. > > How convenient for you - to snip the rest of my paragraph and make it look > like "Yes" is all I wrote. > Yeah, I have to agree, it was pretty convenient :-) >>>And as for the nature of the replies being annoying (not the actual >>>message behind it) - as Andrew asked, exactly how polite should the >>>responses be? What length of reply or words would be 'rude' etc.? >>> >> I already respond to that in an other message, please read the messages >> posted in the group before posting... > > Ok, you responded by saying "What about just posting a link to the faq .." > It's a given that not many people are going to be bothered reading through > the entire faq and absorbing. A large article like that will be summarily > ignored by most of them. <sigh> What is this thread about? It's about adding something about homework in *the faq* ! > >>>>I'm not certain of this. I think after a while they'll just stop posting >>>>or start asking why they never get answers (and that would a great time >>>>to tell them why). >>> >>>At which point you will see the replies that will annoy you, except that >>>there will more than one original post for every reply. More pollution. >> >> >> Less annoying pollution... > > So says you. Everyone else in this discussion seems to think it would be > more annoying, however. So I say indeed... >>>>But I don't think they read the group before posting anyway. >>> >>>I think a lot of them don't read much before posting, that much is true. >>>I still reckon the group is much better off with the way regulars behave >>>now. >> >> >> I don't. > > Bully for you. > Things just work a certain way around here, and you being annoyed at that > isn't going to change it - usenet tends to work by majority and you're in > the minority. Live with it. > Live with the fact that I am free to express what I think and what I feel... > This conversation ceases to be of any value since we've reached a certain > point where we know that you are annoyed at how this group works and now > we all know that. Hunky dory. You just be annoyed there and we'll get on > with helping people. Sure, continue to help people, there is nothing wrong with that, in contrary, it's a nice thing to do. But try to be a little more open towards the point of view of other people. There is nothing wrong with that too... Yogo == 4 of 4 == Date: Fri, Oct 29 2004 1:07 pm From: "Yogo" <n o s p a m> "Alex Hunsley" wrote: > One last thing Yogo: > Your concerns would carry more weight if you were one of the people > regularly helping people here. Being a regular, getting a feel for the > group and actually helping others tends to put you in a better position to > be criticising regular helpers. I think you may be right, but, hey! I'm not a regular. Which doesn't mean I am not allowed to say what I think... Yogo ========================================================================== TOPIC: tomcat 4.x : setting mime type for a directory or setting a default mime type http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/967946fe70b1bf90 ========================================================================== == 1 of 2 == Date: Fri, Oct 29 2004 12:35 pm From: [EMAIL PROTECTED] (CJ) I want all of the text files in a directory (various unknown extensions that are not .txt) to be set to text/plain. Using <extension>*</extension> does not work. Right now users see these text files unformatted, the carriage returns aren't processed. Strange thing is that when IE users hit refresh/reload the carriage return is processed and the text file is displayed properly. Mozilla Firefox shows the files correctly no matter what. Any ideas? And no, I can't require all of the users to use Firefox :) CJ == 2 of 2 == Date: Fri, Oct 29 2004 12:51 pm From: Andrew Thompson <[EMAIL PROTECTED]> On 29 Oct 2004 12:35:15 -0700, CJ wrote: Sub: tomcat 4.x : setting mime type for a directory or setting a default mime type Please restate the subject in the body of your post, as a lot of people ignore the subject, and this post makes a lot less sense without it. > I want all of the text files in a directory (various unknown > extensions that are not .txt) to be set to text/plain. Using > <extension>*</extension> does not work. Right now users see these text > files unformatted, the carriage returns aren't processed. Strange > thing is that when IE users hit refresh/reload the carriage return is > processed and the text file is displayed properly. Mozilla Firefox > shows the files correctly no matter what. Any ideas? And no, I can't > require all of the users to use Firefox :) And is this actually a Java question? It sounds like it is more related to Tomcat configuration or site-design. -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: Append one array to another array http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d ========================================================================== == 1 of 3 == Date: Fri, Oct 29 2004 12:54 pm From: Lee Fesperman <[EMAIL PROTECTED]> Michael Borgwardt wrote: > > VisionSet wrote: > > > How could they have included the Array type in the javadocs? > > There's no single "Array type". Of course, all Array types are derived from > Object[], but none of them, including Object[] are real classes, they're > synthesized by the JVM. That's not right. An array of primitives can't be derived from Object[]. -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) == 2 of 3 == Date: Fri, Oct 29 2004 12:58 pm From: Michael Borgwardt <[EMAIL PROTECTED]> Lee Fesperman wrote: >>There's no single "Array type". Of course, all Array types are derived from >>Object[], but none of them, including Object[] are real classes, they're >>synthesized by the JVM. > > > That's not right. An array of primitives can't be derived from Object[]. Ah, you're right of course, I forgot about those. So there's not even a common superclass for all array types (except for Object). == 3 of 3 == Date: Fri, Oct 29 2004 1:31 pm From: Lee Fesperman <[EMAIL PROTECTED]> Michael Borgwardt wrote: > > Lee Fesperman wrote: > >>There's no single "Array type". Of course, all Array types are derived from > >>Object[], but none of them, including Object[] are real classes, they're > >>synthesized by the JVM. > > > > > > That's not right. An array of primitives can't be derived from Object[]. > > Ah, you're right of course, I forgot about those. > > So there's not even a common superclass for all array types (except for Object). Yep, Object is the only common superclass for array types. That's why System.arraycopy() takes its array arguments as Object ;^) -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) ========================================================================== TOPIC: jar file, not being accessed http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7be536529d2ceb23 ========================================================================== == 1 of 1 == Date: Fri, Oct 29 2004 1:46 pm From: picaza <[EMAIL PROTECTED]> > > You need to add the jar to your classpath > > javac -classpath myjar.jar MyClass.java > thanks that was it. peter ========================================================================== TOPIC: Developing MIDlet for PDAs and cell phones http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d0109d66581670e ========================================================================== == 1 of 1 == Date: Fri, Oct 29 2004 1:45 pm From: "Rhino" <[EMAIL PROTECTED]> I am a member of a small club and several people in the club have PDAs and cell phones. If I want to make an application that each of our members can use on their existing PDAs and cell phones (assuming their cells can even run MIDlets) what exactly do I need to know about each of their devices to develop MIDlets that will run on all their devices (at least those that are capable of running MIDlets)? In other words, rather than writing toward a specific device, e.g. Nokia CP1111 cellphone, and requiring everyone to have that device, I want to write MIDlets that will run on a (small) known set of devices. How do I determine the capabilities of those devices so that I know what the lowest common denominator MIDP, CLDC, etc. I need to use in doing the development? I'm still very new to MIDlets so if I'm not asking a coherent question, please help me ask one that makes more sense ;-) -- Rhino ========================================================================== TOPIC: Deploying MIDlet via cable? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/939c5a9412e6b4a8 ========================================================================== == 1 of 1 == Date: Fri, Oct 29 2004 1:38 pm From: "Rhino" <[EMAIL PROTECTED]> I am a MIDlet newbie but I've done a fair bit of J2SE development. I would like to understand the deployment process for midlets a bit better. I have downloaded the Wireless Toolkit (2.2) and would like to install some of the demo applications on my Tungsten E PDA just to practice the process of installing an application. Unfortunately I'm not very clear on what I have to do. The J2ME FAQ at http://bellsouthpwp.net/m/c/mcpierce/j2mefaq.html#provisioning seems vague on the process. Am I right in understanding that OTA provisioning is not an option for me since my PDA does not have Bluetooth and I do not have a cell phone or wireless modem of any kind? All I have is the IR port on the PDA. Assuming I am right and that OTA is not an option for me, I'm trying to understand in more detail what I need to do to install my midlet via the HotSync cable. The FAQ says that I need to "browse the local file system and select the JAR and JAD files to install onto the device. The software then negotiates a connection with the device and uploads the MIDlet suite." When I try to drag and drop a given JAR and its JAD into the Palm Quick Install application on my PC's desktop, it will only drop into the Expansion Card area of the Install application; I can't drop it into the Handheld area of the application. However, I don't have any expansion cards for the Tungsten E. (The Tungsten E supports expansion cards; I just don't happen to have one.) Is it only possible to install MIDlets on an expansion card and not on the Handheld itself? I have access to a server and could put the JAD and JAR on that server if that would help. However, I stress again that I have no wireless access to my handheld beyond the IR port. (The Tungsten E does not support Bluetooth so I couldn't add it even if I wanted to.) Are there any options for installing MIDlets on my PDA *WITHOUT* upgrading to a more expensive PDA that has Bluetooth and/or getting a cell phone which I haven't needed until now? I would be willing to convert my MIDlet to .PRC files and installing them that way, assuming it is possible to convert MIDlets to .PRC files; if it is, could someone please tell me how? Also, I have one terminology question that is relevant to this issue. I keep seeing the term "MIDlet suite" in the FAQ but I can't find a definition of that term. Is it the JAD and the JAR files for the application? Or both of those plus the MANIFEST.MF file? Or something else altogether? Any help on this issue would be highly appreciated! Rhino ========================================================================== TOPIC: regex: remove file ext http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9292732e966a520c ========================================================================== == 1 of 3 == Date: Fri, Oct 29 2004 1:54 pm From: picaza <[EMAIL PROTECTED]> hi, i am trying to lope off the extention of filenames as i read them w/ a regex. seems like it should be easy but i cant get the regex to work. i would like to use "\\.\\w$" or "\\.\\S$" but they dont work. what does work is "\\...$" or "\\.nc$" but these dont offer the flexibility i want. the snippet of code follows thanks, peter. +++++++++++++++ / the regex is ".\w$" a dot followed by a word at the end of the str Pattern fileExtRegEx = Pattern.compile("\\.\\w$"); Matcher FileExtMatcher; while ((str = in.readLine()) != null) { FileExtMatcher = fileExtRegEx.matcher(str); str = FileExtMatcher.replaceAll(""); allNames.add(str); } ++++++++++++ == 2 of 3 == Date: Fri, Oct 29 2004 2:03 pm From: Carl Howells <[EMAIL PROTECTED]> picaza wrote: > hi, > i am trying to lope off the extention of filenames as i read them w/ a > regex. seems like it should be easy but i cant get the regex to work. > i would like to use "\\.\\w$" or "\\.\\S$" but they dont work. > what does work is > "\\...$" or "\\.nc$" > but these dont offer the flexibility i want. Aren't you missing a quantifier like *, then, if you want to match extensions with a length of more than one character? "\\.[^.]*$" seems appropriate. == 3 of 3 == Date: Fri, Oct 29 2004 2:10 pm From: Alan Moore <[EMAIL PROTECTED]> On Fri, 29 Oct 2004 20:54:01 GMT, picaza <[EMAIL PROTECTED]> wrote: > hi, > i am trying to lope off the extention of filenames as i read them w/ a > regex. seems like it should be easy but i cant get the regex to work. > i would like to use "\\.\\w$" or "\\.\\S$" but they dont work. > what does work is > "\\...$" or "\\.nc$" > but these dont offer the flexibility i want. the snippet of code follows > thanks, > peter. > +++++++++++++++ > / the regex is ".\w$" a dot followed by a word at the end of the str > Pattern fileExtRegEx = Pattern.compile("\\.\\w$"); > Matcher FileExtMatcher; > while ((str = in.readLine()) != null) > { > FileExtMatcher = fileExtRegEx.matcher(str); > str = FileExtMatcher.replaceAll(""); > allNames.add(str); > } > ++++++++++++ > \w matches a single word character, and \S matches a single non-whitespace character. You need to add a + if you want to match more than one character: Pattern fileExtRegEx = Pattern.compile("\\.\\S+$"); ========================================================================== TOPIC: Best references for buidling a webcrawler http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/794947bf20d69623 ========================================================================== == 1 of 1 == Date: Fri, Oct 29 2004 1:58 pm From: Tris Orendorff <[EMAIL PROTECTED]> "Jay Liu" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hey guys, > > I'm somewhat new to Java and I'm just looking for some reference ideas > for building a html page getter. How about this, <http://www.jeffheaton.com/javabot/javaspider.shtml>, a simple spider program. -- Sincerely, Tris Orendorff -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d++ s+:- a+ C+ UL++++ P+ L+ E- W+ N++ o- K++ w+ O+ M !V PS+ PE Y+ PGP t+ !5 X- R- tv--- b++ DI++ D+ G++ e++ h---- r+++ y+++ ------END GEEK CODE BLOCK------ ========================================================================== TOPIC: Does this finally get executed ? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e0d9fa26e656cf72 ========================================================================== == 1 of 7 == Date: Fri, Oct 29 2004 1:59 pm From: [EMAIL PROTECTED] (GIMME) Psuedo code ... Does sc.close() get executed ? public static Employee get(int id ) throws Exception { try { SomeConnection sc = new SomeConnection(); return new Employee(); }finally { sc.close(); } == 2 of 7 == Date: Fri, Oct 29 2004 2:12 pm From: "Tony Morris" <[EMAIL PROTECTED]> "GIMME" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Psuedo code ... > > Does sc.close() get executed ? > > public static Employee get(int id ) throws Exception > { > try { > SomeConnection sc = new SomeConnection(); > return new Employee(); > }finally { > sc.close(); > } No. It won't compile. Nothing is executed. -- Tony Morris http://xdweb.net/~dibblego/ == 3 of 7 == Date: Fri, Oct 29 2004 2:18 pm From: "VisionSet" <[EMAIL PROTECTED]> "GIMME" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Psuedo code ... > > Does sc.close() get executed ? > > public static Employee get(int id ) throws Exception > { > try { > SomeConnection sc = new SomeConnection(); > return new Employee(); > }finally { > sc.close(); > } Yes, finally is always executed. I think the only exception is calling System.exit(0) -- Mike W == 4 of 7 == Date: Fri, Oct 29 2004 2:19 pm From: "VisionSet" <[EMAIL PROTECTED]> "Tony Morris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > No. It won't compile. > Nothing is executed. > > Psuedo code ... -- Mike W == 5 of 7 == Date: Fri, Oct 29 2004 2:22 pm From: "Tony Morris" <[EMAIL PROTECTED]> "VisionSet" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > "Tony Morris" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > > No. It won't compile. > > Nothing is executed. > > > > > Psuedo code ... It won't compile. There is a scope error. Nothing is executed. -- Tony Morris http://xdweb.net/~dibblego/ == 6 of 7 == Date: Fri, Oct 29 2004 2:27 pm From: "VisionSet" <[EMAIL PROTECTED]> "Tony Morris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > > > > No. It won't compile. > > > Nothing is executed. > > > > > > > > Psuedo code ... > > It won't compile. > There is a scope error. > Nothing is executed. I think scoping issues may be arguably left out of pseudocode. Not that I'm advocating sloppy questions, even though I'm probably guilty of them myself a fair bit. -- Mike W == 7 of 7 == Date: Fri, Oct 29 2004 2:26 pm From: "Tony Morris" <[EMAIL PROTECTED]> > Yes, finally is always executed. > I think the only exception is calling System.exit(0) There are other exceptions: - throwing an exception from within a finally block. - explicitly returning from within a finally block. Both of these should be avoided as a matter of form. Note, however, that the given example will not compile due to a scope problem. -- Tony Morris http://xdweb.net/~dibblego/ ========================================================================== TOPIC: multiple forms and one servlet http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4dacdcfce2b3903e ========================================================================== == 1 of 2 == Date: Fri, Oct 29 2004 2:23 pm From: [EMAIL PROTECTED] (Yasaswi Pulavarti) I have one servlet which has multiple forms. The action element of the forms is pointing on one servlet. I want to process the different form requests as different reponses in the same servlet. How can I do that based on the form "Name" attribute. Thanks, Yasaswi == 2 of 2 == Date: Fri, Oct 29 2004 2:29 pm From: "Tony Morris" <[EMAIL PROTECTED]> "Yasaswi Pulavarti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have one servlet which has multiple forms. The action element of the > forms is pointing on one servlet. I want to process the different form > requests as different reponses in the same servlet. How can I do that > based on the form "Name" attribute. > Thanks, > Yasaswi Servlets don't have forms. Now that your question is completely out of context, let's guess what you really want. My guess is that you want the Front Controller Design Pattern (a J2EE blue print design pattern). You might want to look at some frameworks such as WebWork and Spring. Struts is an older, crustier, less well designed option, but it is more common. -- Tony Morris http://xdweb.net/~dibblego/ ========================================================================== TOPIC: Setting up a filter based on server name http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/801866155eeb6057 ========================================================================== == 1 of 1 == Date: Fri, Oct 29 2004 2:40 pm From: freddiemac <[EMAIL PROTECTED]> What do you mean servers "tied to" an application? HTTPServletRequest.getRequestURL() should give you what you need. MarkN wrote: > My situation is unique I guess. There are several virtual hosts tied > to the same J2EE application (ColdFusionMX running on top of JRun4). > > > Mike H <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > >>I'm assuming you're virtual hosting. Each virtual host has it's own >>and each host has its own web.xml file. It's in the web.xml for the >>particular host where you define the filter url-pattern that is >>relational to the virtual host. Unless I'm missing something. >> >> >>On 27 Oct 2004 15:20:51 -0700, [EMAIL PROTECTED] (MarkN) wrote: >> >> >>>This question pertains to the Java Servlet specification. >>> >>>Is it possible to specify a <url-pattern> for a filter based on the >>>server name? >>>Trying to specify a url-pattern such as "www.bla.com/*" doesn't work. >>>Am I missing something here or am I trying to do something that is not >>>supported. >>> >>> >>>Example (that does not work as intended): >>> >>> <filter> >>> <filter-name>TF</filter-name> >>> <filter-class>TestFilter</filter-class> >>> </filter> >>> >>> >>> <filter-mapping> >>> <filter-name>TF</filter-name> >>> <url-pattern>www.bla.com/*</url-pattern> >>> </filter-mapping> >>> >>> >>>Thanks for your time! >> ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
