Monday, December 25, 2017

Dreams, Desires, and Aspirations

    Venturing into the foray of self publication, self broadcast, or anything else. 

    You have tried the self publishing world briefly.  You found ways to do epub formats and then having your e-reader handy tested the format to verify that your little collection of short stories could be read through a few times.  When to do:  A few weekends out of the year or when in a forced insta hire layoff!

    You ventured into self publication of music.  You generated more spotify notice than anything and paid at fractions of a penny for each listen.  Who actually buys an mp3?  You bought your own album!  When to do:  See time permits above...or otherwise when the unheated garage is tenable to practice sessions!

    You whizzed through another country at a blistering pace with camera firing in tote and attempted to market your natural landscape photography.  Having below entry level camera gear and nothing more would make far from justice the prodigious residence of imagery that should exist on market.  You might actually buy your own stuff on 500px.  If only having placed yourself on the NYTimes best seller's list, a marketing trend might suffice in giving you notice.  You pay yourself for zero sum net loss/gain and something out of nothing makes something!   When to do:  Any scant deal for government subsidized flight trips abroad with enough accumulated savings makes this two week sojourn possible! 

    You'll market your prowess in scripting languages, anything erudite making COBOL sexy again!  You find yourself fluent in the way of knowing lookups...mastery being no longer necessary, your mind is being read and understood better than you might have been able to express.  The vast language of machines could do much interpretive reading on the sequencing of natural language.  The designer you worked from one system into another, leaping on dev trends.    When to do:  boredom sets in.

    You'll sublet a room in your house.  Unless city or state regulators say otherwise.  In that case, it were likely utilizing some obscure 19th century law relating to people with hats walking where they shouldn't be...or pertinently the obscurum of commercial versus residential zoning.  When to do: Several weekends out of the year!

    You'll invest pocket change in the new stock.  You lost a sum in bitcoin.  IRA/401k account!  When to do:  the last time you drained the retirement account.

    You'll taxi people.  Everything to become as tiny as a rickshaw navigating the maze like corridors of a city sprawling into the sky.  You are at the base of everything.  When to do: this is your job on Wednesday!
 
     You'll leave an instant hire job for another opportunity.  Career transience is one's intelligence in knowing that office is a shared space in the tropics for a few afternoons with billowing storm clouds ominously overhead.  When to do:  This is your job on Friday!

     Your mind maps will be commerce.  So to your thinking processes which could be a commodity.  You will teach people how to live again.  Personal philosophy coaches and lifestyle administrators abound.  When to do:  This is your job on Tuesday!  

   The rest of the days of the week are given to the resilience of repurposing your life and the things around you!  A new mall has opened up down the street with explicitly that purpose even if stores exist in providing rehabitation of old habits.  You move like a modulus on the branch of time, always who you are and you should be!

     

Saturday, December 23, 2017

Call this redefinition

   Call this redefinition.
   Measure is by analytics.
   You have resurfaced the you that remembered a fragment of a line
   Educate oneself to know what could be remembered
   What is to learn? 
   No more marketing tomorrow!
   All of this will be automated in time! 
   No more sales! 
   No more mentoring!
   No more law! 
   

Eventful and uneventful

    Half a day and a year and a half later.  An eventful milestone passes nearest to the holidays.

    What can one say about that time?  The shroud of secrecy that claims any that knows without claiming to know, pretends without pretending.  Corporate schedules are routed like circuitutious liabilities and all the passive journals in writing with digital eyes.  Rotating through and through, stacking through the heaps, that class that asks for much.  Another aims her scanner at you and feigns to sleep, that is a place where much substance is made of anything beyond its due.  All hyperbolic in presence is the world of suspicion there in store.

Stack the heaps.
What remains seems endless with false corporate cheer.

Wednesday, December 13, 2017

React Firebase Deployments

   Some helpful hints to syntax errors, notably as related to 'npm run build' and 'firebase deploy' as related to syntax error shows either an older version a 'build/static/js/mainxxxxx.js' build or a current version but seems to be referencing an older version of this.

1.  Updating the 'index.html' file on new deployment.  Important to do this.  You can add a space in the file (or some character which makes the operation of the file functionally unchanged), for instance.

2.  In the Firebase console under the hosting tab, you may need to rollback to the current deployment, or at least ensure this has happened.  I have found that any new 'firebase deploy' command hasn't fully ensured updates of all deployment files to the latest deployment batch.

I have also experienced old cached site data remaining even upon refreshing firebase server data.  I am not certain why this seems to be more so the case either with 'firebase deploy' ments or 'firebase serve' (local hosting), but with chrome browser, you can do a refresh load with ctrl+'reload'.  Seems to remedy old data in the browser system. 

My current experience as of 12/13/2017

  

Sunday, November 5, 2017

React App recommendations for inlining svg art

Recently playing around with Adobe Illustrator in conjunction with Animate CC for export into ReactJS .  However, as I've encountered with Animate CC choppy motions for animating svg group elements coupled to all the hassle of inlining svg plus simil code...this allegedly is trending down in terms of popularity, one particular bright spot that I've found for inlining rapidly lengthy pieces of svg code comes by way of transpiling (in cli environment) an svg into reactjs components.  It is done easily at console.  Here's a link that helps doing such...

https://medium.com/@scbarrus/transform-raw-svg-files-into-react-components-in-seconds-25faf56a6f07

I've found that it does what it says in a second for large svg files.  Just follow instructions for installing globally via npm.

Of course aside from working on a component search object element and then modify inside reactjs component object for animation with loop call inside such component (in other words creating js side animation), css is an alternative as well.  React by the way is nice for creating ios and android apps while avoiding all the hassles of learning to have to code in swift and using xcode or android and java in general.  React apps can be provisioned for web apps as well. 


Friday, October 13, 2017

Angular backend integration problem...custom parser

I found any number of back end parsing solutions that didn't work with my angular app, and I spent more time researching this problem in the long run.  It took me 30 minutes (no kidding) to write a functioning string parser for approximately several hours of non solution to Angular typescript component interfacing.

Example parser

  
class ParseObject{
    toParseObj: string;
    pitems: PostItem[];
    constructor(objstr: string){
        this.toParseObj = objstr;
        this.pitems = [];
    }
    catchEscape(rs: string[]){
        var i = 0;
        var rtnrs: string[] = [];
        var setcontinue: boolean = false;
        for (let r of rs){
            if (setcontinue){
                i+=1;
                setcontinue = false;
                continue;
            }
            if (r[r.length-1] == "\\" ){
                if ((i+1) < (rs.length-1)){
                    let fr: string = rs[i+1];
                    rtnrs.push(r+fr);
                    setcontinue = true;
                }
            }
            else{
                rtnrs.push(r);
            }
            i+=1 
        }
        return rtnrs;
    }

    iterateParse(strP: string, strset: string[]){
        for (let strp in strset){
            var splitobj = strp.split(strP);
            var nsplitobj = this.catchEscape(splitobj);
        }
    }

    parseString(){
        /*{"records":[{"name":"JimBob","message":"Hello katz!"},{"name":"Dr IQ","message":"Hello hello my name is Jim Bobby.
 Been an old friend of shorty there!
 Gratz!"}]}*/
        //presumes user properly input string for formatting
        var rs = this.toParseObj.split(']}');
        console.log(rs);
        //catch escapes
        var nrs = this.catchEscape(rs);
        console.log(nrs);
        let nrs0 = nrs[0];
        var nrs1 = nrs0.split('{"records":[');
        var nrs2 = this.catchEscape(nrs1);
        console.log(nrs2);
        let nrs3 = nrs2[1];
        var nrs4 = nrs3.split("},{");
        var nrs5 = this.catchEscape(nrs4);
        console.log(nrs5);
        for (let nr of nrs5){
            //split "," for key,value s
            var nrs6 = nr.split(",");
            var nrs7 = this.catchEscape(nrs6);
            console.log(nrs7);
            let nrs8 = nrs7[0].split("\"name\":");
            let namevalue = nrs8[1].split("\"")[1];
            console.log(nrs8);
            let nrs9 = nrs7[1].split("\"message\":");
            let messagevalue = nrs9[1].split("\"")[1];
            this.pitems.push(new PostItem(namevalue,messagevalue));
        }
        return this.pitems;
    }
}
class PostItem {
    constructor(public name: string,
                public message: string) {
    }
  }

You can build a custom service to be used with a promise


Here's my component service
import { Component, Injectable, OnInit } from '@angular/core';
import {PVector} from './lineData';
import {frameResizer} from './frameResizer';
import { routerTransition } from './router.animations';
import {Guest } from './guest';
import {Http, Headers, RequestOptions, Response} from '@angular/http';
import 'rxjs/add/operator/map';
import 'rxjs/Rx';
/*{"records":[{"name":"JimBob","message":"Hello katz!"},{"name":"Dr IQ","message":"Hello hello my name is Jim Bobby.
 Been an old friend of shorty there!
 Gratz!"}]}*/

class ParseObject{
    toParseObj: string;
    pitems: PostItem[];
    constructor(objstr: string){
        this.toParseObj = objstr;
        this.pitems = [];
    }
    catchEscape(rs: string[]){
        var i = 0;
        var rtnrs: string[] = [];
        var setcontinue: boolean = false;
        for (let r of rs){
            if (setcontinue){
                i+=1;
                setcontinue = false;
                continue;
            }
            if (r[r.length-1] == "\\" ){
                if ((i+1) < (rs.length-1)){
                    let fr: string = rs[i+1];
                    rtnrs.push(r+fr);
                    setcontinue = true;
                }
            }
            else{
                rtnrs.push(r);
            }
            i+=1 
        }
        return rtnrs;
    }

    iterateParse(strP: string, strset: string[]){
        for (let strp in strset){
            var splitobj = strp.split(strP);
            var nsplitobj = this.catchEscape(splitobj);
        }
    }

    parseString(){
        /*{"records":[{"name":"JimBob","message":"Hello katz!"},{"name":"Dr IQ","message":"Hello hello my name is Jim Bobby.
 Been an old friend of shorty there!
 Gratz!"}]}*/
        //presumes user properly input string for formatting
        var rs = this.toParseObj.split(']}');
        console.log(rs);
        //catch escapes
        var nrs = this.catchEscape(rs);
        console.log(nrs);
        let nrs0 = nrs[0];
        var nrs1 = nrs0.split('{"records":[');
        var nrs2 = this.catchEscape(nrs1);
        console.log(nrs2);
        let nrs3 = nrs2[1];
        var nrs4 = nrs3.split("},{");
        var nrs5 = this.catchEscape(nrs4);
        console.log(nrs5);
        for (let nr of nrs5){
            //split "," for key,value s
            var nrs6 = nr.split(",");
            var nrs7 = this.catchEscape(nrs6);
            console.log(nrs7);
            let nrs8 = nrs7[0].split("\"name\":");
            let namevalue = nrs8[1].split("\"")[1];
            console.log(nrs8);
            let nrs9 = nrs7[1].split("\"message\":");
            let messagevalue = nrs9[1].split("\"")[1];
            this.pitems.push(new PostItem(namevalue,messagevalue));
        }
        return this.pitems;
    }
}
class PostItem {
    constructor(public name: string,
                public message: string) {
    }
  }

@Injectable()
export class SearchService {
  apiRoot: string = 'url/path/to/your/fetch.php';
  results: PostItem[];
  loading: boolean;

  constructor(private http: Http) {
    this.results = [];
    this.loading = false;
  }

  search() {
    let promise = new Promise((resolve, reject) => {
      let apiURL = this.apiRoot;
      
      this.http.get(apiURL)
          .toPromise()
          .then(
              res => { // Success
                console.log(res);
                var json=JSON.stringify(res);
                var jobj = JSON.parse(json);
                var jobj2 = jobj["_body"];
                //var jobj3 = JSON.parse(jobj2);
                console.log(jobj2);
                var parseobj = new ParseObject(jobj2);
                this.results = parseobj.parseString();
                this.results.reverse();
                console.log(this.results);
                
                /*
                for (let job in jobj){
                    this.results.push(new PostItem(job.name, job.message));
                }
                //this.results = res.json().results.map
                /*
                this.results = jobj.map(item => {
                  return new PostItem(
                      item.name,
                      item.message
                  );
                });*/
                // this.results = res.json().results;
                //posts = res.data.records;
                resolve();
              },
              msg => { // Error
                console.log("hit error");
                reject(msg);
              }
          );
    });
    return promise;
  }
}
Also make sure to make http global via app.module.ts and adding your service as a provider with
import { HttpModule } from '@angular/http';

...

@NgModule({
  imports: [
    ..., HttpModule
  ],
  declarations: [
   ...
  ],
 
  providers: [ SearchService ],
  ...
})

Deployment of your Angular app

You've may know the basics about instancing your Angular app via command line environment with ng serve yada yada yada, but do you know how to build bundle your app for distribution/deployment?


ng build --prod

 command will create dist (distribution folder with javascript bundles). 

Then with the generated files in the dist folder, you need simply upload to deployment (site host) and your site should be up and running.  You can google search to do deployment to AWS (amazon) or any other site hosting solution.  

Oblivion

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