|
Did you try method="post"?
|
# ? Dec 3, 2008 18:13 |
|
|
# ? May 15, 2024 22:42 |
|
Vanadium posted:Did you try method="post"? Yes, same result Also, I know it's posting because a refresh in my browser pulls up a "re-send" confirmation.
|
# ? Dec 3, 2008 18:15 |
|
I figured it out... it needs to be "name" instead of "id". I knew it was something stupid.
|
# ? Dec 3, 2008 18:22 |
|
Gilgamesh posted:something stupid.
|
# ? Dec 3, 2008 19:59 |
|
what is a good regex for a URL starting with [url]http://[/url]
|
# ? Dec 3, 2008 23:10 |
|
hexadecimal posted:what is a good regex for a URL starting with [url]http://[/url] http://immike.net/blog/2007/04/06/5-regular-expressions-every-web-programmer-should-know/
|
# ? Dec 3, 2008 23:12 |
|
I solved my problem, if anyone is interested. The problem wasn't with the C++ file, but with the ASM. My file was called FpMult.asm, and I ended the file with END FpMult (because I read somewhere that you were supposed to do an END <FILENAME>, so I thought it'd be a great idea). Well, apparently with an ASM file with more than one function, you're not supposed to do this, or you get the result I get, which was where the "driver" program doesn't ever get a chance to execute. My professor simply deleted the label, telling me "This won't do anything," and sure enough it did. EDIT: Blah.
|
# ? Dec 4, 2008 01:17 |
|
this is more of a estoeric crypto question than programming but I didn't want to make a new thread so unless someone can recommend another megathread to post it in: I have a linear secret share of the form X + Y mod N = C Let C be some 64-bit integer of the form C = A + B*(2^32) If there are two parties, one of whom knows X and the other knows Y, is it possible for them to interact in some way to produce Xa, Xb and Ya, Yb such that Xa/Ya are secret shares of A, and Ya/Yb are secret shares of B, without either learning A, B or C? This is related to this paper on secure scalar products. On page 13 they discuss the possibility of 'packing' plaintexts into a single ciphertext for batch scalar products and note that a subset of those plaintexts and be recovered "...efficiently by using standard cryptographic techniques." I'm not really sure how though.
|
# ? Dec 4, 2008 04:21 |
|
I guess COC is a good place to put this question. There is a site with the same theme as http://getsatisfaction.com/ only you vote on what people want with points. It has the same 'Feedback' button and all.
|
# ? Dec 4, 2008 04:46 |
|
Sgt. Raisins posted:I guess COC is a good place to put this question. What
|
# ? Dec 4, 2008 04:51 |
|
Sgt. Raisins posted:I guess COC is a good place to put this question. That isn't a question.
|
# ? Dec 4, 2008 05:51 |
|
Yeah, it was late and I didn't think it though. Lets rephrase it. I am looking for a site that offers to take care of feedback and feature requests. It is very similar to http://getsatisfaction.com/ The other site even has a similar feedback button that they have you to put in the page. The big difference is that they give you votes(4-5 I think) to put in to features you would like to see. Anyone have any idea what site I am talking about? EDIT: Never mind, Someone found it for me http://uservoice.com/ Sgt. Raisins fucked around with this message at 15:08 on Dec 4, 2008 |
# ? Dec 4, 2008 14:30 |
|
code:
|
# ? Dec 5, 2008 13:37 |
|
nbv4 posted:
The problem is that field refers to the last object in all callbacks, right? I think you can workaround that by having the variable enclosed in the callback function come from another function's scope: code:
|
# ? Dec 5, 2008 14:22 |
|
Is this a thread for algorithms? I was wondering if there was a quick or easy algorithm to test if a point is inside a non-convex polygon
|
# ? Dec 5, 2008 15:19 |
|
All these years, with the little network programming I've done, I've written communication like this:my appz posted:Client: SEND|FILE|<file> Now I wonder if it's better to just send the file back with the first bytes of the stream set as the size, type etc. Is it better to header the packets, or to use the more interactive client/server command system?
|
# ? Dec 5, 2008 16:55 |
|
tractor fanatic posted:Is this a thread for algorithms? I was wondering if there was a quick or easy algorithm to test if a point is inside a non-convex polygon I don't know about testing for concave property, but the one test I remember off hand is drawing a line from some point inside polygon and seeing how many times it intersects the edges of polygon. If it's odd then the point is inside, if it its even its outside.
|
# ? Dec 5, 2008 17:09 |
|
Hey, I wrote an AVL tree implementation in C (btw comments welcome, I think it's pretty dashing) and I'm having some problems. When I manually insert these words by doing insert(root, "word") and then manually remove them by remove(&root, "word"), everything seems to work fine. For example, the root is relevailles, the height ends up at 4 and then when I remove them in order, the height ends up at 0 because all the elements are removed and root is a null pointer. However, when I try to insert from a file like in the source and then iterate over that file to remove words, I get strange results, because after removing all the elements, I get that the final height is 1, when it should be 0. I suck at doing I/O in C and I recon there's a problem in the way I read the lines from the file. Anyone know what I'm doing wrong? hey mom its 420 fucked around with this message at 18:32 on Dec 6, 2008 |
# ? Dec 6, 2008 14:50 |
|
Probably your use of feof http://drpaulcarter.com/cs/common-c-errors.php#4.2
|
# ? Dec 6, 2008 15:21 |
|
Hmm, tried checking for feof after the call to fgets and breaking out then, but no change. EDIT: Ah, got it, when doing malloc, I wasn't reserving space for the null termination byte. When I do malloc(strlen(buf) + 1)), it seems to work fine. I found another problem though, ugh. When I load up a file with 1,5M words that are in order and load it up, I get a reported tree height of 21, which sounds good because log2(1,5M) is just under 21. However, if I shuffle the lines in that file and try to insert them, I get a reported tree height of 25, which seems way too much. Can anyone see any problems on a quick glance with the code? EDIT: UGHH!!! I'm so stupid, nevermind, it didn't come to my stupid head that a 1,5M node AVL tree with a height of 25 can still be balanced. hey mom its 420 fucked around with this message at 20:26 on Dec 6, 2008 |
# ? Dec 6, 2008 15:46 |
|
I want to allow access to a site if terms are agreed upon. If the user hasn't agreed, they are re-directed to the terms page. What is a good approach?
|
# ? Dec 6, 2008 19:23 |
|
im_afraid_of_clowns posted:I want to allow access to a site if terms are agreed upon. If the user hasn't agreed, they are re-directed to the terms page. What is a good approach? A javascript alert window would be easiest.
|
# ? Dec 6, 2008 19:35 |
|
quadreb posted:A javascript alert window would be easiest. I went with the setcookie php function and checking the cookie on every page. I'm still learning php and this is what I did: code:
code:
im_afraid_of_clowns fucked around with this message at 23:47 on Dec 6, 2008 |
# ? Dec 6, 2008 23:37 |
|
im_afraid_of_clowns posted:I want to allow access to a site if terms are agreed upon. If the user hasn't agreed, they are re-directed to the terms page. What is a good approach? Any login system, make the terms part of the account signup agreement.
|
# ? Dec 7, 2008 11:14 |
|
I'm going to also use a trie for storing words of the alphabet and searching through them, etc. What's the best way to store the edges in a node? If I use an array that I increase and decrease in size, I save space but I have to traverse the edges to find the next node. If I just use an array of 256 fields (one for each character in ASCII), I can just index them to get the next node but 256 fields times 8 for each (char, node pointer) pair is 2Kb. I could also use a hash table but I don't know if that's worth it.
|
# ? Dec 7, 2008 21:29 |
|
Bonus posted:I'm going to also use a trie for storing words of the alphabet and searching through them, etc. What's the best way to store the edges in a node? The general rule with tries is that you should use a fixed-size array unless the character set is prohibitively large. 256 is not prohibitively large, but (say) the Unicode set is. Even if the "flat" character set is prohibitively large, you should consider splitting individual characters into sequences of smaller sets, e.g. with Unicode by branching on the bytes of a UTF-8 encoding. Bonus posted:If I use an array that I increase and decrease in size, I save space but I have to traverse the edges to find the next node. If there's a clear pre-processing phase, you could keep them in sorted order and do a binary search. But again, this isn't worthwhile unless you can't use fixed-size arrays. Bonus posted:If I just use an array of 256 fields (one for each character in ASCII), I can just index them to get the next node but 256 fields times 8 for each (char, node pointer) pair is 2Kb. 1. Why would you need to store the character in each entry? 2. Another advantage of fixed-size arrays (if you're using C/C++) is that you can keep the array inline in each node, which should help space usage a little (and significantly reduce your running time). 3. The only reason to support 256 branches at each node is if you want to treat strings as opaque binary data, which is reasonable if they're 1) actually binary data or 2) arbitrary Unicode text. Otherwise, you should figure out what assumptions are valid about your data, then go hog-wild: notably, case-insensitive English words only need 26 branches per node (plus a few if you allow compounds / hyphenated compounds / contractions). Bonus posted:I could also use a hash table but I don't know if that's worth it. This is a decent option if your character set is very large (or infinite). rjmccall fucked around with this message at 23:04 on Dec 7, 2008 |
# ? Dec 7, 2008 22:46 |
|
Cool, I just implemented the trie by using a field which increases and decreases in size but I have to traverse when seeing which edge to follow. It performs alright for inserting, looking up and then deleting 1.5M words, but not as well as the AVL tree and hash table. I'll try doing some branching to see how fast it is if I switch to a hash table for storing edges or a field that I can index in O(1) time. I've done an analysis of the input files and I've found that they contain 78 different ASCII characters, so that shouldn't be a problem. Later I'll have to add the ability to find the n nearest words for any word by Levenshtein distance and I have a feeling tries will give good performance there. AVL trees will probably be alright for that too but I have no idea if it's even possible to implement that efficiently if I'm storing the words in a hash table.
|
# ? Dec 7, 2008 23:50 |
|
This is a question about using curl, but I thought it might be answered here since I think anybody here who has done some automation has probably done this before. Suppose I want to access IBM's news on Google Finance. Your browser can go there at: http://finance.google.com/finance?morenews=10&rating=1&q=NYSE:IBM Now I want to retrieve that from the command line. Generally when I see '&' I assume it's time for curl. I am trying: curl -d "morenews=10" -d "rating=1" -d "q=NYSE:IBM" http://finance.google.com/finance > test.html test.html will end up being the main google finance page. No good. What am I missing?
|
# ? Dec 8, 2008 05:59 |
|
Rocko Bonaparte posted:This is a question about using curl, but I thought it might be answered here since I think anybody here who has done some automation has probably done this before. Suppose I want to access IBM's news on Google Finance. Your browser can go there at: curl 'http://finance.google.com/finance?morenews=10&rating=1&q=NYSE:IBM' It's a GET request, not a POST, so you just request the URL with no particular cleverness. Edit: Just to be clear, this is a property of HTTP, not of curl; wget or indeed any web client behaves the same way. The only time you need to use curl's -d stuff is when the page requires POST data (and, consequently, could not be made into a [url][/url] link). ShoulderDaemon fucked around with this message at 06:17 on Dec 8, 2008 |
# ? Dec 8, 2008 06:14 |
|
I was trying wget on the full URL and was getting a 404. Is there something to it or should that have just worked?
|
# ? Dec 8, 2008 07:54 |
|
Rocko Bonaparte posted:I was trying wget on the full URL and was getting a 404. Is there something to it or should that have just worked? If you ran wget http://finance.google.com/finance?morenews=10&rating=1&q=NYSE:IBM without the quotes around the URL, it'll parse as wget http://finance.google.com/finance?morenews=10 & rating=1 & q=NYSE:IBM, which runs wget http://finance.google.com/finance?morenews=10 in the background, resulting in a 404, sets the environment variable rating to 1, and sets the environment variable q to NYSE:IBM. Edit: This is sort of a pet peeve of me, I have no idea why the GET syntax settled on using ampersand to separate query components, even though many shells have used that as a reserved character for ages. What makes it worse is that recently a new separator was proposed (which, of course, web browsers can't safely use at this point because the server code may be too old to understand it) and that wound up as semicolon, possibly the only character reserved by more shells than ampersand. ShoulderDaemon fucked around with this message at 08:17 on Dec 8, 2008 |
# ? Dec 8, 2008 08:11 |
|
Bonus posted:Cool, I just implemented the trie by using a field which increases and decreases in size but I have to traverse when seeing which edge to follow. It performs alright for inserting, looking up and then deleting 1.5M words, but not as well as the AVL tree and hash table. I'll try doing some branching to see how fast it is if I switch to a hash table for storing edges or a field that I can index in O(1) time. That's pretty cool. There's another self-balancing tree that's faster than AVL called the DSW algorithm. It's different in the sense that it doesn't balance on each insert, delete but rather waits and then turns the tree into a "vine" (a linked list), and then re-forms the tree by unrolling the "vine". It is superb. I always meant to implement a trie but never did
|
# ? Dec 8, 2008 13:53 |
|
Rocko Bonaparte posted:http://finance.google.com/finance?morenews=10&rating=1&q=NYSE:IBM ShoulderDaemon posted:Edit: This is sort of a pet peeve of me, I have no idea why the GET syntax settled on using ampersand to separate query components, even though many shells have used that as a reserved character for ages. Ampersand wasn't evented for shell syntax, spaces don't work well in shell's too and that's 110% a neckbeards fault. MrMoo fucked around with this message at 07:58 on Dec 9, 2008 |
# ? Dec 8, 2008 14:28 |
|
narbsy posted:That's pretty cool. There's another self-balancing tree that's faster than AVL called the DSW algorithm. It's different in the sense that it doesn't balance on each insert, delete but rather waits and then turns the tree into a "vine" (a linked list), and then re-forms the tree by unrolling the "vine". It is superb. Just for fun I also went and implemented tries in Haskell, took me about 10 minutes, Haskell owns. code:
|
# ? Dec 8, 2008 15:41 |
|
Does anyone have any experience with FreePastry and Windows? I'm going through the tutorials and have managed to get 2 nodes to see each other. The problem is that the first node does not report any messages being received from the second node. Apparently the output should be : code:
code:
The 2nd node seemingly works fine, and it does attempt to directly send messages to the node, which is on the leaf set, so I don't know what's going wrong
|
# ? Dec 8, 2008 16:25 |
|
MrMoo posted:This can only be a troll, no ones that stupid. Looks like someone got his Cheerios pissed in on the wrong side of the bed this morning
|
# ? Dec 8, 2008 17:17 |
|
MrMoo posted:This can only be a troll, no ones that stupid.
|
# ? Dec 8, 2008 17:18 |
|
This isn't entirely a programming question, but most of you guys are math geniuses anyways so I'll give it a shot. If I have a polygon with n points each with a coordinate (e.g. longitude, latitude) and I have a point (x) on a map, how can I prove that x is either contained inside of the polygon or not? If it's not too horribly obvious, my math skills are terrible I know.
|
# ? Dec 8, 2008 22:57 |
|
http://en.wikipedia.org/wiki/Point_in_polygon
|
# ? Dec 8, 2008 22:58 |
|
|
# ? May 15, 2024 22:42 |
|
Stephen posted:This isn't entirely a programming question, but most of you guys are math geniuses anyways so I'll give it a shot. Draw a ray from the point in a direction of the polygon and count how many times the line intersects the polygon. If its odd then point is inside, if the number of intersections is even then its outside. If you don't encounter any intersection at all, then its outside, obviously.
|
# ? Dec 8, 2008 23:04 |