group by of this stroke:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
What I actually expected it to do:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D
Here is what I've got. Pretty simple and not fully implemented, but totally fun :)
Back to the social media.
Was debugging #Spark again for several previous days. Things that I've learnt during another deep debugging session:
1. It seems that it doesn't like when you try reading old checkpoints
2. Do not use different schemass for serialization in same application, or you will spend a lot of time debugging them.
3. #Scala is statically typed language that allows you to make things you can do in #Python, but with guarantee that if it compiles then it will at least work.
Giving my laptop some hard time in recoding thing from mp3 to ogg. Also, first time in my life I found out that it is easier to write a #python script that to write #bash script to work with files with spaces. It took for about several hours to try making script in bash and about 15 minutes to write a python script that does literally the same, faster and more stable! #Linux #nerd #life is hard :D
Last evening I was doing two things at the same time:
1 - I was writing a universal DSL for querying languages using native #Python type hinting (I call it naiiveORM). Will open source it when ready.
Reason is very simple: Python declares to be expressive and easily language, but lately I feel that most of the time I just fight the interpreter to express my thoughts. And with Scala, I just write my thoughts straightforward, and they just work. Easily and fast, without any hacks and fighting language
Why? Because it makes development tools agnostic to editor you use. You use the very same tools, when you use Atom, ViM and Emacs or anything else that supports those protocols.
This is what should be made years ago, when the "editors war" just started.
Writing cli applications in #Python is a bit painful, because damn, you have to invent a wheel, and this all trying to make it still beautiful and shiny. Maybe I'm doing something wrong probably :D
Fun thing about #Python. It's type annotation system could be used to do the type checking with mypy or in runtime and to make it more stable. Or you can use it to do more metaprogramming and writing less code.
What should you choose?
Why do I need to change language, if the one I work with currently allows mostly... everything could be possibly needed to do in the world.
If I need performance, install Cython, build slow modules and get it up to 1000x faster. Statistics - install jupyter, numpy, pandas etc. Web - install Flask (aiohttp). Desktop - pygtk/pyqt/tk
Software Engineer, tech enthusiast, Ukrainian 🇺🇦. That guy in the corner, who acts strangely
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!