« first day (3457 days earlier)      last day (1477 days later) » 
00:00 - 18:0018:00 - 00:00

wim
12:01 AM
1 more... mechanical turk stackoverflow.com/q/60981636/674039
 
It was very familiar...
 
wim
@AndrasDeak yeah. I'm not saying they should be banned. I just find them boring. I still like to see what clever tricks people can find in "real" languages.
 
 
2 hours later…
1:55 AM
about to get ready to get a cffi module of mine working on another OS.. giving me a nervous feeling =(
 
2:20 AM
anyone know a good simple ref on how to package a project using wheel?
 
wim
3:10 AM
LOL, building out pypy3.6 from source and their jitting scripts print out freaking rainbow ASCII mandelbrot sets or something, for progress bars
 
yeah, one thing I like about watching pypy being built
 
3:23 AM
hi, how do i start a chat for a question? or do i need to wait for the notice to trigger from too many comments? the user is new so doesn't have 20 rep for joinig.
 
@aneroid see room rules
 
wim
they are not talking about this room, they are talking about a dedicated room for chat on one question
as far as I know there is no way to manually trigger that link, I asked mod about it once.
 
Ah okay. got it wrong
 
you could probably start a channel through this interface and invite the person @aneroid ?? go out one level from this chat, and at the lower right there's a create chat button.
 
3:42 AM
ah ok, thanks @Todd. I did see that but wasn't sure if those were correct/appropriate for questions
@wim that's too bad. perhaps because it may have been prone to abuse or needless creation of per-question chats?
 
4:01 AM
@Todd That won't help for aneroid's situation because the other person doesn't have enough rep to write in normal chatrooms.
 
oh well.. at least the system will offer a chat if comments continue for a while
 
Yep. It would be great if high rep users could manually trigger the creation of such chatrooms. Or have the power to invite a low rep user into an existing chat. We've asked for such things for years, to no avail. The chat system is fairly neglected.
218
Q: Room owners should be allowed to accept <20 rep users to talk in a room

Jon ClementsI'm a fairly heavy chat user - and I think for new users sometimes it's best to direct them to a room related to their question, whereby details can be thrashed out (avoiding a long stream of comments). Thereby, getting a question back into shape and answerable - possibly even answered and posted...

 
4:54 AM
tagged with Python badge
 
 
2 hours later…
6:28 AM
@αԋɱҽԃαмєяιcαη I think that's pretty clear, they actually need getattr.
And perhaps not even that, cannot remember how BeautifulSoup objects work from the top of my head.
 
6:57 AM
cbg
 
cbg
 
Wait is Roganjosh a RO now?
 
Congrats @roganjosh
 
7:00 AM
@Alex Room Rules we request that you don't ask about questions here that have been posted on main site for at least 48 hours
 
7:19 AM
Hi everyone I need to ask something
 
Go ahead, though please take 2 minutes to read the room rules, linked top right
 
I want to access other websites, but I want to show my cellular network that i was using YouTube can it be possible?
Like i have a a bundle in which i got 15 gbs for YouTube only but u want to use them for another purpose
 
No, logically that doesn't make sense to me.
 
Did you get what i said?
 
With the disclaimer that this is all based on my understanding of how things work, You're essentially asking if YouTube can be your vpn/proxy/gateway, YouTube isn't designed for that.
 
7:25 AM
Okay
Thanks though
 
For your cellular network to see traffic from one website, that website has to be the one sending the traffic, no matter where the traffic initially originated from.
No worries.
 
what would print(urllib.request(url.com)) count as server side then?
You could fetch a url serverside, and display it (using CGI), but that wouldn''t count as a proxy or vpn
 
7:47 AM
consider another cellular plan =)
 
@RazaChishti this is probably impossible, because your provider doesn't ask your phone which addresses it accessed (in which case it would at least theoretically be possible to spoof), it will instead ask your provider where your traffic came from.
 
the youtube restriction probably only applies when accessing the web on the cellular network, but not if you connect to wifi
you can always have one of your friends turn on hotspot, and connect to their wifi
 
