Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
functional
Feb 12, 2008

shrughes posted:

your bold lettering.

It helps new questions stand out from ongoing discussions. It's common practice in other threads, where it doesn't draw any attention. Typically it's followed by a more in depth problem description, but here the question was so straightforward it didn't seem to need elaboration.

Adbot
ADBOT LOVES YOU

Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog
I read almost every thread in this forum and the only time I see a lot of bolding is in Victor's posts.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

functional posted:

It helps new questions stand out from ongoing discussions. It's common practice in other threads, where it doesn't draw any attention. Typically it's followed by a more in depth problem description, but here the question was so straightforward it didn't seem to need elaboration.

Well I hate it, and by extension, you.

Has anyone in here done programming with a ZigBee stack? I'm looking at a few and can't really bring myself to care about any of the various special features (I have an extremely simple application) but if anyone has any opinions about which are particularly easy or painful to work with, that would be useful.

Lamont Cranston
Sep 1, 2006

how do i shot foam

functional posted:

What's the best GUI-based Subversion application for Mac?

Either Versions or Cornerstone. I prefer Cornerstone but they've both got demos so try them out.

cr0y
Mar 24, 2005



not coding per-se, but can anyone recommend a site/script that can crawl a url or a list of urls and check for spelling mistakes?

Moon Whaler
Jul 1, 2007



Edit: I guess I should post this in the Java thread. Never mind.

Moon Whaler fucked around with this message at 05:59 on Mar 5, 2009

NickNails
May 30, 2004

Not sure if this is the best place for this, but I'll give it a whirl.

I'm looking for a simple batch find and replace program. I have some content on a website where I change a couple of things every week in a couple dozen pages. I'd like to have a simple way to do it, rather than open each one individually. What is typically recommended?

TagUrIt
Jan 24, 2007
Freaking Awesome

NickNails posted:

Not sure if this is the best place for this, but I'll give it a whirl.

I'm looking for a simple batch find and replace program. I have some content on a website where I change a couple of things every week in a couple dozen pages. I'd like to have a simple way to do it, rather than open each one individually. What is typically recommended?

If you're running *nix (or can use Cygwin on windows), typical choices are sed, awk, and perl. That is, assuming that you can write a regular expression that matches precisely the data that needs to change and nothing else.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
You don't need cygwin to run those programs on Windows.

TagUrIt
Jan 24, 2007
Freaking Awesome

Mustach posted:

You don't need cygwin to run those programs on Windows.

Apparently so. (I knew about perl, but didn't know there were sed and awk versions for windows.)

dorkasaurus_rex
Jun 10, 2005

gawrsh do you think any women will be there

Is there anyone out there who can help me with some trouble I've been having in Processing? I have a class in it for school and it's very frustrating not being able to find good documentation/knowledgeable people to seek help from.

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


I have no idea if this is a C++ question or more a CPU information-type question, or even if the question makes any sense.

Is there any way to "guarantee" that floating point numbers generated by my program are accurate up to a specific number of digits, or a specific number of digits after the decimal, or any other form of guarantee? This thing is going to be running on a couple different CPUs, and it came up that we're losing precision in some of our outputs somewhere.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Ledneh posted:

Is there any way to "guarantee" that floating point numbers generated by my program are accurate up to a specific number of digits, or a specific number of digits after the decimal, or any other form of guarantee? This thing is going to be running on a couple different CPUs, and it came up that we're losing precision in some of our outputs somewhere.

This is basically the entire field of numerical algorithms. Short answer: no, you will need to actually design your program around maintaining precision.

EDIT: Depending on your problem domain, you may be able to switch to a fixed-point representation without substantially reworking your program; there likely isn't one built in to your compiler, though, so you would need to roll your own. They are not terribly difficult, however.

EDIT 2: And by "roll your own" I mean "investigate what libraries might already exist for the problem before writing out new code, of course".

rjmccall fucked around with this message at 21:22 on Mar 5, 2009

Standish
May 21, 2001

rjmccall posted:

EDIT 2: And by "roll your own" I mean "investigate what libraries might already exist for the problem before writing out new code, of course".
Yeah I would look into something like http://gmplib.org/

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Sadly, said problem domain specifies that I'm stuck with using floating points in this case. (We ALSO have and use fixed points and BCDs and all sorts of other crap. It's kind of maddening. But I digress.)

