Category Archives: Server

Phil 8.14.15

8:00 – 6:00 SR

  • Doing the reverse commute today – meeting with Ronda between 3:00 – 4:00.
  • Could not get the userId over from the login directive over to the flyoutPanel directive. So rather than pass in individual values to the login, I’m now passing the same session object to both. That works fine. Cleaner, too:
    this.sessionMessageObject = {
        loggedIn:false,
        userId : -1,
        networkId: -1,
        serverTarget:"rssPull.php"
    };
  • I also like the way the call in the html looks:
    <ng-login-dialog message_obj = "mc.sessionMessageObject" ng-if = "mc.sessionMessageObject.loggedIn === false"></ng-login-dialog>

    It tells a better story, I think

  • Yay! got the service pulling down network names for a particular user!
  • Working on loading the full network.
  • For a break, started to migrate code to the server. The database won’t accept sourcing views generated by mysqldump -. I get an access denied. But using the the hand-coded sql in tnTableStructures, everything works.
  • Meeting with Ronda. The certs for the dev machine are bad? They seem to be OK on the production box. We installed tomcat and mySql on the dev box and verified that they were running.

Phil 8.13.15

8:00 – 5:00 SR

  • Still no admin
  • Gave Lenny the FizzBuzz test. He’s trying to solve it in Excel. And he did a fine job. Something to know about the Excel IF function. It’s an implicit ELSEIF. So always start with the narrow case and work out.
  • Going to add views to chart_data db for pulls, rather than submit a join directly.
    • Ok, that was awesome. Views. Are. The. Best.
    • Changing queries in the PHP to use the views. Done.
  • Get network listing, selecting and loading working
    • got the interface built and running
  • Make the query into a flyout where the buttons are still visible in the collapsed state. Will also have to change the size of the webgl div? Or just overlay it?
  • Updated lib to angular 1.4.3 – no changes that I can see.

Phil 8.11.15

8:00 – 5:30 SR

  • No admin
  • Got pulled down the CSS rabbit hole and got nowhere, but I spent 2 hours doing it.
  • Fixed guids for Google News items – top news did not match targeted searches. Now it’s simply the link.
  • Added saving of pictures from NLP
  • restructuring the rsstestbed
    • The first thing that is always done is that something is added to the network.
      • Search – google news rss.
      • URL – if selected from the list provided from the search, then a link is made. Otherwise, it’s a new start.
      • NLP – any URL that comes back has author, title, keywords, entities and concepts associated with it. These are attached to the URL that is added to the network. Because there is only one item of each type, implicit networks are made that connect URLS
      • Ratings point to an item or another rating. They can also point to an URL (which is then NLP’d for relations)

Phil 8.10.15

8:00 – 3:00

  • And still no admin
  • Today we figure out how to link items in the database that are linked in the display. Since a query can actually combine several sub-queries, I need to either send up an array of items or fire off multiple requests.
  • So first, I think that only the selected item(s) should be able to be the ‘parent’ of a query. That means that I first have to make it so that clicking on the space between items doesn’t unselect. Done. Now making multiple select if you hold down the ctrl key while clicking. Done.
  • Having a very annoying issue where the text api as used in the Alchemy PHP API is returning one thing and the Alchemy demo is returning something entirely different. I’m getting the former and want the latter:
    Array
    (
        [status] => OK
        [usage] => By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html
        [url] => http://krugman.blogs.nytimes.com//2015/06/29/the-awesome-gratuitousness-of-the-greek-crisis/
        [language] => english
        [text] => Barry Eichengreen ... fundamentally unworkable.
    )

    So why is this different?

      "status": "OK",
      "usage": "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html",
      "url": "http://krugman.blogs.nytimes.com/2015/06/29/the-awesome-gratuitousness-of-the-greek-crisis/?_r=0",
      "language": "english",
      "text": [
        {
          "provider": "theconversation.com",
          "link": "https://theconversation.com/path-to-grexit-tragedy-paved-by-political-incompetence-43988"
        },
        {
          "provider": "krugman.blogs.nytimes.com",
          "link": "http://krugman.blogs.nytimes.com/2010/04/28/how-reversible-is-the-euro/"
        },
        {
          "provider": "www.imf.org",
          "link": "http://www.imf.org/external/pubs/ft/fm/2015/01/fmindex.htm"
        }
      ]
  • A Unifying Framework for Behavior-based Trust Models and who’s cited this

Phil 8.7.15

8:00 – 4:00 SR

  • And still no admin
  • Meeting with Debbie next Wednesday at 9:00
  • Fixed various timesheet issues
  • Working on storing and retrieving networks
    • Items should only be added, not deleted
      • Modifying GoogleNewsRSS so that it can create and retrieve items using networkDbIo – done
      • Sending up userId for queries. Also setting data xfer so that data is sent up as an IPostObject. – done
    • Is this the same for associations?
    • Associations are added and removed from tn_network_data
    • All sessions start with a default name (user+timestamp?), which can be modified
      • Added a description field to tn_networks.
      • Added a title field to tn_items that I somehow overlooked

