Hacker Newsnew | past | comments | ask | show | jobs | submit | dqminh's commentslogin

We mostly use replicated MergeTree, SummingMergeTree, AggregatedMergeTree etc. And yes, we do use Kafka engine to consume directly from Kafka, in additions to standard Clickhouse inserters.


any reason why you guys choose to pipe the compressed content into `tar xzf` process inside the container instead of extracting it outside and overlay the extracted content onto the container via overlayfs or something similar ?


Piping it in allows the build driver to be agnostic about the physical location of the container.


anyone knows how does this perform compared to http://ace.ajax.org ?


this uses codeMirror as a core editing component ace is faster and more code friendly than codeMirror. (multiSelect, indentGuides, folding) but codemirror is smaller and supports variable width and bidirectional fonts

currently there is no comparable desktop project using ace but maybe there will be something soon http://www.indiegogo.com/happyedit


i had trouble with CtrlP initialy because the initial load time is too slow. However, this config line fix it for me

  let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
It lets CtrlP use git to list files, which is much faster for large project


I've tweaked mine to this, which includes untracked files, but honours your gitignores:

  let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files --exclude-standard -co']
It was annoying me that I couldn't open files I'd just created with CtrlP, as they wern't yet tracked.


Just tried this out on my setup, and it made a huge difference. A large project that used to take ~1s to load the first time is now pretty much instantaneous.


I tried to write an interface to ImageMagick's MagickWand in Golang as well to solve the same problem. You can find it here: https://github.com/dqminh/mage


Its opposite for us. At work, we dont use branch, only git pull --rebase on master. Any idea on when and why to use branches often ?


Branching can often be a good strategy if you have a large team and you don't want large uncompleted chunks of work to block quick fixes & deploys, etc. The situation you want to avoid is:

1. Engineers A & B are working on a medium-sized story that's not really done yet, but is in master anyway 2. Somebody discovers a small but critical bug in production 3. Engineer C can write a bugfix very soon, but can't deploy it to production because the other story isn't done yet.

But if your team never ends up saying "I'd deploy that but master isn't clean right now due to different changes", you probably just don't need to branch that much. Maybe your team is smallish or maybe you're capable of always breaking up work into really small increments. It really depends on everybody's situation.

Github does something sort of like this internally: http://scottchacon.com/2011/08/31/github-flow.html

Branching is more overhead in some circumstances but I've also found they can make things much easier. But I also wish that more people were comparing strategies and trade-offs because this stuff gets subtle and there are really lots of ways to do it.


We faced this situation before. What we do is: - When there is a feature that is not done yet, but has some user-facing code, we use feature toggler to disable it on production - we deploy quick fix by doing a cherry-pick

We discussed about branching a while ago to solve this problem more effectively but still not satisfied with the pros vs cons. For us, branching only makes sense if we switch to use branching completely, and thats quite a big change.


Yeah, personally I know a number of solid devs who like feature toggling but the notion has always rubbed me the wrong way. Especially because half the time I'm adding a non-trivial feature, I'm always semi-refactoring the code underneath to deal with the common patterns and concepts that emerge as a result of that addition. But I'm a big refactoring-as-you-go kind of person--I don't know how common this is.

Branching is definitely a significant investment for a team. It's best done when you've got somebody in-house who can guide everybody through the etiquette and how to use git to best support it. And if you want to do it all the way then you want to support in multiple places in your development stack -- QA servers, staging servers, CI, etc.

But for large units of work that genuinely should stay out of master -- large user-flow rewrites, big code refactorings or database migrations -- I find it a great way to have significant experimentation off to the side and then bring it back into master when it's ready for prime-time.


this was a question I had - how do you have your QA,testing,staging setup to test branches ? Or is fast and frequent commits (by design) eliminate the need for the commit-deploy-test cycle and replace it with a review step instead ?


Generally speaking I like to have at least one CI environment available for every branch that makes you nervous, plus master. So what number you're dealing with depends on the team. Sometimes you have eight engineers but only four of them are doing something major at any given time.

Of course, whatever you call what you deploy to production -- master, production, timestamp tagging, etc -- it should ideally pass CI before getting deployed as well. And there are merge conflicts to deal with, too -- that ideally belongs to whoever's doing branching.

So, maybe my ideal workflow looks like this:

  * Branch away from master
  * As you work in your branch, grab a CI server if you feel like it (telling
    everyone else)
  * Commit code in your branch, keeping an eye on your CI as you go
  * Periodically merge in from master, dealing with merge conflicts in your branch,
    *not* in master
  * When you feel like it's ready to go, get whatever review you feel like you
    need -- code review, product manager review, etc
  * If you feel 99% certain it's good, merge it into master and push that back to
    origin
  * Wait for master CI to pass
  * Deploy to production
  * Beer
From an etiquette point of view, there are things that can go wrong, not least the individual commitment to deal with merge conflicts before they get involved in master. And conflict resolution cannot be rushed. If you have engineers who are just gonna edit files randomly to get git to accept their merge, you're going to have problems. (But if you have those sorts of engineers, you already have problems.)


Out of curiosity, do you work for a relatively small company? I ask because I can't imagine this scaling particularly well, with production code containing a large number of "dead" code paths that you have to cross reference with your feature toggler to check on their status.

Do you feel like you gain anything significant from your method (apart from the simpler git interaction from having just one developer branch)?


We have been very happy with the git branching workflow described and justified here: http://nvie.com/posts/a-successful-git-branching-model/


A local git branch is super-cheap, so there's hardly any downside to using them. The upside, even for a single developer, is the ability to work on multiple features/bugfixes simultaneously, and merge them into master only when they're ready.


Where I work, there are several different git styles, but they all work nicely together if everyone adheres to one simple rule. I'm going to say it loudly, because it's important:

origin/master must be deployable.

If that means developing in a branch, fine. If that means accumulating several patches locally in master that you haven't pushed yet because you're not done, fine. Just make sure that origin/master can always be deployed to the servers.

Actually, come to think of it, both of those things are pretty much equivalent to using branches for anything non-trivial.


python also has this right by introducing named parameters. The same function in python can be written as:

  do_send_mail(recipient="some@email.com", cc="another@email.com", subject="Hello!", body="hi!")


There are significant differences though:

1. It's not possible to mandate the usage of keyword attributes in Python 2, this function could be called with

    do_send_mail("some@email.com", "another@email.com", "Hello!", "hi!")
JS/Ruby's low-fi version of using hashes actually helps there as you have to provide hash arguments via the hash.

Python 3 lets you fix this issue (a great reason to switch, by the way) by using a ⭑[0] argument (not a ⭑-arg, which you can use in Python 2 but which will simply make your stuff fall into a black hole unless the creator of the function asserts no positional argument was passed via e.g. `assert not arg`; furthermore Python 2 would require that a default value — to check for — be given for each keyword argument):

    >>> def foo(*, a, b):
    ...     print(a, b)
    ... 
    >>> foo()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: foo() needs keyword-only argument a
    >>> foo(1, 2)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: foo() takes exactly 0 positional arguments     (2 given)
    >>> foo(a=1, b=2)
    1 2
2. the arguments are separate from the method name in Python, in your example the method is `do_send_mail`, in Smalltalk and Objective-C it's `doSendMailToRecipient:cc:subject:body:` which has advantages and inconvenients. Python is easier for default values (you need a new method in Smalltalk or Obj-C), but the Smalltalk/Obj-C method is simpler for behavioral differences (as the dispatch is done at callsite, Python will need internal soup)

3. There is no order in Python's argument (whereas changing the order in Smalltalk/Obj-C changes the method called), which means callers can lower the call's readability by swapping arguments around in... less than sensible ways.

(nb: I love Python, don't interpret my comment as a put down of it, just pointing out fundamental and important difference between Python's keyword arguments and Smalltalk's keyword messages)

[0] I hate HN's markup.


> It's not possible to mandate the usage of keyword attributes in Python 2

That's not completely true, but it's inconvenient. If you're prepared to go the kwargs route, calling with positional arguments raises a TypeError:

    >>> def foo(**kwargs):
    ...  print(kwargs['a'], kwargs['b'])
    ... 
    >>> foo(1, 2)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: foo() takes exactly 0 arguments (2 given)
    >>> foo(a=1, b=2)
    (1, 2)
You have to manually check for required parameters, though, and assign any necessary defaults.


> That's not completely true, but it's inconvenient. If you're prepared to go the kwargs route

Ah true, I'd not thought about using kwargs only.

> You have to manually check for required parameters, though, and assign any necessary defaults.

Yeah, and you likely lose parameters management in the IDE.


thanks for the point. I have no background in Python so I didn't take Python into consideration. In my opinion, there are more people like me: coming from pure HTML/CSS/PHP background straight to Objective C


Look into Smalltalk (which is the language Obj-C borrowed the message syntax from) too. Squeak by Example is an excellent intro.

http://squeakbyexample.org/


no, more ram means less power consumption because you are accessing hard drive less often.


For what it's worth, the OpenBSD team is working on improved buffering for high-RAM machines:

"Computers today have immense quantity of unused memory. This new software almost works, we still have some minor bugs to fix, but the results so far are incredible. On computers with 16GB of RAM we can dedicate as much as 13 GB to buffering and almost no data is read from the hard drive, everything is in the RAM. It performs even faster than SSDs. We only have to write to the disk anymore and that’s mainly for reliability reasons. I estimate we’re a year away from the whole thing working flawlessly. From this aspect the 6 month release cycle is a bit limiting."

http://undeadly.org/cgi?action=article&sid=2011101806163...


seriously, you think OpenBSD invented the buffer cache?


Pretty sure that's wrong except in contrived disk-heavy workloads. RAM needs power in proportion to its storage size.

My 2009 MBP, which I immediately upgraded to 8GB RAM on purchase, has never come close to the stock advertised battery life. And, supposedly a reason Apple optimizes iOS devices for such small RAM sizes (sizes which are never emphasized in published descriptions) is that minimizing RAM is an important factor for their long battery life.



Tornado doesn't have any orm, it only has a very thin wrapper around MySQLdb.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: