« first day (1650 days earlier)      last day (3298 days later) » 

Air
6:01 PM
Can PyCharm refactor a long single line of e.g. JSON so that it's readable and indented over many lines?
Or any nested collection generally, like taking [[1, 2], [3, 4], [5, 6]] and turning it into
[
    [1, 2],
    [3, 4],
    [5, 6],
]
 
Python itself has a pprint module, if you want something programmatic
 
@Air I would bet that if the JSON is really long it could fit better in external data file
 
DSM
Can you write PyCharm extensions in Python?
 
Although now I see that pprinting that list doesn't actually change anything.
>>> x = [[1, 2], [3, 4], [5, 6]]
>>> pprint.pprint(x)
[[1, 2], [3, 4], [5, 6]]
Such an improvement!
 
DSM
And json.dumps(x, indent=4) does too much in the other direction.
 
Air
6:08 PM
pprint doesn't do much to small things that fit on one line
 
>>> pprint.pprint(x, width=10)
[[1, 2],
 [3, 4],
 [5, 6]]
Well, it's something.
 
Air
Not a big deal, I was just wondering if there was a quick right-click "fix this crap" option
 
Perhaps you can configure it in the settings where you can 'choose' what happens when you (code)format the file
 
DSM
Kevin could probably write a script so that whenever you pasted it into chat it would be nicely formatted. That would be almost as good, no?
 
6:24 PM
training is hard :\
 
You'll never get to Namek with that attitude.
 
Anyone here host a blog with ghost and want to tell me whether they like it or not?
 
I don't so I can't
 
@Kevin Well I always appreciate your contribution nonetheless :P
 
I've always believed that there's some marginal value in saying "nope, can't help you" since it at least verifies that your messages are being sent properly, and you haven't become a Sixth Sense style "ghost without knowing"
 
6:35 PM
stackoverflow.com/q/29806213/400617 not enough relevant information to reproduce the problem
 
DSM
@Kevin: yeah. There's nothing worse than someone Llanfair-ing a good line, for example! #longmemory
 
Oh I agree, I'm just giving you a hard time :)
 
@DSM I got that reference.
 
:D
 
DSM
6:43 PM
Oddly enough, Jon and Fizzy both linked the Llanfair-etc city page nine months apart to the day. Coincidence? I think not.
 
Illuminati, wake up sheeple, etc
 
oreilly.com/data/free/analyzing-the-analyzers.csp @DSM another thing you may be interested in.
 
cbg
@RobertGrant WIP
 
7:00 PM
Are questions about Mathematica offtopic for SO? Should i flag it for something specific? stackoverflow.com/questions/29832054/…
 
hmmm
guess it'd be more a match on math
 
@user5061 I would not say out of topic. However there is a specific stackexchange site mathematica.stackexchange.com
 
@XavierCombelle Yeah this is why i asking. Migration might be needed but it is impossible for this SE site, right?
 
@user5061 not worth the trouble,
could ask the user to delete the answer and ask on mathematica.se instead
 
@AnttiHaapala So in such cases i ask for self deletion? And link them mathematica SE?
 
7:12 PM
@AnttiHaapala could a moderator make the link ?
 
cbg
 
well...
 
Air
@iCodez Please don't tell people to cross-post =/
0
Q: Mathematica - Count number of zeros of a function in an interval

gurlukLet's say I have a function, F[x_,d_] = Sqrt[(x^2 - 1)^2 + d^2], and I want to count how many roots (no root, or one root, or two roots etc.) it has in an interval, say, 0 < x < 5 for a given d. I am not interested in the exact value of the root. For example, it has one root when d = 0, an...

 
1
A: Where is this on topic

Antti HaapalaThat question belongs to electronics.stackexchange.com. It is about electrical engineering, and only passingly relates to programming, as address decoders have many uses in digital electronics beyond that which is programmable. More so, there it would then probably be closed as a duplicate of exi...

 
Air
If you think it's off-topic and needs to be migrated, flag it for a moderator to deal with.
 
7:20 PM
i really need a simple solution to this: askubuntu.com/questions/608889/…
 
user2555451
@Air - Well, I was hoping the OP would clean up after himself and delete the one here. I only bother the mods when no action has been taken.
 
There are no answers to move; just delete it and re-ask it, @paul23. No need to make things complicated. — Shog9 ♦ Jul 3 '14 at 16:05
 
Air
@iCodez Ah, but they almost never do
And it's annoying to have to clean up after
 
user2555451
7:37 PM
@Air - There, he deleted it. I'll just flag in the future. So much for leaving it to the OP. :/
 
