« first day (3157 days earlier)      last day (1790 days later) » 
02:00 - 19:0019:00 - 23:00

2:29 AM
@piRSquared so I jumped the gun and wrote an answer to your pivot question with some missing information because I wanted to close a couple of dupes, but it's a lot better if it's just a question 10 in your post.
(point being, I've made some edits, please change or rollback if you don't think it's upto par)
 
 
1 hour later…
3:57 AM
@wim That's an excellent argument..
 
4:07 AM
@AaronHall I believe my repr satisfies that in this case. I suppose you could use repr(instance) == repr(eval(repr(instance))). Or in my case instance.json_dict() == eval(repr(instance)).json_dict() or .to_json_str() which effect8vely achieves the same without defining eq.
 
why is swiss central bank interest rate negative?
does it mean people get paid to borrow from swiss banks?
 
6 hours ago, by wim
This somewhat non-obviously means that defining an __eq__ has the side-effect that you can't use instances of those objs in a lookup dict. It's not a fair price to pay if you only added the eq method for a testing convenience, IMO.
What it means is that if you define __eq__ you should also define __hash__ if you intend your object to be hashable.
@toonarmycaptain comparing strings seems like a poor alternative.
To continue my thoughts on defining __hash__ - But usually custom objects are mutable, and defining __hash__ on a mutable object is a bad idea.
 
4:42 AM
@AaronHall well I'm currently comparing the json-serialisable dict, which is how I'm storing and reinstantiating the object, so similar in function to how you're suggesting using __repr__ there but that's not much better than a json string, hence this discussion.
This object is mutable, but by the same token should really only be compared to itself in production via is since they are classes of students, and thus should never really be equal, same as two people are either the same person, or not, even if otherwise equal in all measurable details.
@AaronHall if I understand correctly, you're pointing out in response to @wim's point that (generally mutable) custom objects aren't generally advisable to hash anyway, and thus not usable for dict key lookup anyway, so losing this by defining __eq__ isn't much of a loss?
 
5:10 AM
found this gem during "research"
Apr 4 '18 at 19:17, by user2357112
ooga booga booga
 
 
2 hours later…
7:39 AM
cbg
 
cbg
@piRSquared speak of the devil, he's just landed on the same question as me. He's also not been inactive so maybe will start answering more :)
 
question regarding sqlAlchemy
 
7:55 AM
What is your question?
 
I have to connect to mssql, does it make a difference to use pyODBC or pymssql
 
There's some discussion about that here but I'm not sure I have useful insight myself
 
as my connection string,
 
 
1 hour later…
9:01 AM
If we have a dictionary where I would like to find the maximum value, but that maximum value appears more than once, which key-value pair will be picked?
In [7]: d = {'a':1000, 'c':3000, 'b': 3000}

In [8]: max(d.items(), key=operator.itemgetter(1))
Out[8]: ('c', 3000)

In [9]: d = {'a':1000, 'b':3000, 'c': 3000}

In [10]: max(d.items(), key=operator.itemgetter(1))
Out[10]: ('b', 3000)
here is one case, c is picked and in another, b is picked, so who is getting picked is dependent on insertion order?
 
What version of python are you using?
 
@DeveshKumarSingh of course
Either first or last
 
I would assume first, similar to index
 
aah okay, and last if we convert the items to list, and reverse it, and then find max
 
9:08 AM
> If multiple items are maximal, the function returns the first one encountered. This is consistent with other sort-stability preserving tools such as sorted(iterable, key=keyfunc, reverse=True)[0] and heapq.nlargest(1, iterable, key=keyfunc).
 
aah, yes i just saw that, but how is this related to sort stability? does that mean similar elements retain the same order even after being sorted
 
Why can't it be sorted(...)[-1]?
@DeveshKumarSingh it means tied items keep their original order, so sorting a second time is a no-op
 
@AndrasDeak from what i know, we have a running maximum, and we don't sort the list to find the maximum, so sorted(...)[-1] seems counter-intuitive to me
but yes, if you sort the list on the key of max, then the last element is the maximum
 
More counter-intuitive than sorted(iterable, key=keyfunc, reverse=True)[0]?
I'm probably missing something otherwise this would be a lame explanation
With a running max you either overwrite in case of ties or you don't
 
9:26 AM
In [19]: votes = {'maddy': 6, 'katty': 6, 'jackie': 1, 'kavi': 1}

In [20]: sorted(votes.items(), key=operator.itemgetter(1), reverse=True)[0]
Out[20]: ('maddy', 6)

In [21]: max(votes.items(), key=operator.itemgetter(1))
Out[21]: ('maddy', 6)
so it sort of aligns with what the document says
 
Of course it does
 
10:29 AM
Can anybody tell me what are the best tool for the development of Machine learning project?
 
that's a very broad question. but if you wanna get your hands dirty and learn, python is a good choice for the language, with packages like scikit learn for the actual model building and packages like matplotlib for visualisation
 
If there was a definite best tool then the others would cease to exist and you wouldn't need to choose. I suppose it will depend on what your project needs to do
You have keras and tensorflow for example, or chainer
 
 
2 hours later…
12:39 PM
@RobertGrant turns out that my friend is going away for his bday so I won't have chance to sample the hot chocolate in Notts just yet :/
 
@rogan how selfish of 'em :p
 
He's already had "Tell me. Where is Ashley, for I would very much like to speak with him?" in a message. His job is hectic, but it's nearly a year since we've met up :/
Bah, maybe that was the issue. I misquoted LOTR youtube.com/watch?v=mTBsfOgS6qE
Separately, what the hell is that video? I only watched enough to confirm the quote before posting. I've since watched more
 
1:12 PM
@toonarmycaptain You keep saying "json-serialisable dict" but you're also calling it a "json string". Is it a dict or a string? dict's and strings implement __eq__, but the semantics are very different.
>>> from json import loads, dumps
>>> d1, d2 = {1:2, 3:4}, {3:4, 1:2}
>>> d1 == d2
True
>>> dumps(d1) == dumps(d2)
False
 
@AaronHall Unless you're cheeky and do json.dumps(d1, sort_keys=True) == json.dumps(d2, sort_keys=True) :)
 
thanks
 
2:43 PM
Have we got some generic Q/A about not having to use list on iterables if you're only ever going to want one result at a time (eg: not re-use it later for anything)
 
A dupe for generators?
 
@rogan this I've effectively answered in the comment 'cos I don't think it's worth a full answer as I'm fairly sure using list to consume iterables when you don't really need to must have come up plenty of times...
 
"then just use writer.writerows(reader)" I don't actually know if writerows is smart enough to iterate through rather than generate all the rows before writitng tbh
 
it is
 
Well, that saved me some research, I'll take your word :)
 
2:51 PM
it's basically a shorthand for for row in something: writer.writerow(row)...
 
@JonClements hey, do you have a second to lend me a hand? There's something that's been bothering me to no end...
 
@cs95 umm... maybe?
 
so this comment has a missing "is"... you wouldn't mind editing it for me, would you? ("Your answer correct" -> "Your answer is correct")
 
I wouldn't normally bother, but done.
 
Thank you so much <3. normally I'd just delete and re-write, but this had a lot of upvotes.
I'll try not to have to bug you again.
 
2:56 PM
Huh, my search for a dupe has led me to understand why nosklo has such high rep, despite the awful answers I was seeing recently
 
@roganjosh standard "right place at the right time"
 
I accidentally b0rked the links on the riddles page and now I can't find this riddle in the transcript. Can anyone dig that up?
 
That's 2 I've found about iterating through files
 
@cs95 no biggy
@Aran-Fey I didn't even know we had a Riddles page!!! :)
 
