« first day (1435 days earlier)      last day (3525 days later) » 

4:07 AM
Minor point about sopython: On CPython 3 True if foo else False is actually faster than not not foo, and it's almost as fast on CPython 2. Personally, it's much clearer than double negation.
 
4:17 AM
cbg(all)
 
 
1 hour later…
5:29 AM
Cbg
 
5:45 AM
cbg
@davidism might have to pick your brains about a flask thing later if that's okay
 
6:21 AM
wotcha @Zero :)
 
cbg @Jon :-)
 
what ya still doing up? :)
 
Actually I got up about twenty minutes ago, after having gone to bed at about 21:00. Not altogether sure why ...
 
sounds like fun... but then, not quite sure why I got up at 6am on a Saturday
done all the practical things like put the washing machine and dish washer on so I actually have some plates and utensils later... but ummm
(and yes, I did put the clothes in the washing machine, and the kitchen stuff in the dish washer) :p
 
That's definitely the recommended way around.
 
6:33 AM
It gets the expected results without breaking the equipment - that's for sure :)
the new washing machine seems to be happy sitting where it is, instead of wondering off, pulling out the water cable (still to be fixed) and the socket it's attached to, to leave me a deathly charge of electrically charged water to walk in to in the morning
 
On balance that sounds like an improvement ... a life free of risk would be a poor thing, but there are limits.
 
6:51 AM
Damn I haven't visited this room for weeks
All because of that "be nice" talk
 
cbg @vaultah :-)
 
@vaultah ?
 
Sep 5 at 15:59, by davidism
@vaultah be nice
I still think I wasn't rude
davidism just pissed me off
(because he deleted m message for reasons unknown)
Ah, I have mixed feelings about this
 
7:08 AM
@vaultah have you asked him what was the reason?
 
No, but I dont't see any good reason to delete this
 
I probably wouldn't have deleted it, but you were a bit snarky in your comments on that Q. I can't imagine any insult was intended on davidism's part - group hug and move on :-)
 
Okay, I agree
That answer is still wrong though :)
 
Welcome @user2699000 ... speaking in chat is disabled until you reach 20 rep, but you're welcome to spectate in the meantime :-)
 
7:26 AM
Can anybody tell me why the size of the below seen structure is 16?
struct Node {
    int data;
    struct Node * next;
};
 
@thefourtheye data + padding + alignment?
 
sizeof(int) and sizeof(Struct*)
(then as @Peter correctly points out - whatever's necessary to align to word boundaries of the CPU)
 
But when I print them separately, they both print as 4 and 4 only.
 
also, don't use struct Node * next; => write it as struct Node *next;
 
Sure... Where can I read more about this padding + alignment...?
 
@thefourtheye @Peter's far more up to date with this stuff than I am... I'm sure he'll have a link or two
^^^ and there we go :)
 
printf("%ld\t%ld\t%ld\n", sizeof(struct Node), sizeof(int), sizeof(struct Node *));
 
:)
and you think the problem is with the last one, right?
 
Sorry, it prints 16 4 8
 
<user-defined type size>, <integer size>, <pointer size>
it is not a must, but in almost all implementations all pointers have equal size
(but again, this is an implementation detail, not constrained by the standard)
but you can try this: sizeof(void *) == sizeof(struct Node *)
 
7:35 AM
But why is it 16? That is what I am failing to understand.
 
Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding. When a modern computer reads from or writes to a memory address, it will do this in word sized chunks (e.g. 4 byte chunks on a 32-bit system) or larger. Data alignment means putting the data at a memory offset equal to some multiple of the word size, which increases the system's performance due to the way the CPU handles memory. To align the data, it may be necessary to insert some meaningless bytes between the end of the...
 
Thanks man :) I ll read about it...
 
@thefourtheye btw use the %zu formatter for size_t type which is what sizeof is evaluates to
 
size_t == long unsigned, right?
 
implementation dependent
on a Mac for example it is, but the standard does not specify it that way
 
7:38 AM
Huh
 
129
A: What is size_t in C?

sblomFrom Wikipedia: According to the 1999 ISO C standard (C99), size_t is an unsigned integer type of at least 16 bit (see sections 7.17 and 7.18.3). size_t is an unsigned data type defined by several C/C++ standards, e.g. the C99 ISO/IEC 9899 standard, that is defined in stddef....

@thefourtheye: CODE:
    #include <stddef.h> /* offsetof() */

    struct Node {
        int data;
        struct Node *next;
    };

    int main(void)
    {
        printf("%zu|%zu|%zu\n", sizeof(struct Node),
                                    sizeof(int),
                                    sizeof(struct Node *));
        printf("%zu|%zu\n", offsetof(struct Node, data),
                            offsetof(struct Node, next));
        return 0;
    }
OUTPUT:
16|4|8
0|8
there is you padding ;)
 
Wow. Good to know :)
 
also it needs #include <stdio.h> for printf() -- but we all know that ;)
 
7:56 AM
(didn't notice it before)
 
oh hey, pineapple made it :)
 
hehe... sorry doing catchup... bbc.co.uk/iplayer/episode/b04hzncs/…
 
8:29 AM
btw @JonClements about the topic we've discussed yesterday as Robert Grant suggested, I looked into MailPile a bit, and right now I'm installing it on my Raspberry Pi (but before that I'm switching from Raspbian to Arch)
it looks very nice, and does exactly what I want it to do
 
it also looks nice and simple.. so we'll see
@JonClements you absolutely don't care, do you? ;)
 
too busy with caring about other stuff to care about that, so yes :)
 
me luv you long time though :p
 
8:33 AM
I know, I know <3
anyway, I'm a bit rhubarb for now
~
 
8:55 AM
@PeterVaro Would be interested to know how you find Mailpile - I'm hoping to play with it myself (kicked in to their indiegogo campaign in fact), but read somewhere that the beta isn't especially usable just yet.
 
9:26 AM
@ZeroPiraeus I will report ;)
 
10:12 AM
Woo! Another upvote for Why is Python 3.x's super() magic? Now it's an even race between that and Is it possible to define a class constant inside an Enum? for my first Good Question badge ...
 
 
1 hour later…
11:37 AM
I can't believe I've spent this much time writing zip(list, range(len(list)) to emulate enumerate
zip should raise a YouFoolException when it spots that
4
 
@Flexo I bet there are others you don't use quite often, take a look at the built-in funcs
;)
 
11:54 AM
cbg
 
cbg(@isedev)
 
 
1 hour later…
12:58 PM
I want to propose a new tag 'winpython' on SO. We currently have 199 Q or As (stackoverflow.com/search?tab=newest&q=winpython). As it is a very widespread python-distribution it would be great to have all this topics in a tag to follow them. (I did not find another way to propose it, hope it's correct to post that here)
 
why not post it on meta stackoverflow. thats a better deal.
 
@sebix any user with enough rep can created it, if it gets used enough then it'll be kept around, if not it gets removed automatically
 
@Swordy ok, will do that. @Flexo I don't have enough rep, that's why I asked here.
I thought there's an easier way to have a new tag, than opening a question on meta
 
199 questions on SO is way too less for it to be a tag
No user has come across the need of creating this tag , so perhaps you can get along with a general word search or add other tags that would be closely related (as of now)
 
@Swordy don't be so sure.
 
1:06 PM
13 results for the last 20 days
 
There are plenty of tags with less than 199 questions.
 
hmmm cool :)
 
1:40 PM
anyone who uses fedora over ubuntu??
 
1:52 PM
@Swordy "use arch" -- whispered mysteriously
 
user559633
neat, one of my favorite "here's how you self-service" answers was upvoted stackoverflow.com/questions/3614312/…
 
WHY???? I yelled ferociously
:)
 
"because arch is the best" -- whispered a bit louder now to be more convincing
 
I'll need to take a look at it said me after being assured that @PeterVaro's recommendation had made a point
cbg(@AaronHall,**kwargs)
 
user559633
2:09 PM
"Ayn Rand, Rand Paul and Paul Ryan walk into a bar. The bartender serves them tainted alcohol because there are no regulations. They die."
 
no offense intended to anyone , just a joke :)
 
then there's the other group -- "we're proud to announce (product)" "we'll buy -- wait, how much does it cost?" "(cost)" "NOPE."
 
user559633
I don't really understand why Apple is upping the size of their phones. I really that Apple is losing their inspiration/magic -- why would someone want a phone near the size of an ipad mini?
 
@tristan peer pressure?? if you think i'm referring to samsung then you are heading in the right direction
 
@tristan regarding the Rand Paul joke, So does this bartender usually sell "tainted" alcohol? If it's just a bad batch, are you saying that current regulations prevent this?
 
user559633
2:21 PM
I don't think Apple is particularly worried about Samsung or other Android phones. They're really playing against themselves now.
 
user559633
I uh, don't know if you're playing along right now @AaronHall. The joke is that regulations exist to keep people from being literally poisoned.
 
Do they?
 
user559633
@AaronHall yes. Regulations do exist to keep people from getting poisoned. If you need a cynical approach: consider why the USDA was gutted and started bending more to corporate pressure under President Bush.
 
user559633
2:40 PM
And yeah @Swordy. NFC isn't a "must have" and packing in more peripheral features means you have to have a larger container to put them in. Apple's strength is supporting their products at all levels -- their devices sync easily to iTunes and other software in a predictable, uniform way.
 
user559633
It would be great if there was a serious Linux phone -- I don't see Ubuntu ever getting it right, especially having used Ubuntu desktop.
 
I'm not an expert on alcohol safety regulations. I do know this is a controversy where regulators appear to be losing the confidence of the public: kezi.com/brew-to-moo
 
@Swordy yes, use Arch, I've been using it for ~4 years now
@vaultah Sorry I caused you frustration, that's not what I intended. Looking back now I was too quick to trash that. Please stay, you're a part of the room! :)
@JonClements Yep, just ping me whenever. I just got to sleep when you posted that.
 
Why do you suppose regulators want to prevent farmers from feeding cows spent beer mash?
 
user559633
@AaronHall the FDA and USDA are kind of a mess now from a non-large scale producer view, that's true. That article doesn't really cover the serious issues though.
 
2:51 PM
It was just the first article I could find on google
 
user559633
They're really shaped by their lobbyists now (their demands for onsite facilities for health inspectors really impede on small operations from becoming profitable and staying sustainably small), but if companies like Coca Cola had their way, they'd sell the cheapest formula they possibly could, even if it was loaded with carcinogens.
 
You mean, they'd put battery acid and loads of sugar in it?
 
user559633
Sure, or incredibly cheap artificial sweeteners that were not well tested in terms of their affects on human health. Oh wait.
 
Could it be that these wonderful regulators merely provide a false sense of security?
 
user559633
This sort of thing is why regulations and inspections matter and why the free market approach is a joke: cnn.com/2014/07/29/world/asia/explainer-china-meat-scandal
 
user559633
2:59 PM
No, the regulators are largely ineffective because they've been designed to be as such by lobbyists. That doesn't mean that they aren't still providing some level of service.
 
3:47 PM
cbg
 
Dun.
 
Whoah. Was just checking the BBC schedules so I know when to go looking for the latest DW episode, and ... there's an actual show called Pointless Celebrities. That's ... surprisingly honest for a Saturday evening show.
 
Pointless is amazing.
It's very funny.
 
5:34 PM
Ok, just read the wikipedia entry ... it does sound like it might be amusing. Someone ought to post clips of the best bits here (like @Jon does with WILTY) so I don't have to actually watch it ;-)
 
I don't think that would work.
It doesn't have such clips, it's just generally fully and also quite an interesting gameshow.
 
... hmm. It also doesn't have a very strong presence on torrent sites as far as I can see ... of the 18 results for "Pointless", only half are for the show and only one of those has any seeds (I'm assuming the video featuring Nova Black isn't from the early-evening family entertainment show).
 
5:56 PM
hey, apparently there's a new season of doctor who, a new iPhone, and a new iOS
 
You, sir, are my hero.
 
what is wrong with server?
I cannot log in.. only the chat is working for me..
does anyone else have the same problem?
 
Goddammit @Martijn, it's uncalled for to not only comprehensively prove another answer wrong, but also go back in time and put your more thorough answer up before they got a chance to write theirs.
This, in case anyone's wondering.
 
6:21 PM
cabbage!
 
cbg @Demnogonis :-)
 
Does PIL lock an opened image on the file system?
I have a function which opens an image with PIL(low) gets its size and moves it to a folder if the image is small. But I keep getting errors and the move doesn't happen
 
@ZeroPiraeus Sowwy.
cbg!
 
