« first day (2271 days earlier)      last day (2678 days later) » 

6:08 PM
Survey Question: How do you Pythonists usually handle environments? Do you create an environment object and ask it what environment you're in? Do you directly query environment variables from the OS? How many environments are you usually looking at? Dev/Prod? dev/int/qa/uat/preprod/preprodfinal/reallyreallyfinal/prod?
 
my company has PROD/Dev/UAT/QA/, as for your first part of the question, not sure... depends on what is needed
 
@Kevin correct (sorry, post-unannounced brb)
 
1. I only interact with the environment in environment-agnostic ways (ex. `open`, `os.path.walk`)
2. Not applicable.
3. for personal projects, one. For work projects, local/dev/QA/production.
"local" being my work computer, and "dev" being a remote server I don't actually have direct access to.
 
kevin being kevin answering my question before i even ask....
there should be some brownie points i can give you for that
 
DSM
In principle we have four work environments. The code queries the OS to find out where it's running, which is handled in a contained object which can be mocked (so that we can pretend we're in PRD even if we're not).
 
6:12 PM
Rewarding me would only create a perverse incentive for me to write initially confusing messages which I then clarify a second later.
See this morning's "damp stranger's couch" message, done intentionally for comedy value.
 
DSM
Suuuure it was.
 
I'm thinking the environment object is probably the way to go too.
 
Actually, now that I think about it, some of my work projects do have an environment object. For instance, a resource file may exist in different paths depending on whether you're in QA or prod. In which case, we have a web.config file for each environment and query it with ConfigurationManager.AppSettings. But of course that's specific to C# and so may not be useful for your survey.
 
What we usually do at work is use whatever oodb database we connect to to determine which environment we're in. This breaks down when we set the db to "memory" and we want to consider it a prod process.
 
DSM
Aside: I really hate it when [certain real-world entities] change their names. It breaks my data request from [large data vendor], and I'm on support while my mentee is on vacation. :-|
 
6:18 PM
When I write Python programs that depend on a resource file, I distribute it alongside my source code in a well-established directory structure, so the relative path is always the same.
 
DSM
We often have use cases where we want to read from a certain database (e.g. PRD) and write to another (UAT). It's easier to handle odd one-off cases if you can localize all the weird logic in one object.
 
how to handle varchar in sql python
 
sounds like the title of a very low-quality question on SO
-1
 
yes it is.
buts sometime brain gets gloomy
 
Somewhat related. In Windows, many programs store per-user configuration data in c:\users\[username]\Appdata\[program name]. Why is this done? Wouldn't it be more logical to store it in [program installation directory]\userdata\[username]?
 
DSM
6:23 PM
Seems equally logical to me to store user data in a user directory. That way if I want to mirror user state I don't need to search through an arbitrary number of dirs, it's all wrapped up in one.
 
Theory: writing to the installation directory tends to require administrator rights, but writing to c:\users\[username]\Appdata only requires the rights of that user.
I don't know whether this is true, because I'm an admin on every computer I use.
And I suppress nearly all "this program requires administrator rights" messages by choosing "always allow and don't ask me again", because I am bad at security.
 
@TheExorcist question is too broad can u explain what u are trying to do
\o cbg antti
 
@DSM Valid point, but I wonder if that's the intent or just a convenient side effect.
 
i am doing this
cursor.execute("UPDATE sites SET include = %s WHERE Id = %s", (str(x), sys.argv[2]))
which says this
 
There's probably a "best practices" document for application development on MSDN that explains this. I suspect my google-fu wouldn't find it, though.
 
6:27 PM
TypeError: 'NoneType' object is not iterable
 
what is x and how are you calling the python script?
 
@TheExorcist is that what an SQL injection vulnerability looks like?
sheesh you saw nothing
I can almost write coherently today
 
@TheExorcist Interesting. Please provide the full stack trace. (using pastebin or similar if it's longer than, say, ten lines)
 
okkk
 
is it not simply that sys.argv is None?
 
6:29 PM
@AndrasDeak strangely enough, not with some drivers
 
@AndrasDeak I'd expect "... has no attribute __getitem__", then.
 
That's not strange, that's exactly what you do to avoid injection.
 
@AndrasDeak no, that's subscriptability
 
but % instead of , would be
 
Yes
 
6:30 PM
i.e. DON'T DO THIS!!! cursor.execute("UPDATE sites SET include = %s WHERE Id = %s" % (str(x), sys.argv[2]))
 
here
 
hmmm
 
sql_update= r"UPDATE sites SET include = '" +str(x)+r"' WHERE domain = "+sys.argv[2]+ r";"

#cursor.execute(sql_update)
cursor.execute("UPDATE sites SET include = %s WHERE Id = %s", (str(x), sys.argv[2]))
rows = cursor.fetchone()


for item in list(rows):
print item
 
that would expose you to sql injection
 
@AndrasDeak reading :P
 
6:31 PM
Oh, you are open to injection.
 
@WayneWerner ah, so .execute protects it from injection?
 
oldie but goodie: "Why do we have two-ply toilet paper, when we are so poor? Because we have to send a copy of everything we do to Moscow,"
 
@TheExorcist forgot to click fixed font
 
@AnttiHaapala never heard it
 
mike the liar again:? :D
 
6:31 PM
@TheExorcist allow me to clarify. When I said "please provide the stack trace", I meant the part of the error message beginning with "Traceback (most recent call last):". Thank you for providing more source code, but that's not precisely what I was looking for.
 
kool
 
@AndrasDeak the driver should, yes. Because you're not formatting it, the driver is escaping the arguments and then formatting them
 
I see, thanks
 
@AndrasDeak I've got a book I bought from a store of used books with well over hundred of pages of illustrated people's demockrazy jokes
 
6:32 PM
Seeing more of the code, I expect cursor.fecthone() returns None, and doing list(rows) is calling list on None, which gives an "... is not iterable" message.
 
yup ^
 
<type 'list'>
['{url}', 'www.{url}', '{url}/sitemap.xml', 'www.{url}/sitemap.xml', 'https://dl.dropboxuserco.bar2.txt']
Traceback (most recent call last):
File "/home/sheet/dropb_no_auth.py", line 109, in <module>
for item in list(rows):
TypeError: 'NoneType' object is not iterable
>>>
 
@AndrasDeak :D I just love the grim dark humour...
 
this was the error
 
You should be able to do list(cursor), no?
 
6:33 PM
@AnttiHaapala we call it life
 
What if you did:
rows = cursor.fetchone()
if rows is None:
    print("No rows found.")
else:
    for item in list(rows): #todo: figure out if you really need to call `list` here
        print(item)
 
whatever list() accepts should be valid in in the for, right?
for item in list(rows): should be something like for item in iter(list(rows)):, should it not?
 
@AndrasDeak yeah, that is another thing too, makes me feel comfortable with my life - the originators weren't telling jokes, they were documenting their life...
 
when i checked the data type
 
I would expect a row object to already be iterable.
 
6:34 PM
its says include has datatype varchar what i am passing is string
 
Or, uh, a collection-of-rows object. Whatever you call that.
 
05AB1E's syntax hurts my head to read...
 
@TheExorcist So you did print(type(include))? But there's no variable by that name in your code.
 
yes
not here there
in sql workbecnh
 
Oh. No, you should iterate over the cursor:

for row in cursor:
    print(row)
 
6:36 PM
really lemme try
 
Oh, does fetchone() return only one row and not a collection-of-rows? I should probably read function names.
 
That should work, assuming that the UPDATE statement actually returns anything
 
I bet if you iterate straight over the cursor, you don't even need to check for None, right?
 
what SQL are you even using?
@Kevin Bingo. Because StopIteration
 
If you fetch one row, you only have one row, not a list of rows.
 
6:37 PM
yeah i am fetching one row only
 
it must be a fetching row
 
Then why are you treating it like multiple rows and iterating over it?
 
there is nothing wrong
 
Ok, so you're getting the first row from the query results, then iterating through the row's columns and printing them. Makes sense. In which case, I continue to endorse the none-checking code from above.
Although I'd recommend changing the name of rows to row, because it's not a collection of rows, it's one row, so it's logical for it to be singular and not plural
 
DBAPI 2.0 - yet another tshi Python API :/
seriously, "returns a single sequence, or None when no more data is available."
how about an exception?
 
6:40 PM
I guess they don't consider "a query that returns zero rows" to be exceptional enough. I have no opinion myself.
 
so where ia m doing wrong
 
@TheExorcist You need to check for None. See: chat.stackoverflow.com/transcript/message/34914001#34914001
 
If you just want one row, then you'd do it like this...
row = cursor.fetchone()

if row:
    for column in row:
        print(column)
 
If you're saying "I already fixed that problem. My question is now: why is my query returning zero results when I'm sure it should be returning something? Does it have something to do with the type of include?", then I don't know.
 
alternatively:

for column in (row or []):
    print(column)
 
6:48 PM
Try checking the sql statement being generated by your code, and comparing it against a hand-crafted sql statement that you know returns the data you want. I expect they'll be different and it will clue you in on where the mistake is. I'm not sure how to view generated statements using whatever library you're using, but it's probably in the documentation somewhere.
 
lemme check
>>> rows
>>> item
'["{url}","www.{url}","{url}/sitemap.xml","www.{url}/sitemap.xml"]'
>>> item
'["{url}","www.{url}","{url}/sitemap.xml","www.{url}/sitemap.xml"]'
>>>
 
@WayneWerner row or () :P
 
row or eval('()')
 
i got this .. if there would be update if would have got updated queryin which dl.something would eb there
this script is working mine which i posted
 
When I say "the sql statement being generated by your code", I'm not referring to either rows nor item. You're looking for a string that starts with "UPDATE sites SET include = " and which doesn't have a "%s" in it.
"How do I find that?" you hypothetically ask. I don't know, but I have faith that you can find out.
 
7:00 PM
row or ''
 
haha .. ok i got you
 
row or {}
row or set()
 
in the end i alwys says i leave it i will solve it
and resolve it
 
for column in (row or []): seems un-best-practicey.
 
yeat earlier it was set() but i converted to rows
but
this type list(rows)
 
7:06 PM
cbg
 
cbg @idjaw
 
o/
 
DSM
Cabbage for @idjaw.
 
cabbages!
 
\o how goes it Joe
how is overwatch ?
 
7:09 PM
massive holiday weight gain. Commencing de-holidaying
 
Video game chat. I'm 70% through Infinifactory and it's just as fun & engaging as every other Zachtronics "get the stuff to the place" puzzle game, and arguably more visually impressive because it's the only 3d one.
 
DSM
@idjaw: don't remind me. Scottish cuisine has its good points, but also its downsides..
 
If you like Spacechem but wished it was cubes instead of circles, you can't go wrong here.
 
@DSM I took a picture of our kitchen that summarized our two weeks of terribleness (deep down it was delicious and I loved it).
 
@idjaw I guess it really will be a lot more cabbage in your future, eh? ;)
 
