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

I would call code coverage "good" when I trust that:

- When I change the logic of a statement somewhere in the code, at least one test will fail in the suite.

A high % in a test report may give an indication but is far from giving me confidence. Having good code coverage means that, once you are back to green, and you have done to test code what will keep or improve your code coverage confidence, you can send the PR being tranquil that you didn't break anything else.


I was very interested by the question, and closed the page after skimming through the first screen: why is there any need to scenarize? why would I want to read about some guys in a bar? Can't we make it interesting to talk about what it really means for a device to "listen on port x"? In my experience (listening to Collège de France podcasts), any topic, even the most obscure and narrow field of knowledge, say "Late Babylonian scriptures as seen by Ibn Amhoud during 8th Century" (invented), can be made a thrilling experience if the speaker is really passionate and knowledgable about it. But there is never any need to start by a conversation at starbucks: one just dive in head first. </rant>


So on one hand, I absolutely hated the writing style as well... on the other hand, its some guys blog and if he likes this style and it makes him happy to write educational stuff like this, even if its not an ideal format for us then should we really judge?


Because different people learn differently?

This style reminded me of GEB a bit and I enjoyed it.


Brings to mind Elements of Style. Place yourself in the background, don't overwrite, don't overstate

"Write in a way that draws the reader's attention to the sense and substance of the writing, rather than to the mood and temper of the author. If the writing is solid and good, the mood and temper of the writer will eventually be revealed and not at the expense of the work. Therefore, the first piece of advice is this: to achieve style, begin by affecting none — that is, place yourself in the background."


I agree that it is probably not the optimal way to write an educational piece. However, in our year of 2022, the amount of content available online is absolutely staggering. If there weren't at least some pieces out there that tried to scenarize concepts like this, I would be disappointed - it's an experiment worth attempting.


I think the idea is that people who have had done their Computer Networks homework at the college coffee shop with their friends Tim and Liz can identify with the article. It's a niche audience but it's the only reason the author can imagine anyone would be interested in it. It's unappealing to me because despite having (re-)imagined this whole scene himself, the author can't really imagine why the reader would want to know, why I would want to know. If he could, then he would have motivated it that way instead.


Its making a point about embodied learning, curiousity, and work as a healthy part of life. Imo, the framing is a hell of a lot more interesting than the implementation details of port binding.


Best hug for me is no hug, thanks.

I would bet 95% of the human beings never hugs except between lovers or parents and their kids. I would bet hug is very much a North American thing. I'm French and hate hugs (we kiss on the cheeks, which feels less intrusive to me, but is crasy intrusive in most non-Latin countries).

I live in China and, in normal settings, people here won't hug, won't kiss and won't even shake hands (Unrelated to any ongoing pandemic.) I think it is the same in Japan, Korea, India, Pakistan, Indonesia, etc. Hugs between stars at international movie festivals do not reflect real people's life.


>I would bet 95% of the human beings never hugs except between lovers or parents and their kids.

And you'd be wrong. Hugging might not be big in your parts, but is a part of many cultures all around the world. Hardly a 5% rarity.

>Hugs between stars at international movie festivals do not reflect real people's life.

Nor do norms in a few countries.

I've travelled extensively, and I not sure where you got the idea that hugs are something only/mainly happening "between stars at international movie festivals".

From what I see "In traditional Chinese culture, hugging is not acceptable, particularly between people of the opposite sex. As Yang Chunmei, a professor at Qufu Normal University, has written, "public displays of affection are a source of embarrassment." Even among spouses, hugging, kissing, or holding hands in public is odd.".

But that's not universal. And even in China it apparently changes, if we're to believe this article:

https://sinosphere.blogs.nytimes.com/2014/05/07/more-hugs-pl...


I've lived all over the place, and spent my childhood in SE Asia. While aspects of the respective cultures are more reserved about PDAs than the US, hugs were commonplace between friends and family of all ages, not just kids or spouses, pretty much everywhere. Some people don't like it, and that's fine and should be respected. But as far as I experienced, both personally and by observation, the majority do.


This goes beyond human culture. Virtually all primates hug. Humans are primates. Heck, I think most mammals are into cuddling.


Maybe I was wrong but what I understand by "hug" is the fact to hold someone chest to chest, arms on the back of each other. I do not mean kids being held in the arms of their parents or lovers loving each other, or people holding hands or anything else. Then I maintain that this activity is reserved to very rare occasions, usually reserved to extreme emotion peaks, for instance at a burial of a close friend's relative, or when the national sports team win the gold.

