« first day (2314 days earlier)      last day (2646 days later) » 

12:06 AM
close vote queue size was 8.5K around an hour back. Currently it is 7.8K. Looks like more people are getting involved in the moderation task (or may be it is a fluke as you mentioned)
 
no, CVQ is always fluctuating a lot
if it goes below 5k, I'll believe it's a signal and not noise
 
aaaaaaah the sky is falling! -Doomsday is here hide your children, FLEE!
... Stackoverflow changed its menu bar
 
 
4 hours later…
3:59 AM
Cabbage
no mcve, no clue stackoverflow.com/questions/42239709/square-root-function Best quadratic solver, evah!
 
4:22 AM
Would that be a good idea to switch to ERP? Got an opportunity to work in Microsoft Dynamics AX.
 
4:51 AM
Let's write a blog post about why node.js isn't a good choice for backend
 
So what's the better choice?
Or you're like Anything but this? :D
 
5:41 AM
yesterday, by Moinuddin Quadri
I just opened my blog and found that it was hacked. That hacker just made a post that it is hacked but haven't messed up the previously posted content. Gentle Hacker :/
It was due to vulnerability introduced by WordPress: wpvulndb.com/vulnerabilities/8734
Lesson of the week: Always keep your WordPress site updated
 
5:59 AM
@MoinuddinQuadri ...
@MoinuddinQuadri sorry but you have learnt nothing. The lesson should have been: "Do not use crappy PHP programs just because they're popular".
 
ca-badge
 
@AnttiHaapala I know nothing about client-side/front-end technologies. When I decided of hosting my own blog, WordPress was the first name that came into my mind. :(
Suggestion/alternatives are always welcomed
 
How can I autohide the navbar and defeat its purpose?
Can't you write a mini script in browser to hide that?
 
6:20 AM
@MYGz Why do you want to hide it completely? Why not just make it un-sticky?
 
Where is the option to make it unsticky?
 
@MYGz first starred msg
 
Much better!
 
Ah, right. They've added their code now.
 
6:35 AM
There should be 5 minutes youtube video to explain how StackOverflow works.
 
6:55 AM
cbg
 
7:09 AM
@MYGz I guess that could work.
 
Please don't add "thank you" as an answer. Once you have sufficient reputation... oh, wait — Machavity Feb 10 at 13:14
 
7:38 AM
:D. Better: Please don't add "What do you mean?" as an answer :P
New joinee's looking forward to unshackle the chains of restricted access :D
How I earn 200+ reps in a day:
Be very active and watch 3+ tags, answer the 1-5% questions that you can quickly answer.
How Martin earns it:
Just don't login and go out trekking.
 
How I earn 200+ reps in a day:
I don't
 
:D
When my rep was less than 2k, I used to edit Gordon Linoff's all lower case answers :D
He generally writes sql queries in all lower case. I would take the query and put it into sql formatter and earn my 2 points :D
Apart from watching tags, i'll watch his answers :P
 
8:11 AM
@khajvah answer questions
 
git seems to generate more money rep
 
I do it to get more chicks — Oliver Watkins Oct 27 '14 at 9:47
@OliverWatkins: In this community, you gotta make the rep first. Then when you get the rep, you get the power. Then when you get the power, then you get the women. — PM 2Ring Oct 27 '14 at 10:16
 
:D
ladies like rep
 
Women has rep
If you wanna be my lover, you gotta get with my rep~
 
my wife shouldn't have more rep than me
 
8:26 AM
Then you'd better be answering questions
Even I have more rep than you
 
@khajvah why not :D
 
@AnttiHaapala this :D
disclaimer: I am just jokeing
 
It's funny how chauvanistic views can ruin a marriage.
And it doesn't matter who has them or if both do
 
RIP my English
 
Can't even see what I type beacuse of super high resolution
 
8:36 AM
sorry guys, your spellings hurt my eyes
 
That's ok
I understand
 
@khajvah haha, first your opinions about vegetarianism, now this about earning more than women :D
do you feel your manhood threatened that much? :D
 
if I earn less money, I will drive a hummer to feel manly
 
You'd drive the hammer up where?
 
ok ok I fixed it
 
8:40 AM
I already earn more than my partner
It's nice
 
me too, since I don't have a partner
 
You could argue that Miss Right earns more than you since she does a lot of your work for you
 
I am loving this conversation :D :D
post lunch cbg
 
one of many productive conversations of sopython
 
This always happens when I take micro breaks from coding to chat
 
8:46 AM
I will happily marry a women earning more than me..I am even ok if she wants me to be a house husband ;)
 
