As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

PA Programming Thread :: PAdev.net - Need hosting for a service of yours? Check it out.

194969899100

Posts

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    @Infidel: Sweet, very cool. Good to have when I write Part 2 which is going to have a TON of actual code.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Infidel wrote:
    Check out the article now!

    http://www.padev.net/2012/02/part-1-managed-language-dynamic-script-proxies

    CODE SECTIONS!

    You're all welcome.

    (The available code tags are listed underneath the post box when editing, straight-forward shit and if there is a language you want me to enable just let me know. It uses GeSHi.)

    Ooooh

    Code sections

    Hey hey hey hey

    If it's not too much trouble, are multiple inline images possible?

    Penny Arcade Developers at PADev.net.
  • Options
    baronfelbaronfel Would you say I have a _plethora_?Registered User regular
    While we're talking useful programs, if you're working in Visual Studio you owe it to yourself to try Resharper. It's a ton of static analysis and core correction/completion/reorganization in one package. It also helps you out with improved Intellisense, WPF completion, and now supports javascript as well!

    Check it out at their site. If you're familiar with IntelliJ, the major keybindings are the same, so you should be able to slip in easily to the extra features.

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    If you're writing C# and you aren't using ReSharper, you're a goose.

    e: If you ever look at my source code and go "Huh, his source code is very pretty...nicely aligned, in nice regions and organized well, doesn't even have any extraneous using statements!" that's because of ReSharper.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    IncindiumIncindium Registered User regular
    I'm still using an ancient version of UltraEdit (v10) that we bought some licenses for 8-9 years ago... I've been using it so long I'm not sure I care to dick around with anything else.

    steam_sig.png
    Nintendo ID: Incindium
    PSN: IncindiumX
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    That's a bleak attitude...

  • Options
    InfidelInfidel Heretic Registered User regular
    Infidel wrote:
    Check out the article now!

    http://www.padev.net/2012/02/part-1-managed-language-dynamic-script-proxies

    CODE SECTIONS!

    You're all welcome.

    (The available code tags are listed underneath the post box when editing, straight-forward shit and if there is a language you want me to enable just let me know. It uses GeSHi.)

    Ooooh

    Code sections

    Hey hey hey hey

    If it's not too much trouble, are multiple inline images possible?

    Done, and now images don't show up automatically, you need to insert them using the button.

    It will put the img tag in for you.

    OrokosPA.png
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Infidel wrote:
    Hey hey hey hey

    If it's not too much trouble, are multiple inline images possible?

    Done, and now images don't show up automatically, you need to insert them using the button.

    It will put the img tag in for you.

    Awesome - thanks very much!

    Penny Arcade Developers at PADev.net.
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    Well, it took me almost four hours, but I finally worked out all the Lua side stack imbalances in this code. You really have to be disciplined with Lua, because even nil being pushed on the stack after a simple nil check can leave you in an imbalanced state if you don't pop it. At least you don't have to clean up function arguments, prologue/epilogue style.

    Also, when using metatables that override __index and __newindex in complex ways, it really behooves you to use lua_rawget/lua_rawset in almost every case, unless you know for a fact you want the metatable to trigger...had some fun to track down access violations earlier because I wasn't doing rawgets, and my __index was being triggered, and then thinking what I was looking for was something .NET side, and it got all kinds of out of whack.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    InfidelInfidel Heretic Registered User regular
    If you resize an image using the width and height attributes, it will automatically render a resized version and link to the original, so MAGIC! Just upload the full deal and use the selections on the dropdown before clicking insert, or insert "original" and tweak the numbers yourself and it will make the smaller copies.

    Going to sort out how I want to handle floating of the images when I get home.

    OrokosPA.png
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    Also, philosophical question. When doing a glue wrappers like this, there are sections of the code where you have to make a choice: Write them in the native side (in this case C#), or write them as actual Lua code. The __index and __newindex metatable function are clear examples of this. They don't change per-proxy, they are always the same. I could actually write them Lua side, and store that Lua as a simple resource in my code...or I could continue to write them C# side, which requires more time, effort and thought as I have to worry about things like the stack balancing out.

    How would you guys go about that? On one hand, writing them Lua side is probably easier for maintenance, but on the other hand execution is likely slightly faster C# side and it keeps that kind of cruft out of the pristine scripting environment I'm trying to create.

    e: Actually, there is one clear advantage to the C# side I didn't think of, and pretty much tips the scale towards keeping them C# side: I can debug them.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    FremFrem Registered User regular
    edited February 2012
    I can mostly confirm admanb's insane ramblings about Sublime Text 2. It's way better than Notepad++, but not as awesome overall as Vim or Emacs yet.

    The first nice feature is multiple cursors. You can put in a whole bunch of cursors in random places, and they all work exactly like you'd expect. Movement, selection, text formatting operations, etc. Ctrl+D will find the next instance of the selected text and put a cursor there. It's really great if you have to work on old code that has a ton of repetition. I was saddened greatly when I learned that Vim doesn't support such dark magick.

    The second nice thing is that you can script it with normal Python, and it's extremely scriptable. Someone built a package manager inside the editor. If I have to (for example) edit a Powershell script, and I realize ST2 doesn't have syntax highlighting for that, I hit Ctrl+Shift+P, and type "pac i<enter>power<enter>" (the text-based menu system has lazy autocomplete) and I've got Powershell syntax highlighting three seconds later. I'd have lost ten minutes mucking around with things in Vim.

    Then there's a bunch of small things that are just nice to have, like the code navigation dropdown, good defaults for everything, live regex selection, the minimap, showing invisible characters on selection, and an incomplete Vim mode that does what I expect a decent amount of the time

    But I still haven't paid the $60. Because Viiiiiiiim.

    Frem on
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited February 2012
    GnomeTank wrote:
    Also, philosophical question. When doing a glue wrappers like this, there are sections of the code where you have to make a choice: Write them in the native side (in this case C#), or write them as actual Lua code. The __index and __newindex metatable function are clear examples of this. They don't change per-proxy, they are always the same. I could actually write them Lua side, and store that Lua as a simple resource in my code...or I could continue to write them C# side, which requires more time, effort and thought as I have to worry about things like the stack balancing out.

    How would you guys go about that? On one hand, writing them Lua side is probably easier for maintenance, but on the other hand execution is likely slightly faster C# side and it keeps that kind of cruft out of the pristine scripting environment I'm trying to create.

    e: Actually, there is one clear advantage to the C# side I didn't think of, and pretty much tips the scale towards keeping them C# side: I can debug them.

    There are Lua debuggers: http://www.cushy-code.com/grld/manual.html is one I've used. Not 100% sure it will play nice with C# though.

    C# is not always faster, if you use LuaJIT as the script engine, however the JIT compiler does break tracing on native C calls, which there are likely to be a lot of.

    For Lua stack balancing I've tended to just use a simple class that on destruction auto-pops everything, not sure how easily you can do that but you can always just call lua_settop() if you've saved the top earlier

    Phyphor on
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    @Infidel: All these additions to Drupal are great, but things like auto-URL's aren't working anymore. Was that because of the multi-image change?

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Phyphor wrote:

    There are Lua debuggers: http://www.cushy-code.com/grld/manual.html is one I've used. Not 100% sure it will play nice with C# though.

    C# is not always faster, if you use LuaJIT as the script engine, however the JIT compiler does break tracing on native C calls, which there are likely to be a lot of.

    For Lua stack balancing I've tended to just use a simple class that on destruction auto-pops everything, not sure how easily you can do that but you can always just call lua_settop() if you've saved the top earlier

    lua_settop feels like cheating though :P Yeah, I could do that, but these are going to be extremely long running script contexts. I'd rather make sure the stack is finely balanced the way it should be, rather than just tossing in a bunch of full pops and settops all over the place. If I were doing just a very simple glue wrapper, I'd probably do exactly as you suggest and have some kind of class that pops on destruct (or some kind of method I can pass a lambda to that does an auto-pop at the end, using gettop/settop).

    At any rate, most of the stack imbalance issues were just from me not having touched the Lua API in a while and having to remember what pushes, what pops and when I have to manually pop. It's coming back to me now.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    InfidelInfidel Heretic Registered User regular
    GnomeTank wrote:
    @Infidel: All these additions to Drupal are great, but things like auto-URL's aren't working anymore. Was that because of the multi-image change?

    I turned that off intentionally as it mucks with things, in particular the use of the @ sign.

    Use <a> tags explicitly, thanks!

    OrokosPA.png
  • Options
    Lux782Lux782 Registered User regular
    Driver problem solved. I reformatted the computer. Haha.

    So question. Seeing as Gnome is talking about scripting. I am writing a piece of software to do testing. Most of the testing will be automated and I was planning on using a scripting language for it. I don't need anything complex for it. The ability to bind function calls to C# calls, do some kind of looping, and some boolean logic for if then else. I was thinking of using Python however I fear that the people who will be writing the scripts will make the script do too much or would not be willing to learn the syntax and end up expecting me to take care of their work. Anyone have any thoughts? The software is for internal use only and it needs to be done quickly. I don't really have the time to write up something grand. IronPython stuck out for this reason though I have never used it. If C# 4.5 was released I would be using the C# scripting language. (Plus async, so awesome)

  • Options
    AnteCantelopeAnteCantelope Registered User regular
    I'm trying to do some graphics programming, using a textbook that uses OpenGL, GLUT, and GLEW. Does anyone have any experience setting these up? GLUT in particular was apparently abandoned years ago, I can't find any 64 bit versions of it, my textbook leads to all these broken links, and files that I'm told should already exist (like gl.h) don't. Everything from my textbook leads to broken links or 404s and aaaargh. I wanna go back to Java.

  • Options
    Grey PaladinGrey Paladin Registered User regular
    Does anyone have any experience with the Clang compiler? How does it matches up to GCC? I heard a lot of nice things about its usability, but where does it stands on the optimization front?

    "All men dream, but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity; but the dreamers of the day are dangerous men, for they may act their dream with open eyes to make it possible." - T.E. Lawrence
  • Options
    bowenbowen How you doin'? Registered User regular
    I will be using sublime text forever now instead of notepad++.

    Maybe I'll pay for it when I get mo' money.

    Also code sections make me happy in the pants. Now all we need is highlighting.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    bowenbowen How you doin'? Registered User regular
    Wow I'm dumb, I didn't see the highlighting at first.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    urahonkyurahonky Registered User regular
    edited February 2012
    Damn I wish I did more programming outside of Netbeans to use Sublime more.

    e: Also everyone should listen to the song in my signature. It's a great song to program to, in my opinion.

    urahonky on
  • Options
    StarfuckStarfuck Registered User, ClubPA regular
    I've been trying SublimeText on/off for a while. I just have trouble getting into it. I have a tough time letting go of vim.

    jackfaces
    "If you're going to play tiddly winks, play it with man hole covers."
    - John McCallum
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Starfuck wrote:
    I've been trying SublimeText on/off for a while. I just have trouble getting into it. I have a tough time letting go of vim.

    I sympathize. I spent a year or so with emacs and I had a difficult time letting go. I still use the cursor shortcuts whenever I can.

    I think in the end I just prefer ease of use, accessible features, and prettiness (oh the prettiness) over text editing wizardry.

  • Options
    zeenyzeeny Registered User regular
    Whip yourself for leaving emacs.

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    urahonkyurahonky Registered User regular
    Snap! The gloves are off!

  • Options
    urahonkyurahonky Registered User regular
    Okay I'm trying to figure out how to remove an icon from a JButton. If I add an Icon, and save my design everything is fine. But when I REMOVE the icon and then save it throws an IOException.
    if (imageSelector.getNoImageRadio().isSelected()) {
                        
                        //Remove the image, so have a blank ImageIcon..
                        path = "";
                        imageIcon = new ImageIcon(path);
                        return imageIcon;
                    }
    

    This is a snippet of my if statement. Basically I set the path to nothing, and then create a new ImageIcon... That does nothing. So I've tried:
    if(((ImageIcon)prop.getValue()).toString().isEmpty()){
                            
                            jButton.setIcon(null);
                            
                        }
    

    (Which Google suggested I do) But it still did nothing. What am I missing here?

  • Options
    urahonkyurahonky Registered User regular
    I hate how the code tag handles tabs...

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    urahonky wrote:
    I hate how the code tag handles tabs...

    You mean how it doesn't handle tabs at all and just takes whatever you had in your editor verbatim?

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    urahonkyurahonky Registered User regular
    GnomeTank wrote:
    urahonky wrote:
    I hate how the code tag handles tabs...

    You mean how it doesn't handle tabs at all and just takes whatever you had in your editor verbatim?

    Yeah! It should magically space everything perfectly for me.

  • Options
    urahonkyurahonky Registered User regular
    Wow I figured it out... I can't believe it ended up being what it was.... One of our Properties for the Control was being set as the ImageIcon("") blank path, and that didn't exist so when we tried to save it (yay, serialization!) it threw the error. So basically I set it to an empty string if the icon doesn't exist any more.

  • Options
    seabassseabass Doctor MassachusettsRegistered User regular
    edited February 2012
    GnomeTank wrote:
    Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.

    The only real problem with emacs is that it doesn't integrate well with screen. If I had to start over, I'd learn vim instead, only for that reason.

    OK, two reasons. eshell can't handle redirection correctly, which annoys the hell out of me.

    seabass on
    Run you pigeons, it's Robert Frost!
  • Options
    zeenyzeeny Registered User regular
    GnomeTank wrote:
    Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.

    Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
    The only real problem with emacs is that it doesn't integrate well with screen.

    Come again? I use a vertical split emacs in a screen tab for over 90% of my development.
    What possible issue do you have?(PS: rebind screen escape if it's shortcuts, .screenrc is your best friend)

  • Options
    seabassseabass Doctor MassachusettsRegistered User regular
    edited February 2012
    zeeny wrote:
    GnomeTank wrote:
    Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.

    Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
    The only real problem with emacs is that it doesn't integrate well with screen.

    Come again? I use a vertical split emacs in a screen tab for over 90% of my development.
    What possible issue do you have?(PS: rebind screen escape if it's shortcuts, .screenrc is your best friend)

    It's exactly the overlap in control characters that's annoying. Yeah, I know I can rebind them (and I have) but I want it to work without having to do anything. Basically screen should change it's defaults to be emacs friendly.

    Obviously that last bit is tongue-in-cheek.

    seabass on
    Run you pigeons, it's Robert Frost!
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Incindium wrote:
    I'm still using an ancient version of UltraEdit (v10) that we bought some licenses for 8-9 years ago... I've been using it so long I'm not sure I care to dick around with anything else.

    I use the current version of ultraedit every day. It's one of the few editors with easy to use FTP support (i'm editing/saving to an ftp directory on a unix server). It also has a wordfile for pickBASIC :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    I just love emacs' basic editing commands. ctrl+a/e, alt+f/b/d/delete, etc. Really basic stuff that's embedded in my brain.

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    zeeny wrote:
    GnomeTank wrote:
    Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.

    Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.

    Yet you told someone they should whip themselves for changing away from emacs. That's the kind of hype I'm talking about. Emacs isn't that great that people should flog themselves for deciding to not use it.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    urahonkyurahonky Registered User regular
    So is there an option for a dialog window, in Java, that displays something for x amount of seconds, or until something opens? I'd really like to use something like that...

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    I never really got into vim or emacs. Can't stand vim though; I'm sure it's easy to use once you know it, but all I want to do is add a line dammit! Or change these few characters.

This discussion has been closed.