Oh well, at least I can abandon that part of my testing for now and work out what I'm gonna do later. Maybe round off after the sixth decimal or something, ugh. Thanks :(

cowboy beepboop
Feb 24, 2001

How do I get started with Win32? Is the huge and intimidating Windows SDK the best option?

Is moving from the lovely world of WPF to Win32 going to hurt a lot?

POKEMAN SAM
Jul 8, 2004

my stepdads beer posted:

Is moving from the lovely world of WPF to Win32 going to hurt a lot?

Understatement of the year.

ExplodeYourself
Jan 19, 2006
Can someone recommend a good smalltalk editor?

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
You should try Smalltalk.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Lord Uffenham posted:

You should try Smalltalk.

Surprisingly this applies to a lot of different problems sh/sc-ers have.

TSDK
Nov 24, 2003

I got a wooden uploading this one
I'm in need of a good book recommendation for C#. I know C++ pretty well, and have some working knowledge of Java, so I don't need a lot of hand-holding from the book.

I've got both "The C# Programming Language" by Hejlsberg et al, and "C#2008 for Programmers" by Deitel and Deitel, and neither of them are all that good for learning the language. The Hejlsberg book is more like a reference for the standard and the Deitel & Deitel book is long winded and, quite frankly, a bit poo poo. It's not really 'for programmers' in any way shape or form since, for example, it takes over 180 pages before telling you how to declare an array. I checked versus K&R, and in that length of time they'd covered the entire language and were giving you an example of how to implement the unix file system in C.

Not content with trying to teach you programming from scratch they also keep interjecting silly little bits of trivia into the main flow of the text, which really disrupts your reading. And don't get me started on the appropriateness of trying to teach software-design-by-UML in a book that's not supposed to be about either UML or software design.

Can anyone recommend a decent book on C#, which has a similar sort of brevity and clarity as K&R?

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
People here like to recommend the O'Reilly "Programming C#" book, but I'm not a fan of the author's writing style, especially if you're looking for something approaching Kernighan's style.

Are you looking for a book that covers only the core language, or some .NET and Windows, Winforms, WPF, etc. as well?

TSDK
Nov 24, 2003

I got a wooden uploading this one

Mustach posted:

People here like to recommend the O'Reilly "Programming C#" book, but I'm not a fan of the author's writing style, especially if you're looking for something approaching Kernighan's style.

Are you looking for a book that covers only the core language, or some .NET and Windows, Winforms, WPF, etc. as well?
Perferably something that focuses on the core language, but with some coverage of things like standard containers and widely used interfaces. The Deitel2 book covers Winforms, WPF etc... and there's always the MSDN for reference on those anyway.

wrok
Mar 24, 2006

by angerbotSD
So I'm trying to find the period of repetition within a given array. I.e.

code:
a = [3, 1, 1, 1, 1, 6, 1, 1, 1, 1, 6, 1, 1, 1, 1, 6]

period = 5 (1, 1, 1, 1, 6)
I figured it might be fun to do with regular expressions, and therein lies the problem. I can sort of match what I want, but not quite:

code:
a = "[3,3,2,1,3,2,1,3,2,1]"
myregex = r"""\[\d{1,},?\s?((\d{1,},?\s?)+)\1+"""
mymatch = "3,2,1,"
In this case, it works, the first group matches "3,2,1,". However, if you add another repetition to the string, it matches two repetitions:

code:
a = "[3,3,2,1,3,2,1,3,2,1,3,2,1,]"
myregex = r"""\[\d{1,},?\s?((\d{1,},?\s?)+)\1+"""
mymatch = "3,2,1,3,2,1,"
This will not do. I can change my regex to work for a longer form by hand-forcing the number of matches to max out, but this sucks and does not work in a generic case.

code:
a = "[3,3,2,1,3,2,1,3,2,1,3,2,1,]"
myregex = r"""\[\d{1,},?\s?((\d{1,},?\s?)+)\1{3,}"""
mymatch = "3,2,1,"
Any regex ninjas around?