I am trying to validate data in Flask with simple form.validate(), it returns False. Validator on that one field is validators=[DataRequired()]
IN html it doesnt throw any errors, i used
{% for error in form.user.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
Just fine
 
Maybe Flask is what I should have spent my time on yesterday....
Instead I got distracted by real life concerns. House needed cleaning and all that
 
Flask is great, light weight and can be snuck into boring events
i mean.. ya.. great framework
 
I like flask alot
 
7:45 PM
any thoughts on no validation on backend? its some silly i bet..
 
lol i dont use that stuff ... this seems more like wtforms question or something
 
on front end it tells me, [This field is required.]
it is
 
I just hand validate stuff when I need to (I try not to need to when I can)
 
@KonformistLiberal can you check if my comment enlight you askubuntu.com/questions/608889/…
 
@KonformistLiberal have you considered just using cffi to directly call the c functions?
 
7:50 PM
does anyone know of a good texteditor that can load very very very big files without crashing?
that runs on windows?
 
Sublime won't do it?
 
scite and notepad++ are dying
I can try sublime i guess
 
I've never had to open a "very very very" big text file
largest I've opened are ~50mb
 
dying? I was just going to suggest np++ but I haven't really followed its development lately
 
crashing .... exausted memory
 
7:51 PM
@tzaman I think he means that it's choking on the file
 
oh
 
I suspect it will take some kind of specialized editor that is good about only having whats on screen in memory or something
 
@JoranBeasley gvim (if it fits in memory)
@JoranBeasley I think I opened some Go files with it
 
no thats the problem it doesnt fit in memory (well it sort of fits in memory...)
its a very very big logfile ...
 
.. LogParser?
 
7:54 PM
@JoranBeasley you can't just tail it?
 
yeah but its too much data and i need to explore it (one of those things where im not sure exactly what im looking for but hoping to recognise it when I see it)
 
Throwing stuff at the wall to see what sticks here. Trying to write a script that will allow a user to open a PDF that resides on their local system in a fixed spot with a fixed name, but I cannot run code on the local machine.
 
@JoranBeasley otherwise there is logstash.net/docs/1.4.2
 
Was thinking about building some Flask app and hosting it on an intranet site and have it go looking for the file through Windows shares, but it's kind of ugly
 
ehhh really how im doing it is just wrong ... i need to go eat ... maybe my brain will work better with food
 
7:56 PM
@JoranBeasley But one time I thought about making an editor which mmap a file
 
yeah I wrote a scanner that just iterates over it in python ... but that wasnt getting me what i wanted either (at least not yet)
(but it wouldnt crash at least)
 
What kind of pattern do you look for @JoranBeasley ?
 
Essentially we have non-tech-savvy users that generate a few reports during the course of the day. A few of these reports need to be manually printed, and can't be easily recalled if they forget to print them
so it's a call to helpdesk to remote into their machine, navigate to C:\program files\companyname\applicationname\rept\backup\report_file_name.pdf and print it for them
 
lol not sure ... something that looks wrong :P
2
 
At the same time: these are non-tech-savvy users that are forced (due to some poorly maintained software out of my control) to be administrators on their local system, and we don't want them poking around in the file system at all.
 
8:00 PM
@XavierCombelle ... I didnt create this logger and its probably better than that csv file from yesterday that someone had
but in all honesty im looking for anomolies ... not even sure what right now
(hence why i want to open it in some editor)
 
@JoranBeasley my best bet would be logstash
 
And the local machine that they're on is a passthrough for some credit card information, so I can't run code on it without being a PCI certified software developer
 
@AdamSmith you can't run software but non-tech-savvy can be administrators ? what kind of PCI thing is it ?
 
Every user on the machine is an administrator. It's fucked.
 
@XavierCombelle i tried it, still not working. My main question is about that error. Also I know go too and couldn't understand your avatar :) what does it mean?
 
8:07 PM
@AdamSmith you can make them run a windows script which create the shared directory it should not be considered as a program
 
@AdamSmith if administrife prevents a script, just a prose document? a friendly hand-holdy reminder of how to navigate the fearsome file system? They'll still call helpdesk but the third time helpdesk makes them read the document, maybe they'll get it.
Not an optimist, but a meliorist; not a pessimist but a pejorist.
 
@KonformistLiberal I got it installed, answer incoming
 
DSM
@davidism: pygame or pynauty?
 
pynauty. What's weird is that it expects you to build nauty, rather than linking to ubuntu's version
 
@XavierCombelle the directory is already shared. There's a \appname share on each local machine that points at C:\program files\companyname\appname, so \\COMPUTER-NAME\appname\rept\backup\filename.pdf is accurate in all cases.
Honestly I may be able to build something that just prompts for the particulars of which report they need (date and report name) and simply gives them a link to file://c:/program%20files/companyname/appname/rept/backup/filename.pdf
 
8:18 PM
@AdamSmith can't the support print the pdf on the correct printer ?
 
@XavierCombelle Yes: the point is to eliminate the call to helpdesk.
 
DSM
@davidism: I gave building it a go, but on import kept getting an undefined symbol error.
 
Yeah, check the error message more closely ;)
 
