News for hackers. Stuff that matters.

tom-lord

Re:Ruby: We have decided to go forward to 3.0 this year on Thursday September 03, 2020 @11:27AM (#24364945)
There's no such thing as a performance measurement "on all workloads".
Re:How Not to Sort by Average Rating (2009) on Wednesday August 30, 2017 @11:10AM (#15132759)
It's written in the article?
Re:ICANN’s First Test of Accountability on Sunday October 30, 2016 @02:19PM (#12831311)
That was the whole point in theory, yes. But in reality, almost all new gTLD registrations are being made as brand protection, and redirecting to the company's existing .com domain. Only a very small minority of websites are trying to build a brand on a new gTLD domain name.
Re:ICANN’s First Test of Accountability on Saturday October 29, 2016 @06:13PM (#12826722)
Why does there even need to be such thing as a TLD? :P

I'm guessing the idea is similar to .London, .NYC, .Amsterdam, ... i.e. it would be used for a geographic indicator/market.

Re:ICANN’s First Test of Accountability on Saturday October 29, 2016 @03:54PM (#12825986)
> Restricted gTLDs should have only been for trademarked company names, like .google or .microsoft

Unfortunately however, there are a lot of grey areas... To name a few:

* Amazon have been in a long dispute with the Brazilian government, over the right to operate a .amazon TLD - as the Brazilians claim it should instead be related to the rainforest.

* On the other hand, Amazon have secured TLDs such as .prime, which could also be disputed. Apple have won .apple, Sky have won .sky, ... the list goes on.

* Sometimes, the conflicts can even be with foreign languages. For example, Ferrero are now the registry operator for .kinder - but as this is the German word for "children", it's been the cause for similar debate.

Also, with regards to your concern that there is a lack of variety in available unrestricted TLDs - I disagree; if anything, there are far too many (there's hundreds!!).

Re:“It's The Future” on Wednesday August 17, 2016 @08:09AM (#12304028)
Shell/batch scripting can often be useful in the devops world, where you have no guarantee that any additional tools (python, ruby, perl, powershell, whatever) wil be available.

Shell scripts are guaranteed to be runnable on all machines.

Unfortunately the shell "language" sucks, but still...

Re:Stack Overflow Outage Postmortem on Thursday July 21, 2016 @05:05AM (#12135643)
> If the POSIX standard is going to require backreferences, then it should also require a non-backtracking implementation for regular expressions without backreferences

At least in some regexp engines, this is possible. There is a concept of possessive (as opposed to reluctant, or as it's often called, "non-greedy") quantifiers. Given the string "abb", consider the following regexes:

/[ab]+b/ -- matches "abb"

/[ab]+?b/ -- matches "ab"

/[ab]++b/ -- DOES NOT MATCH!! (Because there is no back-tracking.)

More info: http://www.regular-expressions.info/possessive.html

One regexp engine which implements this (see section 4): https://raw.githubusercontent.com/k-takata/Onigmo/master/doc... -- this is the engine used by modern Ruby versions.

Re:Can a Living Creature Be as Big as a Galaxy? on Thursday March 31, 2016 @06:22AM (#11396102)
No one really knows for sure, but....

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

Re:Non-nullable types for TypeScript on Monday March 21, 2016 @01:37PM (#11329954)
Yes, however that was 3 and a half months ago -- and as far as I can tell, there's been no movement towards doing so.
Re:Non-nullable types for TypeScript on Monday March 21, 2016 @07:26AM (#11327338)
Funny how the conclusion is basically "Don't use `var`, use `let` instead" - even though almost all documentation/examples exclusively use the `var` keyword!
Re:Why I No Longer Use MVC Frameworks on Tuesday February 16, 2016 @06:07AM (#11109105)
> Designers suck at code. Coders suck at design. Keep that shit separate.

I currently work in a small-ish company, where I am the ONLY person designing/developing multiple systems. (I do get some input now and then, but it's mostly all down to me.)

I like this idea in principle, but you don't always have the resources to achieve this!

Re:An 'in' operator for Ruby on Tuesday February 16, 2016 @05:20AM (#11108937)

    [1] pry(main)> 10..100
    => 10..100
    [2] pry(main)> (10..100).class
    => Range
    [3] pry(main)> (10..100).to_a
    => [10, 11, 12, 13, 14, ..., 99, 100]
Re:An 'in' operator for Ruby on Tuesday February 16, 2016 @05:09AM (#11108899)
Yes, you can. Ordering has been guaranteed since ruby v1.9, very much intentionally.

The implementation of a ruby hash is now as a doubly linked list [0]. This has inevitably caused a slight performance hit, but the benefits far outweigh the cost IMO.

[0] https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-...

* No comparison with other time periods, and their respective tuition fees.

* No comparison with other countries, and their respective policies.

* No data on where these students graduate from, or in which subjects, or with which grades, or what their average salary is X years later, or whether they'll actually be able to pay back the loan.

It's missing a huge amount of important information; you really can't justify the conclusion "tuition fees are good" from this alone.

Re:Ruby gaining a safe navigation operator: '.?' on Monday October 26, 2015 @06:18AM (#10450437)
> this would never pass a code review, the expectation of "foo?" is that it returns true/false.

95% of the time, yes. However, the "official" rule is simply that such methods must return a value that can be EVALUATED as true/false. There are plenty of methods in the ruby core/standard library which end in a "?" but do not return true/false, such as:

* File#size (http://ruby-doc.org/core-2.2.3/File.html#method-c-size-3F) returns Integer or nil.

* Integer#nonzero? (http://ruby-doc.org/core-2.2.0/Numeric.html#method-i-nonzero...) returns self or nil.

This misunderstanding of what "?" methods are allowed to return is an ongoing problem in the community, e.g. https://github.com/rails/rails/issues/20110

> According to his numbers, the mode is precisely 0.

I was referring to the fact that the graphs - e.g. https://theoverspill.files.wordpress.com/2015/10/screenshot-... - are using using mode = 0.5

I'm confused... How can the mode number of searches be 0.5?!

"More people perform half a search every day, than any other amount." -- What?!

I guess maybe that's more like "the mode over 30 days, divided by 30"?

Re:Behavioral Profiling: The password you can't change on Friday July 31, 2015 @06:06AM (#9980886)
> Fingerprints are usernames, not passwords, even if some people use them as passwords.

This doesn't make sense. You cannot "use a username as a password".

Fingerprints, retina scans, DNA samples, etc are biometric passwords. They are unique identifiers to your identification, and cannot be changed for obvious reasons.

Re:Becoming a contractor programmer in the UK on Friday July 31, 2015 @06:01AM (#9980868)
It's also worth noting that (at least in the UK) such notice periods are not legally binding.

You can only be forced to give a notice period up to your payroll pay frequency. So for example, if you get paid monthly then you cannot be sued for failing to give > 1 month's notice!

... But of course, most people will still honour their company's "3 month notice" (or whatever) period out of good faith, as it's generally a good idea not to burn bridges.

Re:Behavioral Profiling: The password you can't change on Thursday July 30, 2015 @10:02AM (#9974999)
> the claim that [...]

What are you talking about? The comment I replied to didn't make any such claims!

> passwords must be changeable

Not necessarily. What about fingerprints?

> usernames need not be changeable

Not necessarily. What about National Insurance / Social Security numbers?

Re:Behavioral Profiling: The password you can't change on Thursday July 30, 2015 @05:01AM (#9973829)
There are plenty of sites that allow you to change your username!
Re:Stop the Vertical Tab Madness (2010) on Thursday July 02, 2015 @06:08AM (#9817887)
> If I could stealthily patch the compiler for any language supporting the "\v" escape so I'd receive mail whenever it occurred in source code, then I could trace actual uses of it. I'm willing to bet that all the mail would come from beginners trying to figure out what the heck "\v" actually does, and then giving up when they realize it doesn't do anything.

Whilst it's true that I've never actually used `\v`, I have included it in code before to cover genuine, necessary edge cases... For example:

https://github.com/tom-lord/regexp-examples/blob/master/lib/...

Re:The button: social experiment driving Reddit crazy on Monday April 13, 2015 @06:24AM (#9366811)
Ohh right, so your plan would be to essentially check for third-party javascript things running on the same page?

This would be a really easy "security" measure to circumvent, though - I could literally just delete your monkey patch, for a start!

Re:The button: social experiment driving Reddit crazy on Monday April 13, 2015 @05:05AM (#9366617)
I don't know much javascript, but that looks extremely error prone to me. How would it behave in different monitor sizes? With zoomed in/out screens? On mobiles, tablets, etc?

And it would still be pretty easy for a cheating script to work cheat your validation!

Re:The button: social experiment driving Reddit crazy on Monday April 13, 2015 @05:01AM (#9366607)
Umm... What?? If you did this, then surely EVERYONE would be flagged as a cheater! Clicking the button "legitimately" would call the same function!
Re:The button: social experiment driving Reddit crazy on Monday April 13, 2015 @04:56AM (#9366594)
Here's the full (nicely formatted) source code, that I put together when the button was new and shiny:

https://gist.github.com/tom-lord/6aee965d9c6a9ca63093

How do you fix education? By fixing the poverty.

How do you fix poverty? By fixing the education.

Oh wait, hang on...

Re:Stop using tail -f (mostly) on Tuesday March 31, 2015 @04:43AM (#9295026)
You can also achieve this by doing:

tail -f whatever.log | grep --color=auto -C99 exception

And there are other ways pausing/scrolling back, such as tmux's scroll mode.

Re:Introducing Darkleaks on Sunday March 29, 2015 @03:56PM (#9286248)
Voting is not a fair analogy at all, because if you think both the main candidates are bad, you can always vote for a minor party! Sure, they almost certainly won't win, but you're sure as heck not making the situation any worse! Or in other words, there is absolutely no obligation for you to support "the system".

I see your point about taxes. However, as the old saying goes, two wrongs do not make a right. Whilst a file sharing system like Darkleaks may have some great potential, I think it is morally wrong to actively promote its use for such things as leaking celebrity sex tapes, and compromising national security.

Older »