Imagine all the time you'd have to code as a house husband
 
^ That's the thing. I will be coding for myself, and not for someone else
But I strongly feel that I'll be spending my entire day on SO instead.
 
@MoinuddinQuadri Exactly :D
@MoinuddinQuadri Why not both?
 
May be I'll be doing both. Though I am not sure.
The only way to figure that out is to help me find such a wife. PS: Connect me if you already know someone ;)
 
Sadly the ones I know are already married
 
8:51 AM
I know it's my fault that this conversation started, but it might be a good idea to let it wind up...
 
@PM2Ring : You may rotate the knives if you feel like. Anyhow I will be leaving in 5 minutes. Today is a busy day for me (Production deployment)
 
I'm debugging why an exception isn't caught. Fun stuff :)
 
@Gemtastic Would work on stuff I like only
would be great
 
9:14 AM
i need to do some easy scraping on a webpage that needs me to login, how do I do that?
 
first, you log in
then, send cookies with your requests
 
hm okay
i'll try that
 
9:28 AM
Cabbage
Odd. Downloading some software packages…
English: 1.0 MB + 3.0 GB + 259 MB
German, Dutch, French, Italian, and Spanish (all in one): 1.0 MB + 2.8 GB + 269 MB
 
cbg
how to start the morning
@PM2Ring The stylish plugin plus this script gist.github.com/g00glen00b/328bba7fdb392d3b8a7f2e6f7d468dbc
and SO is back to better colors
 
9:48 AM
@PM2Ring probably its just wrong encoding
 
I just noticed the our university stopped offering visual studio to students :'(. "It is mainly used by students for C# and we do not wish to support a non public language".
 
c# is open source
 
@marxin You mean the compiler?
 
yeah and some libraries as well as far I remember
not all of course
 
.NET went open source
but I don't think microsoft's compiler is open source
mono is, though
 
10:21 AM
Is the first answer to my question spam? stackoverflow.com/questions/42246373/…
Should I flag it?
one more answer with spam from the same guy... ugh
 
@Sosi It looks spammy to me, although the product it's advertising is free & open source. But the author may be intending to add commercial links if the post survives.
 
I flagged it as spam. It has absolutely nothing to do with my question, so why even advertise an open source program that has nothing to do with it
 
@Sosi I've flagged them both. But I guess another flag won't hurt. :)
 
@PM2Ring thanks!
 
I see the mods have already done the needful. The posts are deleted, and so is the user.
 
10:32 AM
Thanks so much, this was very efficient!
 
Don't thank me, thank our tireless mods. :)
 
I had went to the user's profile because I was wondering whether you could flag him instead of his posts. I couldn't find such a feature, but I guess it was unnecessary given the time it took for mods to notice he was spamming
 
user6845426
Good morning all :D
 
@Sosi Stack Exchange doesn't have that. It would be open to abuse. And the mods need to see the evidence before they act.
 
@PM2Ring yes. Anyways, it seems to work well as it is :)
 
10:46 AM
Exactly. If you suspect spam and it's not obvious from the flagged post, use a custom flag, clearly explaining why you think it's spam, or a spam precursor.
 
11:18 AM
cbg
 
11:30 AM
So learning C# after postponing that for just a bit too long... It makes me wonder: what is the reason that python is so heavily based on "exception catching" (and eafp by extension) and C#/java/C++ are based on if-statements (LBYL) where exceptions "should only be used for cases truly exceptional, not for things like verifying input".
What fundamental difference in the language drives this distinction?
 
@paul23 Python exceptions should be used only for true exceptions too
using exceptions for flow control(instead of if) is bad
 
uh, a common base is converting a string to a numeric: in python one would use an exception for this, and "expect a numeric unless proven otherwise". C# has for example the "TryParse" function that works without exceptions.
 
how would one use an exception in Python?
how would you convert a string to a numeric?
 
try: int(in); except ValueError as e: print("this won't work")
 
no, you would do int(in)
it can't convert, of course it should raise an exception
how else do you expect it to fail?
oh C# does it with return values
that's bad
 
11:38 AM
That's very C-like
Where you have to use return values etc. for signalling exceptional cases.
 