To me, when meeting a friend or colleague at the first of the day, each culture has its own "hello sign" system, for French people it can be the kiss on the cheek or hand shaking (with many variants), for Chinese people it is a look in the eyes and "hi" with the hand or "吃了没?", for many other people (Germans?) it is purely hand shaking, and as far as I can guess the "hello = hug" is common in the USA.

I still do not think this "hello = hug" is universal or even the behavior of above 10% of the humans. I think most americans might believe it is nearly universal and always acceptable because nobody dares refusing the hug when they do it. It is actually very hard to stop a coming hug without becoming the very bad cold blooded person that has no feeling at all for others (personal experience here).


Your experience and perspective on life is not universal and I wouldn't be so quick to generalize. I've had the luck of travelling a fair bit in my life and I would say hugging is common in many cultures, family ties or not. For context I'm not from North America.


Yep - every culture (and even family) is different. Heck, I have a close Hong Konger friend who is one of the most physically affectionate people I’ve ever met


While it goes without saying that wishes not to be hugged should be respected, and cultural norms differ, and the Western way of doing things is not the "correct" way that should be forced unto others

in the case of hugging

I can't help but think that the absence of hugging (romantic or casual friendly etc) and handshaking (formal or casual high fives etc) really is sad and really DOES rob people in China, Korea, Japan etc of one of life's simple pleasures and high points of the day

I too like you am a European who spent many years in East Asia (Japan, but I have many Korean and Chinese friends and have visited those countries too) and while I definitely had some uncomfortable hugs and handshakes, overwhelmingly, a good hug or handshake would produce big grins, squeals of joy, instant warmth and connection etc etc, irrespective of gender, age, whether between friends or complete strangers - despite language and cultural barriers.

Without exaggerating, sometimes it's almost as if you're allowing someone to experience something they've been denied their whole life and people just gobble it up and look like they've had an epiphany or something.

In case it seems like I'm just making this up in my own mind, I don't think so, because many, many people have told me that the rigid norms banning most types of affection from public life, and even in the home, is one of their pet peeves about their own culture and society.

Maybe there is some selection bias in that foreigners tend to be surrounded by people who are OK with or interested in or prefer the foreign way of doing things, but I don't think so either, I lived in an area with very few if any foreigners and have many friends who don't speak English and don't have much if any interest in going abroad etc, and they would still say the same thing.

I'm acutely aware of how cringe the above might sound but rest assured it's not because I think I'm some hot or cool guy or whatever. Just a human being who likes hugs and handshakes. Each to their own and YMMV!


Hugging complete strangers.... that is strange really. Why would you do that.

At least you should hang out a day or two...


It's definitely cultural, I'm in the UK and I hug my friends when I'm saying hello or goodbye, but kissing on the cheek feels like something that old women do


The UK "hug" is this. https://www.youtube.com/watch?v=wxwHL0ObnaE

and this is it in operation in a social setting. https://www.youtube.com/watch?v=jGCK_9AJNL8


I'm also from the UK, and I do enjoy a hug, but some of my friends really don't like them. If I'm hugging a woman, and they lean their cheek into me, then I will give them a kiss on it. However, it can have some very awkward and funny moments.


This and alcohol is how I ended up married and with kids. YMMV.


In Serbia, man hug other man friends, and then man kiss to cheek woman friends.

Sometimes man kiss man on the cheek but its mostly considered a joke.

There is also religious 3 times to the cheek, I am gonna ignore that since everybody do it. That kiss is almost non existent tho, its more of a gesture.


Same here.


I live in Japan, but lived in South Korea as well. I have to say, I have never seen so many public displays of affection as I did in South Korea (and I'm an American). Matching clothes -- down to the shoes, hugging, hand holding, piggyback rides, and on more than one occasion a loud lover's quarrel. Take from that what you will.

Another interesting thing I noticed about physical touch in Korea is that the culture doesn't seem to have the same hangups America does about two heterosexual male friends touching. School kids holding hands as they walk together, and guys in their twenties resting their heads in their friends lap as they lounge at the park. It was refreshing and enlightening.


I'm in the Netherlands, which is pretty close to France. Among younger age groups, hugging among friends is very common (and instead, kissing on the cheeks, especially between men, feels very intrusive).

Which is to say: don't be too quick to generalise.


In France we kiss.

In Australia we hug. I discovered it the hard way.

When a girl walks up to you, at work in causal work situations, in France you start a kiss on the face. But in Australia she walks 20cm closer and the kiss lands in the neck, and it’s a very, very awkward moment.

(Fortunately she accepted my deep excuses while I babbled to explain what had just happened).


I have seen toddlers try to hug people. They run up, wrap their arms around your legs, whatever they can reach in a visibly affectionate way. Not sure if it's their intention to hug but definitely surprising in a culture where there's absolutely no hugging.


Amen friend. Please keep out of my personal space.

I'm fine with a good handshake in a professional setting to seal a contract. Shows peaceful intent to respect boundaries. Anything else is a rude intrusion and you're just trying to touch me for your own personal satisfaction. That makes you pretty creepy.


Too bad.

You must be having congenitally low levels of “cuddle hormone” :)


