News for hackers. Stuff that matters.

itafroma

Re:When XML Beats JSON: UI Layouts on Thursday October 31, 2019 @06:18AM (#21407201)
Yes:

    {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
            "price": {
                "type": "number",
                "multipleOf": 0.01,
                "minimum": 0
            },
            "currency": {
                "type": "string",
                "enum": ["EUR", "USD", "GBP"],
                "default": "EUR"
            }
        }
    }
> i'd also like to see "don't deliver to my house option", meaning i'll come and pick it up from a depot the same day.

This almost exists in Portland, OR at least: many items have an option for "one-day pickup": https://smile.amazon.com/gp/campus?campusId=CAMPUS_POR

I say "almost" because it's not same-day: it's overnight.

Re:Sublime Text 3 now has font ligature support on Friday October 06, 2017 @12:05AM (#15414342)
I would highly recommend James Felici's The Complete Manual of Typography. Goes through all the core concepts of typography and why they matter, and provides a number of guidelines.
Re:macOS 10.12 Sierra: The Ars Technica review on Wednesday September 21, 2016 @03:15PM (#12551312)
> Have they finally updated packages like php and ruby?

PHP:

> ▶ /usr/bin/php -v

> PHP 5.6.24 (cli) (built: Aug 8 2016 16:58:37)

> Copyright (c) 1997-2016 The PHP Group

> Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Ruby:

> ▶ /usr/bin/ruby -v

> ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

Re:Say hello to Google Allo: a smarter messaging app on Wednesday September 21, 2016 @12:34AM (#12545425)
> It has fallback to SMS functionality, but SMS apps are rejected from the Apple App store.

Which guideline are you thinking of? My search for "SMS" only found two unrelated guidelines:

> 1.1.6 False information and features, including inaccurate device data or trick/joke functionality, such as fake location trackers. Stating that the app is “for entertainment purposes” won’t overcome this guideline. Apps that enable anonymous or prank phone calls or SMS/MMS messaging will be rejected.

> 3.2.2 (iv) Collecting funds within the app for charities and fundraisers. Apps that seek to raise money for such causes must be free on the App Store and may only collect funds outside of the app, such as via Safari or SMS.

Re:Mr. Fart’s Favorite Colors on Sunday March 06, 2016 @07:55AM (#11233594)
The purpose of the signature is to establish legal solemnity, not identity or authority. It's why you can sign with just an X, and why really important contracts still need to notarized (which does establish identity).
Re:Ask HN: In a difficult situation at work. Need advice on Saturday December 26, 2015 @02:15PM (#10794901)
1. Yes, they are allowed to do that, assuming you're an at will employee with no contract that specifies otherwise.

2. I'd give notice, citing the change in performance review and withdrawal of the promotion/raise as the cause. It's one thing to work in what appear to be horrific conditions, it's another to then be retroactively denied compensation.

The main X factor is when you give notice, and that's up to you: personally, I'd probably give notice immediately and see if the company counters with an offer to reinstate what you were promised. Otherwise, start looking for another job and give notice as soon as you get an offer.

This will certainly come up during your next job interview, so you don't want to burn any bridges or get too emotional about this (even though you have the right to, for sure):

- Be calm and factual when explaining why you're giving notice, to prevent poisoning the reference: your performance review was changed after the fact, and you were denied compensation and an advancement opportunity you were previously promised. In any situation, this is a reasonable and justified reason to leave a job.

- Do not give K as your reference. Give one of your other superiors.

- When explaining why you left your previous company during interviews, you don't want to throw them under the bus. Explain that you were looking to advance and grow as a developer, but those opportunities were not available at the previous company.

Re:Ruby 2.3.0 Released on Friday December 25, 2015 @01:01PM (#10791805)
The NEWS file defines what the pragma actually is,[1], but you'd use it like so:

    # frozen_string_literal: true
    str = 'foo'
    str << 'bar'
This will now produce an error:

    # main.rb:3:in `<main>': can't modify frozen String (RuntimeError)
It's equivalent to Ruby 2.1's String#freeze:[2]

    str = 'foo'.freeze
    str << 'bar'

    # main.rb:2:in `<main>': can't modify frozen String (RuntimeError)
Except that it will affect all strings created after the pragma mark.

You can also trigger this behavior globally with the --enable=frozen-string-literal option.

[1]: https://github.com/ruby/ruby/blob/v2_3_0/NEWS#L17-L26

[2]: http://ruby-doc.org/core-2.2.3/Object.html#method-i-freeze

Re:Are My Push Notifications Driving Users Away? on Thursday November 26, 2015 @04:09PM (#10634741)
> Anyone know if they're supposed to be banned or not?

They are prohibited by App Store review guidelines 5.5 and 5.6:[1]

> 5.5 Apps that use Push Notifications to send unsolicited messages, or for the purpose of phishing or spamming will be rejected

> 5.6 Apps cannot use Push Notifications to send advertising, promotions, or direct marketing of any kind

Apple has responded positively to reports I've made regarding those guidelines, but it's hard to say how much of an effect it had. The DM push notifications I reported seemed to come out of the blue and were never repeated: the company could've been told by Apple to stop or they could've just been doing it as a test.

[1]: https://developer.apple.com/app-store/review/guidelines/#pus...

The board outlined their side in a press release shortly after Zimmer's termination: http://ir.menswearhouse.com/press-releases/detail/12/mens-we...
It seems he had a few bouts with the board about various issues and lost: http://ir.menswearhouse.com/press-releases/detail/12/mens-we...
Re:Google Launches Android Studio 2.0 on Monday November 23, 2015 @03:07PM (#10616937)
Official announcement on the Android Dev blog: http://android-developers.blogspot.com/2015/11/android-studi...
Re:Quirky has filed for bankruptcy on Wednesday September 23, 2015 @02:28AM (#10263593)
> Correction, this is chapter 11 bankruptcy. This isn't the same as standard bankruptcy. This is the same kind of bankruptcy that 50 Cent is going through. It doesn't mean you have no money, it allows you to reasses your finances and protects you.

While it's relatively common for people to associate the word "bankruptcy" with the "we ran out of money so we need to liquidate any assets we have left and walk away from our debts" (Chapter 7) or "we can't pay our debts on time so we need a payment plan" (Chapter 13) types of bankruptcy, and it is true that 50 Cent also filed a Chapter 11 bankruptcy, it's a bit disingenuous to say that it doesn't mean they don't have any money.

A Chapter 11 bankruptcy is a tool to protect a debtor's assets and give it time to come up with a plan to pay back its creditors: in this case, the plan proposed by Quirky is to sell off all of those assets at auction so that it can raise enough money to pay off its debt. The Chapter 11 filing is being used as a way to say to potential buyers "don't worry, these assets won't be taken from the company before the sale can close."

They are otherwise very much broke and are counting on the sale to raise the money to pay off their debts. If they can't sell quickly enough, it'll likely convert into a Chapter 7 bankruptcy.

Here's a good overview of what's going in: http://www.frostbrowntodd.com/resources-1562.html

Re:Show HN: HTML5 version of StarCraft on Monday September 07, 2015 @10:28AM (#10181536)
> Meanwhile, DOTA2 is a thing...

After an IP battle that was settled out of court.[1] Valve also does not use any of Blizzard's assets in Dota 2.

[1]: http://www.engadget.com/2012/05/11/blizzard-and-valve-settle...

Re:Matchstick to refund everyone's money on Monday August 03, 2015 @09:26PM (#10001087)
> will this create an expectation in Kickstarter backers that they'll always get either the product or their money back, thus creating some sort of reputational debt-slavery for the project creators who genuinely just use up the money and fail?

Hyperbolic imagery aside, the expectation is already there. They can't just walk away from the project with a shrug should it fail: they have a contractual obligation to demonstrate that they did not squander their funds and to provide the best possible outcome to their backers. If they fail to do that, the terms of the agreement allow backers to seek legal action:

> The creator is solely responsible for fulfilling the promises made in their project. If they’re unable to satisfy the terms of this agreement, they may be subject to legal action by backers.

In this case, Matchstick's project creators have assessed that they have enough money to pay everyone back, so they're doing exactly what the terms of the Kickstarter agreement between backers and project owners have obligated them to do: provide the best possible resolution to backers by, in part, returning the money.

Another project may determine that they can't pay everyone back: in that case, they're subject to the requirement that they "demonstrate that they’ve used funds appropriately and made every reasonable effort to complete the project as promised". If they can't do that to the satisfaction of every backer, they're still on the hook. That's why a lot of times, project failures will have a note about providing a refund to anyone who requests one instead of Matchstick's strategy of proactively refunding everyone.

Re:Matchstick to refund everyone's money on Monday August 03, 2015 @08:09PM (#10000818)
> Will other projects feel pressure to refund if they don't pan out?

They should as it's one of the remedies Kickstarter requires projects to pursue should they be unable to complete the project and fulfill the rewards:[1]

> If a creator is unable to complete their project and fulfill rewards, they’ve failed to live up to the basic obligations of this agreement. To right this, they must make every reasonable effort to find another way of bringing the project to the best possible conclusion for backers. A creator in this position has only remedied the situation and met their obligations to backers if:

> [other required remedies]

> * they offer to return any remaining funds to backers who have not received their reward (in proportion to the amounts pledged), or else explain how those funds will be used to complete the project in some alternate form.

[1]: https://www.kickstarter.com/terms-of-use#backer-creator

Re:Linux 4.0 on Sunday April 12, 2015 @10:30PM (#9365663)
For those confused about the codename, it's explained in this post by Linus: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g...

> .. after extensive statistical analysis of my G+ polling, I've come to the inescapable conclusion that internet polls are bad.

> Big surprise.

> But "Hurr durr I'ma sheep" trounced "I like online polls" by a 62-to-38% margin, in a poll that people weren't even supposed to participate in. Who can argue with solid numbers like that? 5,796 votes from people who can't even follow the most basic directions?

Re:Google Moderator is shutting down on June 30, 2015 on Tuesday April 07, 2015 @01:24PM (#9335594)
The one person I saw using it, at least when it was relatively new, was Matt Cutts to organize the questions asked for the daily Google Webmasters videos. Though those seemed to have died out almost a year ago, and they had moved to the Product Forums by then anyway.
Re:Things you should know about PHP 7 on Friday March 27, 2015 @12:06AM (#9274696)
> A lot? Please stop spreading wrong info. In the words of an internal developer,

You may disagree with me saying "a lot", and that's fair, but I don't think it's fair to say it's "wrong info" and NikiC's characterization that it has "no direct effect on userland devs" is disingenuous, given the RFC lists several changes to syntax and behavior: https://wiki.php.net/rfc/abstract_syntax_tree#changes_to_syn...

Re:Things you should know about PHP 7 on Thursday March 26, 2015 @04:52PM (#9273014)
> Maybe there seem to be some alternatives?

This is not meant to be an endorsement of this method, but PHP <7.0 uses a single-pass compilation where the parser itself does the opcode compilation. A lot of the buggy and quirky behavior PHP exhibits (at least when that behavior is unintentional) is the result of this process.

Like a lot of extant PHP, there's no real reason it was done this way: it's just the method Rasmus et al happened to program the original engine, and it's grown organically since then. With the AST, phpng, and the uniform variable syntax, I'd argue PHP7's main feature is finally getting around to correcting the sins of the past.

Re:Things you should know about PHP 7 on Thursday March 26, 2015 @02:31PM (#9272038)
> I feel like I want to test what happens if you put values like "", false, " ", 0, an empty array, etc etc etc in front of ??.

All of those would result in the variable being assigned those values: the null check uses the same semantics as is_null(), and the truth table for those values is:

    $v     is_null($v)
    ------------------
    ''     FALSE
    false  FALSE
    ' '    FALSE
    0      FALSE
    []     FALSE
If you want to all falsy values to use the fallback value, use the shorthand ternary operator (?:) instead.
Re:Things you should know about PHP 7 on Thursday March 26, 2015 @10:45AM (#9269953)
Note this is just Zend's take on what's important in PHP 7: it's not a complete list.

A more comprehensive list:

- Dual-mode scalar type hints (weak by default, toggleable to strict via a per-file syntax) (https://wiki.php.net/rfc/scalar_type_hints_v5)

- Return type declarations (https://wiki.php.net/rfc/return_types)

- <=> operator (https://wiki.php.net/rfc/combined-comparison-operator)

- Null coalesce operator (??) (https://wiki.php.net/rfc/isset_ternary)

- Closure::call (https://wiki.php.net/rfc/closure_apply)

- Abstract syntax tree (https://wiki.php.net/rfc/abstract_syntax_tree)

- Context sensitive lexer, allowing the use of reserved words in more places (https://wiki.php.net/rfc/context_sensitive_lexer)

- Unicode escape syntax in strings (https://wiki.php.net/rfc/unicode_escape)

- A uniform variable syntax (https://wiki.php.net/rfc/uniform_variable_syntax)

- Expectations (https://wiki.php.net/rfc/expectations)

- Use declaration grouping (https://wiki.php.net/rfc/group_use_declarations)

- Removal of a ton of long-deprecated features

- Massive speed improvements

You can see everything that's been added to PHP 7 on https://wiki.php.net/rfc (look under Accepted and Implemented - PHP 7.0)

Re:Why the snow forecast for New York City was so bad on Tuesday January 27, 2015 @02:32PM (#8955150)
> but they aren't going to like hearing forecasts of 2-16 inches.

The NWS provides probabilistic accumulation guidance: http://www.wpc.ncep.noaa.gov/pwpf/wwd_accum_probs.php?fpd=48...

Similar to what this article suggests in its postscript, you wouldn't have to merely say 2-16 inches. Instead, you could say, "there's a 50% chance it'll be between 4-6 inches, and a 15% chance it'll be between 14-16."

I kept my profile there for a while from 2011-2012 and at the time I didn't get any leads. When I actively searched for job postings there, they mostly seemed to be within a few core areas, usually aligning with the same things Stack Overflow proper has a lot of activity in: .NET, enterprise Java, etc.

As a web developer working in stuff like PHP or Ruby, I just chalked it up to me being in the wrong venue. Over time, I've gotten better leads and interviews from stuff like We Work Remotely and even Indeed. From my experience, the stuff SO Careers was optimizing for and prioritizing on profile pages wasn't really important for landing an interview request.

All that said, a lot can change in 2 years and it seems SO Careers's success somewhat speaks for itself.

Re:Sony Got Hacked Hard: What We Know and Don't Know So Far on Thursday December 04, 2014 @04:38AM (#8698520)
> It's Sony Pictures Entertainment that got hacked, not Sony. They're completely separate companies, yet the media fails to recognize that.

Sony is a very large conglomerate: while it would be incorrect to say that, say, Sony Computer Entertainment (the subsidiary that runs Sony's video games operations) got hacked, Sony Pictures Entertainment is a wholly-owned subsidiary of Sony Entertainment, Inc., which is itself a wholly-owned subsidiary of Sony Corporation.[1] It's as much "Sony" as any of its other subsidiaries.

[1]: http://www.sonypictures.com/corp/aboutsonypictures.html

Re:The dark side of .io on Tuesday November 11, 2014 @05:28AM (#8589187)
> Meanwhile, Palestine is still a colony of Israel but hey they don't have a nice TLD so who bothers.

The relationship between Palestine and the IANA is not very similar to .io and the Chagossians. Palestine has two TLDs—.ps and .فلسطين—that are managed by a Palestinian—not Israeli—naming authority, PNINA. As such, using the Palestinian TLD is considered[1] a mark of solidarity with the concept of a Palestinian state, not a reminder of, or the exploitation of, a forced exile.

[1]: http://www.pnina.ps/domains/

> Non-citizens, too?

The general rule is that anyone, citizen and non-citizen, can make a FOIA request.[1] However, the law as interpreted by the Supreme Court only provides a guarantee to open access for US citizens when making a request of a federal agency. For requests of a state agency, only US citizens residing in that state are guaranteed open access.[2]

[1]: http://www.foia.gov/faq.html#who

[2]: https://www.eff.org/deeplinks/2013/05/scotus-foils-foia-advo...

Re:The oldest .com domain names on Thursday October 09, 2014 @02:49PM (#8434368)
> I find adobe.com really interesting. What were they doing back then?

Adobe was founded by ex-Xerox PARC employees, so perhaps not surprisingly their first couple of successes were printing related: PostScript and Type 1 fonts in 1982 and 1984, respectively. By 1986 they were working in desktop publishing with the development of Illustrator.

Older »