|
X.clone() creates a copy of the object, and you can pass it to your destructive methods.
|
# ¿ Mar 25, 2008 02:51 |
|
|
# ¿ Apr 29, 2024 07:34 |
|
If you are just rewriting the output of a program from xml to xml, there are other options like xpath+xsl. Although xsl is pretty useful it can be quite awkward being declarative.
|
# ¿ Mar 26, 2008 16:38 |
|
CRIP EATIN BREAD posted:I'm not sure, the way this works is fairly obtuse, such as What is it meant to look like in the output? If you can paste them into a paste bin I can either knock up an xsl attempt or tell you it's impossible.
|
# ¿ Mar 27, 2008 15:22 |
|
Treytor posted:Would anyone know why this bit of code won't worry on a blackberry? Please try the Small web dev questions thread.
|
# ¿ Apr 12, 2008 12:25 |
|
syphon^2 posted:I hope Javascript questions are welcome here. There's no "Javascript Megathread", and this question is very very simple, so I didn't want to start a new thread just for it. For future reference - the web dev and the general programming questions thread might be better. JavaScript and Java really only have the name in common.
|
# ¿ Apr 22, 2008 18:02 |
|
dancavallaro posted:I feel like maybe I'm going about this the wrong way, so what should I be doing? You can always run a search and replace on the files coming back from the browser, or if it is html you can add <base href="http://www.cnn.com/"> at the top
|
# ¿ May 16, 2008 12:55 |
|
dancavallaro posted:If you know of a good library for that If you want to look at other languages there is HTTP::Proxy in perl, and twisted does stuff for python
|
# ¿ May 16, 2008 18:53 |
|
Use a flag bit.
|
# ¿ Aug 1, 2008 11:06 |
|
Fruit Smoothies posted:While we're on the subject of sockets; I've always prefered async non-blocking. Can someone tell me why I should do sync blocking instead? Should I? I was under the impression that nio was the way to go for performance.
|
# ¿ Jun 28, 2009 02:16 |
|
Kaltag posted:The other side is an embedded system that runs a very unrobust FTP server. I only know that the last character is getting chopped because when I send "CWD /data" it returns with "Can't open directory /dat". My boss wrote the embedded FTP and perhaps he didn't anticipate the different line separators for linux and windows. I'm going to work on it some more before I walk up to him and tell him that his code is wrong. You need to send \r\n anyway From: http://www.faqs.org/rfcs/rfc959.html Edit: correct citing code:
Edit: His code *should* try to accomodate other line endings, as per postel's law, but your code should be sending the right thing in the first place. Never use println on a wire protocol: always use the correct line endings for the protocol, not the platforms ones. tef fucked around with this message at 14:34 on Sep 29, 2009 |
# ¿ Sep 29, 2009 14:27 |
|
Vandorin posted:I keep getting an array out of bounds error, and I can't figure out why. X is width, Y is height?
|
# ¿ Oct 15, 2009 21:20 |
|
Any recommended json libraries or such?
|
# ¿ Dec 10, 2009 12:26 |
|
It is called an autocomplete widget, or an autosuggest widget.
|
# ¿ May 25, 2010 18:21 |
|
http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html#putIfAbsent(K, V) if you used this instead of the null check you could avoid the race.
|
# ¿ Jun 17, 2010 11:26 |
|
omlette-a-gogo posted:A good habit to get into is to close all streams in a finally block: You can also use helper methods to handle all of the boilerplate: code:
code:
|
# ¿ Aug 27, 2010 00:31 |
|
Cool, I didn't see those.
|
# ¿ Aug 27, 2010 03:51 |
|
Riff posted:Hi, was wondering if any of you could help me with a bit of a problem. Hurp a durp a durp Is counting really this hard? Seriously? you call incrementArray(new int[] {0,0,0,1}, 10, 1) to add 1 to this array in base 10. code:
this is completely untested but it should work better than adding one to a number by converting it to a string. durp if you said 'convert it to a string' you should be ashamed of yourself. :ugh: pps it works for any increment >=0 tef fucked around with this message at 05:27 on Nov 5, 2010 |
# ¿ Nov 5, 2010 05:21 |
|
Mr. DNA posted:Can anyone give me some suggestions for good resources to learn how to program GUI apps with Java using a text editor and command line compiler? I find diving into an IDE overwhelming. (Java) gui toolkits are a miriad of pain and suffering. I can't recommend SWT to anyone, not even the brain damaged (Another cross platform library that needs to be wrapped to be cross platform, for example: tooltips and sliders work significantly differently). quote:Thanks for any help! Writing Java demands an IDE to deal with the level of complexity in modern frameworks and toolkits. Writing java in a barebones environment will drive you insane. (much, much quicker than working in eclipse will) You might find it easier to start with something simpler and pedagogical to learn GUI programming, like Tcl/Tk, or writing a web app in one of the myriad frameworks (i'd recommend python+django fwiw).
|
# ¿ Nov 5, 2010 05:49 |
|
Aleksei Vasiliev posted:use an IDE like Eclipse. i handcode SWT GUIs in it. I treat it like a text editor that can compile, tell me of my errors while I'm making them, and other stuff. You don't really need to know much to use Eclipse. just do File > New > Java Project, then File > New > Class. Also, File > Restart Eclipse. Although I never get to use it because it just seizes up and locks.
|
# ¿ Nov 5, 2010 05:50 |
|
Reminds me of my favourite eclipse bug: Only on windows! https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514
|
# ¿ Nov 5, 2010 06:00 |
|
epswing posted:You probably want something more like... An enum for difficulty, stored as an attribute somewhere it makes sense.
|
# ¿ Dec 6, 2010 19:34 |
|
Starting with 5 is a good idea. I can't recommend any beginner java books off hand but I will say that 'Effective Java 2nd ed' is an excellent second book.
|
# ¿ Jan 5, 2011 15:02 |
|
Aleksei Vasiliev posted:Where can I find a good tutorial on concurrency? I think you mean 'I have a parallel problem' concurrency is more about multi-agent stuff/actors style problems and parallelism is more about dataflow/pipeline problems you might try an algorithmic skeleton library to make your life easier http://skandium.niclabs.cl/documentation/
|
# ¿ Jan 14, 2011 14:17 |
|
Jam2 posted:My reason for posting here is to ask, what will I be able to do by the end of this course? Will I be completely proficient in java or are there advanced concepts i still will not have touched by the end of the 8 cred course? to be frank, there will be intermediate and beginner concepts you won't have touched. Jam2 posted:To me, proficiency means being able to use tools available to solve problems and write good code as a valued contributor within an engineering team. It means being able to hold your own in a work environment full of experienced programmers. It means being able to bring something to the table. This is my three to four year goal. It still takes relatively experienced programmers a month or two, to step up and contribute heavily to a large code base. Three or four years is a relatively modest goal to be able to work as a junior programmer within a larger team. 'and be completely proficient in java, C, and python by next summer'. this will never happen. you might be able to write hello world in each of them, but that is not a level of reasonable proficiency. 'no one here is really in a position to judge my intent/motivation/capability.' actually of all the people qualified to judge, you are the least qualified as you are yet to acquire the skills you desire and so know little about the amount of time and dedication it takes. If you want to be a better programmer you should spend more time *reading code* than writing it.
|
# ¿ Apr 8, 2011 13:42 |
|
I mean how many java programmers actually understand the type of enum
|
# ¿ Apr 8, 2011 13:44 |
|
epswing posted:To me, a couple of the key attributes of a worthwhile programmer are intelligence and curiosity, and from across the internet it seems you might have both, so keep at it and have fun. I'd say that the following are more important: Mastery of ones own native tongue Being humble. Other people know more, think more and have solved problems you are yet to have. No-one likes to work with a dick, especially one who is right. Programming is as much explaining things to people as it is explaining things to a computer.
|
# ¿ Apr 8, 2011 17:40 |
|
epswing posted:Sure, I'll agree that attitude is also a key attribute, but I don't necessarily think it's "more important than" intelligence or curiosity. If any of these three are lacking, you're not going to get very far. actually no matter how smart you are or curious, if you're a dick to people, and can't write for poo poo, you won't get far. real software is written by groups, collaborating.
|
# ¿ Apr 9, 2011 06:55 |
|
Paolomania posted:Yeah try telling that to HR. Here I have a note for you: I am writing to inform you that I am ending my employment at ButtCo.
|
# ¿ Apr 9, 2011 06:56 |
|
epswing posted:So I'm not sure why you posted. 'more important than' really, programming doesn't need that much intelligence or curiosity to write. you are not an artist, and most programming is glorified typing. I mean, seriously we're in the java thread here people. you are akin to telephone operators of the turn of the century, laboriously plugging poo poo togerher and subsequently replaced when a more effective interface is found. and as for getting far: I know many programmers in industry who are not geniuses or curious about programming, and yet they seem happy enough making yet another skin for a database :-) the reason I posted is that you are wrong and have a childish, romanticised view of programming as a career. hth. tef fucked around with this message at 17:22 on Apr 10, 2011 |
# ¿ Apr 10, 2011 17:15 |
|
epswing posted:Sorry but you're probably one of those dicks you were talking about earlier. Programmers are frequently arrogant jerks. I am sorry I had to spell things out to you but if you read my earlier posts before replying to them I might not have had to be so cruel :-) Simply put the idea that a career (in java) requires intelligence & curiosity, is quite ironic, because java is designed for the mediocre tasks in programming, a simple way to write business logic without having to understand much in the way of resource management :-) (you may also want to notice that i am yet to break out an ad-homiem, unlike yourself.) edit: time to move goalposts tef fucked around with this message at 17:44 on Apr 10, 2011 |
# ¿ Apr 10, 2011 17:38 |
|
Paolomania posted:QED If i'm being a dick it's because I am channeling dijkstra :-)
|
# ¿ Apr 13, 2011 12:31 |
|
|
# ¿ Apr 29, 2024 07:34 |
|
welcome to something awful
|
# ¿ Apr 13, 2011 17:28 |