News for hackers. Stuff that matters.

yes_or_gnome

Re:Adding Mercurial support to Gitlab on Thursday September 20, 2018 @03:26PM (#18034875)
Your comment is criminally low. Every other comment is 'Git vs. Mercurial' and speculation as to why git has "won". Their not useless, but they are uninteresting technically. So, as a git aficionado, I thank you for a detailed analysis of Mercurial and this proposal.

Personally, I've only used Mercurial to check out some projects that use it exclusively (i.e. (previously) Python and Firefox) and to create a toy repo of no significance (to learn its CLI interface).

Just to highlight a couple things from your comment:

> Therefor, if you value some of mercurials core features, and your primary value from git is the light weight branching model, mercurial with evolve + topics starts to look like a real solution for many shops.

By far the most annoying thing about going from git to mercurial is the overloaded concept of a 'branch'. I couldn't care less about the continued existence of my one-off, topic branch. TBH, I prefer the git concept of the reference pointer being culled in the process. The (git) branch's existence continues on only in the merge commit message. Although this assumes 1) an actual merge was committed (not rebased), 2) the merge wasn't fast-forwarded (--no-ff), and 3) the default merge message format was used.

> With that said, we use mercurial in production for our main repository. We do use evolve + topics for our development and when commits land in production, those commits become “immutable”.

> Developers can rebase their work, if they wish, and they can squash, if they wish. I generally discourage the later as I’m a believer more commits the merrier. I’m also not allergic to merging and I don’t see the value in a purely linear history, so rebasing isn’t as common for us. We also have a single integration branch. When developers are ready, we merge to this branch and the ticket gets advanced to qa. Once the ticket passes qa, we merge to default (therefore advancing the head) and the topic is closed out on its own.

We use Github. IMO, Github made a HUGE mistake when they added the options to Rebase and Squash in-lieu of the only sane option, Merge. I suspect that a lot of users wanted these options because Github (still) refuses to drop the --no-ff from their Merge strategy. I prefer --no-ff, but I do agree that it does make for an ugly log graph; Unlike most people, I couldn't care less about pretty graphs.) Rebase and Squash shouldn't be considered "Merge" strategies. They're for cleanliness, but only prior to sharing changes. Having them in Github has made the process of figuring out what has (and hasn't) been merged just absolutely atrocious. I'll leave it at that, but needless to say my arguments haven't convinced my peers' desire for pretty graphs.

As far as other user comments, I think the most egregious suggestion has been (paraphrasing):

> Mercurial has (had) better documentation.

Which I think is patently false. Git' manpages are (and always have been) fantastic. git-scm.com has been around for as long as I can remember. If you really want to do so, you can get yourself deep into the git's technical documentation which will teach you everything about the file formats and algorithms that are being used. All of this documentation has been around since git maintenance was handed over to Junio Hamano (circa May, 2005); Long before it's popularity explosion.

Re:New York inmate's golf drawings lead to exoneration in murder on Thursday September 20, 2018 @02:24PM (#18034484)
Like most days, I had no intention of comment on HN today, but whenever I'm reminded of the Innocence Project[1] I'm reminded by one of the most mind-blowing moments in my life. This was in college, I had a PoliSci professor (Political Science) that stated, 'I believe that O.J. Simpson was innocent.' To add context, this professor was an older, white male, however that's not the mind-blowing bit. That bit comes later. Let's face it, in the US, one's opinion on the OJ Simpson verdict varies greatly by one's ethnicity. As a (much) younger, white male, I held the stereotypical view point that he was guilty, so the professor's statement rapt my attention. I can't remember his arguments specifically, but it was enough for me to doubt my own assumptions and read about the trial myself. My "mind-blowing" moment came when I switched my opinion from "clearly guilty" to "I think OJ Simpson was guilty, but I'm not confident enough to convict him."

