|
Who loves pthreads? You, I hope!! I could wax poetic about my complaints with my operating systems class, but suffice it to say that I'm a bit lost when it comes to the pthread part of the current assignment. The assignment is to write a server for a subset of HTTP - technically, we do this three times: once using fork(), once using pthreads, and once using select() to handle concurrent queries. Since, strangely, he hasn't said word one about pthreads in class, I'm rather lost on this. So we would like the server to be able to handle an arbitrary number of queries at the same time, so I would like to do something like code:
code:
Oh god, tell me what to do so I can go back to writing Java ( )
|
# ¿ Mar 5, 2008 05:01 |
|
|
# ¿ May 4, 2024 09:32 |
|
You know what else is equivilent to a DFA? A regular expression.hexadecimal posted:Also he asked for what is the fastest
|
# ¿ Jan 8, 2009 03:47 |
|
hexadecimal posted:You're all just mad you cant manually resolve ambiguous BNF grammar! edit: also, I'm preeeetty sure a ton of work has gone into optimizing the poo poo out of perl/python/$LANGUAGE_OF_THE_WEEK's regex library anyway.
|
# ¿ Jan 8, 2009 03:52 |
|
I assume he's talking about A+/MS/Cisco/etc certification, in which case, not if you're interested in programming. At best, they'll be introductory data structures classes, and in the average case, they'll be strictly IT classes. Regarding math: In high school, math was my lowest mark by a good 25% and I never bothered taking Grade 12 math. I spent two years as a music major before taking a CS course on a whim and loving it so much that I dropped out of university to take grade 12 math and precalculus. It turned out that those years away did me good, and I'm now going to be graduating with a math minor. If you're worried about your math skills, there's nothing wrong with going to a local college and brushing up your knowledge. Another question that should be asked is, what do you want to do with your programming knowledge? This would affect what choice of language you should approach. You mentioned that you're looking at the job market, then as before, I'd echo the Java and PHP suggestions, and throw in C# as well, since IMHO it's the most tolerable of the big enterprisey languages (assuming you're on a Windows machine). Given this, I wouldn't even bother learning C and certainly not C++. Alternately, if you're a Mac user, I have heard it said that the Mac development world is booming thanks to the iPhone, so if you're a Mac person, learning C and then Objective-C might be a path to success for you. Also, I disagree with your "That said, I realize it's important to know as much as you can." quotation - the way I read it, it sounds like you're suggesting a breadth of languages is important, and that's not the case; you are far more employable with knowing one language very well as opposed to knowing the rudiments of five.
|
# ¿ Jan 11, 2009 22:39 |
|
It's hard to say how that certificate would go; to be sure, it would give you a foundation, but you'd still have to build on it on your own time afterwards to make yourself marketable, in my view. One year really isn't enough to get deeply into the field, IMO.IntoTheNihil posted:Honestly, i'm not sure. I've always loved working with computers and want to eventually have a career in the field. The idea of being a game developer always looms but I don't really feel I should shoot for that. I am always thinking up programs and games but don't have the skills to create anything, so i'm looking to change that. IntoTheNihil posted:I've always thought that knowing multiple languages really opens up your career possibilities. *I live in the town that Bioware is based in; hence why both my gamedev stories involved that one company.
|
# ¿ Jan 11, 2009 23:12 |
|
HungryHobo posted:I was wondering if anyone here could give me some sugestions for sites to read, books or decent beginner projects in this area. If you're looking for an excellent overview of AI, in my view you can't go wrong with the Russell/Norvig text. Very complete and entertaining to read, even for someone like me who didn't really enjoy his AI class. I guess the question is, what specifically did you like? Search? If so, adversarial search (minimax / alphabeta, etc)? Bayesian nets? Machine learning? If so, what specifically? Reenforcement learning? Vision? (If the answer to this question is "er, I donno", then the Russel/Norvig might be good in singling down especially what you like) Also, talk to professors at your college who work in AI/ML. It's an excellent way to get yourself thinking about what they research, and maybe even working for them as an undergraduate summer research student.
|
# ¿ Jan 13, 2009 21:00 |
|
IntoTheNihil posted:Sorry to spam up this thread with even more questions but I've recently discovered how huge the Java market really is. Even around my city there's multiple high paying jobs for Java programmers. Can anyone tell me the pros and cons of the language and some general learning info? I messed with it a bit before and even though people say it's simple I couldn't grasp much. One of the best things that Java has going for it, in my view, is Sun's documentation. There are many tutorials on Sun's website, and the reference material is quite robust. Start small and work up slowly, don't get discouraged, and have fun.
|
# ¿ Jan 14, 2009 05:07 |
|
I disagree. There's no reason to know anything about the C memory model if you're learning Java to become a Java developer. Yes, it's something that everyone should know about in a perfect world, but given that he's starting from first principles I think it's best to choose a level of abstraction and stick with it. He can always come back to the lower-level stuff if he so chooses. One of the good things about Java is that it does force you to code in a certain way; with C++, your methology can range from "procedural programming with iostreams" to "C with classes" to "Java-style OOP where most everything is a class" to "template metaprogramming and C++0x draft standard wankery" and everything in between. Given that he doesn't have an instructor guiding him, a more restricted language is probably what he needs, and the fact that he's looking at Java jobs is the icing on the cake in my view.
|
# ¿ Jan 14, 2009 05:41 |
|
dancavallaro posted:Anyone know of a programming language where you can redefine integer literals (i.e. 3 = 5)? edit: dancavallaro, are you a grad student?
|
# ¿ Feb 10, 2009 00:15 |
|
Well, of course, if it's horrible, INTERCAL will let you do it
|
# ¿ Feb 10, 2009 03:31 |
|
Offhand, I don't know of a Linux analog to TextMate. From my experience, you'll have editors fall into three camps: the IDEs such as Eclipse or NetBeans, the generic NotePad-ish editors like gedit, and then the "real man"'s editors: vim and emacs. (which I would argue could very well be what he wants) Not to turn this question into an editor holy war, but since I'm a vimfag, I would recommend you look at vim. It supports tabs, and you can get a directory tree by typing :e. You might need something like one of these plugins and a bit of scripting to make it really work the way you want, though. I'm sure emacs can be configured to do a similar thing, too; someone else would have to chime in on that, though.
|
# ¿ Feb 11, 2009 17:18 |
|
So I'm taking a computational differential equations class this term, which has a project component. I'd like to do my work in something that isn't Matlab. I assumed that any real scientific computing, based on the limited set of applications that I've used, would have to be written in some unholy alliance of C and Fortran. However, I came across SciPy and it sounds like they're trying to market Python of all things as a scientific computing language. Anybody have any thoughts about if this is a direction that things might go in, or is this nothing more than a bunch of Python dorks with Not Invented Here syndrome not wanting to link against LAPACK?
|
# ¿ Feb 11, 2009 22:37 |
|
bitprophet posted:Uh. SciPy has been used for years and in some areas (like bioinformatics) Python is basically the king.
|
# ¿ Feb 11, 2009 23:01 |
|
bitprophet posted:No prob, sorry for sounding acerbic, was kind of defensive given your "golly they're using Python for this?!" tone Since you're a Python guy, any idea what the speed hits are with using SciPy's routines as opposed to, say, a reasonable BLAS library? edit: oh hey there's a python thread; why don't I go post in there instead Dijkstracula fucked around with this message at 23:26 on Feb 11, 2009 |
# ¿ Feb 11, 2009 23:22 |
|
ShoulderDaemon posted:This is how it's typically done in mathematics. Dijkstracula fucked around with this message at 07:19 on Feb 19, 2009 |
# ¿ Feb 19, 2009 07:17 |
|
This may not be the best thread to ask this, but does anyone know how public nethack servers that you connect to over telnet handle ncurses running over different sockets? I'm working on something similar, and I was hoping to use some screen-handling API, but it doesn't appear that ncurses really is intended to write to use anything other than stdin/stdout. Thoughts?
|
# ¿ Feb 25, 2009 17:37 |
|
ShoulderDaemon posted:For the most part, they arrange a pty for each socket, then spawn a separate process for each pty that the ncurses code runs in (talking on stdin/stdout), and do anything fancy with IPC. ShoulderDaemon posted:ncurses and terminfo are seriously the worst code.
|
# ¿ Feb 25, 2009 18:14 |
|
ShoulderDaemon posted:If you find yourself reimplementing the terminfo library, I may be able to give you some pointers; I've done partial reimplementations myself.
|
# ¿ Feb 26, 2009 04:09 |
|
ShoulderDaemon posted:Telnet clients should send a window size option when they resize, so that's not a major problem. Feel free to email me if you'd rather not clutter the thread, jblake@omgwallhack.org.
|
# ¿ Feb 26, 2009 05:20 |
|
If you don't mind getting your hands dirty with a backtracking logic language like Prolog, this sounds like a good constraint programming problem.
|
# ¿ Mar 29, 2009 23:13 |
|
Fruit Smoothies posted:I agree that in order to solve a problem you need to know about it. However, in this case, it would only confuse people if I gave the whole subject matter. In the worst case, people might get a glimpse into an area that they don't know anything about.
|
# ¿ Apr 7, 2009 16:12 |
|
Munkeymon posted:Java? When the hell did Java become good at anything graphical? But yes, at the risk of replying to every newbie question with "PYTHONPYTHONPYTHON", what you want is what Munkeymon said.
|
# ¿ May 1, 2009 18:11 |
|
I ask for IAC extended ASCII just to be safe, and that doesn't change anything. Disregard, off-by-one error in my transmit function was loving things up Dijkstracula fucked around with this message at 00:32 on May 2, 2009 |
# ¿ May 1, 2009 22:16 |
|
Free Bees posted:Visual Studio owns.
|
# ¿ May 9, 2009 18:43 |
|
I don't think they're talking about functionality so much as the intuitiveness of VS' debugger. In general, debuggers that are built into IDEs are easier for the neophyte to pick up - think about setting a breakpoint in Eclipse as compared to gdb, for instance. Once you know a bit about the latter there's nothing to it, but it seems a bit more arcane than clicking a tab to the left of the line you want a break on.tripwire posted:Python is interpreted and comes with an interactive shell.
|
# ¿ May 9, 2009 19:21 |
|
Ah, that's a good point; I suppose instead of inspecting your data in a debugger, you could quite literally just print it out in the intepreter I hadn't really thought about things that way.
|
# ¿ May 9, 2009 19:48 |
|
Avenging Dentist posted:Apparently we're getting better at this!
|
# ¿ May 14, 2009 02:24 |
|
The only one that comes to mind for me is hexadecimal getting banned, and I think that happened outside SH/SC anyway.
|
# ¿ May 18, 2009 08:29 |
|
tef posted:And yes, hexadecimal (perma'd user enenthogen) !(x ^ y)
|
# ¿ May 18, 2009 18:11 |
|
royallthefourth posted:Prolog is really just a relational database, like SQL. You wouldn't write a whole app in SQL, and doing so in Prolog is also a really bad idea. But when you need it, it's really great. Yes, this is a nice constraint satisfaction problem, so Prolog would do the job well. Five bucks says tef has already seen this thread and is working on a solution right now
|
# ¿ Jun 4, 2009 19:01 |
|
tef posted:Datalog is an example to the contrary - logical programming makes it very easy to express the relationship between things. Dijkstracula fucked around with this message at 19:16 on Jun 4, 2009 |
# ¿ Jun 4, 2009 19:12 |
|
Evil Home Stereo posted:I don't really understand why it is possible to solve this type of problem in some languages and not others. *algorithm isn't quite the right word; the technical term is "computable function", which has different implications, which delves into a bit more CS theory than you probably care about at this point.
|
# ¿ Jun 5, 2009 15:09 |
|
ShoulderDaemon posted:Aho, Sethi, and Ullman's book is generally considered to be a strong introductory and reference text. You may want to pair it with a text on language theory such as the Sipser or the Ullman / Hopcroft, as the Dragon book drops you in the deep end with respect to grammars and whatnot. It'd be fun to start up a reading group for the Dragon text. I really hope I get to TA the compiler class next year Dijkstracula fucked around with this message at 00:17 on Jun 18, 2009 |
# ¿ Jun 18, 2009 00:15 |
|
DRO posted:I'm writing a program in MIPS and I'm having a problem formatting output. (Also this sounds suspiciously like part of a homework problem.)
|
# ¿ Jul 23, 2009 19:32 |
|
sund posted:Just making sure that you didn't do x-((x/10)*10) to get the decimal place. I'm not familiar with MIPS assembly, but by a quick google search it looks like the divide instruction performs a modulo operation as well, so you only have to do a single math instruction.
|
# ¿ Jul 24, 2009 14:44 |
|
outlier posted:A graph layout / graphics type problem: I've written some code to draw phylogenetic trees, but I developed it from first principles, it's subpar and I'd like some pointers to decent prior art or algorithms. Here are two programs for phylogeny viz I've seen others using. http://www.phylowidget.org/ http://loco.biosci.arizona.edu/paloverde/paloverde.html
|
# ¿ Aug 1, 2009 18:06 |
|
I don't know the name of such a thing, but why on earth would you want to use that instead of a bit field? Suddenly extracting values becomes Hard-With-A-Capitol-H rather than a simple mask and shift.
Dijkstracula fucked around with this message at 18:50 on Aug 1, 2009 |
# ¿ Aug 1, 2009 18:47 |
|
nbv4 posted:Instead of creating a table in my database with a bunch of boolean columns, I can store all the information in one bigint. This way if I want to add a new boolean, instead of creating a new column in my table, I can just factor in a new prime. The only problem is that it would probably overflow the integer after so many primes... nbv4 posted:The method I remember reading about may have used addition, because I remember it being used with like 40 different booleans. edit: or, I'm easily trolled? Dijkstracula fucked around with this message at 21:26 on Aug 1, 2009 |
# ¿ Aug 1, 2009 21:20 |
|
Garbled, how? Is it a formatting issue (ie. correct characters not in the expected place) or are even the characters completely off? What are the differences between the computers that poo poo the bed and the ones that don't In any event, without seeing code, it's hard to tell what the issue is. Maybe post the contents of your SIGWINCH handler? also, "putty" is not a terminal type, so ncurses doesn't know anything about it. edit: I just reread your post. Chuu posted:All I'm doing is when data is pumped in, I check the height/width of the terminal, and put text on the screen based on that. I'm not doing anything fancy with events, all my code is based on the height/width global variables. In any event, post the relevant code, look up Unix signals, and implement a SIGWINCH handler. Even if this isn't the cause of your problems, you'll be one step closer to having a reasonably-well written program. Dijkstracula fucked around with this message at 14:44 on Sep 5, 2009 |
# ¿ Sep 5, 2009 14:32 |
|
|
# ¿ May 4, 2024 09:32 |
|
There's nothing wrong with semi-modern Fortran standards. Yes, Fortran 77 is pretty drat archaic, but if you updated the code to Fortran 90/95 standards, then you'll have far more readable and modern code without having to rewrite the entire thing from scratch. But, I'm not convinced porting code is the best way to learn a language, especially between languages like C and Fortran. I'm envisioning a post a few months from now where he asks "my C code is so much slower wtf" and us discovering that he didn't take into account Fortran's column-major arrays vs. C's row-major arrays and ended up blowing his cache or something. In my opinion it's better to work with what you know and save the "learn a language" projects for when they're not critical to your research/job/etc. Dijkstracula fucked around with this message at 20:45 on Oct 18, 2009 |
# ¿ Oct 18, 2009 20:43 |