Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract all times from all log files isn't working #13

Open
xf0e opened this issue Nov 29, 2014 · 5 comments
Open

extract all times from all log files isn't working #13

xf0e opened this issue Nov 29, 2014 · 5 comments

Comments

@xf0e
Copy link

xf0e commented Nov 29, 2014

Hello,

in file export_events.py on the line 54 the interpeter generates an exeption:

Traceback (most recent call last):
File "export_events.py", line 117, in
updateEvents()
File "export_events.py", line 54, in updateEvents
ts = [int(x[x.find('_')+1:x.find('.txt')]) for x in L]
ValueError: invalid literal for int() with base 10:

@xf0e
Copy link
Author

xf0e commented Nov 30, 2014

My log file names are:
keyfreq_.txt
keyfreqraw.txt
window_1417327200.txt
keyfreq_1417240800.txt
window_.txt
keyfreq_1417327200.txt
window_1417240800.txt

can the error come frome those files where the names have no timestapm in the names(like windows_.txt)?

I also tried to debug and after executing this code, but without of casting to int
the ts variable stores this values: "['1417240800', '', '', '1417240800']".

L = []
L.extend(glob.glob("logs/keyfreq__.txt"))
L.extend(glob.glob("logs/window__.txt"))
L.extend(glob.glob("logs/notes_*.txt"))

extract all times. all log files of form {type}_{stamp}.txt

ts = [x[x.find('_')+1:x.find('.txt')] for x in L]

@karpathy
Copy link
Owner

karpathy commented Dec 2, 2014

Hi,

strange that this is happening - you're right there should be timestamps following the underscore. Somehow the code is failing to get the timestamp, or compute it sometimes. I haven't seen this issue so far with anyone before so I'm not sure what this could be. Ideally you'd descend down into the code (the logging code is relatively simply) and try to do those calls in console to try to narrow down what's going on.

Sorry I don't have very useful comments about this.

@xf0e
Copy link
Author

xf0e commented Dec 7, 2014

I wasn't able to reproduce the problem again. I tried at least for 12 times to delete the whole statistic, but ulogme was every time able to create files with correct time stamps. don't know why it was not working for the very first time.

@sld
Copy link

sld commented Feb 2, 2015

I did have the same error in OS X.
First time I run ./ulogme.sh by using python 3.3.
Then keyfreq_.txt become in logs/.
Then I got the same error described by @xf0e.

Deleting files in logs/ and rerun ./ulogme.sh by using python 2.7.8 fixed the problem.

@dannygoldstein
Copy link

Had a weird experience where keyfreq_.txt kept reappearing in logs/ every couple seconds, causing updateEvents() to fail with

ts = [int(x[x.find('_')+1:x.find('.txt')]) for x in L]
ValueError: invalid literal for int() with base 10:

even though ps -fA | grep ulogme showed no active ./ulogme.sh processes. Turned out there was a zombie bash ulogme.sh from hours before that was putting them there. If anyone keeps running into the invalid literal error, try doing a ps -fA | grep bash and killing old bash processes that may be running ulogme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants