Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 430 431 [432] 433 434 ... 796

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

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6465 on: October 19, 2014, 12:42:55 am »

Linux (and modern Mac OS) use just newlines ('\n'), but Windows has always used a carriage return ('\r') followed by a newline ('\n').  That definitely can cause issues if you're working with cross platform code that does string manipulation but doesn't account for the platform differences.  I didn't see anything obviously wrong like that when skimming the code above though.

I really doubt it's because of the virtual machine though.  Do you know how to use gdb or any other debugger?  If not, try taking a look at it.  When running your program inside gdb, if it encounters a segfault it will break immediately and give you the current state of the program so you can see what variables have what values, what caused the segfault and be able to go up the call stack of functions to see just where the program is at the point of the crash.  Sometimes it won't give you the answer immediately, but it will definitely help.
Logged
Through pain, I find wisdom.

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6466 on: October 19, 2014, 12:59:25 am »

Yeah, I read through the code and can't see anything wrong.

Something very weird is going on.

It sounds like it could be some weird character issue, invisible invalid characters or some such.
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6467 on: October 20, 2014, 11:47:18 am »

Anyone proficient with SQL? Apparently my syntax is garbage, and I could use someone experienced to run it past.
Logged

Twiggie

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6468 on: October 20, 2014, 12:03:43 pm »

I work with it quite a bit, though I wouldn't really call myself proficient...
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6469 on: October 20, 2014, 12:09:19 pm »

Perfect! I just started with it not a month or so ago, so you already outrank me. :P Just making sure there were people here who could read that when I need help in the evenings. It kinda makes me happy that SQL is so hard on my brain, because it makes everything else I'm involved in seem piss easy by comparison. *hugs Python closely*

E: Also: Morgan. Nice.
« Last Edit: October 20, 2014, 12:12:22 pm by GUNINANRUNIN »
Logged

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6470 on: October 20, 2014, 12:52:07 pm »

I'm a reasonable hand with SQL too. Not a wizard, but I know my way around it.
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6471 on: October 20, 2014, 01:09:39 pm »

I'm a reasonable hand with SQL too. Not a wizard, but I know my way around it.
Spoiler (click to show/hide)

Generals anyone?
Logged

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6472 on: October 20, 2014, 01:26:33 pm »

HAHA my system softwares class is getting into bash shell scripting.

I like how white space doesn't matter until it does.

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6473 on: October 23, 2014, 10:40:01 am »

So I have a program that uses two JFrames so that it can display across a multi-screen setup. One of them is opened from the first one to be fullscreen on the second screen; I can make this work. However, it then minimises every time focus is lost. This is a problem, because it is meant to act as a display window for a projector or TV or whatever, and setAlwaysOnTop(true) doesn't seem to help. Any ideas?

I'm using code which I do not fully understand (problem source!) lifted from stackoverflow:

Code: [Select]
public static void showOnScreen( int screen, JFrame frame )
{
    GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    if( screen > -1 && screen < gs.length )
    {
        gs[screen].setFullScreenWindow( frame );
    }
    else if( gs.length > 0 )
    {
        gs[0].setFullScreenWindow( frame );
    }
    else
    {
        throw new RuntimeException( "No Screens Found" );
    }
}

When I use this code, I get the problem. If I manually move it to the second screen and maximise, I do not.
« Last Edit: October 23, 2014, 10:46:52 am by Arx »
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Sergius

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6474 on: October 23, 2014, 07:27:37 pm »

I'm a reasonable hand with SQL too. Not a wizard, but I know my way around it.
Spoiler (click to show/hide)

Generals anyone?

I've done a crapload of SQL in several different engines over the years. Wanna post it or is it top secret? Send it over if you want me to try parsing it.
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6475 on: October 23, 2014, 07:38:10 pm »

I'm a reasonable hand with SQL too. Not a wizard, but I know my way around it.
Spoiler (click to show/hide)

Generals anyone?
I've done a crapload of SQL in several different engines over the years. Wanna post it or is it top secret? Send it over if you want me to try parsing it.
Oh no I'll post it here! Thanks in advance everybody. c:
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6476 on: October 24, 2014, 11:42:34 am »

Hint to anyone doing anything:

When iterating through a list/map/vector with a for loop, do not change the list/map/vector from inside the loop. Half the time it works like you think it should, the rest of the time it explodes and wipes half a planet from existance.

It is a lesson I have had to learn many times, but somehow I always forget.
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6477 on: October 24, 2014, 11:56:11 am »

I was wondering what happened to the other side of the street.
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6478 on: October 24, 2014, 02:02:26 pm »

addendum: use the iterator itself to change the list. the iterator knows and throws back exception at you if anything is not supported.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6479 on: October 24, 2014, 02:05:03 pm »

Things working like they should half of the time seems like a very optimistic estimate :P
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.
Pages: 1 ... 430 431 [432] 433 434 ... 796