« first day (2853 days earlier)      last day (2318 days later) » 

00:00
the GPIO pins on my pi are also being weird, so there's that. i also have to figure out all the stuff i need to do with the output of the FPGA.
That code I looked at yesterday was pretty weird. I've never used a RPi myself, but I just had a quick look at these docs so I think I can give you good code that will convert signed 8 bit numbers to a bit list you can send to GPIO pins with GPIO.output
the pins being weird is beyond just my code, it's more of the "they won't turn off" variety.
which...could be me missing something really important.
it's like GPIO.cleanup() isn't working or something.
@heather Ok. You need to slow down and totally understand how Hz works. It's really simple. Frequency is the reciprocal of time. So something that happens 25 times per second has a frequency of 25 Hz. Each cycle takes 1/25 th of a second.
@PM2Ring ah, yep, that's what i did - if one cycle takes 1.1 * 10^-5 seconds, i can just do 1/that = hz value, which gave me 90,909.1 hz, which then move the decimal point over for kilo, and 91 khz.
it's just how often something happens in [unit of time, generally seconds].
00:11
ouch, the read time is even slower
50 hz? really?
50 Hz is alarmingly close to the mains frequency here ;)
@AndrasDeak the "mains frequency"?
probably not the right terminology, I only learned electronics in Hungarian. I meant the frequency of the AC in the power sockets.
well i know very little about electronics, so it could be the right term for all i know =)
You may know that the power plugs have alternating voltage, with 110 V effective value in the US and 230 V in Europe. The frequency of the corresponding harmonic oscillation is usually around 50-60 Hz
this is something that experimentalists have to take into account, because that 50 Hz can couple over to virtually anything and end up as an artifact in frequency-dependent measurements
I also heard of one case where the 100 Hz power oscillation (corresponding to the 50 Hz voltage oscillation) led to a vibration in a pump in a neighbouring laboratory and ended up messing with an atomic force microscopy measurement
apparently measuring forces with atomic precision is fickle business...
00:20
wow...that's kinda crazy.
@AndrasDeak Mains frequency is a common term in English. At least, that's what I've always called it. We also use 50Hz. In the USA they use 60Hz.
cool, thanks
hmm, maybe i should switch to the arduino...less overhead from the OS and such...but a lot less I/O pins...
ah shoot. the arduino has 14, i need 16.
i guess i could hunt down a second arduino...and then i have to program the darn thing in C...
and even that might not be fast enough
ergh
anyone got a magic wand? or is that in the manual as well? ;)
00:24
Is there a two-sentence explanation to what you're doing that needs kHz speed? Optionally in the transcript
With old AM radios, especially in the early ones that used valves (aka vacuum tubes) there was always a noticeable 50 Hz hum in the background. You can still hear it in stuff like guitar amplifiers that use valves.
@AndrasDeak this is for the input to an FPGA, which has to occur on the rising edge of the FPGA clock. the FPGA clock runs at 50 mhz.
@PM2Ring i saw a shop last week that had a marconi (!) vacuum tube along with a bunch of other old tubes...pretty cool.
Ok. Wiki says that in the USA they call it (power) line frequency.
line as in "line, neutral, ground", right?
@AndrasDeak Yes.
00:27
hmm, looks like you can push an arduino to 2.67 mhz...that's a lot better than the Pi
@heather but it doesn't have to occur on every edge, right? Or is it that somehow the signal has to change in that 1/5e7 seconds time?
well, according to the non-SE forum post, anyway
@AndrasDeak well...ideally it'd occur every edge.
does your output have to be in the MHz range?
the whole point is the FPGA runs super-duper fast, so i don't want to slow it down as i feed it input.
(also, physics nit-pick: mhz could be millihertz that nobody uses :P)
00:29
lol, okay, 50 MHz for the FPGA clock =)
20 ns per cycle...good luck I guess :D
@AndrasDeak lol yeah, i'm thinking i'm just gonna have to slow down the FPGA clock to maybe 2 MHz. That's still pretty fast, and the arduino can apparently handle that, so.
Honestly naive question: what if there's a bunch of cycles between changes in input? Is that really a problem?
Or is the FPGA a picky piece of equipment? I never heard of one so I'll believe anything
well...the way i've written my verilog code, which is probably all wrong since i've never programmed in verilog before ~10 days ago, is that everything happens on the rising edge of the FPGA's clock.
00:32
which is because...multiple reasons, the best one of which probably being it's what every other example of verilog code i've seen did.
verilog is so different from what i'm used to that i'm basically banging my head against a wall to try to get through it =P
Hmm, but wouldn't that mean that if the input doesn't change for 10k cycles then it just recomputes the same things? (last honestly naive question, I promise)
@AndrasDeak that sounds right.
which...yeah, i guess that probably wouldn't be a problem.
i have no idea =)
you may have "naive" questions, but i only have naive answers.
if the computation is stateless then the only difference should be that with a higher clock frequency there's a lot more energy wasted and your room will get much warmer for the same result
what does it mean for a computation to be stateless?
that you take the same inputs and get the same outputs, with no spooky actions-at-a-distance happening
00:36
::mumble mumble quantum fpga::
yeah, i think mine'd be stateless then.
>>> def spooky(add1, add2, results=[0]):
...     result = add1 + add2 + results[-1]
...     results.append(result)
...     return result
...
>>> spooky(2, 3)
5
>>> spooky(2, 3)
10
>>> spooky(2, 3)
15
spooky state ^
oh...mine might not be stateless then.
I'm only using fancy words to say "if doing the same thing 10k times gives you something different then you'll get something different"
well, i'm adding the sum of all the "past integrals"
"past integrals" being from previous cycles?
00:39
yeah.
then definitely doing 10k idle steps is different than 1 single step: there's a factor of 10k difference in the next contribution :)
although if you're integrating correctly then the 10k steps with 1/10k time step size would give you almost the same integral, basically using a finer temporal mesh to integrate a slowly varying piecewise-constant function
Does this make sense to you?
Oh. I almost forgot. Here's that bitlist code. From the docs, it looks like GPIO.output(chan_list, (GPIO.HIGH,GPIO.LOW)) wants its bit data as a tuple. So that's what my code produces. But maybe it can accept a list, and that would be slightly faster here.
def signed_to_bits(n):
    return tuple(int(u) for u in f'{n & 0xff:08b}')

# test with all legal signed 8 bit values
for i in range(-128, 128):
    print(i, signed_to_bits(i))
@AndrasDeak i'm not sure.
are you saying that missing a few of the added sums might be fine over a large number of steps?
If you can use a list, make that a list comp:
def signed_to_bits(n):
    return [int(u) for u in f'{n & 0xff:08b}']
I'm assuming you're running 3.6+ on the RPi, so you can use f-strings.
i have 3.5.3, let me upgrade.
00:43
@heather So, there are two scenarios. In both cases your input changes in, say, 200 mus (microseconds). In the first case you leave the FGPA alone and take 10k cycles with dt=20 ns while the value of the input is unchanged. You'd compute the same integral contribution 10k times with the small dt time step. In the second case you slow down the FGPA and have (optimally) 1 cycle with dt=200 mus, and compute the integral contribution (from the same function value) with a single large time step.
the results should be the same, except from slight integration errors for when the value of the input changes
@heather That's standard for CMOS and related technology. Old-fashioned TTL logic uses voltage levels, but CMOS uses edge detection. That has several advantages, the main one being that exact supply voltage isn't critical.
@PM2Ring hmm, it's telling me 3.5.3 is the newest version when i do sudo apt-get install python3
@heather Oh well, it's easy enough to do it with format. Give me a sec.
apt-cache search python3.6
don't ask what happens if you try to install it, though
00:47
but apt will let you know if it will try to remove python3 first...
[int(u) for u in '{:08b}'.format(n & 0xff)]
you have to hand install it on raspbian.
@PM2Ring ah, thank you.
@heather Yeah, don't bother doing that just for 3.6. Unless you need f-strings and dictionaries that retain insertion order. ;)
@heather ah, can confirm
@PM2Ring no, those were my heart's desire! =P
actually, the dictionaries sound kinda nice...
00:49
you don't need it
also it was an implementation detail in 3.6 so might as well go 3.7 for support ;)
i wouldn't bother installing on this pi, it's not even my own, so.
@AndrasDeak FPGA = Field-Programmable Gate Array, although there are a few other expansion of the acronym. Basically a chip that you can program to do fun things with boolean logic.
bedtime rhubarb, have fun with the rest
@PM2Ring I googled it when it was first mentioned, still it's completely alien to me
@AndrasDeak rbrb and thank you
Rhubarb, Andras.
@AndrasDeak Think of it as a way to create a program in terms of AND OR and NOT that's running directly on the hardware.
00:53
Sounds like fun :)
Anyway, I better let you go. Night!
now FPAAs...those are real cool @PM2Ring
that's one of the things near the top of my never-ending to-learn list.
01:09
@heather Wow. That does look intriguing.
02:05
cbg
@PM2Ring Does anyone do those anymore? I remember my dad doing some work for the city when I was a kid and being the only guy who knew how to fix/meddle with that stuff.
 
1 hour later…
03:11
@toonarmycaptain No idea. I guess I would've heard about FPAAs years ago, but if so, I've forgotten about them. I don't keep up with hardware like I did when I was young. And I must admit that I was always more into digital hardware than analog anyway. Although I did get the chance to mess around for a few months with a cute analog computer in the mid 1970s.
I tend not to think of many people on here as having been alive in or much before the 70s lol
 
2 hours later…
06:36
can i get list of all models that have foreign key of that model.Eg. A->B , C->B , D-> B then how can I get a list ( [A,C,D] ) from the model B in django?
07:02
cbg-morning
 
1 hour later…
08:07
is it possible to override repr for flask admin's display ? I dont want to touch my own repr because im using it for a lot of other internal things
 
2 hours later…
10:07
Is there someone who can help me in visualization of the tensorflow with tensorboard?
Please let me know if someone can help to get how to visualize the training of the model, please...
10:26
cbg
11:02
cbg nice people of the new COC
COC-cbg
Is it me or the avatar pictures are broken?
Broken in what way?
most don't load properly, and show a generic replacement
I can't say I've noticed anything different
11:08
I can see everyone as usual
Okay, so it is me... I think it is because I've purged caches on my computer and via VPN, loading can be slow
Thanks
I was asking because imgur also seemed slow/broken lately
I don't want to subject people to looking at my face, so you should expect that my profile pic is the default pattern
haha - yes, but in this case, I don't even see the default.
@ReblochonMasque same here. I was cursing Firefox for it, before I saw your post. Gravatars are loading fine, stackoverflow images aren't loading because of insecure SSL.
eh, not SSL, the site itself is down now.
11:28
@ReblochonMasque they were broken yesterday, fixed for me today chat.stackoverflow.com/transcript/6?m=43523484#43523484
11:44
ok, thanks for the feedback.
12:06
cbg
 
1 hour later…
13:17
\o cbg
 
1 hour later…
14:30
cbg
cabbage nice and gentle people of the new COC
@ReblochonMasque your avatar isn't loading for me
Yes, there is a glitch with avatars it seems
We talked about it a couple of hours ago, the chat is still visible right above.
Yeah I saw, just adding my voice to the choir :p
14:53
Let's Golf What is the most succinct way to produce a list of second elements from a an iterable of tuples of length two (or of arbitrary length)?
pointers to a python script to migrate e-mails from MS outlook to thunderbird?
cbg @piRSquared
cbg @ReblochonMasque
MCVE
def iter_a():
    yield (1, 'a')
    yield (2, 'b')
    yield (3, 'c')

[t[1] for t in iter_a()]

