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

Hardly shorter than just writing the for loop, i.e. the example in python

    groupByAge = collections.defaultdict(list)

    for person in people:
        groupByAge[person["age"]].append(person)


In JS you would also need to check if the key exists first (so you can add it). I think the minimal example would be:

    const groupByAge = {}
    for (const person in people) {
      if (!groupByAge[person.age]) {
        groupByAge[person.age] = []
      }
      groupByAge[person.age].push(person)
    }
IMO it is a very nice change to now be able to write:

    const groupByAge = people.groupBy(p => p.age)


A reduce version seems quite okay to me though, and keeps it pretty functional-styled.

    const groupByAge = people.reduce((previous, current) => {
      if (!previous[current.age]) previous[current.age] = []
      previous[current.age].push(current)
      return previous
    }, {})


Would be more interesting to see i3 vs sway.


I found Nim's gorge command really useful. It runs a command at compile time and stores the output in a variable, so you can simply do things like:

    const compile_version = gorge "git describe --tags --always --dirty"
    const compile_time = gorge "date --rfc-3339=seconds"


That is very nice, thank you for sharing


So simply compiling code could execute any random code? How is that safe?


It is the normal way of the world. Makefiles are arbitrary code execution. 'build.rs' in rust is the same. npm's package.json has an install script.

Often this arbitrary code is to do things like run "pkg-config --libs" or such to find dependencies to link against, or generate some files that shouldn't be checked into source code, but rarely does it have sandboxing or other restrictions.

Languages, like Go, which don't let a package execute arbitrary code on installation are the exception.


What do you normally do with code after you compile it?


It's never safe to compile code, of course it can execute any random code, otherwise it would be useless...


It's true that most languages's build systems (nim, rust, autotools, makefiles, etc) are unsafe to execute if you do not trust them.

Go does stand in contrast to this. `go get` and `go build` cannot execute arbitrary code, and if you use those two commands to build untrusted code, in theory your machine should still remain uncompromised. They release CVEs for any issues here (such as https://github.com/golang/go/issues/29231).

Of course, if you run the code you compiled, that is unsafe, but just compiling it is supposed to be fine.


> Surprisingly, there isn't a headphone jack, which seems like something Fairphone's demographic would really have wanted. Wired headphones last indefinitely, while Bluetooth buds turn into garbage after a few years when the batteries die.

Every wired headphones I've had started to break down after a year or so, including ones with a detachable cable.

BT headphones are much more reliable. If you buy something like the Sony's you can probably get replacement batteries.


That is... Unique experience.

I have two pairs of 15y sennheiser that are pristine and used all the time. And they seamlessly plug into any audio device I own or my friends do, are never out of charge, and I can listen with two headphones from one tablet when wife and I watch a movie on airplane or tent with kids.

Bluetooth will sooner or later loose battery - never mind the lag of 15y old Bluetooth standard.


Haha, I was just about to reply to the parent with "sounds like you should spend the extra cash on a pair of sennheisers that will last you the rest of your life" when I saw you'd done it for me.


Sounds like you've been getting cheap headphones. Bluetooth headphones are inherently less reliable due to far more points of failure.

You say you can "probably" get replacement batteries but we've already seen that it's damn near impossible to source the tiny batteries for things like true wireless earbuds.


> Bluetooth headphones are inherently less reliable due to far more points of failure.

Really? They seem to have less points of failure to me - they're fully encapsulated (usually glued shut) and don't have to physically interface with anything less than simple metal charging pads. Compared to physically being shoved into something and yanked out and a cable that is being manipulated.


> They seem to have less points of failure to me - they're fully encapsulated (usually glued shut)

This just means they're harder to repair? That's not a reduced point of failure in really any sense.

Wired headphones are some wires, solder, also often glue, and a driver. Wireless headphones have batteries, internal computers that need to communicate wirelessly with devices and - in the case of True Wireless Earbuds - themselves, and in general more parts that are more delicate crammed into the same or smaller space.

> don't have to physically interface with anything less than simple metal charging pads. Compared to physically being shoved into something and yanked out and a cable that is being manipulated.

What a strange point. Unless you're wirelessly charging some AirPods then... You're gonna have to charge those things with a physical cable. That will have to be, as you so hyperbolically put it, "shoved into something and yanked out."

Fortunately, any decent headphones worth your money anticipate such rude treatment and have their cables be easily replaceable.

Wireless headphones can't be said to do the same for their batteries that will inevitably wear out.


I don't know if maybe you don't use Bluetooth headphones, but no they don't have a physical cable you plug in. They do it wirelessly and with pad contacts.


Maybe they were saying the case needs a charging cable unless you do wireless charging?


And what are those pad contacts in? A charging case. Which needs to be charged via physical cable.


Software, batteries, and the bluetooth comm protocol are three giant points of failure. An example, I can no longer use my car's (2012) bluetooth with any modern device. At least, it is horribally laggy and doesn't display data, when it works.

Points of failure on wired buds are the cord and connector construction and materials. So you can generally know the "more you spend", it's likely being put into the construction (for reputable brands).


software is a point of failure :) also, batteries


Looks like durability is exactly the reason, though not necessarily of the headphones, but of the phone itself:

> A notable downside compared to previous Fairphones is that the Fairphone 4 no longer includes a 3.5mm headphone jack, a choice that feels at odds with the company’s otherwise customer-first approach. Fairphone tells me it made this decision in order to be able to offer an official IP rating for dust and water resistance, which was missing from the company’s previous phones. It’s only IP54, which means it’s protected from light splashes rather than full submersion, but that’s impressive in light of its removable rear cover and modular design.

https://www.theverge.com/2021/9/30/22700014/fairphone-4-rele...


Interesting because my Samsung Galaxy S5 has a rating of IP67, and it has a 3.5mm jack.


I think that's why the quote ends with

> that’s impressive in light of its removable rear cover and modular design.


Fairphone says it had to nix the jack to get IP54. If another phone can include the jack and get a much better rating, it goes to show that Fairphone is not telling the whole story. The 3.5mm jack was nixed for reasons other than IP rating.


I feel like I'm just restating my parent comment, but Fairphone has the rating while being user-repairable. Not being glued shut is what makes it more challenging to get that rating, as I understand it.

(In the live stream they also mentioned that a headphone jack would make the phone bigger still. And also that they had a lot of back-and-forth on it - I don't know why you would attribute this to malice rather than a balancing of constraints.)


> I feel like I'm just restating my parent comment

Because you are not listening that it is only about the 3.5mm jack. If they can do a USB-C port, they can do a 3.5mm jack. A USB-C is quite a bit more difficult to deal with than a 3.5mm jack.

> but Fairphone has the rating while being user-repairable. Not being glued shut is what makes it more challenging to get that rating, as I understand it.

What does that have to do with dropping the 3.5mm jack? There are other holes which present the same problem as the 3.5mm jack.

> (In the live stream they also mentioned that a headphone jack would make the phone bigger still.

Making the phone bigger would give them space to add seals to keep stuff out. See, nothing to do with the IP rating.

> I don't know why you would attribute this to malice rather than a balancing of constraints.)

Attributing it to "reasons other than IP rating" is not attributing it to malice. It was pretty clear it was more about making it thinner like every other phone and not IP rating.


It was "not telling the whole story" that sounded like attributing it to malice, but if you meant that part of the reason was making the phone smaller than I agree.

I imagine (but know little to nothing about these ratings) that the more holes and crevices there are, the harder it is to be water and dust resistant. Modularity and the USB port add these, the jack might have pushed it over the limit, and when forced to choose between those three, the jack seems to me to be the sensible one to sacrifice. Still a shame, of course.


Can you easily disassemble the Samsung Galaxy S5?


I have a Samsung XCover Pro - it has a removable back, physical buttons, an impressive replaceable battery, a headphone jack... and an IP68 rating.

It's probably not as repairable as the the fairphone, but clearly it's possible to be waterproof with a removable back/battery and a jack.


I'd imagine a little glue helps ;)


It was very easy to take apart as it just used same size Philips screws.

Replacing cracked glass was hard as you had to soften glue and required a uv curing glue to attach the replacement, but would assume the fairphone treats the digitizer screen and front glass as a single replacement assembly also.


So a headphone jack is an ingress point, but the charging jack isn't?


It's not that they can't seal an ingress point so much as that every one they do adds cost and complexity.


The phone is already wildly overpriced as is for its specs. By default your market is already restricted to niche enthusiasts. Sacrifices like this make zero sense once you're already at this stage.

"The most fair-trade and repairable phone you can't plug headphones into" isn't the nicest selling point.


Had this problem woth headphones, but not earbuds.

I now only buy headphones with replaceable cables to avoid this problem


"BT headphones are much more reliable. If you buy something like the Sony's you can probably get replacement batteries."

I don't think I've read many comments as airy as this one. You can't get replacement batteries.

I have a pair of bose wired earbuds from 2013 maybe that still look brand new and the quality blows me away. Literal plug and play.And the type of wire somehow never catches/jumbles/splits etc.

In thatsame time I've had at least 5 pairs of bluetooth buds and over ears 9that I can think of). sony, sennheiser, jabra, and some amazon brands.

The user experience is different for every one, random buttons, different time to sync, etc. Hundreds of dollars wasted, largely due to battery degradation or one of the buds straight up not working. There's no reason why batteries in bluetooth modules can't be consumer replaced besides planned obsolescence.


No headphone jack doesn't imply wireless headphones. On my Xiaomi Mi 9 SE I just had to use a USB-C to jack dongle.


interesting, I didn't realize usb-c supports digital and analog audio signals. kind of neat


I wouldn't get too excited. my pixel 2 came with a headphone jack dongle. the audio quality was not great, and according to forums I read at the time, that OEM dongle was actually one of the better ones.

to be fair, I believe that was an actual DAC in the dongle. I suppose in theory you might get better quality with analog passthrough from an onboard DAC. I doubt anyone other than apple would bother putting a decent DAC in a phone with no headphone jack though.


Supporting analog audio out over USB-C is definitely something that varies from device to device. Some adapters are passive requiring the device to send analog signals or some devices can be active in which they have their own DAC and expect a digital signal. Some devices will have their own DAC on board and can support a passive device, some devices do not have one and will require an active adapter.

Generally speaking, you'll probably have more success with active (DAC-based) USB-C to 3.5mm adapters.


They don't support analogue audio signals - USB is a digital interface - you use a DAC to convert the digital audio signal to analogue.


USB-C absolutely supports analog audio signaling, it's called "Audio Accessory Mode" in the standard.


this is incorrect, look at the spec. I would not have commented something like that unless I verified it first


The new gen yes, but old gen jacked products in my mother living room are still kicking.

Granted, they were never attached to a mobile device, which wears the cable.


> Every wired headphones I've had started to break down after a year or so, including ones with a detachable cable.

To counter your anecdotal evidence, let me offer mine.

My AKGs are almost 20 years old now. I only had to relpace the plug once which was a cheap repair I could do myself.


I use the $7 to $10 Panasonic HT21 for many years at a time, for the past 15 years.


I have been using my Bose bt headphones for 3 years now and they still seem as good as the day I got them. No noticeable battery issues.


I have wired studio headphones for 20 years.


They chose that path because it enabled them to be water proof and still user repairable.

Also, for a less bulky design.


You're buying bad headphones then. The industry pros have been using wired headphones for decades and they've been incredibly reliable.


My focal headphones have the best of both worlds, Bluetooth aptx, but also a cable you can attach to use them as normal analogue headphones.


Yeah I've been using a pair of Audio-Technica that have both and I've enjoyed them a lot. I see no reason to upgrade.


Unfortunately, a CS PhD doesn't even guarantee mediocrity.


I have a Huawei matebook x pro and I would highly recommend it. Great build quality and 3:2 screen.


> I see all these calls for "cancel rent", as if housing grows on trees and landlords are all some kind of Ebenezer stereotype, instead of being a lot of small-time folk just trying to get by.

So letting property should just be risk-free profit? Being a landlord is a business and businesses fail all the time.


I think the idea is that landlords did accept a risk that if tenants did not pay they would have the legal remedy to evict them.

It was the government that took away their legal remedy without any due process.

Comparing it to any other business, imagine the government coming in and saying you will continue having to operate your business but your customers no longer have to pay.


Businesses fail all the time, even though other kinds of businesses aren't required to keep providing products/services to people who stopped paying for them.


Where did you get that from?


I guess a drone can just land on a roof (or even street-level)?

Basically a battery powered camera that can be deployed very quickly to an area of interest.


I get "We were unfortunately unable to place the cookie that is necessary for the use of our site. Is your computer connected to the internet through a company network? We recommend that you ask your IT department for an exception for DER SPIEGEL content. Have you configured a browser extension or the browser itself such that cookies are blocked? Please add DER SPIEGEL to your list of exceptions. Should you continue to have problems, you can find more information here."

I only have ublock origin and a minimum of config changes.




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

Search: