« first day (2254 days earlier)      last day (2697 days later) » 
00:00 - 14:0014:00 - 00:00

2:11 PM
I got stuck on Day 7
and skipped 5 and 6
gonna try day 17 today
 
@Code-Apprentice how?
5 is simple brute force
6 is quite straightforward too
 
Today is my first day in this chat room and I have seen "cbg" at many places. Can someone please tell what does that mean? :/ The results that I got on Google are: :P

CBG Cannabigerol
CBG Cinema Buying Group
CBG Capillary Blood Glucose
CBG Carrier Battle Group
And I am sure you guys are not discussing about medical terms over here ;)
 
It's mentioned in our room rules sopython.com/chatroom
 
The fact that you're asking that question indicates that you didn't read the Room Rules thoroughly. :)
 
As mentioned, it is my first day and I was not knowing about the rule book. Let me take a look. Thanks for the link :D
 
2:25 PM
@vaultah well, near the room rules:P
 
Wow. Salad language. Nice innovation ;)
 
@MoinuddinQuadri cbg. If you go to a new room, assume a set of rules by default and make sure you try to find them.
they are usually not hidden very well:P
 
Yep, And don't go to a room and do something which is against their rules. People tend to take rules quite seriously.
 
I believe that's self-evident; the non-trivial part is realizing that there are rules
 
Salad language is just a bit of fun, there's no obligation to use it. We mostly just use a few words from it. And one or two of the regulars hate it.
 
2:28 PM
@AndrasDeak: In fact it is my first time in any of the chat room. I was even not knowing that such rooms exist :(
@BhargavRao: I am just curious, what are the consequences of breaking any of the rule of chat room?
 
The mod queue is empty again. Dunno what to do. :/
 
@MoinuddinQuadri ah OK then:) Consider my advice for the future.
 
@MoinuddinQuadri 1 kick -> 1 minute ban.
 
the owners of the given room handle your violations as they see fit
@BhargavRao I don't think you should bring flags into this
 
There are other auto flags that are raised, which is a mod only secret.
 
2:29 PM
any kind of flagging for breaking local rules is a misuse/abuse of the system
 
@AndrasDeak Ah, Yes. That's true
 
@Moinuddin in short: room owners can kick you, and each time this happens, you'll be automatically banned from the room for a longer period of time
 
You guys are terrifying me. I should be thoroughly reading the rule book
 
1 min, 5 min and 30 mins. IIRC
 
but within the limits of normal social interaction, it shouldn't come to kicking (it often does, though)
@MoinuddinQuadri just listen to what people are telling you:)
 
2:31 PM
@MoinuddinQuadri For a first offence we normally just explain what you've done wrong. But when someone repeatedly breaks the room rules we consider that disrespectful behaviour and the Room Owners (people whose names are in italics) will respond as they see fit.
 
@MoinuddinQuadri you asked "what are the consequences of breaking the rules" :P
 
@PM2Ring: For example you, as I can see your name in italic. Is that correct?
@AndrasDeak: I am glad, I asked that :P
 
also, @Moinuddin, since you're new to SO chat: 1. you can edit/delete your messages up to 2 minutes after posting; 2. you can reply to specific messages, like I did in my previous 2 messages; 3. if you post multiline code, ctrl+k will make it a code block that preserves indentation; 4. read the "faq" and "help" links in the lower right corner
(0. read the room rules ✓)
 
@MoinuddinQuadri full list available at chat.stackoverflow.com/rooms/info/6/python
 
Also mods names will be blue in color
 
2:35 PM
@AndrasDeak Thanks for the information @AndrasDeak. I appreciate it :)
 
There are 4 resident mods in this room. Catch em all :P
 
Chat Room rules are mostly common sense & respectful behaviour. OTOH, a room may have rules that may seem arbitrary, and those rules need to be respected too. If any of our rules seem a bit weird, rest assured that they're there for a reason, but we're happy to explain the rationale if you're curious.
@MoinuddinQuadri Correct
 
Hello in this script is a function named "dummy_task" stackoverflow.com/a/3490944/6660785
Can anyone tell me how that function is called?
 
@BhargavRao @PM2Ring @AndrasDeak: Reading the rule book now. Don't want to unknowingly break the rule and kicked-out from here. I have zipped my hands for sometime :P
 
@IsabelCariod you pass it an integer
@MoinuddinQuadri haha, good thinking;)
but with minimal consideration for your fellow humans, you're unlikely to break them. Maybe the "don't post new questions here" rule.
Most conflicts between users and room owners arise when users fail to read what others tell them and act accordingly
 
2:40 PM
@AndrasDeak what you mean with an integer?
 
@IsabelCariod what in the world could I mean?
or maybe: what do you mean then?
if my answer doesn't answer your question, you need to rephrase your question so that it reflects what you want to know
 
In that link is a function
def dummy_task(n):
    for i in xrange(n):
        time.sleep(0.1)
    return n
 
I know, you asked about it
no need to post it here
 
and I want to know how to use
 
yes, and I told you that
if "you need to pass it an integer" doesn't answer the question to you, you need to read a few tutorials, I'm afraid
do you know how python works?
 
2:43 PM
I understand to give a number
 
Melon everyone
 
(@Moinuddin you might understand now what kind of problems might arise)
 
but it has no logic
 
/OFF
in C, 21 secs ago, by Peter Varo
the worst news we can have for today: How is NSA breaking so much crypto?
 
@IsabelCariod let me know if you have a specific question
 
2:45 PM
/ON
(although the article is a year old one, I only find it today)
 
@AndrasDeak Yup. Everything mentioned there was common sense. And I don't think I would have ever broken them. But it is noce to know I am on right path ;)
 
> There seemed to be no reason why everyone couldn’t just use the same prime, and, in fact, many applications tend to use standardized or hard-coded primes.
ah, the age-old bottom line of security vulnerabilities
def random_integer():
    return 4
(too lazy to search xkcd)
 
@MoinuddinQuadri you probably won't be surprised if I tell you that most offenders don't have 12k rep:)
@PeterVaro thanks;)
@PeterVaro I'll don my tinfoil hat and wonder how many of those bad design choices were influenced by NSA itself
I'd say "probably not worth the effort", but then again Snowden
 
@AndrasDeak True. Probably I have been here for quite a significant amount of time. That's why* everything already makes sense to me.
 
2:50 PM
yup
then again I know at least one 30k user who keeps asking off-topic and awful questions on main, so I'm aware that this is only a tendency
anyway, good to have you here:)
 
@IsabelCariod In a real program you'd have a function performing a useful task instead of dummy_task. But to explain the benefits of threading we just use dummy_task to waste some time in order to illustrate how threading works. Otherwise, the author of that code would have to make up some task that takes time to run, and that would distract from the main purpose of the demonstration.
 
@AndrasDeak well, for me at least this is some sort of good news -- I always had the theory, that intel and/or amd are installing backdoors in their processors. which means. it doesn't really matter how hard an algorithm tries to generate randoms, if that random is only pseudo one (a very good one ofc)
 
@AndrasDeak Melon for you :P
 
@PeterVaro Well, these things are not exclusive, you know;D
@MoinuddinQuadri :P
 
but this article shows us the possibility that cracking these cryptos is doable without hw backdoors
@AndrasDeak i know, but I still can hope..
 
2:54 PM
It would be "hilarious" if NSA was like "oh shit, we could've just broken those few primes used in Diffie–Hellman, would've been much cheaper"
 
LOL :)
 
cbg
 
@PeterVaro The NSA doesn't have a monopoly on smart crypto people. And it's (generally) not that hard to test if a random number generator is as random as it's claimed to be: there are standard stats tests for that sort of thing.
 
@heather cbg
 
cbg
 
2:56 PM
@PM2Ring which tests are based on what exactly?
 
have to make a cipher for social studies, so i'm writing a program so it can be encrypted without any work on my part. it's giving a few errors, though, would anyone mind looking at it?
 
@PeterVaro means, deviations, correlations, skews, etc, I presume
 
how will they decide wether the sequence we have is pseudo or real random?
 
cbg, Green Bean here :D
I am already in love with cabbage language <3
 
@heather if you post it somewhere and provide a bit more information than "few errors", you have nothing to lose:)
 
2:57 PM
hmm, fixed that problem
 
that was quick
 
@AndrasDeak, true =)
 
you're welcome :P
 
i need to be slower about asking questions =)
 
well, coming up with an MCVE solves 90% of debugging issues
 
2:59 PM
MCVE?
 
MCVE.
(google)
 
I guess -> MCVE = Minimal, Complete, and Verifiable example
 
If a "random" number comes out of an algorithm then it's pseudo-random. But for crypto purposes we make sure that our PRNG have a nice big period, and we seed them with enough entropy to ensure that their outputs are sufficiently unpredictable. OTOH, it gets a little tricky when you make restrictions on the range of the PRNG, eg when you want random primes.
 
"minimum complete and verifiable example" according to google
 
yup
 
3:01 PM
@PM2Ring, out of curiosity, when you use randint in python, is that random or pseudo-random?
 
first google hit is stackoverflow.com/help/mcve, looks good:P
@heather everything in your computer is pseudorandom
except stuff like HotBits
 
oh, okay
 
@PM2Ring and how exactly are we seeding it?
 
until your quantum computer is ready and implemented with actual qubits, deterministic algorithms are all we have
 
3:04 PM
neat, thanks:)
haha, that SQL outlier
nobody uses it, everybody asks about it
 
@heather Well, as Andras said, it's pseudo-random. However, you can influence how random it is. By default, Python uses the Mersenne Twister PRNG, which is rather good, and much better than the simple Linear Congruential PRNGs that were standard a few decades ago. However, you can tell the random module to use other randomness sources. Take a look at the docs for class SystemRandom in the random module docs.
 
(though I have to add cation as well: for example the way git separates C from C++ is very unreliable)
 
right
 
@PeterVaro os.urandom() is pretty good on typical systems because it gathers entropy from unpredictable hardware events, including timing info from input events. When you look at timestamps on key and mouse input events at microsecond (or better) resolution, you get a fair amount of entropy in the low order bits.
 
oh right, the good old "now keep mashing the keys while the key is being generated" routine:)
 
3:09 PM
@PM2Ring and don't you think that is going through the CPU?
 
@AndrasDeak I only read the problem. I am working on a strategy now
 
@PeterVaro You may enjoy this article: Myths about /dev/urandom
 
let me read it then :)
 
@PeterVaro Sure. But if the CPU was doing sneaky stuff to bias it, it would be detectable if the biasing were significant enough to worry about.
 
@PM2Ring how?
 
3:12 PM
There was a dupe for this stackoverflow.com/questions/41199918/…, Can anyone remember?
I'm 100% sure there was one.
 
Also, we don't use "raw" entropy, we use a process called "whitening" to turn the raw entropy into a random bitstream with a "spectrum" approaching white noise. FWIW, one of the oldest known whitening algorithms was invented / discovered by Neumann János Lajos aka John von Neumann. :)
 
:)
those weird hungarians..
 
Exactly. :) Look, I'm not saying that what you're suggesting is impossible. Just that it'd be really hard to do it (IMHO) with any degree of success without it being detectable by people in the crypto community who go looking for that sort of thing. Of course, I'm not a crypto expert, so don't take my word for it. Do a search on the Crypto & Security Stack Exchange sites: the topic of various kinds of backdoors has been discussed there numerous times.
 
well, I desperately hope you are right!
 
My source of randomness is high schoolers. They're "soooo randommmm xD"
 
3:22 PM
@BhargavRao Self-deleted
 
=)
try elementary schoolers @KevinMGranger
 
I can't, child labor laws.
 
lol
8th graders are sometimes old enough
 
Question - how can I remove the whitespace from a datetime output?
 
how can take the list alphabet = [chr(x) for x in range(97, 123)] and make it case insensitive?
 
3:26 PM
2016-12-17 15:23:07.303273 # output
2016-12-1715:23:07.303273 # desired output
 
@heather We don't let 8th graders in here... unless they're writing quantum gate simulators. :D
 
This doesn't change anything:
import datetime
string = (str(datetime.datetime.now()))
string.replace(" ", "")
print(string)
 
@PM2Ring, before you made the edit, I was like, um...*(::starts slowly backing away::)*
=)
 
haha:D
 
@JakeStokes Strings are immutable in Python. So when you want to "change" a string you need to create a new one instead. So the str.replacemethod can't change its argument. Instead it returns a new string that has the output you specify.
 
3:29 PM
Ah okay thanks
Duh
 
Whoever is above 13 is fine with SO (legally). Whoever is not should work hard to hide their age, or they'll get terminated.
 
@JakeStokes So you need to do string = string.replace(" ", "")
 
Done... much appreciated.
 
@AndrasDeak, phew
i'm good then =)
 
@heather I know, otherwise I'd have warned you the first time we interacted:P
 
3:32 PM
@Jake BTW, string is a bad choice for a variablename because it's the name of a standard module. In the early days of Python string used to contain all the string manipulation functions. But in modern Python they're now methods of the str type. So these days string mostly contains a bunch of useful string constants.
 
Mods and staff are legally obliged to nuke underage users:/ While hating to do that. So the best is to never reveal your underage.
 
well, i'm glad i'm not underage/nuked
 
Meh, I find using the string module is so rare it's fine to use it as a variable name
It's unfair that both str and string are taken! What else should we call it, char_star?
 
@heather Well, that list only contains lower-case letters, so I'm not quite sure what you're asking.
 
The catch-22 is that if you know that you should tell this fact to an underage user, they have already debunked themselves being underage.
Oops, I missed heather's question. I think str.lower() (or maybe string.ascii_lowercase) might be of interest
@heather like here :P
 
3:35 PM
@PM2Ring, it only contains lower case letters, but I'd like it to not care whether the input letters compared against the list are lower or upper case, because I'm manipulating the index.
you know, i think i'm just going to input messages that are all lower case.
 
NO, check the link
 
@KevinMGranger I often use s for a "throwaway" name that only exists over 2 or 3 lines. Otherwise, I try to use a more meaningful name. And let's face it, neither str nor string are particularly meaningful when it comes to naming a specific string (rather than a type or general string module). ;)
 
@AndrasDeak, I did, but then it won't print any upper case letters. i realized that what I want is impossible =)
 
@KevinMGranger you should call it definitely_not_bytes to mess with zedas
@heather OK, but I don't understand either:)
 
My main side project is implementing a network protocol, so I work with a lot of "throwaway" variables that refer to types. I guess I'm an exception :P
 
3:39 PM
you mean tmp_exception to avoid shadowing
 
grooooan
 
@heather Give us an MCVE and we'll show you how to make a case-insensitive version.
 
@PM2Ring, this is my current code
 
import string; alphabet = string.ascii_lowercase
 
@heather Ok. Firstly, your encryption algorithm may not be reversible for all possible choices of add and multiply.
 
3:46 PM
@PM2Ring, what do you mean?
 
Secondly, if you want to preserve case information then you'll need to encode your letters into a set of 52 numbers, not 26.
 
@PM2Ring have you heard of Intel Management Engine?
 
@PM2Ring right, i don't think i need/want to do that
 
@heather I'll try to keep this simple. Your coding process turns each letter into a location number from 1 to 26. If you multiply location by either of the factors of 26 (2 or 13) and reduce the answer to the 1 to 26 range then you get collisions. Eg, 2*2 = 4 and 2 * 15 - 26 = 4. So when you try to decrypt the message you can't tell if that 4 was originally a 2 or a 15.
BTW, instead of doing while location > 26: location = location-26 you can do location = location % 26, or more compactly, location %= 26. The % operator is called "modulus".
 
3:56 PM
@heather Modular arithmetic is a fascinating branch of number theory. The basics are pretty easy to understand. And the more advanced stuff can be used to make some of the most powerful forms of encryption currently known.
I really have to go. It's almost 3AM in my time zone & I've got a busy day of playing music tomorrow. Rhubarb!
But before I go... That location %= 26 won't do exactly the same as your loop because your location values run from 1 to 26. But it's simpler to make them run from 0 to 25, and then % will do what I said before. :)
:really gone:
 
4:12 PM
@PM2Ring rhubarb, have fun tomorrow:)
 
rhbrb @PM2Ring, thanks for the explanation
 
4:39 PM
What is main thread? E.g, Tkinter is designed to run from the main thread; run all UI code in the main thread...
 
4:59 PM
cbg
 
Wife got a great message on her laptop:
> Chrome is draining your battery faster. Switch to Microsoft Edge for 32% more browsing
 
lol:D Smooth.
How did MS show that message on Linux?
 
She's on a Windows machine
She has a Surface Pro 3
 
5:14 PM
anyone here ?
 
Saturday and Sunday is pretty quiet around here
Not many people are here. If you have a question you can post it and if anyone passing through can/wants to answer, they will. I'm in and out a lot, so don't know how useful I'll be
 
http://stackoverflow.com/questions/4131123/finding-the-most-frequent-character-in-a-string
here how do i count total no. of frequent characters found ?
 
What is it about that answer that is giving you difficulty? It seems to have a few ways to do this in Python, including the most common way to do it, using Counter from the collections module.
 
@idjaw that's fabulous
 
yup. Wonderful marketing built right in to your OS
 
5:37 PM
@idjaw I asked and didn't got an answer...
 
Hey guys, got a short question.. Can you explain to me why my regexpression doesnt work? I need to use python 2.7.5... This is my expression: pattern = re.compile('\d{4};[a-zA-ZäöüÄÖÜß. -]+;.+') Im reading a csv file, till the first ;, there must be 4 digits, till the 2nd ; there must be letters from a-Z, umlauts and . or " " or . , then after the 2nd ; there can be any sign...
Now my problem: In the second "part" it doesnt accept umlauts like äöü or ß. In the third "part" where i dont specify the umlauts, its no problem when they occur... i didnt find any helpul answer yet..
 
5:58 PM
@ConstantinM Did you put # -*- coding: utf-8 -*- at the beginning of your scripts?
27
A: python : working with german umlaut

Cédric JulienDid you add an encoding in the begining of your source file ? # -*- coding: utf-8 -*-

 
yeah :/
 
wim
@MarcusS well done!!
@PeterVaro I don't think the measures are very good. For example, it usually takes more lines to write something in java than it does in python. So by one axis (number of lines changed on github) it will make java seem more "popular"
 
6:23 PM
having looked at a few day16s, it seems I'm the only one who Generatored All The Things
 
@AndrasDeak I did, too
I wondered if there might be a way to just calculate the checksum without actually generating the disk data.
@AndrasDeak Are you looking at solutions on the subreddit? I haven't looked at anything there yet for any of the days.
 
6:44 PM
@Code-Apprentice There is
 
@Code-Apprentice I only see functions there:P
I meant sopython solutions
and I only looked at a few, which were linked here
when my original solution went overboard with memory I thought that the only viable approach was with generators (rather than trying to reduce the memory footprint of my existing approach)
so now the only thing that is stored in a list is the separator bit sequence which I couldn't mathematically figure out in 15 minutes so I just stored it
 
@AndrasDeak once I got all the functions working, the final solution was pretty easy.
my solution didn't use hardly any memory but it takes about 14s
for both parts
 
7:12 PM
just watched rogue one
can't say much else except: fanservice ++, sw_plotholes --
wife wasn't impressed :D
said that every star wars movie has the same plot
 
yes, there were definitely a lot of easter eggs for the fans
 
and it felt much more the stuff from star wars that I like, from the jedi knight/jedi academy games and such
than these new iPodtroopers of mr Lens Flare.
RIP Heimlich
 
aww, rip
 
paraphrasing Darth Sidious: "the tragic irony was that though he could keep others from dying, he could not save himself".
 
7:52 PM
I fear tomorrow's AoC:D In case marxin was right, and Sundays are tougher
 
So far it seems like last year's were tougher in general
 
possible, I'm new to it
 
Advent of BFSMD5Bruteforce
 
yeah, the md5 is strong with this one
 
@wim it has flaws, that's for sure, yet it can give you a fair idea what is going on..
(also: we have to create a better one, I guess..)
 
8:03 PM
@MarcusS it still makes me learn new patterns, so as a non-dev I find it great
 
Yeah -- it's still fun. I just wish it had more variety (as there would be even more patterns to learn from that)
 
right...
 
8:55 PM
just got rid of the "toolbar" panel on my KDE desktop. This should be fun getting used to
of course, even with it, I alt-tab a lot anyway.
 
just use gnome
disclaimer: I have an irrational dislike for KDE:P
probably because when I was first subjected to it, it came across as wanting to look too much like windows
haven't touched it since, and that was long ago
 
9:14 PM
I have used Gnome a lot recently. Decided to check out KDE when I built a new system.
Prior to the last few weeks, it has been a while since I used KDE. I wanted to see what is different.
 
10:00 PM
@AndrasDeak How long did your Day 5 solutions need to run?
 
not too long
 
I'm running around 30s each.
much longer than any of my other solutions so far
 
that one is pure bruteforce, so don't worry about it
it can't really be done in a smart way
I have a solution which ran for an hour
@Code-Apprentice 18 seconds for part 1
 
What's your processor?
Mine is a 2.8 GHz Intel Celeron
 
i7-3632QM CPU @ 2.20GHz
 
10:04 PM
hmm...don't know how a Celeron clockspeed compares with i7
 
part2 45 seconds
 
okay, so I guess I'm not doing as bad as I thought
 
no, as I said, that day is brute force and there's nothing you can do about it
other days have much higher variability in efficience
but I'm usually on the slow end of the spectrum:)
 
so far my solutions have run fast enough that I haven't worried about efficiency. My slowest was prior to this Day 5 one was about 10 secs, including unit tests.
Day 5 runs about 1:40 total with 43s for unit tests. So just less than 1 min for both solutions.
 
yup
that's prefectly fine
 
11:11 PM
huh, I think I've solved a problem I've been struggling with or a month now
 
That sounds like a good thing
Python related?
 
no:)
I mean, yes, good thing; no, not python
part of the problem seems to be that I almost solved it a week ago, I just didn't realize it at first:D
 
11:54 PM
This problem will be the end of me. Can someone spot why when planet_Orbit(MERCURY) is not commented out JUPITER orbits, but when it is, JUPITER does not orbit and simply stays in the center of the screen without any shading?
This is done in processing for Python by the way ^
 
00:00 - 14:0014:00 - 00:00

« first day (2254 days earlier)      last day (2697 days later) »