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

An interesting feature of ribbon mics - because the ribbon is open at the front and the back, they reject sound from the side (and top/bottom) almost perfectly. You can arrange these cleverly in live or studio settings to amplify one thing while rejecting another completely.

A typical usecase for this is a singer with an acoustic guitar - one mic can pick up the guitar and almost fully reject the vocals, and vice-versa. Pretty cool.


Generally these are only used in test methods, which is fine. I've never seen anyone use them outside that.


What benefit do they provide in testing scenarios? I've never written Kotlin, but from an outsider's perspective, it seems like a slim benefit, outweighed by the cost of the mere existence of this syntactical oddity in the language's grammar.


When writing tests, you can name the methods more useful things, such as:

  class MyTestableClass {
    fun `methodName - when input does not parse to valid regex throw exception`() {

    }
  }
It's pretty clear what is under test in a situation like that. That's basically the only situation I ever see it used in (and would code-smell the heck out of it if I saw it in other circumstances).

People who are familiar with RSpec-style testing are very used to this sort of thing.

  describe MyTestableClass do
    context 'input parsing issues' do
      context 'when not valid regex' do
        it 'throws exception' do
          ...
        end
      end
    end
  end
Anecdotally, I've also found that such style naming for tests allows me to write out the desired names for all the tests ahead of time more easily and then implement them. That happens to be my flow.


methodName_whenInputDoesNotParseToValidRegexThrowException

They did a study and it isn't hard to read camelCase. https://ieeexplore.ieee.org/document/5090039


This study only compared camelCase to snake_case and what the results are mixed, depends on what you call "hard to read". They only seem to have tested finding identifiers from a word cloud, and it did take more time to read camelCase identifiers (although they were also resulted in more accuracy).

It's important to note that the researchers only tested short phrases with 2 and 3 words. "getNextPath" is a different beast compared to "methodName_whenInputDoesNotParseToValidRegexThrowException".

On the other hand, there is a good body of research that generally shows that proper sentences (not just 2-3 words) without spaces are harder to read, at least for English speakers[1]. Early medieval Latin manuscripts did not use space between words[2]. The fact that spaces were seen as an improvement when they were introduced, is probably telling.

[1] https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=unsp...

[2] Roman-era inscriptions did use an interpunct (a small middle dot) to separate words, but this practice fell out of fashion in Late Antiquity and Early Middle Ages and I'm not sure if it was ever the norm in handwriting.


From experience CI test reports are vastly more comprehensible at a glance.

That study compared camel case to underscore spaces. Well underscore space is still not as readable as methods with spaces and dashes.


Sure, but I like writing the other more. It's entirely a style thing and you're not required to do it :) it's also basically only ever seen in tests :)


I mean, it's harder to read compared to normal text with spaces and punctuation.


That doesn’t seem to be the case based on the study. And normal for one thing, such as paragraphs of prose, might not translate to another thing, such as a sequence of words in a line of code.


That’s just one study, and I’d argue we should write books in camel case to make them more compact if there’s truly no difference.


> That doesn’t seem to be the case based on the study.

The study does not say that camelCase is unequivocally as easy, or easier, to read.

Selecting the correct identifier from a list of 2-3 words (expandAliasTable, expandAliasTitle, etc.) is a wholly different exercise.


Ah thank you for actually reading the referenced study


I like how tests are made in Python - you don't even need classes, just functions, and use a single assert keyword for everything. Also it's easy to parametrize them using decorators.


Parameterized tests in Junit are basically the same as decorators:

    @ParameterizedTest
    @ValueSource(strings = {"first", "second"})
    void fooGoesBar(String param) {
        ...
    }
Also, once you get used to assertj, you'll never want single-assert again. It's fantastically useful to know (for example) not just that two lists aren't equal, but specifically what elements differ.


> It's fantastically useful to know (for example) not just that two lists aren't equal, but specifically what elements differ.

Pytest shows the diff as well when using assert:

    >       assert y == x
    E       assert [1, 2, 3] == [1, 4, 3, 6]
    E         
    E          At index 1 diff: 2 != 4
    E         Right contains one more item: 6
    E         Use -v to get more diff


Great, what's the equivalent of this?

    assertThat(someCollection).map(Thing::getValue).containsExactlyInAnyOrder(3, 4, 5);


If the list contains numbers or strings, you can use

    assert sorted(x) == sorted(y)
If you want to add map, then you have to write

    assert list(sorted(i.getValue() for i in someCollection)) == [3, 4, 5]
If the list contains non-sortable values, but they are hashable and unique, you can use sets:

    assert set(x) == set(y)
If the values are not unique, but hashable, you can use a counter (like a set but with count for repeating values):

    assert Counter(x) == Counter(y)