@AdamSmith you can make a flask app which does what the helpdesk does
 
0
A: Error installing pynauty: “error: command 'x86_64-linux-gnu-gcc' failed with exit status 1”

davidismThe full error message tells you the solution: you need to compile nauty with the -fPIC flag. Download nauty, unzip it, cd into the dir CFLAGS=-fPIC ./configure make Download pynauty, unzip it, cd into the dir ln -s ../nauty* nauty python setup.py build python setup.py install

 
8:21 PM
0
A: how replace 2 words in a file with python?

tommy.carstensenDuplicate of Python replace multiple strings I would rather that this question is closed and marked as a duplicate than you vote for this as an answer. import re rep = {"left": "right", "right": "left"} # define desired replacements here # use these three lines to do the replacement rep = dic...

Opinions? ^
 
DSM
@davidism: no, I mean after that. It built, it wouldn't import.
 
oh, I didn't try that :-/
 
Never mind actually, I'm not sure what would be the proper action
 
@vaultah I don't think there was any deliberate plagiarism there. I agree he could be a little clearer that it's modified from the accepted answer of the linked question, but he doesn't look to be rep-farming.
 
8:33 PM
@vaultah the correct answer would be stackoverflow.com/a/15448887/128629
 
Le sigh.
0
A: Dangers of sys.setdefaultencoding('utf-8')

Red Pill@Martijn: Your contributions to S.O. speak for themselves, they helped me many times (and I do have 15 years with Python on my back). Still - the answer given here does not only irritate the original poster: He asked for code which demonstrates that the switch is harmful - except that it 'hides'...

I voted down the previous post, and I cannot be bothered reading all that.
Not tonight anyway.
Haven't people heard about concise communication?
 
Thanks @Zero
 
@MartijnPieters holy wall of text, Batman
 
25K of text.
 
pastebin.com/hfmQRALs Can you guys tell me if my water pollution poem is good
^
 
8:37 PM
so almost 24Kb, my mistake.
 
but with fancy hlines!

