Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 626 627 [628] 629 630 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903691 times)

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9405 on: April 21, 2016, 06:00:07 pm »

Also, there are the #pragma versions of library includes, and also linker settings. I recommend using them instead of hacking through the VS project settings. At least having your settings in a text file is portable to new projects, just have a cpp file specify its lib dependencies. Anyone who's wrangled with the VS project settings menus will get why I'm recommending this.
« Last Edit: April 21, 2016, 06:03:28 pm by Reelya »
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9406 on: April 22, 2016, 03:01:00 am »

what if we started keeping knowledge of foundational programming events as a set of parables, so that people can be enlightened of the old ways and avoid common pitfalls hundred years from now?

Spoiler (click to show/hide)
« Last Edit: April 22, 2016, 03:16:45 am by LoSboccacc »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9407 on: April 22, 2016, 03:08:29 am »

It's Experts Exchange, not Expert Exchange. Makes the URL way better.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9408 on: April 22, 2016, 05:07:46 am »

If I wanted one, I'd prefer it to be an expert one.

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #9409 on: April 22, 2016, 08:13:13 pm »

Code: [Select]
SELECT * FROM OPENQUERY (REMOTE_SERVER, 'SELECT * FROM REMOTE.dbo.Person WHERE PersonFirst = ' + @CustomerFirst + ' AND PersonLast = ' + @CustomerFirst) AS PASSTHROUGH
For some reason, sql server won't let me concatenate strings to create a passthrough query. No matter what I do, all it will allow is a single, unbroken string literal. Which means I can't pass those @ parameters in. Is there something I'm missing?
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

Shadowlord

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9410 on: April 23, 2016, 08:33:41 am »

Aren't you supposed to be doing parameterized queries to protect against sql injection anyways? http://rosettacode.org/wiki/Parametrized_SQL_statement

I should note that I don't know what PASSTHROUGH is, and only used SQL in one program, and learned enough to make that and then haven't used it again since.
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9411 on: April 23, 2016, 02:22:44 pm »

I've never used SQL Server, but in MySQL anyway I always use the CONCAT() function to do string concatenation, and a very quick search for SQL Server documentation indicates that it's supported there too.  Might be worth a try, but I've got not idea what passthrough queries are in this context so it may make no difference.
Logged
Through pain, I find wisdom.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #9412 on: April 23, 2016, 02:36:15 pm »

I have my Murach SQL book and there's nothing in here about a PASSTHROUGH keyword. Is there any documentation online about this function?
Logged

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #9413 on: April 23, 2016, 04:12:03 pm »

I'm not even sure PASSTHROUGH is a keyword. It's just an alias for the returned query results or something. Anyway, I can always just perform another query on the results... but you'd think sql would give you every filtering option available to decrease bandwidth.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9414 on: April 24, 2016, 09:51:32 am »

Code: [Select]
SELECT * FROM OPENQUERY (REMOTE_SERVER, 'SELECT * FROM REMOTE.dbo.Person WHERE PersonFirst = ' + @CustomerFirst + ' AND PersonLast = ' + @CustomerFirst) AS PASSTHROUGH
For some reason, sql server won't let me concatenate strings to create a passthrough query. No matter what I do, all it will allow is a single, unbroken string literal. Which means I can't pass those @ parameters in. Is there something I'm missing?


It looks as though passthrough is a temporary query result. I'm a bit rusty with sql, as I've been using mongodb recently(I like it a bit more).


You might need to write some additional code to set the variables that you want... I've never used that part of SQL before, but this looks to be along the lines of what you want.


I'm sure you've already seen it though.

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9415 on: April 24, 2016, 11:30:33 pm »

So, ah, errors are dumb.  Sometimes.

Just wrote the rough beginnings of an A* pathing algorithm for a roguelike, in one sitting on a plane flight.  Got home, finished it, and aside from a few simple mistakes it seemed to work.  But then I actually tried it and the enemies still couldn't path around corners.  Everything seemed correct and I couldn't figure it out.

Turns out that, drum roll... I never told it that impassable terrain was off limits for pathing.  So this algorithm was dutifully plotting out straight lines through walls because they were invisible to it.  Even though it knew how to go around.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: if self.isCoder(): post() #Programming Thread
« Reply #9416 on: April 27, 2016, 04:13:27 pm »

Yea, i need some help with this code: http://pastebin.com/7RdsCW2d
i marked problem sections with a comment that has PROBLEM: in it

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9417 on: April 27, 2016, 04:21:59 pm »

Yea, i need some help with this code: http://pastebin.com/7RdsCW2d
i marked problem sections with a comment that has PROBLEM: in it
I don't see the problem with the "R" command, but the "r" command does not appear to update i correctly.
Logged

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: if self.isCoder(): post() #Programming Thread
« Reply #9418 on: April 27, 2016, 05:13:36 pm »

I found out the problem (SCANF, DARN U)

Avis-Mergulus

  • Bay Watcher
  • This adorable animal can't work.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9419 on: April 28, 2016, 07:29:00 pm »

Bluh. So I made a robot, which is a fancy name for a raspberry pi on a really derpy chassis. So far, my stuff's been working perfectly, but then I decided to make a direct control script, so I can drive it around like an RC car.
The problem is this: I generally run the pi headless, and use SSH or a bluetooth terminal on my tablet to control it. The script I wrote uses pygame to detect keystrokes and set the motors accordingly, but apparently, a remote keyboard doesn't count as a real keyboard for pygame event purposes. I mean, if I physically hook the keyboard up to the pi, it works perfectly, but that sort of defeats the purpose.

So my question: how does one make it detect remote keystrokes?
Logged
“See this Payam!” cried the gods, “He deceives us! He cruelly abuses our lustful hearts!”
Pages: 1 ... 626 627 [628] 629 630 ... 796