Phil 8.5.15

8:00 – 4:00 SR

  • Still no admin.
  • Need to add checks for http(s):// in the freeform text. If it’s there, open the url, if it’s not then send to GoogleNews
  • I think the best way to get the results from the network queries is to take the raw rows from the server and parse them into graphical network data. I will need to add variables for id_index and type (table at least, maybe more)
  • Query for all items on a network with labels synthesized from id_index and type name:
    -- get all the items in a network
    select ti.id_index, ti.guid, ti.item_type, ty.name as type_name, CONCAT(ty.name, '_', ti.id_index) as label, ti.text, ti.float_val, ti.link, ti.image
    from tn_network_data dat 
    inner join tn_associations a on dat.assoc_id = a.id_index
    inner join tn_items ti on a.target_id = ti.id_index
    inner join tn_types ty on ty.id_index = ti.item_type
    where dat.network_id = 1
    union
    select si.id_index, si.guid, si.item_type, ty.name as type_name, CONCAT(ty.name, '_', si.id_index) as label, si.text, si.float_val, si.link, si.image
    from tn_network_data dat 
    inner join tn_associations a on dat.assoc_id = a.id_index
    inner join tn_items si on a.source_id = si.id_index
    inner join tn_types ty on ty.id_index = si.item_type
    where dat.network_id = 1;
  • Query for all associations on the same network
    -- get all the associations in a network
    select a.id_index, u.login, a.user_id, si.guid as source_guid, a.source_id, ti.guid as target_guid, a.target_id, at.name as assoc_name, a.assoc_type, a.created_on
    from tn_network_data dat 
    inner join tn_associations a on dat.assoc_id = a.id_index
    inner join tn_types at on a.assoc_type = at.id_index
    inner join tn_items si on a.source_id = si.id_index
    inner join tn_items ti on a.target_id = ti.id_index
    inner join tn_users u on a.user_id=u.id_index
    where dat.network_id = 1;
  • Ok, let’s see if we can pull this down and parse it!
  • Got into some kind of issue trying to use my old (pre ATSBase) login directives. Rebuilding.

Phil 8.4.15

