« first day (2784 days earlier)      last day (2165 days later) » 

3:48 AM
0/
 
 
2 hours later…
5:25 AM
cbg
 
5:45 AM
cbg
@Skyler MyModel.objects.update(my_field=new_value) should do it I think
(this would update all the elements in the table, including any updated_at (auto_now=True) fields for those elements)
Better way (if you want to update particular set of elements only) would be to filter before the update.
 
6:03 AM
Oighea! How's ya day goin?
 
6:25 AM
recbg
 
what are you doin' right now?
 
That's ... creepily specific.
 
how is it specific. I am not expecting a specific answer
 
@Mulliganaceous reading your comments :-p
 
@Mulliganaceous yo
 
6:35 AM
heeeeeeeeeeeeeeeeeeeeeeeeeeey! Oighea!\
 
?
 
@Mulliganaceous I guess I forgot to add a smiley there, so the humour was lost. It was not actually criticism.
 
It is my way of saying "Oy!"
 
I see!
 
without using pandas or numpy, how can i find percentiles of a file containing numbers seperated by newline
 
6:39 AM
Read, sort, ..., profit?
 
(quite a busy day nevertheless, need some rest today. See ya tomorrow)
(at lest that is the last day of may)
 
7:24 AM
cbg*
 
@AndyK cbg
 
7:35 AM
Cabbage
 
@IljaEverilä hey
 
@AndyK @IljaEverilä @PM2Ring hey
 
@Cosmo hey
 
Sup?
 
7:50 AM
@Cosmo not much and a lot
:)
 
howso? o:
 
8:05 AM
I just spotted an encryption question where the OP's using ECB encryption to send JSON data. That's probably not a good idea...
 
8:27 AM
RIP their privacy
 
Indeed. Several of the early Cryptopals challenges teach you how to perform various attacks on ECB. FWIW, several of the Python room regulars started on Cryptopals late last year, but I don't think any of us finished it.
 
@Mulliganaceous please don't do that.
cabbage
 
8:44 AM
If you act like an idiot, some people may suspect that you aren't acting. ;)
I must be in a generous mood today (or I'm an idiot :) ). The OP gave the expected output as text in his question, but the CSV input was in an image file. So I wrote code to generate the input from the output. That code ended up being longer than the code the OP needs. I wasn't going to post an answer until the OP showed some effort, but some kid posted a Pandas solution (despite the question making no mention of Pandas), so I figured I ought to show how to do it in plain Python.
 
Cbg
 
Hello, extremely truncated pi person. :)
 
All usernames with digits of pi are truncated to a certain degree...
 
I can't argue with that.
 
 
8:54 AM
Wonder how they obtained that data
 
Reminds me of the way Richard Feynman unlocked the combination locks on his colleagues lockers at Los Alamos by trying out digits of e.
Probably people sending info through ECB encryption ;)
 
I assume the y axis is the number of pi passwords of that length. From some pool of collected passwords. But that leads to the question: Who the hell is collecting plaintext passwords?
 
@3141 it's me or that graph it's horrible?
 
@3141 Well played!
 
what are both Y axis?
 
8:56 AM
Pi is amazing xD In one exam, I didn't know the answer, but I just wrote the answer lies somewhere in pi :p
 
well, what is the right Y axis?
 
I didn't even notice the right Y axis...
 
also, I don't understand the graph in general :/
 
On is a log scale, the other is normal.
 
ooooh I get it
the right Y axis belongs to the right half of the graph
still, don't get the point
for example, the first column in "5"
what does it mean?
 
8:59 AM
How lazy people are, using such immensive passwords?
 
@3141 I'd forgotten about that. I mean, I remembered his safe cracking exploits, but not the use of e digits. But of course it's so easy to remember the low digits of e, due to all the repetition.
 
If my password were 314159, and it was on this graph, it would bump the "9" bar up by 1.
Yup, but the digits of pi are probably better known.
to the general public at least
 
sure, to the "general public"
 
I must confess to having used pi digits as passwords. But even in my foolish youth I never used initial digits, only ones past 40 places or so.
 
Sorry, that spunds a bit pretentious...
 