def make_histogram(imgs, path, histlist):
    for img in imgs:
        try:
            tmp = Image.open(os.path.join(path, img))
        except Exception:
            print('bad image: ' + img)
            continue

        size = tmp.size
        print(size)
        if size[0] < 800 or size[1] < 600:
            os.rename(os.path.join(path, img), os.path.join(path, 'small images', img))
            continue

        tmp = tmp.resize((800, 600), Image.ANTIALIAS)
        histlist.append([img, tmp.histogram()])
do I have to close the image first?
 
@MartijnPieters np ;-)
I've just been trying to work out whether any of my answer was salvageable; decided it wasn't and contented myself with a comment on the question.
 
6:38 PM
@ZeroPiraeus Yeah, there are good reasons. One of them is that there is a cache, and you have to clear that cache every time you add to or remove from the registry. My version does that too.
The post you link to concerns providing your own registry implementation, which would allow you to remove registrations but not access the cache.
 
man. Oracle makes the most counter-intuitive interfaces...
 
@MartijnPieters The one that scares me silly is the thought of debugging a function that gets hordes of variants registered and unregistered on the fly, at random.
Once you can do that, someone's going to store them in a database, and ... ugh.
 
how to take data from a fingerprint scanner using python
 
@JonClements cbg!
 
6:47 PM
cbg @Jon :-) Not glued to the TV?
 
Hosting a party - so not even really glued to the laptop either :)
 
ahem I assume my invitation was lost in the post?
 
@Ffisegydd oh.... yes... your invite... it got eaten when you de-BFF'd me in favour of a pivot table
no hard feeling and all that... :)
 
I'm sure @Ffisegydd isn't the first to have their head turned by a pretty set of axes ...
 
@Zero Oh the many ways of reading that statement...
I may have to hand myself in... @Ffisegydd might have just had too much of an axe...
 
6:55 PM
 
What's this "kick-mute user" option do again? :p
On the plus side, you were sad when I died...
 
well that was depressing...
 
Although you beat me up, crashed a car I was too drunk to drive, and made me lick your nappy clean while in the bank vault, I did love you Stewie...
 
Whoever doesn't like Family Guy is mad :)
 
7:04 PM
doesn't like Family Guy
refuses to answer questions regarding sanity
 
/me looks for keys to shotgun and ammo
 
reaches into pile of axes
 
opens a bag of chips
 
breaks down in tears of the memory of being de-BFF'd by axes
continues to type in italics as it appears to be a trend at the moment
 
Can I join in with my nunchucks and shuriken?
Oh, sorry.
Can I join in with my nunchucks and shuriken?
 
7:09 PM
@Martijn why not... let me get a few drinks down my neck and we'll have a go at pass the shuriken again...
apparently lost a leg last time... so it's not dangerous at all
 
can I caw and peck people?
 
@corvid as long as you do so in a polite manner
 
(ahem), do excuse me sir but CAW CAW (peck)
 
is a shuriken (at least, my avatar looks a bit like one)
Fear me.
 
I could also offer a sword and a miao dao
btw. I was able to solve my problem with the images
 
 
3 hours later…
10:35 PM
Looks like I'm going to be having half a dozen people staying over
going to leave 'em to not wreck the place any further... but don't think this party's going to end until 3-ish
 
Sounds like fun :-)
 
I've excused myself from it - been a long day, very tired and got work to do tomorrow... so - will be interesting to see how much cleaning is required in the morning :p
need to watch Dr Who first though :)
 
Enjoy :-)
 
MA1
11:28 PM
hi
i am on ubuntu 13.10 and python packages are being install in /usr/local/lib/python2.7/dist-packages/
but sys,path is missing /usr/local/lib/python2.7/dist-packages/
so import failed on modules
don't know why this is happening
any solution
 
Are you using the system Python - and how are you installing the packages?
 
MA1
i am install the packages using pip
not sure about if i am using the system python
i am on friends system
 
something's odd then, if you're using the correct version of pip and python version, then it should "just work"
 
MA1
i use both fedora and ubuntu
and never got issue like this
this is the first time i got this issue
 
Well, can't say I've ever had such an issue
 
MA1
11:37 PM
anyway i solved the issue but permanently updating the PYTHONPATH
 

« first day (1435 days earlier)      last day (3525 days later) »