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/

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

189111314100

Posts

  • urahonkyurahonky Registered User regular
    Hey hey! I buy groceries from them because they're almost across the street from me. Don't make drive an additional 5 minutes!

  • bowenbowen How you doin'? Registered User regular
    Do you guys have Wegman's in Ohio?

    It'll be worth that extra 5 minutes if you do, trust me.

    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
  • urahonkyurahonky Registered User regular
    We have Meijer and Kroger. There's also a Cub Foods but it's roughly 20% more expensive and you have to bag your own shit.

  • bowenbowen How you doin'? Registered User regular
    I hear Krogers is a good alternative to Wegman's.

    Worth the markup, if there is one. I had a bag of apples last me almost 2 months. I have no idea how that worked.

    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
  • WeretacoWeretaco Cubicle Gangster Registered User regular
    bowen wrote:
    I hear Krogers is a good alternative to Wegman's.

    Worth the markup, if there is one. I had a bag of apples last me almost 2 months. I have no idea how that worked.

    Well clearly you bought too many apples :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • urahonkyurahonky Registered User regular
    Alright time to move guys. Hopefully I'll still be able to collaborate with you in the future.

  • bowenbowen How you doin'? Registered User regular
    Weretaco wrote: »
    bowen wrote:
    I hear Krogers is a good alternative to Wegman's.

    Worth the markup, if there is one. I had a bag of apples last me almost 2 months. I have no idea how that worked.

    Well clearly you bought too many apples :)

    Granny smith apples last forever apparently though. Well... non-wallyworld ones.

    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
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    urahonky wrote: »
    Alright time to move guys. Hopefully I'll still be able to collaborate with you in the future.

    If your boss tries to bite you, bite him back.

  • templewulftemplewulf The Team Chump USARegistered User regular
    bowen wrote:
    I hear Krogers is a good alternative to Wegman's.

    Worth the markup, if there is one. I had a bag of apples last me almost 2 months. I have no idea how that worked.

    I once bought ground beef from wal-mart that went green within 3 days. Their groceries really are the worst.

    Cub isn't that much different in price where I live, but I consider it the Wal-Mart of grocery stores anyway. The lighting is bad, the crunched-together aisle make me uneasy, and no one - employee or customer - looks happy to be there.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • EndEnd Registered User regular
    templewulf wrote: »
    I once bought ground beef from wal-mart that went green within 3 days. Their groceries really are the worst.

    green?!

    what the fuck

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • bowenbowen How you doin'? Registered User regular
    Yup.

    I bought ground beef and it went gray in 1, and green in 4.

    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
  • EndEnd Registered User regular
    edited February 2012
    I've seen ground beef go gray, but usually that takes about a week, and I should have already have thrown it out. I had no idea it can turn green. But I guess anything is possible ;p

    I did used to go to walmart when I was in college, but I didn't buy much raw meat then.

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • bowenbowen How you doin'? Registered User regular
    Walmart for paper products, soda, and boxed foods like cereal, nothing else.

    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
  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    The produce and (some of) the meat at the Walmarts around me are fine. The biggest complaint I have is I can't buy their chicken legs because they come from some type of monster chicken that has monster leg tendons.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    My wife and I won't shop at Wal-mart anymore. We have a discount food store here called Winco that we'll buy big brand boxed stuff at, but we buy meat from a butcher and produce from one of the many organic stores around here. We also do farmers markets. Requires a little more work, but man the quality is so much better than ANY grocery store. Same with the meat from the butcher, which is always super fresh. Sometimes literally right out of the grinder if we go in when he's doing a new batch. He also gets all his meat from sustainable local farms, so that's cool.

    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
  • templewulftemplewulf The Team Chump USARegistered User regular
    GnomeTank wrote:
    My wife and I won't shop at Wal-mart anymore. We have a discount food store here called Winco that we'll buy big brand boxed stuff at, but we buy meat from a butcher and produce from one of the many organic stores around here. We also do farmers markets. Requires a little more work, but man the quality is so much better than ANY grocery store. Same with the meat from the butcher, which is always super fresh. Sometimes literally right out of the grinder if we go in when he's doing a new batch. He also gets all his meat from sustainable local farms, so that's cool.
    I hate moving, because then you have to start the search for that kind of thing all over again.

    I mean, I could drive back for the farmers' market, but on the other hand Soul Calibur isn't going to play itself.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Grey PaladinGrey Paladin Registered User regular
    edited February 2012
    Are there any compilers that comply with the C '11 standard as of yet?

    Grey Paladin on
    "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
  • bowenbowen How you doin'? Registered User regular
    Not fully, gcc comes the closest I think with -std=c11

    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
  • Jimmy KingJimmy King Registered User regular
    My wife and I avoid Wal-mart if at all possible. On occasion they are the only store with whatever we need... our wal-mart has an amazingly good variety and selection of certain items according to my wife. We shop at local/regional grocery stores as much as possible, though... Food Lion, Martin's (previously locally owned Ukrop's, but they sold to Martin's). Food Lion is the best for meats, usually.

  • IzzimachIzzimach Fighter/Mage/Chef Registered User regular

    Can anyone comment on using Node.js as a (simple) server for a typical client/server multiplayer game? The ability to use javascript on both client and server makes node.js pretty tempting, at least for quick prototyping, and I felt like trying a simple game to see how well (or badly) it works out. I'll probably just try to make a simple DOTA-style game to try it out. I did something similar in C# and having the same language in both client and server saved a lot of headaches IMHO.

    I would like to try making the client in-browser using an HTML5 canvas but from a practical POV I'm probably better off using Unity for the client. My main concerns at the moment are:

    1. What protocol should I use to send data around? For near-real-time gaming you typically use TCP or UDP sockets but doing that here sounds a little TOO low-level. Should I just use socket.io and call it a day?

    2. If server-side computation starts to get complex, then the node server will probably get cranky since it' all single threaded. At that point I should dump some work into another thread process, right? It seems like deferring computation to the next tick in Node.js is possible but not usually recommended.

  • baronfelbaronfel Would you say I have a _plethora_?Registered User regular
    In a week or so the Visual Studio 11 preview will drop, and it's coming with c++ '11, I think. More info here, and a dev diary here.

  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Izzimach wrote: »
    Can anyone comment on using Node.js as a (simple) server for a typical client/server multiplayer game? The ability to use javascript on both client and server makes node.js pretty tempting, at least for quick prototyping, and I felt like trying a simple game to see how well (or badly) it works out. I'll probably just try to make a simple DOTA-style game to try it out. I did something similar in C# and having the same language in both client and server saved a lot of headaches IMHO.

    I would like to try making the client in-browser using an HTML5 canvas but from a practical POV I'm probably better off using Unity for the client. My main concerns at the moment are:

    1. What protocol should I use to send data around? For near-real-time gaming you typically use TCP or UDP sockets but doing that here sounds a little TOO low-level. Should I just use socket.io and call it a day?

    2. If server-side computation starts to get complex, then the node server will probably get cranky since it' all single threaded. At that point I should dump some work into another thread process, right? It seems like deferring computation to the next tick in Node.js is possible but not usually recommended.

    This is probably the ideal use case for Node.js.

    1. Yup.

    2. Yup. I think that's why many Node.js servers run on top of Nginx.

  • InfidelInfidel Heretic Registered User regular
    Izzimach wrote:
    Can anyone comment on using Node.js as a (simple) server for a typical client/server multiplayer game? The ability to use javascript on both client and server makes node.js pretty tempting, at least for quick prototyping, and I felt like trying a simple game to see how well (or badly) it works out. I'll probably just try to make a simple DOTA-style game to try it out. I did something similar in C# and having the same language in both client and server saved a lot of headaches IMHO.

    I would like to try making the client in-browser using an HTML5 canvas but from a practical POV I'm probably better off using Unity for the client. My main concerns at the moment are:

    1. What protocol should I use to send data around? For near-real-time gaming you typically use TCP or UDP sockets but doing that here sounds a little TOO low-level. Should I just use socket.io and call it a day?

    2. If server-side computation starts to get complex, then the node server will probably get cranky since it' all single threaded. At that point I should dump some work into another thread process, right? It seems like deferring computation to the next tick in Node.js is possible but not usually recommended.

    re: #2

    This isn't a problem, you'll want to wrap anything CPU-bound into a worker thread, which isn't all that bad and still gives you better performance (particularly in memory) than multi-threaded request handlers.

    See this and this.

    OrokosPA.png
  • CantidoCantido Registered User regular
    jQuery Mobile is so damn sweet. But I really should be learning jQuery first. My senior design project is all forms, forms forms....

    3DS Friendcode 5413-1311-3767
  • EtheaEthea Registered User regular
    The entire node.js concept doesn't thrill me as much as it seems other people are about it. I think some of it is that it looks exactly like signals / slots from Qt, and the majority of the work I do is heavily CPU/GPU bound.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    I'm not even sure what node.js is, but if I have gleaned correct information from the context...why on earth would you want to write anything complex and computation heavy like a MOBA backend in JavaScript?

    I mean, it looks like it's really just a model...couldn't you make it gobs more efficient with C++, or even a JIT'ed language like C#? Following the same basic model I mean.

    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
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    It's an event-based web server, so yes it's similar to other event-based systems.

    As for why write it in node.js... why not? If it's just an experimental/for fun project, he can get experience in a new language and different style of programming while walking familiar ground.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    I didn't mean Izzimach specifically, just in general. If the goal is to write a high throughput, production, event based network server...I'm not sure JavaScript is ever my first choice. I guess I'm questioning why node.js exists at all, and where there isn't a node.cs, or a node.cpp, which would seem like infinitely better implementation languages where efficiency and performance were a stated goal.

    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
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    As far as I know node.js does have crazy-good performance, at least compared to Apache and similar. The tradeoff is higher CPU and memory consumption, but that shit's cheap these days, right? :P

    I'm not a performance guy, though, so it's not in me to worry about that. I just like trying new technologies, especially lightweight frameworks and dynamic languages.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Yeah, I guess having worked in that space (high throughput network servers), it just seems an odd choice to me.

    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
  • VerboseVerbose That one guy over there. That guy. Registered User regular
    I'm wondering if I can get some help on what I imagine is extremely easy Java homework. If so I will post my question, I just don't want to come off as trying to get someone to do my work for me.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Yeah, that's kind of what this thread is here for Verbose. As long as it's just a question, and not like "hey, solve this homework for me", most of us are more than willing.

    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
  • VerboseVerbose That one guy over there. That guy. Registered User regular
    edited February 2012
    Okay so Idk what the rules are for posting links so I'm not going to post the link for the homework unless someone says it is okay.

    Basically this is the problem:

    We want to create a new Builder, NumBuilder, that converts digits to words, i.e. the string "1, 2, and 3." becomes "One, Two and Three." The string "10" becomes "OneZero". Most of the method is given to you, just fill in the append method. You may not use a loop construct ("for" or "while").

    NumBuilder.java
    1 public class NumBuilder extends Builder {
    2 StringBuffer sb = new StringBuffer();
    3 public void append(char c) {
    4 // What goes here?
    5 }
    6 public String toString() {
    7 return sb.toString();
    8 }
    9 public static void main(String[] args) {
    10 NumBuilder nb = new NumBuilder();
    11 nb.append("1, 2, and 3.");
    12 System.out.println(nb);
    13 nb.append("4 and 5");
    14 }
    15 }

    And the main thing I don't understand is what happens when you pass a string into a char, as with the append class there along with the main class that tests it.

    EDIT: To clarify something, this isn't the problem I am working on, but the one I am working on uses the code from this problem.
    This is the actual problem:
    The class java.io.OutputStream is an abstract class. Subclass and implement the abstract method to create a kind of output stream called a NumStream. Your NumStream class work in a similar fashion to the NumBuilder in problem set 1, converting digits to strings.

    NumStream.java
    1 import java.io.*;
    2 public class NumStream extends OutputStream {
    3 public void write(int c) throws IOException {
    4 // What goes here?
    5 }
    6
    7 public static void main(String[] args) {
    8 NumStream ns = new NumStream();
    9 PrintWriter pw = new PrintWriter(new OutputStreamWriter(ns));
    10 pw.println("123456789 and ! and # ");
    11 pw.flush(); // needed for anything to happen, try taking it out
    12 }
    13 }

    Verbose on
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    Uhhhh...unless Java has some crazy broken boxing shit, you can't pass a string to a function taking a char like that. Like, that shouldn't build.

    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
  • VerboseVerbose That one guy over there. That guy. Registered User regular
    edited February 2012
    Yeah see, that is why I am horribly confused at the moment.

    EDIT: Oh crap wait a sec. I just realized that the append method being called must be from the builder class:
    public abstract class Builder {
    2 // Appends just one character
    3 public abstract void append(char c);
    4
    5 // Force implementer to create a toString method.
    6 public abstract String toString();
    7
    8 // Makes use of the append(char) method
    9 // to append a whole string.
    10 public void append(String s) {
    11 for(int i=0;i<s.length();i++) {
    12 append(s.charAt(i));
    13 }
    14 }
    15
    16 // Makes use of the fact that all Objects
    17 // have a toString() method to format all
    18 // other objects.
    19 public void append(Object o) {
    20 if(o == null)
    21 append("null");
    22 else
    23 append(o.toString());
    24 }
    25 }

    This makes much more sense i think?

    Verbose on
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    I mean, the simplest thing is to have it take a char, because then it becomes very simple to do a switch:

    (Psuedo-code)
    function NumToString(char c) {
        switch(c) {
             case '1':
                 return "One";
             case '2':
                 return "Two";
    
             // Rest of case
        }
    }
    

    But the fact that you can't use looping constructs is stupid, because how else are you supposed to get the characters out of the string and pass them to the function one by one? There is nothing like LINQ's Select() or Aggregate() in Java that I am aware of, so I am completely unsure as to how they expect you to take an arbitrary string and parse it character by character without a loop.

    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
  • zeenyzeeny Registered User regular
    Can anyone comment on using Node.js as a (simple) server for a typical client/server multiplayer game?

    I think it's a bad, fun idea that you should try. I'm still not sold on node as an actual server, but it's a fun platform.

    Izzimach wrote: »
    1. What protocol should I use to send data around? For near-real-time gaming you typically use TCP or UDP sockets but doing that here sounds a little TOO low-level. Should I just use socket.io and call it a day?

    Socket.io will be fine.
    2. If server-side computation starts to get complex, then the node server will probably get cranky since it' all single threaded. At that point I should dump some work into another thread process, right? It seems like deferring computation to the next tick in Node.js is possible but not usually recommended.

    You will probably want to scale with cluster, but I have a mini headache in the back of my head just thinking of the possible socket.io/cluster issues.

    There is no reason not to go ahead with your project - it sounds fun and you will be learning a new platform, just don't go with an expectation of "Hey, this will all totally work as documented!". Simply not the case in node world from my limited experience so far;o)

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited February 2012
    Verbose wrote: »
    Yeah see, that is why I am horribly confused at the moment.

    EDIT: Oh crap wait a sec. I just realized that the append method being called must be from the builder class:
    public abstract class Builder {
    2 // Appends just one character
    3 public abstract void append(char c);
    4
    5 // Force implementer to create a toString method.
    6 public abstract String toString();
    7
    8 // Makes use of the append(char) method
    9 // to append a whole string.
    10 public void append(String s) {
    11 for(int i=0;i<s.length();i++) {
    12 append(s.charAt(i));
    13 }
    14 }
    15
    16 // Makes use of the fact that all Objects
    17 // have a toString() method to format all
    18 // other objects.
    19 public void append(Object o) {
    20 if(o == null)
    21 append("null");
    22 else
    23 append(o.toString());
    24 }
    25 }

    This makes much more sense i think?

    Yes, that makes more sense. So above for my pseudo-implementation of the abstract append function for NumBuilder.

    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
  • VerboseVerbose That one guy over there. That guy. Registered User regular
    edited February 2012
    I changed my mind. I understand nothing about the actual problem, being:
    The class java.io.OutputStream is an abstract class. Subclass and implement the abstract method to create a kind of output stream called a NumStream. Your NumStream class work in a similar fashion to the NumBuilder in problem set 1, converting digits to strings.

    NumStream.java
    1 import java.io.*;
    2 public class NumStream extends OutputStream {
    3 public void write(int c) throws IOException {
    4 // What goes here?
    5 }
    6
    7 public static void main(String[] args) {
    8 NumStream ns = new NumStream();
    9 PrintWriter pw = new PrintWriter(new OutputStreamWriter(ns));
    10 pw.println("123456789 and ! and # ");
    11 pw.flush(); // needed for anything to happen, try taking it out
    12 }
    13 }

    Does the pw.println somehow pass the input through the write method or something? Other wise I do not get how the write method applies to that main, given that the main our teacher has usually tests what we do...

    Verbose on
  • [Michael][Michael] Registered User regular
    Joe K wrote: »
    urahonky wrote: »
    Ethea wrote: »
    urahonky wrote: »
    bowen wrote: »
    That is ridiculous, why?

    Everyone is getting these desks that our manager is buying from IKEA. Supervisors/Managers get the desks I'm in right now.

    Your workplace changes would make me want to get a new job if they happened to me.

    Yeah... But I have 0 experience so I'd like to stay for at least a year. Right now I'm going to grin and bear it. I do like the place, but it's just small stuff like this is what is annoying. Otherwise they're a really cool bunch of people.

    ...

    Wal-Mart is weird.


    I worked at the Wal-Mart home offices in Bentonville two summers in a row as a temp. I never saw signs about what to do in a hostage situation or vendor samples for furniture, and there's definitely no "fairly mandatory church services." Not that they aren't all super conservative. I literally never saw anything on the TVs in break rooms and lobbies but Fox News.

    But the rest is true. Their corporate culture is just...weird. Kind of soul-crushing. Like every day I worked, I maybe died a little inside. And on days we did the cheer, it was way more than just a little.

    When I was looking for computer science-y internships, I didn't even bother looking there despite having previous work experience and good references from Wal-Mart employees/managers. Luckily there's plenty of demand for IT in northwest Arkansas aside from Wal-Mart.

This discussion has been closed.