9:01 AM
the "general public" would probably use their credit card / mobile PIN
 
Ironically, I don't use any at all.
*frantically changes passwords
 
Birthdays are very popular for numeric passwords / pins / lottery numbers. Some people use their own, but more likely their kids' or parents'.
 
I wonder what the probability of entering a random date as, let's say, the password of a random twitter acount and getting in is.
Actually, why not try?
brb
:)
 
rip twitter xD
I've got one weak af password for sites I don't care about.
 
Could I know what those sites are? For research purposes of course...
 
9:07 AM
After a few years of being obsessed with pi I decided to shift my attention to e, figuring it was a bit cooler, since it was more obscure, and you need to know a bit of calculus to appreciate its significance. But later I thought "Why should the transcendental irrationals get all the attention? What about the first one discovered, the square root of 2?"
Of course among the algebraic irrationals, phi gets a lot of attention, and I've certainly spent a lot of time playing with it and Fibonacci numbers, but I have a soft spot for good old root 2. :)
 
You'll never guess what my favourite irrational is...
XD
I wonder who that one guy who used 37 digits of pi for his password was, thinking that he was being super secure.
 
And every other password is unique and composed on the spot using a fairly simple generation algorithm that takes a phrase and mutates them well homonyms and special characters and such. The result is text that is generally only comprehensible with prior knowledge of the words used to form it. I generally spend a while picking the words. Not to make it more secure, because it's almost always unrelated to the site it's used for or to myself from the get go, but to memorise
I should really just pick and start using a password manager but eh
 
Make sure that you don't hit your head.
 
@3141 I've honestly forgotten most of the sites that still have such a password. Possibly dailymotion, if I even have an account there?
or some other site used only to consume videos, etc
No sites that connect to me, personal information, or financial accounts, though
I wonder what I used for SE though.
sec xD
does SE support fb/google/whatever login?
 
9:13 AM
Damn. I'm going to trawl through stackoverflow account and try every sognificant irrational I can. I predict a success rate of about 25%
 
If not, I've forgotten my password xD
 
Welp...
 
It's definitely not the weak one. I haven't added that to an account in years. And I think the only remaining account still used regularly is behind two factor
the only one I can think of is two factor anyway
 
I have a hunch that @AndrasDeak is the only person around who would use 37 digits of pi for a password.
You could always just get them to email it to you.
 
I mean you could mince the digits into a password i.e. every second letter to pad it out
 
9:16 AM
them being SO.
 
that would be secure, if your password is secure to begin with
wait, SO stores them in plain text../
 
@3141 I'm the kind of person who takes a lot of care to not have passwords that have anything to do with me
 
Oh I know one site that as it
 
I use this for making passwords, which you can read about here. I guess I ought to use something a little more secure, since SHA-1 isn't as secure as it was once thought. Actually, I should tell Tab (aka Xanthir) to get his act together and upgrade it: he's still a regular on the xkcd forums.
 
And I know this because I know it was hacked, my account on funimation is on a public database somewhere xD
and therefore every other account that uses that password/email combination
 
9:17 AM
RIP
 
I don't for the life of me know what those other accounts could be though
so my point is
I don't use any of them xD
all they have out of hacking it is my email tbh
why is annoying but
I have a spam filter
 
Interesting @PM2Ring. I should maybe start using that.
 
or just a password manager site that does the same thing + perturbation
 
Even though it uses SHA-1 it's not exactly vulnerable, since an attacker (should) never know your Master pass phrase. So its pretty safe for a similar reason that a HMAC using SHA-1 is still safe.
 
@Cosmo I'd rather do all the computations locally, thanks.
 
Or you could just write all your passwords down on paper.
Much safer.
 
Oh unreal got pwned
so that's why every now and then I get emails about failed login attempts xD
 
I'm unsure about the safety of those sites.
How are we sure they don't collect the data ? :p
 
“AbuseWith.US”
Not a site that I would consider “safe”
 
9:24 AM
@IMCoins I'm not sure they don't collect the data, no. It is accurate, though
 
I mean, coupled with some other things like... howsecureismypassword.net
People would create the database in which they'd be compromised. ;d
 
well you can always run sites like that last one offline tbh @IMCoins
then clear your cache or do it in a vm where you load it, disconnect, test it, trash the vm
 
I still say that nothing beats a notebook with my passwords in it.
 
You could.
But the important question : will the average person do that. ;)
 
with some of the recent vulnerabilities I'd basically assume all data has been breached by someone
chiefly the NSA
particularly all data that preceeds the annuoncements
 
9:28 AM
Yes, but you can't worry about the NSA since they basically catch nearly everything.
 
announcements* bah
 
Don't worry, I have a tool that can trump even the NSA
 
+ if you're not an important person, as they don't have the processing power to treat all the data, I wouldn't worry.
 
Incognito mode.
 
18 hours ago, by DSM
You can edit your comments within two minutes.
please make use of that feature
 
9:29 AM
Well the worry about the NSA is that if you ever become a target of the NSA you're dead on the spot
@AndrasDeak sorry, ty
 
Who are you talking to? Andras
 
follow the little arrow
that's another feature...
 
oh cool
 
Huh...
I never knew.
 
I'm marginally surprised that the NSA leaks (e.g. snowden) didn't create a war with america
 
9:31 AM
But my point about these websites wasn't that powerful companies already had our data.
What's dangerous is if the average hacker can get its hand on yours.
 
Who against America?
 
@Cosmo The major problem with those leaks wasn't that the NSA spies on everyone; it was that the NSA spies on US citizens.
it's a given that every intelligence agency spies on every other relevant country
 
I honestly don't see the deterrant value of nukes. The fallout of any major nuke strke would be catastrophic.
@AndrasDeak I'm aware
 
Perhaps. But there is some degree of neccesity. Terrorist attacks and the like have been thwarted before through such surveillance.
 
A nuke is not made to be used, but to impress.
 
9:33 AM
IMO the problem isn't the survelliance though
it's the computing power they have to infiltrate/hack resources
and create a botnet
 
By surveillance I mean collecting data on online habits etc.
 
and then attack aggressively
 
Only if they have a suspect though.
 
How does the NSA attack ? Do you have examples ?
 
Yeah. The surveillance isn't as problematic as the risk that they are constantly setting up their own backdoors
 
9:34 AM
I'm on the fence personally.
 
It's a slippery slope arguments, obviously, @IMCoins
 
@IMCoins there's a problem when you have too many. Although, this has spun to be too off-topic.
 
What I'm saying is that cyber warfare is, at this point, worse than nuclear warfare
 
(or if you have any for that matter)
@Cosmo but there's no kill switch for the nukes.
 
I remember after a terrorist attack (I can't remember which) apple offered to decript the attacker's phone, but the government wanted a backdoor to all Iphones. There was a stalemate for a very long time until I think the govt decripted it themselves.
 
9:37 AM
@Cosmo It's a large debate that's happening right now.
 
@shad0w_wa1k3r ... you're a programmer. You have faith in kill switches that by neccessity haven't been tested at scale?
Technology does not go back into pandora's box.
 
As far as I remember, Apple declined the NSA to unlock this particular iPhone, because it would mean that they/(+some hackers) could reproduce it to unlock every iPhone.
 
What I'm trying to say is that I believe I can live without the tech and the electricity, instead of dying in radioactive waste.
 
@IMCoins I think they probably have enough access already to institute attacks like the US election 'rigging' on a social level
and moreover, they have the power and patience to do it undetectably, in theory
@shad0w_wa1k3r well, only if you've stocked your bunker in advance
it's not your computer you should fear, it's your neighbours going postal ;P
 
@Cosmo but it does evolve. The internet might be a mess today, doesn't mean there aren't protections that you cannot adapt and secure yourself.
 
9:41 AM
Reminds me of this.
 
^
this
 
Talking election might be off-topic, but electronic voting, is by essence, wrong.
 
I can see "mechanical" voting being a thing
 

End of the world and other local poli

discussion imported from the python room
I suggest continuing there ^
 
The range of permitted topics is pretty broad in this room, but we generally avoid discussions involving politics or religion. We don't actually have a rule about that, but they're traditionally avoided in polite conversation since it can end badly.
 
9:49 AM
Fair enough.
I can see how that could end up badly.
 
cbg all, does anyone has the reference to a PEP or some other official discussion about fixing/leaving the following behaviour in Python3?
>>> t = ([1],)
>>> t[0] += [2]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    t[0] += [2]
TypeError: 'tuple' object does not support item assignment
>>> t
([1, 2],)
 
isn't that just a coincidence of how += is implemented?
 
yeah, both events you expect to happen, happen. No bugs :-p
 
It's annoying. And we have had some discussion about it in this room. Of course you can do t[0].append(2) without raising TypeError.
 
oh yeah, because it's t[0] = t[0].__iadd__([2]), where the right-hand-side appends, but the returned list can't be bound to t[0] because the tuple is immutable
> As Daniel noted, this behaviour is in accordance with the language definition.
It's obscure and surprising behaviour, but it isn't wrong.
 
10:10 AM
@AndrasDeak brilliant, cheers mate!
 
no worries
 
It may be in accordance with the language definition, but it's still a wart. But I guess it's just another reason to use .append rather than +=.
 
yeah, I realized I'd never use += on lists
 
@PM2Ring sure, that's without a question, as @AndrasDeak mentioned it, I've never used the += on a list myself either -- but it just came up as a puzzle today at work and I was surprised it was still there in Python 3
I would've thought it has been removed by now
(as there were so many backward incompatible changes introduced in the newer version)
 
@PeterVaro backward incompatible changes that are inherently good
 
10:16 AM
+= can be ok on local lists. But it's better to stick with .append. See what happens when you un-comment the a += [2]line in this code:
a = [0]
def f():
    a.append(1)
    # a += [2]
    return a
print(f(), a)
And you can't just wrap the a += [2] in a try...except.
 
now that's creepy
 
10:34 AM
@PM2Ring WHAT
 
You can't catch a SyntaxError with a try nvm, that's no syntax error
 
surely that's a bug
no the unboundlocal err-
wait
is it treating a as a method-local because of line 4?
shouldn't it only do that from line 4 onwards?
I thought python was liberal with scoping
oh I guess it's an error either way in that case but
sec
yeah I maintain my query
 
CPython optimizes local variables, and any variable that appears on the left side of an assignment is considered a local variable. The bytecode of the f function never even tries to look at the global scope when you access a
 
huh
fair enough
I was thinking from the context of rust, where you can freely create subscopes with no cost but
python is much more
literal to it's source code, being interpretable
 
>>> def f():
...  a
...
>>> dis.dis(f)
  2           0 LOAD_GLOBAL              0 (a)
              2 POP_TOP
              4 LOAD_CONST               0 (None)
              6 RETURN_VALUE
>>> def f():
...  a
...  a = 1
...
>>> dis.dis(f)
  2           0 LOAD_FAST                0 (a)
              2 POP_TOP

  3           4 LOAD_CONST               1 (1)
              6 STORE_FAST               0 (a)
              8 LOAD_CONST               0 (None)
             10 RETURN_VALUE
notice how there's no LOAD_GLOBAL in the 2nd function
 
10:43 AM
that explains some other weird behaviour I had way back
neat
 
11:04 AM
@Cosmo @abarnert has written some nice answers on this topic, eg stackoverflow.com/a/49538854
 
What happened?
 
11:23 AM
@PM2Ring thanks
 
Does anyone know any good ML competitions?
 
the more I thought about it I realised I had no basis for my assumptions other than like rust (+ possibly java?'s) nesting scopes
@3141 WELL
 
Reminds me of a riddle I posed to the room a couple months ago:
 
that depends on what you mean by ML
 
x = 23

def f():
    print(x)
    return
    #add a statement here that will make this program crash with something other than a Syntax Error

f()
The solution being, to force x to become a local variable by assigning to it. An x = 1 after the return could never possibly execute, but for the purposes of determining the scope of a variable, Python doesn't care
 
11:26 AM
if you mean deep learning, then no. If you mean AI in general (including, and often, heuristics), there's this coming up soon: codingame.com/contests/code-of-kutulu and the rest of the site's games and puzzles
Disclaimer: I have some bias since I contribute to CG
@Kevin I would have started with a yield but in fairness I do /not/ fully understand yield
 
yield is in the same general category of "statements that could potentially affect the behavior of a function, even if they never execute"
 
but can it be done with a yield? (idk how)
 
yield would turn the function into a generator. If the riddle was "add a statement here that will make the program terminate without printing anything", that would be a solution.
 
oh
oh it does do that
cool
 
For the original riddle, no yield-based solutions immediately spring to mind... I don't discount the possibility entirely, however.
 
11:32 AM
you can also redefine print
AND
you can declare to be a global, ironically xD
x = 23
def f():
    print(x)
    return
    global x
f()
it produces a similar error
 
@Kevin Higher Order Function guy just deleted his question. I was hoping he'd post a more tangible example, since it is kind of interesting, although I suspect that what he wants to do is impossible without some major changes to the design of his code. Oh well. I guess there's a chance that he'll fix it and un-delete, or just post a fresh question.
 
@Kevin does an IndentationError count as a Syntax Error in this class?
 
Yeah.
 
darn xD
 
@PM2Ring Too bad he deleted, since I had a quick-n-dirty solution: add another branch inside func: elif args[0] == "getParams": return lst. Now you can view the parameters as long as you have a ref to the function itself.
 
11:44 AM
I guess that'd be acceptable. But his code does odd things. In `x1=some_func([1,2,3])`, `x1` is a function, but he later does `x3=x1('add',x2)
x4=some_func([3,5,7])` and then wants to test if `x3` equals `x4`. So `x1` itself must return a function. Unless one of us is a bit confused. ;)
 
I didn't probe too deeply at any of the parts of the question that might violate my mental model of the problem :-P
SO questions are much like toothaches in that way. Play around with them too much and they'll only get worse.
 
Given his most recent edit, I think the general strategy of "provide some way to access lst, given a reference to the func object" works for his purposes... He needs to change the func parameter list to accept one or two arguments, though
 
@3141 you still around?
 
Alright, I posted my quick-n-dirty answer, and also a variant that uses function attributes... Let's see if I'm remotely close to what the OP wanted
Here's hoping that by "x3 should equal x4" he means "x3 should have behavior identical to x4", and not "x3 should have the same referential identity as x4"
This strikes me as a roundabout way of implementing classes without actually using classes
The if-elif dispatch is basically a suite of methods. lst is an attribute, which is by default private but he wants it to be public
 
12:08 PM
@Kevin Maybe he's coming from Haskell, or some other functional language.
 
I'm kind of morbidly interested in seeing what a full-fledged OO framework would look like, implemented like this. Complete with multiple inheritance and MRO and all the other things that make language devs curl into a ball and cry
 
I wonder why he hasn't responded to your answer? Maybe he's testing it...
I think I know what this guy wants to do, but some of his English is a bit confusing. I assume his timestamp's a float encoded as bytes, since you can't fit much of a timestamp into 8 bytes of text. ;)
 
Yup @Cosmo.
 
Did you see my response to your question re: ml comps?
 
12:23 PM
@3141 I don't know why nobody said kaggle.com
 
Thanks, I'll check it out.
Kaggle is kind of assumed when you ask about stuff like this,
the question is better phrased as: does anyone know ML comps that aren't on kaggle.com
 
Well, you ask for ML competitions. I answer accordingly !
 
I'm the only one who said /anything/, @IMCoins. SFAIK. Also yes, Kaggle. I like CG though as it's quite social
(You'll need to unlock the chatroom though; It's a spam-protection measure)
Which, doesn't take long anyway, but, CG is used in a number of classrooms, so, y'know
 
Again, I'll check out kaggle.
Sorry. Oops
 
btw guys
I'm too old to have learned python with pycharm
should I go and learn pycharm?
 
12:29 PM
is there really that much to learn about an IDE?
 
I'm not sure but
 
pycharm is not free AFAIK. But yesterday, jezreal told me about spyder which is the same but opensource
 
I never use it and I don't know if that's costing me anything
 
spyder is specifically aimed at a MATLAB-like experience which can sometimes trip up python users
 
I have a friend who uses it and raves about it. Not sure whether it's really worth it though.
Nothing wrong with good old IDLE.
 
12:31 PM
Ah I get free jetbrains stuff whilst I'm a student although I avoid using it generally (clion aside although vs code may take it's place)
Oh jeez I haven't used idle in years ew no
 
this sounds like something that you can start trying out and see if it works for you...
 
Well, pycharm is to python what Microsoft Visual Studio is to c#
 
I just have like, a text editor, and a dropdown terminal on a hotkey.
 
you should be able to gauge if you need an IDE, and if you do you can try pycharm to see what it's like
 
I know I don't /need/ one. But do I want one?
 
12:32 PM
so what do you expect from pycharm to do?
ah.
Go try it out, nobody here will be able to tell you what you want.
 
If it's free you might as well.
 
fair
I wonder if my jetbrains student license will extend through my phd
 
Higher Order Function guy seems to like the get_lst approach over the function attribute approach. Makes it more likely he's coming from a functional language background, since it doesn't require explicit mutable state
 
jetbrains should be able to tell you that
 
if not I guess I'll just wait until I'm earning enough to deduct it from my tax haha
pycharm community is a thing btw
 
12:35 PM
What are you doing your PhD on?
 
It's still loosely to be determined. I have an offer from a supervisor for a scholarship allocated to him for his research though
 
Well, personally I bought a humble bundle with 6 months free of pycharm
 
Which field though?
 
His area is basically AI for the purposes of software engineering tools
 
So, broadly CS.
 
12:37 PM
it's a good deal for me, right? xD
Nah it focuses on things like code-generation, program/language analysis, automated debugging/bug detection, etc.
Like creating linters on steroids
 
Haha, sounds interesting.
 
creating that button that makes you go "oops, there goes my code base"
 
So you will be the one that crafts the software that analyzes our code to see if it's readable or not ? :D
 
Yeah. More importantly, there's still plenty of research to be done on the underlying problems, i.e. AI interpeters, generative AI, etc
 
Anyway, I need to go, but ping me if you want anything and I'll be right back.
Rbrb
 
12:41 PM
The initial proposal he's sent me is basically about applying modern techniques like memetics to genetic programming
 
How is memetics different from genetics in a programming context?
 
genetics is a population of solutions, memetics is a population of solver-agents
 
my picture is that memetics is genetics applied to more abstract contexts
 
(i.e. a population of local searches)
 
Random question - does SQLAlchemy give you a function on a model that tells you whether or not the model's data has been updated in the db since the model object's creation?
 
12:46 PM
I'm not a SQLAlchemy user, but it seems that it needs to be implemented.
 
@IMCoins Probably not me persay. I'd be interested in devising something like a universal (semi-universal) programming-language translation approximator though. If that makes sense?
representational transformations really interest me for some reason xD
 
You want to create a soft that will translate to plain english what the code does ?
 
Nah screw that
think
python-to-c++
or python-to-java
 
Aaah. It already exists.
 
as a basis
 
12:48 PM
I need to remember the name
 
Yes but
those are specific mappings
and likely rely directly on the underlying compiled forms
Well I say that but
show me please xD
 
I had to find it back.
 
thanks o:
 
It's an open source project that will interest you I believe.
 
I need to cook spaghetti
 
12:52 PM
@AndrasDeak +1
@AndrasDeak I put some white wine in the meat
 
oh I specifically meant the pasta ;)
the wife's already done the heavy lifting
 
Ah it is interesting. It doesn't having the learning model implications though
 
@AndrasDeak hé hé
 
What I'm thinking of (for a research project) would ideally generalise to things like pattern-'transpilation' not just language transpilation and would explicitly be a learned model not an explicit design.
The end goal (long beyond what I would likely commit to) would be to contribute towards something that it could be used an abstract universal linter which accepts 'arbitary' goals other than just avoiding pitfalls.
 
@Cosmo Go and implement it. ;)
 
12:58 PM
one-lang is awsome though
It's just not ML so it doesn't replace an ML project?
@IMCoins Are you implying that I'm belittling one-lang? xD
 

« first day (2784 days earlier)      last day (2165 days later) »