Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-21-2014 , 06:49 AM
Quote:
Originally Posted by Xhad
my favorite part about that code is that it shadows sum, yet the way it calls sum is incorrect for both the builtin and the custom version

Lol. My favorite part is that at the end it just adds up the four values in the print statement instead of using sum.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 08:21 AM
Dev at worked shared this yesterday, it's probably even more awesome of you are more familiar with the language... https://gist.github.com/aras-p/6224951
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 10:21 AM
Can anyone help? I'm trying to install a newer version of Stripe.net. I need it fairly urgently as we've started accepting other currencies I need to make use of the balance transfer API so I can complete my VAT return:
https://github.com/jaymedavis/stripe.net

I do install-package Stripe via nuget, and it builds the DLL.

I create a new project, and add a reference to this built DLL in the project. Then with the code:

Code:
using System;
using Stripe;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var planService = new StripePlanService("test");    
    }
}
It can't find the namesapce 'StripePlanService'. What am I doing wrong? :S
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 10:44 AM
Edit: nm solved, doesn't work doing it myself but installing via package manager inside VS itself seems to work fine.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 11:32 AM
Quote:
Originally Posted by kerowo
Dev at worked shared this yesterday, it's probably even more awesome of you are more familiar with the language... https://gist.github.com/aras-p/6224951
diabolical
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 01:17 PM
so something i do to learn is try and break something i dont understand into the smallest piece i do understand, entirely, as far as functions.

i tried doing this with pythons random library, because i was interested in knowing how they generated pseudo randoms because it's a subject of interest to me.

being very not well versed in anything, and still a beginner in python, this is probably a recipe for distaster. at any rate i did it anyway.

so in the random.py script, the first thing they import is:

Code:
from __future__ import division
ok neat, i have no idea what __future__ is, but it is presumably a library. and it presumably has a function for how python performs division. that is exciting.

i then went to __future__.py and found the following definition for division:

Code:
division = _Feature((2, 2, 0, "alpha", 2),
                    (3, 0, 0, "alpha", 0),
                    CO_FUTURE_DIVISION)
where the _Feature class is:

Code:
class _Feature:
    def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
        self.optional = optionalRelease
        self.mandatory = mandatoryRelease
        self.compiler_flag = compiler_flag
and the CO_FUTURE_DIVISION appears to apply some sort of abstract sequence as follows to that variable:

Code:
CO_FUTURE_DIVISION   = 0x2000   # division
is this 0x2000 sequence a different language for something? is it the actual language python is using to communicate with the cpu itself?

thanks and sorry for the beginner questions, am i better served asking these on stackoverflow? i tried searching for them but i couldnt really get a good idea of how to look at the python standard library from a noobies perspective.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 02:03 PM
Quote:
Originally Posted by KatoKrazy
I love my MacBook Pro but not being able to F2 for rename or at least right click is so tilting.
Which reminds me...no F5 for refresh

In Twitter news my script has been running for 2 days now and still collects tweets (search api, filtered for a single search term, 15 minute timeouts).

Quote:
Originally Posted by jjshabado
This doesn't seem broken, imo. If you sell a laptop (or give it to a new person) you should wipe your user and the new person creates a new one.
Fair enough but I'd still like to sell software.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 02:08 PM
The __future__ thing isn't really a library though it's mostly called like one. from __future__ import division tells python 2 scripts to use python 3 division (they changed how integer division behaves by default between versions)

The 0x2000 thing is a number written in hexadecimal, equivalent to 8192. It appears to be just some arbitrary constant. It's being passed as compiler_flag so presumably it means something to the Python interpreter (whose meaning might not make sense without digging into the C source)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 02:09 PM
Quote:
Originally Posted by kerowo
Dev at worked shared this yesterday, it's probably even more awesome of you are more familiar with the language... https://gist.github.com/aras-p/6224951


You can do a lot of diabolival stuff with R, too. Like redefine the behaviour of "(" or ")" and actually make said misbehaviour random :P
Might never be caught (since a ton/most R users aren't programmers and mostly consumers that hack up some stuff) and destroy a bunch of scientific work.

@mburke: not related to the specific Python question but rather to the "RNG are interesting". You probably want to read this (well some other source, the wiki article isn't particularly enlightening imo):
http://en.wikipedia.org/wiki/Lehmer_...mber_generator

Lehmer generators fascinated me quite a bit the first time I heard about them.

Last edited by clowntable; 10-21-2014 at 02:15 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-21-2014 , 10:24 PM
One of the more upsetting things I learned was how RNGs work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2014 , 01:37 AM
Take it one else around here is excited about emacs 24.4?

The first thing I did was M-x eww, which brings up the built-in web browser. I mistyped "google.com" and got this:



This forum was completely unusable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2014 , 10:17 AM
Quote:
Originally Posted by Barrin6
Great python I learned today from my professor!

Code:
def main():
  #2nd step take user input
  blue = int(input("How many blue markers do you have?: "))
  red = int(input("How many red markers do you have?: "))
  green = int(input("How many green markers do you have?: "))
  black = int(input("How many black markers do you have?: "))

  blue = sum(blue)
  red = sum(red)
  green = sum(green)
  black = sum(black)

  #step 6, print and invoke
  print("You have %d blue marker" % blue)
  print("You have %d red marker" % red)
  print("You have %d green marker" % green)
  print("You have %d black marker" % black)
  print("You have a total of %d markers!" % (blue + red + green + black))


#step 3 declare a function to sum
def sum(blue,red,green,black):
  total = blue + red + green + black
  #step 4: return value
  return total

main()
beautiful code to create that
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2014 , 10:59 AM
What is the use case for redefining what ( does?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2014 , 01:37 PM
How did I not hear of this earlier?
https://www.indiegogo.com/projects/p...build-yourself

Instaordered one without the Pi because I hope they get to the Beagle support level and I can roll with that. I don't know if I'll use it for much but it seems pretty damn awesome
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 12:55 AM
Bet it can't beat the specs on a Macbook Pro.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 01:32 AM
If I didn't have my macbook pro already, I would of bought that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 02:11 AM
Found this article by DHH today. Thought it was pretty interesting:

The other side of version-less software
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 04:53 AM
Quote:
Originally Posted by kerowo
What is the use case for redefining what ( does?
Professor used to do wizard stuff like that in C++ for a class I ended up failing.
Its beautiful code but I'll never write it LOL.

Everyone is so cute above by jumping to conclusions.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 05:31 AM
Quote:
Originally Posted by iosys
Professor used to do wizard stuff like that in C++ for a class I ended up failing.
Its beautiful code but I'll never write it LOL.

Everyone is so cute above by jumping to conclusions.
That's what's built into our DNA, mate.

Spoiler:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 07:35 PM
Do you all just have ****ty credit or what's the deal? Free financing for 12-18 months makes a MacBook really affordable.

Also, now that goofy is no longer a video game maker, perhaps he will. E less tight lipped about what he did?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 09:00 PM
Quote:
Originally Posted by Anais
Do you all just have ****ty credit or what's the deal?
Yeah, I have ****ty credit. Took exactly one hospital bill.

$2,000 can buy me a jalopy.

I'm pretty sure buying a Mac won't make me a better person, programmer, whatever.

The less money I give to Apple, the less incentive they have to open lawsuits against small polish grocers.

I definitely don't hate on Apple products nor those that use them. The company stands for many things I don't believe in, thus I won't buy Apple even if I was a millionaire with A+ credit.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 09:03 PM
Holy ****, my Theory of Algorithms test today was ridiculously hard. I can't remember ever walking out of any test thinking I did worse than this one. Then had to go and take another test 20 minutes later that I probably bombed because my brain was fried after the first test.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 09:49 PM
Quote:
Originally Posted by clowntable
How did I not hear of this earlier?
https://www.indiegogo.com/projects/p...build-yourself

Instaordered one without the Pi because I hope they get to the Beagle support level and I can roll with that. I don't know if I'll use it for much but it seems pretty damn awesome
So I guess you have to populate the breadboard with the components that are included. Interesting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2014 , 09:59 PM
Anyone become/pick up a scrummaster role? Good idea/bad idea? I have no designs on becoming mgmt at any time in near future but will probably change jobs in 4-16 months.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2014 , 12:25 AM
Quote:
Originally Posted by KatoKrazy
Holy ****, my Theory of Algorithms test today was ridiculously hard. I can't remember ever walking out of any test thinking I did worse than this one. Then had to go and take another test 20 minutes later that I probably bombed because my brain was fried after the first test.
You got a job now, so you're free to slack. j/k

You're not the first here to say Algorithms and Data Structures can be pretty rough. I'd like to see how well I'd do on a test like this. As long as they don't ask for heapsort*, I'll be fine.

*... and pretty much everything else, lol(?).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m