Which code you wrote you're most proud of?

Which code you wrote you're most proud of?

Other urls found in this thread:

en.wikipedia.org/wiki/Logistic_map#Chaos_and_the_logistic_map
twitter.com/NSFWRedditImage

>cmd.exe
>shutdown /p

sudo rm -rf /

System.out.println("Hello World");

I wrote a small networking library for c that admittedly will probably only be used for malware, has lots of downloads, allows you to easily upload data to an http server that's disguised as html.

Where do I type this? cmd?

>be lazy
>watch flicks in comfort of bed
>too lazy to get up
>make batch file for shutdown
>can now say, "Hey Cortana, run 'my shutdown command'"
>shit actually works
>mfwnf

System.Console.Write("How old are you?");
int age = int.Parse(System.Console.ReadLine());
System.Console.WriteLine("Wow! In 10 years you will be " + (age + 10) + " years old!");

:^)

Paste it in ~/.bash_login

System.Console.Write("How old are you?");
int age = int.Parse(System.Console.ReadLine());
Thread.sleep(315569520000);
System.Console.WriteLine("Wow! In 10 years you will be " + (age) + " years old!");


:-)

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;
}

I did a full stack deployment automation tool a few years ago.

Scales from 2 - 2048 servers
Auto configures switches, but AGG and TOR
Auto configures SAN from initial setup to LUN provision
Builds both core management infrastructure and requested VM's
Configures PDU's and UPS's, and full monitoring.

Wrote it in PowerShell v3 for Server 2012 / R2, using XAML whenever a GUI was needed.

Built it when I was working at Microsoft, and then they bought hardware for the project. 4 racks of DL560 G8's, two racks of DL380 G8's, and two VNX 7600's.

Took me about a 8 days to rack and cable everything according to the SKU, another 2 - 3 days to configure the deployment tool to build it, and 31 hours to actually build and provision everything. It was magic.

You copied this from wikipedia.

Newfag

Clever

#include
main()
{
printf("Hello World!");
return 0;
}


My mom says that I'm destined for great things.

>Q_rsqrt

I'm not proud of any of my code, It's all garbage. But some of it has been used by thousands of people.

Probably some of the weird stuff I did when I was just starting out, learning Perl on a Silicon Graphics Indy R4600. Overly complex formats, using short-circuited operators as control statements, etc...

($valueToCheck =~ /CrazyLongRegexHere/) && do { stuff_I_should_have_done_in_an_if_block; }

I've been working on string-based arithmetic functions in R and I'm pretty proud of my progress. I'm just doing it for Hackerrank stuff, but seeing it actually benefit my scores is rewarding.

Proudest overall, given the amount learned in the process of creating something, probably my program to color-code cycle numbers in a logistic growth function.
en.wikipedia.org/wiki/Logistic_map#Chaos_and_the_logistic_map
Pic related. look for yellows, greens, and reds in the black portion. That's 3-cycles, 6-cycles, and 5-cycles respectively. It's been years, but I plan to tinker with it again someday.

integration between an 80s mainframe with an ancient af flat file database we have housing employee info and active directory, auto provisioning user accs. From there FIM + a bunch of SPML requests set up access on various different systems

the company refuses to upgrade, so worked with what i was given

class RandomString
{
readonly string s = ("bcdfghjklmnpqrstvwxyz");
readonly string vo = ("aeiou");
Random rand = RandomHelper.GetRandom();

public void Run()
{
Parallel.For(0, 10000, (i) =>
{
var ti = GenerateRandomString((i*10) + 10000 );
ti.OrderBy((i2) => i2);
var se = ti.Where((p)=> vo.Contains(p));
});
}

private string GenerateRandomString(int i)
{
{
var t = new StringBuilder();
for (int o = 0; o < i; o++)
{
if (o % 2 == 0)
t.Append(s[rand.Next(0, s.Length)]);
else
t.Append(vo[rand.Next(0, vo.Length)]);
if (o == 0)
t = t.Replace(t.ToString(), t.ToString().ToUpper());
}
return t.ToString();
};
}
}

I hate it when people talk about math and try to make it overly complex by using technical terms..

Your " program to color-code cycle numbers in a logistic growth function" goes something like this, right?

x = Array()
for i in [1..40000]
x[n+1] = r * x(1 - x[n])


Pic related..

Name of library?

...

It's too bad this original implementation is actually undefined behaviour. Instead of aliasing the pointer from float to long, type punning should be done through a union or using memcpy.

I guess memcpy could slow it down a bit though, unless the compiler can optimize it out somehow. I should test this someday and benchmark some fast inverse square roots.

Anyway it's a cool algorithm and formal code correctness was probably not the main goal.