|
Argh. I'm wanting to write a bit of code to keep track of statistics about my memory pool. I want to set up this UpdateMemoryStats function as a global so I can call it anywhere (or in the main loop) and I only want one set of stats, so I figure I should make the stats static. Unfortunately I keep getting a drat unresolved external symbol error. I'm obviously missing something... I've gone over this a bunch and I think I just need someone else to look at this or something. Or if there's a better way to do this just suggest that. code:
|
# ? Jun 20, 2008 18:51 |
|
|
# ? May 16, 2024 19:14 |
|
Femtosecond posted:Argh. I'm wanting to write a bit of code to keep track of statistics about my memory pool. I want to set up this UpdateMemoryStats function as a global so I can call it anywhere (or in the main loop) and I only want one set of stats, so I figure I should make the stats static. Unfortunately I keep getting a drat unresolved external symbol error. I'm obviously missing something... I've gone over this a bunch and I think I just need someone else to look at this or something. Somewhere (and only one place) you need to put code:
|
# ? Jun 20, 2008 18:57 |
|
edit: I meant to post this in the Java thread...
|
# ? Jun 21, 2008 05:50 |
|
I am hiring programmers to write code for my online ticketing merchant's website. They will be building everything from scratch. What is the best web scripting language/framework to have my website developed using? php, .net, cf, ruby? What will be the easiest for a new programmer to interpret and add functionality to? My main concern is that I don't want the site developed on a dead platform that mainstream programmers do not use.
|
# ? Jun 23, 2008 05:57 |
|
There isn't really a posterchild for "mainstream programmer". You'll find good/bad/excellent/retarded programmers of all types. Although, I haven't heard the term ColdFusion in a while, so maybe you'll want to stay away from that.
|
# ? Jun 23, 2008 06:01 |
|
Jam2 posted:What is the best web scripting language/framework to have my website developed using? php, .net, cf, ruby? You can make a good website in any language, though PHP practically encourages insecure code, and ColdFusion has fallen out of style. Other languages to consider would be Perl and Python. Jam2 posted:What will be the easiest for a new programmer to interpret and add functionality to? Probably PHP, but chances are that the code will have security vulnerabilities. Most programmers should be able to adapt to any OO language, and if they can't, chances are the stuff they'd have written would have been trash anyway.
|
# ? Jun 23, 2008 06:21 |
|
Triple Tech posted:There isn't really a posterchild for "mainstream programmer". You'll find good/bad/excellent/retarded programmers of all types. Although, I haven't heard the term ColdFusion in a while, so maybe you'll want to stay away from that. Yay for me. I recently had my flagship website coded in ColdFusion. Only after paying big money and receiving the finished product did I find out. Hooray for getting additional development done on my snazzy new site. Also spent $1.5K for a CF based CMS. Jam2 fucked around with this message at 06:23 on Jun 23, 2008 |
# ? Jun 23, 2008 06:21 |
|
I'm not sure this counts as programming as such, but I have a question about how to do something in Excel. If I have a list of dates in cells A1 to A10, how can I find the average time in days/hours between those dates?
|
# ? Jun 23, 2008 09:00 |
|
Mr Crucial posted:I'm not sure this counts as programming as such, but I have a question about how to do something in Excel. In the cell you want the summary type =AVERAGE(A1:A10), then right-click on the cell, choose "Format Cells", choose "Custom" and set it to dd/MM/yyyy hh:mm (or MM/dd/yyyy hh:mm if you are American). Queen of Beans fucked around with this message at 11:12 on Jun 23, 2008 |
# ? Jun 23, 2008 11:08 |
|
hobofood posted:In the cell you want the summary type =AVERAGE(A1:A10), then right-click on the cell, choose "Format Cells", choose "Custom" and set it to dd/MM/yyyy hh:mm (or MM/dd/yyyy hh:mm if you are American). That's not what I'm after, that gives an 'average date' whatever that might be, on my data it spit out a date near the middle of the data set. What I want is the average time between dates in a list - say if the list had the 20th, 24th and 30th of any particular month, the average time between dates is 5 days, if you see what I mean.
|
# ? Jun 23, 2008 16:56 |
|
So set B1, B2 to =A2-A1, =A3-A2 and so on and average through that?
|
# ? Jun 23, 2008 17:39 |
|
If you want a formula that works in one cell, you'll need an array formula:code:
code:
A2-A1 A3-A2 A4-A3 ... A10-A9
|
# ? Jun 23, 2008 19:00 |
|
Aredna posted:If you want a formula that works in one cell, you'll need an array formula: This works, thanks.
|
# ? Jun 24, 2008 09:01 |
|
I didn't see a Regex megathread ( I thought there was one at one point ) so hopefully this is a good place to ask this. I'm looking for a regex expression that will match space delimited tokens. If a token contains a space then the token is quoted. Currently I don't need to worry about quotes in the tokesn themselves. So a string likecode:
code:
|
# ? Jun 25, 2008 18:00 |
|
fankey posted:So a string like code:
code:
Also, how do I stop smilies appearing in code blocks? Zombywuf fucked around with this message at 19:58 on Jun 25, 2008 |
# ? Jun 25, 2008 18:26 |
|
Zombywuf posted:Also, how do I stop smilies appearing in code blocks? Check the "Disable smilies" box in your post
|
# ? Jun 25, 2008 19:01 |
|
Zombywuf posted:
code:
|
# ? Jun 25, 2008 23:07 |
|
fankey posted:([\w.]+|"[^\"]*") . means every character, so '"toot toot"' would match as '"toot', and 'toot"'. You might want something like [^"]\S+|"[^"]+" to be a general case - match either someting that doesn't start with " followed by non whitespace characters, or " followed by anything that isn't a " then a final ".
|
# ? Jun 26, 2008 01:58 |
|
tef posted:. means every character, so '"toot toot"' would match as '"toot', and 'toot"'. If I test my expression with this site it appears to work OK - test 1.2 "toot toot" matches as 'test', '1.2', and '"toot toot"'. If I send test 1.2 "toot toot" to your expression I get 4 matches - 'test', '1.2', '"toot' and 'toot"'. Is there something I'm missing?
|
# ? Jun 26, 2008 03:45 |
|
fankey posted:Is there something I'm missing? No, I'm missing something - . means match everything, but when it is in a character class it just means period, i.e \. is the same as [.]
|
# ? Jun 26, 2008 09:01 |
|
Is there such a thing as a private interface? Or a private abstract method that needs to be implemented by their sub classes? I'm using Perl so technically no problem like this exists, but I'm just double checking, like when I move on to a more OOPish language. I have a process whose start and end is the same, and only one method, Start Process, is exposed via a superclass. Start Proccess consists of methods &Start, &Middle, and &End. Start and end are completely standardized while &Middle is what changes for any given subclass. So... Can &Middle be private? Technically it can't do anything on its own without the context of the entire process, that's why I'm wondering if it can be made private.
|
# ? Jun 26, 2008 20:53 |
|
Triple Tech posted:Is there such a thing as a private interface? Or a private abstract method that needs to be implemented by their sub classes? I'm using Perl so technically no problem like this exists, but I'm just double checking, like when I move on to a more OOPish language.
|
# ? Jun 26, 2008 21:09 |
|
I saw a rails thread, but nothing for Ruby specifically, so I thought I would ask my question here. I'm reading through the O'Reilly Learning Ruby book, and it says "Unlike other languages, a Ruby constant is mutable—that is, you can change its value." It doesn't go any more in-depth at that point, but it leaves me rather confused. If you can change it, then in what way is it a constant?
|
# ? Jun 27, 2008 21:33 |
|
According to the Pragmatic book on Ruby, it looks like constants are simply normal variables which raise a warning when changed. So you get the flexibility of being able to change them when desired (although, yes, I don't quite understand why one would not then use a normal variable...) but the extra rigidity of a warning being emitted when you do so.
|
# ? Jun 27, 2008 21:45 |
|
They have different scoping rules, too.
|
# ? Jun 28, 2008 13:59 |
Regex Request: I'm looking to parse the following file: code:
I've tried distance=\"[0-9]*\.[0-9]*, but that gives me the XML before it, too.
|
|
# ? Jun 30, 2008 03:39 |
|
grep/egrep will return the lines what match that regex you specify, not the regex itself. You'll need to redirect the egrep output to sed/awk(gawk) to extract the data from the line you want.
|
# ? Jun 30, 2008 07:15 |
|
Jo posted:Regex Request: grep -oP '(?<=distance=")[0-9]*\.[0-9]*' works.
|
# ? Jun 30, 2008 09:19 |
|
Jo posted:Regex Request: Do not use regular expressions to parse XML, XML is not a regular language. I have had to maintain code that used regular expressions to parse XML files and if I catch your doing it I will find you... Use xmlgrep, it comes with the XML::Twig perl library.
|
# ? Jun 30, 2008 10:16 |
Zombywuf posted:Do not use regular expressions to parse XML, XML is not a regular language. I have had to maintain code that used regular expressions to parse XML files and if I catch your doing it I will find you... Relax, I not using it in production code. I only need it in the final step to extract from the XML output that single value for use in a spreadsheet. It feels the largest limitation right now is my work machine is Windows based. I'd swap to Debian in a heartbeat, but all our in house stuff was written for Windows. Scaevolus: I will try that tomorrow when I get in. Thank you to everyone who responded.
|
|
# ? Jul 1, 2008 00:05 |
|
I'm trying to use a Visual Studio deployment project for the first time to create a .msi installer for my application. It's pretty simple for the most part, but I'm struggling to figure out how to create an uninstall link for the application. I think I can do it if I can make a shortcut to msiexec.exe, but it seems like I can't do that because apparently you can only create links to files in the installer package. Is there some trick to this that I'm missing? I've googled around a bit, but the only thing I can find is someone asking the question on experts-exchange where the usual google cache trick won't work.
|
# ? Jul 1, 2008 16:53 |
|
Kino posted:I've googled around a bit, but the only thing I can find is someone asking the question on experts-exchange where the usual google cache trick won't work. Does the "scroll down past the interstitial ads until you see the answer" method work on that page?
|
# ? Jul 1, 2008 18:18 |
|
csammis posted:Does the "scroll down past the interstitial ads until you see the answer" method work on that page? Oh bah, for some reason I didn't do that. It didn't end up being that helpful though, as it just tells you to use msiexec to do it and doesn't explain how to actually create the shortcut in VS. I'm starting to wonder if it'd be easier to just make an application that calls msiexec programatically. VV Great, thanks, that did it. Guess my search terms were slightly off. Kino fucked around with this message at 19:00 on Jul 1, 2008 |
# ? Jul 1, 2008 18:40 |
|
Kino posted:I'm trying to use a Visual Studio deployment project for the first time to create a .msi installer for my application. It's pretty simple for the most part, but I'm struggling to figure out how to create an uninstall link for the application. I think I can do it if I can make a shortcut to msiexec.exe, but it seems like I can't do that because apparently you can only create links to files in the installer package. Is there some trick to this that I'm missing? I've googled around a bit, but the only thing I can find is someone asking the question on experts-exchange where the usual google cache trick won't work.
|
# ? Jul 1, 2008 18:49 |
|
I wrote a Bloom Filter class, but I don't quite know what numbers to use for the number of slots and the number of hash functions to call. I really don't know where to begin on either of them, so I have 64 slots and 8 hashes, but I think those numbers might be a little low. Does anyone know any guidelines that might help me? I'm prioritizing a low false-positive rate above performance, if that matters. Edit: 256 slots with 16 hashes seems to be a bit better on the false positive side. POKEMAN SAM fucked around with this message at 02:53 on Jul 2, 2008 |
# ? Jul 2, 2008 02:39 |
|
Ugg boots posted:I wrote a Bloom Filter class, but I don't quite know what numbers to use for the number of slots and the number of hash functions to call. I really don't know where to begin on either of them, so I have 64 slots and 8 hashes, but I think those numbers might be a little low. For anyone who cares, this page really helped me out: http://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html#tab:bf-config-1 Since my hash returns 16 bytes as it is, I'm probably going to just stick with 16 hash values with 256 slots, since each byte can represent 0-255, so the numbers go together pretty well.
|
# ? Jul 2, 2008 05:41 |
|
A bash question: The script takes one hostname, and n DNS servers to query with that hostname. What I already have it doing is querying the DNS servers and putting just the IP address results into unique temporary files in /tmp/. The files are stored in an array in the script, and I'd like to diff all of them to see if any of the results differ, and then output which DNS servers gave different results. Thanks for any help.
|
# ? Jul 2, 2008 18:58 |
|
Why again is emulation for video games slow? Is it because the programmers lack the EXACT documentation for the original architecture? Basically is it a matter of accuracy or is it really processing power? I guess it couldn't be processing power if today's systems are magnitudes more powerful than consoles... Also, just how powerful are the specialized components in consoles that couldn't be emulated away (quickly) in a modern desktop? (graphics, sound, "emotion", etc)
|
# ? Jul 2, 2008 21:20 |
|
checkeredshawn posted:The files are stored in an array in the script, and I'd like to diff all of them to see if any of the results differ, and then output which DNS servers gave different results. Just choose one file as a base file and diff each of the other files against the base one individually. This will tell you if there any overall differences, but I'm not sure what you're actually trying to accomplish here. If you're trying to verify that your DNS records haven't changed, it might be better to actually compare the results against known good output (which would then be your base file). As far as how that would look in bash, I'd use a for loop to iterate over the array (excluding the base file) and run diff -q on each file against the base file. You could build up results in a temporary file/buffer, or just have the program exit when when one of the diffs returns any output.
|
# ? Jul 2, 2008 23:05 |
|
|
# ? May 16, 2024 19:14 |
|
This is not exactly a programming question, but it is related to programming: If you are contracted to build a web application, say a CMS or whatever, how do you feel about building it with a framework, such as CodeIgniter for PHP or Django or whatever, not counting if the client specifically requests it? I've always kind of wondered, do you use CodeIgniter, or since you are selling the application as your own to the client, should you write all of the code by hand? Is using a framework "cheating" when selling an application?
|
# ? Jul 3, 2008 14:30 |