|
DaGr8Gatzby posted:I think it's just GCC. It's not GCC's fault. Apple uses its own weird-rear end branch of GCC because they're big babies who don't want to mainline their Objective-C patches.
|
# ? Nov 12, 2009 00:01 |
|
|
# ? Jun 7, 2024 16:49 |
|
Avenging Dentist posted:It's not GCC's fault. Apple uses its own weird-rear end branch of GCC because they're big babies who don't want to mainline their Objective-C patches. Partly because RMS is a big baby who doesn't want to mainline Objective-C at all (hence the perma-deprecated status of #import and GCC emitting punitive warnings about it).
|
# ? Nov 12, 2009 00:09 |
|
haveblue posted:Partly because RMS is a big baby who doesn't want to mainline Objective-C at all (hence the perma-deprecated status of #import and GCC emitting punitive warnings about it). #import in the actual language would reduce compile times on a lot of large projects by at least 50% (at least on Windows)
|
# ? Nov 12, 2009 02:28 |
|
more falafel please posted:#import in the actual language would reduce compile times on a lot of large projects by at least 50% (at least on Windows) No it would not.
|
# ? Nov 12, 2009 04:08 |
|
Objective-C projects on Windows?!
|
# ? Nov 12, 2009 05:12 |
|
Mustach posted:Objective-C projects on Windows?! With gcc, anything* is possible *offer does not include legible error messages, correctness or performance of generated code
|
# ? Nov 12, 2009 05:32 |
|
I have an assignment in CS to make a concatenator that merges several text files into one (Java ClassName text1.txt text2.txt text3.txt compilation.txt), but we've received no useful reading resource for doing so. Does anyone know some good guides on the subject online?
|
# ? Nov 12, 2009 17:42 |
|
ufarn posted:I have an assignment in CS to make a concatenator that merges several text files into one (Java ClassName text1.txt text2.txt text3.txt compilation.txt), but we've received no useful reading resource for doing so. The documentation for system.io and possibly string? That's not exactly an esoteric topic.
|
# ? Nov 12, 2009 17:47 |
|
sund posted:Does Windows have a kill() equivalent? I'd like to send SIGINT to a background process I spawned with CreateProcess() without too much hassle. TerminateProcess() won't work, it causes this utility to leave temporary files around. GenerateConsoleCtrlEvent will work if you create the original process with CreateProcess and it is a console application. Read the page when it talks about CREATE_NEW_PROCESS_GROUP for details.
|
# ? Nov 12, 2009 17:52 |
|
litghost posted:GenerateConsoleCtrlEvent will work if you create the original process with CreateProcess and it is a console application. Read the page when it talks about CREATE_NEW_PROCESS_GROUP for details. Perfect! Thanks a bunch. All Google got me was "send WM_CLOSE".
|
# ? Nov 12, 2009 18:00 |
|
ufarn posted:I have an assignment in CS to make a concatenator that merges several text files into one (Java ClassName text1.txt text2.txt text3.txt compilation.txt), but we've received no useful reading resource for doing so. Check out the BufferedReader class in the API, it has a clear example on how to open a file. code:
For writing a file check out the PrintWriter class. code:
|
# ? Nov 12, 2009 18:31 |
|
I'm curious about why this batch script broke:code:
|
# ? Nov 13, 2009 13:09 |
|
With Javascript, is there anyway to set document.location.hash without appending an item to the browser's recent history? We have a Flex app at work and I want to let users bookmark/deep-link pages by setting the fragment each time they change the view. The fragment sets correctly, but the user can then toggle through the recent hashes by using back/forward. I don't plan on picking up those change events so I'd rather the hash changes not append history items.
|
# ? Nov 14, 2009 02:21 |
|
digital-entropy posted:With Javascript, is there anyway to set document.location.hash without appending an item to the browser's recent history? We have a Flex app at work and I want to let users bookmark/deep-link pages by setting the fragment each time they change the view. No.
|
# ? Nov 15, 2009 06:04 |
|
digital-entropy posted:With Javascript, is there anyway to set document.location.hash without appending an item to the browser's recent history? Couldn't you do something horrible with scrollTo or similar?
|
# ? Nov 15, 2009 23:01 |
|
tef posted:Couldn't you do something horrible with scrollTo or similar? He's not using hashes to scroll to specific locations, he's using them so deep linking works with his Flash app, but he doesn't want to bother making the back/forward buttons work and people like him are the reason the rest of us hate Flash.
|
# ? Nov 16, 2009 03:22 |
|
pseudorandom name posted:He's not using hashes to scroll to specific locations, he's using them so deep linking works with his Flash app, but he doesn't want to bother making the back/forward buttons work and people like him are the reason the rest of us hate Flash. The reason I'm attempting to do it this way is that a coworker put app-specific back/forward buttons in and at some point they do need to be stripped out but that's going to be a bigger endeavor than simply working around it for now. Believe me, I'd rather just use the browser back/forward work but it isn't something I am currently able to do. But thanks for being a smartass and bothering to inquire why I might be stuck doing things a particular way. People like you are the reason the rest of us hate the internet.
|
# ? Nov 16, 2009 08:58 |
|
pseudorandom name posted:He's not using hashes to scroll to specific locations, he's using them so deep linking works with his Flash app, but he doesn't want to bother making the back/forward buttons work and people like him are the reason the rest of us hate Flash. oh I see
|
# ? Nov 16, 2009 12:21 |
|
digital-entropy posted:The reason I'm attempting to do it this way is that a coworker put app-specific back/forward buttons in and at some point they do need to be stripped out but that's going to be a bigger endeavor than simply working around it for now. Sorry man; but every time I use a Flash app with a UI that almost but not quite behaves like a real UI it drives me nuts.
|
# ? Nov 16, 2009 15:01 |
|
Just on a quick note: The cobol aggregator is still alive and kicking at http://sn.printf.net If anyone wants their blog to be added, just ask.
|
# ? Nov 16, 2009 17:17 |
|
I have a quick newbie Java question regarding random numbers. Random rand = new Random(); int i = rand.nextInt(30); As I understand it, this will make i some random int between 0 and 29. Now let's say I want to generate a random long value that is well outside int's range. So, something greater than 2147483647. Random has a nextLong() method, but as far as I can tell, you can't pass it an upper limit. So right now, I'm generating a random number and checking that it is less than whatever the upper limit is, regenerating the number until it is less than the upper limit. It's working but I'm totally sure there is a much more efficient way to do it. vvvvvvvvvv Awesome, thank you. Seaniqua fucked around with this message at 21:21 on Nov 16, 2009 |
# ? Nov 16, 2009 20:14 |
|
Modulo.
|
# ? Nov 16, 2009 20:33 |
If an application is completely controlled by different key/values in a JSON object, what's the best way to document all the different parameters you can use?
|
|
# ? Nov 16, 2009 21:47 |
|
fletcher posted:If an application is completely controlled by different key/values in a JSON object, what's the best way to document all the different parameters you can use? By... listing the valid keys? I'm not sure what you're asking here.
|
# ? Nov 16, 2009 21:49 |
Avenging Dentist posted:By... listing the valid keys? I'm not sure what you're asking here. I guess I'm looking for a good example that is already out there of what I'm trying to do.
|
|
# ? Nov 16, 2009 21:53 |
|
fletcher posted:I guess I'm looking for a good example that is already out there of what I'm trying to do. It's not really a complex problem. You can probably get away with a simple two-level list.
|
# ? Nov 16, 2009 22:02 |
haveblue posted:It's not really a complex problem. You can probably get away with a simple two-level list. Some of the values should be other JSON objects, some should be an array of values, etc, so it is a bit more involved. I guess I should have mentioned that, my bad!
|
|
# ? Nov 16, 2009 22:45 |
|
I'm having problems running a batch file on Windows Server 2008.code:
edit: I'm also not a programmer so if that's not the best way of doing what I need, what's a better way? Also how could I parse the byte output to something like kilobytes or megabytes? edit 2: I found out what the problem was: The password of the Administrator account was different than the XP machines. Changed that to match and it worked fine. TheWevel fucked around with this message at 04:55 on Nov 17, 2009 |
# ? Nov 16, 2009 23:25 |
|
Seaniqua posted:I have a quick newbie Java question regarding random numbers. Use either of the two implementations here: http://www.cs.gmu.edu/~sean/research/ This solves both the problem of getting a uniform long number within some range and of only 1/65536 of the possible values actually being produced because the default has a 48-bit seed.
|
# ? Nov 17, 2009 00:57 |
|
I've been working on a little project that involves processing quite a few (50) text files that aren't all quite the same format. I started doing them 1-by-1 using regexes in perl, but I stumbled across this article which made me think that I might be able to use a more elegant approach. I'm a total novice at defining grammars (never written a compiler!). Can they pick up paragraph-sized structures? How flexible can you make a grammar before it becomes useless?
|
# ? Nov 17, 2009 01:35 |
|
it's not the size of the "structure" that defines what kind of grammar you need, it's how complicated a parser you need. What do you need to do to this data? If you don't need to do anything as complicated as these (the canonical context-free examples being "counting" multiple elements or navigating a tree-like document structure), it's likely a regular expression is as expressive a grammar as you need.
|
# ? Nov 17, 2009 02:30 |
|
I have texts split into sections and subsections. The format is consistent within each text but not between them. For each document, I want to recognize sections and subsections and store each one along with its correct title and index (section, subsection). This is cool stuff, whether or not I actually need it.
|
# ? Nov 17, 2009 08:49 |
Avenging Dentist posted:By... listing the valid keys? I'm not sure what you're asking here. Still looking for suggestions on this. Basically I want to see if I can improve this.
|
|
# ? Nov 17, 2009 22:39 |
|
fletcher posted:Still looking for suggestions on this. Basically I want to see if I can improve this. Well, step one would be to make the actual options better designed. Since this is presumably meant to be used in a browser, you should be using the already-existing browser names for things. "colour?" "background-colour"? "on-click"? "alpha"? (this last one should be "opacity"). Step two would be cleaning up your quotation marks. Step three would be to get rid of the bold red (it is really annoying) and to just add a "compatibility" column. Also drop the "Object" column, format the example better, add hyperlinks to cross-reference the sub-objects, and add some headings in there. For extra credit, stop using OpenOffice to write your documentation and get a tool designed for writing documentation. Sphinx works well for Python, but you might be able to make it work for this too (or just use plain-Jane ReST).
|
# ? Nov 17, 2009 23:02 |
Avenging Dentist posted:Well, step one would be to make the actual options better designed. Since this is presumably meant to be used in a browser, you should be using the already-existing browser names for things. "colour?" "background-colour"? "on-click"? "alpha"? (this last one should be "opacity"). That page I linked isn't mine, it is what I intend to replace. Unfortunately I don't have enough control over the source code (yet) to rename all those attributes, otherwise I would. Is there nothing else out there that uses a JSON formatted object like this so I can see how they documented it?
|
|
# ? Nov 17, 2009 23:19 |
|
I'm working on my first ever Java program for a course at uni, and while I've got most of it working perfectly, I'm having a problem getting the input validation to work properly. Basically, any input must fill three criteria: it must be the right length, there can only be numbers and none of these numbers can be repeated. In other words, if the length is defined as "3" - 123 would be valid but 113, a23 and 1234 would not. I'd paste the exact methods I'm using to do this at the moment, but as it's coursework, I can't. Currently I'm using one method to parse the input into an array (we've been specifically instructed to use arrays) and call the other individual methods to test each validation criterion one by one from this method. When a validation criterion is unmet, the validation methods ask for a new input and sends that back to the first method to start the cycle of array entry and validation over. If that made any sense, you may have noticed that I'm left with the problem of the validation methods eventually returning to the point immediately after they call the first method after the replacement input has been tested - leading to all sorts of problems. Cliff notes: What is the best way to structure input validation when there are multiple criteria to be tested? Sorry if this is a stupid question, but I've got myself going in circles right now, and I'm a bit new to all this.
|
# ? Nov 18, 2009 01:11 |
|
Here is some pseudo code to help you. code:
Janitor Prime fucked around with this message at 01:52 on Nov 18, 2009 |
# ? Nov 18, 2009 01:49 |
|
MEAT TREAT posted:Here is some pseudo code to help you. I didn't 100% understand what your pseudocode was saying, but it did inspire me to a perfect and tidy solution (whether it was the way you were trying to tell me or not). Basically, I made all my validation methods return a boolean and sat them in a while loop until they all returned a true value. With hindsight, it's what I should have done in the first place. Now it works, is way tidier, and I'm pretty much all finished . Thanks! As for the avatar, yeah, I get that a lot. To be fair, that was kind of the point.
|
# ? Nov 20, 2009 17:28 |
|
I've got a batch file composing a list of files and directories by identifying them and echoing them into a .txt file, but the list always has trailing spaces at the end of each line, which gets in the way of what I mean to do. Trimming the last character from the string before echoing into the file doesn't cut the space, but the last meaningful character. Is there something I can do to make it not put that space in? Or will I have to manually remove that space every time I use an address from that file?
|
# ? Nov 23, 2009 13:48 |
|
|
# ? Jun 7, 2024 16:49 |
|
I have a general implementation question... Suppose I have a ball moving around the screen. Let's say the code for this was moveBall(delta_x, delta_y) so in a loop where delta_x = delta_y = 1 the ball would move at a constant 45 degree angle, one pixel per iteration. Now how would I write this if the ball could move at any angle? I was thinking about taking the ratio between sin(a) and cos(a), but how am I going to move sqrt(3) pixels at a time? Furthermore, if I call the speed at which the ball moves for d_x = d_y = 1 b, how can I make it so that the ball moves at speed b for any angle?
|
# ? Nov 23, 2009 16:08 |