user11585758
8:17 AM
Tor is best for proxy and vpn
 
8:46 AM
@Simon cbg and thanks :)
 
cbg. Does Python call the `__len__` dunder method on list implicitly when evaluating the following expression:

```
a = []
not a
```
 
how can I add tags to a question that is already pending edits?
@isquared-KeepitReal no, it calls __bool__.
 
@MisterMiyagi what does __bool__ do? I am thinking about time complexity of that operation
 
The various protocol fallbacks (e.g. iter using __getitem__) mostly exist for historical reasons.
 
actually list doesn't have a __bool__ (at least in the python 3.7 that I have installed)
 
8:50 AM
how do you inspect the dunder methods of list?
 
>>> list.__bool__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'list' has no attribute '__bool__'
 
nice
dir(list) gives all of them
 
@isquared-KeepitReal How could the time complexity be anything other than O(1)?
 
wonder how to figure out what is called when we do bool(list)
 
>>> import dis
>>> dis.dis("a = []; not a")
  1           0 BUILD_LIST               0
              2 STORE_NAME               0 (a)
              4 LOAD_NAME                0 (a)
              6 UNARY_NOT
              8 POP_TOP
             10 LOAD_CONST               0 (None)
             12 RETURN_VALUE
@isquared-KeepitReal
 
8:53 AM
All you need to do is check if the list contains at least one element. That's obviously O(1)
 
@Aran-Fey huh, that's embarrassing. same for dict
 
@Aran-Fey yes... correct
@Aran-Fey maybe for the cases when all but the last element is not None. Or would None be considered an element in itself
 
the values don't matter, what matters is whether the list is empty
 
I am confused, why is len called so many times?
class List_(list):
...     def __len__(self):
...         print('called __len__')
...         return super().__len__()
...
not List_()
called __len__
True
called __len__
called __len__
 
8:57 AM
No repro. Is that IPython?
 
ahh
yeah, that's probably why
right, if run in a file it gets called exactly once.
 
Why does IPython call it extra times?
 
ipython calls __len__ just once for me as well
unlike the standard REPL, it calls __len__ also to print the list
 
9:29 AM
once here too
 
9:58 AM
cbg
Oh that comment, like he have another solutiin
 
Mmm, I'm not sure what to make of gpg telling me I have an insecure passphrase to sign my commits because it doesn't contain a number or special character. I would have thought they'd know about xkcd
 
@roganjosh good day for you and congrats for RO :P
 
Many thanks @αԋɱҽԃαмєяιcαη :)
 
you welcome :p
 
@αԋɱҽԃαмєяιcαη TBH, the usual solution is "don't touch untrusted sites". SSL exists for a reason.
 
10:14 AM
I understand that point already.but where the solution itself. Now you've to deal with a url, but for some reason they aren't covered with cert. So what i should do ?
 
@αԋɱҽԃαмєяιcαη There isn't always a solution.
 
Thanks @Arne
 
well that's why i were asking him, (Okay we all know that it's dangerous). So tell me what do
 
i had a thought, I just wanted to discuss.
 
I'd use the standard "this is a stupid idea disclaimer": Warn them that this should only be done if they actually trust the site.
 
10:16 AM
there's nothing to make you work under antibiotic coverage
@MisterMiyagi noted , will do next
 
10:48 AM
@MisterMiyagi isn't the point that third parties can hijack even uf the site itself is trustworthy?
 
Hello guys ! want to know if i have categorical column and categories are w1,w2,w3,w4 . i need to know the levels assigned to it .. in python ..In R using attributes we get to know the levels of the category but in python i dont knwo how to go about .
 
If "levels" are terminology I'd start with googling "pandas categoricsl levels", assuming pandas
 
Nah, too obscure, sorry
This needs no pygame, just "+= on immutable input"
 
10:57 AM
Nah, it's the same issue :)
Or similar...
Anyway, have to go now. Rbrb
 
:p take your time. have a lovely day
 
Got it!
@αԋɱҽԃαмєяιcαη thanks, you too
 
@MisterMiyagi a war in comments at the end, he edited his answer with the same which i said in comment section
 
@AndrasDeak i did that but wasnt able to serve the purpose
 
@αԋɱҽԃαмєяιcαη comments are not for answers
 
11:03 AM
@AndrasDeak I understand but i feel it's a bit ugly to edit my answer while I've open dialogue with the asker, something like i take points and run to add
at least the viewer will see the answer and all comments below to understand why there was a dialogue even, better than keep checking the edit history
 
@αԋɱҽԃαмєяιcαη I'll look into it later
 
@NabiShaikh pandas doesn't call them 'levels', for whatever reason. If you mean the categorical's values (e.g. 'foo','bar') they're called 'values', if you mean the integer values backing those, pandas.Categorical calls them 'codes'. This term is not really properly documented in the User Guide
 
@AndrasDeak alright.
 
>>> pd.Categorical(["a", "b", "c", "a"], categories=["b", "c", "d"], ordered=False).codes
array([-1, 0, 1, -1], dtype=int8)
>>> pd.Categorical(["a", "b", "c", "a"], categories=["b", "c", "d"], ordered=False).categories
Index(['b', 'c', 'd'], dtype='object')
 
hello every one
I can't print api response in frontend in flask
filename = secure_filename(file.filename)
            filepath = os.path.join('upload', filename)
            file.save(filepath)
            data = put_request(filename, filepath)
            return render_template("index.html",data=data)
 
11:09 AM
@Mannya Hello. You'll need to be more specific, please. What do you mean by printing the response?
 
data = {"status": 1,
"message": "extracted data",
"data": {
"date": "Wednesday 01. January 2020",
"parties": [["COMPUTER SCIENCES", "ENgineering"], ["CMD", "Engineer"]],
}
}

here is the data
how to print date in index.html
@roganjosh
 
What are the contents of index.html? Do you have the jinja tags to access what you're sending to the template? Please put the relevant parts of index.html into a pastebin/dpaste/gist and link to it
 
@Mannya That response is in JSON. You mean "I want to parse the response JSON and access the 'date' field"? There are tons of existing simila questions, please see them.
 
This is my index.html file code

<div class="table-responsive">
<table class="table">
<thead>
<th>
<td>Sr.No</td>
<td>Label</td>
<td>Value</td>
</th>
</thead>
<tbody>
{% if request.method=='POST' %}

{{data['message']}}
{{data['data']}}

</tr>
{% endif %}
</tbody>
</table>
</div>
:49017625 yes please look at the index.html code
what I am doing wrong here?
 
{{data['data']}} --> {{data['data']['date']}}
@Mannya also please see the guide to formatting code in chat
 
11:15 AM
@roganjosh I did that too, but
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'data'
 
@Mannya OK. Please collect your code together into a properly formatted dpaste and link to that resource here.
I think I know what the issue is. If you link your code properly here, I will respond in-kind with what I think will fix it. But I want to be sure I'm reading the code correctly
 
Thanks. Where does put_request come from?
 
put_request is a method which returns data
 
Ah, right, I follow now
 
@Mannya please see the changes here
 
Okey give me 1 min I am checking
 
You're sending a string to the template, not a python object or anything serialized as JSON. Therefore, you can't access anything by key in your template. In place of jsonify, you could try json.loads to give a dictionary
 
but the API return json response
how IT changed into string
 
11:31 AM
You didn't deserialize the string that you're getting sent back, you just pass it straight on to the template. Perhaps I'm relying on jsonify to do too much, so instead use data = json.loads(put_request(filename, filepath)). You still need to keep the change I made in your template
Separately, data = json.loads(put_request(filename, filepath)) is pretty brittle if the API doesn't return a JSON response so you'll probably want to break that into multiple lines with some exception handling, but I'm just trying to check we can get it working
 
okey let me check this change. API is taking around 1 min for the response
Thanks Buddy It worked!! thanks a lot @roganjosh
 
why would an API taking that much time to response back? are you sure it's the back-end API?
 
@AndrasDeak Take your pick of trust the: provider, site, request, connection, ...
 
Sounds like you do have an operation done before going in the fly to the API
 
@αԋɱҽԃαмєяιcαη I am not that good in english. I did not get you fly API?
 
11:39 AM
@Mannya You're welcome
 
API is taking time because the the file are in pdf formate api perform ocr on pdf then text extraction the classification
 
@Mannya I'm asking, are you sure that the delay occurred from the API itself? or you are doing an operation which is taking a time before sending the POST request ?
 
@αԋɱҽԃαмєяιcαη Sorry, I don't see how their answer covers your comments. Perhaps something was deleted?
 
I am sure its the API which taking time
 
@MisterMiyagi Ask imagetwist.com to fix their configuration (Good luck!) is covering the part of otherwise go ahead and go ask almost of site where the cert is unverified and then ask them to verify it.
and yes just noticed now there's part deleted.
@Mannya then the delay here on transferring the requirement to the API, or yea if the back-end performing an action so that's sounds logical
But for an instant query without waiting the back-end to process something. i would not expect a delay
 
11:44 AM
Do you have any idea how I can improve the response time of the api
I created the API which I am using
previously it was taking around 1.5 min
 
Well, it's actually based on what you are doing internally once you receive an outbound call. sounds like you need to thread what you are processing internally then
 
but then I stored the trained model after that api started giving response in 1 min
 
So you're loading some kind of machine learning model?
 
Cool. so we are in the right track. you have to enhance the internal process. so you can response in time
 
yes I am using naive bayse and NLTK
spacy too
 
11:46 AM
@smci Thank you ...got it
 
@Mannya Ok, and does the model change on each request (i.e. is this more info for it to learn on) or you just want the model to give a prediction?
 
@roganjosh just for prediction, model is not changing
 
@NabiShaikh please see room rules and practice in sandbox before posting a code. here's a guide on code formatting
 
@αԋɱҽԃαмєяιcαη of got it similar to statckoverflow i will repost it
 
11:50 AM
@Mannya Ok, then you could probably load the model as an app global when you start the app, rather than loading it every single time in response to a request. This depends a lot on how you've structured your app and I probably don't have time to help actually set it up right now
 
okey
 
run_cmd=f"if temp_dfi['{i}_levels'].isna().sum() > 0:
print(temp_dfi['{i}_levels'].isna().sum())
temp_dfi['{i}_levels'].fillna('w{uniq_val}', inplace=True)";
exec(run_cmd)
So above code , i am unable to execute in exec command in python , one linner code i am able to run but if statement as above i am unable to do so ..
 
:49018000 Please pay attention for what I've mentioned for you. better than posting and removing !
 
@NabiShaikh as was suggested to you already, please practice in the sandbox
Separately, I have no idea why you want to exec this string anyway
 
Can I ask One more question?
 
11:58 AM
Sure
 
I can't post my question S.O
We are not taking question from this account. This is what I am getting when i try to post question
 
@Mannya you can usually post your question here and wait for an answer. better than asking Can I ask One more question? and waiting for someone to tell you go ahead
 
That means that you have been question-banned on the main site
 
How I can resolve that? I edited my question also.
still my account is blocked
 
12:02 PM
@αԋɱҽԃαмєяιcαη I think it's fine that they ask as a point of etiquette if they are not familiar with the room. It's better than being spammed with lots of questions and having to tell someone to stop/kick comments to Ouroboros
 
@roganjosh my answer based on his previous dialogue with you actually as he already aware of rules.
@roganjosh also the rule stating the following. Ask your question directly. Avoid asking if it's okay to ask, or if anyone knows about a topic. Users may want to see your question before speaking up, and users who join later can see it.
 
I am sorry That I said such stupid thing. my appology
 
@Mannya there's nothing to apologize about :P we love to help always
 
@αԋɱҽԃαмєяιcαη sure, but be mindful that the rules don't cover every situation. The user was asking if it was ok to ask another question. I'm sure I don't need to remind you that some people have to be told to stop, very directly, asking questions because they just bombard people in the room. Given that background, I don't think there is an issue with someone checking to see if they're ok to ask further; let's not discourage that
 
@roganjosh i don't have Controversy with you. you are old than me here and you know the rules better than me. so thanks for learning me new point :P
 
12:08 PM
@αԋɱҽԃαмєяιcαη no worries :)
 
@roganjosh in that code , if you observe there is i variable which is the column name and thats keep on changing . that why i am asking , any way thank you appreciate your reply ..
 
@NabiShaikh sure, but you've taking the f-string concept too far. You should keep it as code and have 3 separate f-strings for the areas that you want to modify i. Don't just make one big string
 
@roganjosh i doubt it will work or not i am not sure , let me give a try ...point taken thanks ...!!
@roganjosh Also , if we use f string for every single line , how indentation would be taken care of ..that is need to be tried
 
that moment when you taken a time for solve a complicated question and then the OP delete the full post once receive the answer :(
 
12:36 PM
Is there a library that guesstimate a function that was used to generate data?
I.e. I have a set of records with certain properties and the resulting y
and I want to determine how the value of Y has been calculated
 
@αԋɱҽԃαмєяιcαη that link is not to a meta post, it's to a post on security.SE main...
 
Ops, i do apologize for that. wrong copy/paste.
 
@NabiShaikh sorry i meant that link actually. How to implement conditional string formatting?
 
I think you misunderstood...and misread... I meant the comment that I linked using the orange link that says "that link". Are we talking about the same thing, αԋɱҽԃ?
 
12:41 PM
What I am doing wrong here?
https://dpaste.org/WJkQ
 
@Mannya can you explain why you think it's wrong?
 
jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'data'
 
@AndrasDeak Got it now. yes it's on the security site not the meta.
 
I am getting this error
 
@Mannya {% for j in if data['data']['duration'] %} doesn't make sense
 
12:42 PM
@αԋɱҽԃαмєяιcαη OK
 
@roganjosh I need that j to print the key of the dictionary
 
@Mannya ok, but why do you have if in there? That wouldn't be valid in Python, nor is it valid in jinja
 
dpaste.org/8Hkb please look at this updated
 
ugh
@Mannya please read what roganjosh told you. Look very carefully at your original line 9, which roganjosh quoted. for j in if is never valid Python syntax. Do you understand that?
there's no point adding more things until you understand that
 
sorry , @AndrasDeak
 
12:50 PM
It's alright, we're just trying to help you see what's wrong.
 
@αԋɱҽԃαмєяιcαη i did't get your question can you please ellaborate
 
@NabiShaikh I've just shared for you a question been disused before for the same one you are asking about. once you click on the link, you will see the full details. , where you were asking how to build if condition within fstring
 
1:40 PM
Let's say I have a list with 4 strings ['a','b','c','d']. I want some kind of function that, each time I call it, it will give me the next item in the list, and starting at the first once the end has been reached
 
@MitchellvanZuylen itertools.cycle(your_list)
 
I tried that, but I'm not sure how to call the iterator
 
well, that's an iterator. Your function has to return next(that_iterator)
 
Ha! Perfect, that next is what I was missing
Thanks!
 
no problem
 
1:42 PM
A normal iterators wouldn't loop right?
 
yes, iter(your_list) only iterates once
 
StopIteration cool, just tried it
Thanks!
 
But you can just loop over cycle(your_list) if that's what you need. You very rarely need to step iterators manually in nature.
or zip them together with something else, things like that
 
I was thinking to apply it for this code/question on codereview:
https://codereview.stackexchange.com/questions/239862/a-simple-animation-in-pygame
 
Off-Topic Seeking help for bypassing captcha.
 
1:45 PM
@αԋɱҽԃαмєяιcαη I'm still not sure that's a valid close reason
@MitchellvanZuylen to which part?
OK, I see it
 
There's a function in there

def getDirection(direction):
    directions = ['right','down','left','up']
    idx = directions.index(direction)
    idx = 0 if idx + 1 == len(directions) else idx + 1
    return directions[idx]
Oh, trying to use proper formatting but.. sorry
 
No, it's correct. It won't get better than that.
 
well, the first sentence is formatted as code, but that's alright
 
Haha, yeah, that's what I meant
 
1:47 PM
the usual issue is that code is formatted as text, killing indentation
 
Would you change the getDirection functionality with an cycle?
Yeah, last time I tried to use backticks and..didn't go well, haha
 
@MitchellvanZuylen yes
@MitchellvanZuylen not in chat, for multiline. You can see our code formatting guide to chat here
I'd also change the camelCase names to snake_case, and remove the star import, but that's just style
 
brief cbg
 
and while 1 should be while True
 
Yeah! I checked the guide but well, practice makes perfect
 
1:49 PM
Yup. You can also practice in the sandbox room linked in the guide.
 
Why True over 1? Because it's more readable
 
because semantically you want a boolean in the predicate of while
in python you just need truthiness, but specifically while True is what you really should mean in an infinite loop
As for your code, yeah, I'd replace that function with a cycle over the directions, and just call next on it right in the collision if.
Not sure how elegant it is to have these hard-wired direction names, but I also don't know how it would be better.
 
Thanks!
I had the same though about the directions, but..encoding them as simple numbers or something also doesn't make it easier to understand
 
No, I was wondering about enums, but I've never actually used them so I can't say
 
I'm gonna go read up on those. Thanks!
 
2:41 PM
@MartijnPieters BTW, i were unable to flag it as duplicated because the dupe haven't received accepted mark by the OP , i really were trying to cast it duplicated but i couldn't
 
 
1 hour later…
3:50 PM
ooo... have I missed something about grace edit periods?
(or am I just mis-remembering stuff)
 
Not that I know of? What did you see?
as far as I know it's "5 minutes unless a comment is posted"
 
ahh... missed a comment was posted - never mind
 
4:38 PM
Windows 10 makes too many different noises for notifications. You'd think it'd help differentiate but instead it just infuriates - "what am I supposed to be responding to?!". I think I preferred just cycling through the various platforms that someone might ping me on and shooing away Windows updates
 
am I the only one who feels 8 upvotes on this question look fishy?
 
Potentially it's hit HNQ
 
@MisterMiyagi absolutely fishy. Flag away.
 
@MisterMiyagi closed
 
4:55 PM
appreciate the input, flagged
 
no need to pile on with further downvotes, though
 
5:19 PM
Hi!

I have a picture of one star on the screen, and I want to draw a full line of stars, with spaces between them.

So first I need to convert ONLY THE WIDTH of the star into rectangle:

star_width = star.rect.width

My question:

Why don't we need to make a rectangle also the HEIGHT of the star?

Because now the star looks like an amorphous shape... one part (width) is converted to rectangle, while the second (height) stays the original shape...

Any explanations?
 
"Convert the width off the star into a rectangle" sounds odd to me. "star.rect.width" sounds like "the width of the star's rectangle". What are you doing with the width later?
And are you sure you're not just drawing one long rectangle with the picture of a single star?
I'd search for "tiling"
 
make a line of stars, then make a fleet (several lines) of stars on the screen.
 
That's not a programming answer
Anyway I have to leave
 
You need the width to find how many stars will be able to draw in one line.
star.x = star_width + 2 * star_width * star_number
 
@YoelZajac Ok, but that doesn't help us understand the question
 
5:26 PM
@AndrasDeak Bye :)
 
Is there a way to search specifically a class in a repository on GitHub? E.g the class File in CPython repository.
 
Perhaps there are fixed proportions, so the height scales with width
 
@aderchox The search bar should be a good start. (It lets you search within the repo)
 
The question is: ok, I converted only the width of the star to rectangle, but the picture of a star has also height.

I wonder if there is a command to convert BOTH dimensions into rectangle, because if you convert only one dimention it's not coherent (at least for me).
 
5:33 PM
@shad0w_wa1k3r I think their question was to find class definitions e.g. class File, where they can ignore File in their search except for where that class is actually defined
 
@αԋɱҽԃαмєяιcαη I will now
@roganjosh Yes
 
@YoelZajac Can you explain what that single, random line of code even means? What's star? What's the point of star_width? How does any of that convert the width into a rectangle (?!?) in the first place?
 
*waves hand*
 
@αԋɱҽԃαмєяιcαη is it you that cast the first dupe vote? Why does it not show a comment of "does this answer your question?"?
 
5:41 PM
Yes i cast it but i deleted the comment because i already answered it?
i think once you press on flag, you will see the link where i vote for close due to dupe
 
@αԋɱҽԃαмєяιcαη again, missing language tag
 
But you didn't. There is no answer to the question, nor is it closed. The comment will be deleted automatically if your close target is used to actually used to close the question; I wouldn't go deleting it myself
 