Kevin started it and then I over-engineered the crap out of it
Now it's nice to look at but painful to modify :D
 
3:04 PM
I was skimming "nonlocal" search but maybe the site has log for this?
 
hi, i have a numpy array that represents a map. it just has boolean values for whether a tile is pathable or not. what is the best pathfinding algorithm for a map like this? a*?
 
@Aran-Fey just had a quick at what pops up when you click "edit" :)
 
@Tweakimp did you try A*?
 
@roganjosh no clue if sopython has backups :(
 
no, im just starting and trying to figure out what to implement.
actually i only need the direction of where to go next, not the full path. is there something quicker for this?
 
3:06 PM
@Aran-Fey afaik - it doesn't... we never even got around to proper revision control either...
 
or do i need to calculate the whole path
 
Well if you don't create the full path, wouldn't a local path just slam you into walls?
 
what would a "local path" be?
 
If you want the shortest distance then I think you need a full path. If you don't really care, then calculating the path locally on each step might work, but it's still going to send you in random directions because you don't know where you're ultimately supposed to be
 
ok
 
3:10 PM
@Arne 1 more vote needed
 
locally in terms of, say, 3 cells' distance from wherever you are
 
@Tweakimp you can also try scipy.ndimage.morphology.binary_dilation iteratively for a dumb BFS solution
 
i dont really care what solution, i need the fastest :p
 
Faster to run <----------> faster to implement
 
So you'll need to calculate the entire route
 
3:15 PM
i meant fastest to run ;)
 
Can I ask what you're trying to do, ultimately?
 
im writing a bot for starcraft2 for a coding competition, bot vs bot.
i want to get the direction in which a unit has to go
 
Oh. That's not really my arena so I'll step back.
 
to then add other factors like other units to calculate the direction it should go for the next frame
 
3:18 PM
probably A* or Dijkstra
 
i didnt find any numpy pathfinding algorithms :( most pure python algorithms are too slow
 
@Tweakimp some shortest path algorithms involve matrix operations. You should be able to implement these in numpy from some pseudocode.
 
can you tell me their names?
 
10
Q: A-star search in numpy or python

sam boosalisi tried searching stackoverflow for the tags [a-star] [and] [python] and [a-star] [and] [numpy], but nothing. i also googled it but whether due to the tokenizing or its existence, i got nothing. it's not much harder than your coding-interview tree traversals to implement. but, it would be nice t...

 
i dont know what to look for
 
3:23 PM
Pathfinding along neighbours doesn't lend itself well for vectorization
 
hello
i'm trying to send dataFrame , ( JSONIFIED ) from flask to the front end ( JS )
i'm having truoble either in sending it in JSON or in Parsing it .. because on front end when i do request like x[0] , i get "["
 
Why might you get "["? Have you considered this issue?
 
that is the issue iam considering ...
back end is like this
 
This rings a bell
 
Too many bells
 
3:31 PM
DbDf = DbDf.to_json(orient ='records')
print('DbDf = ',DbDf)
//COnsole
DbDf = [{"0":1,"1":"qwdqwdq"}]

return jsonify({"df":DbDf})
 
But every other time, more people get pulled in so I'd rather try deal with it than have it become another 50-line discussion
 
i think the backend is ok right ?
the front end i'm using vanilla javascript
 
Vanilla JS says nothing about how this is parsed on the front end
 
You have a //Console in between python lines
 
req.onload = ()=>{
    let x = JSON.parse(req.responseText);
    var tableData = xmlParse.df;
    console.log('tableData[0] = ',tableData[0]);
i meant to say that is what i had on console since command print :

DbDf = [{"0":1,"1":"qwdqwdq"}]
 
3:34 PM
You send a json from python. So ask about what you do with that in JS in the JS room?
 
^^ that is either nonsense or very advanced JS beyond what you need
 
Is it python's concern what you do on the front-end and how?
 
@roganjosh what do u mean ?
@roganjosh req.onload = ()=>{
    let x = JSON.parse(req.responseText);
this is how we parse json object
but for some reason when i tried to print the first element
console.log('tableData[0] = ',tableData[0]);
i got this
tableData[0] =  [
so i've screwed up in parseing it or in sending it from the backend
 
Look at console.log('tableData[0] = ',tableData[0]);. What's going on with the quotation marks?
 
because js thinks of it as string
'tableData[0] = ' <--- this part ?
its like a string
js print it as its
like print('string = ' )
will pring
string =
 
3:38 PM
@JRick that's python, stop right now
@JRick for the umpteenth time you are very confusing and when we try to ask for clarification it only gets worse. You often don't seem to understand the basics of the tools you're trying to use. You are becoming a burden here.
 
@AndrasDeak i understand that its python chat , i suspected that i either screwed up in python code ( sending json object ) or in receiving ..

that is why i have both codes out there , you may advice me on the python part , i would appraciate it
 
You basically forgot that jinja exists. None of the code matches up.
 
@roganjosh that is a response to an AJAX , i don't think Jinja can respond to AJAX request , it renders before the page
 
And you are a burden. I said a while back that I would stay out of these discussions but I've since seen more people, without experience of your random questions, trying to help you. It's become really irritating for me.
Like now; jinja doesn't respond to AJAX at all. It's a template rendering language
 
@roganjosh that is what i said , am i wrong about it
 
3:43 PM
Flask will render subsections of a page if you have your AJAX update, say, a <div>
Yes, you are wrong
 
ohh
how can i can send json via jinja in respond to an AJAX ?
 
And countless times before. You make strange assumptions, come here, ask some bizarre question and then it goes down hill when people try to help you but you don't have a base understanding to respond
 
:/
 
@JRick you've been asking for help with web stuff and databases, neither of which I'm familiar with. This is why I've let others struggle with you for this long, because it's harder for me to gauge if you're being helpful. This is not the first feedback from others who have technical background that you're not getting anywhere. For the sake of the mental peace of the regulars here, please try working on your own or asking for help elsewhere for a while.
 
I don't think that i have leaned everything and i dont think i will ever do
but i'm learning as i go
 
3:48 PM
It might also help if you learn one tool better before introducing another one into your arsenal. You've been seemingly jumping from framework to framework or tool to tool over a short course of time. But again, this is just my layman's impression.
 
i think i ask for a question every 2-4 days
but if that is annoying you don't have to help me with it
 
That's exactly what I'm saying. I'm sorry.
 
finally got plaidml to build.
(from source)
 
I'm curious, since you asked about flask-login a while back. I want to restrict a view from a non-authorised user. How would I do that?
 
@Dair ah, great. Outside the virtualenv then?
 
3:51 PM
@roganjosh just add "@login_required"
this decrator will be enough after u set everything up correctly
 
No, that just ensures they are logged in, it doesn't give view-specific access
 
I haven't tried without virtualenv lol. But I can try again without it. My main concern was just to get the build to succeed to I can actually push back to the github repo.
 
yeah, having it work in a virtualenv is even better I think, go with that
 
but it said build succeeded I had to change the vendor/llvm to disable something.
 
I'm asking about specific roles. You can see it on sopython github. It also uses SQLAlchemy, which you've also asked about.
 
3:52 PM
@roganjosh ok what do you mean buy non-authorized users ?
ahh ok
 
does anyone know a hassle free way of cleaning up/removing command line utilities that were once installed on your comp, but you don't use anymore?
 
there is another library you can add for that but u can do it urself as well
 
I've got like 5 gb remaining, I really need to do something about all the crud I've accumulated over 6 years
 
@JRick I have access, you have access, to this random site. But I want admin access and I don't want you to have it
 
basically, they build the full blown llvm but they don't actually need the full blown thing since there is non-essential debugging tools.
 
3:53 PM
@cs95 mac?
 
yup
 
@cs95 Sounds like you want to try a new operating system.
 
then I've got nothing :P
 
You can switch to ubuntu and then when that gets too bloated you can switch to arch
 
I am looking for help in GeoDjango based on this question https://gis.stackexchange.com/questions/325217/loading-multiple-shapefiles-in-geodjango
This question was also posted on SO but there was no response, then someone on GIS asked me to post there. any type of help will be appreciated
 
3:54 PM
lol. I've done pip installs and pip install --users over multiple python versions, ML stuff, language models, hefty crap
 
@roganjosh you can use library called "Flask Principal" or you can add role tables urself and whenever user try to access that page you must run function to check his/her role
 
@JRick how do you prevent access to non-admin users in that case?
 
where do I begin ;_;
 
macs might also have a concept of "these packages were auto-installed and are no longer needed" but I don't trust that on debian anyway
 
sudo apt autoremove
 
3:55 PM
Ok, and how does that look? You can do it without flask-principal
 
not to mention all the stuff with brew ...
 
there's probably an equiv to that with brew
 
there's a start
 
@roganjosh yea ofc without flask - principal all you have to do is get the current-user , query his role from database and check if he is "admin" or not for example ... if admin he can access if not u raise error or redirect him
 
users and roles are many-to-many
Users can have multiple roles so the view should check for that
 
3:58 PM
yes
 
So, I'm curious of what you come up with
 
@JRick But do you know if that is efficient? (I mean it might be. I honestly dont know if it is or isnt, but databases are pretty complex, there might be a better way)
 
You ask a lot of questions of us. I would be less frustrated if I knew you were taking all the technical feedback in and reading around the libraries you're using
 
@roganjosh i've not gone throw this yet but i will defenitly look for all security breaches that is known at the moment and i 'll make functions to prevent that from happening to me
@roganjosh dude , i do , trust me , i work and study everyday on myself
 
Then my question stands. I don't doubt that you do reading, but I've given you something to focus on instead of scatter-gun research
 
4:02 PM
my questions could be dum or simple sometimes because as i said i go on and off and i forget some simple stuff , and instead of wasting too much time reasearching i rather just ask someone to remind me on how i used to do it
@roganjosh the security part is on my mind but first my app should be working before i can securit it
 
And I'm beyond the point of obliging, and I think others will be too soon
 
you have to build the band before u hire the gurds
 
1 min ago, by J Rick
my questions could be dum or simple sometimes because as i said i go on and off and i forget some simple stuff , and instead of wasting too much time reasearching i rather just ask someone to remind me on how i used to do it
^ that's exactly what I want you to stop doing
Don't waste our time answering your question because you forget some simple stuff. Waste your own time researching and learning.
 
@JRick you're going to end up with and egregious amount of technical debt with that mentality. I've done this too many times in the past trust me, it's bad.
 
@roganjosh i hope you don't because you save me lots of time when u reminds me of that issue , it wastes lots of time to research every line i get stuck in
but i respect it if u do
 
4:04 PM
Please read the comments above
 
@JRick It wastes time in the short run but it saves time in the long run.
 
u dont have to be by myside all the time , u have helped enf
 
@JRick What does that mean?
 
@AndrasDeak hmm , ok i will try
 
thank you
 
4:06 PM
You can't sail by with platitudes. We all have our issues in work. We just don't keep bothering others with them
 
@JRick The one thing to keep in mind is that you will undoubtedly reach a point where you cannot resolve your issue with a simple Google search. This room is a powerful resource for those times. Do not waste that resource.
 
i thought its like 2 sec issue to u , i didnt think it would bother u , if i decided to google it , i might spend 1-2h and sometimes days
 
@JRick That is how you learn.
And now you know that it bothers us.
 
@AndrasDeak great then i will keep doing it , jk lol
ok i will stop :)
thanks
 
read this book recently, has some nice recipes
 
4:09 PM
You call them recipes, I think it's alchemy
 
cut it out, we're done
 
ugh, to run brew cleanup I first need to run brew upgrade which installs a lot more stuff just to remove it. Counterproductive
 
weird if you need that
something like update I'd understand (if that works the same way as apt)
 
when did you last upgrade brew?
 
the logic here being it needs to have the latest version to determine whether it needs those dependencies or not
must've been over a year ago before now
 
4:13 PM
I think for a while they didn't have clean up facilities, that's possibly why you need to upgrade.
 
peruse user reviews
This operation has freed approximately 17.2GB of disk space.fvgs Apr 17 '17 at 7:30
seems promising
 
@JRick It would also help if you take a little more care when posting here to make it easier for people to read & understand your posts. Try to avoid typos, and try to use proper English grammar. Don't use non-standard abbreviations like "enf", and try to avoid txtspk expressions like "u". Sure, "u" is common online, but it's discouraged on Stack Exchange sites, and we prefer that it's not used in this room.
 
@cs95 the question is whether anything breaks afterward
 
yeah but what do the 1-star user reviews say? :P
 
@PM2Ring i will keep that in my mind
 
4:17 PM
@JRick Thankyou.
 
@PM2Ring you are welcome , thanks for your care, I appreciate it
 
Hi All,
Any can please answer me for this question:
 
:46449362 I also linked them to the formatting guide yesterday, and got the impression from Kevin that it's been asked before
 
It looked like they were about to link to their question again
 
Nope, just unformatted code that's already been posted here, but with additions
 
4:28 PM
this time I used `` and put the entire code in it
 
@chiragsoni do it right instead. Practice in the sandbox.
 
Did the guide I linked you to tell you to do that?
 
Ok which part of this code I need to format please tell me I putted it in `` thinking that it is the code.
 
Read the yamming guide you were pointed to, and practice in the sandbox until you get it right.
 
4:31 PM
sandbox link please
 
farm meaning law farm in which the lawyer practices. — ag2019 12 mins ago
it's cute when they try
 
That's a bit nasty when they went on to correct themselves
 
@cs95 Now I have the theme tune from Green Acres running through my head.
 
I have a Category model like this:
class Category(models.Model):
    categoryId=AutoField(primary_key=True)
    parentId = models.ForeignKey('self',on_delete=models.CASCADE,null=True)
    name = models.CharField(max_length = 200, db_index = True)


categoryId  parentId   name
1            NULL     'Vehicle'
2            1         'Car'
3            1         'Bike'
4            NULL     'Wood'
5            4        'Table'
 
4:43 PM
thanks for your effort
 
In the template I want to show the parent categories(categories with parentId as NULL)
and the sub categories(categories with parentId as one of the category ids) as dropdown items of the parent category

Can I fetch the data like below using the Django ORM
{
    {"parent":"parentId",
     "child":[c1,c2,...]
    },

    ......so on
}
Think about the recursive query to achieve it.
 
It wouldn't be recursive in the example you've given
 
Ok fine but it is possible to fetch the data as I like
 
Well, you either dismiss the point about recursion, in which case I don't know why it was raised, or you have a problem that actually needs recursion. Which is it?
do you have parent-child-child relationships in this data? That's what Kevin and I were talking about yesterday
 
No I don't know recursion I just want to get the data as I showed i.e.
{
    {"parent":"parentId",
     "child":[c1,c2,...]
    },

    ......so on
}
Sorry I don't need recursion
 
4:56 PM
stackoverflow.com/questions/6928692/… would be a start, but how are you filtering the dropdown?
Are you looking for a dynamic dropdown based on values selected in another dropdown?
 
One technique I know that is use the code like this:
data = Category.objects.all().filter(parentId=None)
list=[]
for x in data:
  parent_data=x
  child_list =Category.objects.all().filter(categoryId=x.id)
  d= { "parent":parent_data,
        "child":[child_list]
      }

   list.append(d)
 
Ok, but that would be a static list
Do you call that function in an AJAX request?
 
but I don't want to iterate over the loop. What I want is in one db shot only I should get the data. I know for such a problem probably loop is required but I want that everything should happen at db side only
whatever code I showed that I am thinking to put in Django views
 
Well, you started with "in the template I want to show..." and now we're on the back end. I'm not sure you're being clear on what you want
I need a break for a bit. rbrb
 
My ultimate goal is I want to get all parent categories(i.e. categoryId with parentId as NULL) and associated sub categories(i.e. categoryId with parentId as NOT NULL) in one shot.
show I can iterate through it easily
It would be easy only when I get the data like this:
{
    {"parent":"parentId",
     "child":[c1,c2,...]
    },

    ......so on
}
 
5:05 PM
is that the exact same block you've posted twice already?
 
yes
 
if you're on desktop there's a context menu you can access to the left of every message, I suggest just posting a permalink to your earlier message rather than reposting the same 8 lines several times
(on mobile there's a link icon on message selection)
 
Ok fine I will take care of all such things. This time please help me with good answer
 
yes, clearly the only reason I'm not helping you with a good answer is that I'm unkind :P
 
bees!
 
5:30 PM
@chiragsoni Do you want "single DB query and perhaps a for loop in python"? Or do you mean "single DB query that gives all data as per your format directly from DB"?
Getting all your data in a single DB query is good, but you shouldn't shy (unless you've already exhausted many other optimizations & this one might save your precious 0.1 second) from some data formatting after fetching database query result.
 
is there an way for me to get all the messages I have send in this group?
 
not via the web interface I think
you can search your messages though chat.stackoverflow.com/search?room=6&user=8591431
it's far from perfect but it's what we've got
 
okay, thanks! yes I need a search term to search for a specific word in my previous messages, or I could keep jumping to my last message, but that will be too much
 
if it was recent-ish you can use your recent tab and manually add &page=2 etc to the URL for pagination
 
5:37 PM
@AndrasDeak aah that's what I wanted, thanks a lot :)
the pagination worked perfectly, but I assume I cannot use the permalink to jump to the point in transcript where the message was posted?
 
@chiragsoni You can use the select_related optimization provided by Django's ORM to make sure you get your parent + child data in a single DB query (do note that you might not be able to do it if your database is sufficiently large)
 
@DeveshKumarSingh sure you can
that's what permalinks are for
 
okay, I will give it a shot, and also I don't think there is an API exposed to the webserver where sopython is hosted so that I can run GET queries?
 
Sopython, probably not
 
5:44 PM
I'm confused
Most routes respond to GET requests
 
"GET queries" sounds like he wants an API, so even if routes respond to "GET requests" it doesn't satisfy the requirement
every website essentially responds to GET requests, but doesn't mean they serve you an API from which you can extract data
 
@DeveshKumarSingh What do you want with sopython?
 
@shad0w_wa1k3r yes, I was asking about GET requests, ones which you can fetch via say a requests.get
 
Well sure, it doesn't have an API, but I don't understand where this convo came from in the first place :P
import requests

data = requests.get('https://sopython.com/')
print(data.text)
 
@DeveshKumarSingh I'd simply call it a website page fetch, not a GET request in this context. Essentially ^
 
5:48 PM
Are you a wizard
 
Works fine. Probably not what you're looking for, but you've not been particularly clear
 
@roganjosh essentially I was looking for a programmatic way to say, search for a particular text in all my messages, essentially what the search bar replicates
 
@AndrasDeak Yes. Yes, I am. You've got me :/
 
@shad0w_wa1k3r In single query only I want to get all the data from the db. But as per my knowledge to get such data for loop will come into the picture, but again I am not 100% sure, so if the loop comes into the picture then iterations should happen on db side ony.
 
@DeveshKumarSingh that has nothing to do with sopython
 
if i understand correctly, SOpython is made via flask, and it must be persisting information in a db, and some searches here might be querying that database, I was wondering if there is a programmatic way to perform those searches, so I thought if there an endpoint exposed, I can hit that endpoint and get those data points
sorry I was not more clear before
 
No, to my knowledge there is no endpoint
 
@DeveshKumarSingh sopython doesn't have your messages
 
The db holding the chat messages is controlled by SO I would think
 
okay, so sopython is just hosting the chat interface?
 
5:54 PM
It's all here anyway. I mean, are you saying that the chat UI isn't facilitating your search?? </sarcsm>
 
Note the subtle difference between sopython.com and chat.stackoverflow.com
 
@DeveshKumarSingh Seems like you've mistaken chatroom & SOPython Site as related, hosting-wise. SOPython is a separate website which does not have any data from chat.SO/rooms/6
 
Might be time you looked at sopython.com
 
@AndrasDeak had to take a second look :P
 
aah okay, sopython.com/chatroom redirects to chat.stackoverflow.com, otherwise sopython.com hosts content which comes out of the chatroom
like riddles and wiki pages
 
5:56 PM
yes, it's basically for whatever chat.SO doesn't provide the room users with
 
@DeveshKumarSingh it doesn't redirect
 
@shad0w_wa1k3r What I am thinking is that if everything will happen on db side, it will be good from the performace point of view
 
okay, and here I assumed sopython hosted it's own chat interface which SO users used
@AndrasDeak yes it doesn't, the page has a link to this chatroom
 
Indeed
Like some other links on the internet
 
guess I should have paid more heed to the link above
 
5:58 PM
But the question then becomes what is the SO api like for accessing chat message from its various chat rooms, or does that even exist
 
@Dodge yes, unofficially documented
 
@chiragsoni wiki.c2.com/?PrematureOptimization Please don't worry about premature optimizations. If you have legit concerns on performance that can be backed by actual live data, then sure, go ahead, but only after assessing where & what you should optimize.
 
well there is this ?
 
ohh okay, that seems closer to what i was asking in the first place
 
6:01 PM
That is cool, I thought it might be interesting to create some charts showing room traffic frequencies, topic trends. Now I see where to get the data for something like that.
I'm convinced that some people never sleep. I could try to prove that If I was bored enough ;)
 
perhaps do some sentiment analysis on chats here :)
 
@shad0w_wa1k3r So as per your understanding I can go ahead with this code:chat.stackoverflow.com/transcript/message/46449528#46449528
Right?
 
Does anyone have experience with git?
 
@chiragsoni No, you need to use a select_related as I mentioned here - chat.stackoverflow.com/transcript/message/46449680#46449680
 
The easiest trend I think would be to show the rise and fall of drive by chatroom questions as the high school and college semesters begin and end
 
6:05 PM
@chiragsoni Django provides with a nice shell interface where you can try things out
@notatroll yes, but please ask your questions directly
 
Also make it python-related
 
@shad0w_wa1k3r thanks but generally to load python interpreter we just type python then it launches it provided that python is installed in your machine. So whatever you are pointing is the same interpreter or something else
 
@notatroll You've already asked the php room, they can help you
 
@shad0w_wa1k3r And to work with django models I usually do py manage.py shell in the project directory
 
yes, that's the same thing I was talking about.
 
6:13 PM
@shad0w_wa1k3r ok
 
6:23 PM
@shad0w_wa1k3r that was my question.
@AndrasDeak thanks
 
6:54 PM
spring (summer?) cleaning on my hard disk just freed up 45 GB in space ... guess I'll find out eventually if I've broken something
 
I'm constantly amazed at how powerful regex is
(was working with unicode tables and non-latin characters in python)
 
02:00 - 19:0019:00 - 23:00

« first day (3157 days earlier)      last day (1790 days later) »