Category Archives: PHP

Phil 9.3.15

8:00 – 3:00 SR

  • More hoops to jump through for dev machine admin.
  • Training
  • Working with Ronda to get the new servers visible on the lab’s network.
  • Add a test in the NetworkChartInfo.addNetItems() method that checks to see if an item exists in the network but not in the data provider and delete it. Done. Add the appropriate call to the PHP to delete an item and get the new dataProvider back – done
  • Fix ‘+’ sign being added to search terms – done
  • Get the image textures to work – done
  • Get rid of ‘open link here’ and replace with ‘delete’ – done
  • Tried out the app on some lower-end machines and the physics become unstable. Need to add some velocity (and force?) clamping.

Phil 9.2.15

8:00 – 5:00 SR

  • Fixed a project name for Carla
  • Submitted a ticket for admin on the dev machine
  • We can see the new server in http, but not https, which is odd. Told Ronda about that, and and had Lenny send the url to some of the labs to see if it’s visible there as well.
  • Realized that I can use a view for the within network queries, where all the text can be concatenated, and possibly any associations as well? In other words, if the search returns a keyword or concept, all URLs that associate with that keyword can be displayed based on the relevance of the association…? TODO
  • Also, strip off any additional URL cruft? – Done
  • Housekeeping
    • Clear the network – Done
    • Overload the network and make sure that new items and associations don’t get added
      • Added check for items. Need to verify that associations already check. Yup, it’s there already.
  • Adding the pulls for http(s) and queries. Ran into a stupid bug where I was setting network_id with user_id

Phil 8.31.15

8:00 – 4:30 SR

  • Status report – Done
  • Timesheets! – Done
  • Get selected items showing up in the feed panel. Done! looks good. Commented out the default addition to the feed. It did make me realize that I need to add a ‘filter network’. Selections should highlight in the GUI and list in the feed.
    • By text search – searching title, description and query
    • By Date range
    • Other?
  • Got the selection working. Query-ish items go in the query box where they are combined into a single query, URL-ish items are listed in the feed section.
  • Get parsing of webpages working so so that they fit into the googleNewsFeed object. This should be just using the Alchemy object with some additional parsing.
  • Deployed to the server, and verified that the page works with Chrome, FF, Edge and IE11

Phil 8.28.15

8:00 – 5:00 SR

  • Commuting in the reverse order. Don’t forget to pick up energy drink mix too!
  • 3:00 meeting with Ronda to work on the servers
  • Adding isAssociation() and isItem() methods to the rssFeed directive. Done. Will probably add isRating() and isTouch() once they start getting used.
  • Deleting ComponentNetwork class from rssController – Done
  • Deleting pendingQueryArray and queryHistory from rSSController. The history can be pulled from the items in the DataProvider. Which works.
    • Add some test QUERY types to validate – Done – replaced the ENTITIES in tn_items. Worked with no other changes.
  • Setting items if their associated queries are clicked and setting the query if a query item in the chart is clicked. Done!
  • Deploying new version to the server.
  • And I am done for the day. Next week needs the following
    • Add items, which will (should?) return the whole data provider. Only differences (additions and deletions) should cause an effect.
    • Have selected items (only?) show up in the list.
    • Have the ‘query’ task change it’s behavior based on what’s sitting in the field. If it’s an url, open it in a new tab.If it’s text (can be multiple queries) combine all the text into a new query and run it.
    • Continue to flesh out the types.
    • Save, Save As, reload (clear and load) models. Verify! Test!

Phil 8.26.15