(by the way I learned about this trick from a LLM)

And if the values are neither sortable, nor hashable, you'll have to write a helper function.

But still, pytest tests are less wordy and they don't require you to create a class.

This situation is familiar to me, I had to write such helper function when writing tests in PHP, for some reason it is not included in PHPUnit assertions.


Parameterized tests are a huge, huge win, yeah. I am a big fan of them and look for how to do them in every test framework I use. RSpec was the weirdest for me; but NUnit and JUnit have been quite easy, and I'm not surprised at all they're easy in Python too (admittedly, I don't remember if I ever wrote them in that language).


In the RSpec case, those don't have to translate to method names with embedded spaces. It seems that using fun `...` instead of a dsl: test "..." is the mistake.


It's a place to put intetion that isn't so much of a second class citizen that it will likely be ignored and/or not updated if it ceases to be true. You want your test methods fine grained (many methods that each check one variation, instead of one method that checks a whole list of them) and every extra redundancy (method naming vs the variation of data actually passed vs documentation) increases the the chance of those redundancies getting out of sync.

In fact I've occasionally found myself writing reflection code to parse the test method name as input just to avoid that problem altogether (for name and data, not for documentation). And that was in plain Java even, the pattern could be far more useful with that kotlin naming freedom.


It reminds me of Spock tests written in Groovy. I have to help maintain a code base like that now at work where a Groovy zealot (who has moved on) convinced the teams to write tests in Groovy instead of Java.

When a test fails, the method name describes what it was supposed to do written out like a sentence enclosed in double quotes which seems like a win but not much of one.

When you need to add a new test or analyze if an existing test needs to be changed, you have to eyeball all the code in the test class because even with methods named with spaces, it's not always indicative of what it does.

With Java, I can sort a list of method names and have a better idea immediately what needs to be updated or added.


Spock is an exercise in syntax cleverness with regular confusion opportunity and little gain IMO. Way too much implicit syntax that IDEs struggle with.

Refactoring Spock tests sucks due to how the context is different based on the clause you’re in.


The test frameworks typically output the passing/failing function names. Adding spaces like this make them more human readable.

expectInternalServerErrorOnBadInput

Vs

expect internal server error on bad input


Isn't this breaking Jakob's law of the rest of the tooling though? I can se flows borking with something like "x failed at expect" in a majority of reporting tools not specifically meant to deal with this spaces in functions stuff.


Not really—-most CI reporting is based off junit/testng report XML files. I doubt your CI reporting is parsing out test names with regexes out of log files.


It’s better to quote a reserved word than to be unable to use it.


So that programmers have one more bikesheddibg reason, obviously.


One thing that I found super interesting when I studied audio engineering is that our ears are very good at determining direction left/right, but absolutely hopeless at working out if a sound is up or down.

This makes their hypothesis a lot more believable to me; I can understand others incredulity.


> absolutely hopeless at working out if a sound is up or down

Easy, just turn your head to the side :P


Someone failed highschool chemistry. More gas can dissolve in cold water vs hot. The opposite of solids.


you know what, i did


Yeah this is standard practise in the UK armed forces/EOD teams. Source: spent time with No. 5131 Squadron in Akrotiri.


Oh the nice folks with the RC-135s!


You mean Squadron No. .131 no? /s


Five frei!


> I can’t think of any other place where people’s sense of net worth is as tied up with their house price as it is in the UK, while at the same time the increase in house price that people have been conditioned to believe is the norm over the last decade is wholly unsustainable given the stagnant wages.

Canada.


Also Australia. Property is king.


Also New Zealand. Surprise! It's a global phenomenon where governments across the world have done everything to ensure housing is the safest investment there can be. As prices go up up up those with, gain, and those without are left paying outrageous sums for rent to pay for someone else's higher and higher mortgage prices.


Interestingly you guys successfully listed up Five Eyes.


Interestingly they listed up the foremost five Western Anglo countries, which are bound to be extremely overrepresented on HN.

Or maybe not so interestingly.


More like 5 nations with housing crises, am I right?


No its a 5 eyes psychological warfare program based on Maslows Hierarchy of Needs.

So shelter is an essential base layer, and by promoting home ownership, banks are now being used to mess people around if they get out of line in a deniable ops way. If you cant even afford a home, you have that psychological inferiority put on you by only being able to rent.

The state is always looking to reduce costs because it can claim to be a low taxation nation, and in reality prisons cost alot, so rather than feel the long arm of the law and end up in prison with todays global technology and ability to look anyone up, causing trouble in peoples home life is now the 5 eyes modus operandi.

All sorts of low level stuff going wrong designed to keep a individual busy rectifying said problem, whilst also getting flack from those around them.

Its thought people will fight/work harder trying to maintain their home and their life and their families life, so all sorts of low level bad things will happen to an individual or household.

Its actually quite nasty some of the things that get done to people, but its always in a deniable way, made to look like incompetence or bad luck, and thats hard to prove because of the way society works. You couldnt tell if a washing machine engineer has deliberately sabotaged your washing machine in a planned obsolesce way or not, but the military leak rumours about people and then people take it upon themselves to contribute to that harassment and intimidation.

Things like reddit malicious compliance can give you a taster of some of the things people choose to engage in, but others will take it to the next level which puts peoples lives at risk. Ultimately its called Karma, but the military will pursue you around the country so you even get hassled on holiday.

This is a list of some of the things thats been done to me. Stopped by the side of a busy road, engaged in conversation and casually positioned so my back is to the road before individual did something to make me step back into the road in front of moving traffic. Its a high curb so I would have fallen backwards into the road.

Head (nose) shot by someone using a silenced snipered rifle whilst walking my dog around a footpath in a farm.

Ex directory, countless unknown numbers, international numbered phone calls or call centres. Got a new phone line put in, and started to get the same on that number even though I'd only given the number out to one car dealership.

Hassled when holidaying in various places of the UK.

Post going missing.

Arrow fired into garden, drones flown into garden.

Someone filing tax returns for me, when I havent.

1mm diameter x 25-30mm long metal added to takeaway kebabs designed to get lodged in the throat, or do damage to the inside of you mouth.

Someone release a small deer in front of the car on an unlit section of dual carriage. Person was hiding behind the armco barrier that makes the central reservation and was trying to cause me to swerve and crash.

Over powered cars pulling out to over take forcing me into the verge to avoid a head on crash.

NHS claiming letters lost in the post. Fake stuff added to doctors notes, creating fictional events.

Courts claiming letters lost in the post in a bid to secure a conviction in my absence for speeding.

Countless malware forcing me out of business.

Program code being changed so my own software stops working.

GCSE Exam results marked down, A-level courses getting messed around with making it untenable to study.

Been drugged in social and home settings, and had things done to me.

You'll literally get driven to suicide but the ambulance staff will resuscitate you, for more of the same.

Reported to police, police not interested!

All of this has taken place in the UK. The people behind it are in a position to deny their activity as they automatically have more authority than I would have in court. It also coerces you to get more security, like cctv fitted inside the home and office which enables greater surveillance which is what the spooks want.


Regularly donating blood or plasma can reduce PFAS concentrations in the body, I believe the effect is the same on microplastics https://theconversation.com/new-evidence-shows-blood-or-plas...


Super interesting. But is the blood then cleaned of them, or is this kind of like giving your plastics to someone else? :/


If I was in a need of a blood transfusion I think I’m OK with there being a normal amount of nanoplastics in them.


nit, but this is usually accomplished with plasma donation (plasmapheresis) rather than blood donation. You can donate plasma much more frequently (2x/week) vs blood (once per 2 months), thought the volume taken for each is roughly similar.


The filters used must be a specific size, so how micro, are micro plastics? If they keep breaking into smaller pieces, wouldn't they be cell sized too? And thus, pass cell sized filters?


They don't filter the plasma, they remove it and replace with some other substance depending in your condition and risk profile.


You have to filter whole blood, to get plasma.


So you filter out the blood cells (45% of volume), toss the plasma (55% of volume) and return blood cells + clean plasma. Any substances the plasma are gone. So this is useful to the extent that the substances you care about are free in plasma. At least in the case of PFAS ("forever chemicals") that seems to be the case, see "Effect of Plasma and Blood Donations on Levels of Perfluoroalkyl and Polyfluoroalkyl Substances in Firefighters in Australia", which found that 52 weeks of plasma donation reduced PFAS blood levels by ~30%. This was more effective than blood donation, which reduced levels by 10% and 0% depending on the specific substances you look at.

https://jamanetwork.com/journals/jamanetworkopen/fullarticle...


If there are microplastics the size of blood cells (this is a range, as cells are differing sizes), how do you filter for blood cells only?

You can dual filter, smaller and larger than, but you'd still have plastics.


Ah, I see, sorry for missing your point. In the paper they injected particles of size "9.55 µm, 1.14 µm, 0.293 µm", and it looks like a red blood cell is 8um. So a purely mechanical filter that got red blood cells would retain the largest of those particles but potentially not the rest. But plasmapheresis uses a combination of centrifugal separation and filters so may be more or less effective than that depending on the properties of the cells and plastics.


Ah! I was not aware that more than filters were being used. This could certainly help.

Thanks


If I was in a situation where I needed emergency blood, the level of microplastics in it is the least of my concerns.


“Excuse me, did this blood come from a vegan? I couldn’t possibly accept blood that isn’t 100% organic, free range, and —-“ (transcript ends, patient died)


The only feasible way I see for removal is via donation or some form of hemodialysis. As the saying goes, the solution for pollution is dilution (or at least in the medical sense!)


This comes up time and time again. I'd feel worse giving someone else toxic blood that can't be fully filtered.

Why isn't blood letting mentioned more?


You don't need to feel guilty. Microplastics are pervasive to the point where everybody already has them in their blood, so people receiving blood with them in it are getting any noticeably net harm done to them. If you're in need of a blood transfusion the alternative is usually death, so all things considering maintaining the status quo of microplastic levels already in you isn't the worst thing ever.


Or get a shit ton of labs done


How about regular whole blood donations?


You mean bloodletting, because you can't use the blood for others.


I don't think anyone would mind taking on some pfas or microplastics from a donor if they're about to bleed out. There are always priorities.


Especially since we all have PFAS and microplastics in us at this point. There is no PFAS- and microplastics-free blood.


If all donated blood was screened for trace microplastics, I think we’d have an immediate and total donor blood shortage.


You can set a custom filter in uBlock Origin to do this for you - here's an example filtering out Pinterest garbage:

google.##.g:has(a[href=".pinterest."]) google.##a[href=".pinterest."]:nth-ancestor(1)

https://awesometoast.com/argh-stop-the-pinterest-results/


Pinterest is an odd case. It's not quite like usual SEO spam because it's immensely useful for what it is (collecting images and links while planning stuff, art references, etc). But then they use whatever sneaky tactics they use to flood search, so people who aren't Pinterest users think it's garbage. Pinterest probably doesn't need to do this to rank highly since it's actually useful. I don't know what they're thinking.


During the outbreak of the Ukraine war, this role was taken up by Twitter Spaces.


Twitter Spaces... perhaps for people in the West with intellectual curiosity about the play by play.

For people on the ground it was Telegram groups and channels. "TG" is huge in Russia, Ukraine and Belarus.


It's really odd that people on HN see the world as west vs. Slavic countries.

The world is MUCH bigger than that, and telegram has much wider spread than that. But yes, twitter spaces is tiny fringe space even in the "west"(a term that always bothered me given how the world is round, and how Australia, New Zealand, and Japan are somehow part of "the West").


For what it's worth, when I hear "the West" I think of what would on a global, historical scale be known as the "far west", i.e. mainly north and western Europe. (The "near west" would be the cultures just to the east of the Mediterranean, I suppose.)

I would never bunch Oceanic or Asian cultures in there.

I'm surprised to hear other people use it in a broader sense. At some point one is talking about cultures that are so different it's no longer meaningful to generalise across them.


in political context, "the West" is referring to the concept of "Western democracies"


I suppose that's because they are heavily influenced by western European countries. Two of the countries you mentioned are part of the British Commonwealth.


> British Commonwealth.

Does that make India and Nigeria part of the West? Also, Commonwealth of Nations is the preferred contemporary term.


Nigeria is West Africa, so...


  > a term that always bothered me given how the world is round
Historical quirks of language are everywhere. Atheists still say Good Bye (God by with you) when they part, and say Bless You when you sneeze.


I have substituted "gesundheit" ("health") for "bless you" for this very reason.


Likewise. It's pretty amazing how widespread a German word such as this managed to become.


At some point gesundheit made it into the zeitgeist and I feel schadenfreude for the people who said it wouldn't.


Well if any German word isn't kaputt we should definitely borrow it into English.


Why not simply say "Health" then? How is cultural assimilation any better than a phrase that has not had religious connotations for a century and a half?


Sounds like a shortened "Your health!" which as a toast should be accompanied by all present having a charged glass in their hand.


Yeah, Twitter spaces is a tiny niche. I know nobody who has used them for anything, but almost everybody uses Telegram. And I'm "In the West".


  Location: Ontario, Canada
  Remote: Yes
  Willing to relocate: No
  Technologies: Android, Kotlin
  Résumé/CV: https://www.linkedin.com/in/adam-bennett-4784b327/
  Email: info@adambennett.dev
  GitHub: https://github.com/ditn/
Android Engineer looking for a Staff or Lead role, ideally at a more established company but it depends on the problem space. I've worked and lead teams at fintech startups and most recently at Twitter 1.0, and I'm recognised as a Google Developer Expert in the industry.

Looking for new challenges and a chance to grow - I'm at my best when under some pressure and surrounded by smart people.


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

Search: