« first day (2339 days earlier)      last day (2613 days later) » 

12:06 AM
@BenjaminR What are you trying to do?
 
12:46 AM
Hi Marcus, it's okay, it was just to produce an accurate average value, but from testing converting the values to floats or Decimal has been sufficient
What that's in service of is much more complicated :)
 
 
2 hours later…
3:01 AM
@BenjaminR The decimal module should be fine for your harmonic sum. But if you need anything more advanced than basic arithmetic operations and square root, definitely check out mpmath, which can do all sorts of fancy functions, complex numbers, calculus, series acceleration, etc.
 
 
4 hours later…
 
2 hours later…
8:50 AM
Cabbage. I just got my first accept on a community wiki answer. There should be a badge for that... :)
I just spent an hour teaching a newbie about DRY. Maybe they'll give me an upvote when they have enough rep. stackoverflow.com/q/42743397/4014959
Thanks, anonymous upvoter. :)
 
It was me :)
 
9:14 AM
Thanks, @Ashish.
 
 
1 hour later…
10:40 AM
New programmers don't care about DRY. They probably just copy-paste until something is working.
 
10:51 AM
I think it's a stage we all go through. And I think there's a fairly high inverse correlation between how long a beginner has been coding for and how DRY their code is.
 
The real problem with that question is not the repetition but the fact that it is not minimal. If OP had constructed a minimal example (you don't need all the units, just pick a few) it would have been easy to understand the confusion and easy to get an answer. As it is now, it is not a useful question/answer. Too long and too unfocused.
 
Normally, I just ignore it, or if I think the coder has promise I'll drop a comment with the Wiki link. I felt sorry for that OP because they obviously put a lot of work into that code, and did a reasonable job at writing a good question. True, it's not a MCVE, but they didn't understand the problem well enough to isolate it.
But yes, they should've reduced it a bit by only including a couple of units. Ideally, during the process of making a MCVE they would've discovered that the problem was with input() always returning a string. And then they wouldn't have posted a question at all. :)
 
user6845426
cbg o/
 
user6845426
@Brandin I went with the merging after.
 
So, keep the image and text separate? I guess it may be better for users.
 
user6845426
10:58 AM
no no, merging the image n text into a single image. I thought it would be easier as the text has no searchable/editable action after being created
 
Maybe my expectations of newbie code are a bit low. At least it wasn't a GUI program with 200 lines of irrelevant crappy Tkinter code. We get lots of those, and a lot of the time the code's not even runnable: they've left out vital stuff needed to build and run the GUI, even though they haven't created a MCVE and you still have to sift through the piles of irrelevant code looking for the source of their trivial problem.
@dipper Is this for image + text that's being displayed in a browser?
 
user6845426
yeh
 
@dipper So why don't you use CSS to overlay the text on the image. Or use inline SVG?
 
Whether to put the text into the image itself, or keep it separate. Separate would look better. Every browser has a zoom function by the way, so even though you said there is no zoom function, actually there is.
 
user6845426
Ah its not being displayed on a browser. It was for a mobile app side project i'm working on. I was just trying to get opinions on how i should store the data on the server
 
11:05 AM
And this mobile app has no zoom function? Isn't that a standard thing for mobile apps?
 
user6845426
You can disable the ability to zoom on an image view
 
user6845426
(with mobile dev) at least
 
Ok. I know nothing about mobile app GUI frameworks, but I still expect that uniting the text+image client-side should be fairly trivial. OTOH, getting it to look good in all circumstances for all text/image combinations may not be trivial.
 
user6845426
I think i'm going to trial both and see which turns out the best
 
No, standard as in what the user expects. User: "Hey, I can't make out this image/text on this ridiculously small display. Let me pinch zoom that sucker so I can read it! What? It's not working. Rubbish app!"
If you merge the text into the image make sure it is high enough resolution to support zooming, because obviously the user will want to do that on a mobile app. On a Desktop you can get away without such a function because you can usually assume the user has a large enough screen. But for a mobile app, the screen is obviously too small.
 
user6845426
11:16 AM
hmm, true
 
And of course if you render the text into the image then that text will pixellate if you do try to zoom, like an old-fashioned bitmap font. So it's much better to keep it as text which is rendered with a modern vector font which looks good at any size.
 
user6845426
The text + image looks like this: imgur.com/tivQ8xJ theres only allowed for 1 line of text so hopefully text wont be too small
 
cbg
 
user6845426
cbg
 
Looks fine here but now put it on a mobile device. It will look too small. Or, say I'm on a Desktop, and I make a line of text "big enough" like with 10pt font or something, and then someone on the mobile app looks at it and says "What that is too small let me zoom that so I can read it!" That's what will happen.
 
user6845426
11:30 AM
What if the image size stays (Around about) the same size regardless of which device is being used and text font stays the same size
 
I don't think you can guarantee that. Even if you could though, preferences matter. If I'm on a Desktop I could probably scoot closer to the display. If I'm on a mobile device, the thing is so small anyway, getting closer probably doesn't help much.
The only way to know for sure is to give it to a user. See if he tries to zoom the mobile device. If even one tester tries that and it doesn't work then you need a zoom function.
 
user6845426
True. I'll have to just give it a go
 
@dipper Ok. The "Template example thingy" text is quite large and clear on my ZTE Android phone.
 
user6845426
Awesome. Thanks for testing
 
What is big enough depends on context, too. What if it the message was "Temp1ate example thingy". If your user is checking it for typos maybe he'll want to zoom in "is that a 1 or a l or a |", etc.
 
12:18 PM
And anyway it's not about how big it is but how you use it
 
Lemons.
 
user6845426
12:52 PM
@AndrasDeak you speak in CHATLAB too?
 
I'm not sure I understand the question
 
user6845426
I was asking if you spoke in the CHATLAB room as well. But then I clicked on the profile and answered it myself. Should of just done that in the first place xD
 
user6845426
I took a machine learning module in my course, i find it really difficult. A lot of math
 
@dipper yes:P
 
I don't like math. That's why I like computers, let it do the work.
 
user6845426
12:58 PM
I don't like math. I don't know why I took the module
 
user6845426
I seen 'machine learning' and thought it sounded cool
 
it doesn't help that MATLAB's peen posting several "machine learning in 10 lines of code" shit on their blogs, which usually go something like "data=read_data(); result=do_machine_learning();". I can hardly wait until we get questions like this on main :P
 
user6845426
I'm stuck trying to do linear regression xD
 
1:18 PM
 
DSM
i was surprised by how much I'd overslept.. and then realized I shouldn't have been. :-P
 
Someone had a good saturday night? :-P
 
stackoverflow.com/questions/42747736/i-have-earn-mony-app Only 1 more vote needed to put it out of its misery.
 
DSM
@AshishNitinPatil: so good that many entire provinces decided to honour it by adjusting their clocks.
 
@PM2Ring -13, nice
 
1:30 PM
I am using Django 1.10 and have my STATICFILES_FINDERS and STATIC_ROOT defined in the settings. I want to overwrite some 3rd party app's static files (css), but unable to do so by making changes in the files I have in my STATIC_ROOT (I did a collectatic and moved them there). Any pointers?
 
@AshishNitinPatil "unable to do so" why?
 
I made changes to the files, but they aren't reflecting. Browser cache is not an issue.
 
How do you know it is not in the browser cache? Are you using the ?nocache=123456blahblahblah trick? Did you try with another browser?
 
Tried in another browser, plus it's a local dev environment, I hit hard refresh every time.
 
What if you delete all the files? Sounds like an environment issue. Restart the server, etc (maybe it cached them?)
 
1:39 PM
I have tried restarting the server, doesn't solve the issue. Will try deleting.
 
Just do something crazy, delete every file and it should stop working, then restore them one by one or something. It probably will turn out to be something stupid in the end.
 
It still gets served after deleting, I suppose my settings aren't correct.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)

STATIC_ROOT = location('static')
 
Then start deleting more. Delete applications, delete your hard disk. Eventually it has to be somewhere.
 
Ok, will do that instead of speculating which file is getting served.
I am using a 3rd party app and it's default files (in site-packages/app/files) are getting served as a priority over my files in the project/static folder.
Confirmed by deletion. How do I mention priority for the static files?
 
Maybe you need to add something first in the STATICFILES_FINDERS list?
 
1:54 PM
Which one is best?
b = [i for i in a if i > 4]
b = filter(lambda x: x > 4, a)
Basically what I am asking is, is lambda functions better to use then list comprehension?
 
Better in what way?
 
Or the other way around, if they do the exact same thing, which one should I use.
I don't know.
They should be the same, so which one should I choose?
 
The first one is shorter, so if your measurement is number of characters, that one is better based on that criterion.
 
Would you recommend I just used lambda function half of the time, and list comprehensions the other half of the times.
Alright, so I should choose by the lenght and readability of it?
Well list comprehensions is almost always more readable imo.
 
I ended up removing the file finders and it seems to be working correctly. Will have to remember doing a collectstatic again when I add some other apps.

STATICFILES_FINDERS = (
# 'django.contrib.staticfiles.finders.FileSystemFinder',
# 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
 
1:57 PM
On the other hand, the list comprehension you have to write 'i' three times so if your criterion is repetition then the lambda is better. On the other hand the filter lambda approach requires the reader to be familiar with filter and lambda, so if your goal is readability for people not familiar with those words, the list comprehension is better, etc.
Just choose the one that you like and use it consistently.
 
Alright thanks ^^
 
@AshishNitinPatil It's only a local dev issue, so shouldn't be much of a problem I think. But will have to keep things in mind. So much efforts for stupid styling for the client.
 
That way someone reading your code can become familiar with your idioms. If you switch it around for no reason, a reader will say "hey why is it like this here? Is there some hidden reason for that?"
 
user6845426
cbg
 
2:10 PM
@SebastianNielsen The first one. It saves on making a function call for each list item. filter is ok if you're calling a fancy function, but if the function is just an expression, then use a list comp. FWIW, Guido hates map or filter being used with a lambda.
TBH, Guido's not a big fan of map or filter at the best of times. :)
 
2:37 PM
Cbg
Twilight Struggle and Eclipse board games both arrived today
Feels a bit like I've just received a Twilight: Eclipse game
 
 
3 hours later…
5:15 PM
help flag please -> stackoverflow.com/questions/42750344/… racist comment is racist.
 
5:47 PM
looks like it was taken care off...now I'm curious
 
Yeah it got removed. It was a comment about where the individual comes from.
 
bleh...I don't know why I keep putting off writing any code all weekend. Especially since I have a project to do that I will get paid for when I finish.
 
I'm voting to close this question as off-topic because we're not here to help you cheat on your test. — Zero Piraeus 2 mins ago
 
I have a higher tolerance for "no visible effort" questions than some, but when it's just a dump of the assignment's question text, I do get a little narked.
 
I did a face palm yesterday when I read a question where the OP installed git and then wondered why they could not create a mercurial repo...
 
7:08 PM
Hey does anyone know if it's possible to share a python code with someone, so that we both can live edit it together.
Just like google docs
But instead with python
 
@SebastianNielsen It's not necessarily limited to python. Look at things like screenhero.com
That's one example. There are several out there
 
Thanks idjaw
 
7:42 PM
@SebastianNielsen yes, it's possible
of course, you can type python in Google Docs...
 
@Code-Apprentice Heh yeah that was my thought
 
just can't easily run it
@idjaw aww...not accepting new users at this time
 
7:56 PM
@Code-Apprentice That is so weird
 
@SebastianNielsen why?
 
@idjaw apparently they are in the process of integrating with Slack
not sure why that means they cannot accept new users...
 
yeah that's really odd
check out floobits as well
it has PyCharm integration
you have to pay for private usage though. Everything is public on floobits under the free model
 
@Code-Apprentice No you can't write "python code" in google docs
 
@SebastianNielsen you can
 
8:04 PM
@SebastianNielsen why not?
python code is just text...
 
Uh my bad, you can >.<
You can apparently connect an app, that allows you to write code in python.
 
why do you need to connect an app?
just start typing letters
 
if I wasn't lazy, I would write something in docs and share with you
I am even lazy to change my christmas avatar
 
This looks like python code to me...
 
Alright now right a class code
It's going to be a pain in the ass.
Now try this instead.
 
8:08 PM
yes, it isn't an ideal solution, but you can type python code in any editor.
 
yeah when he said write it in Google docs, he was kiddint
 
Alright code-apprentice, but that wasn't what I meant.
 
no, I wasn't kidding. I was just being very narrow minded about features.
 
That's right khaja I was just kidding hehe
It was all a joke.
 
It's only Java that you need a fully featured IDE
 
8:09 PM
well, auto indentation is a nice feature to have
in any language
 
@Code-Apprentice that's not true
 
How so?
 
I can't type Python in emacs
 
why not?
 
because Emacs is pain
and I don't know how it works
 
8:16 PM
you just start typing...
emacs is a bit easier than vi. You don't need to enter some kind of edit mode.
 
nope
 
are you serious right now?
 
yea
I use Vim on daily bases
 
you still can type python in emacs.
It's entirely possible.
 
Oh, I am serious only about Vim and Emacs :D
 
8:18 PM
and I'm serious about this shotgun in my hands
 
Emacs shortcuts are too weird
 
they definitely take some getting used to.
 
I tried switching to it from Vim but after a few days gave up
 
Been many years since I used emacs...but I probably still have some muscle memory if I tried to use it again any time soon.
 
even with evil mode
the configuration was too complicated
either that or I am dumb
or both
 
8:20 PM
I started learning vim a little more lately when I installed Arch Linux on a desktop. Used it for some python coding but then I installed PyCharm.
probably won't use either emacs or vim much in the future. There are just so many other alternatives. Vim basics are good to know when you are installing Linux since it is almost always the default editor.
 
yea
 
Hey by the way, I am currently running windows 10 on my laptop, is it possible to completely remove windows, and install linux?
I know this is kinda off topic.
 
yes
 
and a lot of software defaults to opening vim when needed, like git commit
@SebastianNielsen yup! That's the best way to do it!
 
you can change git's default editor
 
8:23 PM
What is the chance that I mess the whole thing up, and my laptop is unuseable?
 
depends on the Linux distribution you choose
if Arch linux- 90%, if Ubuntu 5%
 
@khajvah of course...but in case you forget to, it's good to know how to navigate in vim...at least :wq.
 
Because I got a bad habit; I can't stop breaking things.
 
that's how you learn new stuff
 
If you want to get your feet wet without messing things up too much, install VM Ware or Virtual Box and install Linux on a VM.
 
8:24 PM
I have already kali linux install on a vmbox
 
@Code-Apprentice lol sometimes when I show something to my coworkers, I like watching them suffer trying to navigate or write something
 
I have already hacked some people. Hacking is much fun.
I stole their password
 
real h4x0r
 
how?
 
8:25 PM
:D
 
I made them download a word document
In which I had saved a macro
 
I hope they trusted you
 
that gave me a backdoor session
 
hm, Kali linux isn't quite a good choice for that
 
Now I got their passwords, and I feel bad about it.
But it was so exciting.
But I hate myself for doing it.
I am a bad person.
:(
 
8:26 PM
Don't feel bad
just post the password here
 
he should
 
Dude they trusted me. :/
 
the best thing is h4x0ring those who trust you
 
But I haven't used their passwords though.
 
doing something bad in a pre-meditated way and then feeling bad about it is pretty pointless if you ask me
 
8:27 PM
Well it is also easier to social engineer people who trust you.
 
@AndrasDeak I trust NSA
 
Yeah, it's like those "prank your loved ones into thinking you're dead" kind of practical jokes. Fun for the whole family.
 
that's why I have an Android phone
 
because Android is more secure than iPhone?
 
So have any of you tried to hack someone?
 
8:28 PM
no because I trust NSA
 
with all your dick pics...
 
tried and failed
 
NSA does all the h4x0ring khajvah wants
 
i never bothered learning
 
8:29 PM
it's an equally useful skill as pickpocketing or strangling children
 
it's more useful
 
haha wtf, that example though xD
 
you strangle a child, you go to jail
but unless you go too far with h4x0ring, you don't
 
only if you get caught
 
@SebastianNielsen Never. Apropos of nothing, there's a neat trick I learned the other day: just tell me your credit card number and I'll show you …
 
8:31 PM
Okay 424314-124-134
 
"guaranteed to be random"
 
95% of h4x0ring is social engineering anyway
 
I got my credit card from random.com
 
social engineering seens fun too
it's like hacking people
 
social engineering is really hacking
 
8:32 PM
hacking ppl
 
It's more phycological
I am not sure if I spelled that right.
 
I'm sure you didn't
 
so is spelling...
psycho
 
Phycology (from Greek φῦκος, phykos, "seaweed"; and -λογία, -logia) is the scientific study of algae. Also known as algology, phycology is a branch of life science and often is regarded as a subdiscipline of botany. Algae are important as primary producers in aquatic ecosystems. Most algae are eukaryotic, photosynthetic organisms that live in a wet environment. They are distinguished from the higher plants by a lack of true roots, stems or leaves. They do not flower. Many species are single-celled and microscopic (including phytoplankton and other microalgae); many others are multicellular to one...
 
seems right
 
8:33 PM
just to be clear: all the little twats who can't even write a helloworld program and go on and on about hacking being so cool annoy me to no end
 
I'm sure that's what he meant
 
hmm well, that was totally intended zero piraeus :D
That was what I was talking about.
 
Algae are pretty dumb; social engineering them is a piece of cake.
 
@AndrasDeak that's why I couldn't learn. All the resources I found were really bad step by step running random scripts
 
but they can never remember their passwords
 
8:34 PM
@AndrasDeak script kiddies
 
I wanted deeper knowledge
 
@khajvah the term...ninjad by Code-Apprentice
I also hate it that hacking has lost its original meaning
 
the original meaning is very broad
every human advancement is a hack according to it
 
@khajvah I could probably argue that so is the new one, but yeah
 
@AndrasDeak I tried explaining to a young kid...okay like an 18-year-old...that I'm a hacker according to the original meaning, and he didn't know at all what I was talking about.
 
8:38 PM
well, the old meaning hasn't been around for decades
 
@Code-Apprentice did he call the cops/
:D
 
of course, he wasn't really a techie, either.
bleh...need to go grocery shopping...
 
@SebastianNielsen if you want to be cool, become a white hat and do something useful instead of abusing those around you
 
well, time to log off for a few. rbrb all.
 
rhubarb
 
8:43 PM
Hey I haven't abused them, I just did it because it was exciting.
I haven't used it.
 
yeah, no, you did
 
Yeah+no seems logic
 
it's a language thing, I'll elaborate
 
But it's just not nearly as fun as creating a defence, as it is to break it.
not nearly*
 
"I snooped around my friend's house when he invited me over and made a copy of his keys. I can go into his house any time without his knowledge or consent. But it's not abuse because I'm not actually going to do it, it was just fun"
"and I could only pull it off because he trusted me"
 
8:45 PM
That was not the same.
 
yeah, totally not abuse :P
 
You make me feel bad about myself now.
 
good
 
but anyway, you could've hacked some non-trusting stupid person as well, you don't need friends for that
 
8:45 PM
How can I kill myself in the quickest way possible?
 
that doesn't make abusing the general trust of others any less problematic
@SebastianNielsen suicide might be an overreaction. It's never too late to build character
 
@SebastianNielsen I tried jumping
 
I just learned about it, and wanted to try it.
 
it works like charm
 
gotta go afk for a bit, be back later
 
Wow :-)
Q: How can I solve my problem?
 
In case you've not yet seen this:
Vietnamese police tactical training, via @starsandrobots https://t.co/0EiL2XQBjk
 
9:59 PM
Can I get some undelete votes for stackoverflow.com/questions/42753582/… please? I had an answer nearly written when it was deleted, and I think both Q and A are useful.
 
undelv-pls?
 
I'm guessing the cv-pls addon doesn't pick that up.
 
10:14 PM
possible
but I'm already unsure about delv-pls
 
lol....using numpy for something trivial...stackoverflow.com/a/42753858/1832539
oie oie oie
 
ohhhhh bleh
asker might be Hungarian
 
10:34 PM
@ZeroPiraeus Done
 
Thanks :-) ... answer posted.
 
Time to go play some ice puck
rbrb friends
 
have fun
 
10:52 PM
Ok, time to see if they managed to get Top Gear right this time … rbrb
 

« first day (2339 days earlier)      last day (2613 days later) »