Well look at how tryparse works: it has an "output" variable, and a return value. - But this is considered "much better" by all topics I read about it, even well endorsed highly updated (modern) places.
 
@paul23 It depends. If you expect the input to be mostly valid, then using exceptions keeps the code clean and is faster than equivalent if based code. OTOH, if the exception is likely to be raised more than 5-10% of the time, then if-based code will be faster.
Python exception handling is very fast if the exception isn't actually raised, but it's rather slow when the exception is raised. That's because Python frames are bulky OOP things compared to C stack frames, which aren't much more than stack pointer manipulation.
 
Python would return a Tuple[bool, Optional[int]]for a "tryparse" method
 
that's ugly
 
11:40 AM
One or the other being "much better" might be open for debate and depend on use case a lot, like @PM2Ring pointed out.
 
writing an if every time you use the function isn't pretty
 
A lot of bugs stem from ignoring error signalling return values, whereas you have to actively silence exceptions.
 
what else are exceptions for lol, if not for these cases?
 
The real power of exceptions is when your code has many layers and you allow an exception to "bubble up" to the layer that knows how to handle it.
 
pretty > ugly
 
11:43 AM
@IljaEverilä Well yes: but if it's so open for debate you would see a mixing inside a language of eafp and lbyl paradigms. Whereas stackoverflow seems to be quite all in for one thing - per language that is.
@PM2Ring I'm always wondering how "good" that is, since it can also lead to highly difficult code where you can't follow the code path easily. - you don't know from which point you entered the exception clause..... - Similar to the old goto statements.
 
@paul23 You either don't need to know that or you will know that, if it's done properly
Exceptions are part of the function/method interface
 
@paul23 Huh? Exceptions carry that info with them. Ever seen a Traceback?
 
If I use a function, I will know what it can throw in which cases
 
@PM2Ring Oh yes, in python one can use that. But that's not inherent to "exception handling", it's just something python does.
 
I know it can throw 1 exception and I know when it can happen
the key is, that same exception might come from a function used inside the one I am calling or it might chain from 50 other functions, but I don't care.
 
11:53 AM
@paul23 It's actually no surprise that some idiom is embraced inside a language.
And it's not that clear cut even in Java. The following comments also point at an important use case for EAFP: file handling. You cannot do LBYL safely.
 
> better
I don't agree at all that if is better even if it is faster
99.9% of the time, you won't care about those microseconds. If you do care about them, don't use Java or Python
 
Well I just wonder why some languages use "X" while others use "Y": with visually very little differences between the mechanics regarding X or Y. Take another example: a list of objects, or "nones" - where you access say a "name" field.
In C# you would put `if x != null`, catching an exception is not the way to go here.
Whereas in python an `hasattr(x, "name")` is frowned upon (even though it is more generic that testing against the magic value "None"). Instead you except for those special cases.
 
I'm starting to think that this discussion is just proving that C# is not Python and vice versa...
 
@IljaEverilä I am mad that that answer got accepted and has that many upvotes
 
@IljaEverilä I know that, I just wonder "what fundamental choices made those differences" - specific to the case of exception handling.
 
12:05 PM
The cheapness of "good paths" in Python, as mentioned by @PM2Ring, probably has had an effect.
So if for example you look up some values from a dictionary using a key you know will most of the time be there, then just go ahead and look it up, and handle the exceptional case of it not being there when it comes.
 
@paul23 FWIW, hasattr works by calling getattr and catching the exception.
 
And more often than not getattr(obj, 'attr', some_default) is good, which avoids the issue altogether :P
 
Cabbagey afternoon y'all
 
Hi, Intrepid.
 
I have fought off the death and am now back at work. What exciting times we live in :)
 
12:14 PM
Cabbage all
 
We got a cool change here last night. It's only 24°C here now (at 11:15PM). Yesterday it got up to 32°C here on the coast. A few days ago, some parts of this state got upto 47°C.
 
47!?
are you on Mercury?
 
Damn, That'd be real hard.
translate: De peeps van de gala commissie zijn aanwezig voor eventuele vragen
(from Dutch) The peeps of the gala Committee are present for any questions
 
wrong chat >.<
 
@paul23 Be a bit careful while using non-english on chat.so (unlike chat.se, chat.so needs all convos to be in English)
 
12:19 PM
Man, and I thought we had it warm in the isles just now ;)
 
@excaza Not quite. :) I'm in Australia, in the region known as the Coffs Coast. en.wikipedia.org/wiki/Coffs_Harbour
 