(Ignore the trailing comma workarounds and comma/space matching problems above, I'm only worried about the repetition matching.)

raminasi
Jan 25, 2005

a last drink with no ice
unless I'm wildly mistaken you can't actually do that with a finite-state machine

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender
I used ^((?:[^,]+,)*?)((?:[^,]+,)+?)\2+$ to match strings of the form a,b,c,d,e, and find the shortest prefix before repetition, and the shortest repetition pattern with that prefix.

First, anchor to the beginning of the string. Then, capture a minimal prefix, comprised of zero or more elements (where an element is one or more noncommas followed by a comma). Next capture a minimal repetition, which is again comprised of zero or more elements. Finally, repeat exactly the second capture until we complete the string.

Edit:

GrumpyDoctor posted:

unless I'm wildly mistaken you can't actually do that with a finite-state machine

Backreferences mean that the "regular expression" is no longer a finite-state machine.

ShoulderDaemon fucked around with this message at 20:37 on Mar 11, 2009

wrok
Mar 24, 2006

by angerbotSD

ShoulderDaemon posted:

I used ^((?:[^,]+,)*?)((?:[^,]+,)+?)\2+$ to match strings of the form a,b,c,d,e, and find the shortest prefix before repetition, and the shortest repetition pattern with that prefix.

First, anchor to the beginning of the string. Then, capture a minimal prefix, comprised of zero or more elements (where an element is one or more noncommas followed by a comma). Next capture a minimal repetition, which is again comprised of zero or more elements. Finally, repeat exactly the second capture until we complete the string.

Sweet, with a few modifications to allow for trailing terms not part of the repetition it worked great! Thanks :)

Pweller
Jan 25, 2006

Whatever whateva.
I have a small app that runs in a command prompt. I want to automate the running of this executable using a batch file, but the program prompts for user input twice. Is there any way I can pass the values for the two prompts from the batch file to the executable it calls? Two inputs are always the same.

example:
batch file
code:
backup.exe
backup.exe output in command prompt
code:
running backup....
How many lines?['8' & press enter]
Start backup (Y/N)?['Y' & press enter]
Backing up...
Backup complete.

Pweller fucked around with this message at 21:16 on Mar 11, 2009

raminasi
Jan 25, 2005

a last drink with no ice

ShoulderDaemon posted:

Backreferences mean that the "regular expression" is no longer a finite-state machine.

I figured something like that was the case. The more you know, I guess.

Scaevolus
Apr 16, 2007

Pweller posted:

I have a small app that runs in a command prompt. I want to automate the running of this executable using a batch file, but the program prompts for user input twice. Is there any way I can pass the values for the two prompts from the batch file to the executable it calls? Two inputs are always the same.

backup.txt:
code:
8
Y
backup.bat:
code:
backup.exe < backup.txt

Jo
Jan 24, 2005

:allears:
Soiled Meat
I have a lot of webspace with shell access, but no administrator access. Is there a SVN variation or other versioning system that will run as a set of php/cgi scripts and store changes in a MySQL database?

Brigs
Jan 6, 2003
I've been wondering if my choice of Stackless Python is correct for my program. The program requires high-performance concurrent processing for multiple complex physical interactions, able to be displayed across all computers which are both running the program and connected to the server array.

This project will be ongoing for many, many years, so working with a powerful, active, and maintained language is very important. I've read that PyPy now has most of the features of Stackless Python, and I've heard sparse good things about a few other languages handling of concurrency. I'd be grateful for advice and recommendations about languages with concurrency in practice, especially any ideas about my choice of Stackless against the range of other options.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
How high are your high-performance requirements?

Brigs
Jan 6, 2003
The program should be able to make use of powerful server cluster(s), as well as thousands or more computers running as clients. The server clusters are where most of the complex work is done, with concurrency between the servers being the first priority. The client will draw the virtual scene that is concurrently generated by the servers, and is able to send keyboard and mouse input. Tasks which are not time/data-sensitive may be handled by sharing workload with clients.

