« first day (2232 days earlier)      last day (2723 days later) » 

1:00 PM
@JRichardSnape boss.replace_with(me)
 
boss.close()
boss = get_new_boss()
 
boss.purge()
 
if i leave replace with blank i got error
 
user6568562
What error might that be ?
 
@khajvah better:
 
1:03 PM
replace with need some value to replace with
-_-
 
with boss:
    pass
 
:D
 
will release the current boss as the boss wants.
 
user6568562
@SohaibAsif Ouch, that's not helping. What version of Excel are you using ?
 
2013
error is we couldnt find anything to replace with
-_-
 
user6568562
1:05 PM
Man, you didn't undo your first find replace
 
Cbg
 
remote_excel_tutorial.close()
 
user6568562
True
 
user6568562
Cbg @Programmer
 
@randomhopeful done
a great experience to learn
@JRichardSnape @randomhopeful thanks
i am an excel developer now
 
user6568562
1:08 PM
@SohaibAsif You welx. It was like those basketball movies where the underdog scores at 0:00
 
@JRichardSnape = P
 
Set up and scored :)
 
now the second problem
 
1:10 PM
'grupoeuropahouse.com/europa-house-village' how to trim or strip the next part
 
user6568562
Laters @JRichardSnape
 
just need abc.com
etc
 
52
Q: Which Stack Exchange site is best for Microsoft Excel questions?

snthWhich Stack Exchange is the best site to ask questions about Microsoft Excel (as well as potentially other Microsoft Office and VBA questions)?

 
i guess i need to replace text after '/' with .com
 
1:26 PM
From a comment in eev.ee/blog/2016/11/23/a-rebuttal-for-python-3 - "Really, Zed Shaw's photo should become a permanent fixture on the wiki page for Dunning–Kruger effect."
Just had to convince a dev that replacing __getattr__ with multiple property creations was unpythonic
 
@holdenweb was he java developer? ;)
 
@holdenweb replacing __getattr__ with what? :D
 
probably he wanted to add properties to access object variables instead of normal attribute access (obj.x)
 
I wish sql had modules
of some kind
I dunno how to get rid of code duplications without hacking from Python string manipulation
 
@khajvah what about stored procedures?
 
1:40 PM
they are not procedures though
 
DSM
@MartijnPieters: thank you for the ftfy recommendation, it would have come in very handy a while back and I see it being useful again!
 
they are intermediate tables.
 
user6568562
@marxin Well that's a bit dumb
 
brief cabbage
 
user6568562
1:48 PM
Hey @Andras
 
@randomhopeful depends on the problem, some people just don't know about getattr
 
or chat markdown;)
 
:D
 
Aug 24 at 12:48, by Andras Deak
Jun 22 at 12:16, by Andras Deak
Mar 15 at 16:34, by DSM
Word of the day. dunderbold: the unintentional bolding of words due to an absence of code-quoting.
but chat markdown is awful
 
__getattr__
yuppie
 
1:50 PM
and you can edit/delete your messages in the two minutes after posting:)
although from mobile that's far from convenient
 
user6568562
@marxin Hmmm, I can imagine to understand
 
I know of __getattr__
 
Java programmers seem to take a while to adapt to the Python way of doing classes. So they make classes when a built-in collection with maybe a helper function or two would do the job. Or when a Python custom class would be appropriate, they stuff them with pointless getters and setters that they expect the caller to use instead of using simple attribute accesses.
 
Correct, @marxin, that was the proposal!
 
because privates and encapsulation (?)
Does too much theoretical OOP make you an impaired python programmer? :D
 
1:56 PM
I like java getters and setters, its very convenient thing, the only downside is that it generates much boilerplate code
 
@AndrasDeak Probably. But that's not going to work so well in Python. :) Better to keep the interface light-weight, and if you do really need custom getters / setters, implement them using Python's @property machinery and don't inflict the details on the caller.
 
Maybe we should just accept dunder-bolding as a happy typographical accident and read bolded word as "dunder-word"
 
haha:D
Please __don't__ paste 100-lines-of-code programs into chat!
 
Obviously in code the dunders will still appear
 
@marxin Try Scala
 
1:58 PM
@marxin the general attitude in the Python world is precisely that getters and setters are mostly redundant boilerplate code.
 
i've noticed that most python devs hate java
not sure why
 
Plus we can turn attributes into properties if we need programmatic access control
 
@marxin most devs hate java
 
What makes you think I hate Java?
 
@holdenweb yeah this is an advantage of python
no Im not saying you hate java, it was just my very subjective experience
 
2:00 PM
@holdenweb That's kind of what happens, I s'pose. People generally figure it out from context. OTOH, sometimes you want to say stuff like, "Don't call __len__, call len".
 
well we even have python programmers who hate python (...), so don't expect too much logic
 
python programmers who hates python? These exist?
 
@AndrasDeak but do you have PHP programmers that hate PHP?
 
I just think it's a language that uses needless repetition too much. Which I characterise with the typical declaration: Puppy myPuppy = new Puppy( "puppy" )
 
@holdenweb explicit is better than implicit, you surely know where from it comes ;p
 
2:04 PM
@Alex well, the one I know only hates python 3
 
@marxin which part of that is explicit?
 
There's being explicit, and there's being explicitly explicitly explicit
 
@AndrasDeak since when are you friends with Zed?
 
Yeah, you have to make some changes, but python3 has definitively some advantages, as least as I see it.
 
and there's being complicated which is worse than being simple
@Programmer who said anything about friends?
 
2:06 PM
@khajvah following the jvm, assign new object of type Puppy, initialized with "puppy" to variable myPuppy of type Puppy
 
I also know complex analysis, but we're strictly in a professional relationship
 
@holdenweb oh... you were mentioning puppies but it's just code stuff... was hoping for biscuits... :p
 
@marxin myPuppy = Puppy("puppy") is the same amount of explicit with no redundancy
I know you know this too, just noting
it's obviously not a competition because python would win
 
pythonic approach is still good but its different, because whole background is different, python has no problem with myPuppy = Kitty('kitty')
 
Well you left out Antti who hates python 2, so it sounded personal :)
 
2:11 PM
which can be considered both as advantage and disadvantage ;)
 
Well Java would have no problem with Thing charlie = new Thing() so that's hardly relevant, is it?
It's syntactically acceptable, but not standard practice, I'd say
 
@PM2Ring the "pointless getters and setters" are the way in Java to ensure that the interface is future-compatible
 
I meant more that if you define a variable in your class definition as Thing charlie, then in constructor you cant do charlie = new Kitty(), which can be either plus or minus
 
because someone in Java decided thus, that there is no way of doing a "property descriptor"
 
I can't remember the last time I reassigned a name to a new value with a type different from its original one.
 
2:19 PM
@Kevin I often abuse it.
like foo = list(foo)
 
@AnttiHaapala Sure. I'm not saying it's wrong to do it in Java. I'm saying it's wrong to write Java in Python. ;)
 
because I don't want to invent new variable names
@PM2Ring sure thing
:D I assumed the former
 
my sql is too slow
 
because there was no "in Python"
 
gimmi mongodb
 
2:20 PM
@khajvah explain analyze
@khajvah HOHOOO
 
I need a duck to debug
 
as if it would make it faster
 
DSM
I was just talking to someone about that the other day: I avoid type instability except possibly at the start of functions, precisely to avoid needless creativity in variable names. Other times I'll just actually mention the type in the name to be concrete explicit about the difference, but i prefer to avoid that.
 
\o o.o
 
I always try to avoid reusing variable names, it can lead to various errors
 
2:23 PM
question: in the same table, for the same item, I have 2 values. I.e.
1(item id)|1(value #1)|102.3
1(item id)|2(value #2)|306.7
how can I subtract value #2 from value #1 for each item?
Right now, I join 2 same "tables" and subtract like that
but it's too slow
 
haha this newspaper deployed on Friday :D
 
nvm, I fixed it
damn, I am smart
 
I've often said that only to have it break 10 minutes later
:)
 
I love type hints in python 3
 
@Kevin I do it frequently in Python, eg when converting external string data to a number (or vice versa) I'll often re-use the name. But I try not to make it confusing, eg use a name for one thing in the top half of the function and then mysteriously change it halfway through the function to a different type.
 
2:29 PM
hope one day everyone will use them
 
And if I do need to do several stages of string processing on the string before I start doing arithmetic on the converted number I'll often put a comment in to make it more obvious where the type change occurs.
 
@PM2Ring in Python 3.6 you can use the inline annotations!
def foo(bar: str):
    bar: int = int(str)
 
Sometimes I'll have one variable name refer to values of different types in different contexts. Ex. data might refer to both a string and a dict, but only in separate function bodies
 
reusing same name in different scopes obviously makes perfect sense
 
@Kevin it is more confusing in Pycharm if you have too many variables
 
2:34 PM
@excaza yeap
 
@AnttiHaapala I could, but I probably won't. :) As I've said before, I'm not a fan of type annotations.
 
5 minutes
 
:D
 
I've done things like "data = asdfasdf"; "processed_data = do_something_with_data_transforming_it"
 
@AnttiHaapala Hang on. Shouldn't that be:
def foo(bar: str):
    bar: int = int(bar)
 
2:36 PM
@Kevin then later I've used data instead of processed_data because I didn't remember which one of these 2 to use.
@PM2Ring perhaps :P
 
@PM2Ring better would be baz: int = int(bar)
 
that banned from the network link on the star board T>T
 
@FlorianMargaine nope.
 
I tend to use 1 or 2 letter names or generic names like row, data, result for temporary stuff that's only used on 1 or 2 lines, and only assign to a meaningful name for things that have a longer lifetime. But I happily break that rule when an algorithm isn't dead simple and you need to keep track of several different things at once.
@FlorianMargaine Perhaps, but Antti was illustrating how to annotate when you are converting something and binding it to the same name, since that was the topic of the conversation. :)
 
2:53 PM
Yesterday, I commented on a question that mentioned the Karplus-Strong algorithm, which is used for synthesizing the sound of a plucked string. The OP didn't show their synthesis code - they were just having problems saving their float data to a WAV file. But I was sufficiently intrigued by the algorithm to write some code. :) Here's a tiny demo that makes the sound of a fairly metallic A string.
import wave
from struct import pack
from random import random

def kastro(frequency, duration=1, volume=1, rate=44100):
    delay_length = round(rate / frequency)
    samples = [volume * (random() - 0.5) for _ in range(delay_length)]
    for i in range(round(rate * duration) - delay_length):
        samples.append(0.985 * sum(samples[i:i+3]) / 3)
    return samples

def save_wave(samples, fname='test.wav', rate=44100):
    scale = 2**15 - 0.5
    data = b''.join([pack('<h', round(scale * u)) for u in samples])
 
hmm you're using noise
 
@PM2Ring Cool!
 
I'm afraid of playing with sound waves, all those sci fi stuff where creating certain notes with a computer to cause issues, I know it's all fake but no thanks...
 
@PM2Ring perhaps sawtooth could work nicely
or is it
ah it is
stupid me
ah no... hmmh
so that could be perfectly random waveform...
 
@AnttiHaapala Yes, that's what the basic algorithm does. See en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis You get a better result if you filter the noise, though.
 
3:03 PM
I'd use sawtooth with some random distortion
hmm that's rather good. however the complete randomization with random() isn't that good
 
cbg everyone
 
you might just get 0.5, 0.5, 0.5, 0.5, 0.5, 0.5
 
@AnttiHaapala You can use a sawtooth, or just one side of a triangle. I got ok results using samples = [volume * (random() - 0.5) * (1-.95**i) for i in range(delay_length)]
 
@vaultah cbg
 
@PM2Ring Did you ever use Pure Data or Max/MSP?
 
3:07 PM
@PM2Ring I'd write all these delay lines and such as successive generators
 
Also, you get a smoother sound by increasing the number of samples that get averaged in sum(samples[i:i+3]) / 3, but if you use too many the sound becomes rather dull. And of course, you can get a lot of variation using a weighted mean.
 
@AnttiHaapala Sir, i have one question please let me understand: i self learning cuda c++. my questions is N = 10. I have 10 bloacks and each block have 1 thread. What does that mean? In this case thread refer to what?
 
@Jovito No. Even though I'm a musician I haven't done much with digital audio.
 
@PM2Ring Ilja is a master of making beat loops in C using some magic bit fiddling
@Mike me? I have no idea about cuda :D
 
But I do know a little bit about Fourier analysis / synthesis, and am familiar with the theory of formants.
 
3:10 PM
@PM2Ring a synthesizer library in Python with C speedups would be nice
 
@AnttiHaapala You mean something like this? youtube.com/watch?v=tCRPUv8V22o
 
@Jovito yeap
 
It's pretty easy to do that in Linux.
 
@Jovito that's the legendary Viznut
 
A lot of fun too.
 
3:11 PM
@AnttiHaapala I expect you could do quite a bit just with Numpy. And you could get rather fancy using scipy as well.
 
@PM2Ring ^
 
@AnttiHaapala There's pyo
 
@PM2Ring the video :D
@Jovito nice
@IljaEverilä ^have you tried pyo
 
I've used it successfully for this little project:
 
You know what I'm really interested in? How can I actually access my sound card in Linux??
you used to just be able to write to a file, but now there's all these daemons in front of it
 
3:16 PM
@WayneWerner easy
still possible to write into a file
 
I know there's pygame and pyaudio, but that's too high level for what I'm curious about, heh.
what's the file? Any of the google searches I've done have fallen silent
 
@WayneWerner Try pyo with JACK.
 
30
Q: Generating random noise for fun in /dev/snd/

jonesRecently I have been exploring the enchanted /dev folder. I want to write some random data to an audio device in order to generate some noise. I am using ALSA. So I instruct cat to pipe some random data to the playback file in the /dev folder... cat file-of-random-data > /dev/snd/pcmC0D0p t...

cat /dev/urandom | padsp tee | aplay
Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
^CAborted by signal Interrupt...
aplay: pcm_write:2004: write error: Interrupted system call
 
Please lower your volume when you do that.
 
3:19 PM
@AnttiHaapala I love this kind of stuff. Reminds me of 1bitmusic.com
 
user6568562
@Jovito This pretty cool and spacy man
 
cat /dev/urandom | aplay
 
Unless you're a Merzbow fan. In that case, turn it up.
@randomhopeful Thanks :)
 
"It all started a couple of months ago, when I encountered a 23-byte C-64 demo, Wallflower by 4mat of Ate Bit, that was like nothing I had ever seen on that size class on any platform. Glitchy, yes, but it had a musical structure that vastly outgrew its size"
@Jovito ^that's hc
 
Sounds like a Radiohead bootleg.
 
3:23 PM
code here: 7C 00 05 A2 29 3F A8 E5 A1 45 A2 05 A2 29 7F 99 00 D4 99 D7 CF 50 EB
 
I dont know any python can i still be here>
?*
 
well you are now...
 
Its the same as walking into someones house, I can do it but people won't like it.
 
@AnttiHaapala That's awesome
 
@Kevin.a it's fine as long as you remembered to pay the £100 entry fee...
 
3:26 PM
@WayneWerner turn volume down before running this:
echo 'main(t){for(t=0;;t++)putchar(t*(((t>>12)|(t>>8))&(63&(t>>4))));}' > foo.c ; tcc -run foo.c|aplay -r 32000
 
@Kevin.a Well, you could start learning Python. :) I think you'll like it more than PHP. And being Dutch is an advantage in learning Python. :)
 
(requires tcc) :D
 
yay!
its black friday do i get discount on the entry fee
 
It even does some pitch modulation.
 
@Jovito remember that C64 does have the 6581 synthesizer...
 
user6568562
3:28 PM
@Antti I can't find another cool Commodore clip you shared once
 
user6568562
Yayah, thank you dude
 
@PM2Ring i love how you know so much about me already. Why do i have an advantage being dutch though :p
 
@Kevin.a You could try bribing Antti with some salmiak...
 
3:30 PM
XD
 
@Kevin.a It's in the Zen of Python: "There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch."
 
@Kevin.a and MartijnPieters
 
haha, awesome
 
Sep 17 at 21:11, by Martijn Pieters
@AnttiHaapala absolutely, and that certainly applies to me too!
 
Also, Guido, the inventor of Python, and our Benevolent Dictator For Life, is Dutch.
 
3:34 PM
Im inspired now
 
To become Dutch? ;)
 
Excellent. See What tutorial should I read?. If you're familar with basic programming concepts you should probably take a look at the official Python tutorial.
 
Thanks !
 
@PM2Ring however we are still unsure about Guido's taste when it comes to zoute drop
 
I got weekend woop
see ya all later
 
3:40 PM
@Kevin.a the proper thing to say would be "rhubarb for now"
 
Some great music releases today: Flume's Skin Companion EP and Max Cooper's second full-length album
 
cbg
 
I never did much with sound on the C64, but I wrote a few sound programs on the Amiga, including a little music player that used Shepard tones.
 
Now that everyone hates my Python book, here's a Black Friday Coupon for 60% off everything: BF2016 https://learncodethehardway.org/
 
user6568562
3:49 PM
The universe will split in two before I'll admit to my wrongs, goddammit
 
@JonClements sigh
 
But it didn't use any cool digital synthesis tricks, it computed the waves the hard way, using sin(). Of course that wasn't too bad on Amigas that had "fast" floating-point hardware.
 
4:01 PM
How do you check for item in a list if and if it's not there you add it? With a comprehension.
 
why would you use a comprehension for this?
 
@BlueMonday Using a comprehension for that seems like an unusual choice. You could do if item not in lizt: lizt.append(item).
 
@BlueMonday You probably don't do that with a comprehension.
 
I tried like this but doesn't seem to be working
>>> [item for item in s if type(item) != list or s.extend(item)]
 
@PM2Ring fixed ;)
 
4:04 PM
Look at Jeremy Bankz being flippant :p
 
Yeah @Jeremy I know that, I was wondering if it could be done with a comprehension guess not
 
@BlueMonday What's s? If it's the list you're creating in the comprehension, it doesn't exist yet
 
s is the list
 
This is a strange question because list comprehension is a really awful way to do it even if it works.
Like, you're not adding an item. You're building a whole new list.
 
Yeah I guess
 
4:06 PM
@BlueMonday just use what Jeremy suggested - if you're particularly inclined to unreadable stuff: data.extend([item] if item not in data else [])
 
Alright thanks
 
But you probably might want to consider a set or similar depending on the actual use case
 
Yeah that's pretty much what I am looking for
 
@JonClements real talk: list I don't mind, but I can't resist shadowing id some times.
If for nothing else than because it's the most-appropriate name for a keyword argument.
 
Yep - never really found a need to use id in real code anyway
 
4:14 PM
I've used it as the __hash__ for items that are unique-by-identity, but that's probably literally it.
 
I saw a good one in the last day or so: in a couple of lines they'd shadowed two things, list and sum, IIRC. I commented, but I can't find it in my comments, so I guess it was a now-deleted answer.
 
vault is too fast for me
 
{relative} is in town for thxgiving and has a problem: their laptop charger is sitting in their apartment, 100 miles away.
 
oh well
 
Googling "charger rental" unhelpfully provides a list of places where you can lease a Dodge.
 
4:20 PM
@MooingRawr Try answering questions when Martijn's around. That'll teach you to be quick. :)
 
@PM2Ring I do, all the time.... I give up on trying to answer and I just read and learn from his answers....
There is a list of people I can't beat and I accept that, so I just sit and read their answer... the list includes but not limited too: kevin, ninja, vault, tiger, when idjaw is around
well tiger usually just hammers dups so meh...
 
@Kevin They sell chargers at stores.
 
@MooingRawr Wise. Although the other day, I answered a question 90 minutes after Martijn, and ended up equaling his score, and getting the accept. :D
I don't expect that'll happen again in a hurry, though.
 
Like, normal consumer electronic stores like Best Buy. They come with swappable plug types and a list of supported laptops.
Buying a laptop charger is roughly equivalent to buying windshield wipers.
 
@PM2Ring are you a demigod ?
 
4:23 PM
I once answered a question before Martijn, but then I had to delete my answer because it was worse than Martijn's (obviously)
 
Papa Kevinson says "If you buy a charger you just know they're going to gouge you on the deal". I guess it makes sense; most people get their chargers when they buy the object that needs charging, so the only people that buy standalone chargers are the ones desperately in need of a replacement.
OTOH it's Black Friday, which is pretty much the ideal time to get electronics for cheap?
 
vault I was typing out that zip map dictionary answer and saw your comment T.T so I didnt bother submitting my answer lol so fast xD
 
@MooingRawr Not quite, but I'm currently in the Python top users list for the last 30 days. And I first learned to program in 1970. :)
 
is there a tag?
:)
 
I'll avoid spending too much time on my answers in the future... stackoverflow.com/questions/39558377/…
 
4:27 PM
@excaza Probably over on retro. And yes, I still remember a fair amount of the Hollerith punch-card code...
 
Tell Papa Kevinson that sounds like dirty commie talk.
Best Buy gouges you on everything. That's the point of retail.
 
@PM2Ring Ive been coding for a hobby since 3 years ago... only started to get paid for my coding services 3 months ago... still feel freshly new, cause I am i feel. need to keep reading and learning lol
 
If you want to pay 'fair' price go to alibaba.com and ship it from China.
 
@Kevin it's also the ideal time not to go into a retail store
the mall near work is a madhouse today
 
I'm getting word that the mall that's second-closest to my house is pretty uncrowded.
 
4:30 PM
@excaza yup and guess who has to drive their mom and sisters around after work to go shopping? the dude who becomes a coat rack where you hang your bags on too... please save me
Maybe I should go pick myself up a 1060 or a 1070 while im at it ....
 
I ordered some stuff on newegg yesterday morning
and it arrives today...
 
i work right next to a ncix (newegg for canada type shop) so I think ill go pick up a gpu after work
260 for a 1060 seems like a steal
 
@MooingRawr which exact 1060 model is at 260?
 
http://www.ncix.com/detail/gigabyte-geforce-gtx-1060-windforce-ef-134496.htm?promoid=1714

it's a 3gb card though so like meh...
 
Ah. I'm eyeing a 6GB version
 
4:36 PM
I was hoping to find a 6gb card..... but at this point anything is better than my current 680 T>T
 
yeah...I have a 560
1GB
it's not fun
 
yeah I know that feel......
all the 1060 6gb cards are 300-450 CAD before price
 
yeah. I have some Amazon gift money, so it cuts the price down a bit for me. But still...
Would love to find a 6GB in the low 300 range
it would really cut he price down for me with my discount
 
oh I was going to recommend one of these since I was picking up one of these : ncix.com/detail/… or ncix.com/detail/…
 
that second one looks promising.
 
4:41 PM
the problem is ncix.com/detail/… looks exact same for cheaper (mail in rebate) and it's slightly faster clock speed but it's cheaper i dont understand i cant see the difference.... maybe im not looking hard enough
last link i promise (sorry for spamming links) but here Joe, the same card on amazon.... for about the same price : amazon.ca/Gigabyte-GeForce-1060-WINDFORCE-GV-N1060WF2OC-6GD/dp/…
 
I can get it for 150
I'm kinda very interested
there's only one obstacle. Wife.
 
Oh it's the Black Friday stuff today right
 
yeah, and I'm obviously finding the one product of interest that is not on sale
 
I'd much rather just spend an extra £30 or whatever and save myself an hour of bargainhunting, haha :-)
 
oh...I will never go to a store for black friday or boxing day
if it is online great. If not...then whatever.
I will not deal with hordes
 
4:45 PM
But even online you have like timed deals and you have to balance stuff and whatnot
So much effort
There's too much choice
 
oh...yeah I don't look for things
if there is something I know I want...I'll check for it on those days
 
I have some friends who are doing it budgeting it as a $30/hr job. Just trying to pick up PS4s they can sell.
 
if it is on special and it's a good discount. great. Otherwise...I do other things
 
I recently replaced very old thermal grease with a significantly better one, but the average CPU temp got higher
Oh well
 
ah crap...I probably have to do that too
my computer is six years old
 
4:52 PM
Is it theoretically possible to damage a CPU, so that it still works but at the same time heats up very quickly?
 
probably, but it's far more likely the grease wasn't applied optimally
 
That
maybe not enough sliver :P
 
air bubbles, uneven spread, etc. I'd try redoing it before going crazy trying to identify other causes
 
thanks guys, I'll try that
 
I wish I knew what really happened to my old videocard. I woke up one day, and I smelled burning. It had gone from a beautiful red card, to a scary black
 
4:59 PM
@idjaw wife aggro gotta just do something sweet to distract her ?
 

« first day (2232 days earlier)      last day (2723 days later) »