deadly animals and deadly heat not here cabbage
 
it's like -10 in here
and is snowing
 
-1 to 1°C here, roads covered in ice :|
 
yeah, roads are terrible
I spend 30 minutes in traffic jams every morning
 
12:22 PM
20 min here :P
 
well, actual journey takes 1 hour which usually(if there is no ice) takes 30 minutes
 
Ah, read it wrong, sorry.
I total at 20 min from home to office, as I can use the highway most of the way.
They spread salt on the highway so that it stays clear.
 
I see like 2-3 accidents every day. All of them are small but they have to wait and close the roads for the insurance company cars to arrive
I don't know which genius thought about this law but a few dozen people waste 20 minutes each so one guy can save $100
 
prime minister must've lost $100
 
it's because of mandatory car insurance law
 
12:28 PM
@AndrasDeak We don't get many deadly animals in this neighbourhood, apart from the occasional venomous snake or spider, but they aren't hard to avoid. OTOH, we do have kangaroos, which are mostly harmless.
 
@khajvah Here you can just exchange isurance info with the other and handle it later with their insurance. There's of course the risk that the other participant will then later deny everything, so usually people wait for police to show up and check the situation. So in the end, the same thing.
 
:D
 
here there's a kind of form you can fill out on the spot if both parties agree, and then there's no backing out
 
they wanna make it so that if the accident is tiny and the payoff is gonna be less than about $70, you can take photos and move on
 
12:30 PM
Taking photos sounds like a reasonable way of handling things.
 
not having mandatory car insurance is another
 
> linux-kernel
 
@PM2Ring a kangaroo would scare me to death IRL
 
Hmm, how'd you handle a case where some broke bloke dents you, and they have no insurance? In such a system would your own insurance then cover, and handle getting the money back?
 
12:34 PM
@IljaEverilä people usually don't have insurance for their own cars
 
@IljaEverilä no, that bloke will give you the money
 
And when they don't?
 
I guess with no mandatory insurance it would be "sue the guy if he doesn't pay up"
 
@IljaEverilä call the police
 
or the eastern equivalent: "hire henchmen"
 
12:35 PM
I think I prefer having mandatory insurance, in the end.
 
@AndrasDeak Although we get them hanging around in the nearest town they tend to avoid close contact with humans. They're only dangerous if they feel threatened and they're cornered so they can't escape.
 
@IljaEverilä yup, doesn't sound like a bad system, even if it's a pain in the ass at times
@PM2Ring sounds a lot like a paramite
 
I guess where it would go horribly wrong is if there's no real competition in the insurance business and it's mandatory.
 
@AndrasDeak nerd
 
There are quite a few at the local golf course. They mostly ignore the humans, but if the humans get too close the roos just hop a short distance away.
 
12:36 PM
very nice of them:)
@IljaEverilä here there's real competition, up to the point that there are occasionally scandals that an exceptionally low-bidding insurance company refuses to pay up, and then disappears without a trace
but we're not exactly the epitome of legal business practice
 
@AndrasDeak that makes no sense for car insurance
 
how so?
 
I mean, running away
 
how so?
 
because it won't be that expensive to make it worth running waya
 
12:39 PM
you clearly seem to think that fender benders are the main kind of insurance events here
 
what else?
btw, you use nice words sometimes
3
 
aw
that's adorable
 
especially the overtone
I don't have any statistics, but there are a lot of major (read: expensive to fix) insurance events here. If a company is exceptionally cheap, it'll draw a lot of customers, and sooner or later these cheap customers will cause a major accident.
but note that fixing a car here is never $100, I think a paint job for anything costs just that much
especially if insurance is paying; people tend to allow larger error margins with respect to price if somebody else is paying for it:P
 
I imagine the insurance cost is higher too
we are cheap in here
 
12:47 PM
probably yes
Rhubarb for now, off to do some administration. And when I say administration, I mean in the sense of <highly NSFW clip from the movie Eurotrip featuring Lucy Lawless, Hans and Gruber>
 
I thought it was called research
 
Hi I'm have a tool (not written by me) that uses pickle to dump os.environ. It works on python 2.7 but fails under python3. Reproduce:

```
import os
import sys
import pickle
pickle.dump(os.environ, sys.stdout)
```
Python3 error:
```
AttributeError: Can't pickle local object '_createenviron.<locals>.decode'
```

Any ideas?
 
@mortenvp Convert the environment object to a dictionary:
import os, pickle
env = os.environ
d = dict(env)
s = pickle.dumps(d)
newd = pickle.loads(s)
print(newd == d)
newd == env is also True
 
1:09 PM
Hello
 
@PM2Ring that worked thanks
 
I lost 6 hours trying to insert some content in a ***** sqlite database
like this
import sqlite3

conDB = sqlite3.connect('dataDB.db')

conDB.execute("INSERT INTO stress (URL, CONTENT) VALUES (?, ?)", ['1', '2'])
conDB.commit()
SQL table is
CREATE TABLE stress
       (ID integer primary key AUTOINCREMENT,
       URL           TEXT,
       CONTENT       TEXT);
 
Hello all! Quick question, in this folder structure:

/mycode
/app_using_my_code

I was told that _app_using_my_code_ did not need to `sys.insert.path` in order to load modules from mycode if I converted mycode into a package. It still sounds weird to me (how would app_using_my_code `import` my package?). Is that comment accurate or can you give me some pointers please?
 
1:29 PM
@Purefan Have you read the import docs?
 
@PM2Ring Yeah, and to my understanding unless mycode sits inside the app_using_my_code an import without sys.insert.path would not work
 
@Purefan If You've made mycode into a proper package, and that package folder's parent folder is in the Python path then the interpreter will be able to find mycode.
 
@PM2Ring Yeap, that's why I've needed sys.insert.path because mycode is not readily available to app_using_my_code so I guess that settles it for now. Thanks
 
@IsabelCariod what's not working?
 
morning cbg
@AndrasDeak Don't forget your FLÜGGÅӘNKб€ČHIŒßØLĮÊN
 
1:42 PM
@Purefan What version of Python are you using?
 
morning cabbage
@Purefan that means you probably haven't installed mycode
 
@PM2Ring 2, and I read the modules doc
 
@Purefan Are you familiar with using pip to install stuff?
 
@PM2Ring Not really, what I know of it is that it fetches python-software from a repository but since @WayneWerner mentioned "install" Im reading about installing python packages
 
or copy it somewhere else on disk
you do that with pip install -e mycode, if you're testing/developing mycode, or you a) turn it into a sdist with python setup.py sdist b) turn it into a wheel with python setup.py bdist_wheel (requires the wheel package installed, which you can configure in your setup.py) and then you can upload it to pypi if it's a general purpose, open source package, or upload it to your own custom pypi/warehouse install, or you can just install it from your dist directory in your app folder.
good job, SO chat for not ordering my messages properly because timeouts -_-
 
1:49 PM
@WayneWerner lol! I think the way we'll go with is "copy it somewhere else on disk". This is a database swiss army knife kinda project, and it will be used by other projects in the company, its being git-controlled and might be implemented as a git-module or as part of a terraform+powershell deployment
 
@Purefan Ok. pip is mostly known as a tool for installing stuff from the PyPI repository, but it can also be used for installing local packages. Best practice is to install stuff to a virtualenv, but that's not totally necessary.
But listen to Wayne, he knows more about this stuff than I do. ;)
 
@Purefan I'm not sure what your company deployment looks like, if you guys have a Phoenix Server... but you probably should be hosting your own pypi equivalent
we're deploying our packages to an Amazon S3 bucket and just copying that bucket to our servers using Salt. If you use Salt, or Ansible, or Puppet, or Chef, or whatever, you could do a similar thing
 
@PM2Ring Thanks :o) @WayneWerner We use Team City to build artifacts that actually get stored in S3 as well, so I think we're already in the same pattern, difference is we use terraform but its the same idea actually :)
 
But the TL;DR is that you should not add a folder to the sys.path. pip installs stuff to the site-packages/ folder that already exists, either to the system site-packages/ folder, or to the site-packages/ in the virtualenv if you're using a virtualenv.
 
^ a million times that
 
1:57 PM
hehe awesome! :) going to bring it up to the team
thanks a lot guys!
 
If your sys.path contains a folder like my_packages_folder/ you're doing it wrong!
 
@Purefan So yeah, when you build mycode you should deploy the artifacts to S3. Also all of its dependencies TBH. Then copy all of those dependencies to something like /opt/python-packages or whatever path. Then do pip install --upgrade --no-index --find-links=/opt/python-packages mycode
 

« first day (2314 days earlier)      last day (2646 days later) »