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
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

GregNorc posted:

code:
ul#[i]list-menu[/i] li a {

This is your problem

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
How about

code:
SELECT title 
FROM movies
WHERE NOT REGEXP_LIKE(title,'\s');

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

rjmccall posted:

If you know that a closed polygon is convex, you can divide it into triangles by just picking a point and drawing segments to all the non-adjacent points. Concave polygons will be a major problem; depending on your application, though, you might be able to use negative polygons to some effect. What are you trying to do?

He can just use BSP to transform a concave polygon into a union of convex polygons.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Feral Integral posted:

Hey, was wondering what kind of software you guys use to plan out your programs before writing (if you ever do)? I'm trying to start a little personal project that involves a lot of network crap like keeping track of packets throughout a series of nodes. So I guess I'm looking for some kind of charting software that'll let me abstract the project before I start coding.

Pencil and paper. A plain text editor if I'm feeling ambitious.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ante posted:

Is there any easy method to return the second pair?

cSingleCommand+2

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
I can only conclude that you're doing it wrong.

You're probably not allocating space for the null terminator and one string is clobbering the other.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
http://forums.somethingawful.com/showthread.php?threadid=2953970

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
If you told us what DVR application you're using, I bet there's someone here who knows enough about it to tell you how to set it up to use any naming structure you like. Also, I'm not sure why you edited out half of the examples in your post, it's just going to make it harder for anyone to write a working regex for what you need. There's no need to be embarrassed about the shows you watch; we're all friends here. :)

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
It's "mod"

As in foo := bar mod 2

Also, I want you to go to school and call your teacher a stupid fag because seriously Turing is basically just a crappy version of Pascal.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

citsejam posted:

Rather than outputting 148, it gives me -108. On closer inspection, I seem to be getting incorrect values when an ASCII character's integer value is => 100. Is something wrong with my libraries, or am I retarded/missing something?

Pretty much that. :) You're outputting an unsigned value with a signed flag. Signed chars range from -128 to 127. Use %u

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Well first of all you should be using an unsigned char if you actually care about values >127. Also, printf casts everything up to an int (*) when you call it.


* Lies

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Nearly every language uses Perl Compatible Regular Expressions. There isn't really a whole lot out there that just uses POSIX regexes.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

csammis posted:

I hate your function name, and by extension you and puppies and kids on my drat lawn, because it doesn't parse the URL. It verifies it ~:mad:>

Let us not forget that it will fail on the following:
https://example.com
example.com.[url]http://[/url]
ftp://example.com

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

rjmccall posted:

URI schemes have to match [-+.a-zA-Z0-9]+, and colon is not a valid hostname character ([-.A-Za-z0-9]+, ignoring internationalization), so if you're willing to require absolute URLs, you can just prepend http:// if the URL doesn't match ^[-+.a-zA-Z0-9]+:.

Good job, you just broke URLs for everything with an explicit port.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Just type Ctrl+D for EOF.

(Probably doesn't work on Windows, but 1) I don't want to doublecheck, 2) gently caress Windows anyway)

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Bishop01 posted:

Where could I find decent free 3rd part information on learning how run windows scripts ala running remote executables and running remote install scripts for software

What does this even mean???

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Why not just make an SVN hook to FTP it wherever it needs to go?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Clock Explosion posted:

Both of those were the result of being sleep-deprived while programming. Thanks for catching them.

Still same problem though. :(

You might want to put in some newlines after your output. Also you have the logic for "y/n" screwed up.

I made a test function for FpMult and everything works fine. So I'm going to go out on a limb and guess that you're treating the strings as char*s in your assembly code. That's not going to work.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Clock Explosion posted:

But would that really cause the debugger to totally bypass the input streams in the C++ file?

You are probably looking at the internal std::string data and not the raw char* and thus it looks like crap.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
http://en.wikipedia.org/wiki/Point_in_polygon

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
It's a bad design, but not for the reason your coworkers are saying (and I'm not really even sure they're saying anything that makes sense at all). Inheritance is an "is-a" relationship, e.g. a Ford is-a kind of Car. A vector in R4 is not a kind of vector in R3, so you shouldn't be using inheritance. Just make two separate classes.

You can usually tell when your inheritance ideas are bad if your primary reason is "code reuse".

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

csammis posted:

That's generally true. When a program wants to open a certain file type, its installation program writes a value in the registry that indicates the file extension and how Windows should invoke the program to open it.

Search the registry using regedit for ".mp3" and do some exploring, you'll see how it's set up.

Or just look here: http://msdn.microsoft.com/en-us/library/bb776870(VS.85).aspx

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
When you doubleclick a file it just executes the command specified in the "open" verb for the extension.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

arkiteKt posted:

Browsers being stupid cunts with javascript form submit problem

The problem is not browsers. It is you. Usually you want a "null" option so that selecting something actually requires a change.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

hexadecimal posted:

Look up quad-trees for doing efficient 2d collision detection.

Quadtrees aren't a collision detection method, they're a culling method. Besides that, with a Space Invaders clone, you'd do just as well with a fixed-size grid for culling.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ToastedZergling posted:

it's simply too inefficient.

...

It's written presently written in javascript

Hahahahaha.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Jo posted:

It's very difficult to disagree with you, but he's right -- if an algorithm is good, it shouldn't matter what the implementation language is.

No, not really. Most Javascript implementations are incredibly slow. Unless you're using Firefox 3.1, Chrome, or whatever beta version of Safari, you're going to be wasting a ridiculous amount of time. For basic operations like looping, the Firefox Tracemonkey engine is almost 40x as fast as the old Javascript engine.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Jo posted:

An algorithm that's O(n) can outperform one of O(n^2) even if the implementation is in a language 100x slower, so long as the problem size is large enough.

Yeah, but according to what he's saying, the problem size isn't especially large. The height of the wall shouldn't even be a factor in terms of the computational complexity, so you only need to optimize row-generation.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Here. This runs in about 10 seconds in FF 3.0 and almost instantly in FF 3.1:
code:
function Row(width, cracks) {
    this.cracks = cracks;
    this.width = width;
    this.potChildRows = [];
    this.memo = {};
}


Row.prototype.findTables = function(allRows, tableHeight) {
    if (tableHeight === 1) {
        return 1;
    }
    else if(this.memo[tableHeight] == null) {
        var count=0;
        for (var i = 0; i < this.potChildRows.length; i++) {
            count += this.potChildRows[i].findTables(allRows, tableHeight - 1);
        }
        this.memo[tableHeight] = count;
    }
    return this.memo[tableHeight];
}

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ToastedZergling posted:

Wow, thank you, I never have seen code written out like that or thought to think about my code like that. What does theta mean exactly? Recommend any books / articles on optimization / dynamic programming?

Big-theta is another notation for asymptotic complexity of an algorithm. O(f(n)) says that a function grows (asymptotically) as fast or slower than f(n), while Θ(f(n)) says that a function grows (asymptotically) as fast as f(n). There's also Ω(f(n)), which says that a function grows (asymptotically) as fast or faster than f(n).

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Just to be completely nit-picky, you should probably use Θ instead of θ. Not that it matters a ton in this situation, since little-theta wouldn't really make sense (at least not in the sense that Θ is Ο and &Omega).

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Look up "fractal terrain generation".

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
What. Why would you write a parser for HTML when you could just, you know, use any implementation of DOM you want?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
You know, hex, when normal people are criticized for their bad advice, they stop to think about why they are being criticized and sometimes even work to improve themselves so they can give good advice, rather than just vomiting up a bunch of dumb words to justify the bad advice they initially supplied.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

IntoTheNihil posted:

How important is math when programming? I was decent at it during highschool but didn't do anything close to advanced studies. After two years post-graduation I haven't retained a lot either.

It depends on if you want to do a lot of mathematical programming. Logic is important though.

IntoTheNihil posted:

Is there a real advantage of learning C prior to C++? It's what i'm doing now (alongside of Python too) but i'm thinking of just saving myself the time and jumping into C++.

Only if you want to be able to write pure C. If you only ever intend to use C++, it doesn't really matter.

IntoTheNihil posted:

Is there a solid C primer out? I'm learning from scratch with the K&R book and it's extremely confusing with how precise it is. I need something slower and more dumbed down I guess, hah.

Honestly, you'd probably learn more by simply coming up with some little projects to do and writing them in C, and use K&R as a reference.

IntoTheNihil posted:

What language has the largest job market when it comes to specialization. That said, I realize it's important to know as much as you can.

Probably Java, or maybe PHP. There are no end of lovely "enterprise" products written in Java, and no end of lovely websites written in PHP.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
I don't think I've ever known someone with a "programming certificate".

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

tripwire posted:

Should I touch the GPU?

Of course touch the GPU. GPUs are expressly designed for fast rendering of polygons.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Susietron posted:

A bit of an HTML question... I'm wondering, is it possible to launch an SSH session from a link?

I know it's possible to open a telnet session by using telnet://some.host.ip.address but I haven't been able to find a similar way of starting as SSH session.

Is there even a way to launch an ssh client from a link? For example...
code:
<a href="file:///c:/program files/sshclient/ssh.exe">Launch SSH session</a>
but then there's the matter of having to use a command line parameter to open an ssh session to a specific host... Any suggestions? Google is eluding me on this one.

Write a URL protocol handler.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
No one who writes software for a company would ever voluntarily use that software.

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Jo posted:

What data structure exists to do the following:
- Quickly return the set of all points (2D) inside a given rectangle.
- Quickly return the closest point to a given point.

QuadTrees seem like the right choice, but are better options available?

If you're just dealing with sets of points, why not use a fixed-size grid? It's way easier to implement, and in the case of point sets, it'll probably be faster because you won't have to descend/ascend through a tree. Hell, with points, you don't even have to worry about them overlapping multiple blocks in the grid.

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