Hi
Have you worked with open street map ?
 
I mean, I've answered it in the comment section. it's really small question. no need to post it as answer for getting a reward for that
especially, i know it's a dupe indeed.
 
@Sagor Yes, to some extent
 
5:43 PM
I need to fulfill a city with a particular color in OSM based on latitude and longitude
But I do not know how to do this
I have worked with google map.
But now I need to work with OSM.
 
@Sagor This is likely to stray out of Python territory very quickly. What libraries are you using?
 
leaflet
I am using flask as backend
 
Ok, then that's JS
 
Can you refer some tutorial to achieve my output ?
I know this can be done by JS
 
@AndrasDeak i don't know why your mention to me loads lately. it's happen since yesterday
 
5:46 PM
IIUC you are looking to do geofencing. I don't know exactly a tutorial off the top of my head for leaflet, @Sagor
 
random question. How do I create an object that I can arbitrarily add fields to?
 
@AndrasDeak Just tagged it, Sorry :P just forgot for that one but for previous i tagged all day
 
obj = object()
obj.foo = 'foo'
obj.bar = 'bar'
something like this ^
 
@roga
 
@Code-Apprentice like that
 
5:49 PM
huh
 
@Sagor it looks like there's a library here but I can't vouch for it at all because I've never used it. I do, however, use leaflet with OSRM and leaflet-routing-machine, and also Flask. However, most of what you're asking would probably be better in the JavaScript room
 
or does that not work?
 
@Code-Apprentice i think that's cover it, i were looking into it today BTW
 
@Code-Apprentice class Thing: pass
and then obj = Thing()
 
I got "AttributeError: 'object' object has no attribute 'type'" (with obj.type = 'foo')
 
5:49 PM
@Code-Apprentice sorry, I'm right before coffee :(
 
but that might because type
type() is a global function. Is it otherwise "reserved" in any way?
 
@Code-Apprentice not that I know of
you should get a different error (syntax?) for obj.from = 'foo'
 
repl.it/@codeguru/OutlyingIndigoMisrac nope, I get the same error with my previous example using foo and bar.
 
import keyword

print(keyword.kwlist)

['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
 
Ok, need to head out for an hour or so. @Sagor leaflet is not a Python thing, so I can try help with that when I'm back, but please don't expect people to be able to answer here; that's a JS library and best-asked in their chat room. If it's a flask question + leaflet, I'm happy to try help when I get back
 
5:53 PM
@Code-Apprentice so use the class Thing
 
this came up recently...something along the lines of "if object could have arbitrary attributes it would have to have __dict__ but we wouldn't want to force that for custom types"
 
star is a module. Inside that module there is the class Star which contains all the definitions of the star (loading the picture, drawing it to the screen).

star_width is needed in order to know how many stars can enter in one line.
There is a space of one star_width from each side of the screen, and also the is one star_width of space between two adjacent stars.
 
@YoelZajac You probably have a bug on line 23
 
@AndrasDeak how can I see the lines?
 
5:57 PM
If neither you can see the code we're doomed
 
00:00 - 18:0018:00 - 00:00

« first day (3457 days earlier)      last day (1477 days later) »