lucky_monkey

Members
  • Content count

    450
  • Joined

  • Last visited

Community Reputation

440 Neutral

About lucky_monkey

  • Rank
    Member
  1. Go to [Window -> Preferences...] then navigate to the following: and check that the stuff that the arrow points to is set up that way. If it already is then I've got no idea :) (except that perhaps you're not putting in the '.' char after the object's name?)
  2. Symbolism of the Labyrinth

    This sounds really interesting, although I'm a little confused: Quote:Original post by sunandshadow A labyrinth is, technically, not a maze. A maze has branches and dead ends, whereas a labyrinth has one passage, twisty but otherwise straightforward, from the outside to the center. Quote:Original post by sunandshadow Theseus used a ball of thread to reach the center of the labyrinth without losing his way and slay the minotaur. Does this mean that the Theseus myth has been significantly altered over time as 'labyrinth' has come to be synonymous with 'maze', or that the labyrinth in that myth was incorrectly named and was really a maze?
  3. Good programmers

    My 2¢The main problem with most of the answers so far is that they don't consider the fact that different people have different ideas of what a good programmer / developer / software engineer / foobarbanator is. You've got to take into account this diversity of opinion. Some people think that you need to be supercoderman, while others think that this is unneccessary and you can just find existing tools and use them or kludge them together if neccessary. You've obviously got to have some idea of how to program if you're going to call yourself a programmer, but I don't think that you need to be awesome or anything. The original question did include the word programmer, so I'll go with solid knowledge of basic programming principles and practices as our first essential. I don't think that you need to be a super-coder to be a decent programmer, you just need to know your tools and know your limits. Hey, sound familiar anyone? ToohrVyk nailed it with the first response! Knowing your limits implies that at some point you'll be looking for help outside of your own brain. Doing this (for me anyway) often involves asking the Googletron, or a workmate or friend for some domain-specific problems. Ignoring social skillz—'cause everyone knows that coders don't kneed those—you can see that our second essential skill is Googlizing your questions. . . Nah, Google's flavour might not be to everyone's taste, so I'd go with #2 being being able to find out the answers to questions you don't know the answer for yet or BATFOTATQYDKTATY for short. Now that our programmer actually has some answers, has to work out if it's wise fnord him to attempt the problem himself. This usually includes more research (so #2 again), into things like existing tools, or into the type of code he'll have to write, languages that can actually do the job, etc. Come to think of it, this doesn't actually require anything more than #2. You could argue that a good sense of the business side of programming is important, and to some people it is. To others though there's no point in knowing anything about customers' needs. Academics etc. don't really need to worry about things like that, do they?! You could argue that being able to learn quickly is essential - it's not though. It's beneficial (I certainly would be a lot better off if I could learn more quickly!!) but non-essential. Um, that's about it.
  4. You'll want to put a synchronized block around your iteration loop. E.g. synchronized (list) { for (Iterator it = list.iterator(); it.hasNext();) { it.remove(); } }because modifying the list from another thread will invalidate the iterator.
  5. [web] mail()

    So you're attempting to send mail through smtp.tcnj.edu? Here's what I get: 220 cyrus.TCNJ.EDU ESMTP Postfix ehlo test 250-cyrus.TCNJ.EDU 250-PIPELINING 250-SIZE 20480000 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN help 502 5.5.2 Error: command not recognized mail from:<my email address here> 250 2.1.0 Ok rcpt to:<a second email address here> 554 5.7.1 <a second email address here>: Relay access denied data 554 5.5.1 Error: no valid recipients rset 250 2.0.0 Ok quit 221 2.0.0 Bye It doesn't support the authentication mechanisms with which I am familiar (AUTH ...), just TLS (indicated by the STARTTLS EHLO option) which has something to do with SSL and certificates and I can't really be bothered reading up on it. This means however that you've only got the one auth method available so whatever script you use to send the email has to know how to authenticate using the STARTTLS option. The error message>>> DATA <<< 554 5.7.1 <venom.TCNJ.EDU[159.91.15.183]>: Client host rejected: Access denied 554 5.0.0 Service unavailable <<< 554 5.5.1 Error: no valid recipientsis pretty weird since it contains three error messages from the server in response to your single DATA command (the second error message, '554 5.0.0 Service unavailable', isn't prefixed by <<< but your client probably didn't send it since it's a server side SMTP error message.)
  6. On girls, guys, semantics, secret headaches and thimbles

    The degree to which these things annoy me depends on context. The more formal the interaction, the more effort I expect people to have spent on it (and the more effort I expend myself). I expect an email from a client (and my emails to clients) to be free of spelling mistakes and grammatical errors. Misspelling my name, even though I sign off all emails with it and have an email address beginning with it, immediately relegates you to unprofessional moron status, lowers the priority of any tasks related to you, and shortens the tone of any correspondence I have with you. When writing forum posts and emails you have plenty of time to ensure that they are free from spelling mistakes and grammatical errors. (Minor mistakes occasionally creep in, of course.) With quick emails to workmates or friends I relax my expectations somewhat. The more familiar the person (or dire the situation), the more relaxed the rules. Contractions are still to be avoided, since spelling mistakes with them can render the message hard to read, and I still strive for correctness on my part. In an IM conversation I'm generally pretty laid back. I tend to type fast and make a fair number of spelling mistakes here, but I still avoid using use contractions. My grammar suffers a little since I tend to write as if I'm speaking; I think that this mode of communication is ok over IM though. Text messaging is an interesting case: I sometimes use contractions even though it's an effort for me to use them on my phone (with predictive on it's easier to write most words in long form than to contract them). I only do it when texting people who use a lot of contractions themselves, so I think that it's a form of linguistic accommodation. I don't do it that much, and my use is relative to how much I care about how my message sounds. Anyway, that stuff is irrelevant to all you random faceless internet people, but it was interesting to me :)
  7. [java] Quoted string regex

    First of all, thanks heaps for taking the time to think about it! Recently email passing though my server with an 'X-Mailer: Apple Mail (2.752.2)' has been failing to be processed by JavaMail when it has an attachment that has whitespace in the filename, since it doesn't quote the value of the 'name' parameter (i.e. name=a file.pdf instead of name="a file.pdf"). I've raised the issue with Apple, but they probably won't fix it for ages so I've gotta come up with a workaround. The parameter values can't have whitespace in them unless the value is a quoted string (and yeah, it's pretty much the same as a Java quoted string except that I think any character after the escape character is allowed) so I've written a regex that, when find() is called repeatedly, will be able to replace an unquoted value with a quoted value (I'm just going to do this blindly and quote everything). I'm interested in changing as little as possible from the way I currently do things, since there's another fix in there for another broken mail client (some kind of backup auto-reporter which doesn't put a ';' between the content-type and the first parameter) and in keeping things as predictable as possible (which is why I'm going to blindly quote everything: it's valid according to RFC 2045, and it means my Content-Type headers are as predictable as possible.) Those three test cases are passed by my regex: 1) is a valid string, and recognised as such. 2) is an invalid string and recognised as such, and 3) is a valid string (since a '\' can preceed anything in the Content-Type field) and is recognised as such. Thanks again!
  8. I've been trying to find a way to represent quoted-strings using a regex. So far I've got: Pattern quotedString = Pattern.compile("\"(?:\\.|[^\"\\\\])*\""); which works for all my test cases. I think I've been staring at it for too long though: can anyone see anything wrong with it?
  9. Quote:Original post by lucky_monkey Quote:Original post by basananas For anybody who might be interested in this problem: I'm quite sure it is due to a very small server socket backlog queue in windows. It can only buffer up to 5 new requests before accepting them. I could solve the problem in the code above by moving the actual connection to the server from the Client constructor to the run function and creating a small delay between starting the different clients.I'm pretty sure that this is actually a threading issue. The delay you created worked because the first two client sockets (the ones that failed if you look at the generated output you posted) started faster than the server socket. Try using the exact same code you did to begin with, but put Thread.sleep(1000) straight after server.start(). One other thing I noticed about your code: you're subclassing Thread, which isn't a good idea. You should instead implement Runnable, then create a new Thread to run it. The reason for this is that Thread objects are never garbage collected if start() is never called on them. One of the first things I had to do when I started at my current job was to track down a memory leak caused by this, so don't think that it doesn't happen!Ok, so I obviously didn't read the code properly! I was reading up on networking stuff today and it reminded me of this thread: the backlog queue in Win XP Home Edition is 5, so I'm guessing that's what you're using.
  10. Quote:Original post by basananas For anybody who might be interested in this problem: I'm quite sure it is due to a very small server socket backlog queue in windows. It can only buffer up to 5 new requests before accepting them. I could solve the problem in the code above by moving the actual connection to the server from the Client constructor to the run function and creating a small delay between starting the different clients.I'm pretty sure that this is actually a threading issue. The delay you created worked because the first two client sockets (the ones that failed if you look at the generated output you posted) started faster than the server socket. Try using the exact same code you did to begin with, but put Thread.sleep(1000) straight after server.start(). One other thing I noticed about your code: you're subclassing Thread, which isn't a good idea. You should instead implement Runnable, then create a new Thread to run it. The reason for this is that Thread objects are never garbage collected if start() is never called on them. One of the first things I had to do when I started at my current job was to track down a memory leak caused by this, so don't think that it doesn't happen!
  11. Would you like prison with your fries?

    Land of the free my arse! Actually, given the US's problem with obesity, maybe there's a reason they're arresting people for eating! Quote:Original post by washingtonpost.com Metro spokesman Ray Feldmann said yesterday: "We were tired of people eating and drinking on the train, spilling things and leaving partially eaten food and containers. People complained last spring about how debris gets on the third rail and starts minor fires." Signs warning that it is illegal to eat or drink on the cars and in the stations are posted in the Metro system.Um, yeah. When people are tired of things they make them illegal. Imposing fines should really be the only enforcement for minor things like this. Anyway, not being able to eat on the train or even in the station is fucking draconian and quite ridiculous.
  12. How do you keep up-to-date?

    Quote:Original post by wilhil you are using the old version, my one has auto update that checks every few hours... but my last update says i have ilegally copied brain and keeps poping up and annoying me.Mate, it's all about the quality of your crack.
  13. [java] Cleaning up native memory

    Look at this.
  14. What's Your Programmer Personality Type?

    On projects for work: PHTB On personal projects: DLSB So I guess what it tells me is that I'm a liberal programmer :)