Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   Beautiful code (http://www.abandonia.com/vbullet/showthread.php?t=27125)

Japo 27-05-2011 08:17 PM

Beautiful code
 
The title is self-explaining, post here lines that you find elegant for whatever reason, be it that it shows the power of a language you like, that it shows how smart you are, or it's one of those obfuscated pieces of code without line breaks... Whatever.

Take a look at this C# for starters. Bear in mind that all this is 100 per cent strongly statically typed!

Code:

foreach(var result in new[] {
  new {
      fileName = fileName + ".1" + extension,
      data = Result1
  },
  new {
      fileName = fileName + ".2" + extension,
      data = Result2
} })
{ /* ... */ }

Beautiful!

Japo 08-11-2011 09:47 PM

For those of you that don't know any CAS (Computer Algebra System), specially any capable of symbolic computations as well as numeric, here's a little Maxima:

http://dl.dropbox.com/u/15818997/Maxima.mht

That link is a MHTML file, any browser should be able to open it I think, except for Safari and Firefox needs some extension.

This is free software, amazing. Too bad I didn't know it before. I could port my Sun position calculator to this.

arete 09-11-2011 03:49 AM

When you can show me what the southern hemisphere's night sky will look like on any given night, please let me know XD

Japo 09-11-2011 09:32 PM

I could... I only need massive amounts of initial data regarding the position, movement and brightness of every star. :P

arete 10-11-2011 03:26 AM

Quote:

Originally Posted by Japo (Post 436473)
I could... I only need massive amounts of initial data regarding the position, movement and brightness of every star. :P

*image of ninety-year-old Japo screaming "At last!! At last every star visible to the naked eye has been plotted in! ... Now, I wish I hadn't forgotten why I was programming this thing in the first place..."*


The current time is 12:05 PM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.