News for hackers. Stuff that matters.

john_fushi

I don't want to tangle myself in a "technically correct" kind of discussion however I'd like to point out that Bloom's taxonomy - a widely used model in pedagogical context - has a level for creative work.

It is the highest level of learning, but still a level of learning.

Re:Memory Order in C++ (2022) on Wednesday August 23, 2023 @08:44AM (#37234955)
Thanks for the explanation!

That's the part I missed : the first null check can be skipped if the memory is allocated but the constructor hasn't been executed.

Re:Memory Order in C++ (2022) on Wednesday August 23, 2023 @08:06AM (#37234612)
Doesn't the singleton example contain an error?

On one hand, the author says that instanciating the singleton and storing it is not safe because there is no synchronization, but on the other hand he says that null check before is safe because the mutex introduces synchronization.

My understanding would be that the mutex protects this whole section and that the atomic is not necessary at all in this case.

Please correct me if I'm wrong.

I guess Matsumoto should have charged for Ruby. I'm sure Mike Perham and Derek Kraan would have been glad to pay for that and that the Ruby community would be in a strong and healthy shape.
Re:And Worst Decisions I’ve Ever Made on Friday January 27, 2023 @04:01PM (#34551797)
(In Canada) The max my bank offers is 10 years, and it comes at a premium. The standard I see around me are 5 years.
Re:What We Look for in a Resume on Wednesday January 25, 2023 @05:09PM (#34524844)
Let's say that, hypothetically, I lead a project for a very big customer that ended up being used to commit a (arguably) crime against humanity.

Should I put this on resume and would it be in poor taste to quantify the results?

> val x: Pair<String, Pair<String, String>>

This just describes the structure. Structure without intent is useless.

Comments and out of code documentation both have the same problems : - Blindspots - Rot

That is not to say they are useless, but they are rarely if ever sufficient.

In the end, the most complete and trustworthy source of truth for the code is the code itself.

Help others by having your code describe your intent. Using appropriate variable name and using appropriate types _help_ to keep displayed intent in sync with reality.

Another point to consider is that for the same intent the structure may need to change, to evolve. Proper typing can insulate the code from those changes.

Unless you live in Quebec - then google disabled this option to avoid complying with local children protection law.
Re:Why should I have written ZeroMQ in C, not C++ (2012) on Saturday August 13, 2022 @01:09PM (#32451765)
Which is also an issue in the author's example, no? So the point would be moot.
Re:Don't ask to ask, just ask (2019) on Friday March 11, 2022 @11:58AM (#30642450)
Hey! What's up?
Re:A generation of American men give up on college on Tuesday September 07, 2021 @06:40AM (#28443136)
Telling someone to "man up" is a telltale sign of toxic masculinity.
Re:Show HN: Embedded Ring Buffer C++98 on Monday June 07, 2021 @01:45AM (#27419385)
N.B. I'm writing my comments as I am reading your code. Please, don't take offense from my criticism, it is meant to be constructive, albeit concise.

/* * @brief Retrieve a continuous block of * valid buffered data. * @param num_reads_requested How many reads are required. * @param skip Whether to increment the read position * automatically, (false for manual skip * control) * @return A block of items containing the maximum * number the buffer can provide at this time. / Block<T> Read(unsigned int num_reads_requested)

Where is skip?

> if (buffer_full) > { > / > * Tried to append a value while the buffer is full. > / > overrun_flag = true; > } > else > { > / > * Buffer isn't full yet, write to the curr write position > * and increment it by 1. > / > overrun_flag = false; > data[write_position] = value; > write_position = (write_position + 1U) % LENGTH; > }

You don't write in the case of an "overrun". Isn't that one of the most interesting property of a ringbuffer? It seems that your implementation is specific to your use case (buffering to sd cards?). I don't think your _current_ implementation is apropriate for a _general_ purpose ring buffer mostly because of api concerns. It may be interesting to emphasis this part in your doc.

> reads_to_end = LENGTH - read_position; > req_surpasses_buffer_end = num_reads_requested > reads_to_end; > > if (req_surpasses_buffer_end) > { > / > * If the block requested exceeds the buffer end. Then > * return a block that reaches the end and no more. > / > block.SetStart(&(data[read_position])); > block.SetLength(reads_to_end); > } > else > { > / > * If the block requested does not exceed 0 > * then return a block that reaches the number of reads required. > */ > block.SetStart(&(data[read_position])); > block.SetLength(num_reads_requested); > }

Maybe : > reads_to_end = LENGTH - read_position; > eff_reads = (num_reads_requested > reads_to_end) ? reads_to_end : num_reads_requested; > //or : eff_reads = std::min(num_reads_requested, reads_to_end) > block.SetStart(&(data[read_position])); > block.SetLength(eff_reads);

Still, I understand the need to be very explicit in an embedded context.

Same principle for ``if (!bridges_zero)`` (the ``else`` case)

Re:Show HN: Embedded Ring Buffer C++98 on Monday June 07, 2021 @01:09AM (#27419188)
> memset(data, 0, LENGTH);

>// ...

> T data[LENGTH];

I'm not sure how important it is in practice, but I'm pretty sure you don't zero out the whole array for sizeof(T) > 1.

Anyhow, memsetting to 0 a complex type is... not something I'd recommend in most cases.

Re:Burnout is real – how to avoid it on Friday August 30, 2019 @12:33PM (#20840126)
Just create child processes with a shared memory region. That's not multi-threading.
I used to work for a car rental company. Actually, it was an insurance company that rented car. Cause 80% of their profits were on the insurance. The car rental part was just to bring more people to insurance part.
Re:Silicon Valley Women Tell of VC’s Unwanted Advances on Thursday June 22, 2017 @02:22PM (#14614218)
You don't miss much really. The article is pretty light on information.
Re:The Canadian Housing Boom Fueled by China’s Billionaires on Wednesday August 03, 2016 @05:55PM (#12221874)
It's really that speaking french in a predominantly french region shouldn't stop you from getting a job you have every competencies to achieve. That's why the law can go into absurd territory(e.g. having only english equipment cannot be a valid reason to refuse employment to a francophone).

But then again, most of the law only applies once your business reach a certain number of employees(30 I think)

Re:The SalesForce Outage: A Nail In The Coffin For SaaS? on Wednesday June 01, 2016 @01:33PM (#11816398)
I think his point is that when comparing running SalesForce on the cloud for every users SalesForce has, vs running SalesForce locally for your users, there will a lot less challenge to keep it running locally than on the cloud.
And a more 'meta' song on the subject : https://www.youtube.com/watch?v=AgiNoNqYXMA
Some songs to practice hearing the sacres : https://www.youtube.com/watch?v=jM05U9rHdwY - Fourrer https://www.youtube.com/watch?v=J2sClLoRFOM - Enfant de Chienne https://www.youtube.com/watch?v=daE5bOnYNNY - god bless the topless https://www.youtube.com/watch?v=M3Ol8wIYoPQ - la petite grenouille
It irks me too, but the term has been adopted in recent months, I think, by the javascript community. It is usually used to mean something akin to reactive.
If you are in Quebec once, try to speak French even if you struggle. You'll see most people will go pretty far to help you.

In any cases, feel free to message me in French if you need practice.

I'm not saying it is impossible, however bilingualism is often required in Montreal. Also, once the startup gets to a certain size(I'm not sure if it is over 30 or 50 employees) they have additional restrictions imposed by the OQLF.
If you are not interested in learning French you'll have a hard time finding a job in Montreal.
Actually it is. Unless you are the kind of person to go to the ER for having sneezed once in the last 24 hours...
Re:A lightweight C++ signals and slots implementation on Thursday January 28, 2016 @08:12PM (#10992804)
Given that the comments talk about compatibility issues with DOS and some DSPs I believe it is not the direction pbhogan wants to take.
Re:Countries That Don't Exist on Saturday November 07, 2015 @05:04PM (#10526411)
After playing Eu4 for a while, I'm kinda disapointed the knights aren't mentionned.

See https://en.wikipedia.org/wiki/Sovereign_Military_Order_of_Ma...

Re:This Is Not America: Why Wal-Mart Left Germany (2006) on Wednesday August 26, 2015 @12:14PM (#10123945)
That was such a failure. They baited people in with the promise of a good selection of products at a low price when they had actually a pitiful selection and jacked up prices.

Half of the shelves were actually empty. Clothes were of extremely low quality.

They just did not do anything right.

We need to register/login to read the article.
Not op but http://www.bodybuilding.com/fun/shortcut-to-size.html

It's a good 4-days workout program. The goal is to gain mass but it does so by improving strength and endurance, setting up a strong foundation for future workout.

A day took me around an hour on average.

Older »