Moment of nostalgia for the little `men working' shovel image
 
@davidism can you explain why your answer is working (if we solve permission problem) and also why i get this error, why this question is 2 separate questions?
 
@Stormy I got a syntax error when I tried to run it.
 
@KonformistLiberal I'm not sure what you mean by "why my answer is working", as I said why in my answer already.
The second question was unrelated because it has to do with a missing header file when building pygame. Why do you think it is related?
 
8:41 PM
@MartijnPieters I'm thinking of flagging it as not an answer, on the grounds that I can't tell whether it is an answer or not.
 
@davidism okay, so i have virtualenv but still i have the same problem?
you said install with virtualenv, can you show please how
 
no, sorry, that's beyond the scope of your question
consider reading the docs I linked
or just go with sudo
 
@davidism okay but did you used virtualenv or go with sudo? I mean why i got this error?
 
what error?
 
8:44 PM
last error, about permissio
n
 
I "used" either. Either one works. I recommended virtualenv because I don't like installing third party stuff to the system dirs.
Did you use sudo python setup.py install? What was the exact error after using that?
 
I tried it but it didn't work, i will try again
 
Please give a specific error rather than saying "it didn't work". It obviously worked, I just did it.
3
 
Between pyenv and virtualenv, is one preferred/better/more commonly used/doesn't eat kittens for breakfast?
 
pyenv is for installing python versions, virtualenv is for isolating environments
you can (and should) use both together
 
8:47 PM
Bah I had no idea what pyenv was. I just wanted to sound knowledgeable -- why'd you have to take that away from me @davidism! :)
 
okay it worked but i tried to import pynauty on python shell but i got an error: "ImportError: /usr/local/lib/python2.7/dist-packages/pynauty/_pynauty.so: undefined symbol: freeschreier"
 
although you only need pyenv if you're not ok with the py2 and py3 versions supplied by your distro
 
@AdamSmith also there is venv/pyvenv for Python 3.4+ (which is mostly the same as, but preferred over virtualenv)
 
@KonformistLiberal yes, it appears to be a pretty poorly designed library, however, I did answer the question about how to install it
 
I wanted the same ability I have with rbenv: Quickly switch from one python version to another, with appropriate per-version package management. That's why I started using pyenv.
I'll have to look at virtualenv, too.
 
DSM
8:49 PM
And now after all this we've arrived at the error message which stalled me so long ago. :-)
 
@AnttiHaapala I've never used it. Why is it preferred over virtualenv?
 
because it is the one bundled with the current version of python, and does the correct thing (tm)
 
@davidism how can we be sure that installation was completely correct and this import error is fault of library?
 
and it is a python module, you can run it as python -m venv
 
DSM
I suspect, but can't prove, that there were some rearrangements and so that function isn't exposed correctly.
 
8:51 PM
@KonformistLiberal because you even have the option to import it. So it's installed and visible to python, it just doesn't work right.
consider opening a bug report with the maintainer
 
@davidism thanks
 
@DSM I don't really do C, what do mean by rearrangements?
 
@WayneConrad It's a blog post.
Not an answer.
But still, it attempts to answer, I think.
So technically an NAA flag is not applicable.
 
@MartijnPieters I honestly couldn't tell, it's so rambly. I'll leave it alone.
 
Still, I voted on the post related to how helpful it is.
 
DSM
8:54 PM
@davidism: I mean standard English, nothing technical. :-) It looks like some files have been moved around and refactored.
 
@MartijnPieters but is it low quality? (Note that I have no idea what answer we're talking about)
 
@davidism I have one last question, it is very simple and dumb so I thought this is right place to ask: What do you mean by "installing to the system"? What could I do instead of installing to the system? - also I will give bounty but need to wait 22 hours, sorry.
 
Installing to the system means that you've used sudo and it's now installed alongside the system's Python, the one managed by apt.
I think this isn't a good idea because now you have non-apt controlled files in an apt controlled location. A virtualenv creates an installation location separate from the system, where you can install packages related to your project without messing with the system.
Read the documentation I linked to for more information.
As well as this (somewhat) official guide: python-packaging-user-guide.readthedocs.org/en/latest/…
 
lol ill lookinto logstash i guess ... but that looks like something ill need to learn which is cool ... but i really dont know if i have the time for it atm
 
9:01 PM
^ wat
@MartijnPieters that's gold, literally and figuratively
 
@davidism Isn't it?
 
@KonformistLiberal I'm pretty sure that you can accept the edit I made to your question, could you check if you can?
 
DSM
dsm@winter:~/coding/naut/pynauty-0.5/tests$ python test_pynauty.py
Testing pynauty on some larger graphs.
Start ...
a25               ... failed
a35               ... failed
[.. et cetera]
levi-r            ... failed
... done.
passed = 0   failed = 17
Well, that could've gone better.
 
The only match I can find for "freeschreirer" is in the _pynauty.so binary, so I don't see much hope of fixing that either.
 
DSM
I can get it to compile and run now, but none of the answers match the expectations, and I'm far too lazy to figure out if that's because of something shallow or deep.
 
9:10 PM
How'd you get it to import?
 
DSM
hacked setup.py.
 
so mysterious
 
DSM
Feels like they've gotten out of sync or something. I've used nauty before but within Sage or via the command line, never via pynauty.
 
So, uh, what did you change in setup.py? I'd at least like to fix that part of the answer, even if the library still doesn't work overall.
 
DSM
Oh, that. I started adding the object files one by one and then realized there was nauty.a.
 
9:18 PM
cbg
 
yeah, I noticed that and libnauty.so were provided by ubuntu's libnauty
 
DSM
Huh. I wonder if that's an older (and so happier) version, assuming my working theory is right.
Almost everyone else has escaped, so why not me too? Rhubarb for everyone!
 
rhubarb
 
 
1 hour later…
10:28 PM
Anyone here familiar with glade? I can't seem to figure out how to set the page type for a Gtk.Assistant page. I haven't found an answer online yet, almost to the point of asking on Stack Overflow but figured I'd ask here first.
 
no ... imho gui builders are the root of all evil ...
 
I don't like them much either, I'm just trying to keep my UI stuff separate from all the logic code.
If there's a way I can convert python code to a .glade file I'd like to hear about it.
 
That's imho how it is usually done, keeping the logic code separated from UI. Otherwise my whole life would be a lie.
 
10:47 PM
Well I'm pretty fed up with glade right now though.
To the point I'm considering using Qt.
 
11:32 PM
bah - I'm at the point of stop doing favours for mates
 
11:51 PM
Uh oh, was someone mean to puppy?
 
I hope not - that'd be animal cruelty!
 
What happened?
 
@AdamSmith between me and my mate.... somethings are personal
 

« first day (1650 days earlier)      last day (3298 days later) »