Screenshot / Code Snippet
About
Browsing the existing Stack Exchange family of websites was OK in a text-based browser, but when you're stuck in a Linux shell with no way out and no other computers around and you just know you saw the answer on Server Fault last week, this is how you can fi...
As far as writing system goes, you've basically got a regular alphabet, an abjad/abugida, a syllabary, or an logography to choose from (at least those are the ones I can remember).
If you want something exotic with only lowercase Latin alphabet letters, you should probably go with lots of q and x, and maybe even swapping roles of some vowels and nonvowels.
@Doorknob ... you know there's a word for "nonvowels," right? /facepalm
Credits
This challenge originated from @miles.
Create a function that computes the CRC32 hash of an input string. The input will be an ASCII string of any length. The output will be the CRC32 hash of that input string.
Explanation
The algorithm of CRC32 and other CRC are essentially the sam...
@CᴏɴᴏʀO'Bʀɪᴇɴ I threw together a rough idea of what would go into something like that, you'd probably have to go into the string escaping and eventlisteners more, though, I suppose
Your task is to decompose a number using the format below.
This is similar to base conversion, except that instead of listing the digits in the base, you list the values, such that the list adds up to the input.
If the given base is n, then each number in the list must be in the form of k*(n**m...
Your task is to create a program/function to replicate this word generator.
Details
Your program/function take two input. One input is the categories. The other input is the syllable types.
Categories
categories will consist of classes of letters.
For example, V=aeiou means that the letters ...
I'd like to submit Indonesian to the poll, if only because I like it, ~200 million people speak it (mostly my country's population but not all of them) and it's relatively simple except for vocabulary and a little bit of the grammar
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
The algorithm computes 1/√x by performing the following steps:
Alias the argument x to an integer, as a way to compute an approximation of log2(x)
Use this approximation to compute an approximation of log2(1/√x)
Alias back to a float, as a way to compute an approximation of the base-2 exponential
Refine the approximation using a single iteration of the Newton's method.
Do you have any knowledge on how floating point is stored?
Fast inverse square root (sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5f3759df) is a method of calculating x−½, the reciprocal (or multiplicative inverse) of a square root for a 32-bit floating point number in IEEE 754 floating point format. The algorithm was probably developed at Silicon Graphics in the early 1990s, and an implementation appeared in 1999 in the Quake III Arena source code, but the method did not appear on public forums such as Usenet until 2002 or 2003. (There is a discussion on the Chinese developer forum CSDN back in 2000.) At the time, the primary...
Basically, in floating point, a number is expressed as (2**a)(1+b) where 0<=b<1
x = (2**a)*(1+b)
log x = a + log(1+b)
since 1+b is between 1 and 2, log(1+b) can be approximated as b+c where c is a parameter
Ruby, 142 bytes
Anonymous function; takes a string as input, returns an integer.
->s{z=8*i=s.size;r=0;h=4374732215<<z
l=->n{j=0;j+=1 while 0<n/=2;j}
s.bytes.map{|e|r+=e*256**(i-=1)};r<<=32
z.times{h/=2;r^=l[h]==l[r]?h:0}
r}