8:00 – 3:00 SR

  • Can still log in and do things. No progress on the dev box.
  • Make sure that the default network is selected in the initial flyout panel logic. Done
  • Back to building the data provider object. Thought about doing it on the server side, but doing it on the client 1) allows the formatting of the data from the server to remain constant as I muck with the client and 2) I can examine each item and throw away the ones that have not changed WRT the display. At least that’s my thoughts for now.
  • Got the items done, working on the associations. Added a JSON.stringify() to build a version that I can check outside the debugger.
  • Associations are doneand it looks good in JSONLint:
    {
        "type": "XYZ",
        "bounds": {
            "xmin": -5,
            "xmax": 5,
            "ymin": 0,
            "ymax": 5,
            "zmin": -5,
            "zmax": 5
        },
        "data3D": {
            "URL": {
                "URL_1": {
                    "data": {
                        "type": "URL",
                        "idIndex": 1,
                        "guid": "my_url_guid_1",
                        "description": "my url 1",
                        "title": "url 1",
                        "link": "http://url",
                        "image": "rock-512.jpg"
                    }
                },
                "URL_2": {
                    "data": {
                        "type": "URL",
                        "idIndex": 2,
                        "guid": "my_url_guid_2",
                        "description": "my url 2",
                        "title": "url 2",
                        "link": "http://url",
                        "image": "rock-512.jpg"
                    }
                },
                "URL_3": {
                    "data": {
                        "type": "URL",
                        "idIndex": 3,
                        "guid": "my_url_guid_3",
                        "description": "my url 3",
                        "title": "url 3",
                        "link": "http://url",
                        "image": "rock-512.jpg"
                    }
                },
                "URL_4": {
                    "data": {
                        "type": "URL",
                        "idIndex": 4,
                        "guid": "my_url_guid_4",
                        "description": "my url 4",
                        "title": "url 4",
                        "link": "http://url",
                        "image": "rock-512.jpg"
                    }
                }
            },
            "ENTITIES": {
                "ENTITIES_5": {
                    "data": {
                        "type": "ENTITIES",
                        "idIndex": 5,
                        "guid": "my_entity_guid_5",
                        "description": "my entity 1",
                        "title": "entity 1",
                        "link": "no link for entity",
                        "image": "rock-512.jpg"
                    }
                },
                "ENTITIES_6": {
                    "data": {
                        "type": "ENTITIES",
                        "idIndex": 6,
                        "guid": "my_entity_guid_6",
                        "description": "my entity 2",
                        "title": "entity 2",
                        "link": "no link for entity",
                        "image": "rock-512.jpg"
                    }
                },
                "ENTITIES_7": {
                    "data": {
                        "type": "ENTITIES",
                        "idIndex": 7,
                        "guid": "my_entity_guid_7",
                        "description": "my entity 3",
                        "title": "entity 3",
                        "link": "no link for entity",
                        "image": "rock-512.jpg"
                    }
                },
                "ENTITIES_8": {
                    "data": {
                        "type": "ENTITIES",
                        "idIndex": 8,
                        "guid": "my_entity_guid_8",
                        "description": "my entity 4",
                        "title": "entity 4",
                        "link": "no link for entity",
                        "image": "rock-512.jpg"
                    }
                }
            }
        },
        "network": {
            "edges": [
                {
                    "source": "URL.URL_1",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_1",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_2",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_2",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_3",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_3",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_4",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                },
                {
                    "source": "URL.URL_4",
                    "target": "ENTITIES.ENTITIES_5",
                    "val": 1,
                    "type": "TRUSTWORTHINESS"
                }
            ]
        }
    }
  • Will test and try to build networks tomorrow. That will require getting all the types set up, and then some integration of the data items and the rssFeed display list.

Phil 8.25.15

8:00 – 5:00 SR

  • Zeno’s admin saga continues…. Hey, I got remote desktop running! Ok, on to getting admin on my dev machine.
  • Meeting with Ronda on Friday to work on provisioning and testing servers.
  • Realized that since putting in the responses to a query, that I need associations that are COMPUTED, EXPLICIT, and DEPRECATED. In other words, the query results in 10 URLS. But the user only selects 3 now and 2 later. Only those urls and their connections are explicit in the network. Ones that I don’t want to show I deprecate. They can still be there (and probably should be? so the different networks can be compared)
  • This means that rather than adding the results of a search, we cull. This may actually work well, since in brings a different (less is more) mindset.
  • Working on putting the database items in the network, which means making a dataprovider. I think the easiest way to not have duplications is to have the Wgl3dCharts.NetworkChartInfo class manage that?

Phil 8.24.15

8:00 – 3:00 SR

  • Still working the Zeno’s Administrator problem.
  • Had a good discussion with Lenny about Low Threshold/High Ceiling coding and also about functional vs declarative programming and how ExtJS and AngularJS relate to those concepts.
  • Adding items to the live network and then bring down and parse the data object. This means pulling out the code that loads before the DB call.
  • Added queries and associations to any query that is not “__topNews__”

Phil 8.21.15

8:00 – 4:30 SR

  • Still no admin, but we’re at the last step. I think.
  • Meeting with the GMO folks. They have an ExtJS framework (YUI-based!?) for all their user IO.
  • We will *not* be abandoning Angular: xtJsVsAngularJs
  • Long discussion with Mark and Lenny about next steps. Maybe integrate all the efforts? I made the point that what we have is an information navigation system, but the info is questionable. Wheat we need is a data/inference system
  • More housekeeping for network logging in. Cleaned up the add network code on the client and server. Everything seems to be working as it’s supposed to. Next step will be to add items to the live network and then bring down and parse the data object.
  • I also realized that the best way to show the items is to have the master list populated by sublists. So the status item would be loaded first, then the selected items, then the search results. Then the various sublists can be managed separately and the other lists won’t care.

Phil 8.19.15

8:00 – 5:00 SR

  • Admin has been approved. Waiting for my logins to re-activate
  • Friday, 9:00-ish meeting with GAO-ish folks to talk about ingest.
  • Continue working on storing items and associations.
  • These people integrate annotations into the article, which is deeper. But in the reading of an article, this seems overwhelming
  • Bayes Server – worth getting? John G. Sandiford’s thesis.
  • Adding a UID to associations, since they need to be unique and findable. Done, and it’s for within a network.
  • Added a HOST type so that the root of the domain can be stored as an attribute as well. Of course, there was a PHP call to do this.
  • Tested creation of items and associations against this Miami Herald article.
  • Need to make sure that NLP items don’t get stored if they don’t return right.

Phil 8.18.15

8:00 – 5:00 SR

  • Still no admin
  • I forgot to save the new SQL for the truancy reports. Fixed now.
  • There is something that’s not quite right in the network physics. When an object is added, sometimes the forces get asymmetric. My guess is that the velocities have to be made non-zero each time an item is added.
  • Was getting a problem where additional information was getting stuck on the end of the image url, which was contaminating the name. Now, rather than assuming that the image name ends with the extension, I look within the image url for a reasonable extension and return that.
  • Need a query that returns the associations shared between two items. Done
  • Working on adding Alchemy NLP results as items with associations

Phil 8.17.15

8:00 – 3:00 SR

  • Still no admin
  • Given that I’m using FizzBuzz for the coding side of the SWE interview, I though I should put together a test for the database portion of the interview:
    • Create three tables:
      • One for names and salaries,
      • One for roles,
      • One that assigns a particular person to one or more roles.
    • Create a query that prints the name strings with their role strings. Extra points if it’s a view.
    • Create a query that sums the salaries.
    • Create a query that sums the salaries for a given role.
      DROP TABLE IF EXISTS test_people;
      CREATE TABLE test_people (
      	id_index 		INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
      	name			varchar(255),
      	salary			BIGINT
      );
      
      insert into test_people (name, salary) values
      ('Sophia',10000000000),
      ('Emma',1000000000),
      ('Olivia',100000000),
      ('Isabella', 10000000),
      ('Jackson',1000000),
      ('Aiden',100000),
      ('Liam',10000),
      ('Noah', 1000),
      ('Charlotte', 100),
      ('Caden', 10),
      ('Harper', 1);
      
      DROP TABLE IF EXISTS test_roles;
      CREATE TABLE test_roles (
      	id_index 		INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
      	role			varchar(255)
      );
      
      insert into test_roles (role) values
      ('Minion'),
      ('Worker'),
      ('Manager'),
      ('CEO'),
      ('Evil Overlord');
      
      DROP TABLE IF EXISTS test_assignments;
      CREATE TABLE test_assignments (
      	person_id 	INT,
      	role_id		INT
      );
      insert into test_assignments (person_id, role_id) values
      (1, 5),
      (2, 4),
      (3, 3),
      (4, 2),
      (5, 1),
      (6, 1),
      (7, 1),
      (8, 1);
      
      drop view IF EXISTS test_join;
      create view test_join as
      select p.name, r.role, p.salary
      	from test_assignments a
      	inner join test_people p on a.person_id = p.id_index
      	inner join test_roles r on a.role_id = r.id_index;
      
      select * from test_join;
      select sum(salary) from test_join where role = "Minion";
      
      DROP TABLE IF EXISTS test_people;
      DROP TABLE IF EXISTS test_roles;
      DROP TABLE IF EXISTS test_assignments;
      drop view IF EXISTS test_join;
  • Add the ability to save a network and then start saving one!
  • Since the mysqldump file doesn’t work on my server, spit the current schema file into three sections:
    • Table creation (incorporate DROP TABLE IF EXISTS table_name) – done
    • View creation – done
    • Tests – done
  • Using the linkFn() in ngFlyoutPanel to call getNetworks() on the load of the directive. Wasn’t sure that it would work, but it does. In Chrome, FF, and IE yet..
  • Uploaded to the main server. Works there, too!

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.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