Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'

15657596162100

Posts

  • ASimPersonASimPerson And protect them from the evils of the world like trigonometry and prime numbers.Registered User regular
    Reminds me of LC-3, sorta

    redoctober2.png
    SE++ Forum Battle Archive | PST = Pacific Standard Time | DRUNKSTUCK: A Homestuck recap
  • bowenbowen Registered User regular
    Anyone know of any good C libraries for MSSQL? Is there any even?

  • IncindiumIncindium Registered User regular
    bowen wrote: »
    Anyone know of any good C libraries for MSSQL? Is there any even?

    I'm guessing you'd probably have to use ODBC?

    steam_sig.png
    Diablo 3 Profile
    Nintendo ID: Incindium
    Hex TCG: Incindium
  • urahonkyurahonky Registered User regular
    Bahhhhh. I spent like 5 hours trying to setup the Transferable object for my DND, and for some reason the object isn't persisting. If I do:
    control = (Control)table.getValueAt(table.getSelectedRow(), 0);
    

    And then control.setIntegrated(true)

    it will set it as integrated.

    But when I do:
    control = (Control)dropEvent.getTransferable().getTransferData(DataFlavor.stringFlavor);
    

    And set it as integrated it doesn't stay integrated. Which means I can drag and drop it 100 times into the scene without a problem.

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • InfidelInfidel Heretic Registered User regular
    Isn't getTransferData returning a String object, since that's the flavor?

    Wouldn't you need a flavor for Control objects if you were trying to cast it straight to one?

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    It returns just a flat object of no type that still needs to be cast properly.

    So (Control) on a string cast will cause it to not work at all. Strings aren't controls.

  • bowenbowen Registered User regular
    So yes, you're right infidel, and I apparently can't read this morning.

  • TavTav Registered User regular
    in java, is there any inbuilt method that returns the amount of objects created or do I need to make my own counter for something like that?

  • bowenbowen Registered User regular
    http://pixelstech.net/article/index.php?id=1333969280

    Hahah.

    @Tav

    There isn't, you can get memory used and the like but not a specific amount of objects unless you keep track of it manually.

  • iTunesIsEviliTunesIsEvil Registered User regular
    Are you trying to do reference-counting, @Tav? I'm curious as to why you'd want to look at the count of objects you've instantiated/created.

  • InfidelInfidel Heretic Registered User regular
    Tav wrote: »
    in java, is there any inbuilt method that returns the amount of objects created or do I need to make my own counter for something like that?

    Your own classes only? Yeah, just static count that you increment manually works.

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • TavTav Registered User regular
    edited April 2012
    Are you trying to do reference-counting, Tav? I'm curious as to why you'd want to look at the count of objects you've instantiated/created.

    We're making what's pretty much a poker game and keeping track of the dealer using an int (which ever player's counter equals 0 is the dealer, 1 is little blind and 2 is big blind). At the moment it's hard coded for 4 players (At the start of the first round it's like p1 - 0, p2 - 1, p3 - 2, p3 - 4 and then at the start of the second round it's p1 - 1, p2 - 2, p3 - 3, p4 - 0...). I was wondering if there was some inbuilt in way to account for x players so it'd be like if (px = playerCount()) {dealerCount = 0}

    edit: There is probably a more efficient way to account for something like this, but this was the first thing I could think of so I'm running with it till someone yells at me for doing it wrong. Not much time for this project so it's functionality over elegance!

    Tav on
  • admanbadmanb the bored genie Seattle, WARegistered User regular
    How are you planning on storing the variable number of players? You must be keeping them in some data structure that you can get length out of.

    twitter, github, resume/portfolio, if you like to play or host boardgames online, check out handtracker
  • TavTav Registered User regular
    admanb wrote: »
    How are you planning on storing the variable number of players? You must be keeping them in some data structure that you can get length out of.

    I was hoping for some magical method I didn't know about where I could just be all "int players = ((getNumberOfInstances(computerAgent) + getNumberOfInstances(playerAgent));" but apparently this doesn't exist.

  • admanbadmanb the bored genie Seattle, WARegistered User regular
    Right... but how are you storing the players? I imagine when you had a fixed number you had something like
    Player p1 = Player.new();
    ...
    Player p4 = Player.new();
    

    but with a variable number you can't do that anymore.

    twitter, github, resume/portfolio, if you like to play or host boardgames online, check out handtracker
  • TavTav Registered User regular
    admanb wrote: »
    Right... but how are you storing the players? I imagine when you had a fixed number you had something like
    Player p1 = Player.new();
    ...
    Player p4 = Player.new();
    

    but with a variable number you can't do that anymore.

    ah feck, you're right there. Screw it, hard coding it is :bz

  • InfidelInfidel Heretic Registered User regular
    Yeah, with variable number of players, the count comes first...

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    Why not use a list or array @tav ?

  • urahonkyurahonky Registered User regular
    Infidel wrote: »
    Isn't getTransferData returning a String object, since that's the flavor?

    Wouldn't you need a flavor for Control objects if you were trying to cast it straight to one?

    It is actually pulling the control properly somehow. I literally cannot explain it, however. It's just that when I drag and drop it from the table into the scene it is creating a new control each time rather than using the control that already exist.

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • InfidelInfidel Heretic Registered User regular
    urahonky wrote: »
    Infidel wrote: »
    Isn't getTransferData returning a String object, since that's the flavor?

    Wouldn't you need a flavor for Control objects if you were trying to cast it straight to one?

    It is actually pulling the control properly somehow. I literally cannot explain it, however. It's just that when I drag and drop it from the table into the scene it is creating a new control each time rather than using the control that already exist.

    That doesn't sound proper to me. :rotate:

    It might have some bizarre connection with how Control has a string constructor, does Java do implicit conversion?

    i.e. If you have a string of "TextField" or such, does your cast somehow get transformed into Control("TextField")? I know C++ can do that.

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    edited April 2012
    That's what I was thinking too, infidel. I cannot find any supporting documentation for java though. And I'm suspecting the way urahonky stores the events for processing by functions other than the one that captured the event, it's creating some sort of nasty mangling.

    bowen on
  • urahonkyurahonky Registered User regular
    Well it seems on our Table you can do:
    table.getValueAt(table.getSelectedRow(), 0);
    

    and that will return the control. Who knew!

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • urahonkyurahonky Registered User regular
    Sorta related question:

    Right now we have a WYSIWYGScene set as a singleton. Why? Because we had assumed there will ALWAYS ONLY be one scene at one point in time. Well now that we've got Tabbed Panes that won't be possible to assume. So now I'm stuck. We have 30 calls to "WYSIWYGScene.getInstance()". How will I be able to keep track of the "main" scene (ie the one that contains the window)? Create a Class that keeps track of it? Create an ArrayList in our Design Class that contains the scenes? I really don't want to break our program but it doesn't look like I can use a lot of the code that we have written already for Scenes (Which are inside the TabbedPanes) that aren't WYSIWYGScenes (which is our main program's scene).

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • bowenbowen Registered User regular
    You will have to rewrite it, you don't want to try and patch singleton design principles to a non-singleton system. Trust me. I know you'll try anyways but that was your warning.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    You will have to rewrite it, you don't want to try and patch singleton design principles to a non-singleton system. Trust me. I know you'll try anyways but that was your warning.

    Yeah that is what I'm thinking what I'm going to do. I just need to run it by the other developer because it'll break what he's working on too.

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • DrunkMcDrunkMc Registered User regular
    Doing some Android stuff, really neat so far. Lots of APIs built in, made a pretty interesting program that deals with GPS, MapViews, and a DB. Also some Canvas drawing. Very nice stuff. The GPS stuff is a bit more confusing then I think it should be, but overall pretty good.

    I made an APP that just logs where I go, (Should only log every 20mins, but its more like every second. The API isn't doing what I thought it would do) and plots the last N on the map. Eventually I'll have an export, and I'll export it to a PostGres +GIS DB and make some other visualizations for it. I think it'd be interesting to see what my steps have looked like for say the past year. I wanted it working intime for PAX East, but no go. :(

    The debugging on your own phone is pretty bad ass.

  • urahonkyurahonky Registered User regular
    I can't understand why the following line isn't working:
    layer = getControlLayer();
    

    When I debug it and highlight over getControlLayer() it has a value in it. But layer doesn't get the value. And ends up being null.

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • bowenbowen Registered User regular
    If you're on the current line on the debugger layer will be null until you step past it.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    If you're on the current line on the debugger layer will be null until you step past it.

    Yeah I keep getting a NPE. But now it looks like if I run getControlLayer().getClass() before I get to that spot I get a NPE. What the hell Netbeans??

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • urahonkyurahonky Registered User regular
    Oh I got it to work... It works... It finally works!

    Holy crap!

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • urahonkyurahonky Registered User regular
    I killed the thread. I'm sorry.

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • admanbadmanb the bored genie Seattle, WARegistered User regular
    You dick!

    twitter, github, resume/portfolio, if you like to play or host boardgames online, check out handtracker
  • urahonkyurahonky Registered User regular
    try{
      Thread.haveAwesomeTime(withEveryone);
       } catch (urahonkyPosts e){
       Thread.terminate();
        }
    

    Games completed recently: Dragon's Crown, Knights of Pen and Paper, Castlevania: Symphony of the Night (20th time), Defender's Quest, The Witcher
  • bowenbowen Registered User regular
    That's about right.

  • InfidelInfidel Heretic Registered User regular
    When you post a lot you're gonna kill the thread eventually!

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    Java just severely depresses me honestly.

  • InfidelInfidel Heretic Registered User regular
    Having the choice to continue to work with arbitrary databases and query code, or go work on a Java/Oracle stack big app, I choose sticking with the medical database fun times. Even if the pure coding side is meh.

    TwitchTV channel: OrokosPA check.php?c=OrokosPA
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
  • GnomeTankGnomeTank Registered User regular
    Java doesn't even have the Parallel Tasks library....newbs are still using raw threads and sync primitives. So 2005.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh
  • bowenbowen Registered User regular
    That's what you get when you suggest the author modify his language.

This discussion has been closed.