|
Dijkstracula posted: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. Not to mention that you can only store half as many bits in a byte-- 2*3*5*7 = 210 < 256, but 1+2+4+8+16+32+64+128 = 255 < 256. It gets worse the more primes you add.
|
# ? Aug 1, 2009 19:54 |
|
|
# ? May 14, 2024 15:21 |
|
quadreb posted:If you make the prime numbers large enough, you could have a new crypto algorithm to play with. A good hint: Look at euler's totient function I propose calling it a bozo enum
|
# ? Aug 1, 2009 20:32 |
|
Dijkstracula posted: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. 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... The method I remember reading about may have used addition, because I remember it being used with like 40 different booleans. nbv4 fucked around with this message at 21:07 on Aug 1, 2009 |
# ? Aug 1, 2009 21:04 |
|
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... Do you know what a bit field is?
|
# ? Aug 1, 2009 21:10 |
|
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 |
|
Someone was reading the coding horrors thread as a programming guide! http://forums.somethingawful.com/showthread.php?threadid=2803713&userid=0&perpage=40&pagenumber=10
|
# ? Aug 1, 2009 21:28 |
|
I thought that sounded really familiar. For what it's worth, it sounds as stupid the second time.
|
# ? Aug 2, 2009 07:36 |
|
How do I push some text to the bottom of a page in LaTeX? Some dynamic vertical filler box or something?
|
# ? Aug 2, 2009 14:25 |
|
Can anyone point me to a good resource that explains the differences between different video formats (specifically vob/mpeg-2 and divx/xvid)? I want to create a program that will merge many different video files together, but I don't know where to start.
|
# ? Aug 2, 2009 22:38 |
|
Look into ffmpeg - you'll definitely end up using it.
|
# ? Aug 3, 2009 02:09 |
|
Thanks for the help, but since it is under the gpl, I won't use it. I am looking for information about the formats or maybe video conversion techniques. I can't seem to find much information on the topic.
|
# ? Aug 3, 2009 02:25 |
|
mykuhl posted:Thanks for the help, but since it is under the gpl, I won't use it. I am looking for information about the formats or maybe video conversion techniques. I can't seem to find much information on the topic. LGPL (unless you're using libpostproc or libswscale).
|
# ? Aug 3, 2009 02:29 |
|
Oh ok I see now. Still some literature on the subject would be nice.
|
# ? Aug 3, 2009 02:36 |
|
Spug posted:How do I push some text to the bottom of a page in LaTeX? Some dynamic vertical filler box or something? I have a terrible solution that may work for you! Beware that floats may migrate! code:
|
# ? Aug 3, 2009 06:24 |
|
Anyone? HiredGoon posted:Hey guys,
|
# ? Aug 3, 2009 07:46 |
|
HiredGoon posted:Anyone? Well the first thing is: that's not CSS, so I can't fathom why you are putting it into a custom CSS field.
|
# ? Aug 3, 2009 07:48 |
|
litghost posted:I have a terrible solution that may work for you! Beware that floats may migrate!
|
# ? Aug 3, 2009 17:12 |
|
Avenging Dentist posted:Well the first thing is: that's not CSS, so I can't fathom why you are putting it into a custom CSS field. Ah. Well, what I have found is: <style> <MainOrArchivePage> span.fullpost {display:none;} </MainOrArchivePage> <ItemPage> span.fullpost {display:inline;} </ItemPage> </style> <MainOrArchivePage><br /> <a href="<$BlogItemPermalinkURL$>">...</a> </MainOrArchivePage> Now, I've posted that into the site's code, and it works all fine in inserting the "..." at the end of the post and linking to the individual post. Now, I should be able to use the: <span class="fullpost"> </span> Command to truncate my posts at will, but I can't seem to get that part of it to work. Any suggestions?
|
# ? Aug 4, 2009 02:13 |
|
BigRedDot posted:Wouldn't \vspace suffice for this? What would the input to vspace be? How do you know how much space to add to get the bottom of the page? It is a function of the text on the page and how much text you want to add to the bottom of the page. So no, vspace would not suffice.
|
# ? Aug 4, 2009 03:19 |
|
litghost posted:What would the input to vspace be? How do you know how much space to add to get the bottom of the page? quote:It is a function of the text on the page and how much text you want to add to the bottom of the page. So no, vspace would not suffice.
|
# ? Aug 4, 2009 05:42 |
|
BigRedDot posted:Trial and error? It's really not that difficult... code:
|
# ? Aug 4, 2009 06:43 |
|
ShoulderDaemon posted:
Haha, I tried that but it didn't work, because I was trying it on a blank page. I didn't think or know of of an explicit space (\ ) until I started messing with the float stuff. Ex: code:
code:
litghost fucked around with this message at 07:09 on Aug 4, 2009 |
# ? Aug 4, 2009 07:04 |
|
ShoulderDaemon posted:TeX is not as dumb as you make it out to be.
|
# ? Aug 4, 2009 19:01 |
|
What's a good way to sort RGB values into a pleasing list?
|
# ? Aug 5, 2009 13:47 |
|
tef posted:What's a good way to sort RGB values into a pleasing list?
|
# ? Aug 5, 2009 17:07 |
|
fankey posted:I'd convert to another color space like HSV and then sort on H. Although since most ( every? ) color space has 3 dimensions sorting in a linear list can be hard. But if all your values have similar S and V then sorting on H will probably work. HSV does give a much more pleasing result than RGB. I'm tempted by this approach though: http://portal.acm.org/citation.cfm?doid=76359.76361
|
# ? Aug 5, 2009 18:01 |
|
How can I sed or AWK a file so that it replaces every 100th instance of a comma with comma{newline}?
|
# ? Aug 5, 2009 23:18 |
|
Xae posted:How can I sed or AWK a file so that it replaces every 100th instance of a comma with comma{newline}? Though I can't fathom why you'd voluntarily use sed/awk instead of perl, code:
|
# ? Aug 5, 2009 23:33 |
|
Perl is the mindkiller. Perl is the silent death.
|
# ? Aug 6, 2009 01:10 |
|
Avenging Dentist posted:Though I can't fathom why you'd voluntarily use sed/awk instead of perl, I'm running this through Cygwin. I don't know if it even support perl.
|
# ? Aug 6, 2009 02:34 |
|
Xae posted:I'm running this through Cygwin. I don't know if it even support perl. According to their website, Perl is a standard package in Cygwin.
|
# ? Aug 6, 2009 02:40 |
|
I've got a question about regular expressions. I've got a web app written in C# Asp. There's a textbox users may provide a some input, most likely to be a file location, either on a file share, the Internet, or on disk. This input is later exported to Excell, in code I do not have access to. These locations are inserted as hyperlinks in the excell document. Excell takes it upon itself to validate these links. Most anything is fine, for example "Pizza", "Foo Bar", and "In my filing cabinent" all are fine. However, enter something like "\\my.com pany" (notice the space), when you go to open the file later, you get a greatly descriptive message from Excel saying, and I quote, "Error" To head this off at the pass, Ive put a regular expression validator on the input textbox. Writing the part saying no spaces is simple enough ^(\\\\)[^ ]*((\/).*)*$ how do I say if it doesn't start with \\ or [url]http://[/url] I don't care what is in the textbox? (Spaces after the first / are apparently cool with Excell)
|
# ? Aug 6, 2009 13:35 |
|
Ulta posted:I've got a question about regular expressions. code:
|
# ? Aug 7, 2009 16:36 |
|
So this one is freaking me out. I have this line of code for checking a registry entry: code:
On Windows 7 RC1 and RTM however, for some reason it returns a non-zero result, even though the registry entry is there. At first I figured something has changed in the library between Windows 7 Beta and Windows 7 RC1, but I can't find anything. And now the really freaky bit. Simply putting these two lines above fixes the problem: code:
This is only in Windows 7 RC1 and beyond. So, anybody have any clue what is going on here?
|
# ? Aug 10, 2009 13:23 |
|
EscapeHere posted:So, anybody have any clue what is going on here? You are invoking undefined behaviour in a way that is not immediately obvious from the lines of code you posted.
|
# ? Aug 10, 2009 17:38 |
|
Vanadium posted:You are invoking undefined behaviour in a way that is not immediately obvious from the lines of code you posted. I would guess that's he's blowing out of the stack somewhere, and adding another stack variable is saving his rear end.
|
# ? Aug 10, 2009 17:56 |
|
Avenging Dentist posted:I would guess that's he's blowing out of the stack somewhere, and adding another stack variable is saving his rear end. I don't know why, but your statement sounds really gay.
|
# ? Aug 10, 2009 21:53 |
|
Probably because he's gay.
|
# ? Aug 11, 2009 04:22 |
|
Avenging Dentist posted:I would guess that's he's blowing out of the stack somewhere, and adding another stack variable is saving his rear end. Thanks. Any ideas on how I might go about debugging this given it works fine with Debug, but not Release?
|
# ? Aug 11, 2009 08:10 |
|
|
# ? May 14, 2024 15:21 |
|
EscapeHere posted:Thanks. Any ideas on how I might go about debugging this given it works fine with Debug, but not Release? Check all your array boundaries to make sure you are not referencing outside of arrays (most likely cause). Debug mode gives different machine code so the stack does not look the same and you're not breaking it then. Also, what is the meaning of the non zero return code, it might actually mean something.
|
# ? Aug 12, 2009 10:38 |