« first day (2258 days earlier)      last day (2915 days later) » 

13:00
great:)
you can go read about fancy indexing if you haven't done so already, although I usually find it very confusing and I end up testing each specific application when I have to...
yeah, just dont let c++ people see that, they are going to read infinitly long, without ever coming to an end
they should brace themselves for that
oh crap, i think i heavily underestimated my algorithm. though i could tweak it to realtime. it now works for 3 minutes and... Memory Error:( damn
that's vectorization for you
moar memory, less runtime
if all else fails, use loops
(but if you have more complicated stuff, you might be able to improve it within numpy first)
Memory Error, doesnt that mean out of memory?
13:06
it does
but memory error can be due to matrix-multiplying a 10k-element column vector with a 10k-element row vector, producing a 10kx10k matrix, when you don't necessarily have to
Is there a way to read handwritten text from an image ?
@vinita yes
then i have a problem, beacuse it takes too long, and allready uses too much memory. cant trade one for another because everything is messed up
@vinita OCR (optical character recognition), it has vast literature
@MarioDekena well, "answer after a long while" still beats "no answer whatsoever", right?
first have working code, then you can profile and improve it
IIm using tika python, but not able to read the handwritten text
13:08
@vinita state of the art algorithms use neural net's to do that. its a classical classification problem. See the MNIST handwriting recognition example
@AndrasDeak yes thats right
@vinita I guess you need to try harder or use something else? ¯\_(ツ)_/¯
isnt tika for pdf?
Yeah I have some scanned pdfs
or can it actually perform ocr, that would be quiete a powerful tool then
Tika works only for non scanned pdfs
MNIST is like dealing with one digit at a time
13:10
so use something that actually does OCR?
extracting encoded text from a pdf is not OCR; it's parsing
My challenge is identifying a box in scanned image and then reading out handwritten words in those boxes
hint: the O in OCR is "optical" character recognition
HANDWRITTEN? oh gosh
@MarioDekena Did i fudge up somewhere ?
so even state of the art neural nets, which is current research topic and far from user applications cant do that reliably
13:12
good PhD topic, probably
actually its for a degree in computer science
in we occasionally get questions like "How can I segment those grey speckles in the lower part of the liver from all angles", to which we like to reply "I know a friend whose PhD topic is this, good luck"
thats not going to help
see first paragraph: 'on-line'
@vinita there are two types of handwriting recognition. on-line is, if the user writes to a tablet of some kind. that way you have samples ordered by the time they where written. Or offline which you have in your case. the text was allready written, so you only have pixels without knowing in which order they where produced.
Hmm
13:18
Offline is way harder. in fact, as i said earlier, there is no commercial approach to do this reliably
So theres no such thing as offline
What if the documents are of same format
what you mean by format?
I.e. there are 5 boxes and whatever is written inside them , only that we need to convert
The first step would be segmenting your image for boxes with text in them; then you need to do OCR for each box.
well detected the boxes is not going to be the problem. but that doesnt help recognize the handwritten text
13:19
So I have 100 such documents, with 5 boxes in exact same position wrt paper dimension
There's no way around it.
@vinita and people tend to disregard boxes, and scanning tends to be misaligned
Yeah recognizing boxes is easy
is there something specific written inside those boxes? like single words out of a limited set of possible words? if so you could train a neural net to do so
the documents that I have (all of them) are all aligned.
anyway, the difficult part is OCR
13:21
Yeah these are medical related documents
Did doctors write in those boxes? If so, give up now.
So the will be using terms from medical fields. Like diseases
Not the doctor
i think you heavily underestimate how difficult this actually is. dont do that. for whatever reason you need such a software, just dont try to do it. because i assure you, you wont succeed. not in the next few month at least. if you are very smart, you might get some limited result after that time thoug. its not entirely impossible.
Ohhk
@MarioDekena Ive got another set of documents. These are "non handwritten"/typed, but have been scanned into images. Thus a little bit of noise due to scanning is there. Now is it possible to read text out of such an image.
or even this aint possible
with high chance
13:27
What do you call reading such a file ?
there's bound to be some mistakes, it should generally work, given proper quality and tools
Im sorry for ignorance
@vinita OCR?
as I've said half a dozen times since we've started talking?
Do you knoe of any library in python which can handle this
or just "text recognition" or something
13:27
@vinita its still not easy, but there are algorithms that do this quite reliable. its going to be hard to write such an algorithm by yourself, but you might find ready to use libraries for that.
@vinita google has a library for ocr named 'tesseract'. looks like there are python wrappers for it availble: pypi.python.org/pypi/pytesseract
Seems like i am stuck at fancy indexing again.
color = np.random.randint(0,256,(3,))
colorSpace = np.full((256,256,256),np.nan)
colorSpace[color] = 1
seems logical. at least to me ;)
@MoinuddinQuadri cbg
@MarioDekena the first one is a bit redundant, randint(0,256,3) is the same:)
let me see
@AndrasDeak I think you are 24*7 available here :P
@MoinuddinQuadri nah, I sleep 3-4 hours each day;)
13:42
@AndrasDeak same ;) days are too short otherwise.
you understand what i am trying to do with colorSpace[color] = 1 ?
@MarioDekena color is an array/list, so it's fancy indexing: colorspace[color] is colorspace[color[0]],colorspace[color[1]],colorspace[color[2]], so 3 matrices concatenated. What you need is basic indexing, with a tuple: colorspace[color[0],color[1],color[2]] which is the same as colorspace[tuple(color)]
if I understood correctly;)
yes you did
@MarioDekena here's a recent answer of mine explaining why tuples are there really
13:47
@AndrasDeak can i mix fancy and non fancy indexing? I have an array of those colors and want to use them to get a value for each out of my colorSpace.
you'll need to try and play around:)
yeah seems like thats the way to go ;)
i just have the problem, that i have assumed so many things in this algorithm that i have written all day without running it once. and now half of it could very well do something entirely different then i thought its doing :D :D
@MartijnPieters "fiucks*tan"
morning everyone
13:51
any clue if there's a canon question for stackoverflow.com/q/41264140/344286 ?
@AndrasDeak the video should load right there under the ingress
@AnttiHaapala I enabled half a dozen domains before I got tired of it
ah :D
disable on that site :P
right:P
If you get a virus, then half the finns got that too
13:52
small comfort
Today I used a global variable and I only feel a little bad about it
mildly shuns Kevin
#helper function for re.match so I don't have to go to the trouble of assigning the result to a name every time, which can be a real drag especially when elbow-deep in an elif-block
last_match = None
def match(*args, **kargs):
    global last_match
    last_match = re.match(*args, **kargs)
    return last_match
put...put a class around it
@AndrasDeak ah I downloaded it, let me throw it somewhere
13:55
oh, nice, thank you
ehhhhhh... OK
@AndrasDeak ah you can reload for longer :P
that was just 1 mpeg segment :D
@AndrasDeak the same link, now longer :D
with what happened before :D
or did you get the link :D
I got the link, watched it
it was more than enough:P
14:03
I mean I put a longer video with what happened before (= nothing)
victim just spits on the ground in front of another n :d
he couldn't have done anything that merits that
@AndrasDeak sysrq R just returns keyboard control directly to the kernel, in case X is having problems. I've never heard of the arrow key thing
Haha. Actually, drawing in the terminal would be nice, even if at a low resolution...
My usual workflow outputs images to pngs or gifs that I have to open myself manually. Would be nice to have a single window for execution and viewing
Would be nice to have a single window for execution and viewing
That's dark.
14:11
@KevinMGranger makes my firefox alt+left "previous page" hotkey very funky:P
@Kevin urxvt + tmux + vim + drawille => you never have to leave a single window!
I have a little helper app which displays an image file and checks for updates every half a second, but it's very much a duct tape & twine solution
Windows Picture Viewer is supposed to auto-update, I think... But after failing to do so 10% of the time, I abandoned it. I don't need an extra layer of buggy code that can make my program seem to produce output it wasn't supposed to.
A 90% success rate sounds good right up until you spend thirty minutes combing through your code trying to figure out why the change you just made didn't have any visible effect on the output
simple_image_viewer.py has the advantage of having a running "{} seconds since a change was detected" counter on the bottom, so I can be damn sure whether it's frozen or summat
14:25
@MartijnPieters so, it indeed is like "fiucking(sic)s*tan", and as such, I think it is perfectly OK normal and professional conduct from a Finnish coder :d
@AnttiHaapala I thought as much. So only the trolling remained, so I nuked the account.
and the v word actually means the English c**t word, but as an intensifier, also f*ing :D
I found it quite funny that it was the name that caused offense, and not the explictive-laden 'answer' turd they left.
I mean, it is offensive as hell, but Finnish programmers generally are :D
Just Here for the Hat: own any hat while the entire site collectively has at least 20 distinct hats
Why am I only getting participation trophies :(
14:29
@KevinMGranger my current hat is upvote via app 7 times
@KevinMGranger you need to close vote... oh.
Some day, I'll be a real stack-overflower!
You'll be flowing over stacks in no time
@KevinMGranger answer some questions then!
kill multiple birds with one stone and wreak havoc in SOD
14:38
Every python question is either closeable, numpy/pandas (don't know those), or answered within seconds by one of you :P
I can camp around some of the more obscure areas I have knowledge in (my highest-earning answers are semi-obscure git and systemd things) but those are more rare
@KevinMGranger so learn numpy!
numpy is useful
It's been useful for me exactly once lol
because you don't know it :D
half the AoC puzzles benefit from numpy, for example
I haven't done any of them yet. And the stuff I python for rarely needs... uh, math I guess
so what do you do usually then?
14:43
I just noticed that my "happy solstice" message fell off the star board, ironically just before today, the actual solstice.
@Kevin :D
let's pin it :d
christmas-shopping-panic cbg
Sure, I haven't abused my position in a while, so why not?
@AndrasDeak you've been kevinning eh?
I count 3 starred messages on the starboard.
My shopping is finished since Monday when I begged {relative} to pick up the last thing I needed from the mall since they were going to the mall anyway.
14:46
hello
I have four items to purchase. Four items that have yet to be defined.
question: Why can't a decorator take a generator as an argument
?
... Or at least I'm pretty sure they were going to the mall. If not, then the power of their love for me drove them to go to the mall just for my convenience, which I would feel slightly bad about so I choose not to believe that's what happened.
@ReutSharabani That's surprising to me. I was under the impression that a decorator could accept any object as an argument.
Can it? I may be wrong
@ReutSharabani because generators are for engineers, not for decorators.
14:48
python 2.X
this is a crisis! :P
I built software to rule the world and all I need now is to pass a generator to a decorator
>>> def decorator(obj):
...     return lambda x: x
...
>>> @decorator(i for i in range(10))
... def frob():
...     return 23
...
>>> print(frob())
23
thanks, so we're wrong, theres something else going on
Mind you, this decorator does absolutely nothing, but it proves that it's syntactically valid
I tried with mock.patch just to see if it compiles, and it doesn't
@Kevin yup, I get it
thanks :)
oh waitttt
I probably wouldn't pass a generator to a decorator anyway, since it gets consumed after you run through it once, which is probably bad for a function you intend to call an indefinite number of times
14:50
But you could pass the generator name
if your decorator was that kind of a decorator
pycharm says: "unresolved reference" to your code kevin
specifically i
I'll check in the interpreter
kevin, any chance you're using pycharm? can you verify this is pycharm-specific? I didn't get the error in interpreter
Can't help you there, I don't even have Pycharm installed
@ReutSharabani But it runs in IntelliJ/PyCharm even with the "unresolved reference"
I'm rewriting this big thing and when I did an mcve I didn't actually run it, just saw the error and took it as true
I was lazy I admit
Understandable.
16 Jun 2014
ugh.....it's like it's their mandate to not fix bugs
I believe wim had a small rant about their disinclination to fix bugs yesterday, so you're not alone in your frustration
apparently 2017.1 will be the fix version
@Kevin Yeah. I'm half expecting wim to maybe read this little bit and re-rant with me :)
can I give bounty for hat help? :)
chat*
Unfortunately not. In room 6 we take cat donations.
this will suffice. Thank you for generosity.
Your only recourse is to swear a life-debt to us. It won't be so bad. We'll travel around the world righting wrongs and being generally debonair.
and we have the army of Kevin on our side. We're fighting the good fight.
I had to google debonair
DSM
DSM
Breakfast cabbage for all.
15:05
cbg @DSM
cbg
our current daily has been taken over by talking about AoC solutions
this is pretty funny
15:20
I'm still pondering whether I can do better than O(N!) on 21.2
I'm very thankful that N=8 right now
@AnttiHaapala I got greedy on AoC
wim
wim
@Kevin I don't think you can
re-resit over, rhubarb till home and stuff
DSM
DSM
I think you can. Some of the instructions are easily reversible, and for the ones that might not be (e.g. rotate based), you just follow all the branches.
I think the "rotate based on original index plus maybe 4" is not trivially invertible
15:25
Yeah, I was thinking of that but couldn't decide whether that would cause some ridiculous combination explosion or not
I didn't think about it to convince myself either way
hey @wim There's another un-resolved PyCharm bug if you scroll up for you to get annoyed at :)
Can someone dupehammer stackoverflow.com/questions/41248756/… to stackoverflow.com/questions/12172791/…? I already spent my close vote for that question.
DSM
DSM
@Kevin: oh, I see your point. :-/
Provided every 21.2 input has one solution, then eventually the field must narrow back down to 1, so the only question is how wide it gets at its worst point
wim
wim
15:30
Oh right, I see what you're saying
DSM
DSM
I have 14 "rotate based on", so if there were only 2 possible progenitors for each state that's only 16k branches. If there were 3 there'd be ~5M. I guess I could actually turn my brain on and figure out how many there are. In fact I guess I could do it without using my brain just by brute-forcing each step. :-P
ah, I see
rbrb
wim
wim
I feel sorry for the guys that wasted time trying to be smart in the first place ... :P
I think I'll give it a shot.
wim
wim
I went straight for the rainbow tables and got a decent place on global leaderboard part B , I didn't even make it on part A because of all the text parsing
time to write a parser like Antti has, I guess
DSM
DSM
15:33
Dawn is leading to pretty purple-and-blue sky. It's good to be home. :-)
15:43
remote work annoyance - not knowing when people are not around when there seems to be an active conversation going on slack....but it moves to the open area and you're waiting for people to reply
sad lego is sad
Hmm, I'm quite surprised at the results of my non-brute force 21.2 solution. view spoiler
I'm not sure whether that applies generally, or just happened to be the case for my input.
wim
wim
@Kevin your gist is starting to take very long to load ... change it to a repo already?
If I can find a way to do it without having to execute any arcane git commands and without having to execute some tedious step once for each source file, sure
wim
wim
don't you have the source files locally?
15:57
@Kevin is all your AoC code inside one directory?
I have 70% of them on my work computer and 30% of them on my home computer.
you're killin' me Kevin
I'm trying to help you out here
I could use this "download as zip" button, I suppose...
yes...do that, put it in a directory called "advent_of_kevin". Go to GitHub create "advent_of_kevin"
and then I'll give you the commands so you don't have to google them
we're gonna move you up in the world Kevin. This is happening
wim
wim
idjaw will hold your hand and i'll spoonfeed you , it's all gonna be ok
16:00
you can do it, big guy.
While I'm at it I'm going to put them in separate folders and give them non-digit names
wim
wim
non-digit names: yay
separate folders: nay
@wim I'm worried about Kevin. He hasn't answered in a while. Do you think he accidentally re-wrote his own history?
wim
wim
hehe ... <slow clap>
wim
wim
16:11
main.py ???
it's OK. This is a start. We're proud of you Kevin
wim
wim
why oh why kevin
(right wim?....just tell him you're proud of him)
And instead, I should be using the name...?
wim
wim
use names like day21.py and put them in the same directory
useless extra nesting is annoying
16:14
Fine, done.
@Kevin It's "kinda possible" to do in O(n) but requires a few assumptions for the general case
I think...yes....definitely a tear in my eye.
After a little testing I've decided that rotation-by-letter is invertible most of the time. Say, N-2 out of N cases for a string of length N
instead of the rotate-extra-if->=-4 thing I changed 4 -> len(string)/2
wim
wim
@Kevin hooray!
16:16
I think the 4 just happens to apply to a case of len 8
and so the example case he gives is not really applicable to a generalization since he uses the 4 cutoff on a len-5 string
wim
wim
Was I the only one who went with a function dispatch for day 21 ? I've only seen if / elif chains so far..
I'm still trying to figure out how you solved it without parsing.
@wim What do you mean?
("you" refers to wim, if that wasn't obvious)
wim
wim
much easier to unit-test .. although admittedly I only wrote the integration test !
line = line.replace(' ', '_', 1)
func_name, *words = line.split()
f = globals()[func_name](list_, words)
Nothing but coal for wim this year.
lol
cool approach, though
wim
wim
hmm, why did I assign that to f
that's almost a lambda, you know
dem b fightin' words
@AndrasDeak look. I got a hat without trying. I actually got two.
I got the hats for not trying, actually
16:30
\o/
It's very sad Canadian of you that with >10k rep you still don't have the yeti
it takes 10 seconds on the front page
how does one acquire the yeti
close or delvote something that later gets closed/deleted, respectively
oh
ok
I have to wait for something to be cv-able
I'll get to it
10 seconds on the front page
look all of you guys with your fancy hats ;3
16:37
screw this. I just got Yoda
I win everything
I just voted to close something
I better get that yeti, Andras, or I'm coming after you
What's the yeti hat? 10k rep?
I have no idea. Andras told me it takes 10 seconds on the main page
I tried doing things and I got yoda instead
are the hats perm? or only until the holidays are over?
@MooingRawr Temporary
Abominable

participate in successfully closing or deleting a question
12 mins ago, by Andras Deak
close or delvote something that later gets closed/deleted, respectively
16:47
guys I don't think I understand modern javascript
"Modern" JavaScript: ignore all lessons learnt in the last forty years of professional programming and start from scratch
it's more like, "here's a super complex thing you need to learn right now in a week. Aaaand it's outdated, stop using it"
And remember stacking as much layers of abstraction on top of each other as possible. Then wonder why your performance is gone.
I write javascript that depends on no external libraries. Sell all of your possessions and follow me.
Yes, all of that too
@MarioDekena Not just performance, even with jQuery stack traces are almost meaningless :-/
And lets not start on some of the more "advanced" frameworks
16:57
on my own server i use javascript heavily! ... to send a request to my server to start python scripts.
@MarioDekena you mean I shouldn't return four functions from my function?
well, if its necessary...

« first day (2258 days earlier)      last day (2915 days later) »