Thursday, April 28, 2011

No more Space Fleet:(


  It is pretty depressing knowing that this is nearly the end for NASA's shuttle fleet.  I watched discovery land yesterday, for the last time, and couldn't help but feel depressed.
 Only two more shuttles are scheduled to leave Earth, one flight each for Atlantis and  Endeavour and then mothballed off to museums; the USA will no longer have the capability to put a person in space for an undefined period of time, but likely many years.

 The Constellation program, initiated after the Columbia disaster, which was basically just Apollo 2, has been more or less canceled; not such a bad thing, it was underfunded and uninspired-- but where is the inspiring replacement?  The current plan is to promote commercial space flight in the hopes that it will produce a cheaper more efficient path to manned space projects.

 It seems to be a common misconception that NASA takes a large percent of the federal budget, but the actual number is closer to half of one percent.

  Here are the numbers, as you can see US budget is $3.55 trillion, and NASA receives only $18.7 billion of that.

 That is 1/190th, or ~0.005%.

That is a pretty damn small percent.  Politicians waste more money on pork barrel projects each year than the entire budget of NASA.

Sunday, April 3, 2011

Javascript Is Kinda Ugly

Working my way through web development with JavaScript + HTML + CSS.  The whole things seems rather poorly documented-- well there is plenty of documentation, its just all over the place, and of utterly random quality, not in any one central location like you can get with C++(via MSDN).

 I found an alternative language/syntax for JavaScript called coffiescript, whitespace sensitive and very concise, how Pythonesque.  I'll have to test it sometime.

 Currently I'm trying out JQuery, a JavaScript framework that supposedly eases the processes of building webpages.

For my own purposes, my running list of useful links/plugins:

Infinite Drag: just a background effect..not what i want
2 Way Infinite Drag: links here for usefulness
All open panel widget


Graphing:
jPlumb  looks real nice
dracula place with lots of links

Wednesday, March 30, 2011

The Problem With C++


C++ is my bread and butter language, the language I have spent the most time with, and language I know the best.  I've spent a great deal of time learning the ins and outs of C++, and its base language C.

  It is without doubt one of the most complex and powerful programming languages currently available, their isn't much you can't do in C++; procedural, object oriented, functional, meta programming.

  And the recent additions to the language, via C++ 0x, have further boosted its flexibility and power, from the succinct awesomeness of anonymous functions(lambda's) to the performance of R value references.  This is the language of the professionals, and the gaping maw that separates average Joe C++ programmer from the those that really know the language is vast. This is not Java, there has been, and hopefully never will be, any attempt to peddle to the legions of mediocre programmers.


 But despite my love for it, C++ has some serious defects.  Most of them stem from its C heritage.


 And the primary one is compilation times.  The C++ compilation model is archaic, it does exactly what C did, which is to copy and paste the contents of one file into that of another.  As the size of a project grows, the compilation times tend to grow exponentially.  C++ programmers have gone so far as to develop coding styles and even code patterns to reduce compilation types, this helps, but requires much extra time and effort, and in the end all it can really do is reduce the growth to something closer to linear.


 What the C++ committee needs to do is address this issue, and why they haven't already done so is beyond me.  Most modern languages do not take nearly so long to compile, for example D, a language much like C++, actually in many ways superior, but lacking widespread tool & compiler support, uses a more modern import system and avoids the C++ compilation nightmare.

 

JavaScript vs Lua


  I've used Lua  in the past, mostly as a scripting language embedded into games, but lately I've been doing some web programming which requires the use of JavaScript.

 The two languages are similar in their approach to OOP, which is prototypes not classes.  This takes some getting used to, if coming from a traditional class based language, but does offer some nice advantages.

 But I've started to notice aspects of JavaScript which seem glaringly inept when compared to Lua.


Advantage Lua:
1)  Lua "tables" are essentially equivalent to JavaScript's "object", yet tables are vastly superior as they offer both the functionality of a hash map and that of an array.  Additionally Lua tables can be keyed by any type, be it string, number or even other tables.  JavaScript is far more limited, the only thing that you can key "objects" by is a string.
  JavaScript offers a separate type called Array which allows you to do what you can already do in Lua with it's basic table.

2)  JavaScript has no functionality for importing code from one file into another.  Most people seem to resort to either creating a mega file, which contains all of their code, or just importing every file at the top of their HTML page.  This seems exceedingly crude to me.

