|
etcetera08 posted:Yeah synirc is fine now. Everyone was getting k/b'd earlier. It's totally not fine, a whole bunch of people just got kickbanned for idling (including me).
|
# ? Nov 30, 2011 04:54 |
|
|
# ? May 15, 2024 06:36 |
|
yeah, I could parse the ascii in a snap. that's not what's been assigned to me though. I've been assigned specifically to read the binary format, for performance reasons apparently. My boss is talking to someone who he thinks might be able to get me the spec. meanwhile, I'm just trying to "crack" it by comparing ascii / binary output.
|
# ? Nov 30, 2011 05:56 |
|
ToxicFrog posted:It's totally not fine, a whole bunch of people just got kickbanned for idling (including me). From #cobol? That might've been by design...
|
# ? Nov 30, 2011 07:47 |
|
I've been asked in implementing a checksum algorithm based on J.G. Fletcher algorithm. Along the algorithm there is 4 different set of data that can be tested to see if the checksum value resulting is correct or not. I've been working on this for a long time and I can't for the life of me find what is wrong with it. I posted it on stackoverflow but some turd down voted it because he couldn't read my question. Maybe anyone could give me an hand on this please? http://stackoverflow.com/questions/8315215/checksum-algorithm-based-on-j-g-fletcher
|
# ? Nov 30, 2011 12:38 |
|
Are you sure your types are correct? - I've been able to match your output by making uint8 a signed char instead of unsigned. If I explicitly set it to be unsigned char it works fine. edit: http://pastebin.com/qear65jS is the program I was using, with gcc version 4.6.1.
|
# ? Nov 30, 2011 13:42 |
|
robostac posted:Are you sure your types are correct? - I've been able to match your output by making uint8 a signed char instead of unsigned. If I explicitly set it to be unsigned char it works fine. Thanks man, you were right someone very clever in our office defined a uint8 type as char instead of unsigned char... I feel really stupid now
|
# ? Nov 30, 2011 15:45 |
|
etcetera08 posted:From #cobol? That might've been by design... code:
|
# ? Nov 30, 2011 15:52 |
|
Le0 posted:Thanks man, you were right someone very clever in our office defined a uint8 type as char instead of unsigned char... I feel really stupid now you should use the standard integer typedefs in stdint.h for this reason.
|
# ? Nov 30, 2011 15:54 |
|
.
maskenfreiheit fucked around with this message at 21:27 on Apr 28, 2019 |
# ? Nov 30, 2011 16:38 |
|
TasteMyHouse posted:you should use the standard integer typedefs in stdint.h for this reason. I'm not allowed to use all the standard libraries because this is a Space project and the regulation are harsh
|
# ? Nov 30, 2011 16:43 |
Le0 posted:I'm not allowed to use all the standard libraries because this is a Space project and the regulation are harsh stdint.h does not actually define any functions or such. It is supplied by the compiler as a way to let your code specify integers of specific bit-widths and signedness without you having to make assumptions or guesses. It literally only contains a series of typedefs and some #defines for the numerical limits of the defined types. If there are regulations that really prevent you from using that kind of declarations, those regulations need a thorough review.
|
|
# ? Nov 30, 2011 16:52 |
|
Le0 posted:I'm not allowed to use all the standard libraries because this is a Space project and the regulation are harsh So it's better to throw the well understood standard data types header in favor of letting programmers roll their own? I feel another Mars Climate Orbiter coming up soon. Seriously though go reread the project restrictions because I really hope you're interpreting them wrong.
|
# ? Nov 30, 2011 16:54 |
|
Well I'm not personally in favor of this regulation because in wanting to be more secure it actually isn't really but we have no choice, we're working with the ESA European Space Agency and they have very unforgiving standards. I should probably check it again to see really if we can't use this. For example, RTEMS, open real time OS we're using (we're doing embedded btw), which has been used in a lot of the space programs also redefines all the common types in its own header. Anyway with the loving crazy amount of software testing this piece of code will go thru, I really doubt that the major issue will be type definition EDIT: Now that you're speaking about it, I should probably check if there is a header file defining type for the processor we're using (LEON2)
|
# ? Nov 30, 2011 18:39 |
|
There are some problems which, when you take a step back, are nice to have. Not that yours isn't an annoying one but drat, you're working on actual space tech! I'm envious.
|
# ? Nov 30, 2011 21:43 |
|
.
maskenfreiheit fucked around with this message at 21:28 on Apr 28, 2019 |
# ? Nov 30, 2011 22:41 |
|
Is there a tool to grab a schema of a Database, preferably one where I can check what I do and do not want included in it? To clarify, something that can get me something closeish to this, just in plain text or whatever pre:TABLE <Table Descripion> Column Name Data Type Encrypted Allow Nulls Description uniqueid tinyint No No <Description> Description nvarchar(100) No Yes <Description> Mr. Crow fucked around with this message at 23:35 on Nov 30, 2011 |
# ? Nov 30, 2011 23:28 |
|
GregNorc posted:Is there a good R tutorial for people who just need to get stuff done? Venables & Smith is the standard overview of the basic features of the language.
|
# ? Nov 30, 2011 23:33 |
|
GregNorc posted:So I''m trying to use subset() in R to remove inelligible participants from some study data. From what you've posted, your subset should already return all columns. For example, this works for me: code:
|
# ? Dec 1, 2011 00:00 |
|
I have an algorithm question of sorts. I have a list of strings that I wish to combine, first in pairs, then when that's exhausted, triplets, and so on. The combinations will be used as keys in a dictionary, let's say. Now, I would like to avoid storing state about what I've last picked, so I want to find the next free combination by a binary search, probing the dictionary. That obviously requires some sort of deterministic order. So far all is well. The problem is I'd rather have the results come out in a not obviously linear order. That doesn't mean it has to be truly random, but I don't want fifty combinations starting with "string one" before moving on to fifty combinations starting with "string two", etc. I've been trying to figure out a way to skip along the list using some hard-coded magic numbers or something, but that doesn't quite seem to work. Can anyone see a solution? Thanks!
|
# ? Dec 1, 2011 06:37 |
|
.
maskenfreiheit fucked around with this message at 21:28 on Apr 28, 2019 |
# ? Dec 1, 2011 15:01 |
|
Neslepaks posted:I have an algorithm question of sorts. Apply a Fisher-Yates shuffle to your results list.
|
# ? Dec 1, 2011 15:53 |
|
e: f; bNeslepaks posted:I have an algorithm question of sorts. I'm a firm believer that the simple solution is the best... so why don't you just build your list then shuffle?
|
# ? Dec 1, 2011 16:20 |
|
Kim Jong III posted:e: f; b No, see, if I build the list and shuffle it before starting to pick, I'd have to store/persist the shuffled lists and I wanted to avoid that. But yeah, maybe it'll have to be that way.
|
# ? Dec 1, 2011 16:52 |
|
Neslepaks posted:No, see, if I build the list and shuffle it before starting to pick, I'd have to store/persist the shuffled lists and I wanted to avoid that. But yeah, maybe it'll have to be that way. Huhwhat? You've got a dictionary with n entries. You want all permutations of those n entries (unless you don't care about order, in which case you want all combinations). In your original post you claim to have the deterministic process to generate the output, but you just want to have it unordered. So build your output, and then shuffle the output. Am I misreading your original post -- do you or do you not have the process to go from {'hello', 'there', 'world'} to {'hello', 'hellothere', 'hellothereworld', 'there', ...}?
|
# ? Dec 1, 2011 17:06 |
|
Building the list and then shuffling it is trivial, but if the dictionary has more than a dozen words then that list is going to be gigantic.
|
# ? Dec 1, 2011 17:47 |
|
Kim Jong III posted:Huhwhat?
|
# ? Dec 1, 2011 17:49 |
|
Neslepaks posted:No, see, if I build the list and shuffle it before starting to pick, I'd have to store/persist the shuffled lists and I wanted to avoid that. But yeah, maybe it'll have to be that way.
|
# ? Dec 1, 2011 17:51 |
|
qntm posted:Building the list and then shuffling it is trivial, but if the dictionary has more than a dozen words then that list is going to be gigantic. With a dictionary of length n, it will have n! entries. If we assume that each permutation takes up just 1 byte: 10 dictionary entries: 3 megabytes 11 dictionary entries: 39 megabytes 13 dictionary entries: 6 gigabytes Unfortunately if you actually need all permutations, you aren't going to escape this. One idea -- if you have a very large dictionary and need to run some process on a large number of permutations, you could always generate each permutation on the fly by first shuffling the dictionary and flipping a coin for each entry, taking only heads for the permutation. If your dictionary was big enough, you probably wouldn't even need to worry about checking for repetition because the number of permutations would be obscenely large. All this leads me to Orzo posted:It really isn't that complicated, the dude doesn't want to use obscene amounts of memory in his algorithm. Permutations are O(n!), are you really suggesting that he stores an entire N! sized list in memory? If Neslepaks needs an permutation of a dictionary, which is exactly what was asked for in the original post, what the hell else can be done other than generate a permutation of a dictionary? Neslepaks: what are you trying to accomplish?
|
# ? Dec 1, 2011 18:11 |
|
Yeah I guess you're right, if he's using the results as keys to a dictionary he'll need that much memory anyway. Build and shuffle does seem the simplest here.
|
# ? Dec 1, 2011 18:16 |
|
TasteMyHouse posted:yeah, I could parse the ascii in a snap. that's not what's been assigned to me though. I've been assigned specifically to read the binary format, for performance reasons apparently. So how many weeks of your time are you planning on burning before even checking the performance of regexes over the ASCII? Neslepaks, I was working on something similar recently for a card game. I had (28 choose 7) = 1,184,040 possible hands and wanted to analyze them. I wanted a way to easily associate a particular hand with a simple integer. So I spent a little time and wrote a brute-force algorithm that would step through every possibility. I spent a few days thinking trying to figure out complicated ways to slice up the million possibilities so that I could make going from a number to a hand really really fast. The best idea I had was something like a jump table: if you just check index 0 you can slice the million up into chunk of at most 296,000, then checking the other indexes for alignment (i.e. entry 1 is the next card after entry 0) slices it up even further. If you're dealing with a huge number of entries that might help. Then I went and actually checked performance. Turns out the brute force takes under 1/5th of a second if it's just stepping through the indexes, not printing out hands, etc.. So the 'quick' way of doing it is "run the brute force n times then stop". And all that thinking was just wasted time.
|
# ? Dec 1, 2011 19:24 |
|
Actually the combinations will be persisted in a key-value store or something like that. My idea was to be able to restart the application and have it pick up where it left off, without it having to store any state. It's no problem to achieve this as long as I accept that the picks come out in a linear fashion, but I was hoping there was some clever trick to introduce the illusion of randomness to this scheme. Thanks for all the replies so far.
|
# ? Dec 1, 2011 19:32 |
|
JawnV6 posted:So how many weeks of your time are you planning on burning before even checking the performance of regexes over the ASCII? 2. The 'performance' issues were not with parsing the files, but with hspice itself generating them. I was dubious myself, but the engineer who assigned this to me told me that hspice runs noticeably slower when outputting results as ASCII, and also there are some binary results files that he doesn't want to have to regenerate as ASCII for convenience reasons. But anyway I've already convinced him that reverse engineering the binary format is a waste of time, and synopsys has refused to give us the spec, so I'm working on the ASCII format right now :P
|
# ? Dec 1, 2011 19:46 |
|
Neslepaks posted:Actually the combinations will be persisted in a key-value store or something like that. My idea was to be able to restart the application and have it pick up where it left off, without it having to store any state. It's no problem to achieve this as long as I accept that the picks come out in a linear fashion, but I was hoping there was some clever trick to introduce the illusion of randomness to this scheme. I do not understand why you don't like the natural ordering of the data.
|
# ? Dec 1, 2011 19:47 |
|
For a set of n strings, a•x+b (mod n) for any a relatively prime to n forms a permutation for values of x on the interval [0,n). This will reduce clustering and you just need to remember a, x and b for that permutation. True randomness with an even probability distribution is tougher since it requires storing the whole permutation or at least its indexes.
|
# ? Dec 1, 2011 20:13 |
|
GregNorc posted:So I''m trying to use subset() in R to remove inelligible participants from some study data. subset() returns all columns by default, you don't need to specify it with select: code:
EDIT: Not sure how I missed the earlier post. defmacro fucked around with this message at 20:27 on Dec 1, 2011 |
# ? Dec 1, 2011 20:23 |
|
Neslepaks posted:Actually the combinations will be persisted in a key-value store or something like that. My idea was to be able to restart the application and have it pick up where it left off, without it having to store any state. It's no problem to achieve this as long as I accept that the picks come out in a linear fashion, but I was hoping there was some clever trick to introduce the illusion of randomness to this scheme. Seriously -- what is the purpose of this code? I'm really quite curious now, but beyond just curiosity, if you give a little more information about what you are looking to accomplish there might be a different avenue that we can suggest that isn't "store a metric ton of data".
|
# ? Dec 1, 2011 20:50 |
|
Kim Jong III posted:Seriously -- what is the purpose of this code? I'm really quite curious now, but beyond just curiosity, if you give a little more information about what you are looking to accomplish there might be a different avenue that we can suggest that isn't "store a metric ton of data". Yeah, this strikes me as a "put down the chocolate-covered banana and step away from the European currency systems"-type situation.
|
# ? Dec 2, 2011 01:01 |
|
Neslepaks posted:Actually the combinations will be persisted in a key-value store or something like that. My idea was to be able to restart the application and have it pick up where it left off, without it having to store any state. It's no problem to achieve this as long as I accept that the picks come out in a linear fashion, but I was hoping there was some clever trick to introduce the illusion of randomness to this scheme. What about building a balanced-as-possible binary tree where each node contains the information (leftChild, rightChild, string), such that leaf nodes could be identified by checking for string!=null and branch nodes would have string==null. When that's done, you'd pass your search algorithm an integer value and use each successive bit in that integer to determine which child branch to search down, stopping when you hit a node with string!=null. So say if we start at the root, you'd look at bit0 of the integer and go left if it was 0, or right if it was 1. At the next level of the tree, look at bit1 and do the same thing. Keep going until you hit a node where string!=null and then return that string. By itself that would produce lots of strings that would repeat in a way you don't want, so also introduce a hardcoded seed value (with special attention paid to the low-order bits) that you would XOR with the passed in integer, then use the result of that operation to traverse the tree as described above. Deterministic but still pseudo-random. To get all your two-string entries you'd concatenate the results of searching with input 0 and 1, 1 and 2, etc. Same for the 3+ string entries. When your program is stopped and re-started, look at your key-value store and use the number of entries to determine where to pick up in the search. I think this should work for trees with 2^n string entries, but you might get some repeated values otherwise. Does that bother you or can you live with checking if an entry is in your key-value store and just continuing on if it already exists? I'm also curious what the heck you're doing - it seems odd to be fine with storing gigabytes of key-value store data while also being unwilling to store a handful of bytes indicating where you are in your search. PDP-1 fucked around with this message at 05:53 on Dec 2, 2011 |
# ? Dec 2, 2011 05:30 |
|
What is "Binary Hexadecimal" format? My google-fu has failed me. The entire context quote:the value must be encoded in binary hexadecimal format as received... i.e. the data must not be modified in any way. Right now we're just assuming it literally, that it's encoded hex, but I can't help but think it's like BCD or something and you have to do some weird transformations to it.
|
# ? Dec 2, 2011 23:18 |
|
|
# ? May 15, 2024 06:36 |
Mr. Crow posted:What is "Binary Hexadecimal" format? My google-fu has failed me. The entire context It might be that someone is thoroughly confused about how computers work and they just meant to write that the data must be written as binary. (Although it would be a good idea to specify endianness too.) "It appears as hexadecimal when I inspect it with my hex editor."
|
|
# ? Dec 3, 2011 04:03 |