8:00 – 4:30 SR

  • Still can’t get on the server.
  • Steve’s found a potential SW engineer. I’ve asked for her resume.
  • Cleaning up the networkDbIo.php code. I’ve also realized that ratings can have ratings. Changed tn_ratings to have a rating_type and a target_type.
  • Finished with addAssociation. It’s like item in that if one exists already we don’t want to create an exact copy with a new date.
  • Building the dataprovider object which requires a list of unique items, pulled from associations. So how do you get distinct items from two columns in mySql? StackOverflow has the answer. In my case, it’s:
    select ti.id_index, ti.guid, ti.item_type, ti.text, ti.float_val, ti.link, ti.image
    from tn_network_data dat 
    inner join tn_associations a on dat.assoc_id = a.id_index
    inner join tn_items ti on a.target_id = ti.id_index
    where dat.network_id = 1
    union
    select si.id_index, si.guid, si.item_type, si.text, si.float_val, si.link, si.image
    from tn_network_data dat 
    inner join tn_associations a on dat.assoc_id = a.id_index
    inner join tn_items si on a.source_id = si.id_index
    where dat.network_id = 1;
  • Ok, that part worked. Now working on building the rest of the data provider. Below is the current structure. Not quite sure how to convert the rows from the database pull to the data3D. This might be multiple queries. The edges, on the other hand are more straightforward. Might need a (unique within the type?) label for the tn_items though.
    this.dataProvider = {
       type:'XYZ',
       bounds:{xmin: -5, xmax: 5, ymin: 0, ymax: 5, zmin: -5, zmax: 5},
       data3D:{
          Speakers:{
             story_0:{xpos:5, ypos:5, zpos: 0, mass:0.9811469360199058, imageLoc: "./assets/checkerboard.jpg", notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_1:{mass:1.1514476240300544, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_2:{mass:0.7468225934308907, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_3:{mass:1.2358769332362016, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_4:{mass:1.1071240443456865,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."}
          },
          Subjects:{
             story_0:{xpos:-5, ypos:5, zpos: 0, mass:1.2374208338984265,  imageLoc: "./assets/checkerboard.jpg", notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_1:{mass:0.4781579303734177,   notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_2:{mass:0.32479382813444624, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_3:{mass:0.9931577182910525,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_4:{mass:1.1995832704567262,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."}
          },
          Platforms:{
             story_0:{xpos:5, ypos:-5, zpos: 0, mass:0.2805132286382044, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_1:{mass:0.9416553793139485, notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_2:{mass:1.10169089403032,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_3:{mass:0.3067471426015206,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."},
             story_4:{mass:0.6582850955300814,  notes:"Ut erat ante, varius ac elementum eget, cursus pulvinar purus. Nulla venenatis nec odio ut scelerisque. Donec hendrerit porta mauris."}
          }},
       network: {
          edges:[{source:"Speakers.story_1", target:"Speakers.story_2", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_2", target:"Platforms.story_0", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_3", target:"Subjects.story_2", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_3", target:"Speakers.story_1", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_4", target:"Subjects.story_1", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_4", target:"Speakers.story_3", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_4", target:"Speakers.story_3", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Speakers.story_4", target:"Speakers.story_2", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Subjects.story_0", target:"Subjects.story_3", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Subjects.story_2", target:"Subjects.story_0", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Subjects.story_2", target:"Subjects.story_3", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Subjects.story_3", target:"Speakers.story_4", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Platforms.story_0", target:"Platforms.story_4", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Platforms.story_2", target:"Platforms.story_0", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Platforms.story_2", target:"Speakers.story_0", val:1, type:Wgl3dCharts.DEFAULT},
             //{source:"Platforms.story_3", target:"Speakers.story_1", val:1, type:Wgl3dCharts.DEFAULT},
             //{source:"Platforms.story_4", target:"Speakers.story_1", val:1, type:Wgl3dCharts.DEFAULT},
             //{source:"Platforms.story_4", target:"Speakers.story_4", val:1, type:Wgl3dCharts.DEFAULT},
             //{source:"Platforms.story_4", target:"Subjects.story_2", val:1, type:Wgl3dCharts.DEFAULT},
             {source:"Platforms.story_4", target:"Platforms.story_1", val:1, type:Wgl3dCharts.DEFAULT}
          ]
       }
    };

Phil 8.3.15

8:00 – 6:00

  • Lost access to servers – gotta reapply
  • Timesheets.
  • Just discovered Resilience Engineering. Very useful thinking.
  • Changed NetworkComponent.jiggle so that motion vectors are always reset as well. Otherwise, if the graph has exploded, then the saved motion vectors will continue to explode.
  • Working through the touches and associations. Remember to return the numeric and string values for now.
  • Finished getTouches()
  • Finished addAssociations() and getAssociations(). The construction of the where clause was getting brittle, so I added a WhereClauseObject that cleans up and generalizes things.
  • Adding touch counts

Phil 7.31.15

7:30 – 2:30 SR

  • AC service today, so I’m working from home.
  • Got server code running at home, now testing on production server.
  • Had to play around with config files, but everything is working now.
  • Working out a way to identify an item for easy searching when there is no (Google) guid. Trying an sha1 hash of the elements used to make the item.
  • Finished addItem()
  • Finished getItem()
  • Finished addItemRating()
  • Finished getItemRatings()

Phil 7.30.15

8:00 – 4:30 SR

  • Still working on getting software for the new dev machine.
  • Added tn_ratings and tn_touches to handle historical behavior. I realized that items shouldn’t have histories in a relational db. Histories should point at items. Sideways thinking.
  • Setting up base and subclasses for the DbIO.
    • baseDbIo
      • improved fail returns
    • userDbIo
    • networkDbIo
      • getUserNetworks
  • Working on item find/add/change/delete PHP functions

Phil 7.29.15

8:00 – 4:30 SR

Phil 7.28.15

8:00 – 5:00 SR

  • Fixing charts – everything done but TST. Did we do that one by hand?
  • Had a thought that the entire financial system could be represented as a network, which could be made to fit into the framework I’m trying to develop. It might let me collapse the project into something small enough for one person to manage, since the database would shrink to only a few (5?) tables…
  • Ordering Software – Visual Studio and IDEA Ultimate
  • A Visual Introduction to Machine Learning
  • Starting to build the server classes that will access the network data
    • A new component doesn’t have have an id_index, so we will know when to create and when to update. Deletion may be tricky, since multiple networks may share an item. We may just want to keep deleted items around anyway, since the fact that they were once attached might mean something…?
    • Class is up and doing raw calls to the database, which, of course is dangerous as heck. Working through how to do bound parameters. Staring with the addUser(), checkUser() and changePassword() methods, since they’re needed and unlikely to change.
    • Discovered the very nice PHP Data Objects (PDO) and this helpful tutorial. I have the checkUser() and rawSqlQuery() methods converted. Need to add some error checking, but very happy.

Phil 7.21.15

8:00 – 4:30 SR

  • Server is behaving with the stricter trustchain.
  • This is the AlchemyNews REST API Documentation, and the list of fields that can be returned. And Twitter access, BTW.
  • Blew through my limits for the day trying to figure out keywords. Asking for academic license.
  • A good example of how to group query elements: http://alchemyapi.readme.io/docs/sentiment-analysis
  • Need to add sliders for attraction and repulsion (network scalars?). Implemented. Now I need to figure out some good values. I think that we might just have to scale attraction for linked items. It should clean things up and cut down the math a bit.

Phil 6.30.15

8:00 – 5:00 SR

  • Lenny submitted the list of equipment for development.
  • Since we’re now on a new SSP, I need to get permissions to match.
  • More work on network chart data
  • Spent 2 hours on support line.
  • timesheets!