|
Nice, thanks guys. I wasn't even sure where to begin.
|
# ? Dec 8, 2008 23:43 |
|
|
# ? May 14, 2024 17:50 |
|
csammis posted:Looks like someone got his Cheerios pissed in on the wrong side of the bed this morning If you know how to edit a file with a space in it, i.e. adding quotes you would do the same with other commands that gently caress up. It just seems a lot longer to find about a -d parameter than to use quotes wrapped around the URL.
|
# ? Dec 9, 2008 02:05 |
|
I just get pissy when I go into a thread that's about asking questions and get shat on. Maybe my question was from a dumb mistake, who knows?
|
# ? Dec 9, 2008 02:11 |
|
Rocko Bonaparte posted:I just get pissy when I go into a thread that's about asking questions and get shat on. It's not a programming question either. It was a lovely retort though, I apologise, I updated it to something slightly less antagonistic.
|
# ? Dec 9, 2008 08:02 |
|
MATLAB, the engineer's reasonable language where everything makes sensecode:
|
# ? Dec 9, 2008 21:01 |
|
My intuition says you have so say "global foo" in the subfuction, but I never used matlab, sorry. I am not an engineer.
|
# ? Dec 9, 2008 21:07 |
|
Vanadium posted:My intuition says you have so say "global foo" in the subfuction, but I never used matlab, sorry. I am not an engineer. Thanks, that works. I've abandoned any search for reason or consistency in Matlab - I'm just glad to get the drat thing working.
|
# ? Dec 9, 2008 22:12 |
|
Vivian Darkbloom posted:Thanks, that works. I've abandoned any search for reason or consistency in Matlab - I'm just glad to get the drat thing working. I've not used Matlab myself but there are other languages that require you to declare which global variables you are using. I like it because it lets you have global variables while still having some minimal control over where they're modified (do a search for global <varname>).
|
# ? Dec 10, 2008 00:13 |
|
Vivian Darkbloom posted:Thanks, that works. I've abandoned any search for reason or consistency in Matlab - I'm just glad to get the drat thing working. Matlab is faultless and I will have none of this talk about my beloved language! IIRC, you declare your global variables in both the subfunction and main function. ('help global' in the workspace )
|
# ? Dec 10, 2008 11:03 |
|
Stupid question about QuickSort: I understand why most of the algorithm works, but I'm confused as to swapping the pivot element at the end with whatever the last unsorted element is. If the pivot is greater than all other elements being sorted, wouldn't this result in the algorithm giving an incorrect result? Yet none of the pseudocode implementations I've seen check to make sure this is not the case. Is there something obvious I'm overlooking?
|
# ? Dec 10, 2008 19:49 |
|
PT6A posted:Stupid question about QuickSort: I understand why most of the algorithm works, but I'm confused as to swapping the pivot element at the end with whatever the last unsorted element is. If the pivot is greater than all other elements being sorted, wouldn't this result in the algorithm giving an incorrect result? Yet none of the pseudocode implementations I've seen check to make sure this is not the case. I assume you're talking about the last step in the in-place partition phase; Wikipedia gives representative pseudocode for this: code:
|
# ? Dec 10, 2008 23:43 |
|
rjmccall posted:I assume you're talking about the last step in the in-place partition phase; Wikipedia gives representative pseudocode for this: Yep, I see it now. I was actually working off my professor's pseudocode, but it's quite similar. I didn't notice that storeIndex gets incremented past (right - 1). It all makes sense now, thanks.
|
# ? Dec 11, 2008 00:05 |
|
How easy would it be to write something that reads in well-formed XML and writes it back out with certain stylistic points (such as if it has more than 3 attributes, put them each one one line) or alphabetize the attributes, etc.. I'm open to languages, but it seems like C# would be suited to do this, I just want to know if I'm biting off more than I chew if I start this. (This would be to clean up some XML files I hand-wrote. There's no Serializer for it or anything, I read in the XML ignorant of the styling and I never have the application write it back out.)
|
# ? Dec 11, 2008 02:50 |
|
Ugg boots posted:How easy would it be to write something that reads in well-formed XML and writes it back out with certain stylistic points (such as if it has more than 3 attributes, put them each one one line) or alphabetize the attributes, etc.. I'm open to languages, but it seems like C# would be suited to do this, I just want to know if I'm biting off more than I chew if I start this. (This would be to clean up some XML files I hand-wrote. There's no Serializer for it or anything, I read in the XML ignorant of the styling and I never have the application write it back out.) I am not well versed in C# but if i was to do this, I would use lex/yacc. I am pretty sure C# supports regular expression matching with its standard API, so lexer part is done. You should look into C# compiler/compiler, or just make your own parser, then parse in XML and spit it back out in whatever format you want. This is probably at least a few days worth of work.
|
# ? Dec 11, 2008 02:56 |
|
hexadecimal posted:I am not well versed in C# but if i was to do this, I would use lex/yacc. I am pretty sure C# supports regular expression matching with its standard API, so lexer part is done. You should look into C# compiler/compiler, or just make your own parser, then parse in XML and spit it back out in whatever format you want. This is probably at least a few days worth of work. This sounds like overkill; I swear there has to be a better/smarter way to do this.
|
# ? Dec 11, 2008 03:12 |
|
Ugg boots posted:This sounds like overkill; I swear there has to be a better/smarter way to do this. Assuming you already are familiar with XML (like understand what an attribute is) and you already know how to program in a C-type language it shouldn't be hard at all. Look up System.Xml.XmlDocument and XmlReader.
|
# ? Dec 11, 2008 04:24 |
|
DLCinferno posted:Look up System.Xml.XmlDocument and XmlReader. I'm familiar with a lot of what C# has to offer, just my exposure to XML programming has been quite limited. It looks like System.Xml.XmlTextReader will help me, since I can read in an XML document and just iterate through the document. Instead of writing the document out with an XML Writer, though, I will probably just write it all out to disk by hand, so I can format it. Then the only thing that I need to be careful of is that I don't accidentally clobber anything, but a diff tool should help with that. Edit: There's nothing in the XLinq suite that I could use to make this easier, is there?
|
# ? Dec 11, 2008 05:04 |
|
hexadecimal posted:I am not well versed in C# but if i was to do this, I would use lex/yacc. I am pretty sure C# supports regular expression matching with its standard API, so lexer part is done. You should look into C# compiler/compiler, or just make your own parser, then parse in XML and spit it back out in whatever format you want. This is probably at least a few days worth of work. It is becoming clear that whenever someone asks a question, whatever hexadecimal suggests is almost certainly what you don't want to do.
|
# ? Dec 11, 2008 06:40 |
|
hexadecimal posted:I am not well versed in C# but if i was to do this, I would use lex/yacc. I am pretty sure C# supports regular expression matching with its standard API, so lexer part is done. You should look into C# compiler/compiler, or just make your own parser, then parse in XML and spit it back out in whatever format you want. This is probably at least a few days worth of work. Shine on you crazy diamond
|
# ? Dec 11, 2008 06:44 |
|
there's a toprettyxml function for objects returned by python's xml.dom.minidom module:code:
|
# ? Dec 11, 2008 08:18 |
|
sund posted:there's a toprettyxml function for objects returned by python's xml.dom.minidom module: It's so crazy I must try it! Edit: That worked awesome to put the XML into a standard prettified format. I could definitely take the output of this, and knowing for example that each element (or close tag) is on its own line, take each line/element and format it how I want it. Thanks! POKEMAN SAM fucked around with this message at 08:33 on Dec 11, 2008 |
# ? Dec 11, 2008 08:28 |
|
There is always something like xslt
|
# ? Dec 11, 2008 10:29 |
|
My brain is being dense right now and I'm having problems getting gfortran to link to a library. I know that I have the library I'm trying to link to: /usr/lib/liblapack.so.3.0 (has a symlink pointing to it at /usr/lib/liblapack.so.3) It successfully links if I do the following: gfortran -o program /usr/lib/liblapack.so.3 filename1.o filename2.o .... I am used to linking to a library by using -l, so something like gfortran -o program -llapack filename1.o ... (potentially with the -llapack at a different location on the line, I normally let a build system take care of this so I don't remember the exact placement) However this second version always produces the following error: /usr/bin/ld: cannot find -llapack I'm using 64-bit Ubuntu Linux, ld 2.18, gfortran 4.2.1, and LAPACK comes from the packages lapack3. What do I need to do to get so that I don't need to specify an absolute path to the library? The program is normally built with GNU Make and built on lots of different systems so relying on an absolute path for a library isn't an option.
|
# ? Dec 11, 2008 22:57 |
|
6174 posted:My brain is being dense right now and I'm having problems getting gfortran to link to a library. If it's anything like gcc/g++ you just need to put the library path after a -L option: code:
|
# ? Dec 11, 2008 23:51 |
|
No Safe Word posted:If it's anything like gcc/g++ you just need to put the library path after a -L option: gfortran is very much like gcc/g++ since it is also part of the GNU Compiler Collection (The gfortran info page even tells you to read the gcc info page for the language independent options). However I still get the error. code:
|
# ? Dec 12, 2008 00:12 |
|
Try symlinking liblapack.so to liblapack.so.3. I seem to remember that ld only maps -lfile to libfile.so. I could be wrong but that's the first thing I'd try.
|
# ? Dec 12, 2008 00:32 |
|
simux posted:Try symlinking liblapack.so to liblapack.so.3. I seem to remember that ld only maps -lfile to libfile.so. I could be wrong but that's the first thing I'd try. That works. It allows just -llapack to find the library. This brings up a related question. If ld simply maps -lfile to libfile.so, then why is it that quite a few of the libraries I've got in /usr/lib do not have a .so variant? Many of them are named libfile.so.# for some number #. But there are also quite a few that have a .so symlinked to the .so.# version. Presumably with as many libraries that have this, the Ubuntu packagers didn't botch this many packages, so I'm missing something. I do see that if I run ldd on the executable, it points to liblapack.so.3. Does this mean that a .so symlink is only needed if you are linking to a specific library, and since most people aren't doing that (at least using ld), the .so symlink isn't needed and thus the package maintainers don't put it in?
|
# ? Dec 12, 2008 00:56 |
|
6174 posted:That works. It allows just -llapack to find the library. It's been a while since I've worked with Linux packaging, but I believe you won't get the symlinks unless you have the package <FOO>-dev (or similar) installed.
|
# ? Dec 12, 2008 01:12 |
|
So i'm working on this C# project for work, and I'm just starting to seriously use inheritance for the first time. I have a base class that does x, y, and z, and I want another object that does x, y, z, AND w. It seems clunky to include w in the base, so I made this derived class. The only constructor in the derived class takes a base-class object as a parameter, since it will be performing additional processing on everything that object controls. Here is an outline of what I've got:code:
jimbroof fucked around with this message at 07:21 on Dec 12, 2008 |
# ? Dec 12, 2008 05:26 |
|
It's a bad design, but not for the reason your coworkers are saying (and I'm not really even sure they're saying anything that makes sense at all). Inheritance is an "is-a" relationship, e.g. a Ford is-a kind of Car. A vector in R4 is not a kind of vector in R3, so you shouldn't be using inheritance. Just make two separate classes. You can usually tell when your inheritance ideas are bad if your primary reason is "code reuse".
|
# ? Dec 12, 2008 06:12 |
|
So I received the following window on my screen: This is related to the commercial game "Left 4 Dead". Is it best practices to leave assert statements in C++ code? This seems like a dev written debugger too? Also, any idea why it would be referencing a "U" drive that is invisible to windows explorer both before, during, and after running the game?
|
# ? Dec 12, 2008 12:38 |
|
quadreb posted:So I received the following window on my screen: quote:Also, any idea why it would be referencing a "U" drive that is invisible to windows explorer both before, during, and after running the game?
|
# ? Dec 12, 2008 13:04 |
|
Scaevolus posted:Well, it would make sense to leave in an assertion that new allocations worked. Shouldn't they have rolled over into a more user friendly "This application has crashed due to <blank>" instead of giving a debugger option that causes a crash likely because it expressly uses an in-house one for them? And I'm not really seeing this network drive idea of yours. I might see the statement be something like (treat as pseudocode): code:
|
# ? Dec 12, 2008 13:24 |
|
quadreb posted:If the drive doesn't exist on my computer, why would it be linked like that? The compiler just stored the path to the source file with the debugging symbols. Why should it care whether you happen to have a drive with the same name?
|
# ? Dec 12, 2008 13:30 |
|
Vanadium posted:The compiler just stored the path to the source file with the debugging symbols. Why should it care whether you happen to have a drive with the same name? I can see that, I guess. Still seems a bit odd for them to leave that sort of code in a published version.
|
# ? Dec 12, 2008 13:33 |
|
Maybe, but I have seen it happen with a bunch of commercial applications.
|
# ? Dec 12, 2008 13:38 |
|
floWenoL posted:It's been a while since I've worked with Linux packaging, but I believe you won't get the symlinks unless you have the package <FOO>-dev (or similar) installed. At least according to the Debian Policy Manual that is correct. Thanks for the clarification.
|
# ? Dec 12, 2008 18:36 |
|
Where can I find info about how Linker scripts work? To give some background: I'm writing a program for a microprocessor, not much of an OS. I need the entire program stored in flash but run from RAM. I can do this easily for functions I've written, but the compiler adds in functions like memcpy and __divsf3 (handles floating point division), and I'd like all that run out of RAM as well. Any thoughts?
|
# ? Dec 12, 2008 19:14 |
|
What kind of microprocessor?
|
# ? Dec 13, 2008 02:48 |
|
|
# ? May 14, 2024 17:50 |
|
ante posted:What kind of microprocessor?
|
# ? Dec 13, 2008 07:19 |