|
The "optimal" choice for a number base is e (the base of the natural logarithms).
(Where "optimal" is: minimizing the product of the number of distinct digits in the system and the number of digits to represent a number in that system.)
See: Non-integer representation: Base e - Wikipedia[^]
Base π is also mentioned immediately following.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
So we can't have been that drunk, then!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Paulo Zemek wrote: A "base 1" system would only see the 0, and nothing else.
Actually,a base one system would only see the 1.
Think of a tab at the pub.
More on unary systems here[^].
|
|
|
|
|
I was still locked on the decimal System when I wrote the text. But I recovered when talked about the 57. A base one system could work if the only number was the one, not the zero. Next step on the pattern. That is: By default, 0 is the starter and 10 represents the pattern. Then, 1 is the starter... And it is eternal, as there's nothing out from them division of 1 by one in base 1 represented by one.
Mind blowing? Too me, too simple. Easy and too boring.
Next question please!!!
|
|
|
|
|
Ooh, "them" instead of "the division" was on purpose. Did you see it on the first read? Also, then is replaced by "the" only, not "the division". Ah I to far/fast? Ok. I will sleep now. Have fun with numbers and encryption!!!..!!.!
|
|
|
|
|
Thanks for the bedtime brain teaser.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
A code fragment from a class used for testing purposes. The function cuts a snippet out of an image, sends it to some data transformation (the transformed data contain no reference to a bitmap), and notifies a different class that new data are available.
Point position = _Motor.GetData().Position;
Rectangle rectangle = new Rectangle(position, Properties.ImageSize.Size);
Bitmap partialImage = _Bitmap.Clone(rectangle, _Bitmap.PixelFormat);
InfraredImage = _Converter.InfraredImageFromBitmap(partialImage);
OnImageReceived();
The function is called every few milliseconds. After a few milliseconds, Bad Things (TM) happened:
An unhandled exception of type 'System.OutOfMemoryException' occurred in System.Drawing.dll - at the _Bitmap.Clone call.
How could that happen? Do I have to get rid of the partialImage s? I added calls to Dispose . Set it explicitely to null . Called GC.Collect . Called GC.WaitForPendingFinalizers . Nothing helped.
Then I saw "rectangle = {X = 1630 Y = 0 Width = 80 Height = 100} ". Uhm, _Bitmap is 1707 x 1280 pixels, isn't it? And 1630+80=1710: that's 3 pixels beyond the right border of the image. Actually an ArgumentException .
And then I remembered: with those managed wrappers of the unmanaged graphics API, any kind of error is translated into an OutOfMemoryException , regardless of the actual cause.
Why do I always have to learn that the hard way instead of remembering it immediately?
I fear the OutOfMemoryException might somewhen become the InnerException of a LostMyMindException ...
modified 22-Apr-16 2:58am.
|
|
|
|
|
Not really the correct forum for this - I'd post it as a question if I were you.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
It's hardly a question, given he's already found the solution. This is precisely the correct forum.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oh, maybe it is:Quote: Why do I always have to learn that the hard way instead of remembering it immediately? And how can I be prevented from throwing a LostMyMindException ?
|
|
|
|
|
Bernhard Hiller wrote: And how can I be prevented from throwing a LostMyMindException ? Obviously, with a missing mind, you won't throw any exception any more - you would have to implement a sane observer to take care of that!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Indeed - note to self, read more carefully before commenting.
Apologies Bernard.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
And what was the developer who came up with this smoking at the time?
How on Earth is this a good idea?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Well you could have resorted to doing it in an unsafe manner because the managed wrappers are really slow. That way you would have successfully screwed with the memory
|
|
|
|
|
Bernhard Hiller wrote: Bad Things (TM)
I think Winnie the Pooh already trademarked that.
Marc
|
|
|
|
|
SQL Server at its best.
Guess the output:
CREATE FUNCTION dbo.WTE ( @ID UNIQUEIDENTIFIER )
RETURNS TABLE AS RETURN
(
SELECT @ID [ID]
UNION ALL
SELECT @ID
UNION ALL
SELECT @ID
)
GO
DECLARE @ID UNIQUEIDENTIFIER = NEWID()
SELECT [ID] FROM dbo.WTE ( @ID )
SELECT [ID] FROM dbo.WTE ( NEWID() )
DROP FUNCTION dbo.WTE
This wasted a few hours today.
|
|
|
|
|
Knowing absolutely nothing about SQL, I have no idea, although I guess the output was not what was expected (and possibly wasn't even logical, having heard various stories about SQL Server).
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Wow! Never seen this before. I tested with RAND() and FLOAT and it's the same behavior. Did you find any explanation?
|
|
|
|
|
Interesting.
I wouldn't have guessed that!
I'd suggest that's worth a quick tip (and possibly a list of what it does in various versions?)
For the record, I tried it in SQL Server 2012:
Microsoft SQL Server 2012 - 11.0.5343.0 (X64)
May 4 2015 19:11:32
Copyright (c) Microsoft Corporation
Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 10586: )
And
Microsoft SQL Server 2012 (SP1) - 11.0.3156.0 (X64)
May 4 2015 18:48:09
Copyright (c) Microsoft Corporation
Web Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
And got the same results
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Now, that is weird and wonderful!
I wonder what else I can do with that...
|
|
|
|
|
Function pointers FTW
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Wow, that is truly horrible.
I'd describe that as a bug, pure and simple.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
This is crazy - how is this possible! It's as if the NEWID() call is passed as a paremeter into the function and called three times?????
|
|
|
|
|
That function should be called WTF....
|
|
|
|
|