Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Any Python coders?

Name: Anonymous 2013-02-26 16:32

I need help.
How do I write a function that would add exponents? As in:

Lets say I made the function named sum_of_exponents(base, exp):
and I decided to print sum_of_exponents(13, 10) it would do the following:
13**0 + 13**1 + 13**2 + 13**3 ... + 13**10?

Name: Anonymous 2013-02-26 16:45

Go suck off a nigger, get AIDS and die.

Name: Anonymous 2013-02-26 16:47

This isn't difficult, nor is it limited to Python.
Start off writing it such that it just sums all the numbers from 0 to exp.

Name: Anonymous 2013-02-26 16:51

Kill yourself.

Name: Anonymous 2013-02-26 16:56

def crash():
        '''\
        print sum_of_exponents(13, 10)
        '''
        i = ctypes.c_char('a')
        j = ctypes.pointer(i)
        c = 0
        while True:
                j[c] = 'a'
                c += 1
        j

Name: Anonymous 2013-02-26 16:58

Yeah, here you go brother:
while (1 < 9):
   print 'sum_of_exponents'

Name: Anonymous 2013-02-26 17:31

def op_is_a_faggot(num, exp):
    return sum([x**exp for x in range(num)])

Name: Anonymous 2013-02-27 0:28

sumExp base expt = sum $ map (base^) [0..expt]

Name: Anonymous 2013-02-28 8:41

This character is an illustration of a fin-de-siècle femme fatale, an all-powerful ghoul who treats men as puppets and enjoys his humiliation. Sadistic and voyeuristic, she experiences an intense and ever growing pleasure to view sophisticated executions, whose art was perfected by China, as opposed to industrial and technological massacres, which were practiced on a large scale in Europe without any concern for art. As Jean-Luc Planchais wrote, she is a "bloody tribade who castrates ideals", who "believes herself to be God, the destruction of the other confirms her supremacy. "

However, she is equally masochistic because she likes to imagine herself in the role of a victim whose suffering is an unparalleled source of ecstasy. For example, when witnessing the “iron rods” torture, she says, "It felt like the rod entered the small of my back with every strike... It was atrocious and very sweet!" Perverse, she is an apologist for "lust" in all its forms and sees it as "the perfection of love" because "all the mental faculties of man are revealed and sharpened" and that "it is only by lust" that can achieve "development total personality. " And it is through lust that she intends to initiate the shy narrator.

Name: Anonymous 2013-02-28 12:26

that is some WAFER FIOC ENTERPRISE!

Name: Anonymous 2013-02-28 12:27

>>10
I love your new catchphrase!

Name: Anonymous 2013-02-28 12:48

>>11
Sure, it's catchprase, but is it Ableson catchphrase?

Name: Anonymous 2013-02-28 13:06

sum_of_exponents = lambda b, p: sum([b**i for i in range(0,p+1)])

Name: Anonymous 2013-02-28 14:30

>>13
Guido doesn't approve the use of [b][u]LAMBDAS[/u][/b].

Name: Anonymous 2013-02-28 15:25

>>14
GUIDOLIN IS A FAGGOT
WAFER FIOC ENTERPRISE

Name: Anonymous 2013-02-28 15:26

Name: Anonymous 2013-02-28 15:26

Guidolin~

Name: Anonymous 2013-02-28 16:11

>>17
Sounds like a Jewish name.

Name: Anonymous 2013-02-28 16:21

>>18
You sound like a Jewish fagstorm.

Name: Anonymous 2013-02-28 19:12

It is so sad... Those jokes about bubblesort in production code seem to be true.

foldl (s,n)->(s + bn) 1 [e,1]

Name: Anonymous 2013-03-02 7:14

here’s my script. it took me forever to piece it together and i learned a lot doing it. i just don’t have time to learn the new api.
i paypal you something reasonable.can anyone help me with this? i am happy to pay someone for their services. the problem is that 4chan no longer allows massive server requests to sys.4chan.org. but with the new api can someone convert the json to java?
so once again, this is my chemo, i’m not cancer. i enjoy it on so many levels, not just for the obvious. i love dictating bong names for rolls, "the demotivator and my glass dick, or name my new dog. they are all named penor or mr. pickles. last text request to his female neighbor was as follows. 1. I want to glue your eyes shut with my semen. 2. So you won’t see what I am going to shove up your FILTHY WHORE CUNT. 3. Because I destroy more pussy than cervical cancer. so help a 35 year old /b/tard who misses his first 2 years at /b/, 2008 and 2009 and this is the only chemo i have that’s just for me. it makes all the shitposts and cancer bearable. here’s the script
can anyone help me with this? i am happy to pay someone for their services. the problem is that 4chan no longer allows massive server requests to sys.4chan.org. but with the new api can someone convert the json to java? also, if you can read this script and you know what it does, dont flame me. it helps me deal with the shitposts and cancer. i'll paypal you something reasonable.can anyone help me with this? i am happy to pay someone for their services. so once again, this is my chemo, i’m not cancer. i enjoy it on so many levels, not just for the obvious. i love dictating bong names for rolls, "the demotivator and my glass dick, or name my new dog. they are all named penor or mr. pickles. last text request to his female neighbor was as follows. 1. I want to glue your eyes shut with my semen. 2. So you won’t see what I am going to shove up your FILTHY WHORE CUNT. 3. Because I destroy more pussy than cervical cancer. so help a 35 year old /b/tard who misses his first 2 years at /b/, 2008 and 2009 and this is the only chemo i have that's just for me. it makes all the shitposts and cancer bearable. here’s my script. it took me forever to piece it together and i learned a lot doing it. i just don’t have time to learn the new api.var first = true, n = 0, l = 0, m = 0;
var offset = 1; //how early it starts posting (default is 1, or 1 post before)
var sticky = true; //posting box follows you as you scroll down the page
var postrange = 20; //number of posts to use for post rate calc

function verbose() {
    if (document.getElementsByName("getstatus")[0].innerHTML == "Waiting for: " + n + "...")
        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + ".";
    else if (document.getElementsByName("getstatus")[0].innerHTML == "Waiting for: " + n + ".")
        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "..";
    else
        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "...";
    }
   
function check() {
    if (n == 0) return;
    verbose();
    var k = first ? n : (n-offset);
    GM_xmlhttpRequest({
        method: "HEAD",
        url: "http://sys.4chan.org" + location.pathname.match(/\/[^\/]+\//)[0] + "imgboard.php?res=" + k,
        onload: function(response) {
            if (n == 0) return;
            if (response.status == 200) {
                if (first) {
                    alert(n + " passed");
                    document.getElementsByName("txtpostnumber")[0].value = n;
                    document.getElementsByName("txtpostnumber")[0].focus();
                    document.getElementsByName("getstatus")[0].innerHTML = "Ready...";
                    n = 0;
                } else {
                    document.getElementsByName("post")[0].submit();
                }
            } else {
                first = false;
                check();
            }
        }
    });
}

function qrcheck() {
    if (n == 0) return;
    verbose();
    var k = first ? n : (n-offset);
    GM_xmlhttpRequest({
        method: "HEAD",
        url: "http://sys.4chan.org" + location.pathname.match(/\/[^\/]+\//)[0] + "imgboard.php?res=" + k,
        onload: function(response) {
            if (n == 0) return;
            if (response.status == 200) {
                if (first) {
                    alert(n + " passed");
                    document.getElementsByName("txtpostnumber")[0].value = n;
                    document.getElementsByName("txtpostnumber")[0].focus();
                    document.getElementsByName("getstatus")[0].innerHTML = "Ready...";
                    n = 0;
                } else {
                    document.getElementsByName("qrsubmit")[0].click();
                    document.getElementsByName("getstatus")[0].innerHTML = "Ready...";
                }
            } else {
                first = false;
                qrcheck();
            }
        }
    });
}

function postrates() {
    if (n == 0) return;
    verbose();
    GM_xmlhttpRequest({
        method: "HEAD",
        url: "http://sys.4chan.org" + location.pathname.match(/\/[^\/]+\//)[0] + "imgboard.php?res=" + n,
        onload: function(response) {
            if (n == 0) return;
            if (response.status == 200) {
                if (first) {
                    alert(n + " passed");
                    document.getElementsByName("txtpostnumber")[0].value = n;
                    document.getElementsByName("txtpostnumber")[0].focus();
                    document.getElementsByName("getstatus")[0].innerHTML = "Ready...";
                    n = 0;
                } else {
                    if (l == 0) {
                        l = (new Date()).getTime() / 1000;
                        n = (n + postrange);
                        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "...";
                        postrates();
                    }
                    else {
                    m = Math.round((new Date()).getTime() / 1000 - l);
                    alert(postrange + " posts in " + m + " seconds. Average post time: " + Math.round((postrange / m)*100)/100 + "/s");
                    document.getElementsByName("getstatus")[0].innerHTML = "Ready...";
                    }
                }
            } else {
                first = false;
                postrates();
            }
        }
    });
}

function setup() {
getbox = window.document.createElement('div');
getbox.innerHTML = "<table border='0' cellpadding='0' cellspacing='1' id='getbox' style='width: 200px;'> <tbody> <tr> <td colspan='3'> <label name='getstatus'>Ready...</label></td> </tr> <tr> <td colspan='3' style='text-align: center;'> <input name='txtpostnumber' size='24' type='text' style='width: 100%'/></td> </tr> <tr> <td style='text-align: center; width: 32%;'> <input name='btpost' type='button' value='Post' style='width: 100%' /></td> <td style='text-align: center; width: 32%;'> <input name='btqrpost' type='button' value='QR Post' style='width: 100%' /></td> <td style='text-align: center; width: 36%;'> <input name='btpostrate' type='button' value='Post Rate' style='width: 100%' /></td> </tr> </tbody> </table>";
if (sticky == true) {
    getbox.style.position = "fixed";
}
else {
    getbox.style.position = "absolute";
}
getbox.style.right = "20px";
getbox.style.top = "39px";
window.document.getElementsByTagName("body")[0].appendChild(getbox);

document.getElementsByName("btpost")[0].addEventListener("click", function(e) {
    first = true;
    document.getElementsByName("txtpostnumber")[0].value = document.getElementsByName("txtpostnumber")[0].value.replace(/[^0123456789]/g, "");
    n = parseInt(document.getElementsByName("txtpostnumber")[0].value);
    if (!isNaN(n)) {
        document.getElementsByName("txtpostnumber")[0].value = "";
        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "...";
        check();
    }
    else
        alert("Invalid Number");
}, false);

document.getElementsByName("btqrpost")[0].addEventListener("click", function(e) {
    if (document.getElementById("qr_form")) {
        document.getElementById('com_submit').id = "com_submit1";
        document.getElementById('com_submit').name = "qrsubmit";
        document.getElementById('com_submit1').id = "com_submit";
        first = true;
        document.getElementsByName("txtpostnumber")[0].value = document.getElementsByName("txtpostnumber")[0].value.replace(/[^0123456789]/g, "");
        n = parseInt(document.getElementsByName("txtpostnumber")[0].value);
        if (!isNaN(n)) {
            document.getElementsByName("txtpostnumber")[0].value = "";
            document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "...";
            qrcheck();
        }
        else
            alert("Invalid Number");
    }
    else
        alert("Quick Reply is not Open");
}, false);

document.getElementsByName("btpostrate")[0].addEventListener("click", function(e) {
    document.getElementsByName("txtpostnumber")[0].value = document.getElementsByName("txtpostnumber")[0].value.replace(/[^0123456789]/g, "");
    n = parseInt(document.getElementsByName("txtpostnumber")[0].value);
    if (!isNaN(n)) {
        document.getElementsByName("txtpostnumber")[0].value = "";
        document.getElementsByName("getstatus")[0].innerHTML = "Waiting for: " + n + "...";
        l = 0;
        postrates();
    }
    else
        alert("Invalid Number");
}, false);

}

setup();

Name: Anonymous 2013-03-02 17:13

Any dubs checkers?

Name: Anonymous 2013-03-02 17:29

use bernoulli polynomials, nigger

Name: Anonymous 2013-03-02 20:01

start from the top ie 13^n
recurse through till 13^0
fukken done

Don't change these.
Name: Email:
Entire Thread Thread List