Do you at least give side hugs to your friends?


Gooey is nice, it could help in a wish I have had since foreveR and is the contrapositive: a way to convert any action I do on my Xubuntu UI into a command line.

Example: I pop the display config, hide the laptop screen, apply and confirm, and whish there was a "log" somewhere with a one line command I can use next time to redo the same thing.

In a way Gooey, if used a lot to make GUI apps, could help fullfilling this whish: I did not use it yet but I hope it displays somewhere the command line it generated from the GUI?


For your concrete example of display configuration, I think `xrandr` is the command you're looking for.


A long bunch of tests for a python RPC I was writing. My boss did rewrite the core code against the tests, so I could merge his code without even understanding it fully. And until now the test code is still healthy and growing, and it proves the core code to be working as expected.


I used recent speakers as simple Bluetooth speakers for a few years, and recently exhumed my old loudspeakers, those classic wooden box pairs with cables and rotative potentiometers. There's no photo: the sound is (was) much better.

Do you know the story with Spanish tomatoes? It's the same, they made them more convenient, easier to carry around and sell, better calibrated, more stable, etc. but suddenly some people tried the old tomato type and noticed that the only thing we should care about when buying them is... taste. Same with speakers: smart or Bluetooth it whatever is just a way to sell us speakers whose sound is fake (because it is cheaper to process the bass with a chip)


Here on HN we need to back such affirmations with data. The bolder the affirmations, the more solid the data-backed proof need to be.

If we were to exchange "philosophical" considerations here, I'd tell you that sunday fishermen have complained weekly that there was much more fish in the river before since the dawn of humanity. I'd also tell you that my own home in downtown Beijing has seen a slug invasion this year, and that these animals are not disappearing at all (at least in my courtyard).


That's a symptom of ecological upset too. One species flourishing when another dies off, and the resulting wild cycles. Not a good sign.


Here's a good article on that topic:

Planet of weeds Tallying the losses of Earth’s animals and plants By David Quammen/Harpers Magazine

http://courses.botany.wisc.edu/botany_422/readings/Quammen19...


Googling, a lot of the articles on species decline seem to point to the World Wildlife Foundation and The Living Planet, a survey published as a joint collaboration between the WWF and the Institute of Zoology.

Obviously, there is probably some bias due to this being in part from a conservation advocacy group. However, the methodology does appear to be documented in a peer-reviewed paper [2]. So I'd personally give it a fair more weight than mere anecdote.

[1] https://www.worldwildlife.org/pages/living-planet-report-201... [2] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1569448/


My favorite feature of pytest is pytest.mark.parametrize, which makes it easy to do table driven testing.


what is "table driven testing"?


I've never heard of that term being used but parametrize helps in situations where:

a) You have a slew of test inputs that all need to be tested through the same function, but you don't want to duplicate code.

b) You want something like "test with every combination of [x,y,z] for parameter a and [j,k,l] for parameter b". This is probably what the grandparent is referring to.

c)You have an even more complicated scheme, which you can define.

This is better than just having a for loop over a pre-generated list of parameters and calling a function with the same assertions, because pytest sees and handles them as separate but related test cases (e.g. when reporting errors, crash handling, fixtures, etc)


Yes. But what's striking me is that one woud ever want to test only one input state. If I have to test function f(x) and see if its output is as expected, I always want to test many inputs (including "silly" ones like wrong type, nulls, extremes). Writing one test for each of them is absurd, just give a list of inputs, a list of expected outputs and check them all.


Distance is no weasel word. China historically interfering with Korea or Vietnam is natural as it's neighbors and problems of one side of the border leaks on the other side, and cultural and economical influences are strong. But France or US interfering with Vietnam or Korea make much less sense. The real deep difference in the long span is that Chinese never sailed en masse to the other side of the planet to "propose" (with a gun in the hand) a foreign religion and a different way of life to people which never asked for anything.


It's a good idea to question assumptions. And to me living in China since Hu, the main difference is that Chinese people themselves perceive Xi as much stronger than his predecessors, and probably rightly so: the crackdown on corruption is no joke, I have relatives who gave back their German cars to avoid issues. Also people of the diaspora or in Taiwan follow closely the tiger hunt at the head of the state and it seems to not be nowhere like catching butterflies. So yes Xi has earned a reputation.


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

Search: