« first day (2384 days earlier)      last day (2564 days later) » 
01:00 - 16:0016:00 - 00:00

1:26 AM
Anyone else watching Genius?
 
 
4 hours later…
5:48 AM
cbg
2/3rd Fanatic, 33 more days to go for the gold :D
 
6:04 AM
cbg
 
6:22 AM
cbg
 
Are there 80 free, or is there a refrigeration unit hidden in the centre of the block?
 
@AnttiHaapala Someone's in for a good Wednesday(?) treat!
 
6:59 AM
morning room
 
7:16 AM
cng-ning
 
Cabbage
 
Interesting reading the stack exchange blog recently : "JavaScript captured the #1 most popular programming language slot in our 2017 Developer Survey (as it has done since 2014), as well as the #2 “most wanted” language (after only Python)."
Alyssa Mazzina on April 21, 2017

JavaScript captured the #1 most popular programming language slot in our 2017 Developer Survey (as it has done since 2014), as well as the #2 “most wanted” language (after only Python).  Translation: JavaScript is still here and going strong, and most of you are happy about that.

Here are some companies searching for JavaScript developers right now.

Amsterdam-based Tripaneer is looking for a JavaScript engineer to join its team “full time and long term.” “This is your opportunity to join a fast growing startup and make your mark.” …

 
8:22 AM
@ZeroPiraeus :P yeah it is not real packaging
but they promised that they can sell it if anyone wants to buy, and shipping will be for free...
but considering that it weighs over 500kg...
 
I keep getting this message (which doesn't have any noticable effect) everytime I try to plot some 3D shape with matplotlib (well, no, with a package called KWANT that used matplotlib for 3D plotting): https://i.imgur.com/Y4vke9U.png
Could anyone tell me what to do about it/what it is trying to tell me? This is in Jupyter by the way.
 
8:39 AM
I have the following setup in Django models.py
class Video(models.Model):
    filename = models.CharField("File Name", max_length=100)
    title = models.CharField("Video Title", max_length=250)
in my html template, i'm trying to return information from the video table using this, but it's returning no data, just a blank page, any idea why? There is data in the table.
{% for video in Video %}

<div class="row">

    <div class="col-md-3">

        <a href="{{ video.filename }}">{{ video.title }}</a>

    </div>

</div>
{% endfor %}
 
Hi All
In Python, Is there any to find Data loss and additional Noise between two WAV or any other audio file after comparing them ?
I came across a few libraries like "audiodiff" and "Pydub"
But I am not sure if I can achieve the intended result !!
 
user6845426
cbg all o/
 
cbg
 
9:00 AM
Django problem solved, stack exchange rocks!
 
9:25 AM
@Gary If you ask a question here and then ask it on the main SO site please let us know so that we don't waste time creating an answer in here.
 
@PM 2Ring That's exactly what I just did, or at least I thought I did! I only asked my question after I posted here, and got the answer in about 1 minute of posting! Then posted here straight away :)
 
@Gary Oh, ok.
 
It was answered by the top Django answerer apparently according to his bio, and yes pretty amazing how you can get a question answered by an expert so quickly
Just continually impressed with what a great climate 2017 is for learning languages with all the resources etc available
how can i change my profile photo in the chatroom
i'm struggling to find out
 
@Gary You need to change it on the main site - stackoverflow.com/users/edit/6549908
 
Thanks @AshishNitinPatil, i just updated it maybe it'll change later
 
9:31 AM
Yes, it won't update unless you come back into the room after leaving it.
 
oh it just updated
nice
 
Did you rejoin the room? Or did it (pic change) happen automatically?
 
the room reloaded itself somehow not sure why
 
9:48 AM
100k points just from 1 answer. Efficiency... - stackoverflow.com/a/506004/2689986
> Co-founder of Let Me Google That For You...
 
that guy is a like the Mark Zuckerberg of SO
one answer what all that was needed
 
@AshishNitinPatil That's ridiculous.
 
Basically, he got the SO swag with just a single answer.
 
everyone with they do the same
 
I can understand getting a lot of upvotes over the years if your answer helps lots of people, but an answer that short really doesn't deserve that many upvotes. IMHO.
 
9:55 AM
it feels like a power law in the application, one single event shaping/affecting manys
 
FWIW, a few months ago, one of the questions I answered got on the Hot Network Questions list and it got way more upvotes than I expected. Sure, it was nice to get the points, but eventually it got a bit embarrassing to get so many upvotes for such a short answer.
A similar thing happened with this one, but at least I put some effort into writing that answer.
 
Well, javascript user base is expanding at crazy rates...
 
how random an answer and a question can have on people...
that randomness is fascinating
 
10:46 AM
@AshishNitinPatil don't forget the rep cap
cbg
 
11:14 AM
Does anyone know about any library in python
 
@AndrasDeak Ah, yes, yes. Backs the rationale for the capping.
 
that could let me find out the data loss and additional noise
 
@AseemYadav check out our rules here sopython.com/chatroom
 
for a WAV file after comparing it with another one
@BhargavRao alright!! So if nobody answers that means nobody knows about it
got it !!
 
Yep. Check the other rules as well. :)
Welcome to Sopython room
 
11:18 AM
not new here !! but yeah, I thought people were busy discussing something else so they might have skipped answering
it would be better to remind them :)
 
11:37 AM
@Aseem you can also put your question in one message, although that would admittedly reduce dramatic effect ;)
 
@AndrasDeak hahaha...sure
 
(you can also edit/delete messages up to 2 minutes after posting which can come real handy)
 
12:16 PM
cbg all
quick string/list question
i'm trying to compare a joined list of letters to a string
and despite the fact that the console output is identical, it's not showing as truthy
        if "".join(obfuscatedString) == chosenWord:
            print ("Correct! Well Done!")
            correct = True
            break`
simple enough
they both look identical in the output
 
don't look at print(string), look at print(repr(string))
 
What he said. It's a bit hard to say if you don't show us obfuscatedString and chosenWord. What does this print?
print(repr(obfuscatedString), repr(chosenWord))
 
and very minor note: I wouldn't put a space between print and the parentheses
either it's python 2 in which case the parens are redundant, or it's python 3 where it's a function call
 
ok, thanks... let me try that, and I'll fix those prints while I'm at it
 
I've got a suspicion, due to the indentation of that code, that it's inside another block, perhaps a loop. In which case there's a whole category of possible error causes that aren't related to tricky invisible characters only detectable via repr
 
12:23 PM
ah ha! I think I have it
there's a line break in chosenWord
 
we're all assuming/hoping that "it's not showing as truthy" comes from a local check inside/before the if block
 
@Kevin Not to mention the break statement...
 
chosenWord is taken at random from a text file
with a word per line
 
strip() it and you'll be fine
 
12:24 PM
sweet
 
Ah yes, readlines() and its surprising tendency to leave in line breaks. That's why I do lines = file.read().split("\n") or lines = [line for line in file] instead
 
strip() worked a treat
 
for line in file: also retains the \n. But you can do lines = file.read().splitlines()
 
Only busting out the latter if I want to do some manipulation on line before storing it in the list. lines = [lines[::-1].upper() for line in file] or what have you.
 
thanks for your help folks
 
12:26 PM
no worries
 
@PM2Ring Ah, I forgot.
 
str.splitlines takes an optional keepends arg, which is handy.
 
now I can bask in the satisfaction of completing my hugely inelegant Hangman game while bored at work
 
the best kind of work is pointless procrastination work
 
@AndrasDeak The other day I learned that the toroidal magnetic field of some magnetars is so intense that it's more than enough to counteract the centrifugal flattening, so they're prolate (i.e., rugby football shape). astronomy.stackexchange.com/questions/20823/…
 
12:33 PM
wow, that's awesome
 
Don't go too close to one while you're carrying your credit cards. :)
 
I have a hunch that my virtual money would be the least of my problems :P
 
Currently choosing to believe that a magnetar is a musical instrument in the same family as the guitar and keytar.
 
I believe tha name comes from a portmanteau of magnet+pulsar
 
Sitar...
 
12:36 PM
But it's played more like a theremin, I expect
 
and pulsar comes from a portmanteau of pulse+quasar
and quasar comes from quasi-stellar radio? source, I think
something like that
 
It'd be tricky to send a probe to a magnetar without all the on-board electronics getting killed. And if you get even closer, the shapes of the atoms in your probe will begin to distort.
 
I hate it when my atoms distort
 
Maybe we send a highly architectured broken probe that gets repaired due to the magnetic interaction?!
 
OK quasar comes from quasi-stellar radio source but they are now also called quasi-stellar objects, so I wasn't too confused
 
12:39 PM
Reminds me of that one scifi novel about the species that can only live on the surface of a star
 
@AndrasDeak I'm pretty sure those etymologies are correct. OTOH, a quasar is an active galaxy nucleus, so it's quite a bit larger than a pulsar, which is a neutron star or a rapidly rotating white dwarf. But they didn't know that when they were making up the names.
 
yup
and even if they would, naming things is still hard :P
like proton/electron -> fermion/boson, neutron OOPS it's actually a neutrino.... OOPS what do we call supersymmetric particles?
gluino...
selectron :|
 
@Kevin Robert L. Forward's Dragon's Egg ? It has critters living on a neutron star. And it's pretty accurate because Bob Forward was an astrophysicist who liked hard sci-fi.
 
Yep, that's the one.
 
There are a few stories that have some kind of life form living inside stars, (eg Olaf Stapledon's classic Star Makers, David Brin's Sundiver) but Dragon's Egg is the only one I know of where the aliens live on the star's surface.
 
12:45 PM
@AndrasDeak Jeff Atwood himself trying to solve one of his naming problems -blog.codinghorror.com/help-name-our-website
 
@AshishNitinPatil oh yeah, some of those names made me cringe when I first saw that :D
Whenever a colleague complains about naming things, just tell them that particle physicists named things sfermions and bosinos
the squarks exchange gauge bosinos, namely gluinos :|
too much weed if you ask me
or just too much wino
 
user6845426
recbg
 
1:19 PM
\o cbg
 
o/
 
Joe
can u say so in english : The best images came according to the following order
is "CAME" the right word here
 
I got 5 new feature requests
all of which are impossible
or pain in the ass
 
@khajvah welp.... time to sit down on a pillow I guess :D
 
Joe
1:23 PM
any body knows?
 
Depends on context. Are the images arriving in your inbox over time or something?
 
user6845426
I'm currently scratching my head at MC/DC
 
I feel bad about telling them none of them is worth it
 
Joe
no .. I did some measurements by myself
 
@khajvah tell them early and swiftly, the more you delay the more hope the people have, but then again, after a certain point, the hope factor drops, it's like a negative quadratic function :D
 
1:25 PM
"came" doesn't really fit, I feel
 
Joe
what u suggest
 
@MooingRawr they want like a graph search on 100s of millions of users which are stored in unconnected mongodb
realtime
 
Maybe something like "The images, ranked from best to worst, are: <list of images goes here>"
 
Joe
thank you kevin , u are king
 
Although this implies a certain comprehensiveness of the image list. You might not use this wording if you're only listing ten images out of a total pool of a hundred.
 
1:29 PM
Kevin, the Lionheart
 
Kevin, the first of his name
 
kabbine
 
My fictional backstory implies that I'd be second of my name, at best. Kevin Kevinson must have had at least one ancestor named Kevin.
Or an ancestor who had a weird sense of humor when the census takers were around.
 
@Kevin which is entirely possible
 
I think I'll leave that part of the backstory in multiple choice superposition for the time being
@khajvah Yeah, it's my understanding that real-world peasants were resistant to the idea of surnames because they saw it as just another tool of control by the upper class.
With that in mind, a sarcastic off-the-cuff response that goes on to become a serious moniker, would be entirely within the bounds of realism
 
DSM
1:43 PM
Cabbage for all, including the heir-apparent to the house of Kevin.
 
Cabbage
 
I'm having a problem with my kingly powers. I tried ordering the tide to stop coming in and it didn't work. Please advise.
 
what's tide?
 
The alternate rising and falling of the sea, usually twice in each lunar day at a particular place, due to the attraction of the moon and sun.
 
DSM
Also a detergent and a football team.
 
1:46 PM
I just saw this question using nested for loops to brute-force a solution to "find product of a,b,c for a+b+c = 1000 and a^2 + b^2 = c^2". I wonder if they'd be interested in this more efficient method...
#Find abc, given a+b+c=total and a^2 + b^2 = c^2
total = 1000
htotal = total // 2
for u in range(1, 1 + int(total ** 0.5)):
    if htotal % u == 0:
        v = htotal // u - u
        if 0 < v < u:
            u2, v2 = u * u, v * v
            a, b, c= u2 - v2, 2 * u * v, u2 + v2
            print(u,v, ':', a, b, c, '->', a*b*c)
            print(a + b + c == total, a*a + b*b == c*c)
 
It's a reference to a nice poem where the king asks to hold back the tides but they hit back at the king even harder.
 
I ordered the tide executed for its impunity, but it doesn't seem to mind the axe blows. The executioner is having fun at least.
 
oh I just remembered that I don't read poems
I am so boring that I read only technical books
 
King Canute, IIRC.
 
@Kevin I was under the impression that "first of his name" refers to "King Kevin I", so only royal ancestors matter
 
1:48 PM
I didn't know it was a poem. I only read the wikipedia article.
 
DSM
Yep. He was trying to show he only had normal powers.
 
I'm not finding the poem, but I'm sure that there was one.
 
Powers any ordinary man has: putting on pants one leg at a time, eating thirty chicken wings in a sitting, declaring war on france...
 
DSM
@BhargavRao: Thackeray.
> KING CANUTE was weary hearted; he had reigned for years a score,
Battling, struggling, pushing, fighting, killing much and robbing more;
And he thought upon his actions, walking by the wild sea-shore.
 
Yess! That's the one.
 
1:51 PM
> Python code can be run as-is, but Java code needs to be compiled first.
huh Python doesn't need to be compiled first ?
 
wow
 
@MooingRawr Yes, but it's not (usually) done as a separate step.
 
CPython turns python code into python bytecode before executing it, but I don't know if that's a feature of the language or the implementation.
 
they are people who knows stuff... that poem ... never heard of ... until now
 
ah .... i see
 
1:52 PM
Were I to write KPython, perhaps it would be equally valid for me to execute straight from the .py file
 
@Kevin The implementation, but (AFAIK) any implementation still has to implement the behaviour of the Python stack machine, so you might as well compile it to a stack-friendly form.
 
"KPython, execute foo.py". Truly the home of tomorrow.
 
@AndrasDeak I thought that might be the case. Kevin of ages past might have been a king, now lost to history. But I like to imagine him as a mighty viking chief.
 
Chief's fine, as long as he wasn't crowned. Perfect bloodline, no interference with non-trivial roman numerals. Win-win for Kevinson
 
King Kevin NaN, the indeterminate.
 
1:58 PM
@PM2Ring I think the a,b,c guy might be doing PE09, actually
 
@Kevin That's also secure from a future high-tech warfare/machine uprising point of view. if king.name == killname and king.ordinal == killnumber: eliminate(king)
 
@MarcusS Right. I was going to ask you if it was a PE. I got the vibe that it was. :)
 
brute force! \o/ is there a none brute force answer ?
 
there usually is
 
2:00 PM
Pythagorean triplet generation
 
pythagorean triplets have a bunch of hacks
 
yeah
 
I stopped doing PE when I had to google one to continue
 
you don't need to use hacks lol
 
The three laws of robotics are the first statutes of my domain's constitution. If I get deposed, it will be nonviolent and for my own good.
 
2:01 PM
@MooingRawr Well, my solution is still brute-force, but it's rather faster than the OP's especially if total is large.
 
I think my solution was basically make a generator to Pythangorean, and then keep pulling from it until i get my number, unelsss the number went over then I stopped.. I think that's still brute force isn't it ?
 
@MarcusS I couldn't solve this one on my own
 
There are some absolute madmen in the PE answers threads that claim to have solved several problems with just pencil and paper.
So yeah I expect there are non-brute-force answers for any of those ones
 
def primitive_pythagorean_triplets(L): #to you bikeshedders out there: yeah, yeah, I know
    for n in range(1, L):
        if (n**2 + (n+1)**2 > L):
            break
        for m in xrange(n+1, L, 2):
            if n**2 + m**2 > L:
                break
            if gcd(n, m) > 1:
                continue
            yield (m**2 - n**2, 2*m*n, m**2 + n**2)
 
@AndrasDeak Yeah, It's general worthwhile to see what you can do with the a, b, c= u**2 - v**2, 2 * u * v, u**2 + v**2 parametrization.
 
2:03 PM
Martijn solved the generator-chip/missionaries and cannibals AoC problem on paper. I can't assess his sanity though.
 
@AndrasDeak I'm still not happy with my answer for that one :(
 
nobody is
 
I miss AoC :D
 
I don't remember that problem so I assume I repressed it.
 
that problem where you had to move generators and chips onto the same floors in the minimum number of moves using some BFS black magic
 
2:07 PM
Ah, I remember now.
 
I kinda cheated and used Prolog to solve it, and then try to convert it into Python code, which didn't end well. ended up with a very long brute force solution that I'm not sure works for every input...
 
@AndrasDeak Huh, I don't remember this problem at all, actually -- but yeah triplets would definitely help here
 
yes :P
I tried several naive approaches, and wasn't even close in big-O
few of those ran for a day, just for the heck of it
 
If it's any consolation, the whole Google-new-concepts thing becomes less frequent as you progress
 
I'm somewhat skeptical :P
 
2:10 PM
haha
the most recent one doesn't require any googling, for example -- you can logic your way there: projecteuler.net/problem=600
 
well I'm not really comfortable skipping to an arbitrary hundred either:/
 
The Rubik's cube one might require some light Googling if you're not already familiar with it
 
I've also been lacking some free time, if truth be told
but I partly blame PE :P
 
@PM2Ring could be wrong but I think you might like this one -- projecteuler.net/problem=596
 
I'm not against googling new concepts; I'm against googling algorithmic shortcuts which are essential to solving problems in polynomial time
 
2:13 PM
Yeah, I agree to a large extent -- our team usually tries to avoid that unless it's something really cool
 
well you have my blessing for that ;)
 
@MarcusS Ok... I'll have to think about that one. I suppose the fact that any number can be represented as the sum of 4 squares might be useful.
 
:P
 
@MarcusS shouldn't the description go "Let T(r) be ..." instead?
 
Wow, you're right -- thanks for the catch
one sec
fixed
 
2:20 PM
that was quick :D
 
Todo: send Andras a check for $2.56
 
The market would probably value my contribution closer to $0.256
 
need an andras deak buy me a coffee
actually, better idea
Buy me a Knuth instead of Buy me a coffee
 
you couldn't handle the Knuth
9
 
Knuth...Knuth...Knuuuuuth
that's fun to say
 
2:33 PM
sorry, missed that
 
If pingu goes noot noot, does tux go Knuuuth knuuth?
 
Blast, I wanted to make a penguin reference.
Kevin'd again.
 
and properly
i.e. by way of Kevin
 
Wow, the modern Mortal Kombats sure are strange
 
2:38 PM
Haven't actually watched the video (because who has 11 minutes for that?), but it sure is an evocative title image.
 
gotta love that -1000 C knife:D
 
I just skimmed it but I think it's a joke
 
that is a possibility
 
I suspect it's not easy to get things to -1000 C for long with DIY chemistry materials.
Unless liquid nitrogen can do it. I have no idea how cool liquid nitrogen can get things.
 
-1000 C is -730 kelvins :(
give or take
 
2:43 PM
Ha, so "not easy" is an understatement then :-P
More like "the thing you are asking for is not even a coherent idea" territory
 
Wikipedia says nitrogen's freezing point is 63 K (−210 °C; −346 °F)
 
you can't go below -273C or whatever it is
 
that, -273
point something
 
Does it bother anyone else that some gases remain a gas no matter how cold you get them? It bothers me.
 
Bose--Einstein condensate, BOOM
 
2:45 PM
sublimation bothers me D:
 
Oh yeah? Not possible? Ask me that in, uh
 
Heh
 
rhubarb for now, don't make me miss out on too much fun sciency chat
 
Oh, I was just about to bring up the horror of the false vacuum :(
 
noooo
 
2:46 PM
I think the heat-dead universe will be quite tepid
 
Oct 6 '16 at 14:26, by PM 2Ring
I suppose I better not mention negative temperature... ;)
 
> A system with a truly negative temperature on the Kelvin scale is hotter than any system with a positive temperature. If a negative-temperature system and a positive-temperature system come in contact, heat will flow from the negative- to the positive-temperature system.
I thought I understood science, I don't anymore
Oh I said basically the same thing before
 
Hmm, you don't see signed integer overflow in real life very often.
> Most familiar systems cannot achieve negative temperatures, because adding energy always increases their entropy.
I'm guessing that the known universe is one of those systems.
 
> Thus, negative temperature is a strictly quantum phenomenon
 
Oh boy, a new way for me to misinterpret quantum physics. Those are fun to use at parties.
 
2:55 PM
Can I just lump that in with tachyons and Alcubierre drives and such?
 
If I play blackjack with my eyes closed, I can never lose
 
You folks sure go to some interesting parties
 
When measuring LOC a programmer commits during a day, do they count removals as negative lines? If so I have -1500 lines this week and it feels like my most productive in a while...
 
Well I usually talk to the dog at parties so I can pick whatever topic I like
 
@MarcusS Consider it as a (sometimes) useful way of extending the definition of temperature.
 
> Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
 
A rough mathematical analogy: T(n) = n*(n+1)/2 gives the sum of the positive numbers from 1 to n. But if we pass a number that isn't a positive integer to T it'll return a value, but it generally doesn't make sense to try to interpret that value as the sum of an arithmetic progression, even though that's how the formula for T was derived in the first place.
 
I worked somewhere once that measured total patch size in bytes (for good-natured competition, not as a performance indicator), and had a very good week the time I ran all our image assets through pngcrush one day on a whim.
 
@corvid «Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.» — Antoine de Saint Exupéry
Translation: "It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove". From here
 
@PM2Ring Reminds me of the whole "sum of natural numbers being -1/12" thing that supposedly shows up in string theory somewhere
...which actually makes me less confident in string theory :P
 
3:11 PM
Let N = 1+2+3+4...
2*N = 2+4+6+8...
2*N-1 = 1+3+5+7...
2*N+2*N-1 = 1+2+3+4...
4*N-1 = N
3*N=1
N = 1/3
 
@PM2Ring well, it's more of just my project got to be bloated shit in the rapid prototyping stage
 
@MarcusS It's to do with the Riemann function isn't it?
 
@ZeroPiraeus Boils down to the Grandi series (sum of -1, 1, -1, 1, -1, ...) which is a divergent series
 
0 = 0 + 0 + 0 + 0 + ...
  = (1 - 1) + (1 - 1) + (1 - 1)...
  = 1 + (-1 + 1) + (-1 + 1) + (-1 + 1)...
  = 1 + 0 + 0 + 0...
  = 1
 
You can pretty much assign whatever value you want to divergent series but it won't necessarily make any sense
It's like saying "Let's assume 1=3 and see where that takes us"
 
3:13 PM
Yeah, let's just stay away from young adult novels
 
rb folks
 
@MarcusS That "sum of natural numbers being -1/12" thing is an example of Ramanujan summation. The generalization of that sum is known as zeta function regularization, and it's not just used in string theory, it's an important renormalization technique used in standard quantum field theory.
Wiki says: "The first example in which zeta function regularization is available appears in the Casimir effect".
@ZeroPiraeus Indeed it is. 1+2+3+... = zeta(-1)
 
I know I can skip a for loop iteration by looping through iter(collection) and calling next(collection) but is there another way of skipping a for loop? Example of how I usually do it:
x = ['a', 'b', 'c', 'd', 'e']
z = iter(x)
for each in z:
	if each == 'b':
		next(z)
		continue
	else:
		print(each)   #prints a d e with new lines
 
Haven't heard of Ramanujan summation before -- in the past I think I had heard of it as "Cesaro summation" (for assigning sums to divergent series)
 
3:22 PM
@Kevin How did you go from 2*N = 2+4+6+8... to 2*N-1 = 1+3+5+7... ? You need to subtract 1 from each term in 2+4+6+8... to get 1+3+5+7... , but you only subtracted one 1.
 
Reading through these wiki pages just makes me want to flip over more desks re: quantum mechanics. Don't understand any of it.
 
Oops.
 
This is why people hate "intellectuals"
 
IIRC this was both interesting, and left me with the sense that I sort of understood what was going on.
 
3:27 PM
@MarcusS part of me is surprise it's your first time seeing that wiki (I'm assuming the TIL is implying it's the first time you saw the page), but part of me isn't surprise since you seem to already know a lot math theory and wouldn't bother looking up infinite series
 
I'm not a math expert
 
bamboolzed again, first with PM and now with you, I wouldn't even be surprise if Kevin comes out to be a robot or something.
 
I've seen the page before but the TIL was about Ramanujan summation -- I had erroneously thought it was Cesaro summation
 
No comment.
 
N = 1 + 2 + 3 + 4...
M = 0 = (.5 - .5) + (.5 - .5)...
N = N+M = 1+.5 + 2-.5 + 3+.5 + 4-.5...
N = 1.5 + 1.5 + 3.5 + 3.5...
N = 3 + 7 + 9 + 11...
2N = 2 + 4 + 6 + 8...
N+2N = 2 + 3 + 4 + 5...
N + 2N + 1 = 1 + 2 + 3 + 4 + 5...
3N+1 = N
2N = -1
N = -1/2
 
3:36 PM
Is there a simple way I'm missing to go from 'True,True,False' to array([ True, True, False], dtype=bool) with numpy? np.fromstring('True,True,False', dtype=bool, sep=',') returns an empty array
 
@MooingRawr When I need to jump around a sequence like that, I use a while loop so I can -crement the index as I choose.
It's not pretty but it's flexible
 
@excaza You can go from the string to an ordinary tuple using ast.literal_eval. I assume it's easy to get from a tuple to an np array.
I wasn't sure if literal_eval could eval tuples without parentheses, but it looks like it can on my machine
>>> import numpy
>>> import ast
>>> s = 'True,True,False'
>>> numpy.array(ast.literal_eval(s))
array([ True,  True, False], dtype=bool)
 
stackoverflow.com/q/7050137 recommendation / too broad
 
@PM2Ring I recall seeing this kind of approach which was based on the Cesaro summation of the Grandi series:
G = 1 - 1 + 1 - 1 + ... = 1/2 (Cesaro summation)
T = 1 - 2 + 3 - 4 + ... = something
2T = 1 + (- 2 + 1) + (3 - 2) + (- 4 + 3) + ... = 1 - 1 + 1 - 1 + ... = G = 1/2
T = 1/4
S = 1 + 2 + 3 + 4 + 5 + ...
S - T = 1 + 4 + 8 + 12 + ... = 4(1 + 2 + 3 + ...) = 4S
S - T = 4S
S = -T/3 = -1/12
 
3:43 PM
@Kevin cool, thanks!
I didn't know that was a thing, maybe my programmed hate of eval has blinded me :)
 
@Kevin thought about that, I guess more control over pretty-ness... I guess in my situation it might be a bit over kill since it's a simple skip.... and there's no need to go back. Thanks I guess
 
literal_eval is eval's mirror universe pacifist twin. It vows not to delete your hard drive regardless of what string is passed to it.
 
-trying to remember if Superman/Batman vowed never to kill anyone and if they broke that vow-
 
we can get some pretty cool hard drive deletion in MATLAB with its internal eval use, it doesn't have a safe version
I think @AndrasDeak found a good one a few months ago
 
01:00 - 16:0016:00 - 00:00

« first day (2384 days earlier)      last day (2564 days later) »