While the details of that case are fascinating, that's not the purpose of this comment. The tie-in to OP's comment is this, the Innocence Project was started by Barry Scheck[2] and Peter Neufeld[3] in 1992. Both Scheck and Neufeld were instrumental members on Simpon's "Dream Team"[4] responsible for discrediting the DNA evidence. If you remember the constant media coverage of the trial, Scheck was the attorney responsible for questioning forensic experts and the LAPDs collection practices. Again, I don't want to get into particulars of the case, but their arguments are very convincing (to me).

Obviously, the project was started prior to the OJ Simpson trial (in 1995) and regardless of one's opinion of Simpson's innocence, I think that most people will agree that single case led to increased scrutiny of forensic evidence and a reduction of importance placed on unreliable eyewitness testimony are a net positive to the world.

[1]: https://en.wikipedia.org/wiki/Innocence_Project

[2]: https://en.wikipedia.org/wiki/Barry_Scheck

[3]: https://en.wikipedia.org/wiki/Peter_Neufeld

[4]: https://en.wikipedia.org/wiki/Dream_Team_(law)

Additional Links:

https://en.wikipedia.org/wiki/O._J._Simpson_murder_case

https://en.wikipedia.org/wiki/O._J._Simpson

Re:Critical vulnerability of NPM package macaddress on Monday June 11, 2018 @11:07PM (#17290429)
I'm not a JS developer, so this as much of a question as it is a statement.

`exec` is a system call and doesn't call bash or any other shell. At least, it shouldn't.

If it does, then it would be wrong to assume that bash is even available.

Either way. The single quote sytax is specific to bash (and maybe sh, dash, etc. I'm not certain.) so, don't rely upon it.

Us Cubs fans had a truly awful decompression in 2016. Don't get me wrong, winning the world series was amazing. But, I wish they did it in less dramatic fashion.

And, to stifle the high, there was an absolute (and ongoing) tragedy less than a week later.

Also. There's the minor leagues. Officially, those are (high to low) AAA, AA, high-A, and low-A. Then there's extended spring training, summer leagues, and associated leagues in the Dominican Republic and Venezuela. Independent leagues, college, high school, and youth leagues down to 4 year olds. International major leagues in Japan, Korea, Taiwan, Cuba, and Mexico.

There's a lot of room to test out new rule changes, but it would take a lot of effort to get them adopted every where.

There are some common rule changes that only make sense in leagues to limit length and discrepancies in competition. Limited innings, run limits per inning, mercy rule, home run limits, starting with runners in extra innings.

However, the rules that the MLB are looking into wouldn't make any sense in non-professional leagues. MLB is looking at limiting visits to the mound and pitching clocks.

Your local high school game isn't going to have pitcher-induced piece of play problems because the player's just aren't that good. Or, if they are, then the game will be forfeited early.

I can't imagine MLB fans being okay with rules that stifle competition. Starting an inning with runners on feels 'icky' for lack of a better term.

I remember when the NHL introduced shootouts. As an NHL fan, I was upset, but I understand the reasoning behind it. There's a large constituency that doesn't like games that end in a tie. Penalty shots are exciting, even when they're manufactured. And, it's a common rule in other hockey leagues (and football/soccer). So, not a big change, but disappointing to a lot of fans; myself included.

However, the change from 4-on-4 to 3-on-3. That was excellent, imo.

Just thinking about the number of rule changes in the NHL, since 2005, is pretty amazing. Certainly it is more exciting, but to get back to baseball, it has me thinking of all the room there is to adjust the game of hockey. Eliminate two line pass, adjust equipment size and materials, regulate goalies, regulate defense, regulate fighting, instant icing, concussion testing, etc., etc., etc.

I couldn't even come up with did ways to make baseball "more exciting". And, even if someone did, then I feel that it would be detrimental to the game.

Just for fun.

1. The first batter runner dictates which base is "first" by running left (to "third") or right (to "first"). This would make indeed infield defense more difficult and add an extra degree of thought into the game.

2. Fielders must rotate positions each inning. Now you can't just put the lefty, 250lbs guy at first because he'll have to shag some balls in the outfield and be a nightmare at shortstop.

3. Rescind the "ball in cap", which is a ground rule triple if a fielder catches a ball with his hat. Instead, make it an ground rule double-play. Just for the fun of seeing someone try it and, as a result, for all the dropped balls.

4. Any player that hits a home run may go back up to bat. Why, yes, i would love to see a single player go back-back-back HRs before taking himself out of the game due to exhaustion.

5. The starting pitcher may opt to throw a red/hot ball once per game. If he throws a strike, then it's a strikeout. If it's a ball, a walk. If it's hit, then it can't be caught (else it's a ground rule double). Hit by pitch is a HR. A batted HR is a grandslam. A foul becomes a do over.

6. The opposing team sets your lineup. Starting pitchers must have a minimum days rest. And, the lineup cannot be changed in the first inning except for injury.

Re:Git log – The good parts on Monday March 26, 2018 @12:25PM (#16680048)
This is likely to be said, "`--color=auto` is the default setting, so it's not needed." However, it's good to include it here because some users may have changed their default configuration to disable colors. This way `git log` works as their standard workflow and `git lg` for when they need a bit of color.
Re:Sin and Cos: The Programmer's Pals on Tuesday March 06, 2018 @12:01PM (#16530084)
> Sometimes this is not a problem. When x is small, sin(x) can be computed by simply returning x. This rule is valid until x^3/6 > precision ~= 1e-38, or x = 4e-16. So exact precision is obtainable by simply returning x if x < 1e-16.

"This rule" seems a lot like the "skinny triangle" rule. I recently ran across it on Wikipedia after going through astrophysics articles. Specifically, to my understanding, the parsec could be calculated without using a trig function thanks to the skinny triangle rule. (To a certain level of error, of course. And, the parsec is now a defined value so the original trig-derived definition is invalid.)

https://en.wikipedia.org/wiki/Skinny_triangle

Re:Linus Torvalds Rants on Saturday March 03, 2018 @02:30PM (#16511054)
Most be a slow day at HN. I've subscribed to this subreddit and the posts there are mostly people discovering lkml.org for the first time and seeing the "Hottest" emails of which some are over 5 years old. (`Re: [Regression w/ patch] Media commit causes user space to misbahave (was: Re: Linux 3.8-rc1)`, `Re: [GIT] Networking`, etc.) In this thread, there's been plenty of more recent examples of Linus's snark, but this particular subreddit is more or less dead. And, I suspect it's dead for a good reason. That is, Linus doesn't really really all that much. Side from the infamous 'Mauro, Shut The F* Up!' email, there's not that many good "rants".

There's plenty of snarky, bad behavior sure. I get that a lot of people don't like it, but none of them bother to understand that these people work together daily and in the most open environment possible. Nobody considers the fact that, in the most infamous example, Mauro has been a contributor since 2006. (I don't know either, not anyone that's a major Linux contributor.) That's right, I wrote 'has' not 'had' because he still contributes to this day. That's not too excuse a behavior, but as a knock against the characterization of a "toxic environment". Maybe for some, but obviously not for others.

I for one, am glad that most of my cringiest, offensive comments were in person and that I was able to walk then back. And, of the stupifying comments that I made in an email, I'm incredibly thankful that they were private.

Re:Intel CEO’s Stock Sales May Warrant SEC Examination on Tuesday January 09, 2018 @12:16AM (#16103802)
It seems pretty simple when you look at the filing. Just quietly change the rules whenever you see fit.

> Explanation of Responses:

> 1. Transactions reported on this Form 4 were made pursuant to trading instructions adopted by the reporting person on October 30, 2017 that are intended to comply with Rule 10b5-1(c).

https://www.sec.gov/Archives/edgar/data/50863/00011276021703...

https://en.m.wikipedia.org/wiki/SEC_Rule_10b5-1

Re:Oh shit, git: Getting myself out of bad situations on Tuesday December 19, 2017 @12:37PM (#15961983)
You're a looney.
Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @10:13PM (#15957443)
I take your original comment as an indictment that git is somehow broken by design. Which sure, you're entitled to an opinion, but to bring up SVN in the same breath is absurd.

That's why I replied.

I can't really address p4 because I haven't used it for any real world use cases. Only to prepare for an interview. With that limited use, I can't come with any reason to think it's superior.

Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @09:53PM (#15957368)
The tool that doesn't work with case insensitive filenames is OSX.

Edit: To add, how is git supposed to handle two files with the same name -- as is the case -- with a case insensitive file system? You can't have two files with the "same" name.

    git checkout file1
Is entirely different than

    git checkout FILE1

In any other platform ls file1 FILE1 would show two different files, but on OSX, it'll show the same file twice.
Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @05:39PM (#15956155)
The SVN and P4 articles exists (just google for "svn mistakes" and "perforce p4 mistakes"), but either 1. nobody is sharing them to HN or 2. they do and nobody cares to vote them up.

Unrelated topic (falling cats), same logical fallacy: http://www.radiolab.org/story/102525-vertigo/ (Starting around 14:20)

Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @05:15PM (#15956005)
I don't see how that's easier. There's `git checkout -b my-new-branch` which is even easier than the originally proposed solution. Followed by `git checkout master && git reset --hard @{u}` or, if you don't want to switch between branches, `git branch -f master master@{u}`.
Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @05:05PM (#15955942)
Just as an FYI, those will likely live in Github forever. Run `git ls-remote` where ever you have had this problem. You'll see that there are refs for every PR in the form `refs/pull/NNNN/head` and `refs/pull/NNNN/merge`; where `NNNN` is the PR number, `head` is the latest commit and `merge` is the final commit.

If any of those commits with confidential information is reachable from any of those commits, then they'll never be garbage collected from Github.

Re:Oh shit, git: Getting myself out of bad situations on Monday December 18, 2017 @04:58PM (#15955896)
Not really an issue with git, but with OSX. In doing some research of git, I wanted to look at the first git repos. Those are torvalds/git.git and torvalds/linux.git. If you clone linux.git on OSX and run `git status`, you'll see this:

    $ git status --short
    ## master...origin/master
    M include/uapi/linux/netfilter/xt_connmark.h
    M include/uapi/linux/netfilter/xt_dscp.h
    M include/uapi/linux/netfilter/xt_mark.h
    M include/uapi/linux/netfilter/xt_rateest.h
    M include/uapi/linux/netfilter/xt_tcpmss.h
    M include/uapi/linux/netfilter_ipv4/ipt_ecn.h
    M include/uapi/linux/netfilter_ipv4/ipt_ttl.h
    M include/uapi/linux/netfilter_ipv6/ip6t_hl.h
    M net/netfilter/xt_dscp.c
    M net/netfilter/xt_hl.c
    M net/netfilter/xt_rateest.c
    M net/netfilter/xt_tcpmss.c
Re:Git hash function transition plan on Friday December 01, 2017 @02:38PM (#15826636)
Based on my own research, it appears that the first git tag was created before the first git commit.

The first tag (?) points to a tree.

  $ git cat-file -p v2.6.11-tree
  object c39ae07f393806ccf406ef966e9a15afc43cc36a
  type tree
  tag v2.6.11-tree

  This is the 2.6.11 tree object.

  NOTE! There's no commit for this, since it happened before I started with git.
  Eventually we'll import some sort of history, and that should tie this tree
  object up to a real commit. In the meantime, this acts as an anchor point for
  doing diffs etc under git.
  -----BEGIN PGP SIGNATURE-----
  Version: GnuPG v1.2.4 (GNU/Linux)

  iD8DBQBCeV/eF3YsRnbiHLsRAl+SAKCVp8lVXwpUhMEvy8N5jVBd16UCmACeOtP6
  KLMHist5yj0sw1E4hDTyQa0=
  =/bIK
  -----END PGP SIGNATURE-----

First commit

  $ git cat-file -p v2.6.12-rc2
  object 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
  type commit
  tag v2.6.12-rc2

  Linux v2.6.12-rc2 release
  -----BEGIN PGP SIGNATURE-----
  Version: GnuPG v1.2.4 (GNU/Linux)

  iD8DBQBCbW8ZF3YsRnbiHLsRAgFRAKCq/TkuDaEombFABkPqYgGCgWN2lQCcC0qc
  wznDbFU45A54dZC8RZ5JxyE=
  =ESRP
  -----END PGP SIGNATURE-----
Unfortunately, I don't think I can confirm my suspicion using git alone. Maybe if I look at some mailing lists around July/August 2005 I could get a more accurate confirmation.

This is due to the fact that those tags pre-date the tagger header which came a short while later.

  $ git cat-file -p v2.6.13
  object 02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b
  type commit
  tag v2.6.13
  tagger Linus Torvalds <[email protected]> 1125272548 -0700

  Linux 2.6.13 release
  -----BEGIN PGP SIGNATURE-----
  Version: GnuPG v1.4.1 (GNU/Linux)

  iD8DBQBDEkvwF3YsRnbiHLsRAp5tAKCEK1XmOropxvWp+k9eiTcafNMXXACcDAVb
  +hOwdKI+bi84SSNNSGnSXGg=
  =cnNS
  -----END PGP SIGNATURE-----
Edit:

Just to reenforce the "First Commit" claim, here's the rev-list for the commit and the commit contents. (Notice it has no "parent" commit.

  $ git rev-list 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
  1da177e4c3f41524e886b7f1b8a0c1fc7321cac2

  $ git dump 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
  tree 0bba044c4ce775e45a88a51686b5d9f90697ea9d
  author Linus Torvalds <[email protected]> 1113690036 -0700
  committer Linus Torvalds <[email protected]> 1113690036 -0700

  Linux-2.6.12-rc2

  Initial git repository build. I'm not bothering with the full history,
  even though we have it. We can create a separate "historical" git
  archive of that later if we want to, and in the meantime it's about
  3.2GB when imported into git - space that would just make the early
  git days unnecessarily complicated, when we don't have a lot of good
  infrastructure for it.

  Let it rip!
Re:Concorde moment on Sunday November 26, 2017 @02:08PM (#15782427)
Caller ID was around for quite a while before 2002. It looks like the first companies rolled it out in the late 80's. But, it's funny that you chose 2002 because that's the year when phreakers learned how to spoof the system. It was always theoretically possible because phone companies would make test calls to customers with information like "BENJAMIN FRANKLIN (123)456-7890". In other words, it was obvious that the Caller ID system was trivial to manipulate.

https://en.wikipedia.org/wiki/Caller_ID_spoofing

Re:Exploding Git Repositories on Thursday October 12, 2017 @03:24PM (#15460570)
Thanks for the correction, he truly was a brilliant mind. One of my regrets was not being active and outgoing enough to go meet him myself. I was lived in the Cincinnati area from 2007-2012. I first got started with Ruby in 2009, and quickly became aware of who he was (Rake, Bundler, etc) and that he lived/worked close by. But, at the time, I wasn't interested in conferences, meetups, or simply emailing someone to say thanks.
Re:Exploding Git Repositories on Thursday October 12, 2017 @02:41PM (#15460203)
Good point. For those that are curious:

Clone (--no-checkout):

    $ git clone --no-checkout https://github.com/Katee/git-bomb.git
    Cloning into 'git-bomb'...
    remote: Counting objects: 18, done.
    remote: Compressing objects: 100% (6/6), done.
    remote: Total 18 (delta 2), reused 0 (delta 0), pack-reused 12
    Unpacking objects: 100% (18/18), done.
From there, you can do some operations like `git log` and `git cat-file -p HEAD` (I use the "dump" alias[1]; `git config --global alias.dump catfile -p`), but not others `git checkout` or `git status`.

[1] Thanks to Jim Weirich and Git-Immersion, http://gitimmersion.com/lab_23.html. I never knew the guy, but, ~~8yrs~~ (corrected below) 3.5yrs after his passing, I still go back to his presentations on Git and Ruby often.

Edit: And, to see the whole tree:

  NEXT_REF=HEAD
  while [ -n "$NEXT_REF" ]; do
    echo "$NEXT_REF"
    git dump "${NEXT_REF}"
    echo
    NEXT_REF=$(git dump "${NEXT_REF}"^{tree} 2>/dev/null | awk '{ if($4 == "d0" || $4 == "f0"){ print $3 } }')
  done
Re:The Incredible Growth of Python on Thursday September 07, 2017 @01:26AM (#15189322)
You're going to have a hard time supporting multiple versions of Python that way. If I started a new package today I would target 3.4, 3.5, 3.6, 3.7-dev, and likely, 2.7. A lot of well maintained packages have different dependencies based on the exact version of Python. If you're crazy enough to support 2.6, then there will be a lot of additional packages in pip freeze.

Ideally, packages would have just one set of dependencies and the packages would be version locked, but that's just not the case in the Python community.

Re:Redesigning Python's named tuples on Friday September 01, 2017 @12:13PM (#15149767)
You can get close. Set __slots__ and then define each as a property with no setter and no deleter. However, an object can still be modified if it stores a mutable object (list, dict) and, while I'm not in front of a computer atm,I believe you can overwrite __slots__ to do whatever.

Here's an SO answer that explains more than I'll ever know about slots. https://stackoverflow.com/questions/472000/usage-of-slots

Re:Redesigning Python's named tuples on Friday September 01, 2017 @01:21AM (#15146310)
Your Point3D class is _not_ functionally equivalent to a NamedTuple. The class is so minimal that I wouldn't bother calling it a class as much as I would call it a glorified dictionary.

I do like the concept of Structs. I first used them in Ruby, so I figured that all "very high" languages had the concept. Python, however "struct" has a very different meaning in Python. sigh It's intended for encoding/decoding binary data from strings/bytes.

https://docs.python.org/3.6/library/struct.html

There is a lesser known use case for the type(...) function. Normally, one would use it to find out an object's type.

     >>> type(42)
     <type 'int'>
     >>> type("foo")
     <type 'str'>
     >>> type(type)
     <type 'type'>
But, it can also be used to create new class types. https://docs.python.org/3.6/library/functions.html#type

     >>> Point3D = type("Point3D", (object,), dict(x=0,y=0,z=0))
     >>> my_point = Point3D()
     >>> my_point.x
     0
     >>> my_point.y = 42
     >>> my_point.y
     42
     >>> my_point.a
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     AttributeError: 'Point3D' object has no attribute 'a'
Which is, essentially, what Ruby's Struct class provides. And, Python objects don't have privacy, so it's more comparable to the OpenStruct class.

Edit: Just wanted to tack on a shout out to Attrs which is really nice improvement to "Struct" concept. http://www.attrs.org/en/stable/ h/t hynek

Re:Puppeteer: Headless Chrome Node API on Wednesday August 16, 2017 @02:09PM (#15029724)
(I don't have the full history, but from my experience...) When I first started using Selenium, it used browser-specific drivers that communicated directly with bespoke extensions/plugins/add-ons/what-have-yous. Then came Selenium Server which allowed for testing on remote machines. Then Grid allowed for simultaneous testing of many remote machines.

Due to the nature of browser plugins, they could only access information that the browser made available. Also, the dev's have consistently been of the opinion that they only care to simulate an end-user experience. (End user's only care about the webpage's presentation, not which headers were present per transaction.) Although, I suspect that early restrictions influenced that viewpoint.

It wasn't until much later that browsers started implementing their own automation channels; Chrome's Automation Extension and Debugging Protocol, Firefox's Marionette, etc. At the same time, browsers started putting additional security measures around plugins making it even more difficult to have consistent features across Selenium's drivers.

Which is why the WebDriver became an open specification instead various driver implementations. I believe, Microsoft was the first to implement their own driver, InternetExplorerDriver, for IE7+. Then ChromeDriver (powered by Chrome Automation Extension), GeckoDriver (Firefox translation to their Marionette driver), and SafariDriver is now baked into Safari 10.

Marionette is possibly the most interesting, but I lack experience with it. TMK it allows for automating the entire browser; both the webpage and the 'chrome' interface. Whereas Selenium, at best, could only simulate actions - like the back button - through Javascript. But, even with the Marionette's feature richness, you still don't get access to request and response information.

I think for most developers ("devs", "qa", "scrapers", etc.) there's very little appeal in moving away from Selenium because it would require maintaining multiple test suites. It gives consistent results and just works. If you want lower level information, it's fairly simple to either 1) just use a CLI client (curl, wget, etc.), or 2) a library libcurl, Requests(Python), Net::HTTP(Ruby), etc. etc. etc., or 3) setup proxy server. I do all of the above, each has it's own downsides clients and libs don't do any rendering themselves and proxies tend to rewrite transactions (ex. strip compression and add/remove/alter headers 'Content-Type: gzip').

I work with a couple people who insistently write shell scripts in Python. I know it's anecdotal, but to me, it's like the metaphor 'When all you have is a hammer, everything looks like a nail.' The scripts use functions liberally, but the code isn't DRY nor self-documented. Written in shell, it would take a fifth of the LOC because there's no need to use subprocess or Popen and parse the output. They're not the best developers, but I certainly trust their Python code than I would trust their shell code. And, there's plenty of work to go around, so it's better than nothing.
Re:Detecting Chrome headless on Saturday August 05, 2017 @09:18PM (#14939131)
Safari has navigator.webdriver, and others will soon follow. The idea was first introduced as a Fx bug, but hasn't gone any where.

https://bugzilla.mozilla.org/show_bug.cgi?id=1169290

There's a webdriver protocol mailing list with a long thread that describes how it should be implemented and how people could avoid it; ex. recompile without the feature. I just can't find it right this minute.

Re:Python Entry Points Explained on Friday July 28, 2017 @12:24PM (#14875415)
Argparse's source is possibly the most difficult lib to grow from the stdlib. https://github.com/python/cpython/blob/master/Lib/argparse.p...

For me, it is not debugable. I wanted to propose and start a reference implementation for supporting --[no-]bool-opt, but I quickly gave up. There's some solutions on SO, but none of them are sufficient. The best solution makes --bool-opt mutually exclusive to --no-bool-opt which will cause a hard failure which is not okay for shell aliases.

Re:A set of best practices for JavaScript projects on Wednesday July 05, 2017 @12:10PM (#14703614)
This is one reason why I find GitHub (especially, Enterprise) so frustrating. I want simple server-side githooks to verify that client-side hooks were used (or, at least a good forgery). I don't want to setup an additional CI environment just to run the most basic SED commands. Nor do I want to make my existing CI environment more complicated by merging disparate validations; unit test validation and commit validations.
Re:A set of best practices for JavaScript projects on Wednesday July 05, 2017 @12:01PM (#14703530)
No. HEAD is the same as GET, but the server should not return a response body. The response code and headers should all be the same. This is to guarantee that a path is serviceable, response body size, and for verifying the client's cache.
Re:Introducing Dash – Reactive Web Apps for Python on Wednesday June 21, 2017 @02:25PM (#14606542)
DASH (Debian Alchemist SHell). I believe it's the default shell for Debian and Ubuntu (I'm a Fedora/CentOS user myself). I remember hitting some edge cases where some bespoke shell scripts don't work correctly on Ubuntu because DASH is a "slim" Bash alternative, so it doesn't have all the "bashisms".

Older »