3) LuaJIT is a custom virtual machine which gives Lua the best performance of any Dynamic language, even Google's V8 doesn't compete(over 2X as slow).  Huge advantage to Lua for this.


Advantage JavaScript:


 1) Now syntax wise I do prefer JavaScript, for as long as I used Lua I just never felt any particular love for the Fortran style of syntax, which requires excessive typing   JavaScript uses a syntax very similar to C, C++ etc. so most programmers will immediately be able to jump in.

2) Lua uses 1 instead of 0 as the base index into arrays etc.  This is out of sync with practically every other language in existence, and while not a major issue, it is something that should have been avoided. NOTE: you can use 0 if you want, it won't break, but most public code assumes a base of 1.



  Overall I currently feel that Lua is the superior language, and wish it were available for client site scripting of web pages.  Web programming seems to have evolved half-hazardly at best, and the only widely supported client side scripting language is JavaScript, so of course this is what I must use...

Web Host

 I've been dabbling around with web programming lately, so far just using HTML and javascript, but at some point I will need a web host, so I've been looking into various methods.

1)  Amazon EC2: Amazon's well known cloud computing service.  The cheapest model is called "Micro Instances" and costs $0.02 per hour, which translates into $14.5 per month.  Not so bad, although you do also have to pay for storage separately.
   EC2 is used by logging into your instance via remote desktop, so you have the freedom of running it pretty much however you want.


2) Google App Engine:  Google offers this alternative to EC2.  The nice thing about this service is that it is 100% free for up to 5 million page views per month.  It does force a certain approach to writing your server though, as you it can only be written in Java or Python and you have to use some specific Google API's for data storage.

3) Windows Azure:  Microsoft's cloud service.  Integrates well with Visual Studio, as they offer a plugin for it. The smallest instance they offer is still $0.05 per hour, over double the price of Amazon.  This seems to be the least appealing of the bunch for price, but does offer some integration with VS and .Net to make up for it.





 I think I'm going to try Google App Engine first, since well, it's free.

Thursday, March 24, 2011

Hilarius Old Guy Pat Condell


Makes fun of the three major cults spawned in the middle east: Islam, Christianity, and Judaism.




  Islam is the current worst of the bunch, a title which they have vied for over the centuries, and deserves absolutely no respect--not that any religion deserves respect, unless proven it has a leg to stand upon.

Christianity and Judaism are much more moderate, and while many practitioners of these religions are balanced enough to know that secularism and separation of church and state are absolutely essential, a growing number seem to have a desire to transform the USA into a dark age theocracy.

  One of the fundamental flaws of many modern countries is the assumption that religion is somehow special.  That it needs to be accommodated, and that no critical discussion can occur regarding its veracity.

Religion is no different than any other belief separated from reality, if there is no evidence to support a belief, logic dictates a skeptical stance.  Divorcing oneself from reality is not healthy, see Sharia law.


 Our accommodation of beliefs separate from reality means that large numbers of our population think we must allow that Islam, of which some branches posses a dark age perspective on basic human rights, be given the same privileges as other religions.  This leads down a potentially very dark path, what is to stop Islam from spreading until it has a majority in Europe?  What follows?  Repeal of basic human rights? Woman go back to being second class citizens?  

 Why risk this?  The more logical path is to reduce the privileges given to ALL religions, thus reducing the impact of Islam, and any other fatally flawed religions that might crop up in the future. By privileges I mean such things as tax breaks, letting believers break certain laws/rules because they 'go against their religion', and the general assumption that clergy are useful/good and so should be given wide berth(clergy are some of the scummiest people on Earth).

   Liberal democracy, the foundation of the West, and fundamentalist religion are simply not compatible.


From Wikipedia:

In 2010 a United States diplomatic leak published by Wikileaks showed that a survey conducted by the UK Center for Social Cohesion on 600 muslim students at 30 universtities showed that 32 % supported murder in the name of Islam and that 40% want Sharia law in the United Kingdom.[28]


If that isn't fucking scary I don't know what is.




 It will be interesting to see just what happens in Egypt, can they actually create a secular and humane society, in other words, a true liberal democracy? Or will it be, as seems more likely, a theocracy posing as a democracy?  I certainly hope they succeed-- but Islamic history indicates this has a fat chance in hell.