Coding in several languages to achieve optimal performance vs ease is likely. The program should be built to scale well, even as calculations get increasingly more complex, and concurrency becomes more tricky. The requirements are that the scene, no matter how complex, is able to be atomically calculated and drawn to the client with no noticeable lag time between updates to scene elements. Considering how many concurrent scenes there can potentially be (millions), I believe the performance requirement is the primary concern.

tommyjohn
May 28, 2004

I have a stupid question regarding socket programming. Being a web developer, I can hold my own in PHP and Javascript, so this seems like a simple enough task - however, I can't figure it out.

Company X's software is listening to port 9036 on each streaming server for individual strings that are being written each time an event is fired (we're a cluster of radio stations, so those events are really songs and spots being played - we're trying to avoid having to use Company Y's software that accomplishes what I'm asking about here. Long story)

What is the simplest way of doing this? We've got an Automation software that can run BASIC scripts and run standalone programs - so, with my basic knowledge of programming, I've tried writing BASIC and command line programs trying to accomplish this, all with poor results.

To me, it sounds very simple - open connection to the port, write the string, and close the connection. Anyone got any ideas? Primers on socket programming? Telnet lessons? Etc.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
By Automation you mean the Microsoft product? I don't know the VB socket bindings well enough to help you there, but that should certainly be sufficient. I do agree that this should be very simple. You'll need to know a few more details than you've listed, but I assume you know that things like whether it's TCP or UDP, the exact message format the server requires, etc.

You should probably sniff your own packets a few times after you've got it working, just to make sure that you're not doing something silly like sending a 1K message in twenty separate packets; that's also helpful as a network debugging tool. Ethereal is very nice for this.

tommyjohn
May 28, 2004

rjmccall posted:

By Automation you mean the Microsoft product? I don't know the VB socket bindings well enough to help you there, but that should certainly be sufficient. I do agree that this should be very simple. You'll need to know a few more details than you've listed, but I assume you know that things like whether it's TCP or UDP, the exact message format the server requires, etc.

You should probably sniff your own packets a few times after you've got it working, just to make sure that you're not doing something silly like sending a 1K message in twenty separate packets; that's also helpful as a network debugging tool. Ethereal is very nice for this.

No, by Automation I mean Automate 5.5, from a company called Network Automation.

I'm permitted to embed pretty simple BASIC code right into each task, but again it comes down to how little I know about VB. I've tried putting together a script maybe four or five entirely different ways, but each time I do it it feels like I'm writing 30 lines of stuff I'm not sure will work to do what I feel ought to be possible with 3 lines.

Of course, this is just a gut feeling. If anyone's got a working example, in VB or otherwise, that would be great just for me to look at.

ohgodwhat
Aug 6, 2005

This is probably pretty retarded, but it's been a long week, so take it easy on me. :v:

I'm using Detours to hook a function in an application, with the prototype:
code:
int (__cdecl *hooked_function)(void *a, void *buf, int num);
When the hooked function is called, it fills *buf with data from the library's internal buffer, up to the amount num.

Here's what I have right now, just saving the information to a file:
code:
file <<  num << " " << result << " " << (char*)buf << std::endl;
which generates rather useless results, like:
code:
1382 1382 ^{ߎo!p <--- much shorter than 1382 bytes, or
2 2 Hy~?FM{/{ިV-ҢѮ/PG( oϩl.... <---- much longer than 2 bytes.
So I'm pretty sure I've screwed up somehow, but my experience is not so much with C++, and all of this is pushing the boundaries of my knowledge. Any ideas how to get useful data out of this?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
You are converting a stream of binary data into a (null-terminated) string. Think about what happens if you find a 0-byte in your data.

Adbot
ADBOT LOVES YOU

ohgodwhat
Aug 6, 2005

I had thought of that, and, well, yeah, that's pretty obvious. Is the rest of this easy enough that it'll come to me when I wake up tomorrow morning? :v:

The real problem I'm having is with encoding, I think. I'm kind of reverse engineering this, and so I have an idea of what data this should be getting, but I'm seeing nothing like it. There should be names and such when it's all just gibberish. It's possible that it's obfuscated somehow and I'll have to dig deeper, but that seems unlikely to me.

I'll look at this tomorrow, hopefully with a clearer head. Thank you though.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply