« first day (1845 days earlier)      last day (1726 days later) » 

12:00 AM
RELOAD!
[Phrancis/TwitterTools] 10 commits. 134 additions. 44 deletions.
[rubberduck-vba/Rubberduck] 4 opened issues. 1 closed issue. 12 issue comments.
[Minesweeper] Games Played: 69, Bombs Used: 45, Moves Performed: 9123, New Users: 9
 
@Phrancis Did she know she could do that?
 
@Marc-Andre Evidently not
 
12:48 AM
I was hoping to spend more time working with the API and less time dicking around with filepaths. Damn slashes man.
 
1:01 AM
So when I run get_twitter_api() within itself, it works with no problem at all. But when I import it and run it from the other file I get a FileNotFoundError ...
 
1:20 AM
@Phrancis Sound like you need to dick around some more. Off you go :waves: :p
 
@IvenBach I'm dicking around, but I was hoping maybe I was missing something obvious that someone else would notice
 
1:51 AM
YES
6
A: Using Python's os.path, how do I go up one directory?

pythonHelpRequiredI think the easiest thing to do is just to reuse dirname() So you can call os.path.dirname(os.path.dirname( __file__ )) if you file is at /Users/hobbes3/Sites/mysite/templates/method.py This will return "/Users/hobbes3/Sites/mysite"

This technique worked, although it looks wonky as hell
 
Various fixes to un-fuck handling of file paths when importing modules within each other

The use of manually building file paths was causing various FileNotFoundError problems. I decided to instead use the os.path module to let the paths build themselves using the location of __file__
[Phrancis/TwitterTools] Phrancis pushed commit 068c848d to master: Clean up debug stuff
 
TTQW!
 
2:29 AM
So with this crap out of the way, I can finally starting poking the API a bit more
 
With enough dicking around you got rid of the crap? Well done.
 
@IvenBach I learned to not fight the machine, let it fight itself instead
 
I think 'ol George Carlin would agree with you there.
I'm trying to tidy up my open PR and maybe sneak in I want for work in my last week before classes.
 
@Phrancis at least it's working.
 
2:45 AM
So, now I need to think about & juggle 2 things. Input appreciated. Here's a bit of code for context:
_input_file_name = f'user_followers_ids {screen_name} {datetime.date.today()}.json'
_followers_ids = []
for user_id in tweepy.Cursor(_api.followers_ids, screen_name=screen_name).items():
    _followers_ids.append(user_id)
print(len(_followers_ids))
print(_followers_ids)
That of course doesn't do anything beyond printing to console after querying the API
The two things are:
1. I need to open the JSON file for writing the IDs to it
2. I need to not keep the file open needlessly while waiting for the API throttling to replenish
So I need to introduce a try/except to watch for rate limit errors, I just can't really think what order the instructions should go
So I need to keep the cursor going (I think) so I don't lose where it last stopped (assuming there are more than 5000 followers to go through on the account)
 
ohh misread
 
If I call .page() instead of .items() on the cursor, it gives me a full page of IDs as a list, instead of each ID one at a time. I suppose once I have a page, I could open the file, then iterate each item in the list and write it, then close the file...
And try/catch as I attempt to get another page, if I get a rate limit error, just sleep the cursor for a while...
Does that make sense?
Actually why do I even need a JSON file. A newline separated TXT file will do perfectly fine for storing this, since it's all just a single ID number per user.
 
@Phrancis seems reasonable.
 
3:01 AM
Time for a short walk. Brain is running 10,000 mph and I could use some fresh air :)
 
3:37 AM
Whew, blood flowing! Got a nice Bloody Mary mix, be ready to code some more shortly!
64
A: Avoid Twitter API limitation with Tweepy

Dan NguyenFor anyone who stumbles upon this on Google, tweepy 3.2+ has additional parameters for the tweepy.api class, in particular: wait_on_rate_limit – Whether or not to automatically wait for rate limits to replenish wait_on_rate_limit_notify – Whether or not to print a notification when Tweepy is wa...

Oh look the rate limit wait is built in to tweepy. Guess that makes the whole try/catch moot
Just need to set my computer not to go to sleep if I'm going to run a long query so it doesn't drop the connection
 
4:10 AM
_output_file_name = f'user_followers_ids {screen_name} {datetime.date.today()}.txt'
_output_file_path = os.path.join(PATH_TO_APP_DATA, _output_file_name)
for page in tweepy.Cursor(_api.followers_ids, screen_name=screen_name).pages():
    _output_file: TextIO
    with open(_output_file_path, 'w') as _output_file:
        for item in page:
            _output_file.write(f'{item}\n')
# For testing
with open(_output_file_path, 'r') as _output_file:
    num_lines: int = 0
    for line in _output_file.read().splitlines():
Super easy
 
Nice. You're really coming along
 
I think I'll make these micro-applications console-based so they can easily be ran by themselves
 
Add functionality to query all of an account's followers' user IDs and save them locally

Note that is has not been tested for an account with large (tens of thousands or more) amount of followers, and will need to be tested or may take a long time, depending on the use case.
[Phrancis/TwitterTools] Phrancis pushed commit fd34c50b to master: Rename function to be consistent with tweepy
 
Results saved to file: C:\Scripts\Python\TwitterTools\app_data\user_followers_ids FrancisVeeGee 2019-08-21.txt
Follower IDs saved: 167

Process finished with exit code 0
Results good, guess it wouldn't hurt to test a few other accounts
 
4:32 AM
[Phrancis/TwitterTools] Phrancis pushed commit e4e216b2 to master: Move console output logic to main, made function return output file path
 
4:50 AM
[Phrancis/TwitterTools] Phrancis pushed commit 590bf5d1 to master: Add console interface and some error handling in case of invalud screen name input by user
[Phrancis/TwitterTools] Phrancis pushed commit 8c925807 to master: Fixed order of operations where subsequent pages would overwrite previous pages, due to re-opening the file for writing
 
@Duga Glad I tested with a larger account. That would've been annoying to find later, likely.
Now testing with a 100K+ account, will take a while, good time for a pause and a smoke
 
5:15 AM
This is funny especially because Java
Progressing well. Got ~85K IDs out of total in ~15-20 mins
 
5:34 AM
 
@Phrancis don't stay up too late dicking around :p. Make sure you get some sleep to be able to think straight tomorrow.
Well done on getting some coding in btw.
 
@IvenBach TY :)
@IvenBach Yeah, did that last night, today's been a caffeine roller coaster. I think I'll save the "hydrating user accounts" part for tomorrow, and just Netflix-chill for a little bit before bed.
Wu Assassins on there is quite good; not near as violent as the title suggests, though a little violent; cook-becomes-warrior-but-doesn't-want-to-kill; some martial arts, some detective stuff. Recommend it.
 
6:13 AM
Added some logging to guesstimate processing time

Also tested with a much larger account (100K+ followers) and found no problems as long as the connection from the user computer to the API remains open, which it should unless the computer goes to sleep or crashes.
 
6:47 AM
[Phrancis/TwitterTools] Phrancis pushed commit 66458719 to master: A few small, largely inconsequential changes
 
Okay, done for tonight. Cheers.
 
 
2 hours later…
9:14 AM
@Phrancis but, but, but... but GDPR!
I have started IntelliJ!
Now I just need to motivate myself to switch to that window and write some code...
 
9:40 AM
@SimonForsberg GDPR what? lol. These were just a bunch of employee names and phone extensions (not personal phones).
@SimonForsberg I think it starts like public static void main(string[] args)...
 
@Phrancis Oh, thanks!
 
10:31 AM
[Zomis/Fighting] Zomis pushed commit faeeb4d6 to v2: Added simple new version of Fights, with Kotlin
[Zomis/Fighting/v2] build 2 Build success.
[Zomis/Fighting] build for commit faeeb4d6 on v2: This commit looks good
 
10:46 AM
Currently running rounds with 5 AIs and 10 games in each pair-up. This might take a while...
AlphaBeta algorithm is slow...
using depths of 3, 4, 5 and 6
the fifth AI is using another approach
Hmm... no wonder it's slow... something's not right. One of the AIs keeps trying to make a move at the same position over and over again, which apparently isn't allowed.
Ah, the AI is not analyzing the same game as is actually being played...
 
11:18 AM
That's better... now games are actually being finished here...
AlphaBeta 3 and 4 is actually pretty fast. AlphaBeta 5 however is a lot slower.
 
[Zomis/Server2] Zomis pushed commit 6a6809aa to ttt3d: Add TTT3D Fighting
[Zomis/Server2/ttt3d] build 9 Build failed.
[Zomis/Server2] build for commit 6a6809aa on ttt3d: This commit cannot be built
BUILD FAILURE!
 
OMG a single match with the fast AI against AlphaBeta 6 is soooooooo slow
2nd game done
3rd game done
4th game done
5th game done
1 game in approx 2-3 minutes
The fast AI lost all 5 games against AlphaBeta 6
 
12:24 PM
Bah, after about a third of all games were completed, computer decided to just shut down :(
This has been happening every now and then, especially when I play Oxygen Not Included (which is why I only play that game on my laptop these days)
 
Hey good morning! Have a nice day!
 
12:43 PM
@Marc-Andre Morning!
My motivation to code disappeared a bit after computer crashed :(
 
@SimonForsberg Is it old? AMD have some good cpus at some good price right now
 
[Zomis/Server2] Zomis pushed commit 7d58122e to ttt3d: Fix AlphaBetaTest
[Zomis/Server2/ttt3d] build 10 Build success.
[Zomis/Server2] build for commit 7d58122e on ttt3d: This commit looks good
 
@Marc-Andre Almost five years.
 
Do you have some information about what is "breaking"?
 
1:08 PM
Monking
@Phrancis looking good!
@Phrancis I have to watch a show about a cook turned warrior
 
@bruglesco Moonring
 
@Marc-Andre Moonring
I haven't been coding since I went back to school. It kinda makes me sad.
Glad to see others doing it though.
 
I've not code in a while at home (and a bit at work too). Division 2 is too good.
I hate Destiny and Microsoft a bit. They should have made an FPS MMO in Halo .
I'm mad at Destiny cause it was suppose to be so good
 
1:26 PM
@Marc-Andre With the computer? No, not really. Suddenly it just shuts down within a second. I have considered overheating of the CPU, but I am not sure it is this.
 
@SimonForsberg Windows machine? Maybe check the event logs to see critical ones at around the time it shuts down ?
 
Controls are a little hard to figure out.
3
 
@Marc-Andre Yup, Windows. What event logs?
Oh great, on Twitter someone figured out how to access all the SSN's of all students and all teachers in Stockholm school system.
... and the teacher's opinion of the students performances
 
1:45 PM
Hmm... I do see something about Kernel-Power.
> The computer has been restarted without having to shut down properly first. This error can occur if the system stops responding, if it crashes or if the power supply unexpectedly breaks down.
(google translated)
 
Yeah might be a Power supply issue
Is your sound correct? A lot of power issue can be heard
in the sound system of the computer
 
@Marc-Andre besides one of the fans always making noise, nothing out of the ordinary
 
Not the sound that your computer is making, the sound from your computer.
 
@Marc-Andre You mean the sound, like if I listen to some music on the computer? I hear nothing out of the ordinary there.
 
@SimonForsberg Yeah sorry, that's what I meant.
 
2:47 PM
@SimonForsberg “this student would be better off working as a janitor” said one teachers review. When asked for comment we received no reply. Back to you in the news room FooBar.
@bruglesco for your burst pipe sheldoncomics.com/archive/090203.html
 
3:40 PM
@IvenBach I'm a 2, because the first time I had a pipe burst I wanted to be 3, but I did't have $80. Now I know.
 
4:03 PM
@Feeds My complaint is I started on Hard mode. IE Poor and Ugly. Got lucky with a moderate level of smarts.
 
4:14 PM
hey
 
5:05 PM
@SimonForsberg That... would be a problem lol
Monking!
 
5:18 PM
@SimonForsberg Yikes. Data breach? How big?
 
5:53 PM
@Phrancis I would guess all the students and all teachers in Stockholm school system :P
 
6:18 PM
Twitter is on fire today. Think I'll stick to coding for a little while.
 
@Phrancis I'm sure Twitter is on fire everyday. Just maybe not on things you follow?
2
 
Just finished my math homework
yay logarithms
 
@Marc-Andre Most days it's not too bad. But today... oh boy.
 
7:23 PM
@Phrancis Yeah, as @Marc-Andre says, potentially all students and all teachers in Stockholm. At least that was what was exposed, how much data that has actually been accessed? Who knows.
 
7:45 PM
^ @bruglesco @Phrancis that is a handy filter!
 
 
2 hours later…
9:36 PM
@IvenBach omfg I must have blocked that out or something. That brings back memories.
 
10:34 PM
@IvenBach Hahaha I loved that show as a child
 
 
1 hour later…
11:48 PM
@bruglesco When my friend and I took Trig our teacher announced "Today we get to work with logs" at which point we both announced "It's better than bad it's good" which left everyone completely confused, including the professor.
 
Sounds right
 
Needless to say it was a very funny moment. Thankfully for us we were too ignorant then to realize how dumb it was.
 
I just wish I had done well in school all so many years ago.
I'm really regretting not getting a high school diploma
 
That makes things harder.
If you need help or encouragement I'm here.
 
@IvenBach I already knew that
thanks
 

« first day (1845 days earlier)      last day (1726 days later) »