|
Randor wrote: This is actually the core problem with the spectre vulnerability[^]
I just read about that now, thanks to your comment. I don't know whether to be impressed by the hack, or appalled at the amount of time the creator of it must have had on their hands.
Real programmers use butterflies
|
|
|
|
|
cool. i'll check it out
Real programmers use butterflies
|
|
|
|
|
For something a little bit different, try programming GPUs. You have to think in terms of using a few thousand processors that can all work at once. The challenge is to arrange your algorithm and data so they actually can all work at once. It's really quite fun.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I've played a little bit with that, enough to at least have a general feel for the landscape. It dovetails with this kind of coding actually, because branchless coding tends to be parallelizable. It's not always true of course, but it just tends to lend itself to it.
Real programmers use butterflies
|
|
|
|
|
No offense intended, but I can think of some things that are a lot more fun, and less contrived.
|
|
|
|
|
Anyone worked on Face Recognition projects? I'm looking to write an app and would like some guidance.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
CP Search[^] is a good place to start
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I've been porting large chunks of C code to C#.
Some routines are quite long and deal with a lot of C "math.h", etc.
In some case, I'll do a straight c "cos" to c# "Math.Cos", for example.
In other cases, a "local delegate" avoids having to make a lot of changes or adding a method with the same name. e.g.
Func<double, double> cos = Math.Cos;
double cosX = cos(x);
double cosY = cos(y).
...
...
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Would this be better as a Tip?
|
|
|
|
|
This brings to mind pre-processor games that attempted to make C more "Pascal-like" by replacing '{' with 'begin', '}' with 'end', etc. This is of limited utility, and only confuses those who expect to see native C# code.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
#define while if
#define true ((__LINE__&31)!=31)
Always fun to work with ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Who in their right mind would ever let you loose with a preprocessor?
Real programmers use butterflies
|
|
|
|
|
What's the problem? It's true most of the time ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I mean, wouldn't it just be simpler to pour a sticky beverage on your CPU?
Real programmers use butterflies
|
|
|
|
|
Ah, but sticky liquids don't change the results when you start adding debug code ... :EvilGrinSmiley:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In that case, run one of your DRAM sticks over your cat in a dry climate. That should do the trick.
Real programmers use butterflies
|
|
|
|
|
If you have a rope you can hang yourself, it doesn't mean you should.
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
They should revoke your coding license.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
This must be a usage of 'fun' specific to Wales.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I was recently porting C# code to C. I did several times for recent projects. It's because I have years of C# code I'm not actively using but I'm currently developing stuff in C++ and sometimes C
Real programmers use butterflies
|
|
|
|
|
Quote: I've been porting large chunks of C code to C#.
So next you will have to use something like Clang bindings for .NET and Mono written in C# to get it back up to speed
Seriously: did you consider using P/Invoke?
Espen Harlinn
Senior Architect - Ulriken Consulting AS
The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra
|
|
|
|
|
If you don't mind changing the case, just add:
using static System.Math; to the top of your code file.
using static System.Math;
...
double cosX = Cos(x);
double cosY = Cos(y); using static directive - C# Reference | Microsoft Docs[^]
Otherwise, a static (and possibly local) function would have better performance.
private static double cos(double radians) => Math.Cos(radians);
private void Foo(double x, double y)
{
double cosX = cos(x);
double cosY = cos(y);
...
} Or:
private void Foo(double x, double y)
{
static double cos(double value) => Math.Cos(value);
double cosX = cos(x);
double cosY = cos(y);
...
} Local functions - C# Programming Guide | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
New sign at town limits:
MyTown, TX
Estab. 1883
Elev 4500
Pop 5686
Zip 79830
--------------
Total 91899
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
Now this song is playing in my head: Old Town[^]
|
|
|
|
|
I got this one: Ghost Town[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|