« first day (1848 days earlier)      last day (3325 days later) » 
00:00 - 21:0021:00 - 00:00

00:10
Yeah, so I have done something similar. I have a desktop that I have a USB drive connected to. I have all my dropbox stuff synced to it, including all my photos.
But I select with other devices sync what folders
so I don't care what happens to any of my devices. They are all synced and nothing to worry about
@pyramidface I don't know anything about celery, but it sounds like it's a task scheduler? The first one enqueues tasks and the second one runs the worker?
maybe run them both...?
yeah probably that's it, but I just wanted to see if there was some simple command that would just do it all
I'm figuring it out right now though
gonna be 2 background processes I guess
do_one && do_the_other?
something like that
using supervisor to make the 2 commands run as daemons
00:42
I just had a conversation (not on SO) with someone who was convinced that storing more data on a server requires extra development effort.
how does one equate to the other?
He was right because he said he was a developer.
What does he develop? Poor ideas?
00:54
chuckle
weekend rhubarb
Cya rhubarb!
01:24
sometimes that might hold true I guess ... IE your server is on a raspberry pi or something small
IE isn't a server, and I wouldn't run it on a Pi! :P
01:41
IE as in for example ... or maybe I meant EG
I get them mixed up
not as in internet explorer ...
o i c :P
we were running an embedded server once on hardware a few steps up from raspi ... but the server was dumping 2GB of logs a day
@AdamSmith, sorry, i was head down on some math. The language was Scottish Gaelic of all things :)
@TigerhawkT3 Wanna dupe hammer this one? I already voted to close with the target: stackoverflow.com/questions/33578234/…
:)
hmm...come to think of it...that might not be the best one...but I'm almost sure I've seen this one before
@idjaw Hammered, but not quickly enough.
01:56
yeah I was even tempted to dump an answer on that one :P
02:40
Someone got an answer through in another of my dupehammered questions. >={
Meaning, they posted the answer after I hammered.
02:58
Apparently, the grace period for submitting an answer to a closed question is four hours. Seems a bit much to me...
03:30
@idjaw I forgot to give you a banana sticker for not answering that dupe. gives banana sticker
04:04
need a laugh? Check out my comment on this question
04:37
Totally uncalled for. All he wanted was someone to do his homework for him! Is that too much to ask?
...owait
5th vote was mine.
Ta. You might like to give it a close vote so the Roomba can find it easier.
I did give it a close vote. I was the 5th one to so vote.
You mean down-vote?
I downvoted it and the answer. OK?
Will there be anything further?
04:55
Yeah. Sorry, I meant down-vote. I guess I'm a bit vague today. :)
Then I'll be off, sir.
05:33
A novel approach to scraping URLs from HTML: stackoverflow.com/questions/33579257/… It's odd that he has RegEx in the title, but he's not actually using regex...
 
2 hours later…
07:23
@JRichardSnape yes, this is ZODB.
07:50
nice, the Finnish gov decided the healthcare here wasn't bad enough so they're set to utterly destroy it
Dumb question: What does (?s) mean in a string that will be compiled into regex. EG: "^(?s).{0,100}flounce"
@AnttiHaapala :(
cbg Autobot
cbg betleH
@BrockAdams the (? ) with a letter sets the corresponding flag for the regex, so in this case it is the same as compiling the regular expression with re.S
08:00
@BrockAdams That's a way of putting flags into the regex. In that case you're getting the s flag, aka DOTALL, which allows the '.' pattern to extend across line boundaries.
@PM2Ring @BrockAdams ^
Thanks @AnttiHaapala @PM2Ring !
this; and cannot link to it, but search for (?aiLmsux) on that page
(python docs suck since there are so many of those places where you cannot anchor to)
@AnttiHaapala Thanks again. Bookmarked for future.
FWIW, I never use those (?aiLmsux) flags: they just make regex look even more cluttered IMHO, so I prefer to use explicit flag args, either in re.compile or in re.search etc. OTOH, some of the re functions in older versions of Python don't accept a flags arg, eg re.split & re.sub
08:13
and when PM2Ring talks about older pythons, he is usually talking about versions that were EOLed a decade ago
If people still use those EOLed versions, would those versions be considered zombie Pythons? Would they consume brains instead of generators?
yes, they'd definitely consume brains.
:p Those flags arg were added in 3.1 & backported to 2.7.
2.6 was eoled 2 years 1 month ago
like, there was this guy who said "ubuntu 6.06 is better than 14.04 bc it gets less CVE's"
08:59
Can anyone tell me why I'm being shown chat flags? Is it just another rep privilege moderation tool?
yes
not sure what they're talking about :d
09:20
I've checked a few of these flags, and I get the impression that they require a lot more context than I'm willing to dig up.
The latest ones aren't even in English. I don't recognize the language, and neither does Google Translate.
09:48
@TigerhawkT3 Wow. Not that Google Translate is very smart... Google Translate error
I'd go.
10:11
good morning :)
Morning.
oh no tigerhawk
i am sure you are afraid of me asking something already.. probably asking in the most dumb way possible
10:34
Hey, ask away @hmmmbob; we'll try not to laugh. :)
nah.. this is my last resort.. will try to find the solution myself first :) but thank you for the offer
We're always happy to help, but we do like people to make an effort first, and to state their questions clearly and succinctly.
i wanted to combine 2 dicts entries..put all the values to the first key.. and then delete if there is an element equally named as key itself, i have written this thus far, and i think it works : def combine(x,y):
for key in y:
x.append(key)
To format code here, select it, then press the "fixed font" button, or press your Ctrl-k keys. Don't put code into the same message as normal text, or the text will get formatted as if it were code. Your description is a bit unclear. Please post a short example of a dict you want to modify and show us what it should look like after it's been processed by your function.
10:57
ok thank you :)
i have a dict, called nodes
combine(nodes[1],nodes[2])
a test call
want to combine it so nodes[1] holds all the values of both lists, and also deletes any element that is "1"
so its not a self loop later in the program
will do alot more work and search before i will ask :)
11:54
@TigerhawkT3 thanks for the banana sticker.... :P
and cbg to all here! :)
pastebin.com/dvwJvKW6 <- how to write php in Python
I want to see, but at the same time I'm afraid...
12:11
oh my
so much global
can anyone give me an idea if getting an retina imac for programming is a decent idea ? or any glaring no nos
Can you use one for programming? Sure. Do you need to get one to satisfy programming needs? No.
perfect answer
thank you
They appear to be nearly $2000.
more actually
mine will cost like 2500 euro
because for 2000 you get a really crappy old spinning drive
12:26
It depends on what you want to program. If you're making fun little Python apps, you could get along just fine with a $100-200 mini PC (x86/x64-based).
nah i need it for poker too
If you want to make Objective-C apps, or Swift, or whatever proprietary language Apple uses these days, you'll need an Apple of some kind.
so i need a decent screen size
and windows machines in my experience just have almost non resale value
The monitor can be purchased separately.
i know that :)
i use a 30" and a 27" right now
12:27
Meaning, you can get a mini PC and connect it to a large monitor.
yeah but for a 4k display etc.. you need a bigger gpu i think..atleast when using 2
I don't know of any computer that has much resale value after 6 months.
Yeah, dual 4k displays will certainly need more video capability than you'll find in a mini PC.
oh.. apple products have incredibly high resale value.. compared to windows machines.. really remarkable difference
was suprised myself
Interesting.
so i have to figure that into the cost
12:30
Do they still have a lot of resale value after several years?
in the past
i sold laptops
after like 2-3 years
in moderate condition
and they wre like retail 1300, and i got 750 for it
I guess laptops after just a couple years is a little different.
Laptops move a bit slower.
thats not great.. sure.. but for a windows machine.. i would get 200 max i think lol
My frame of reference is tower PCs - I've had my current one for a little over six years now.
my current pc.. is a mainboard laying on the box it came in.. and i start it with a screwdriver
12:32
Classy.
it works :P
what pc can go 6 years ?
Well, mine, for starters.
And the last one I built. And the one a friend built for my sister.
I had to replace the video card after having it shipped a couple years ago.
And the occasional fan.
oh wow
And I upgraded the OS from XP to 8.1 last year.
maybe i get suckered into "get something new.. its so much better" propaganda
12:36
Well, the new things are better.
But if it's a choice between using the old thing and spending $2500, I'd keep using the old thing.
true.. but i get it for 60%
for deduction reasons
That's a good savings.
so if i sell it and not declare it as income (yes i am a morally bancrupt individual) its pretty much even
If you're selling computers for more or less the same price you paid for them 2-3 years ago, that is impressive.
nah
its illegal :P
12:39
Only a little, hopefully?
yeah
its wrong.. no 2 ways about it
You probably shouldn't be discussing your illegal tendencies with strangers on the internet.
if someone would report that and they would follow up on that... good for them :)
then their life must be bleak..i hope it makes them happy
Let's just say you don't plan on doing it any longer and leave it at that.
ever 2-3 years i destroy my computer by using it as a frisbee
12:43
I'm listening to a 80's new wave / punk etc special on the radio. They just played the classic Germ Free Adolescents by X-Ray Spex.
Regular radio (e.g FM), or Internet/satellite/etc.?
u scare me
@hmmmbob okay let me put it another way: please don't discuss your illegal tendencies in the chatroom.
got it
@TigerhawkT3 Regular FM 2 NSB FM, broadcasting from Sydney. But also streaming on 50.97.94.44:8002/nsblive?type=.flv
12:47
It's not an appropriate place to discuss such things. We allow off-topic chat in general, but have to draw the line somewhere.
The program I'm listening to started at 8PM my time, and finishes at midnight, i.e., in about 12 minutes. The special continues at the same time on the first Saturday of December.
I gave up on radio when the only local metal station was bought out and replaced with the area's nth Hispanic music station.
I actually started appreciating my local rock station. I get the news I need in the morning on my drive to work while listening to some great classics.
@TigerhawkT3 I don't mind some Hispanic music, in small doses. But I kinda got burnt out on too much Cuban music several years ago: a community station I listened to a lot tended to play it after hours, when the station was on auto-pilot.
Oh, it's not that I don't like it, it's that we already had a number of identical stations, but that was the only metal station. Kind of like wiping out an endangered species to put up an apartment complex.
12:58
can we put this one out of its misery: stackoverflow.com/questions/33581259/euler-method-in-python
Voted.
Ah, right. I'm not a huge metal fan, but I don't mind some, when it's played well. Some of those metal guitar solos are as intricate as any classical violin solo. But I generally hate "growl" vocals. OTOH, I still like King Crimson's 21st Century Schizoid Man which has growl-like vocals, and guitar work that certainly inspired many metal players.
That is prog rock, not metal. And the vocals don't seem like growling/screaming so much as just kinda distorted.
But prog rock is cool too. I mostly just know Hocus Pocus, but it's a good one.
I had an obsession with The Mars Volta. Their newer stuff not so much. Their album De-loused in the Comatorium is fantastic
There is a little coffee jingle I like.
13:10
@TigerhawkT3 Sure, it's prog rock, but on the heavy end of the spectrum. It certainly predates metal, but bands like Crimson were predecessors of metal, IMO. As were Pink Floyd, Led Zeppelin & Deep Purple. Nobody would call them metal bands these days, but back in the day they were sometimes referred to as "Heavy Metal".
Oddly, that early heavy metal is quite different from today's heavy metal.
With Pink Floyd, I mostly think of Another Brick In The Wall, and Ummagumma.
Have you heard some of the tracks on Ummagumma?
But speaking of prog rock, here's a great keyboard-driven example that you may not be aware of, although it was a minor hit here. It's from a local band called Healing Force with mostly Australian members, but featuring a great singer from New Zealand. Golden Miles (audio + still image)
@TigerhawkT3 Sure. I'm more into Pink Floyd's early stuff than their later stuff. I don't have Ummagumma but I have Meddle, and I still listen to it regularly.
I set up an audio player and speaker near the window to play Ummagumma on Halloween.
It's almost too weird.
13:26
@TigerhawkT3 Oh dear. :) Yes, Ummagumma is weird. I think they were trying to prove a little too hard that they could still be strange without Sid Barrett's influence.
I researched it recently and apparently the band came to dislike that album. It's like they're embarrassed about some crazy music they wrote 30 years ago or something. How odd!
I think they agree with my theory. When you're doing cutting-edge stuff it can be hard to not cross the line into pretentious wankery. :)
You may enjoy this fairly new piece: it's vaguely reminiscent of Metallica's Nothing Else Matters. Chantel McGregor - Walk On Land. Chantel is one of my favourite young blues / rock guitarists, and Walk On Land is one of her original compositions. I can't wait to hear the album version.
13:42
I actually kind of liked the solo, but admittedly I did fast-forward to it.
@TigerhawkT3 Naughty boy! :) It has more impact if you also listen to the build-up.
I might've posted this one recently.... anyway, here's Chantel playing a cover of a rather rocky Jethro Tull number A New Day Yesterday You won't need to fast-forward this one. :)
@TigerhawkT3 A bit too heavy for me.
But they're Canadian!
OP posted this 17 hours after posting this that was already flagged as a dupe.
both are identical.
someone wanna help hammer that one out of the park?
@TigerhawkT3 :P
unleash the smash
13:57
SMASHED
<3
Don't you worry about hammering, let me worry about blank.
So, duplicate target states to create a new question if the solution does not work. But they simply code-dumped the duplicate solution as not working.
In this case should we keep the dupe target, or close-vote as too-broad instead?
@idjaw Oh-oh. I just tested Padraic's code in stackoverflow.com/a/31001317/4014959 : It's broken. Eg, cyclic_equiv(['a', 'b', 'c'], ['b', 'c', 'd']) returns True
nice catch
now. If the OP actually provided that in their post, we wouldn't be in this situation.
@PM2Ring So, cleaning this up would probably be best.
What's the best way to proceed in this case? Edit Padraic's solution, comment to OP that the code should be fixed and the dupe target still holds true?
14:15
Well, we definitely should do something. :) I haven't analysed Paddy's code closely, but I've been testing it with minor variations of the above data. It seems to give a false positive with most lower-case letters in the last position of the 2nd list. But it gives the correct answer with upper-case letters or numbers. I'm going to have a closer look at it, but I want to make myself a snack first.
But I'll post a comment to the poor guy who got hammered first.
Read the comment I put as well
I kinda feel bad for OP too...however, he didn't do himself any favours by just stating it didn't work.
He should have shown his work to reach that conclusion. That is what my recent comment stated.
anyone knows the minimum cut problem ?
14:34
wanna make an if statement if a value of a of a dictionary is equal to a key of the same dict
@hmmmbob It's vaguely familiar. However, I don't remember writing code for it.
i am working on it :)
have all evening and night
to finish that problem
@hmmmbob You have to loop over all the values, and test if each one is in the dict. There's no faster way.
i have this right now
for key in nodes:
	if nodes[key] in nodes.keys()
