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

[Programming] Reinventing equality, one language at a time

16263656768100

Posts

  • Options
    DehumanizedDehumanized Registered User regular
    i use both of those properties of that webhook to mirror chat between a game and a developer/admin slack, it's great

  • Options
    halkunhalkun Registered User regular
    Yay! Not only do I have the Beta done, but I can do a one-click deployment. All I have to do is select either Debug, Demo, or Release in my Solution Configuration in Visual Studio and build the solution. Based on what I selected it will change all the build variables and build the version I want. The Demo version is pretty snazzy because it automatically sets #defines so that you can't save in the Demo release, changes the "about" window, and the WiX installer will only add the demo mission files.

    I'm sure this is how it's supposed to work and I'm all excited over nothing. Still neato-burrito to me.

    If anyone wants a copy of the demo beta... I have it available. :D

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    edited July 2018
    Hey @Aioua or other powershell nerds, what's the equivalent to xargs in PS? I want to do "foo | xargs bar" but in PS.

    edit: should have LMFGTFY'd.
    foo | %{&bar $_}
    

    ...which looks kind of hideous.

    Echo on
  • Options
    AiouaAioua Ora Occidens Ora OptimaRegistered User regular
    edited July 2018
    Echo wrote: »
    Hey @Aioua or other powershell nerds, what's the equivalent to xargs in PS? I want to do "foo | xargs bar" but in PS.

    edit: should have LMFGTFY'd.
    foo | %{&bar $_}
    

    ...which looks kind of hideous.

    Well that's kind of a hacky way so it looks like xargs. I've never been a fan of the % alias because it explains nothing. (funnily enough, I didn't know what xargs did so the original code was no more enlightening)

    and the ampersand isn't necessarily necessary, depends on what your bar command is.

    What I would write would be more like:
    Foo-Cmdlet | ForEach-Object {
       Bar-Cmdlet -ArgName $_
    }
    
    And least there there's only one mysterious symbol so you can guess that it's the current thing in the loop. Or if foo was more complicated I'd probably:
    $fooResult = Foo-Cmdlet -Argument "value" -OtherArg "value"
    $fooResult | ForEach-Object {
       Bar-Cmdlet -ArgName $_
    }
    

    Aioua on
    life's a game that you're bound to lose / like using a hammer to pound in screws
    fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
    that's right we're on a fucked up cruise / God is dead but at least we have booze
    bad things happen, no one knows why / the sun burns out and everyone dies
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    edited July 2018
    Yeah, I tossed that into a function in my profile. It's for linting Go files, but golint defaults to including the vendor dir, which is butts, and I don't want butts.

    "go list" lists packages and excludes vendor dir, so I thought I'd pipe that to golint instead:
    function Go-Lint {
        go list ./... | ForEach-Object {golint $_}
    }
    

    Hit a little problem though. When I run "go list" directly, it gives me paths to project packages relative to my GOPATH:
    λ  go list ./...
    echocorp/go/warren
    echocorp/go/warren/example
    echocorp/go/warren/mocks
    echocorp/go/warren/prometheus
    echocorp/go/warren/stubs
    

    And running golint straight in that repo:
    λ  golint ./...
    sender.go:14:6: exported type Sender should have comment or be unexported
    

    But running the PS'd command gives me full paths:
    λ  go list ./... | ForEach-Object {golint $_}
    C:\Dev\Projects\Go\src\echocorp\go\warren\sender.go:14:6: exported type Sender should have comment or be unexported
    

    Small thing, but a bit annoying. Not sure what PS thinks the CWD is when running the command.

    Echo on
  • Options
    bowenbowen How you doin'? Registered User regular
    Ah I missed PS, said no one ever.

    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
    AiouaAioua Ora Occidens Ora OptimaRegistered User regular
    edited July 2018
    bowen wrote: »
    Ah I missed PS, said no one ever.

    I was missing powershell just yesterday as I was working with python!

    Aioua on
    life's a game that you're bound to lose / like using a hammer to pound in screws
    fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
    that's right we're on a fucked up cruise / God is dead but at least we have booze
    bad things happen, no one knows why / the sun burns out and everyone dies
  • Options
    AiouaAioua Ora Occidens Ora OptimaRegistered User regular
    edited July 2018
    Echo wrote: »
    Yeah, I tossed that into a function in my profile. It's for linting Go files, but golint defaults to including the vendor dir, which is butts, and I don't want butts.

    "go list" lists packages and excludes vendor dir, so I thought I'd pipe that to golint instead:
    function Go-Lint {
        go list ./... | ForEach-Object {golint $_}
    }
    

    Hit a little problem though. When I run "go list" directly, it gives me paths to project packages relative to my GOPATH:
    λ  go list ./...
    echocorp/go/warren
    echocorp/go/warren/example
    echocorp/go/warren/mocks
    echocorp/go/warren/prometheus
    echocorp/go/warren/stubs
    

    And running golint straight in that repo:
    λ  golint ./...
    sender.go:14:6: exported type Sender should have comment or be unexported
    

    But running the PS'd command gives me full paths:
    λ  go list ./... | ForEach-Object {golint $_}
    C:\Dev\Projects\Go\src\echocorp\go\warren\sender.go:14:6: exported type Sender should have comment or be unexported
    

    Small thing, but a bit annoying. Not sure what PS thinks the CWD is when running the command.

    Hmm. I don't know anything about go so I can't help you there. CWD is easy enough to temporarily change in powershell if it comes to it?

    Aioua on
    life's a game that you're bound to lose / like using a hammer to pound in screws
    fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
    that's right we're on a fucked up cruise / God is dead but at least we have booze
    bad things happen, no one knows why / the sun burns out and everyone dies
  • Options
    bowenbowen How you doin'? Registered User regular
    Aioua wrote: »
    bowen wrote: »
    Ah I missed PS, said no one ever.

    I was missing powershell just yesterday as I was working with python!

    This collection of words makes no sense!

    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
    AiouaAioua Ora Occidens Ora OptimaRegistered User regular
    bowen wrote: »
    Aioua wrote: »
    bowen wrote: »
    Ah I missed PS, said no one ever.

    I was missing powershell just yesterday as I was working with python!

    This collection of words makes no sense!

    programmers just don't understand

    life's a game that you're bound to lose / like using a hammer to pound in screws
    fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
    that's right we're on a fucked up cruise / God is dead but at least we have booze
    bad things happen, no one knows why / the sun burns out and everyone dies
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    Is there a good regex tutorial for beginners? My wife is picking it up, and I'm honestly not sure I can evaluate a tutorial from the perspective of a beginner.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    templewulf wrote: »
    Is there a good regex tutorial for beginners? My wife is picking it up, and I'm honestly not sure I can evaluate a tutorial from the perspective of a beginner.

    Not a tutorial, but https://regex101.com/ is great for testing stuff.

  • Options
    SpawnbrokerSpawnbroker Registered User regular
    Regular expressions were probably 50% of the focus of my compilers class in college. It's pretty advanced stuff.

    If you have access to Pluralsight, there are some great fundamentals courses on there for just about anything. Here's the one I'd recommend: https://www.pluralsight.com/courses/regular-expressions-fundamentals

    Steam: Spawnbroker
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    regex101 is good at explaining what is going on in a regex though.

    ljattvwjomvd.png

  • Options
    LD50LD50 Registered User regular
  • Options
    CarpyCarpy Registered User regular
    edited July 2018
    Are there any java logging libraries that aren't crap? Our initial log4j setup was implemented all weird plus log4j doesn't ( or maybe didn't) handle parameterized strings so our code had to be littered with:
    if(logger.isDebug()){
       logger.debug("msg" + msg)
    }
    

    We moved to slf4j running on top of logback and now we're running into the issue where every instance of a logger context opens a file handle to every single log file defined in the xml, which completely fucks up rolling logs. You can't share appenders across loggers, and you have to assign each appender to a specific logger, so why the hell is it blindly opening file handles. It seems like the answer to this problem is to have unique logback.xml for every process I launch which I find really dumb.

    Java :rotate:

    Carpy on
  • Options
    hippofanthippofant ティンク Registered User regular
    Carpy wrote: »
    Are there any java logging libraries that aren't crap? Our initial log4j setup was implemented all weird plus log4j doesn't ( or maybe didn't) handle parameterized strings so our code had to be littered with:
    if(logger.isDebug()){
       logger.debug("msg" + msg)
    }
    

    We moved to slf4j running on top of logback and now we're running into the issue where every instance of a logger context opens a file handle to every single log file defined in the xml, which completely fucks up rolling logs. You can't share appenders across loggers, and you have to assign each appender to a specific logger, so why the hell is it blindly opening file handles. It seems like the answer to this problem is to have unique logback.xml for every process I launch which I find really dumb.

    Java :rotate:

    Wouldn't some package-protected helper methods basically make all those problems go away? Arguably you shouldn't have to build those on top of a logger library, but... I look at that code snippet you posted, and that could have just been stuck in a helper method and then replaced with a single call to that helper method.

  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    I can't speak to using this version of it, but there's a Java rewrite of Serilog, which is far and away (IMO) the best .Net logging framework.

    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
    electricitylikesmeelectricitylikesme Registered User regular
    templewulf wrote: »
    Is there a good regex tutorial for beginners? My wife is picking it up, and I'm honestly not sure I can evaluate a tutorial from the perspective of a beginner.

    http://www.gskinner.com/RegExr/ is excellent for developing regex's.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Oh god I have all the devops to do. I'm suddenly neck deep in "make microservices not suck land" but best I can tell no one's really tackled that in an off-the-shelf way.

    Need any pointers? This is pretty much my job.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Getting good stuff from Prometheus alerts already. A service hit the RAM cap and asploded. Now we get Docker container metrics for individual services with cAdvisor, way better than what we had before.

    dh739agam9ox.png

  • Options
    LD50LD50 Registered User regular
    Echo wrote: »
    Getting good stuff from Prometheus alerts already. A service hit the RAM cap and asploded. Now we get Docker container metrics for individual services with cAdvisor, way better than what we had before.

    dh739agam9ox.png

    That was... abrupt. What the hell happened to that service?

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    No idea, we'll investigate when it's not-weekend. Checked the logs real quick so at least we have something more to go on.

    That's one of the services that usually doesn't need a whole lot of memory but certain outliers in the jobs it gets can lead to some intensive stuff. Might be we just bump the RAM limit on it.

  • Options
    electricitylikesmeelectricitylikesme Registered User regular
    Echo wrote: »
    Oh god I have all the devops to do. I'm suddenly neck deep in "make microservices not suck land" but best I can tell no one's really tackled that in an off-the-shelf way.

    Need any pointers? This is pretty much my job.

    At the moment I think I'm just engaged in the usual game of "yes, I need full admin access to pretty much everything that's what you hired me for".

    I'm also currently threading the needle with the developers of "I will tell you how to work" while stressing that I am also on their side.

  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    So, LinkedIn. Should I be keeping it updated or can/should I ignore it? And what on there is important vs. what is just them fishing for more information?

  • Options
    dporowskidporowski Registered User regular
    Orca wrote: »
    So, LinkedIn. Should I be keeping it updated or can/should I ignore it? And what on there is important vs. what is just them fishing for more information?

    Most people only REALLY update it if they're looking. Keeping it semi-current with at least your position isn't a bad idea, but if you spend a lot of time on it that's generally seen as the "job hunting" batsignal.

  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    edited July 2018
    dporowski wrote: »
    Orca wrote: »
    So, LinkedIn. Should I be keeping it updated or can/should I ignore it? And what on there is important vs. what is just them fishing for more information?

    Most people only REALLY update it if they're looking. Keeping it semi-current with at least your position isn't a bad idea, but if you spend a lot of time on it that's generally seen as the "job hunting" batsignal.

    Hah. I deliberately didn't update it while job-hunting to avoid that bat-signal (to co-workers) since I had ignored it for years.

    Orca on
  • Options
    electricitylikesmeelectricitylikesme Registered User regular
    God damn Oauth 2.

    The most annoying thing about all the documentation is it's like "okay so we're going to assume you're making a web-application..." and it's just no! Obviously not! I'm a sysadmin who wants to write scripts, how do I do that?

  • Options
    AngelHedgieAngelHedgie Registered User regular
    Me: I have deployed your endpoint into the test environments you requested, with the exception of the one environment we do not have.

    Client: Thanks, but can you also get that environment deployed as well?

    Me: No, I cannot, because we do not have that environment. I can set one of the other endpoints to point to it, if you want to verify that endpoint works.

    Client: Can you please set up the missing environment? Also, can you reconfigure the URIs you are using?

    Me (while screaming silently): No, I cannot, because a) we do not have that environment and b) the URI is defined by the cluster the application is running on.

    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
  • Options
    djmitchelladjmitchella Registered User regular
    via some discussion of how to optimise a renderer:
    Years ago while interning in the rendering group at Pixar, I learned an important lesson: “interesting” things almost always come to light when a software system is given input with significantly different characteristics than it’s seen before. Even for well-written and mature software systems, new types of input almost always expose heretofore unknown shortcomings in the existing implementation.

    I first learned this lesson while Toy Story 2 was in production. At some point, someone noticed that a surprising amount of time was being spent parsing the RIB scene description files. Someone else in the rendering group (I believe it was Craig Kolb) whipped out the profiler and started digging in.

    It turned out that most of the parsing time was spent doing lookups in a hash table that was used to intern strings. The hash table was a small fixed size, perhaps 256 elements, and it used chaining when multiple values hashed to the same cell. Much time had passed since the hash table was first implemented and scenes now had tens of thousands of objects, so naturally such a small hash table would quickly fill and become ineffective.

    The expedient thing to do was to just make the hash table larger—all this was happening in the thick of production, so there was no time to do something fancy like make the hash table grow as it filled up. One line change, rebuild and do a quick test before committing, and… no performance improvement whatsoever. Just as much time was being spent on hash table lookups. Fascinating!

    Upon further digging, it was discovered that the hash function that was being used was the equivalent of:

    int hash(const char *str) {
    return str[0];
    }
    (Forgive me Pixar, if I’ve posted super-secret RenderMan source code there.)

    The “hash” function had been implemented in the 1980s, at which time someone had apparently decided that the computational expense of actually incorporating some contribution from all of the characters in the string in the hash value wasn’t worth it. (And if you’ve only got a handful of objects in the scene and a 256 entry hash table, maybe, I guess.)

    Another historic implementation detail added insult to injury: once Pixar started making movies, the names for objects in scenes had grown fairly long, along the lines of “BuzzLightyear/LeftArm/Hand/IndexFinger/Knuckle2”. However, some earlier phase of the production pipeline used a fixed-size buffer for storing object names and would shorten any longer names, keeping only the end and helpfully adding a few periods to show that something had been lost: “…year/LeftArm/Hand/IndexFinger/Knuckle2”.

    Thence, all of the object names the renderer saw were of that form, the hash function hashed all of them to the bucket for ‘.’, and the hash table was actually a big linked list. Good times.

  • Options
    ElaroElaro Apologetic Registered User regular
    templewulf wrote: »
    Is there a good regex tutorial for beginners? My wife is picking it up, and I'm honestly not sure I can evaluate a tutorial from the perspective of a beginner.

    I strongly suggest she learn the fundamentals of regular expressions (meaning the definition of a finite automaton and how they relate to regular languages). I could recommend a book, but it's kinda expensive.

    Children's rights are human rights.
  • Options
    Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited July 2018
    Hey friendly people, long time no post.

    Uh, so I feel like 1) The only acceptable GUI API in this day and age is HTML+CSS+JS, and 2) my Javascript-fu is inadequate given point 1.

    I would like some recommendations on good Javascript and/or Typescript learning resources. I did read "Javascript The Good Parts" maybe five years ago, but I've forgotten most of it. Also from what I understand Javascript has changed a lot lately. Lambda syntax? Yes please!

    I will say that if it says "node" or "npm" anywhere, I won't use it. I'm want to learn Javascript for browsers specifically. I'm totally good on server-side languages, thanks.

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Hey friendly people, long time no post.

    Uh, so I feel like 1) The only acceptable GUI API in this day and age is HTML+CSS+JS, and 2) my Javascript-fu is inadequate given point 1.

    I would like some recommendations on good Javascript and/or Typescript learning resources. I did read "Javascript The Good Parts" maybe five years ago, but I've forgotten most of it. Also from what I understand Javascript has changed a lot lately. Lambda syntax? Yes please!

    I will say that if it says "node" or "npm" anywhere, I won't use it. I'm want to learn Javascript for browsers specifically. I'm totally good on server-side languages, thanks.

    Well the good news is that npm is vital for client-side development as well so you can toss out that restriction!

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    *uses only available Go library for a particular third-party service*

    99 race conditions on the wall...

  • Options
    zeenyzeeny Registered User regular
    edited July 2018
    Elaborate? Not thread-safe is a ruby gems thing, really not a golang packages issue.

    zeeny on
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    It's just rather shoddily written, not using mutexes where they should be, starting a job before a job handler is registered leading to occasional situations where the job finishes before the handler is registered, and generally annoying stuff.

  • Options
    zeenyzeeny Registered User regular
    ...BUT IT'S FREEEEEEEEEEEEE......

  • Options
    bowenbowen How you doin'? Registered User regular
    Hey friendly people, long time no post.

    Uh, so I feel like 1) The only acceptable GUI API in this day and age is HTML+CSS+JS, and 2) my Javascript-fu is inadequate given point 1.

    I would like some recommendations on good Javascript and/or Typescript learning resources. I did read "Javascript The Good Parts" maybe five years ago, but I've forgotten most of it. Also from what I understand Javascript has changed a lot lately. Lambda syntax? Yes please!

    I will say that if it says "node" or "npm" anywhere, I won't use it. I'm want to learn Javascript for browsers specifically. I'm totally good on server-side languages, thanks.

    All GUI systems have their places though, so pick things that make sense. Do you want something that's accessible from all devices? HTML+JS is the clear winner there, but comes at the pitfall of needing hosting.

    If it's just something you want to run locally that may or may not be the best choice still.

    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
    AngelHedgieAngelHedgie Registered User regular
    zeeny wrote: »
    ...BUT IT'S FREEEEEEEEEEEEE......

    You get what you pay for.

    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
  • Options
    TelMarineTelMarine Registered User regular
    So yesterday it became official that I was laid off from my job after nearly 8 years. I actually got tipped off about it last week, so I had a lot of time to accept reality when the official hammer hit. It was the first job I ever had, so it's been a pretty interesting experience. It was a big layoff, apparently 15% worldwide (although I also heard as much as 30%). I've already got a first draft of an updated resume, going to be finishing that up soon. I plan to take a couple weeks or so off too. The package I got is pretty good. Adding all the severance and unused vacation, I'll be getting 5 months. I feel like the job market for developers is pretty damn good at the moment (especially where I am, Bay Area) so I'm not too worried about it, just weird that I have to do it involuntarily, haha.

    3ds: 4983-4935-4575
This discussion has been closed.