The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
Somehow I imagine you, searching all your external drives: "Where is this damn VM... I have to test this!!! ARRRRGGGG"
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 imagine you, searching all your external drives: "Where is this damn VM... I have to test this!!! ARRRRGGGG"
That's pretty much how it went. I used the GCC for the C version -- but had to log into my DigitalOcean droplet because it was easiest to write a command line C program there. I used my GIT bash shell to do the the bash shell one, etc.
I was searching all over the Internet for compiler VMs.
I actually tried to get it running in ADA, but couldn't.
It is hard to say 'wrong' or 'right'...
The Euclidean way is much more perfect (consistent) and fits better math as science, however Donald Knuth promoted an other way (called floored division), which found to be better for computer science and used by most languages today... Modulo operation - Wikipedia[^] - there is a nice table on the left side about programming languages...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Python and Ruby are garbage languages and I'm sure this will be their end.
-1%20 = 19 is so counter intuitive, I don't know how they reached that conclusion, however, we can see here that in Python the result of a modulo(%) operation has to be of the same sign and strictly smaller than the second operand.
And so python says
print 1%-20; = -19.
print -1%-20; = -1. (finally)
Someone needs to go back to the math class they hated.
I am not the one who knocks. I never knock.
In fact, I hate knocking.
To make it even worse, it's not even the same in all languages, and to make that even worse there are languages that didn't even make a choice which way to do it (you have already guessed which languages that were).
There's a nice list at the right side of the relevant wikipedia page, which is interestingly the Modulo operation page while the point is that in most languages it's really the remainder operation.
I don't think this is really wrong.
This is probably due to confusion between modulo and remainder.
There seems to be the same for positive numbers.
But for negative numbers, there are different.
Remainder work as expected.
But modulo work as following: returns the difference of the first number, and the biggest integer (possibly negative) multiple of the second number that is less than the first number.
So in our example: -1 - -20 = 19
That's why lot of programming languages have 2 "modulo" operators, one for modulo operations and one for remainder operations.
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
Having given this some thought... I have come to the conclusion that the argument that the remainder must never be negative must make sense only to they who realllllly don't like improper fractions and consider negative fractions to be improper.
But I have not found anything explaining why someone would feel that way. I have a guess, but no way to confirm it.
In 2013, Bernanke wrote that virtual currencies “could have a long term promise”, and addressed his thoughts to congress. However, more recently in 2015, Bernanke also said that there were some “serious problems” with virtual currencies, including issues with anonymity and the lack of stability.
OK, no more blockchain posts for a while now, at least from me
next Tuesday, 50 leaders representing the business, technology, government, academia, arts and non-profit sectors arrive on Sir Richard Branson’s private island to spend three packed days discussing blockchain technology for the third annual Blockchain Summit....“We’re trying always to invite the biggest thinkers of this world and discuss how we can use this technology to really do good,” said Bitfury chief executive Valery Vavilov.
Actually, the title is a little misleading. I accidentally ran across something that will crash the compiler process which runs separately from the IDE. It's not that big a deal but it seems to be repeatable. This will happen when you put an invalid entry in the initialization list of a class constructor. For example :
: BaseClass( defaultArg )
, m_ValidMember( 0 )
, m_InvalidMember( 0 ) // <- this will cause the crash
As anyone else run across something like this or other ways to cause mayhem with VS17?