DSM
7:11 PM
Infinifactory; Zachtronics; Spacechem. Three words that Kevin knows that DSM does not.
@idjaw: let's just say my Christmas wasn't exactly Atkins.
 
Zachtronics games are basically programming challenges whose answers must be syntactically valid Befunge.
 
@DSM :) I feel ya man.
Plus, there was the constant snacking with chocolates and all that other evil stuff
@WayneWerner Oh definitely!
 
side note: cabbage soup is delicious
 
it totally is
I absolutely love it
 
bleh
 
7:15 PM
what a surprise. Andras shows up to hate
 
my wife does this stuff - I don't know exactly what's in it besides cabbage, carrots, and some kind of broth. So delicious.
I could eat a gallon of it. And the best part is a gallon is still like 50 calories.
 
We've just finished the last of the fruit soup, now that's what I prefer
 
whats a fruit soup ?
 
that's what I was just about to ask
 
year += 1 cbg, all!
 
7:17 PM
> Fruit soup is a soup prepared using fruit as a primary ingredient, and may be served warm or cold depending on the recipe. Some fruit soups use several varieties of fruit, and alcoholic beverages such as rum, sherry and kirsch (a fruit brandy) may be used. Fruit soup is sometimes served as a dessert.
@inspectorG4dget hiya how goes it
 
oh, you Westerners are weird
 
cbg @inspectorG4dget
fruit soup (warm) sounds like it could be tasty
 
@MooingRawr trying to figure out how to figure out if a number is a fibonacci number, without computing the fibonnaci numbers upto it
 
DSM
@inspectorG4dget: year = 2017 for you too!
 
no, it's cold as hell, and has a lot of cloves in it (yummm)
 
7:18 PM
cloves are awesome
 
@inspectorG4dget not sure if that's possible ~_^
 
fruit soup? fruit soup?
you gave cabbage soup a bleh
and you're talking about fruit soup?
I'm more of a savoury person
 
> However we Hungarians usually eat fruit soup hot
don't listen to her ^
 
@inspectorG4dget math.stackexchange.com/questions/9999/… try this. I remember reading about it in school
 
7:20 PM
@WayneWerner well, it's definitely possible - integer partition until you hit 1,1. But there has to be a better way
@MooingRawr ooh! Thanks
 
in conclusion there are a math formula that you can calculate to see if it's a fib number, im not sure if that counts as calculating for a fib tho
if u dig more in it i think wolfram alpha had a fib definition. i would look it up for you but i need to have a bio break
 
Ouch. I just looked at the math.SE question and I don't want to re-engage those math muscles right now :P
 
holy oh-snap! I was actually looking for a way to compute things, actually. But this is fantastic - I've learned something new today.
tl;dr: I ain't even mad
 
DSM
You need to think a little bit about efficiency, though. If your candidates are small, nothing is going to be as fast as just computing them (the real Fibonacci numbers, I mean) once and storing them in a set. And you're going to have to use arbitrary precision if you want to use the phi formula at any large size.
 
that formula is still crazy
> It was derived by Binet in 1843, although the result was known to Euler, Daniel Bernoulli, and de Moivre more than a century earlier.
 
7:29 PM
I was just about to mention the limited precision problem. int(round((phi**n - psi**n) / (phi - psi))) gives the wrong answer for n==71.
 
Euler and Bernoulli be like "ofc dude"
 
(provided phi and psi are initialized to (1 + math.sqrt(5)) / 2 and 1 - phi respectively)
(psi = -1/phi also fails at n==71)
 
@DSM I agree. This is for nothing real - I was just curious about how efficiently I could implement the obviously less efficient solution
 
i love math, but im not very good at the extreme math >.>
 
interesting
 
7:33 PM
hello
 
hello
 
@IsabelCariod cbg
 
greetings @IsabelCariod, and welcome to our world. Have a cabbage
 
i hate how slow the reddit app is ><
 
thanks boy
 
7:34 PM
takes forever to load a page ...
 
Nerd snipe: given a decimal type that can store X digits after the decimal point, determine an upper bound for the value of N where binet's formula ceases to give the correct answer.
 
it's supposed to be 50% faster that m.reddit.com!
 
Alternate problem: "given a decimal type that can store X digits, regardless of whether they come before or after the decimal point, determine..."
 
@Kevin way too extreme engineering for me
 
DSM
Speaking of web speed, I finally had to give up on Adblock Plus the other day and switch to a competitor. It was in one of its absurdly slow moods and rendered Chrome unusable. :-(
 
7:35 PM
@inspectorG4dget Likewise. Warning, snipees: I won't be able to verify your answers.
 
I try to extract the first column from the database, I do
 
@DSM ublock origin?
 
c.execute('SELECT url, time, response FROM page WHERE id = ?', [str(uuid)])
responses = c.fetchall()
for cols in responses:
urll = cols[0]
 
@Kevin I just did that empirically
 
DSM
@WayneWerner: yeah, ublock I think, though I wouldn't bet money on it.
 
7:36 PM
yeah this works
 
@Kevin im not sure what you are asking but ima guess 1.618033 ;3
 
71 308061521170129 1.0 (n, F_n, difference from Binet0
I mean, that's doubles
 
@AndrasDeak Your answer agrees with mine.
 
how many of you are working for project related to web crawling
 
I've heard some gnarly things about adblock plus, but I don't remember where I read it now :P
I'm... probably as far removed from web crawling as you could get. I think
*and still doing modern development
 
7:39 PM
@MooingRawr The answer I would award full points to would be a formula of the form "N >= [some expression involving X goes here]"
 
@inspectorG4dget oh did u ever find that the extra forumla ? mathworld.wolfram.com/BinetsFibonacciNumberFormula.html i found the wolfram linke
@Kevin but but 1.618033 ;3 needs some loving too ;(
and don't we live in a world where we make everyone feel special once in a while (so long as we can extort them for something that would benefit us)?
 
@MooingRawr I didn't find that formula, but now that I see it, I'm kicking myself - I've known this all along
 
I'll grade your answer as if you had submitted "N >= 1.618033 + X*0". I award you three points out of ten for good penmanship and submitting on time.
 
@inspectorG4dget hey man at least you knew it... i didn't know about it until i had to do some research on it ... but learning is the best thing in life imo. xD
 
DSM
Ha, found it:
It has precision problems for small n; fib(71) is wrong. If we're only required to be correct for the first few terms, then def fib(n): return [0, 1, 1, 2, 3, ..][n] is even simpler.. [Updated to address change from round to int in code.] — DSM Feb 8 '11 at 17:19
 
7:41 PM
@MooingRawr learning is awesome. I'm a self-proclaimed learnaholic
 
@inspectorG4dget oh how do we gain that title, i would like to earn it too
 
it's a two-question quiz that you have to pass:
1. Do you want to be a learnaholic?
2. Are you sure? It's pretty addictive
 
call this recursive question recursion depth = inf
 
oh nice i learn something new today! sure and sure i would love to learn what an addiction is outside of the gaming and coding world.
 
that can be applied to any form of *holic
 
@DSM You beat me by nearly six years. Let nobody doubt your prowess in the realm of integer sequences.
 
anyone know if they are going to do another pycon in toronto this year ?
 
DSM
I don't see why not. They've had one for the last few.
 
Is Pycon the one that is hosted in the same place twice and then repeats the cycle somewhere else? Or am I thinking of something else.
 
@DSM Great! im determine to stand out so i can find the room 6 reps that comes....
 
7:47 PM
it helps if you actually log in to chat during your time there
 
@MooingRawr Spoiler. They aren't real. None of this is.
Kevin controls this room entirely
 
I will only reveal my meatspace identity when we all collectively start a company together. Not necessarily a software company; a pizzeria would be fine.
 
@AndrasDeak I didn't have access to interweb last year.... didn't have data and Ryerson's wifi was really slow so i didnt bother....
 
@Kevin how did you know I dreamt about opening a pizzeria last night?!?!?!
 
7:49 PM
Will you ship to Europe?
 
The password on your dream journal is insufficiently secure.
 
@AndrasDeak Why not? Just clone kevin and put him on a plane to where ever you are... but make sure you tip well ;3
 
@AndrasDeak I'd consider Italy for the sake of verisimilitude, but probably not anywhere else.
I'm assuming you're asking "will you ship yourself to Europe to begin your enterprise" and not "will you mail me a pizza", because of course I'd mail you a pizza.
 
DSM
I'd be interested to see if a pizza sent to DSM c/o LargeCanadianCity would arrive or not.
 
would you mail the pizza and not the order of a pizza where a local pizza place would make it and deliver it ?
 
DSM
7:51 PM
Maybe DSM @ LargeCanadianCity c/o NumberFirm would be more likely to succeed.
 
is it possible for me to place an order to a LargeCanadianCity Dominos from NotAsLargeCanadianCity?
 
DSM
Can't expect the Mayor to keep track of all us TLAs.
 
DSM I will buy you a pizza if you want ... xD I haven't had any pizzaria downtown in so long but im sure they are teh same since last time
 
I'm optimistic that an address containing your company's True Name would be delivered successfully.
 
@Kevin thank goodness; I meant the latter
 
DSM
7:53 PM
@idjaw: don't see why not, as long as you pay using a credit card. COD might be too easy to prank.
 
heck you won't even need to give me an address... i could order a pizza at a shop and tell them it's for a pick up under like DSM or something and im sure they are more than happy to give it to the first person who identify themself as DSM
 
Tangentially related, but I was annoyed recently by a fantasy story where the powerful Macguffin was protected by a series of riddles. That's not a good security system. It doesn't prevent evil people from getting your Macguffin, only dumb people.
 
Yes. Pizza, exactly 20 pieces of pepperoni equidistant. Ensure the green peppers are tangential to the pepperoni. Ensure that each quadrant also has an equal amount of meat and vegetables.

The pickup is for Data Science Man. Yes, that is correct, Science is my middle name.
 
Granted, the riddles were situated at the heart of a stronghold of law and order, but that wasn't password protected either.
 
DSM
I'll bring that up at our next security meeting. "So Kevin -- yeah, that one -- pointed out that our passwords don't protect us against men of ill will."
 
7:55 PM
@idjaw funny thing is, most family run pizzaria would make that, if you paid extra...
i dont know if they will weight out the ingredients to balance it but they will give equal slices of meat and veggies.
 
In a world where dark lords have access to shapeshifting, biometrics + riddles are insufficient defense against them. That's all I'm saying.
 
My instructions were pretty clear.
 
I have in database in a col text:
Server: sffe
Content-Length: 258
X-XSS-Protection: 1; mode=block
Cache-Control: public, max-age=31536000
Age: 487852

When I print, it's horizontally
Server: sffeContent-Length: 258 ...
How can I make vertically?
 
@IsabelCariod What does print(repr(cols[0])) display?
I suspect there's something weird going on with escape characters or something.
 
cbg
 
8:00 PM
\o hiya marcus how goes it
 
@DSM If your passwords can be circumvented by answering the recovery question, which happens to be "what walks on four legs in the morning [...]", then no, they don't protect you.
 
@Kevin print Server: sffeContent-Length: 258...
 
No quote marks or anything? That's super weird. I guess that means cols[0] isn't even a string???
 
DSM
@Kevin: we're a little more sophisticated, thank you very much. It's "What animal can accurately recognize a hook attached to power storage?"
 
I tried to use dict but I failed
 
8:04 PM
If the answer is "man", your riddle is insufficiently difficult.
 
DSM
Let's try Kevin's suggestion again. What does print(type(cols[0]), repr(cols[0])) show?
@Kevin: try again. :-P
 
Now I understand
 
If cols[0] is really a string and it literally starts with "Server: sffeContent-Length: 258" and showing the repr proves there's no tricky whitespace happening, then unfortunately that means that there's no way to separate the lines out into their unmangled form. Consider the string "a:bcd:e". Its unmangled form is ambiguous; it could be either {"a": "bc", "d":"e"} or {"a":"b", "cd":"e"}.
You can make educated guesses, perhaps splitting on the first capital letter found, but that's in no way bulletproof.
@DSM Ok, um... Crows have been known to use hooks to retrieve food. Alternatively, if the answer is a pun, I'm not coming up with anything on that front.
 
Yes now looks good
Server: sffe\r\nX-XSS-Protection: 1; mode=block\r\nAlt-Svc: quic=":443"; ma=2592000; v="35,34"\r\nAccept-Ranges: none\r\nConnection: close\r\n'
Thanks
 
DSM
@Kevin: if you get "power storage", you'll probably get the rest.
 
8:09 PM
How peculiar that the whitespace didn't show up before.
@DSM Oh. view spoiler.
 
DSM
Indeed. Thought it was almost too obvious, but apparently it'd buy me several minutes to delete sensitive files before you crack our system!
 
Fortunately I am not a dark lord.
Both fortunately for you, because your system will remain uncracked today, and fortunately for me, because apparently I'd be rubbish at it.
 
data scientists, got a few? I have a question about cross validation
 
@inspectorG4dget just ask your question xD
 
8:14 PM
@MooingRawr was already typing it out. Was just calling everyone's attention to it first... :P
 
sorry
 
@Kevin this is hilarious. I don't know anything about this game, because I never played any of them. Is that stuff you can do in the game and it carries over?
 
@idjaw IIRC it's a third-party mod for the game, not something that you can do out-of-the-box.
 
let's say I'm doing 10 fold cross validation. In each fold, a 10th of my data is used as testing, while the other 9/10th is used for training. The point of this is so that the model doesn't get biased by training data, and is therefore trained/tested on literally all of the data
 
It bugs me that the fun stuff I keep seeing in these games are all mods. The vanilla version of these games seem like they are deliberately bare and buggy to just let the community fill in the blanks. Am I wrong?
 
8:18 PM
I haven't played Skyrim or anything similar, but my perception is they're already quite good even when played vanilla.
Providing hooks for fanmade content is merely a very gracious extra.
 
however, to me, that means that I instantiate a model (say a neural net, with its config params - network topology, connections, initial weights/biases, etc), and then start the kfold training. So something like this:

nn = createNeuralNet()
for train, test in kfold(data, k=10):
    nn.fit(train)
    outputs = nn.predict(test)
is this accurate? or should it be more along the lines of:

for train, test in kfold(data, k=10):
    nn = createNeuralNet()
    nn.fit(train)
    outputs = nn.predict(test)
 
@Kevin I think that's a better summary. Yeah. They do end up having great reviews from release. So they must have good out-of-the-box appeal too.
 
I agree, it's criminal that Bethesda released Skyrim as a finished product without the realistic HD horses mod.
 
There's certainly a problem in the industry of shipping out half-finished games and depending on the community and/or paid DLC to make it into a full experience, but Bethesda is not at the top of the list of sinners
 
Yes. Agreed. I think my disappointment is more towards Fallout
It just never seemed fully polished like Skyrim.
@davidism exactly!!!!! :P
 
DSM
8:29 PM
@inspectorG4dget: I don't know much about neural nets, but when I do fold validation of any sort each validation is entirely independent (and so I'd put nn = inside the loop). This is often the sort of thing we parallelize, and so it'd be weird to have any coupling.
 
@DSM: I'm not using a neural net at all, but I am using (several) other models to compare their performance.
I find it weird that each fold is independent of the rest, since independence means that you get `k` (trained) models at the end of the day, and not one generalized model
on then other hand, a low variance between folds means that your model/params are robust against noisy data
but ultimately, that would depend on you having a tight confidence interval around your mean, amongst the folds. Would you agree with that?
 
DSM
I guess I have trouble understanding what meaning you'd attach to the resulting error vector if they were dependent, because then the only easy-to-interpret result is the final one. So you couldn't really compute a variance across your subslices, because they're each an answer to a different question, so you can't really find the error across k trials in the ordinary way.
I don't know about anything depending on having a tight confidence interval, because one of the reasons I would do k-fold validation is to find out what my errors look like.
Maybe I'm old-fashioned, but I always treated k-fold validation as just doing a train/test split k times to control the variance estimate, not as a separate type of cumulative training, if you know what I mean.
 
Cbg :)
 
cbg Ian
 
DSM
Cabbage for the seldom-seen @IanClark!
 
8:42 PM
@DSM o/ - too long, too long... :(
How be?
 
DSM
Ehh, first day of real work (yesterday was WFH because I forgot it was a holiday!!) post-Christmas. And annoying production issue which I had to handle because everyone else is on vacation, which doesn't seem to be fixed yet. :-(
Yourself?
 
@DSM: Sorry, I should rewrite my first block of code as follows:
clf = someClassifierModel(*params)
tests = []
for train, test in kfold(data):
    clf.fit(train)
    tests.append(test)
errors = getError(clf.tests)
does that make more sense?
 
@DSM the longer the vacation the more depressing the return :( - nice xmas / new years anyway?
And yeh, good thanks - annoying that I haven't been on here in a very long time. Find that my current job doesn't really align very well to doing so - but I will endeavour to be more present!
Also haven't really had any time to contribute anything meaningful to SO in general in a while
 
DSM
@inspectorG4dget: if that's any different from putting clf = someClassifierModel(*params) inside the loop then I still don't get it. I really do want them to be independent.
@IanClark: yeah, pretty much. Good to see my f"{sibling}'s children". And real life has a way of getting in the way of SO time, which is usually a good thing, I expect. :-)
 
I just spent 30 minutes debugging a unit test by stepping through the internals of a Werkzeug request, only to realize that the premise of the test was misleading and useless to begin with.
 
8:55 PM
@DSM Any good resources you'd recommend for learning more about stats / data science and analysis / etc? Seems like a good skill to have
 
It tested nothing, but happened to fail due to an incidental change that was failing other tests too. I just chose the wrong test to start debugging with. :-(
 
DSM
Moral of the story: never test.
 
ever
 
<3
Angular + Ionic
I've been debugging for 4 hours why my thumbnail generator doesn't work.
 
I've also just started writing my first proper Python package - so wanted to rejoin my Python people
 
8:56 PM
Cool, what will it be?
 
Well, turns out the image is not loaded because: <img ng-src="$ctrl.thumbnail"> should have been <img ng-src="{{$ctrl.thumbnail}}">....
@davidism ^I beat you
 
@davidism github.com/evenicoulddoit/… - OSSing some work I've been doing for my job. We make pretty heavy use of Rest Framework and were finding that with a heavily normalized dataset we were rewriting serializers with very slightly modifications over and over again
 

« first day (2271 days earlier)      last day (2678 days later) »