[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Which code you wrote you're most proud of?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 26
Thread images: 5

File: 1472914413001.jpg (88KB, 290x289px) Image search: [Google]
1472914413001.jpg
88KB, 290x289px
Which code you wrote you're most proud of?
>>
>cmd.exe
>shutdown /p
>>
>>56501755
sudo rm -rf /
>>
System.out.println("Hello World");
>>
>>56501755
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.
>>
>>56502529
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
>>
>>56501755
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!");


:^)
>>
>>56503581
Paste it in ~/.bash_login
>>
>>56503670
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;
}
>>
>>56501755
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.
>>
>>56504172
You copied this from wikipedia.
>>
>>56504209
Newfag
>>
>>56504169
Clever
>>
#include <stdio.h>
main()
{
printf("Hello World!");
return 0;
}


My mom says that I'm destined for great things.
>>
File: 1472683497608.jpg (84KB, 384x512px) Image search: [Google]
1472683497608.jpg
84KB, 384x512px
>>56504172
>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; }
>>
File: ColorCodedChaos.png (14KB, 1204x524px) Image search: [Google]
ColorCodedChaos.png
14KB, 1204x524px
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.
https://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.
>>
>>56501755
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
>>
>>56501755
    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();
};
}
}
>>
File: cringe.png (323KB, 1057x960px) Image search: [Google]
cringe.png
323KB, 1057x960px
>>56507336

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..
>>
>>56503551
Name of library?
>>
File: 1413775162315.webm (3MB, 1372x756px) Image search: [Google]
1413775162315.webm
3MB, 1372x756px
>>
>>56504172
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.
Thread posts: 26
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.