[05:40] ahoy za! [05:40] Hey Cryterion , so early? :) [05:41] Morning, yeah, at work already, grrr [05:41] Morning pavlushka [05:42] Maaz: is coffee on [05:42] Cryterion: Sorry... [05:43] Maaz: Coffee please [05:43] Cryterion: There isn't a pot on [05:54] Morning Naeil :) [05:54] lol @ Cryterion's situ :p [05:54] Maaz coffee on [05:54] * Maaz puts the kettle on [05:55] Maaz coffee please [05:55] Kilos: Righto [05:55] So the problem is with is? [05:55] Maaz large [05:55] In a beer mug just for you Kilos [05:55] Maaz large [05:55] In a beer mug just for you pavlushka [05:55] I always get it wrong [05:55] morning pavlushka Cryterion and other early birds [05:55] Morning Kilo's [05:55] Maaz you told it to Kilos already, not gonna fall for that :p [05:55] pavlushka: *blink* [05:56] Maaz: I already got my own coffee :) [05:56] Cryterion: Huh? [05:56] Heya Kilos [05:56] lol [05:58] Coffee's ready for pavlushka and Kilos! [05:58] Maaz: ty [05:58] You are welcome pavlushka [05:59] Maaz gracias amigo [05:59] ¡de nada compadre [05:59] oh my you early superfly [06:00] hi thatgraemeguy [06:00] Kilos: I'm not here anymore... [06:00] morning :) [06:00] we're going away for the week, I'll chat over the weekend, just needed to check some stuff on the PC [06:01] hi thatgraemeguy, pavlushka, Cryterion, et al [06:01] go safe and enjoy [07:43] Hello superfly :), was away with some issue [07:49] the fly has gone away for a week pavlushka [07:50] Kilos: np, he can check back the logs if he wishes :) [07:50] 16.04 makes ugly emoticons [07:54] but it works well otherwise [07:54] might even do a clean install on my ssd [07:55] the 14.04 to 16.04 upgrade on this drive gave lots of probs [07:55] hi drussell hows davy? [07:56] Kilos: what kind of problems? [07:57] And hey :) [07:59] i cant remember but was annoying enough to do a clean install and just rsync old home [08:00] hows paddatrapper today [08:00] is your hair still blue [08:20] Kilos: tips are blond. All blue has faded out. [08:20] hahaha [08:21] so weird, not even lunch time there and 7.20pm here [08:22] I'm sitting in a lecture theatre for the my supposed third lecture of the day... I have had about 20 minutes of teaching out of 2.5 hours... [08:22] ouch [09:12] good mornings [09:23] Morning inetpro and Kilos [09:23] Morning inetpro and Kilos and paddatrapper [09:24] http://www.minetest.net/ server on my laptop at the moment karrimor.duckdns.org:30000 [09:24] in case anyone wants to play [09:32] hey andrewlsd [10:48] hi andrewlsd [13:34] Good afternoon everyone. [13:34] Any news on Kilos? [14:10] Hi gremble, I'm not sure what you heard last. He's at home with his lady and his daughter, but he's not allowed to do anything major. [14:11] Ah okay. That is good news [14:11] Also, the hospital has given them another two weeks to pay [14:36] I hope they are able to manager [14:36] manage* [16:04] Greets [16:09] Hey dl [16:10] dlPhreak too [16:14] paddatrapper: howdy [18:01] good evening [18:29] good evening! [18:34] hey pavlushka [18:34] Hey kulelu88 :) [18:34] ping theblazehen :) [18:35] how is it going kulelu88 ? [18:35] lekker man howzit? [19:03] does pavlushka know what lekker means even :-) [19:03] oh I assumed he is a local fellow [19:04] inetpro: lekker means good I think, but was working on a little :) [19:04] on something, so was busy, kulelu88 fine here :) [19:05] you speak french? pavlushka [19:06] kulelu88: may be someday :p [19:07] aah your name 'seems' French pavlushka [19:08] kulelu88: really? after this long? when everyone stopped saying that its of Slavic? [19:08] forgive my ignorance concerning European names :P [19:09] kulelu88: so it seems to you as french, though is more or exactly Russian :) [19:10] Vladimir seems more Russian :P [19:12] lol [19:13] pavlushka: you a software engineer for ubuntu? [19:14] kulelu88: I wish :) [19:14] We need a wiki of "who is who" [19:28] kulelu88: he's from Bangladesh if I remember correctly [19:33] Who is you? [19:33] Also, hello [19:33] I think there is one on the ubuntu-za wiki page, kulelu88 [19:34] ow gremble my man :P #feesmustfallonlybeforefinalexams :D [19:34] o/ [19:36] * superfly has enough Internets in Struisbaai to get online for a bit [19:36] Just read a letter from Habib that said if there are more disruptions, Wits will close for the rest of the year. [19:38] looks like Habib and co. are holding a gun to the students heads now. The hard workers don't want to repeat the year next year [19:42] yo superfly howzit? [19:42] o/ superfly [19:42] kulelu88: not too bad, and yourself? [19:43] good good [19:43] hi pavlushka, shouldn't you be asleep already? [19:43] superfly: I forgot, thanks for reminding :) [19:44] * pavlushka that's the reason he sleeps in the chair [19:45] not good for your back, pavlushka [19:46] point ^ [19:46] superfly: thanks, at least some one cares about my back :) [19:47] pavlushka: I'm a dad, it's built into me [19:47] * pavlushka now leaning back [19:48] kulelu88: problem is the protesters don't care... [19:48] hehe, built-in Dad's functions :) [19:48] from superfly import Dad [19:49] lol [19:49] dad = Dad.care(level=9) :P [19:49] paddatrapper: I've actually been idling wondering how many of the protesters are actually students, and also what faculties they're from or what they are studying [19:51] superfly: some aren't, the leaders are UCT students. As far as I know Masixole (the main leader) is a masters student [19:51] ah, so he's not really beholden to the same timelines as the undergrads [19:51] I guess they're humanities students... With some others thrown into the mix [19:51] Yup... [19:52] I was about to jokingly say it must be humanities students [19:54] * inetpro falling asleep [19:55] inetpro: go to bed, old man [19:56] I'm just glad I've been working on skills that make me employable if it comes to the universities closing :x [19:57] if I have a global variable in my code, called "bot", how do I call that variable to my function via a Flask router? [19:57] why do you have a global variable? [19:57] ^ [19:57] gremble: the closing of the varsities is highly unlikely [19:58] superfly: just testing the concept. I will adjust later [19:58] this dude in the telegram channel gives bad coding advice :/ [19:58] kulelu88: which Telegram channel? [19:58] kulelu88, unlikely it might be, it is still a terrifying prospect to me. [19:58] superfly: on telegram itself. for this lib: https://github.com/python-telegram-bot/ [19:59] superfly: heh! [20:01] superfly: this is the function: https://www.zerobin.net/?99b16b6bb11140e2#yxO5eeMR744x9ZTC6wrXqMf0KZpX2S5VP8EAxO2GnM0= . I have removed update. Now I have added a global 'bot' variable. how do I call/use it via a web/curl request? [20:02] ohi ludo! [20:02] kulelu88: yeah, you've got it all wrong [20:03] kulelu88: what he has written there is a framework for writing a bot that listens and responds to messages. [20:03] kulelu88: Flask is a web framework [20:04] now you're trying to mash the two together, and you're not sure why it doesn't work [20:04] I am just using Flask for API requests to the bot [20:04] "API requests"? [20:06] superfly: I want my server to respond to GET, POST requests, that then pass that on to the bot to perform actions [20:07] like send a message to someone? [20:08] superfly: yeah, that is exactly my goal [20:09] hrm, this is interesting. because you've already got an event loop running for the telegram bot, and now you're trying to add an event loop for your HTTP server [20:11] superfly: 1 suggestion was to split the REST-server and bot and use the pub-sub of Redis (but that is over-engineering for now) [20:13] kulelu88: you need to forget the extensions part of the Telegram Bot module, and use the plain old API from within Flask [20:14] superfly: it does support the regular API stuff too. I could avoid telegram.ext and just use import telegram only [20:15] right, 'cept your example is totally wrong (which is why you're asking) [20:15] kulelu88: that "bot" needs to be created somewhere [20:15] kulelu88: but there's an easy way around this, and we can hook into Python's module loading system for it too [20:16] superfly: just before the function, I made the bot here: bot = telegram.Bot(os.environ["API_TOKEN"]) [20:16] so 'bot' exists [20:16] right, and drop the "bot" from the arguments [20:17] oh wow, it worked now :D [20:17] darn, web programming is tough :P [20:17] kulelu88: you also have no chat_id [20:17] and "update" shouldn't be there either [20:17] it's also stored as a global variable [20:18] this lib looks more suited to my needs: https://github.com/datamachine/twx.botapi [20:18] no, the Telegram Bot is fine, it's just engineered to be a Telegram bot and ONLY a Telegram bot [20:19] if you use the extensions [20:19] if you just use the plain old API, then you're fine [20:19] superfly: so if I don't include a variable in a function but call a variable that is defined globally, it will fetch the global value of that variable? [20:20] you don't "call" a variable, you just use it [20:20] (noob question from hindsight) [20:20] and global means that it is visible everywhere [20:20] superfly: and why are global variables dangerous to use? [20:20] because they are visible everywhere [20:21] and one part of the code can change the value without another part being aware of it [20:22] noted! alright, no more coding questions :P [20:22] and when you do that with languages like C, where string buffers need to be allocated dynamically, then you get one piece of code reading more memory than it is supposed to [20:31] kulelu88: https://bin.snyman.info/mmmbgq28 [20:32] kulelu88: ^^ untested, but I'm sure you can make it work [20:33] superfly: so based on your code, I should not try to mesh the 2 together and instead integrate the telegram functions into my Flask REST service? [20:33] yes [20:33] I like that solution :thumbsup: [20:46] kulelu88: getting somewhere? [20:48] yep, your code is always more legible. I swear you should write a book for imperative web programming! :D [20:53] kulelu88: open a Python prompt, and type "import this" -- I don't need to write a book [20:55] (I'd love to write a book, and self-publish, and become $$$ RICH!!!, but I really don't know what to write about, or how to get people to like my book) [20:57] kulelu88: I also think that knowing the tools and knowing what you are trying to do helps me to bridge the gap and show you how to achieve it [20:57] that largely doesn't work in book format, though [21:00] superfly: regular books are terrible, but tutorial-style (eg. let me hold your hand) books sell quite reasonably. Eg. http://nickjanetakis.blogspot.com/ [21:05] interesting [21:07] but I think gremble has done it already. It's quite a bit of work [21:08] You won't become rich from the book itself. But writing a book is a very good way on expanding your knowledge. [21:09] I would advise against self-publishing though. A good editor is worth more than gold in terms of getting a good quality book out. [21:11] gremble: (off-topic) what happens to second semester tests? will the schedule be pushed into December? [21:12] kulelu88, currently the exams have been extended into December. [21:12] I think the last one is written the 6th [21:12] That means supps will be pushed into Jan probably [21:12] With summer school probably touching the start of the first semester [21:13] luckily they have such giant gaps between semesters [21:22] gremble: you don't need to use a publisher to get a good editor [21:23] and from all the mistakes I've seen, there aren't many good editors out there either [21:23] superfly, you don't. But a publisher will be your best bet on getting a good one. They don't really sit around :P [21:24] gremble: I've talked to people who have done both, and they say that you can find good editors without needing a publisher [21:24] I agree with that [21:26] heh. my brother had a fight with his English teacher in Std 6, over the spelling of the word "fulfill" - she maintained it was "fullfill" and he said it was the former. they looked it up, and he was right. [21:27] I've had lots of fights with math teachers xD [21:27] Or it could've been the same one each time, I don't know :P [21:28] my maths is terrible, my English is pretty decent [21:28] (decent enough that I'd get maybe 2 or 2 spelling errors in an entire hand-written essay) [21:28] ugh [21:29] 2 or 3 [21:29] keyboards are totally different :-P [21:31] These days spelling is not as important as grammar and proper word choice. Some of the stuff that I've edited are the reason I'm getting grey hairs at 25 [21:32] is or are? [21:33] Where? [21:33] "Some of the stuff that I've edited are the reason I'm getting grey hairs at 25" ? [21:33] In the second sentence it can be either, since stuff can be singular or plural. In this case it is plural [21:33] Because I have edited more than one thing [21:33] :P [21:34] 1 stuff? isn't stuff plural? (not criticizing, I honestly forgot the rule here) [21:36] Hmm, yes. You are right. You wouldn't use stuff as a singular. But, "The stuff is gone." vs "the stuff are gone" [21:37] So, you can use it as a grouping, where it would act as a singular. [21:37] Language is so much fun :D [21:42] the stuff is gone sounds more 'correct', but I'm not sure [21:43] because "stuff" is a collective noun [21:43] Stuff is gone, is the correct one because you are referring to a singular despite it being more than one thing. [21:44] what superfly said :P [21:44] good night everyone, sleepy time for me [21:45] Sleep well superfly