@hmmmbob That's not efficient: it has to regenerate nodes.keys() each time through the loop. And if you're using Python 2 it's even worse, since nodes.keys() is a list.
14:42
ok def thanks for the input
if i am only bad in efficency
and my dict has only 2 entries
Are you using Python 2 or Python 3
@hmmmbob It may not be worth using a dict if it's only ever going to have 2 entries.
nah
of course you are right
but for the assignment
i have to get it down to 2 entries
200
You can find the intersection of all values and keys, then just loop over those. (I have no idea what the problem you're talking about is). for node in set(nodes.keys()).intersection(nodes.values())
14:45
have to find the minium cuts
but i have several steps that are not working yet so its gonna be long
but thank you very much
Well you've only shown two lines, and they deal with finding the keys that are also values, which that does.
You can also look at how networkx implements it: networkx.github.io/documentation/latest/reference/…
if i append a value to a list, and that value is already in the list, i will simply have it in there several times right ?
Yes. Why not try it?
@davidism Good point. That's faster than looping over all the values at Python speed (although creating that intersection is performing a loop over all the values and all the keys, it's doing it at C speed).
yeah goodi dea
it does, thats unfortunate
14:52
we seem to have a different definition of unfortunate
@hmmmbob If you don't want duplicates, then don't use a list: use a set. And sets (like dicts) are much faster than lists when you want to test membership.
i want the duplicats
in fact i think i desperately need them :)
Ok. I think I've found the bug in Padraic's code. It's an off-by one error: The if k >= n: just after the inner while loop should be if k > n:. I'll do some more testing to make sure. It looks like Ben Melamed has logged off for the time being.
However, I suspect that this task might be a bit tricky on Python 3 because it needs to compare list members, and that will cause problems if the list isn't homogeneous.
user559633
15:11
cbg vaultah, pm, david, all else
I find that if:...else:...block in cyclic_equiv to be a bit mysterious. The incrementing by k makes sense, but I don't get the test. :) Do you have any insights, Antti? I guess I should muck around with a few examples on paper...
In case you're wondering what the yam I'm talking about, we dupe closed a question an hour ago, and then discovered that the code in the dupe target is borked.
user559633
15:29
What about the answers in the final dupe target?
user559633
I'm a thoroughly uncreative person, so I'd probably start by aligning based on the longest substring I could
@tristan I don't know, I guess they're ok. The OP was interested in using Padraic's code, since it doesn't use anything fancy, and it's supposed to be very space and time efficient. But his cyclic_equiv function has that little off-by-one error. Of course, the OP could have given us a better description, rather than merely saying it doesn't work...
It's a bit scary when an accepted answer with 13 votes is wrong. OTOH, it's only a couple of months old.
user559633
Heh, yeah, votes don't really imply anything other than popularity
user559633
Also, this isn't at all what I'm supposed to be doing right now, so hell yeah i want to play along
user559633
What input are you using to get an off by one error?
user559633
15:38
a = [0,0,0,0,0,0]
b =[0,0,0,0,0,1]
cyclic_equiv(a,b)
user559633
Got it, that's wrong.
He actually got 14 upvotes and a down vote. Maybe the downvote's from the guy that got dupe-hammered. :) And the other 14 voted without testing it, which I guess is fair enough, but still, I tend to test mysterious algorithms before I'm confident that they probably work most of the time. :)
user559633
I think StackOverflow still has the "Oh boy that sure does look complex! VOTE"
DSM
DSM
Brief cabbage for all.
@tristan Yeah. Unless it's too complex, and they don't really undersand the question, let alone the answer, then it just gets ignored. Even though cyclic_equiv('abc', 'bcd') gives a false positive, cyclic_equiv('abc', 'bcA') returns False, as it should.
Morning, DSM
user559633
15:41
Greetings DEE SAM
DSM
DSM
Someday someone will explain to me why people who want help parsing files go out of their way not to show what the file actually looks like.
user559633
@DSM because ~~privacy~~ and because most people are bastards.
DSM
DSM
"Here's my csv file." "There aren't any commas!" "Yeah, there are. But first I loaded it into Excel, then copy-pasted to notepad, and then took a screenshot. That makes sense, right?"
user559633
Oh, woof. Yeah, I tend to not touch CSV, regex, or local environment questions anymore for those reasons.
user559633
"Your solution works on the information and data that I provided, but not on the data that I just found to exist"
DSM
DSM
15:44
One time after about twenty minutes it turned out the OP kept loading the results into Excel (which was correctly parsing it) but kept insisting to me "the csv writer isn't outputting any commas!"
@DSM I had one of those earlier. But I eventually got him to post his data. Sadly, he put it into a comment, even though I'd clearly asked him to edit it into the question. Luckily, it was just a bit of JSON, so it didn't get yammed up due to lack of formatting.
DSM
DSM
Eh, ignore me. I'm just grumpy this morning.
user559633
@DSM It's too late. I've already empathed.
16:16
I return from my walk. How are we all?
16:27
I'm pleased. It appears that I've killed the bug in cyclic_equiv - it's just correctly identified 300,000 True matches, and more important 2,500,000 False matches in randomised tests on lists of 5 ints. See ↑ for details.
@PM2Ring good job!
Ta. It's now doing tests on lists of 8 ints. The tests create a list for each rotation, and then put a "bad" int into every location, so each random list of length n gets tested against n² combinations that almost match.
I've put a comment on Padraic's answer. He'll probably fix it himself next time he logs in. After I found the bug I noticed that he'd simply made a translation error, because it's not in the code (pseudo-code ?) that he quoted from Jewels of Stringology.
Just passed another 64 * 100,000 tests.
DSM
DSM
He already made the fix, I think.
So he has. I've been kinda busy, so I didn't notice his ping.
Want me to notify OP that the dupe target solution was fixed? Or do you want the honours?
16:55
@idjaw I've just done that. And read his recent baffling comments. I suspect he's doing something dumb, but it's hard to tell how he's trying to run this code.
@PM2Ring Awesome... and yes I was responding to those comments while raking leaves....Which indicates that OP never even got to the point where they would have discovered the bug you found. They were having difficulty outputting the method's return.
DSM
DSM
Is there a reason the OP won't edit his Q to show how he's calling the code? Is the code a trade secret of some kind?
^^That is the frustrating part
If you look at their history, they posted that exact same question yesterday and it was dupe hammered
However, through the comments it is clear that OP is having fundamental issues with the language right now.
DSM
DSM
Better you lot than me. (And for entertainment's sake I tried the repaired code on every comparison between (0,1,2)^N x (0,1,2)^N for N from 1 to 9. 9 is still running, but every other test passed.)
@DSM Sometimes, I think it's simply that they can't figure out how to edit their question because they can't find a nice big button.
17:00
Feature-Request: SO Clippy: "Looks like you should be putting that in your original post. Need some help?"
@DSM Thanks. To properly test the False matches I wrote this simple version of the test:
def slow_cyclic_equiv(u, v):
    vv = v + v
    vlen = len(v)
    return any(u == vv[i:i+vlen] for i in range(vlen))
DSM
DSM
For stuff like this I break out the pypy so my loops run faster. :-)
Actually, I suspect my code might be faster than Padraic's algorithm. It wastes RAM, but that's hardly an issue for lists this small. Sure, if I were doing it in C Paddy's algorithm would be preferred, but the way Python throws RAM around it's usually pointless using the behaviour of algorithms in C as a guide to their behaviour in Python. :)
My tests are overly strenuous. Really, they only need to test with bogus data in the last element of the second list. OTOH, it's good to be thorough. :)
DSM
DSM
I maintain an N-dim data library at work. I've implemented a version of itertools in c++ for the test suite, because I've found that testing every comb/perm/cart. prod for small inputs (1) picks up bugs I'd never have thought to test for, and (2) helps me sleep better at night..
17:17
Wise move. That reminds me of a classic I saw yesterday: an attempt at image filtering using DFT. stackoverflow.com/questions/33571500/… For starter's he's not using a library to read his greyscale BMP image. Which I guess could be admirable, but not when you do it like this:
tmp = imIn.read(1)
val = struct.unpack('c', tmp)[0]
row.append(val)
18:31
Hi, @holdenweb. Pity you weren't here yesterday: we had a Python / Ruby equivalent question but it appears to be resolved satisfactorily.
@SOReadytoHelp: Thanks for finding that "dupe target". And now you do have enough rep to comment, so next time you can do it properly. :)
@PM2Ring Not actually a bug Ruby guy, so may not have been able to help
Sorry. For some reason I thought you were. I guess I might be mixing you up with someone else...
@PM2Ring There are 4 cvs on that
@BhargavRao Do you want me to make it 5? :) Yesterday I was hoping a Ruby expert could locate an appropriate dupe target so it could be hammered quickly.
I've also not voted on that :P
18:46
idjaw did post a reasonably-good looking link, but on close inspection it appeared to be slightly erroneous, so we didn't use it as a dupe target.
idjaw's linked post looks good to me. :/
I'm uncomfortable closing a question like that as "Too Broad" because it's not too broad. It'd be different if it was asking us to translate a big slab of code from one language to another.
Yep. These questions are the border cases between off-topic and a good question.
@BhargavRao Yeah, that one's ok. His first proposed target shows an example of adding 1 to a time to increment it by 1 day. But that actually increments the time by 1 second.
Now we can't even close as dupe, we'll hafta wait for Wayne :D
18:55
Ah, Wayne! That's the Ruby expert I was thinking of earlier. But idjaw's target only shows how to do a time difference, it doesn't show how to increment a time, which is the core of the new question.
Then the question's good!
It's ok. And unlike the answer I mentioned earlier it doesn't confuse seconds with days. :)
Hehe... Conclusion drawn.
Is this answer a good practice?
It combines EAFP and LBYL at once. :/
19:07
European Association of Fish Pathologists?
I'm not kidding, it exists, that's even the first response from Google.
Easier to ask Forgiveness than Permission
:D
There's nothing wrong with combining EAFP and LBYL IMO. They both have their uses. There are sometimes when EAFP fits nicely, and other times when it's just ugly and LBYL fits.
But str(user_num).isnumeric() is kinda weird.
Added a comment. Now waits
@Ffisegydd Sure. But it is a bit silly to use LBYL when you've already done EAFP on the same thing.
19:11
I didn't actually read the specific question in much detail
g'morning, Pythonistas.
a grand cbg to you
Looking for some Django help, trying to wrap my mind around GenericForeignKey
as far as I can tell, it allows me to add a foreign key to any other table?
19:27
@BhargavRao I'm not keen on any of those answers, actually. I like to keep the code in a try: block to a minimum, so it's obvious which statement(s) is the one that may raise an exception. If you want to run additional code when the exception isn't raised put it in the else: block (or finally:). And if multiple statements may raise the same exception they really should be in their own (possibly nested) try blocks, otherwise your except: code can turn into an ugly mess.
@Pm That's was my initial concern.
I had thought of sentinel values. But they are worse.
finally is the correct way indeed.
cbg Jon
@BhargavRao Not, finally:, else:. finally: always runs, whether or not the exception is raised. It will even take precedence over a return in the try:, except:, or else: parts!
@SomeKittens Anything in particular confusing you?
19:35
@PM2Ring Yep. I got confused for a moment.
> The try ... except statement has an optional else clause, which, when present, must follow all except clauses. It is useful for code that must be executed if the try clause does not raise an exception.
Anyway, I've added a comment to the question, linking to our Kevin's excellent answer
@JonClements eh, digging in further I think I understand the general case
now my problem is what to set it to.
Do puppies eat kittens?
:D
My evil twin might... but I'm a good puppy
I saw the name there and reminded me of the dog & cat in Tom and Jerry. Sigh, good old days
19:54
Umm... plenty of fireworks tonight... definitely wasn't so many last year
fireworks? What's going on?
Fireworks on meta or on site?
People doing the weekend of November 5th
3 days from now we'll have 3 days of continuous fireworks here in India :)
20:26
@BhargavRao Diwali?
Is that correct?
Yep. Correct.
haha I had that solution in my buffer ready to paste @BhargavRao . :)
Just realized that this is my 7000th message in this chatroom Pats self
@idjaw I took a lot of time typing >>> :D
hahah I thought you copied that from your interpreter. That's hilarious
Lol, Many times I add them in front of the code blocks to distinguish between input and output.
20:50
Phew finally finished the website and hosted it. Work done for the weekend :-)
I find it quite odd that in unittest one can't (or seems like it's not possible) add a mock.patch decorator on the setUp method. Have to use patch.start() inside the setUp.
cbg all
cbg
I'm running into some trouble porting some code from 2 to 3 that provides a different memory storage backend with an API like the array module. This uses the array module in ways such as a = array.array('c', ('a','b','c')). However that typecode is gone in Python 3 though, what's the best way of porting this? (I was going to ask a SO question but this seems like a dupe however I can't actually find a dupe question...)
20:59
Umm... isn't that just the same as using a bytes object?
00:00 - 21:0021:00 - 00:00

« first day (1848 days earlier)      last day (3325 days later) »