« first day (3110 days earlier)      last day (1824 days later) » 
00:00 - 16:0016:00 - 00:00

1:29 AM
We have someone posting spam answer in Python tag.
 
2:26 AM
cbg
@smci Cody deleted it.
@AndrasDeak How come you don't have python gold badge, to hammer that anyways, i did it for you
 
3:13 AM
1
Q: Want to assign value in the new column by comparing the other column in pandas data frame?

sdh2000I have a dataframe and has a column name called savings. In that savings, it has a positive and negative value. I want to check if the savings is negative then assign 1 in the new column (need to create a new column name called flag_negative). If the savings is positive assign 0 in the new column...

any suggestion?
 
@Jason Please do not post box links here...
 
ok sorry
 
@Jason np
 
0

I have a dataframe and has a column name called savings. In that savings, it has a positive and negative value. I want to check if the savings is negative then assign 1 in the new column (need to create a new column name called flag_negative).
If the savings is positive assign 0 in the new column. I have a missing value in the savings column which I don't want to do anything. Leave as it is
for i in sum['savings']:
if i>0:
sum['flag_negative'] = print(0)
elif i == " ":
sum['flag_negative'] = print(" ")
else:
sum['flag_negative'] = print(1)
I have tried with above code.. answer comes only none
can you help?
 
4:13 AM
Hi anyone have experience with numpy?
 
5:03 AM
@AaronHall Honestly, I don't understand C.
 
@toonarmycaptain Nor do i
 
@JakeM MCVE please. Why do you have tuples in a Numpy array? You should only put numbers in Numpy arrays. True, you can put any Python object into a Numpy array, but then you lose most of the benefits of working with Numpy, including its speed.
 
@PM2Ring Exactly.
 
Sigh trust an engineer to expend more energy on the flaw in the question than it would take to answer the question
I'll try somewhere else.
 
@toonarmycaptain look at this:
Wait 60 seconds, to many searches
 
5:14 AM
@smci That's not spam! On SE, accusations of spam are serious, and have serious consequences. Please do not refer to posts as spam unless they are actual spam, posted for commercial advantage. See meta.stackoverflow.com/questions/260638/… Etc.
@JakeM There might be a simple solution to your question. Or you may need to do a massive rewrite of your code because you're forcing Numpy to run at Python speed instead of C speed. Without further information that's indicative of your code, I can't tell.
 
@PM2Ring Yeah, that's right, anyways, mod deleted it
 
FYI, Jake accepted an answer to the very same question about 20 minutes ago.
 
Guys, Do you know a tool by any chance for MySQL abuse checker(i.e how many connections can handle, etc)?
 
@Aran-Fey Oh yeah
@JakeM Why are you even bothering anymore, you've got your answer already:
Here: stackoverflow.com/questions/55789003/… (added a Here: so i can make this a none box link'
 
@Aran-Fey Thanks for that info.
 
5:23 AM
@Aran-Fey I need to thank you as well
@toonarmycaptain This was what i needed to show you:
 
And it looks like Jake isn't using tuples in Numpy arrays after all...
 
@PM2Ring Yeah, was ready to say that, i was think about that right from the beginning, lol
Why does he even post it here, a question is enough
I guess Jake is upset, he just left the room...
 
@U9-Forward I suspect that Jake doesn't fully understand the answer he accepted. And we could have helped with that. Oh well. Hopefully, he's now studying the documentation, learning how .all works. And learning the difference between a tuple and a Numpy array...
 
@PM2Ring Exactly
 
In some places, it can be dangerous to communicate unclearly and then act superior when you're misunderstood. m.xkcd.com/169
 
5:36 AM
@PM2Ring Btw, i get it a little more, his a JavaScript user...
rbrb
 
Or maybe he does understand it now. I'm on my phone, so it's not easy to see exact timestamps of questions & answers.
 
6:00 AM
Hi anyone know about apache airflow
 
@smci Yes, it's a common Unicode problem, but the cause may not be under the direct control of the OP. It looks like it's due to the PDF library (handling anything apart from ASCII or Latin-1 in PostScript / PDF is a little painful). So I'd be happy to give the OP an answer for their specific question, if we had more details. However, the OP hasn't clarified their question, or responded to any comments. So he gets the hammer. ;)
 
6:19 AM
Hey guys, anyone willing to see my new python project? I am kinda new. :D
 
@AviThour Someone might, if you give us a few details.
 
Am i allowed to post github links?
 
7:05 AM
@AviThour Yes, but can't you just tell us briefly what the project does?
 
 
1 hour later…
8:33 AM
@smci that's not spam
@U9-Forward half my rep is
 
user11285244
Can I ask , driver.implicitly_wait can function all of driver object after writing?
 
@JakeM I almost gave you an answer, good thing I skimmed the rest of the messages first.
 
@AndrasDeak Oh, garbage content that does not answer the question, on SO do you only call that NAA? (on many other sites would be considered spam.)
@PM2Ring Wasn't the user calling str() on Unicode wrong?
@AviThour Best to tell us first what the project's about. Does the code work, are you asking for a code review or are you stuck on specific programming issues?
 
8:51 AM
@smci it's not even NAA I'm afraid, it looks like an attempt at an answer. Only worthy of downvotes and community delvotes.
It might fit the second case in the figure here but it's a bit of a gamble
 
@smci I agree with Andras. It's just a low quality answer that's unlikely to help the OP much.
 
NAA is typically for "thank you" and other comment answers and link-only answers (but if the link text is informative it's not link-only!)
For instance "Use contextlib.nullcontext" is not link-only and thus not NAA
These deletion flags must be a no-brainer. If technical knowledge is needed it won't fly
 
@smci I don't see any unambiguous evidence in the posted code that the OP did that. And I have a policy of not answering Unicode questions when I don't know the Python version. But I suspect that the root cause is the library the OP is using. It may be broken, or the OP may not be using it correctly. There are too many unknowns for me to bother speculating any further.
 
Alright, this is my project - github.com/thouravi/csgo-stats-notifier - It fetches the CS;GO data and sends you a windows notification realtime! :D
 
9:16 AM
@U9-Forward "we don't do that here"
 
@AviThour str("{:.2f}".format(kd)) is redundant. .format already returns a string.
 
@Aran-Fey can you make a commit or something? would be appreciated.
 
nah, I'll be making commits on my own projects
 
I don't understand what you mean, like I am using str("{:.2f}") to print the output only upto 2 decimal values.
isn't that fine?
 
@AviThour isn't the API key private? Don't you have a quota? API keys usually shouldn't be put in version control, just like other credentials
 
9:20 AM
"{:.2f}".format(kd) would do the same thing
what you're doing is like writing int(5) instead of 5
 
Wait, let me change.. Thanks @Aran-Fey
@AndrasDeak i mean yes, however It's not my API Key, found it over Internet so.. :D
 
I see...
 
Thanks @Aran-Fey, I am newbie so. cheers.
 
Please only star things that are interesting to a broader audience. Saying thank you is enough as thank you.
 
I saw the option on star "as useful", so isn't it a thing for newbies to learn? like i did.
I do understand your concern, will keep that in mind.
 
9:25 AM
Thanks
 
Our star policy in this room is a little different to the usual policy in SE chat rooms.
 
This is my only chat room i have been to on StackOverflow, Python > All.
 
user11285244
SORRY, Can I ask a question? driver.implicitly_wait() can function ALL of driver object after writing it?
 
Can a RO unstar that message please. There are other messages that are more deserving of being on the star board
 
9:41 AM
@Aran-Fey I tried but mobile is a piece of yam. Will do from laptop
 
no rush
 
@Aran-Fey Done
 
thanks
 
@AtsushiSakata We need more context. I have no idea what you're talking about. Is this related to the thing you asked about the other day?
 
user11285244
@Aran-Fey what do you mean
 
user11285244
9:49 AM
@PM2Ring yes a little
 
user11285244
@PM2Ring related to webdriver
 
@AtsushiSakata Someone had starred this message and I asked the ROs to remove that star
 
@AtsushiSakata Are you talking about Selenium?
 
user11285244
@PM2Ring yes
 
user11285244
@Aran-Fey I understand
 
9:59 AM
cbg all
 
@AtsushiSakata So you should ask a clear coherent question, and maybe someone who knows Selenium will answer it.
 
Consider the following condition statements:

if a:
    #do something
elif b:
    #do something
elif c:
    #do something
else:
     #return to first if statement
is it possible to return to the first condition check again?
Consider these statements inside a function
 
Not without a loop or redundant code
But the start of the if will do the same thing if you go there right at the start of the else block
 
Yeah maybe i should re-frame the question.
 
Yeah, it's quite unclear
 
10:05 AM
What would happen if that function is called in the else block
 
user11285244
About selenium methods Webdriver question. I want to use driver.implicitly_wait() to do scraping, like that. from selenium import webdriver


driver = webdriver.Chrome("D:\chromedriver")

driver.implicitly_wait(10)

driver.get("https://google.co.jp/")

element = driver.find_element_by_id("abc") Is this means that driver.implicitly_wait() methods function 2 driver.objects below. I mean it waits until doing their jobs.
 
@AtsushiSakata have you given up spamming? (Context)
 
user11285244
@AndrasDeak yes
 
@andras, so in the else block, the code is looking at a something completely different. Say, I have a txt file with 2 lines. On first run, the conditions run for the last line. But when the else block is reached, it grabs the first line and returns back to running the if-else condition for that line(first line)..
*it grabs the first line(in the text file)
 
I'd use a loop over "lines" and break in all except the "else" case
 
10:15 AM
Re-framed quesiton:

Line 1: "some text"
Line 2: "some text"

if a: #check condition for Line 2
#do something
elif b: #check condition for Line 2
#do something
else:#check condition for Line 2
# grab Line 1 and return to condition checks again on Line 1
 
(Or return)
 
Yeah, I thought of return, but was unclear about its usage. Say, if I have a return in the else block, would the control resume back to the function or the first if statement? Consider all of this is in a function.
 
Return always ends the execution of the function and goes back to the caller
Return only applies if your function is done inside the given if branch
I just had to kill a wasp so the message got too short :P
 
If permitted, I'd like to star the message above :P
 
"Return only applies if your function is done inside the given if branch". Something like this?:

if a:
   def foo:
       return 'bar'
elif b:
      #do something
else:
     return

That doesn't look right to me ;D
 
10:26 AM
@AndrasDeak We have 2 main kinds of wasp here. 1. European paper wasps, which are evil and must be exterminated. 2. Native mud wasps, which are relatively non-aggresive, just annoying because they build little tubular mud nests in inconvenient locations, but they do keep the spider population under control. Each mud tube contains a paralysed spider (or similar prey), and the spider contains some wasp eggs. They often build small clusters of parallel nests, with the tubes oriented vertically.
 
Or did you mean?:

    def foo:
         if a:
             #do something
             return 'bar'
         elif b:
             #do something
             return 'crow'
         else:
             #return
 
@PM2Ring mud daubers are awesome
@amanb no
 
user11285244
@AndrasDeak so can you answer my q
 
@AtsushiSakata no
 
user11285244
@AndrasDeak why
 
10:29 AM
for i in [2, 1]:
    line = lines[i]
    if a:
        #do something
    elif b:
        #do something
    else:
        continue
    break
 
def foo(inputs):
    # the function you already have
    for inp in inputs:
        if a:
            # only if we're done with the function
            return a_case
        else:
            pass
            # go to next iteration
    return default_case
 
@Aran-Fey, that's it, continue is what I should be looking for. This will resume conditional checks again, I hope
 
Aran's version is the break I mentioned, this ^ is a special case if your function is done in every other case
 
But pass would skip the execution of things inside the else. I wnt to grab "Line 1" from the text file here and then jump into the next iteration
 
Pseudocode...
 
10:35 AM
so, maybe I can do the line-grabbing first and then pass
That's rude and has been flagged
 
Why do you do tests on line 2, and then process line 1 afterwards. That seems backwards. Of course, there may be sensible reasons for that control flow for your particular case, but if so, your MCVE should reflect that.
 
@PM2Ring, in my re-framed question post, I explained my intent. I have reasons to encounter the problem this way because, I am working on conversation strings and starting from the last string in the conversation, going backwards.
 
does looping backward make more sense perhaps?
or is that what you're doing already
if your content changes dynamically (based on what you do in the else block) rather than looping over a given set of options, you should use a while loop instead, but same fundamental logic
 
The problem is this: I'm tokenizing conversation strings in forward loops and then classifying the conversation with if-else, but if the conversation ends with a string that does not have a token defined in my JSON definition, it looks for the string above it and then finds out if that string was tokenized and runs through the if-else conditions to classify it.
 
10:45 AM
So it's a kind of backtracking?
 
yeah sort of...
 
so would it not be possible or meaningful to start looping backwards?
 
Yes, now that I'm chatting here, my brain has opened up to that possibility :D
@AndrasDeak, it was right there, and I couldn't figure out a way..that's just common sense..start backwards in the first place, of course :D
 
it's easy to get stuck
 
I think its more like: Look at the problem from different perspectives.
 
10:55 AM
Sometimes, it makes sense to work backwards & forwards. But the code quickly gets complicated, and it's easy to get confused when you're trying to debug it. So it's generally better if you can have a strong sense of direction in the flow of control.
 
@PM2Ring, you're corect
 
 
2 hours later…
12:51 PM
Hi guys
n = int(input())
cols = sorted(list(map(int, input().split())))
print([''.join(i) for i in cols])
Can someone tell me whats wrong in this code?
There is an error ' TypeError: can only join an iterable'
However sorted function returns an iterable right so I am not understanding whats wrong?
 
sorted function returns an iterable but i is an item from that iterable which is often not an iterable
 
cols appears to be a list of integers. This means that i is an integer. You can't call join with an integer as an argument.
 
there's also probably no need to call list on map before calling sorted on it
 
>>> "".join(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only join an iterable
 
@Kevin that will be step 2 :P
oh, I thought you were emphasizing the intness
If you're not doing anything else with cols then don't convert to int and then you'll be able to do ''.join(cols)
 
12:54 PM
I kind of am. i being an int is kind of the sine qua non of my diagnosis
 
I think the problem is twofold. The first problem is that ''.join() should be outside rather than in a listcomp.
then it gets an iterable, and we can start worrying about not being able to join ints
 
If the goal is to display the elements of cols all joined together into one string, I agree that it is a problem that .join is inside the list comp.
Perhaps what RaphX really wants is:
>>> cols = [1,2,3]
>>> "".join(str(i) for i in cols)
'123'
 
Thanks guys I got it
Here is my modified code:
n = int(input())
cols = sorted(map(int, input().split()))
for i in cols:
    print(i, end=' ')
 
that's not the same thing
that will almost exactly print the second input line
 
It will also print a trailing space, if that matters.
An alternate solution:
 
12:58 PM
and strip away multiple whitespaces, etc.
 
>>> cols = [1,2,3]
>>> print(*cols, sep="")
123
>>> print(*cols, sep=" ")
1 2 3
 
Ah, I was wondering about print(*cols) but I didn't know about sep to pull it off.
of course this might just be an overly M CVE
 
Thanks a lot! @Kevin and @AndrasDeak
 
no problem
 
I don't think there's too much that has been lost in the process of making the MCVE minimal. Any code that begins with n = int(input()) is probably from SPOJ or a similar online coding challenge site. So the real code is probably fetching cols from user input, doing some math on it, then printing it back out. We don't really care about the math as long as the typing of the list remains the same.
 
1:04 PM
I do care. Because there's no point converting to ints if you're not going to do math on it.
 
True. Let us assume that there is a good reason to convert to int, even though there isn't one in the MCVE.
 
Can anyone tell me what to do in this problem: codeforces.com/contest/10/problem/C
 
Well, the reason to convert back & forth from string to int is that we want the columns to be numerically sorted, for some reason.
 
Oops, so there is a reason to convert to int in the MCVE. My recollection of the sorted call got pushed out of my mental cache once I made the problem even minimaller by assigning an already-ordered list literal to cols instead of getting it via input()
 
same
for some reason I thought we were breaking up a number into digits then putting it back together again
 
1:13 PM
@taritgoswami Define two functions, quick_digital_root and slow_digital_root. The first one calculates the digital root recursively using the proposed formula d(x*y)=d(d(x)*d(y)). The second one calculates the digital root by iterating over the digits of the number and multiplying them together, without using any shortcuts.
Then you take those functions, and... Hmm, I thought I understood the problem description, but the sample input/output is confusing to me. What does "the amount of required A, B and C" mean?
The problem description was about identifying when quick_digital_root gives an incorrect value. How does "required" relate to correctness?
 
Yeah, it's confusing to me also
 
Maybe it's asking "How many times does quick_digital_root(a,b) give the correct answer for all values of A in (1..N) and all values of B in (1..N)?"
 
Is this the first codeforces challenge here that is confusing?
 
Hmm, that can't be the question, because then the answer would be N^2 as long as N is less than 10.
 
@Kevin Probably it's asking to find how many triplets is enough to make the conclusion by Billy wrong ?
 
1:23 PM
Since d(d(a)*d(b)) is identical to d(a*b) if a and b are one digit long
 
@taritgoswami You have to count the number of (A, B, C) triplets in the range such that the digital root test fails. If A*B=C, then d(d(A)*d(B)) = d(C), but the converse isn't necessarily true. Eg, d(d(3)*d(4)) = 3, and d(12) = 3. Now 3*4 = 12, so the test succeeds for (3,4,12), but gives a false positive for (3, 4, 3) because 3*4 isn't 3.
BTW, there's a fast way to calculate the digital root, using modular arithmetic.
 
@PM2Ring Yeah, if n<=9 return n else return n%9
 
Oh, so you're not checking quick_digital_root against slow_digital_root. You're checking whether d(a*b) == d(c) implies a*b == c and counting how many times this implication is proven wrong.
 
@Kevin That's my take on it.
I expect there's a more efficient way than O(n**3) brute force.
 
@Kevin Is this two functions correctly implemented as u defined?
 
1:29 PM
@taritgoswami Close. What's the digital root of 18?
 
Yep. But 18%9==0.
 
if(n<9):
    return n
elif(n%9==0):
    return 9
else:
    return n%9
 
But since all your numbers are greater than zero, you can do n % 9 or 9
 
Perhaps I'm missing something because my failed implication counter doesn't give the right answer for N=5. (spoiler warning for anyone trying to solve the problem on their own, obv)
It's also too low if I use the d(x*y)=d(d(x)*d(y)) property to calculate d faster
... Did I forget how digital roots are calculated? Yeah, I think I did.
 
1:36 PM
I think this gives the correct o/p: ide.geeksforgeeks.org/qTdDagv1Q3
 
pastebin.com/SU7662Wi (spoiler warning again)
 
But it will be very solw for large N
 
Can someone take a look at my code here and help me speed it up. It's taking 15+ Minutes for a 9000x9000 item comparison.
 
That seems like a double loop over rows, would that make 9000^2 iterations?
 
@RobertFarmer I think last time I offhandedly mentioned that your double-for loop might be made more efficient by storing one of the worksheets or the other in a set or dict. This would reduce your program complexity from O(N^2) to O(N), which is very good when N=9000.
 
1:44 PM
@Kevin Don't we need to check if a*b==c when d(a*b)==d(c) ?
 
I'm 99% sure that code has bugs, because running those two elif statements 9000 times for each wtrow makes little sense as far as I can tell
 
The second elif was an offhanded attempt to see if it made creating a new report easier. It did but only made things like two seconds faster.
 
@RobertFarmer Here is an unhelpful partial implementation. I completely threw away your two elifs so obviously this won't do exactly what you want, but maybe it will be thought-provoking.
... Or if Aran-Fey's suspicions are correct, maybe it will do exactly what you want. Wouldn't that be nice?
 
cbg
 
@taritgoswami I'm not sure. I did check for both false positives and false negatives in my first pastebin, but I removed one of them in my second pastebin since it didn't seem to change the answer for either of the test cases.
 
1:53 PM
It might. I'm looking at it and i'm going to give it a test run. But the reason for my first elif is because outside of the comparison there exists a few hundred "free floating" items containing the T/P values I need to remove they don't contain any matching values so the normal if-statement wouldn't have caught them.
 
Or perhaps you're asking "shouldn't that line if d(a*b) == c and a*b != c: actually be if d(a*b) == d(c) and a*b != c:?". Maybe it should.
@RobertFarmer If you don't even need to compare those free-floating rows against sap, then it may be appropriate to filter them out like this:
    for wtrow in wt.iter_rows():
        if wtrow[4].value in ("T","P"):
            continue
        key = (wtrow[3].value, wtrow[2].value)
        indexed_wt[key].append(wtrow)
 
My brother in Germany is starting to learn Python (3rd or 4th language, so not a beginner developer, but still mostly self-taught). Looking for suggestions on collaboration environments. I've opened a shared console on pythonanywhere, but working at a console is like writing all functions as lambdas.
 
This conditional ensures that wtrow will not be added to indexed_wt if wtrow[4] is "T" or "P"
Oh, that reminds me. if saprow[4].value is "X" should be if saprow[4].value == "X" because you should not use is to do equality checks.
 
Well, I just ran your code and all that's missing is the catch for the values that don't have matches from the previous report and with a significant and I mean like 700 seconds worth of significant time saving.
 
Sounds about right :-)
I was hoping it would be nine thousand times faster, bringing it down from 15 minutes to 0.1 seconds, but bringing it down from 15 minutes to three minutes and twenty seconds isn't too bad.
 
2:08 PM
the whole program runs for 101 seconds.
But that loop only ran for 0.22 Seconds
Major time saver. The main time usage is saving it and i'm not sure why.
Now I really got to improve my code skills. I feel like i should've known this.
 
@PM2Ring Ok thanks for the advice both of you. I presume it makes no difference to the flag moderators if I leave a comment on the answer explaining why it's VLQ/NAA, as well as flagging.
 
People don't use dicts nearly as much as they should
 
I wouldn't expect anyone to come up with a solution like this on their own if they've never seen anything similar before. It's not a trivial optimization.
Much in the same way that carpenters do not require their apprentices to construct their own lathe before they learn to make birdhouses
Now that you have seen it, keep it in your toolbox
 
Sam
Python unrelated but anyone here use Kubernetes?
 
Nope, I am blissfully ignorant of containers and virtual environments and The Cloud
 
Sam
2:17 PM
fair enough
 
@Kevin and which characters will die in next weeks GoT battle.
 
So can I ask about the free floating rows the code you provided. I'd just run that before the comparison to exclude those entries.
 
@smci VLQ & NAA ought to be obvious without domain knowledge. That answer shouldn't have been flagged, and it didn't require deletion; OTOH, there's certainly no reason to undelete it.
 
@RobertFarmer That's the idea.
 
Hey gang, newb question here: I need to install boto3, should I use something like pipx/pipsi or just install it globally?

Is there a case for *ever* installing packages globally (besides virtualenv, pip)?
@Sam some
 
Sam
2:25 PM
@ZachValenta I've just deployed Ambassador as a loadbalancer and api gateway... now I want to add a service(?) from a container image i have stored in Google's container registry but I have no idea how to do this
 
I only install packages globally because I'm too lazy to set up virtual environments. Luckily I only install like three packages a year so by the time my module paths get overpolluted, it will be time to get a new computer
 
overpolluted module paths? what are those? that sounds bad.
 
Essentially: if two modules happen to have the same name and I install both of them globally, then one of them will become inaccessible.
 
If you're using Pip to install things wouldn't it throw an except of some sort?
 
@Sam you're ahead of me in Kubes, I don't have an answer. I'd never heard of Ambassador before, will do some reading on this and related tech (Envoy, Linkerd). Hopefully next time we meet here I'll be at your level!
 
Sam
2:31 PM
I'll let you know if i figure it out
 
@U9-Forward ...I won't know what QML is without googling it.
cbg all
 
Does anyone know how websites like google search for similar images based on another image?

Note: I like hashtags!

#Google #OpenCV
 
I don't know whether pip would warn me about duplicate package names or not, since it hasn't happened to me yet.
Probably because I almost exclusively install modules from pypi, which assigns a unique package name to every package. (... Right?)
 
@Sam cool, please do!
 
@X4748 stackoverflow.com/questions/843972/… discusses some image similarity algorithms, although it's unclear which (if any) is used by google specifically
 
2:35 PM
@Kevin It doesn't matter what Google uses, it was just an example, thanks
@Kevin One simple and quick question! What data do I have to store in my tables/database?
 
\o cbg
 
o/ cbg
 
I think you should store the image data in your database. Can't compare images without the images.
 
several times I've begun a response to "\o" and I accidentally typed "./" and it reminded me of what happens to Beetlejuice at the end.
 
It's too long to read, I'll read it later... right now I'm working on something else, when it's finished I'll think about pythonic parts!
 
2:44 PM
Perhaps "./" has a normal sized head but a very long arm.
 
That is a distinct possibility
 
@Kevin Hmmm, Like what? I've stored data such as height, width, size, name, etc.
 
 
Is that enough?
 
@X4748 You need pixel data too.
 
2:47 PM
I thought maybe it's good to store pixels or something like that..
@Kevin +1
 
Kevin, what is that image.
That is something out of a fever dream
 
If you only store height/width/size/name, then you might have two 500x500 images that are 100kb each and they're both named "x.png", and one is a picture of a fish and the other is a picture of a bicycle. All of the stored data is identical but the images are as different as can be
I suspect you know this already and I am misinterpreting your question somehow
@RobertFarmer It's Nightcrawler by Boris Groh. I assume the friendly giant skeleton is watching the child to make sure he gets home safely.
 
@Kevin do you know if there is a story behind that image? He looks like he just wants to be friends.
I missed the preexisting explanation (-:
 
Honestly you say Giant Skeleton and I get Dark Souls flashbacks.
 
I tried looking up the source (which I believe is at artstation.com/artwork/eLvAZ) to see if there is any commentary, but I don't see anything substantial.
I assume the comments from the author on the right translate into something like "glad you liked it"
Ya, "Спасибо большое!" is apparently "Thank you very much!". This tells us nothing.
 
2:58 PM
The child does not appear to be afraid but the footprints in the snow indicate that someone may have been at some point
 
i cant tell if behind the Skeleton if the swirling of the background is meant to be fire or smoke from something
 
I am reminded of a different artist who draws vibrant scenes of giant monsters and knights etc and all the titles subvert the apparent storyline because they're all like "hey man I like your sword"
 
Strange that the skeleton appears to me to be sad although I cannot see his facial expressions
 
Most of Boris Groh's other paintings are also in the genre of "spooky thing lurking in a not-actively-hostile way" although artstation.com/artwork/3yowJ does appear to be shooting death beams
 
get a real War of the World TriPod style vibe from that
 
3:04 PM
It's time for ... Vague Questions I've got a function that uses numba.njit to make fast a process that ranks values in a dataframe. This has been working fine forever. That is until I tried to use it in my flask application. When I attempt to just call the function on a dataframe it just hangs my application. I'm already digging into many aspects but maybe just maybe someone has a "Oh, that's just this one thing you forgot to do..." type of comment.
 
@Kevin Hmm, I still don't understand something, How am I supposed to search for other images when I only know height and width? I want to search for images using SQL queries, isn't that possible? I have to get all images recursively?
 
@Kevin that's sun peeking through the clouds and then the creatures armpits (lump-pits)
 
@piRSquared when it worked before did you call it on a dataframe, and if yes, on a similar kind of dataframe?
 
If that's true, it's really hard to compare! there may be millions of images!
 
@X4748 I don't think you can do it with just SQL queries. You're not going to find a select * from images where SIMILAR(data, target_image_data) that works right out of the box.
 
3:08 PM
@AndrasDeak yes, same exact dataframe
The server I'm running flask on is different though and I'm fairly certain (51%) that is the source of my problem.
 
[Quack] have you tried running the flaskless original on the other server?
then you can differential diagnose between flask and server
 
bah... such a good idea. I don't have that access. Off to get that access (-:
 
@Kevin Correct, but it has to be a really hard thing to find similar images! or maybe not... :thinking! I only need 10 or more of the latest images
 
@piRSquared But crepuscular rays always converge to a single point in front of the apparent position of the sun. In that image, there are two different points of convergence. Possible explanations: 1) the beams are coming from the being, but they are not death beams. Maybe they are fun party beams. 2) the artist doesn't understand how crepuscular rays work. 3) there are two suns in the sky, each positioned directly behind the being's armpits.
 
with two suns you'd probably see four rays
 
3:15 PM
artstation.com/artwork/OQzKJ is another depiction of fun party beams, this time directed towards the being rather than from
 
and are you sure the beams don't converge in a single point above the party alien?
that would only leave the flare unexplained
 
 
I was just about to do that, thanks ^
I didn't notice that the right bundle was so closely focused
 
I think two suns poking through one hole would create two groups of rays and not four.
 
No, I meant two holes.
But then considering the flare at the point of origin of one of the rays it has to be an alien-slash-supernatural-being-sourced party beam
 
3:22 PM
Hmm, but with one hole I don't think you could get that pattern. I would expect the rays from Sun A to crisscross over the rays from sun B.
 
one hole would have to be large enough that one would probably not see the volumetric light
 
Like this.
 
Sam
@Arne I reverted back from the wheel approach after but did manage to get a solution working in the end
 
If the holes are tiny... maybe we get a quantum interference pattern
 
the good thing about light is that it does classical interference anyway :P
 
too high-brow ;)
 
In that scenario I would realize that I am in a simulation designed to torment ethicists, and I would demand to be released into the real world or at least be ported to a more entertaining MMO
I think it's probably a good idea to occasionally shout "I demand to be released from this simulation" even if you're not at the helm of a trolley problem
 
wim
# puzzle.py
def myfunc(n):
    result = []
    for i in range(2, n):
        for j in range(2, i):
            if i % j == 0:
                break
        else:
            result.append(i)
    return result
    # your code here

print(*myfunc(10))
the script behaves like this
$ python3 puzzle.py && echo $?
2 3 5 7
0
what can you add to the function, at the place I have specified, to make it behave like this instead
$ python3 puzzle.py && echo $?

0
 
In the webcomic Trixie Slaughteraxe, there is an item called the Scepter of Death that gives you a vision of your future at the moment of your death. This is less useful than it sounds because the scepter doesn't work recursively. If someone in the vision touches the scepter, nothing happens. Anyone acquainted with the mechanics of the scepter will realize that they're living in the scepter's simulation, and will most likely take wildly different actions than if they were real.
 
Just guessing: yield ''
 
3:40 PM
Perhaps in a moment of insane grief they will slay the person having the vision. Then the real-world person will see that they died as a result of grief-driven slaughter, but since the real-world killer won't have any reason to go insane with grief, the death will not come to pass even if the scepter-holder does nothing to avert it.
 
wim
@PM2Ring you got it. too easy?
 
In a recent post that I answered, the OP commented "this works... But only after I restarted my interactive session and re-imported my code. Consider adding a warning that this is necessary to your answer". I don't know how to tactfully say "no, I won't do that, because if I did then I would have to add that warning to every answer I've ever written"
 
@wim Maybe. ;) But we were talking about this stuff here quite recently.
 
morning cabbage
 
Hey is it feasible to turn Python code into a executable? I was talking with someone and said its not worth the trouble but how would yo deploy the code anywhere then if the user of said code isn't Python-Savvy and wouldn't know how to run IDLE or anything
 
3:48 PM
There are some projects that bundle Python scripts into executables, for example Py2exe. I find these projects insanely frustrating to use for anything other than the simplest of applications.
Common things that make compile-to-executable projects to fail in confusing ways: 1) importing a third party module 2) reading from a file 3) having a more complicated project structure than "nothing but .py files in a single folder"
Each of these things is ostensibly still possible to achieve, but I see a steady stream of questions on the main site asking why each of these don't work, so I assume the project maintainers aren't trying very hard to make them easier to do
This may or may not be because automatically finding all the dependencies of a project with 100% accuracy is NP-hard and/or is provably impossible thanks to the Halting Problem
 
Well that one back at the core question. If turning scripts to executables is that is difficult what is the best way to make use of the scripts? Just send them to the user tell them to only ever run the scripts and never ever edit them? or is there someway that is obvious 1000% better i just don't know.
 
@RobertFarmer Target platform? Linux? Windows? Any and all?
 
Windows
preferrebly Any but Windows is common enough
 
The Cool & Trendy solution is to write a web application powered by Python and a framework such as Django. Then your user doesn't need to install anything, they just need to navigate to your website.
 
Well that certainly is a fair example.
 
3:55 PM
If you can be assured that Python is installed, then wrap up your project and all its dependencies in a .zip - if I'm not mistaken you can reference a module within a zip archive and run it
If no Python, then there are projects like PyInstaller. OR, look into writing your app using 'boo', which is a Python-y but .NET-friendly language.
boo will compile to a Windows .exe or .dll
 
If your concern with sending raw scripts to your users is "what if they modify the scripts and then run them and something bad happens?", I don't think that's worth worrying about. If the user isn't tech savvy at all, they won't even think to open the script. If the user likes to tinker, then they probably are well acquainted with the consequences of their curiosity.
The question of "how do I stop curious users from blaming me when they modify my script and something bad happens?" is a valid one. Maybe stick a stern disclaimer in the readme file.
 
Having converted to use a class instead of a dictionary, it's kinda pleasing when tests pass because you implemented the class to be iterable using one of it's attributes.
 
@Kevin Yah, but then there are the tinkerers-who-think-they-are-savvy-but-arent-quite-as-savvy-as-you-would-like - stern disclaimers are probably the best you can do here
 
00:00 - 16:0016:00 - 00:00

« first day (3110 days earlier)      last day (1824 days later) »