TIL (about the Dark Arts of HTML)
-
The most efficient algorithm is to query WolframAlpha
-
The most efficient algorithm is to query WolframAlpha
What if you have to do so using @ben_lubar's wifi?
-
well ok. but wolfram isn't actually calculating the answer... it just has a harddrive full of precomputed answers. :-P
-
I bet they make tons of money with their IPaaS though.
-
This post is deleted!
-
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
yeah. conflating subconversations is a rough thing to happen.... ;-)
-
-
-
Huh. My friend said I missed one when I pasted to him.
You definitely @accalia'd something:O (n(log(n)) **(**log(log(n) ) ) ) ...Wait now I've confused myself
-
there's another version of the sieve that has a different runtime but is rarely implemented. maybe he was thinking of that one?
-
This post is deleted!
-
ARGH MATH screw this I'm going back to working on documents with words in them ;)
-
Wait now I've confused myself
there's probably a reason why the wikipedia entry elides some of the parens where they can be trivially inferred.
-
Apparently that's the bit complexity and now everything makes sense again. He says.
-
ok, yes technically, however since all the operations in the sieve are load/store/bitmask/addition the bit complexity can be taken as the time complexity as all those operations take the name number of processor cycles (to within one order magnitude).
:-D
-
-
Something something variable-width integer types something number of bits increases with N something something. I lost track at that point.
-
this friend of yours.... i need to meet them. it sounds like we'd get along famously!
-
for reasonably small values of N, yes. but since you need at least N bits (more commonly N bytes) you do have an upper bound of how big you can check with the sieve
True, but on modern machines, 'reasonably small' can still allow N to be a million or two ;)
@Yamikuronue said:Something something variable-width integer types something number of bits increases with N something something. I lost track at that point.
I've lost track now too. But then I'm getting the abridged version
-
True, but on modern machines, 'reasonably small' can still allow N to be a million or two
well yes. and a server properly kitted out can calculate several billion (and occasionally trillion)
or you can do a partitioned sieve to hard disk and get much much bigger numbers (like quadrillions)
or you could just google the lists of primes
here's the first fifty million primes: http://primes.utm.edu/lists/small/millions/ (not all in one file. this is a link to the index)
-
That's pretty cool.
-
I made it for young ms. flabdablet who is studying prime numbers in school right now.
-
They take up the majority of his face. I'm still amazed how he didn't manage to get them poked out before.
Well, I had a different image in mind, but I couldn't find it so this one will do I suppose.
-
clicky thing
TIL about the × (×) HTML entity.
How old is that code? Some of it feels... off. Like using
document.write
instead of the DOM API.
And of course, there's the doctype.And why did Discourse remove the link from your quote?
-
How old is that code?
Sep 2012; it's my first ever attempt at making anything with Javascript+HTML.
why did Discourse remove the link from your quote?
Because links in quotes is Doing It Wrong, duh.
-
the weekday of my birthday coincides with the weekday of Christmas
filed under:Brought to you by Boring Facts inc.Mine coincides with the weekday of Christmas Eve, as does my dad's and both of my grandmothers'. Technically, my coincides with the Christmas Eve of the year just ended, but that works for me.
filed under:Brought to you by Even More Boring Facts inc.
-
Mine coincides with the weekday of Christmas Eve
Same here.
Technically, my coincides with the Christmas Eve of the year just ended, but that works for me.
Yep.
Filed under: me too
-
And why did Discourse remove the link from your quote?
Of course it did! Didn't you have a after your question that I quoted?
Why the fuck would anyone expect a quote to contain all the quoted content?
-
Why the fuck would anyone expect a quote to contain all the quoted content?
Formatting isn't important.
Emoji aren't important.
Only words are important.
-
Formatting isn't important.
Emoji aren't important.
Only words are important.
No.
(I mean, ok, yes, but still no.)
-
I'd remove all the spaces as well. They are not proper characters anyway.
-
I'dremoveallthespacesaswell.Theyarenotpropercharactersanyway.
Thismanisagenius!SomebodygetAttwoodonthephonelikepronto!
-
not for the Sieve of Eratosthenes.
Yes, but that's a terrible way to determine primality. At the very least you should be able to use simple algorithms up to 118670087467 and get constant-time determination for anything in that range. Above that, stuff starts to get trickier as the most efficient method becomes probabilistic (AIUI, depending on the density of Carmichael numbers, but this is stuff I really don't know well).
-
granted. granted.
the sieve is a terrible algorithm for testing whether a random number is prime.
it's a fantastic way to say: "find me all the primes less than N" so long as you have enough memory to actually count up to N.... and that's about it.
-
-
TIL you can run 3D games at somewhat decent speed inside VMware virtual machines if you enable 3D acceleration.
Does that 3D acceleration rely on the guest having complete passthrough to and exclusive control of the GPU, or can the guest and host share it?
Can multiple guests run accelerated 3D at the same time?
-
If the guests are the OS versions that gets the SVGA driver from the VM tools, then yes.
That used to just be Windows 7+, but maybe it's changed recently for Linux.
-
it's a fantastic way to say: "find me all the primes less than N" so long as you have enough memory to actually count up to N.... and that's about it.
It's probably better to hard-code the handling of 2, 3, 5 and 7 (i.e., working with a loop that steps by 210 each time round) so that you only feed things into the sieve that have a reasonable chance of not being filtered.
-
there are a number of optimizations you can make to the sieve (the most often used one i see is to store numbers as n > 2N +1 so that you never store/check even numbers. takes a bit of "tricky" math.. .:-P
-
store numbers as n > 2N +1
Saving one bit per number? <sarcasm> That's going to make a lot of difference, I know it! </sarcasm>
-
In an array of bits? Yes.
-
It's an infinite series, so the more savings you make, the further along you can get...
-
In an array of bits? Yes.
I'm not convinced. There's simply not that many primes that fit in 64bit integers anyway (and really comparatively very few that fit in 65 bits but not 64). Once you get over that, you're into high-overhead operations whatever you do.
-
TIL about the U+2E3B THREE-EM DASH character ("⸻"). Yes, it's 3 times wider than a standard character. Yes, you can cause overflows on many websites.
I think the people at unicode are trying to see how much they can push their power. I bet they'll add spiral text or something in the next version.
-
. I bet they'll add spiral text or something in the next version.
AWESOME! we'll finally be able to properly typeset Faerie runes then!
-
TIL Ruby has an API that tells you whether a character is upper or lower case… and it only supports ASCII
-
-
-
I guess my 'Filed under' was too <small>...
-
I saw it; I just decided to give an example anyway ;)