Open Side Menu Go to the Top

06-07-2015 , 10:55 AM
Also, chrome.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-07-2015 , 03:32 PM
This past Tuesday, I was in a server room.

It was awesome.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 03:50 PM
I love server rooms. Go in them several times a week. They're so chilly and white noise-y. Would love to nap there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 03:58 PM
Server rooms make you sterile.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 04:49 PM
Thank god! The operation is so expensive!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 04:52 PM
Quote:
Originally Posted by Low Key
Dunno about safari, but chrome and Firefox have tab managers. Just set up The Great Suspender on chrome and it works really well. All tabs suspended until they are the focus, which they then auto-reload. To suspended if not viewed for 5-120 minutes
Safari is actually similar and does the same.
Idk sort of wanting something similar to if I were to open a vm, open a bunch of tabs and then suspend the vm. When I reopen the vm all the tabs will still be there and I'm sort of wishing there was a cache state or something of that sort.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 07:10 PM
Quote:
Originally Posted by kerowo
Server rooms make you sterile.
Just because IT folks don't have kids doesn't meant they're sterile.

Spoiler:
Bazinga!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2015 , 07:12 PM
Yeah, it means they're intelligent.

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 01:49 AM
Quote:
Originally Posted by kerowo
Server rooms make you sterile.
Quote:
Originally Posted by Low Key
Thank god! The operation is so expensive!
When I learned cell phones in your pocket made you sterile, I bought an extra one to make sure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 06:02 AM
Super basic Python question, as I am a noob.

I want to mess around with some basic Starcraft replay analysis, and there's a library to do so on Github here. However, I have no idea how to use it. I've installed it, and have this for a script so far:

Code:
import sc2reader

def main():
  replay = sc2reader.load_replay('testrep.SC2Replay', load_level=4)
  for event in replay.events:
    print '{0} => {1}'.format(event.pid,event.name)

main()
which was stolen from their documentation. It doesn't even work, really:

Code:
D:\dev\sc2reader\examples>reptest.py
0 => PlayerSetupEvent
1 => PlayerSetupEvent
2 => PlayerSetupEvent
15 => PlayerSetupEvent
1 => UpgradeCompleteEvent
1 => UpgradeCompleteEvent
1 => UpgradeCompleteEvent
2 => UpgradeCompleteEvent
2 => UpgradeCompleteEvent
2 => UpgradeCompleteEvent
2 => UpgradeCompleteEvent
2 => UpgradeCompleteEvent
Traceback (most recent call last):
  File "D:\dev\sc2reader\examples\reptest.py", line 15, in <module>
    main()
  File "D:\dev\sc2reader\examples\reptest.py", line 13, in main
    print '{0} => {1}'.format(event.pid,event.name)
AttributeError: 'UnitBornEvent' object has no attribute 'pid'
I guess this is part of Python's charming "hey, do whatever the **** you want" attitude with types combined with out of date documentation for a third party library?

But anyway, my biggest problem here is: what IS the API? Where are these structs defined and how can I see what's inside them when no documentation to describe them exists?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 06:21 AM
The events are here: https://github.com/GraylinKim/sc2rea...2reader/events

The one causing you a problem is on tracker.py. These events don't have a pid, which seems to be the problem.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 06:55 AM
That project does look a little dead. I'm also surprised it doesn't let you know which version of SC2 it's compatible with. I only glanced the docs so maybe I missed it.

I would say lack luster documentation and dead projects isn't specific to Python but specific to the open source community in general. You're going to find garbage in every language, but you'll find a lot of good stuff too.

At least this guy made an effort to document the source. Maybe you can submit a pull request and fix the issue. I would also make an attempt to find older replays (in the 2013 era when the last release was for that script) and see if they work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 07:16 AM
Give the data folder (https://github.com/GraylinKim/sc2rea...sc2reader/data) it looks like it's both HotS and WoL.

Agreed about the lack of documentation being a general problem. But I look at it as undocumented open source is still better than some guy keeping his personal project to himself.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 07:18 AM
Goofy, looking at your script it looks like what they have in their documentation works fine. It's just your assumption that every event has a pid that seems to be broken.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 07:22 AM
Ah true, it's a user error.

UnitBornEvent has 2 types of pids, I guess that's why it's not just called "pid":
https://github.com/GraylinKim/sc2rea...r.py#L266-L269

The author made an effort to give human readable strings when outputting the instance of the class. You could probably get away with just printing "event" if you're fishing around for general info about the event.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 08:40 AM
So, I've been slacking off extremely recently in my endeavour to learn Python, which sucks. However I've just come across something interesting.

I watched Ex Machina, a movie dealing with questions about AI and consciousness, and I found a Python easter egg in it.

In one scene, the protagonist is seen typing a script into a computer, which I immediately recognised as Python code, even though I couldn't fully understand what it does.

Curious as I am, I typed it into a script of my own and ran it.

Code:
import sys

def sieve(n):
    x = [1] * n
    x[1] = 0
    for i in range(2,n/2):
            j = 2 * i
            while j < n:
                    x[j] = 0
                    j = j+i
    return x
    
def prime(n,x):
    i = 1
    j = 1
    while j <= n:
            if x[i] == 1:
                    j = j + 1
            i = i + 1
    return i - 1

x=sieve(10000)

code = [1206,301,384,5]
key = [1,1,2,2,]

sys.stdout.write("".join(chr(i) for i in [73,83,66,78,32,61,32]))

for i in range (0,4):
    sys.stdout.write(str(prime(code[i],x)-key[i]))

print
The script puts out an ISBN number (ISBN = 9780199226559), which is the ISBN of the book:

Embodiment and the inner life
Cognition and Consciousness in the Space of Possible Minds


I thought that was a pretty neat easter egg, and if nothing else, it reinvigourated my drive to learn coding.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 08:48 AM
Hah, that is pretty cool.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 09:43 AM
Wow, that's awesome. Good movie.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 10:31 AM
Quote:
Originally Posted by Sugar Nut

The script puts out an ISBN number (ISBN = 9780199226559), which is the ISBN of the book:

Embodiment and the inner life
Cognition and Consciousness in the Space of Possible Minds


I thought that was a pretty neat easter egg, and if nothing else, it reinvigourated my drive to learn coding.
Very nice. I remember remarking after the movie that they must have not spent much on their technical consultant, since the "code" on the screen was just calculating prime numbers. I wrote it off as a small oversight in an otherwise great movie. This redeems it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 12:20 PM
Dear Netflix,
Pull some strings so that movie is available on instant watch by no later than 10:42pm EST. Thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 12:35 PM
Yeah the ISBN code was discussed on HN as well iirc. It's pretty cool.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 12:55 PM
Quote:
Originally Posted by jjshabado
Goofy, looking at your script it looks like what they have in their documentation works fine. It's just your assumption that every event has a pid that seems to be broken.
The "loop over events and print event pid, name, and timestamp" (timestamp was also broken) example came from their documentation.

Thanks for the help, that should help me get started.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 02:18 PM
Well the hot Tinder recruiter finally got back to me.

If I make it to the offer stage - I think there's a reasonable chance they'll come in with something less than I am making now, but obviously I'm going to hope to make it up in equity. It seems odd to me that Tinder only has 60 employees, as popular as the app is. I wonder if it's because there's no precedent for a dating app turning into something bigger. Like say Uber wants to be much more than a ridehsare. Snapchat wants to be much more than a teen app, etc.

Does anyone here have any thoughts on Tinder's prospects? I don't have kids so I can definitely take on plenty of risk. But if the workplace environment seems kinda dotcom/kool-aid/mysoginist/etc. then I would only go there if I think that being the 65th employee at Tinder has a chance to make a bundle on options.

I'm going to post in BFI too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 02:19 PM
Anyone watching WWDC? Apple just announced that they will open source Swift and it's coming to Linux!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2015 , 02:29 PM
suzzer, you're never going to impregnate & marry recruiter girl if you don't take a job there
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m