Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gvalkov
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
gvalkov
11y ago
I really liked the COBOL comparison. It's a real pity that nothing came out of their effort to use Lua[1] for the build language. [1]: https://cmake.org/pipermail/cmake/2007-November/017971.html
32.
▲
by
gvalkov
11y ago
Print as a function is a definite improvement in terms of functionality and API (`print >>fileobj, ...` always looked like syntax from another language). I too though I'd be bothered by the extra (), mainly due to muscle memory,
33.
▲
by
gvalkov
11y ago
In line with the other suggestions, there is also jenkins-autojobs [1] (disclaimer: I wrote it). It's a set of scripts that listen for changes in a git|hg|svn repository and create|update jobs from template jobs and the rules defined
34.
▲
by
gvalkov
11y ago
I hope more command-line interfaces adopt a similar pattern. I pet peeve of mine is searching for a package (irrelevant of the package manager) and then installing it. In terms of interaction, it goes on something like this: $ ${tool}
35.
▲
by
gvalkov
11y ago
Could Python 3 host the features you want? If it did, would you consider migrating your code-base to it? I'm positive that if your ideas have merit and you share them on the python-ideas mailing list, you'll get a good discussion
36.
▲
by
gvalkov
11y ago
You contribute the same borderline FUD in every thread that is related to Python. It's unfortunate that Python is not the language you want it to be, but consider just how dismissive you are of the needs of others - frankly, it comes a
37.
▲
by
gvalkov
11y ago
I find it hard to appreciate these inventive types of API design. Something more traditional and boring, like Celery's crontab[1] or dateutils rrule[2] seem quite sufficient. For example: crontab(hour=18, minute=30, day_of_week=&#
38.
▲
by
gvalkov
11y ago
Nicely done - the design is amazing. I had to solve a similar problem a while ago and wrote tailon: https://github.com/gvalkov/tailon
39.
▲
by
gvalkov
11y ago
I have a small wrapper around `pygmentize -g` in my dotfiles that optionally overwrites the lexer based on the mime-type, as determined by `file`: https://github.com/gvalkov/dotfiles/blob/master/bin/
40.
▲
by
gvalkov
12y ago
I find that in recent versions of GNU make, the ONESHELL and define directives alleviate some of the pain of multi-line rules. There is also this emacs package [1] I wrote while maintaining an inline-shell heavy makefile framework that
41.
▲
by
gvalkov
13y ago
By using Python3's nonlocal statement. def outer(): a, b = 1, 2 def inner(): nonlocal a a, b = 3, 4 print('inner a: ', a) print('inner b: ', b) inner
42.
▲
by
gvalkov
13y ago
I really hope Hy catches on as the way to add DSLs to Python projects. I did this to one of my small projects and I'm very happy with the results: http://pyzmo.readthedocs.org/en/latest/#usage-hy
43.
▲
by
gvalkov
13y ago
Indeed, it's quite idiomatic. I would have still preferred if there was a switch/case construct that would generate a dispatch table for us (in fact, this was proposed and rejected in pep 3103[1]). A case statement would have been a nice, l
44.
▲
by
gvalkov
14y ago
Excellent work. Have you considered making this into a Vim reference manual (:help help-writing [1])? This would make a worthy addition to the Vim distribution, imho. I always enjoyed reading through the Vim manuals (especially :help usr_41
45.
▲
by
gvalkov
14y ago
And if you find that useful, here's an extension of that same idea: https://github.com/gvalkov/python-oneliner (I haven't worked on it in months though)
46.
▲
by
gvalkov
14y ago
Just wanted to mention that the news of Mir has hit wayland's mailing list[1]. I'm very curious to see what the wayland developers think of all this. A lot of work has already went into wayland and in making things work with it (gtk3, qt5,
47.
▲
by
gvalkov
14y ago
This article isn't as much about one-liners as it is about the usefulness of the if __name__ == '__main__' idiom. It's great when a module can be consumed as a library and as a command-line script at the same time. Unfortunately, Python i
48.
▲
by
gvalkov
14y ago
For the sake of comparison, here's the corresponding Python one-liner: ping google.com | python -c 'import os,re,sys; [os.system("say %s" % j[0]) for j in (re.findall("time=(.*)", i) for i in sys.stdin) if j]' I'm sure someone can
49.
▲
by
gvalkov
14y ago
Thanks. My approach is actually pretty minimal. Just a read-print-loop ( -n , -p ), a few local variables (equivalents of $_ , $~ , $. etc) and a shorthand import syntax to take away some of the verbosity. There are other projects, suc
50.
▲
by
gvalkov
14y ago
I hear you on the one-liners issue. Python is unhelpful when it gets to that - there are no -n , -p , -l switches or special variables like there are in Perl and Ruby. It's a shame really, since all the building blocks needed to imple
51.
▲
by
gvalkov
14y ago
You can enjoy the best of both worlds with something like zsh's edit-command-line . I'm very happy with Emacs keys in the shell, unless I need to make a non-trivial edit or type in a multi-line command. In those cases, C-x C-e drops me r
52.
▲
by
gvalkov
14y ago
It actually comes in handy if you're using Sphinx and don't want to maintain release and version in conf.py separately from the version in setup.py . There's no reasons why the data should be consumable only by setuptools .
53.
▲
by
gvalkov
14y ago
I've wondered why using a dictionary to initialize setuptools.setup() isn't more advocated in such guides. I understand this is superficial, but imho, this looks much clearer than the author's suggestion [1]: from setuptools import
54.
▲
by
gvalkov
14y ago
I'm surprised there isn't a Perl6 version of Mail::RFC822 . This is exactly the kind of thing that Perl6 rules[1] are supposed to excel at. It would be good publicity, especially now that rakudo has usable releases. [1]: http://en.wikiped
55.
▲
by
gvalkov
14y ago
You could either run plasma-desktop through .xinitrc or set KDEWM to xmonad in .xsession. You will have to send plasma-desktop to the float layer. It's best if you make xmonad act like an EWMH compatible WM by using the EwmhDesktops
56.
▲
by
gvalkov
14y ago
Unfortunately, gnome-shell desktop components are closely tied to mutter. For example, the fallback gnome-panel [1] and the gnome-shell gnome-panel [2] are two entirely different beasts (same goes for cinnamon, where they've never had a fal
57.
▲
by
gvalkov
14y ago
That's a reasonable alternative and something that one could get used to. After all, Vim and Emacs people have been rebinding Caps Lock to Esc / Ctrl for a long time. One possible downside is the extra strain that this would put on the
58.
▲
by
gvalkov
14y ago
My main gripe with chromebooks is that they don't have a windows key (KEY_LEFTMETA). As a xmonad user, I have quite a lot of functionality bound to that key and I'm not too sure about moving it over to KEY_LEFTALT (mostly because of confl
59.
▲
by
gvalkov
14y ago
Here's to hoping that duplicity and git-annex could somehow make use of this service. I'm far more optimistic about duplicity support though, as incremental archives seem to fit the glacier storage model much better. A git-annex spe
60.
▲
by
gvalkov
14y ago
Well, there is PyCoreutils [1] for the userspace and supervisord [2] for pid 1. This is certainly an interesting idea - too bad the world isn't in dire need for more distributions. [1] https://launchpad.net/pycoreutils [2] http://sup
More ›