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

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

18889919394100

Posts

  • Options
    bowenbowen How you doin'? Registered User regular
    edited May 2012
    Cantido wrote: »
    So I finally asked that potential employer, as nicely as I could, "why not switch from VB.NET to C#"?

    First it turns out I wont be working with either language, but they're just really deeply rooted in VB.NET. Then they got in a fun argument with each other about the differences between the two for a couple of minutes.

    There isn't any differences. Well I mean, there is. But VB.NET is just another language that hops on top of the .NET metalanguage. So, we're talking syntax differences (and a few minor things from a carryover from VB). It is, for all intents and purposes a wrapper language for C#, which is their flagship .NET language.

    This is why you could take any .NET encoded bytecode files and transform them between C#, VB.NET and C++.NET in reflector no matter which language it was compiled in originally.

    bowen on
    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
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    so Flash CS 6 came out with a Canvas exporter, and it's (mostly) awesome.

    85% of Flash's timeline animation capabilities now available on heavily optimized canvas javascript.

  • Options
    jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    I don't think there's much excuse for any .Net developer not to be a polyglot program. If you know C# or VB.Net you already know the other language, you just may not know it yet. There's more of a cost to move to IronPython and F#, but the rewards are greater as well. As a bonus it is a pretty gentle introduction to Python and Ocaml without worrying about learning a new set of libraries.

  • Options
    CantidoCantido Registered User regular
    If I have two folder and want to compare them in Java, how do I use an iterative loop to compare them?
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.Scanner;  
    import java.io.*; 
    public class start
    {
    	public static void main(String[] args) throws IOException  
    	   {  
    	        //Make sure Both folders are existing directories
    			//(which they are)
    			File CDirectory = new File("C:/compare");
    			File EDirectory = new File("E:/");
    			if (CDirectory.isDirectory() && EDirectory.isDirectory())
    			{
    				//collect all files and put them in two arrays.
    				File[] clist = CDirectory.listFiles();
    				File[] elist = EDirectory.listFiles();
    			}
    			Iterator itr = clist.iterator();
    			
    			for (File eSubject : elist)
    			{
    				for (File cSubject : clist)
    				{
    					if (eSubject.compareTo(cSubject) == 0)
    					{
    						System.out.println("Files Match");
    					}
    					else if (eSubject.compareTo(cSubject) != 0)
    					{
    						System.out.println("Files Don't Match");
    					}
    				}
    			}
    			
    	   }  
    }
    

    3DS Friendcode 5413-1311-3767
  • Options
    bowenbowen How you doin'? Registered User regular
    edited May 2012
    jackal wrote: »
    I don't think there's much excuse for any .Net developer not to be a polyglot program. If you know C# or VB.Net you already know the other language, you just may not know it yet. There's more of a cost to move to IronPython and F#, but the rewards are greater as well. As a bonus it is a pretty gentle introduction to Python and Ocaml without worrying about learning a new set of libraries.

    Mostly this. .NET is more of an API framework, so, knowing the syntax of both it's pretty easy to go between them because you know System.Windows.Forms contains a MessageBox class. The only difference is how you call it which is almost identical between the two. Largest difference between the two is array subscript, aside from just general language stylization.

    C++.NET has a bit more to it than VB or C#, having to interface with both the CLR and C++ STD/ISO thingamajibbers.

    bowen on
    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
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    Almost every .NET programmer I've ever met has been brutally entrapped in C#, and speaks as though they legitimately do not even understand how other programming languages function.

  • Options
    bowenbowen How you doin'? Registered User regular
    Cantido wrote: »
    If I have two folder and want to compare them in Java, how do I use an iterative loop to compare them?

    Directory matching is one of the defacto reasons to use recursion, do you need to use iterative looping?

    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
    CantidoCantido Registered User regular
    bowen wrote: »
    Cantido wrote: »
    If I have two folder and want to compare them in Java, how do I use an iterative loop to compare them?

    Directory matching is one of the defacto reasons to use recursion, do you need to use iterative looping?

    No, I don't need to use an iterative.

    3DS Friendcode 5413-1311-3767
  • Options
    bowenbowen How you doin'? Registered User regular
    Jasconius wrote: »
    Almost every .NET programmer I've ever met has been brutally entrapped in C#, and speaks as though they legitimately do not even understand how other programming languages function.

    We can say that about a lot of programmers. Most of my classmates didn't really understand bit/byte and how it works with memory either. Code monkeys I guess?

    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
    Cantido wrote: »
    bowen wrote: »
    Cantido wrote: »
    If I have two folder and want to compare them in Java, how do I use an iterative loop to compare them?

    Directory matching is one of the defacto reasons to use recursion, do you need to use iterative looping?

    No, I don't need to use an iterative.

    http://www.exampledepot.com/egs/java.io/TraverseTree.html?l=rel

    Try that?

    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
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited May 2012
    Jasconius wrote: »
    Almost every .NET programmer I've ever met has been brutally entrapped in C#, and speaks as though they legitimately do not even understand how other programming languages function.

    This isn't a .NET issue, this is a programmer issue. More specifically a below average programmer issue.

    Also, people forget IronRuby as a viable .NET language. Since it's written on literally the same back end as IronPython (Microsoft's DLR), and is hosted in the same code repository, this is shameful.

    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
    urahonkyurahonky Registered User regular
    Ugh... Macs. Every time I have to get a demo ready... The MacBook Pro just loves to fuck up and now I have to figure a way to troubleshoot.

  • Options
    bowenbowen How you doin'? Registered User regular
    edited May 2012
    Well that's Java. Not so much Java as what you guys are doing with Java.

    Generally you put business logic separate from UIs and develop them separate. But you've heard this before.

    bowen on
    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
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    bowen wrote: »
    Well that's Java. Not so much Java as what you guys are doing with Java.

    Generally you put business logic separate from UIs and develop them separate. But you've heard this before.

    We don't like your kind around here...corrupting people with your talk of separation of concerns and layered architecture.

    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
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    i do all web work with response.write

  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Psssh, response.write? I write raw CGI handlers in C.

    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
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    GnomeTank wrote: »
    Psssh, response.write? I write raw CGI handlers in C.

    that's the inefficient way of doing things

  • Options
    bowenbowen How you doin'? Registered User regular
    Jasconius wrote: »
    i do all web work with response.write

    I bet I've told this here before, but, yes, I've had to deal with someone who did just that.

    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
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Ugg, speaking of developer horror. We have a guy here at work who is sort of the missile silo developer of one part of our app. He's the only person who works on it, he doesn't really understand .NET that well, but thinks he's the shit. Lets list off the stupid shit this guy has done:

    * Created his own serialization engine, because the .NET one "isn't good", whatever the fuck that nebulous term means.
    * Writes big chunks of his code in C style static methods that take contexts as an argument. You know, sort of like what we do with classes and the concept of fucking 'this', only not.
    * Created a service call which takes a list of objects, and actually has different behavior based on the number of objects in that list, creating a method that you can't correctly predict the results of without looking at the implementation.
    * Refuses to give us an API For the above that allows us to batch send, no. We must call that horrible API once for every item, to hell with the number of SOAP envelopes, responses, and requests that fires up to do a single channel call.

    I could go on for hours. I want to ring this guys neck.

    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
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    GnomeTank wrote: »
    I could go on for hours. I want to ring this guys neck.

    Sadly, with the amount of beard you would have to contend with, this would prove impossible.

  • Options
    InfidelInfidel Heretic Registered User regular
    admanb wrote: »
    GnomeTank wrote: »
    I could go on for hours. I want to ring this guys neck.

    Sadly, with the amount of beard you would have to contend with, this would prove impossible.

    Are you invoking natural selection to explain the neckbeards? :lol:

    OrokosPA.png
  • Options
    wildwoodwildwood Registered User regular
    admanb wrote: »
    GnomeTank wrote: »
    I could go on for hours. I want to ring this guys neck.

    Sadly, with the amount of beard you would have to contend with, this would prove impossible.

    Clearly fire is the only alternative.

  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Infidel wrote: »
    admanb wrote: »
    GnomeTank wrote: »
    I could go on for hours. I want to ring this guys neck.

    Sadly, with the amount of beard you would have to contend with, this would prove impossible.

    Are you invoking natural selection to explain the neckbeards? :lol:

    Why yes. Yes I am.

  • Options
    Woot427Woot427 Registered User regular
    Anyone have any suggestions for super fast pdf creation? Our first pass was at using pdflatex, the tex file is created in 100ms but then pdflatex runs for 30 seconds for a 7 page document. That's far too long. PDF creation isn't something I have dabbled in too much. We're close to saying screw it and just saying rely on the print-friendly view and print to pdf if you really want it.

  • Options
    DrunkMcDrunkMc Registered User regular
    Woot427 wrote: »
    Anyone have any suggestions for super fast pdf creation? Our first pass was at using pdflatex, the tex file is created in 100ms but then pdflatex runs for 30 seconds for a 7 page document. That's far too long. PDF creation isn't something I have dabbled in too much. We're close to saying screw it and just saying rely on the print-friendly view and print to pdf if you really want it.

    I have loved iText. I haven't timed it, but check it out. Great library!

  • Options
    Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    I know pdflatex doesn't take 30 seconds to compile my homework, which is often 8 pages or more. I find that odd.

    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • Options
    JediNightJediNight Registered User regular
    Curious what people might suggest for this situation, as I'm not too experienced at more advanced programming techniques:

    I'm looking to make a customized scheduling application for a convention I work (volunteer) for. (This year we desperately needed some "collision detection" with regards to event data, not scheduling them against events ran by the same panelists, etc)

    Part of the data that will be stored will include the available times of day the panelist(s) can run event. But since there could be between one and multiple valid time blocks in a day, I would need to check against those times for a "collision" when trying to place the event in the scheduling grid. My idea was creating a 24 length array for each day set to 0/1 and when scheduling the event, have it check against that array for valid times.

    Does that sound like a good idea, or do you have a better solution? (Will be programming it in C# with WPF)

  • Options
    TofystedethTofystedeth Registered User regular
    edited May 2012
    jackal wrote: »
    I'm being told to work on a legacy VB6 app. If I post my address will someone come over and kill me? Something quick and painless would be nice, but I'm not picky.
    We offer a wide array of services. Please feel free to browse our catalog.
    http://www.youtube.com/watch?v=nUo8W_tbGtE

    Tofystedeth on
    steam_sig.png
  • Options
    TofystedethTofystedeth Registered User regular
    edited May 2012
    Woot427 wrote: »
    Anyone have any suggestions for super fast pdf creation? Our first pass was at using pdflatex, the tex file is created in 100ms but then pdflatex runs for 30 seconds for a 7 page document. That's far too long. PDF creation isn't something I have dabbled in too much. We're close to saying screw it and just saying rely on the print-friendly view and print to pdf if you really want it.
    @woot427
    At my old job I used a Python library called ReportLab. It has both free and paid versions. I don't remember exactly how fast it was, but working from a pure text file source of about 5000 pages that got split into a bunch of 1-10ish page PDFs didn't take more than a couple minutes, from start to finish I think. If your PDFs have images and such I don't know how long it'd be. I never really go the opportunity to do anything fancy with it, but it seemed pretty straightforward.

    Tofystedeth on
    steam_sig.png
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    edited May 2012
    OK I've apparently gone braindead re: modules in Python. I'm working on an application centered around Django, and I'm writing some modules to import large amounts of data into the database (SQLite at this point, but it could be anything). I have things structured as such:
    Root
    .lib/
    ..synchronizers/
    

    lib and synchronizers are directories under root (being the root of the django site), and each have a blank __init__.py in them. Sitting in the root directory I launch the interpreter and manually add lib/ to sys.path. And yet, when I try to 'import synchronizers' it fails.

    Of course it doesn't help that I've never tried to modularize something like this before, so I'm failing rather spectacularly. I've also tried this with synchronizers/ directly under root with no help. The import modules are all sitting under synchronizers/

    LuvTheMonkey on
    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    EndEnd Registered User regular
    edited May 2012
    if you're adding lib/ to your path, you don't need the __init__.py in lib/, but it shouldn't matter

    I'm curious how exactly it isn't working. Is import synchronizers giving an ImportError? Or are you expecting the submodules to live in the synchronizers module? (They won't, because synchronizers module is just synchronizers/__init__.py)

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    EndEnd Registered User regular
    oh wow I found my compiler book (you know...the dragon book)

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    I'm thinking it should work the same way the default xml package works. /usr/lib/python2.7 is in the pythonpath by default, which has:
    xml
    .etree
    ..ElementTree.py
    

    And you can do 'from xml.etree import ElementTree' and you get all the functions. My goal is to make it so I have a sync.py on the root that goes something like 'from lib.synchronizers import *' and then loop through the loaded modules and execute the sync() or whatever function in each.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    BarrakkethBarrakketh Registered User regular
    You should probably read the documentation on modules and packages.

    If you use "from xml.etree import ElementTree" you only have the ElementTree name in your namespace. To use something in that module, you would have to refer to it via ElementTree, "ElementTree.XMLParser.

    If you want to load the names in that package or module into the current (probably global) namespace with something like "from xml.etree.ElementTree import *", you need to define the "__all__" variable, which should be a list containing all the public symbols in a module or package. If it's for a package (a.k.a. a directory), then it needs to be defined in __init__.py.

    Rollers are red, chargers are blue....omae wa mou shindeiru
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    Aha! __all__ seems to be where I need to go next. But first, kebabs.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    The kebabs didn't help. The behavior is most strange:

    Starting at my django project's base directory, I can enter the interpreter and run 'from blahblah import models' and it imports my models definition file (stored in blahblah/ of course). As I understand it, the interpreter automatically adds the current working directory as part of the module search path, so this makes sense. As far as I can tell, this directory is not otherwise listed in the import path, and $PYTHONPATH is not defined.

    I then change into the lib directory and start the interpreter, but when i run 'from synchronizers import blahblahblah' it errors out me with 'No module named synchronizers'. The very strange part is that I can copy the synchronizers directory into /usr/lib/python2.7/site-packages (also on the module search path) and the same error occurs, but I can import anything else stored in site-packages (nothing installed there, at least to my eyes, is set up any differently than my attempt).

    Maybe I need sleep.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    KiTAKiTA Registered User regular
    Has anyone played with D? The guy who made Irisu Syndrome uses that for his coding and it seems interesting enough.

  • Options
    urahonkyurahonky Registered User regular
    Just got this book to read for work: http://www.amazon.com/The-Rootkit-Arsenal-Evasion-Corners/dp/144962636X/ref=sr_1_1?ie=UTF8&qid=1336997304&sr=8-1

    Has anyone checked it out yet? I'm pretty excited.

  • Options
    urahonkyurahonky Registered User regular
    Have to write up a bug report before I move to my new project. Basically I have to write down the problem, the fix, and the prevention of the bug. There are 66 bugs that I fixed in this iteration. This is going to take forever.

  • Options
    bowenbowen How you doin'? Registered User regular
    urahonky I'm sorry you're about to go postal, I hope prison food is okay.

    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
This discussion has been closed.