Thursday, January 3, 2013

Segway to the previous post...mentions to the possibilities of interstellar travel

   Couldn't discount nano technology here.  Why so?  It seems if you needed the optics and instrumentation to accomplish the task of research, if a corresponding piece of hardware could developed in a streamlined manner relative a predecessor, why use bulkier more massive technology that would increase fuel requirements for travel.  If you could significantly reduce mass you reduce fuel, and this in turn leads to an added possibility that the first interstellar voyagers would indeed not only be machines, but one's that were quite small.  It would be added risk cost factors should also diminish or at least the acceptability for loss threshold would only increase with declined cost otherwise.  Or in other words, the first interstellar visitors could be also likely those that were completely unseen to the naked eye?  Seems less glamours or spectacular to the idea of gargantuan structures, or at least designed around the premise of housing so much a human colony, but likely it seems the reality of possibilities outside of faster then light travel.

    Of course, I mentioned in some past attempt at a bit of science fiction the idea, that such machines themselves (a sort of adaptation from Clarke's envisioned Von Neumann device), a sort of generic self assembler that should work in adaptive arrays.  Ideally for instance, they might also contain maps, something like genetic blueprints in which surveying and assembling indigenous materials for any desired structures, or in other words, why spend all the fuel to send the materials in building something that could be built readily with materials around.

   It seems much of mission work at present were spent devoting resources to travel to one and one destination only rather then forming a mission that could accomplish the task of sweeping an area for study at one time.  Seems wasteful to me in a way...or in other words, if arrays of nanos could spend the task building colonies for research purposes at many given sites that were part of an area sweep, why not send colonies to multiple hosts sites at once.  You wouldn't be limited to one crater site, or one ideal candidate in theory but many sites on a given site with a fleet of nanos for instance, which in turn build larger scale research structures at the site rather then delivering mass and spending all the fuel and limiting candidate site study possibilities.

Wednesday, January 2, 2013

Map of the universe and relativism

Starting with a map of the universe as an inspiration point, a thought occurred to me...going back to the representation of the universe as a map were done so with all sorts of implication.  It would seem the map were cosmological projections of structures in time that may or may not exist, or at least these structures would likely be in much different alignments relative to the past that were projected into our present.  The map it seems were entirely relative, at least how might a map coincide with a map in a different galaxy that were closer to another galactic structure then ours...it seems they would be mapping a time relative to ours that appeared different to them relative us, and vice versa.  Could you hand a map to an alien visitor for another galaxies and have them clearly understand much of what were known...maybe, maybe not?  And given the varied subdivision of space and overall considering a known cross sectional length of the universe, there would be potentially a very large number of maps that could be drawn at any given time that should be difficult in reconciling correspondences?

 All of these drawn maps would be called perspective maps in some manner, or at least the problem of perspectively couldn't be neglected in the relational scope from map to map.  Of course, generally being confined to much smaller distances in travel, its not so much a problem considered however at the moment for our planet.

Now consider as thought experiment 'grand map' that expressed all structures of the universe at their present location at any given time that were all local in the time relative sense...meaning this were the true position of such structure at a given point in time that could be characterized as local present, or in other words a map derived in all space at a local present time in all such locations.  This map it would seem would could be understood in all local space relatively speaking, but more distant cosmological structures would neither visibly correspond to the optical images present from any given vantage.  Of course, it seems some structures could be missing for the compilation of all such local presents...if you were advanced enough you could apply predictive maths in deducing an optical map that might correspond to a given vantage, but this were always limited in scope given the complexity of the n bodies interaction problems were concerned at the detailed level.  You might find something approximately resembling but neither finely resolved.

Monday, November 26, 2012

Node Cookbook, Chapter 6 Making an express web application

Now the particular issue that I've run into with this example is implementation of Jade mixin s in this example.  One I would indicate that the mixin in Jade is simply a short hand java script function for the Jade scripting system (inspired incidentally by Haml for Node).  Unfortunately, the Jade script, Profiles.Jade file includes what should apparently be defined as two empty functions which it appears automatically generate an error, but handled by the index.js through the main body apps routes/index.js script...sort of circuitous silliness in my opinion :) ...umm...book example script appears in some ways to be a mess, but... 

Monday, November 19, 2012

Node JS and Express 3 example problem, Child express application called inside a Parent express application

 The problem that I've seen though Express with Node JS, is stable implementation examples keeping to framework versions.  For example, a Node cookbook seems to provide excellent examples say from Express 2, but unfortunately at the time of writing either owing to changes since then through version or for any other reasons, I've spent time studying and trying to re work examples for basic functionality.  I'd give the latest problem example:  This would include using a app.use() call on another express app embedded into a main express app.  Apparently while mount uri citation works, the uri is structurally not integrated into the main express apps router for some odd reason.  I'd indicate that I've been able to use app.use() with uri for mounting functions with resend and request calls implementing by default routing...by the way if you use a console.log(app.routes) call to see the uri as route, it won't show, but will if you alternately use app.get() for the same function.
     Why the big fuss over the call of one app to another?  Well according to the Node cookbook chapter 6 example, going from sub chapter to the next, implementation of previous application functionality can be done so (in a class/module oriented) way simply copying the contents of one application and embedding it in the parent application.  Apparently the very basics of this functionality is handled with a

app.use(uri, require('./myappname/app'));

No problem here at least initially.  The problem that seems to manifest, at least in the latest version of Express somewhere in the process of child apps sending and receiving request or sending response.  At least in my example case, I used on the child express app, using the following function:


  app.use(function(req, res, next){
    res.send('hello world');
    next();
  });


It appears the parent app neither provides request communications to child express apps, or the child express apps aren't communicating to the local host...minding I did set up a listener on the child express app


if (!module.parent) {
  app.listen(3000, function(){
    console.log("Express server listening on port %d in %s mode",   app.address().port, app.settings.env);
  });
}


Thus getting a response Cannot GET /childappuri/ when the uri    localhost:3000/childappuri/ is called

At this point stumped what were occurring here.  Set up the basic of examples here again...otherwise, the workaround were embedding much in the main app all of the process (a little more involved).  Hoping I could find a working example on the  most current express 3 version, but couldn't aside from already provided advice through common forums such as StackOverflow which were general enough, didn't see anything at the moment.


A solution:
Thanks to another posting in StackOverflow.  The simplest that I've found is simply exporting the app.
Thus I added after all configurations and routing adds the following in the body of child express app in the app.js file:

module.exports = app;

All references above in the parent app should be used, and make sure that the server instantiation in the child express app is removed while using a listener (hadn't checked to see if this were technically necessary).

Thursday, November 8, 2012

Node Cookbook, Chapter 6 implementation of sessions, site wide management

Okay reading Node Cookbook.  I am having difficulties with an example here, namely, Chapter 6, custom middle ware for site wide management, under initializing and using a session.  Here the problem encountered namely begins with the alternate use of the deprecated function dynamic helpers().  In this implementation the book calls for


app.locals.use( function (req, res) {
        res.locals.user = req.session.user;
    });
However this gives rise to error at least in my case, so a slight modification of this alternately is


app.use( function (req, res) {
        res.locals.user = req.session.user;
    });
which seems to resolve some issue here, but then I get an error in the views>login.jade file referencing user.

Okay some additional s here of notable mention.

In the views/login.jade  file I had to change the reference from

user

to

locals.user

or notably I received an error that user wasn't defined oddly enough.

Secondly I instantiated the function in the configures portion of the app in the following manner:


app.configure(function(){
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.cookieParser('kooBkooCedoN'));

  app.use(express.session());
  app.use(require('./login'));
  app.use( function (req, res, next) {
        console.log('hit func1');
        res.locals.user = req.session.user;
        next();
    });
  app.use(app.router);

  app.use(express.static(path.join(__dirname, 'public')));


});

Try moving this app.use() function with res.locals.user assignment just after the app.use(app.router); instantiation and you might as I did have problems with your function being called even though it were technically instantiated, or this is to say, I've found this function has to be called before the app.router instantiation but not before the require('./login') instantiation !!!  Obviously the assigning before the require(./login) assignment references res.locals.user before user has technically been assigned in the ./login module, or at least received an undefined assignment error here, and then it appears that app.router assignments causes disregard in express of any app.use() response, request, next functions needed to set res.local.user...so order of instantiation is very important here.

Since I am a noob when working with express here, it is worth noting that that app.get() function that conflict with app.use() functions on response and requests basis neither coupled may with next(); generate un desired results, or at least I've run into these sorts of problems especially as pertaining to GET page routing.

Tuesday, November 6, 2012

Electoral outcomes python script


The following python scripts computes a permutation of outcomes for electoral success if Obama holds leaning blue states.  I computed a total of 18 distinct electoral outcomes which lead to success, this actually could be reduced a bit, since there maybe set overlap if not including the state of Florida which automatically provides Obama a win if Obama holds every other projected state and leaning states are included.  Just run script in Idle then type 'perms' or you could modify script for a list print

mapdict = {'va': 13, 'nh': 4, 'oh': 18, 'wi': 10, 'ia': 6, 'co': 9}

def checkset(pickmap, mappicks):
    mpcheck = True
    checkcont = 0
    for mappick in mappicks:
        checkcont = 0
        for pick in pickmap:
            if pick in mappick:
                checkcont += 1
            if checkcont == len(mappick):
                return True
 

def checkmap(inmap, score):
    mappicks = {}
    mappick = []
    newscore = score
    for state in inmap:
        newscore = score
        newscore += mapdict[state]
     
        mapcopy = inmap.copy()
        del mapcopy[state]
        if newscore < 27:
            #print(state, len(mapcopy))
            returnpicks = checkmap(mapcopy, newscore)
         
            for pick in returnpicks:
                #print (state, pick)
                if returnpicks[pick] > 26:
                    cpick = list(pick)
                    rpick = cpick[0:len(cpick)]
                    rpick.append(state)
                    rtuppick = tuple(rpick)
                    if not checkset(rtuppick, mappicks):
                        mappicks[rtuppick] = returnpicks[pick]
         
        else:
            mappicks[tuple([state])] = newscore
    return mappicks


perms = checkmap(mapdict, 0)

Friday, October 26, 2012

Windows 8 Pro upgrade experience.

    Fortunately for my Lenovo laptop, upgrade integration went smoothly and nicer then I had expected.  I were able to do the upgrade even preserving previous side by side installations and master boot records with an existing Linux distro.  The value for the operating system excellent likewise.  The Windows 8 user interface may take some time for me to get used to but in fairness the same difficulties could have been much the same for Ubuntu's Unity.  Its seems the interface reminds of the integration of a tablet or alternate peripherals culture.  Here relative the browser based interfaces, laptop and desktops such users might seem to benefit less from the start menus window 8 integration messaging, email, and peoples apps, for instance, but in comparison it seems even on the Linux side of distribution, umbrella messaging app integration s appears to be a trend.  Honestly, in the some many years of staying away from facebook or twitter, I succumbed and signed up for accounts, alongside some others not withstanding Tumblr.  I am too poor, of course, to work extensively with peripherals: smartphones, tablets and anything else that could serve to benefit greater here, but for the value I couldn't complain.  Aside from the start menu and other Ubnutu"lensing" like aspects offered here, the overall desktop experience isn't so much a stretch from the windows 7 interface.  Pulling up applications by the way is a bit different...or at least I determined this indirectly using a pull the start menu > right mouse button > hit all apps combination to do the trick of finding apps not immediately listed in start menu.  Likewise if you manage to pull the search tab from the right side bar.  Here there is a locus trick with the mouse pointer that I hadn't figured out...if there were more of a tablet or surface like touch elegance found with the mouse pointer, I might be more dazzled by this otherwise.  If you were expecting for elation here with the desktop, or laptop that hadn't resembled a tablet, the value I think brings more here relative the upgrade from windows 7 to 8 that seems more so and so for a really new experience.  Generally speaking I hadn't lost anything to my recollection in the transfer of data and applications, and there again these days now with ever increasing use of web based applications and online storage filling the role of computing needs, I've found less hassle in moving to a new operating system, and otherwise, mostly I was prepared to lose my Linux distro for the hassle of a new side by side attempted installation, this time windows seemed a little more friendly to the alternate operating system presiding on my laptop.
     Lastly, this brings a theory to mind and why some users absolutely disliked the Unity interface and jumped ship from Ubuntu to Mint which retains some of the more traditional and conservative desktop UI.  It would seem windows 8 parses between a new design philosophy and the tradition having been the mainstay which were the desktop itself, I actually liked the new windows 8 start interface, the old desktop still reminds that something of previous cultural traditions are hard to die, or at least something of a resistance to the idea that the larger screens would vacate old desktop models completely.  The application switcher (pull this by toggling the thumb start link then on the same vertical axis hoover the mouse to the north of this location) might have hinted at possibilities here: forgoing all sorts of potential application screen clutter and thumb tabs that scarcely remain to be understood...okay more likely with the added tab too many in the browser.  Honestly I would have been even happier if my windows 8 seemed more then ever like an elegant tablet, however having the mouse peripheral driving the interface in some manner.  Maybe a bit much for many users vested in conservative traditions, but then the traditional desktop has been there and if windows 8 looked looked so much like its pre cursor what could one say of the next desktop generation?  

Oblivion

 Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...