# ['a', 'b', 'c']
Not directly, but uses tons of python - what do you guys think of the 100days of ML code?
[s for _,s in iter_a()]
one less char, if I count correctly @piRSquared
@Code-Apprentice but won't work for arbitrary length
14:57
> from a an iterable of tuples of length two (or of arbitrary length)
hmm...which one is it?
ah, that is an xor there, right?
@Code-Apprentice your entry is valid. I was thinking of both problems More OR than XOR
(e for _, e in a)
@ReblochonMasque I believe that is the same as @Code-Apprentice but in generator form
yes, it is a generator
15:00
@piRSquared yes, yours is more general and will work with a tuple of any length >=2
zip(*iter_a())[1]. Python 2 only.
Python 3 requires a list call, in which case it ties with code apprentice's approach
[*zip(*iter_a())][1]
Or, no, my answer is disqualified on account of it returning a tuple, not a list
@Code-Apprentice [b for a,b,*c in iter_a()]
@piRSquared i was thinking of the same thing but you beat me to it
15:03
pi's approach has got to be [*[*zip(*iter_a())][1]] if we're being picky about types
@Kevin You had me at tuple
wim
wim
>>> [t[1]for t in iter_a()]   # whitespace optional there
['a', 'b', 'c']
is there not getter of element 1 function that I can pass into map that is shorter than this lambda?
[*map(lambda x: x[1], iter_a())]
[*dict(iter_a()).values()]
i dont like how you have to call values :\
or i think that would be nicer and it doesnt work with arb lengths
wim
wim
15:10
@piRSquared do you actually have a cool answer to show or are you just throwing it out there
all answers so far were boring
Nope, don't have one. Just throwing it out there to see what room 6 can come up with
I thought @Kevin's answer was zippy (-;
python devs, please bind operator.itemgetter to a shorter name, like g or something, thanks in advance
wim
wim
+1
and rename lambda to lameduh
to further discourage use
add an exec that expects a pyth string
Rename lambda to λ so that it's both shorter for golfers, and a hundred times more painful to use in serious code. Everyone wins
8
15:19
Wait does python really use lambda as a keyword?
Yes.
Woa.. that is... sort of weird
lambda:lambda:lambda:lambda:lambduh
15:23
Good to know though since I have been trying to pick up some python just recently with no that much of success unfortunately ^__^
the alt key options on OSX include  but not a lamda, thanks
@Kevin I would tape a piece of paper on my f8 key with the written λ and map the key accordingly.
wim
wim
what to do when user keeps asking the same question repeatedly #1, #2, #3, #4
15:33
It's risky of me to make jokes about the difficulty of typing various characters, because in an international community like this you never know when someone will say "actually, on Finnish keyboards there's a dedicated "λ" key, right next to the "Æ""
wim
wim
I have been closing as dupes of one of them, but it just occurred to me that it might prevent roomba from deleting them?
Is that the new unicode keyboard?
For the purposes of this joke, yes
(but actually it's a Kanji keyboard)
I need a disk dedicated to emoji
15:41
> The encompassing keyboard design -- with six separate pads of kanji characters, a pad for emoticons and a giant Enter button -- puts every single standard-issue Japanese typograph at the users' fingertips. There are also floor pedals of unknown purpose.
I wrote a Q&A on cokurtosis and coskew a while ago. I was so very tempted to title it "Coskew yourself"
5
Got a bad case of cokurtosis, but doc says it will clear up if I eat more vegetables
Glad you're ok, that can really go sideways if you don't normalize it
DSM
DSM
16:07
@piRSquared: do you think I could get away with closing this as a dupe of this? My answer would basically be the same.
looking
I think its fuzzy. The questions are not the same but sort of are. My opinion is to close it as a dup. I think it is more helpful that way.
DSM
DSM
Closed and added an explanatory comment.
16:44
I want this to work for positional arguments as well
def λ(expr):
    return lambda **kwargs: eval(expr, kwargs)

[λ('x**2')(**kw) for kw in [dict(x=i) for i in range(10)]]
# [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
DSM
DSM
Lunchtime cabbage for all, BTW.
CABBAGE!
where you from DSM? The english side of things in canada?
DSM
DSM
Yep. I think the Canadian visitors in the room are about evenly split between English and French, but I'm on the English side of that divide.
16:59
@DSM Faisons un sondage...
Convert data frame to another data frame, split compound string cell into individual rows. And there are quite a few such duplicates, for want of a canonical. Answers tend to become too data-specific.
DSM
DSM
@smci: but how would we keep the non-Canucks from voting?
TBH I think we need an official "explode" method, or whatever it's called, so we don't need to keep reinventing things.
The downside is that it would be one more official support for nonscalar entries and that's just a path to confusion.
@DSM Sorry, are you talking about positional args and kwargs in functions? Why would we need an explode method?
DSM
DSM
No, this type of explode.
@DSM ok, better still, please VtC in favor of that
17:14
recbg
I liked the dup link you gave @DSM. Since I've answered that question countless times, I had to throw my entry on the dup target stackoverflow.com/a/51752361/2336654
17:37
The directory '/Users/myName/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Hello, I am trying to install pandas
with pip install pandas, or sudo pip install pandas, or sudo pip install --user pandas ... nothing works, when I do import pandas there is no module named pandas
pip version is 2.7
python is 2.7
sudo -H pip install pandas also doesnt work
no need to post that same long error twice
What does "doesn't work" mean? What error do you get?
@Suisse might be worth making a virtual environment
@AndrasDeak it wasnt the same long error
it was another error
please bring it back
17:40
I second the suggestion from @RobertGrant. Use a virtual environment.
@Code-Apprentice it means just, it works without errors, but when I do import pandas, it says the same: module not found
@Code-Apprentice are you really asking for an error, or for which of the two provided it is? :)
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python2.7/site-packages (from pandas) (1.15.0)
@Suisse so when are you getting those two errors you pasted?
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pandas
17:41
@RobertGrant yah, I wasn't clear that the first message is the error...not enough context given prior to that
Ah sure
@RobertGrant only when I do: sudo pip install pandas
@Suisse why don't you make a virtual environment, and install inside that?
Also unless python2 is essential, I'd consider using 3
true
Thank you
Edit the dupe list with a better one?
Ah good point
thanks it worked, when I switched to python3
18:10
@Suisse 👍
 
1 hour later…
19:20
cbg
the low amount of dependency injection containers discussion happening in r6 is disturbing
lol:
Dec 12 '16 at 17:42, by Antti Haapala
dependency injection is for Java idiots
o/
DSM
DSM
19:41
Antti's opinions are strongly held. And numerous.
19:54
Like the Sand People, they are easily frighten away, but they will come back in greater numbers?
@MooingRawr Gaara never backs down excuse you
yells some inane things about dependency injection containers, java, a lost shoe, chewbacca and sand people
cbg
@FélixGagnon-Grenier you met up with java the hutt, eh?
heh, indeed
it was a most ungraceful and unpleasant encounter. I do not recommend.
... that being said, I could have thought about it, but dependency injection container creation sucks in type less languages. That is, when you create more than a glorified array.
20:12
i have no idea what dependency injection containers are, but they sound unpleasant.
ah, according to google
> an object that knows how to instantiate and configure objects
yes, that is generally what it does
With type hint, it's possible to use reflection so that you can actually automate that process, which greatly simplifies bootstrapping of an application. Typeless languages and non reflection based dic's need to be configured manually, through language, xml, or whatevs, which tends to become quite ugly very fast
i see.
20:28
I'm not quite sure how to search/ask for this. I notice that passing a function "reference" does not work the same as passing a class method. config.add_view(function) vs config.add_view(class.method). Indeed, the latter fails with argument number errors, because the method expects the first arg to be the class instance. Why can't the object be passed with the method reference, if that makes any sense?
pass instance.method
or make it a static method?
@AndrasDeak hmmm.. thanks for making me double check. The code throwing the error is not the one I though. I was passing instance.method already, the error happens elsewhere where I did not instantiate the class. :)
no worries :)
wim
wim
how you got instance.method if you did not instantiate the class :P
20:36
yeah, you probably need a static/class method if you don't actually need an instance
wim
wim
dependency injection is just a fancy-pants way of saying "argument passing"
a decorator over the method is causing the problem. I add cornice decorators over an api methods so that a swagger definition be generated. The decorating caller throws the argument mismatch error.
I am changing from module scope functions to an instantiated class so that I can pass the database object used in it as an argument to the constructor, so that I can write tests more easily. The endeavour is taking more time than I would have hoped :)
@wim heh, it is indeed. I like fancy things
20:53
... on another note, pycharm's debug icon (possibly all of jetbrains 2018.2) has changed, and I don't know how I feel about it
wim
wim
21:18
Oh yeah, it's a little bug now. Cute!
Don't remember what it was before (also a bug?)
 
2 hours later…
23:21
Yep. Also a bug, but... different.

« first day (2853 days earlier)      last day (2318 days later) »