Category Archives: Java

Phil 11.16.2017

7:00 – ASRC MKT

  • Data & Society to Launch Disinformation Action Lab Supported by Knight Foundation
    • The lab will use research to explore issues such as: how fake news narratives propagate; how to detect coordinated social media campaigns; and how to limit adversaries who are deliberately spreading misinformation. To understand where online manipulation is headed, it will analyze the technology and tactics being used by players at the international and domestic level.This project builds off the ongoing work of the Media Manipulation initiative at Data & Society, which examines how groups use social media and the participatory culture of the internet to spread and amplify misinformation and disinformation. Recent releases from this initiative include Lexicon of Lies and Media Manipulation and Disinformation Online.The funding is part of today’s announcement that the John S. and James L. Knight Foundation is giving $4.5 million in new funding to eight leading organizations working to create more informed and engaged communities through innovative use of technology. The other organizations receiving support include: Code2040, Code for Science & Society, Columbia Journalism School, DocumentCloud, Emblematic Group, HistoryPin and mRelief.
  • Before I restart on The Group Polarization Phenomenon, I’m going to take a look at how much work it would be to add the recording of trajectories through cells by agent.
  • And updates
  • Done! The name incorporates the n-dimensional cell position. In this case it’s 2D
    GreenFlockSh_10: GreenFlock[6, 3], RedFlock[6, 4], GreenFlock[7, 4], GreenFlock[7, 4], GreenFlock[7, 4], RedFlock[8, 4], GreenFlock[8, 5], GreenFlock[8, 5], GreenFlock[8, 5], RedFlock[8, 6], RedFlock[8, 6], RedFlock[8, 6], RedFlock[8, 6], GreenFlock[8, 7], GreenFlock[8, 7], RedFlock[7, 7], RedFlock[7, 7], GreenFlock[7, 8], GreenFlock[7, 8], RedFlock[6, 8], RedFlock[6, 8], RedFlock[6, 8], GreenFlock[5, 8], GreenFlock[5, 8], GreenFlock[5, 8], RedFlock[4, 8], RedFlock[4, 8], RedFlock[4, 8], RedFlock[4, 8], RedFlock[3, 7], RedFlock[3, 7], RedFlock[3, 7], RedFlock[3, 7], GreenFlock[3, 6], GreenFlock[3, 6], GreenFlock[3, 6], RedFlock[3, 5], RedFlock[3, 5], GreenFlock[2, 5], GreenFlock[2, 5], RedFlock[2, 4], RedFlock[2, 4], RedFlock[2, 4], GreenFlock[2, 3], GreenFlock[2, 3], GreenFlock[2, 3], GreenFlock[3, 2], GreenFlock[3, 2], GreenFlock[3, 2], GreenFlock[3, 2], GreenFlock[3, 2], RedFlock[4, 2], GreenFlock[4, 1], GreenFlock[4, 1], RedFlock[5, 1], GreenFlock[5, 2], GreenFlock[5, 2], RedFlock[6, 2], RedFlock[6, 2], RedFlock[6, 2], GreenFlock[6, 3], GreenFlock[6, 3], GreenFlock[6, 3], RedFlock[7, 3], GreenFlock[7, 4], GreenFlock[7, 4], GreenFlock[7, 4], RedFlock[7, 5], RedFlock[7, 5], RedFlock[7, 5], GreenFlock[8, 5], RedFlock[8, 6], RedFlock[8, 6], RedFlock[8, 6], GreenFlock[8, 7], GreenFlock[8, 7], GreenFlock[8, 7], GreenFlock[8, 7], GreenFlock[9, 8], GreenFlock[9, 8], GreenFlock[9, 8], RedFlock[9, 9], RedFlock[9, 9], RedFlock[9, 9], RedFlock[9, 9], RedFlock[9, 9], RedFlock[9, 9], RedFlock[9, 9], GreenFlock[9, 8], GreenFlock[9, 8], GreenFlock[9, 8], GreenFlock[9, 8], GreenFlock[8, 7], GreenFlock[8, 7], GreenFlock[8, 7], GreenFlock[8, 7], RedFlock[7, 7], RedFlock[7, 7], RedFlock[7, 7]
    
  • Some additional thoughts about building maps from trajectories
    • Incorporating trajectories allows determination of otherwise difficult problems. An example of this is pictures of war crimes. If the trajectory originates in a legal belief space, then it’s evidence to be saved. If it comes from an extremist belief space, it’s propaganda to be deleted.
    • The simplest way to do this is to look at all the trajectories where a landmark is shared. Every item that is adjacent to that landmark on a trajectory must be adjacent in the environment. If we build a graph with the lowest crossing number, we should have our best reconstruction.
    • Time can be an important dimension, and may provide useful information where just sequence may not
    • It is possible, even likely, that the map is not fixed, so the environment should also be allowed to morph over time to support optimal relations. Think of it as agents surfing on a wave. There is an outer frame (the shore) that waves and surfers can’t exist. Within that frame, waves move and follow different rules from surfers. Surfers in turn are influenced by the waves, and in our case, waves may be influenced by the surfers as well as the external environment.
    • Trajectories point both ways. In addition to being able to infer a destination for an agent, it may be possible to infer an origin.
    • Discussing this with Aaron, we realized that it might be possible to build a map by constructing a network from the adjacency of paths. In other words, if one path goes from C1->C2->C3 and another goes from B2->C2->D2, then we know that C2 is adjacent to all those points. That information can be used to build a graph. If the graph can be arranged so that it has a low crossing number, then it should approximate the original map. The (relative) size of the areas could be related to the crossing times averaged out for all agents.
  • And I just found this in Reinforcement Learning : An Introduction (1st edition linked here): ReinforcementLearningPP2
  • Back to Angular
    • Found where the typescript files live on the browser/webpack: FoundTheFiles
    • Got routes working, with minimal confusion. The framework generates a lot of code though…
    • To get npm install angularinmemorywebapi save to install something visible for the IDE, I had to add the -g option. Still got weird errors though: 
      D:\Development\Sandboxes\TourOfHeroes>npm install angular-in-memory-web-api --save -g
      npm WARN angular-in-memory-web-api@0.5.1 requires a peer of @angular/common@>=2.0.0 <6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN angular-in-memory-web-api@0.5.1 requires a peer of @angular/core@>=2.0.0 <6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN angular-in-memory-web-api@0.5.1 requires a peer of @angular/http@>=2.0.0 <6.0.0 but none is installed. You must install peer dependencies yourself.
      npm WARN angular-in-memory-web-api@0.5.1 requires a peer of rxjs@^5.1.0 but none is installed. You must install peer dependencies yourself.
      
    • Here’s how you generate a service
      ng generate service in-memory-data --flat --module=app
      

       

Phil 11.8.17

ASRC MKT 7:00 – 5:00, with about two hours for personal time

  • After the fall of DNAinfo, it’s time to stop hoping local news will scale
    • I think people understand that this sensation of unreality has a lot to do with the platforms that deliver our news, because Facebook and Google package journalism and bullshit identically. But I’d argue that it also has a lot to do with the death of local news to a degree few of us recognize.
    • This is not unheard of in digital local news: People pay to drink with the investigative reporters at The Lens in New Orleans and to watch Steelers games with the staff of The Incline in Pittsburgh.
  • And as a counterbalance: Weaken from Within
    • The turtle didn’t know and never will, that information warfare — it is the purposeful training of an enemy on how to remove its own shell.
  • Rescuing Collective Wisdom when the Average Group Opinion Is Wrong
    • Yet the collective knowledge will remain inaccessible to us unless we are able to find efficient knowledge aggregation methods that produce reliable decisions based on the behavior or opinions of the collective’s members.
    • Our analysis indicates that in the ideal case, there should be a matching between the aggregation procedure and the nature of the knowledge distribution, correlations, and associated error costs. This leads us to explore how machine learning techniques can be used to extract near-optimal decision rules in a data-driven manner.
  • Inferring Relations in Knowledge Graphs with Tensor Decompositions
  • From today’s Pulse of the Planet episode:
    • Colin Ellard is a cognitive neuroscientist and the author of Places of the Heart: the Psychogeography of Everyday Life. He says that the choices we make in siting a house or even where we choose to sit in a crowded room give us clues about the way humans have evolved.  The idea of prospect and refuge is an inherently biological idea. It goes back through the history of human beings. In fact for any kind of animal selecting a habitat, kind of the holy grail of good habitat choice can be summed up by the principal of seeing but not being seen.
      Ideally what we want is a set of circumstances where we have some protection, visual protection, in the sense of not being able to be easily located ourselves, and that’s Refuge. But we also want to be able to know what’s going on around us. We need to be able to see out from wherever that refuge is. And that’s Prospect. The operation of our preference for situations that are high in both refuge and prospect is something that cuts across everything we build or everywhere we find ourselves.
  • So, prospect-refuge theory sounds interesting. It seems to come from psychology rather than ecology-related fields. Still, it’s a discussion of affordances. Searching around, I found this: Methodological characteristics of research testing prospect–refuge theory: a comparative analysis. Couldn’t get it directly, so I’m trying ILL.
    • Prospect–refuge theory proposes that environments which offer both outlook and enclosure provoke not only feelings of safety but also of spatially derived pleasure. This theory, which was adopted in environmental psychology, led Hildebrand to argue for its relevance to architecture and interior design. Hildebrand added further spatial qualities to this theory – including complexity and order – as key measures of the environmental aesthetics of space. Since that time, prospect–refuge theory has been associated with a growing number of works by renowned architects, but so far there is only limited empirical evidence to substantiate the theory. This paper analyses and compares the methods used in 30 quantitative attempts to examine the validity of prospect–refuge theory. Its purpose is not to review the findings of these studies, but to examine their methodological bases and biases and comment on their relevance for future research in this field.
    • This is the book by Hildebrand: The Wright Space: Patterns and Meaning in Frank Lloyd Wright’s Houses. Ordered.
  • Ok, back to Angular2
    • Done with chapter 3.

Phil 11.7.17

7:00 – 6:00 ASRC MKT

  • Renting a spec Miata at Summit Point 
  • This is really good: The Human Strategy A Conversation With Alex “Sandy” Pentland [10.30.17]
    • Human behavior is determined as much by the patterns of our culture as by rational, individual thinking. These patterns can be described mathematically, and used to make accurate predictions. We’ve taken this new science of “social physics” and expanded upon it, making it accessible and actionable by developing a predictive platform that uses big data to build a predictive, computational theory of human behavior.
  • Rerunning the DTW with the selected agent weight being the specified weight rather than scaled by the distance from the angle so that it matches better the RANDOM_AGENT and the RANDOM_AGENTS settings.
  • Ok, here’s the results. The relationships between the populations appears more consistent, but that could be normal variability. Time for some true statistics to see if these are actually distinct populations. I can also increase power by doing more runs. Possibly also increasing the population size, though there might be confounding effects. DTWEqualWeight
  • Pandas can read in a specific Excel sheet and numpy can run bootstrap on DataFrames, so I can automate the analysis. Going to talk to Aaron first, since he might be the one to go down this road.
  • I think the next step is to start on the UI for the polarization game. Angular?
      • Installing NodeJS
      • npm install -g @angular/cli -> added 968 packages in 56.599s. That is a lot of packages. The IntelliJ plugin seems to be working, the @angular/cli package is visible: NodeNPM
      • Creating a new project is reasonable NewAngularProject
      • Once the project is running, the way to compile and run seems to be to run ng serve –open in the IntelliJ terminal (Note: When running as non-admin, do this in a terminal with admin privileges). It then does a whole bunch of things when a code change is made:
        ** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
         10% building modules 8/10 modules 2 active ...\PolarizationGameOneUI\src\styles.csswebpack: wait until bundle finished: /                                                              Date: 2017-11-07T15:50:25.164Z
        Hash: b3174f5198d14bdc05ac
        Time: 4708ms
        chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
        chunk {main} main.bundle.js (main) 20.8 kB [initial] [rendered]
        chunk {polyfills} polyfills.bundle.js (polyfills) 553 kB [initial] [rendered]
        chunk {styles} styles.bundle.js (styles) 33.8 kB [initial] [rendered]
        chunk {vendor} vendor.bundle.js (vendor) 7.02 MB [initial] [rendered]
        
        webpack: Compiled successfully.
        webpack: Compiling...
        Date: 2017-11-07T15:51:07.132Z
        Hash: 7b89b5a301e4a411e92d
        Time: 703ms
        
      • Everything is then sent to localhost:4200/, so all the browser debuggers are available
      • RunningAngular
      • And you can change the picture in the app.component.html file. re-renders on the fly. Pretty nifty. Yep verified:The ng serve command builds the app, starts the development server, watches the source files, and rebuilds the app as you make changes to those files.The --open flag opens a browser to http://localhost:4200/.
      • Pleasantly, if the install fails, ng serve –open will complete the install nd then start the server.
      • Added the ‘heroes’ component: AngularCLI AngularComponent
      • Then I got this error message:
        ERROR in src/app/heroes/heroes.component.ts(7,18): error TS2304: Cannot find name 'ViewEncapsulation'.
      • Turns out that I had to add ViewEncapsulation to the imports in heroes.components:
        import {Component, OnInit, ViewEncapsulation} from '@angular/core';
        
        @Component({
          selector: 'app-heroes',
          templateUrl: './heroes.component.html',
          styleUrls: ['./heroes.component.css'],
          encapsulation: ViewEncapsulation.None
        })
        export class HeroesComponent implements OnInit {
          constructor() { }
          ngOnInit() {
          }
        }

        Once added in, the rebuild happened and everything functioned normally. Correct error message in the IDE and everything!

  • Talked to Aaron about next steps with the herding data. We need to do something with NNs, and this could be a good fit
  • And now I have a nice little certificate of candidacy!

Phil 11.6.17

7:00 – 4:00 ASRC MKT

  • Going to try a batch job that runs the sim on a single population with a .2 radius and see if I can see a difference between the behaviors using DTW.
  • I had created a few bugs with changing the names of the flocks to Red and Green. Also, I had never run in batch mode with StorageAndRetreival. And calculations for an average center don’t work when there are no members of your flock. So fixing bugs.
  • First set of outputs from the batch jobs. Here’s the headings: HerdingHeadings
  • And here’s the DTW for the same settings (smaller stage though for proportionally greater differences): HerdingDTW
  • The first really obvious thing it that NoHerding is distinct from the other settings, which are more like echo chambers. Groupings tighten up as the radius increases, and the average heading approach may be statistically better than the random agents, but not by much. Lastly, RANDOM_AGENTS and RANDOM_AGENT lie on a continuum. As the switch between each agent takes longer, the more AGENTS will start to look like AGENT.

Phil 11.3.17

7:00 – ASRC MKT

  • Good comments from Cindy on yesterday’s work
  • Facebook’s 2016 Election Team Gave Advertisers A Blueprint To A Divided US
  • Some flocking activity? AntifaNov4
  • I realized that I had not added the herding variables to the Excel output. Fixed.
  • DINH Q. LÊ: South China Sea Pishkun
    • In his new work, South China Sea Pishkun, Dinh Q. Lê references the horrifying events that occurred on April 30th 1975 (the day Saigon fell) as hundreds of thousands of people tried to flee Saigon from the encroaching North Vietnamese Army and Viet Cong. The mass exodus was a “Pishkun” a term used to describe the way in which the Blackfoot American Indians would drive roaming buffalo off cliffs in what is known as a buffalo jump.
  • Back to writing – got some done, mostly editing.
  • Stochastic gradient descent with momentum
  • Referred to in this: There’s No Fire Alarm for Artificial General Intelligence
    •  AlphaGo did look like a product of relatively general insights and techniques being turned on the special case of Go, in a way that Deep Blue wasn’t. I also updated significantly on “The general learning capabilities of the human cortical algorithm are less impressive, less difficult to capture with a ton of gradient descent and a zillion GPUs, than I thought,” because if there were anywhere we expected an impressive hard-to-match highly-natural-selected but-still-general cortical algorithm to come into play, it would be in humans playing Go.
  • In another article: The AI Alignment Problem: Why It’s Hard, and Where to Start
    • This is where we are on most of the AI alignment problems, like if I ask you, “How do you build a friendly AI?” What stops you is not that you don’t have enough computing power. What stops you is that even if I handed you a hypercomputer, you still couldn’t write the Python program that if we just gave it enough memory would be a nice AI.
    • I think this is where models of flocking and “healthy group behaviors” matters. Explore in small numbers is healthy – it defines the bounds of the problem space. Flocking is a good way to balance bounded trust and balanced awareness. Runaway echo chambers are very bad. These patterns are recognizable, regardless of whether they come from human, machine, or bison.
  • Added contacts and invites. I think the DB is ready: polarizationgameone
  • While out riding, I realized what I can do to show results in the herding paper. There are at least three ways to herd:
    1. No herding
    2. Take the average of the herd
    3. Weight a random agent
    4. Weight random agents (randomly select an agent and leave it that way for a few cycles, then switch
  • Look at the times it takes for these to converge and see which one is best. Also look at the DTW to see if they would be different populations.
  • Then re-do the above for the two populations inverted case (max polarization)
  • Started to put in the code changes for the above. There is now a combobox for herding with the above options.

Phil 11.2.17

ASRC MKT 7:00 – 4:30

  • Add a switch to the GPM that makes the adversarial herders point in opposite directions, based on this: Russia organized 2 sides of a Texas protest and encouraged ‘both sides to battle in the streets’
  • It’s in and running. Here’s a screenshot: 2017-11-02 There are some interesting things to note. First, the vector is derived from the average heading of the largest group (green in this case). This explains why the green agents are more tightly clustered than the red ones. In the green case, the alignment is intrinsic. In the red case, it’s extrinsic. What this says to me is that although adversarial herding works well when amplifying the heading already present, it is not as effective when enforcing a heading that does not already predominant. That being said, when we have groups existing in opposition to each other, that is a tragically easy thing to enhance.
  • Hierarchical Representations for Efficient Architecture Search
    • We explore efficient neural architecture search methods and present a simple yet powerful evolutionary algorithm that can discover new architectures achieving state of the art results. Our approach combines a novel hierarchical genetic representation scheme that imitates the modularized design pattern commonly adopted by human experts, and an expressive search space that supports complex topologies. Our algorithm efficiently discovers architectures that outperform a large number of manually designed models for image classification, obtaining top-1 error of 3.6% on CIFAR-10 and 20.3% when transferred to ImageNet, which is competitive with the best existing neural architecture search approaches and represents the new state of the art for evolutionary strategies on this task. We also present results using random search, achieving 0.3% less top-1 accuracy on CIFAR-10 and 0.1% less on ImageNet whilst reducing the architecture search time from 36 hours down to 1 hour.
  • Continuing with the schema. Here’s where we are today: polarizationgameone

Phil 10.30.17

7:00 – 4:30 ASRC MKT

  • The discussion and conclusion
  • Tweaked the “Future Work” section of the CHIIR DC proposal to reflect the herding work. More words means less bullet points!
  • Updated Java and XAMMP on my home machine
  • Pointed the IDE at the correct places
  • I don’t think I have PhpInspections (EA Extended) installed at work? It does nice things – Have it now
  • Working through creating a strawman game. Having some issues with a one-to-many relationship with RedBeanPHP. Ah – it’s because you have to sync the beans. I think rather than have a game point at all the players, I’ll have the players point at the scenario, and the chat messages point at the game and players.
  • Got that mostly working, but having a null player issues
  • Important PHP issue – arrays don’t need to start at zero! The bean arrays are indexed with respect to their db id!
  • Meeting with Wayne
  • The DC is good to submit
  • Start working on a JCMC article that connects the flocking model to qualitative theory.
  • Keep on working on the game. Possible project for a class/group in either 729 – design and evaluate class (Komlodi) or 728 – Online Communities & Social Media (Branham)

Phil 9.5.17

7:00 – 4:00 ASRC IRAD

  • Read some more Understanding Ignorance. He hasn’t talked about it, but it makes me look at game theory in a different way. GT is about making decisions with incomplete information. Ignorance results in decisions made using no or incorrect information. This is a modellable condition, and should result in observable results. Maybe something about output behaviors not mapping (at all? statistically equal to chance or worse?) to input information.
  • Heat maps!!!! 2017-09-05
  • Playing around with the drawing so we’re working off of a white background. Not sure if it’s better?
  • Adding a decay factor so new patterns don’t get overwhelmed by old ones 0.999 seems to be pretty good.
  • Need to export to excel – Done!2017-09-06
  • Advanced Analytic Status meeting.
  • NOAA meeting. Looks like they want VISIBILITY. Need to write up scenarios from spreadsheet generation to complete integration from allocation to contract to deliverable. With dashboards.
  • Latest version of the heatmaps, This produced the excel sheets above (dbTest_09_06_17-07_01_51) Going to leave it like this while I write the paper: 2017-09-06 (1)

Phil 8.18.17

7:00 – 8:00 Research

  • Got indexFromLocation() working. It took some fooling around with Excel. Here’s the method:
    public int[] indexFromLocation(double[] loc){
        int[] index = new int[loc.length];
        for(int i = 0; i < loc.length; ++i){
            double findex = loc[i]/mappingStep;
            double roundDown = Math.floor(findex);
            double roundUp = Math.ceil(findex);
            double lowdiff = findex - roundDown;
            double highdiff = roundUp - findex;
            if(lowdiff < highdiff){
                index[i] = (int)roundDown;
            }else{
                index[i] = (int)roundUp;
            }
        }
        return index;
    }
  • And here are the much cleaner results:
    • [0.00, 0.00] = [0, 0]
      [0.00, 0.10] = [0, 0]
      [0.00, 0.20] = [0, 1]
      [0.00, 0.30] = [0, 1]
      [0.00, 0.40] = [0, 2]
      [0.00, 0.50] = [0, 2]
      [0.00, 0.60] = [0, 2]
      [0.00, 0.70] = [0, 3]
      [0.00, 0.80] = [0, 3]
      [0.00, 0.90] = [0, 4]
      [0.00, 1.00] = [0, 4]

      [1.00, 0.00] = [4, 0]
      [1.00, 0.10] = [4, 0]
      [1.00, 0.20] = [4, 1]
      [1.00, 0.30] = [4, 1]
      [1.00, 0.40] = [4, 2]
      [1.00, 0.50] = [4, 2]
      [1.00, 0.60] = [4, 2]
      [1.00, 0.70] = [4, 3]
      [1.00, 0.80] = [4, 3]
      [1.00, 0.90] = [4, 4]
      [1.00, 1.00] = [4, 4]
  • Another thought that struck me as far as the (int) constraint is that I can have a number of ArrayLists that are embedded in a an object that has the first and last index in it. These would be linked together to provide unconstrained (MAX_VALUE or 2,147,483,647 lists) storage

8:30 – 4:30 BRI

  • I realized yesterday that the Ingest and Query microservices need to access the same GeoMesa Spring service. That keeps all the general store/query GeoMesa access code in one place, simplifies testing and allows for DI to provide the correct (hbase, accumulo, etc) implementation through a facade interface.
  • Got tangled up with getting classpaths right and importing the proper libraries
  • Got the maven files behaving, or at least not complaining on mvn clean and mvn compile!
  • Well that’s a new error: Error: Could not create the Java Virtual Machine. I get that running the new installation with the geomesa-quickstart-hbase
    • Ah, that’s what will happen when you paste your command-line arguments into the VM arguments space just above where it should go…
    • Wednesday’s goal will to verify that HBaseQuickStart is running correctly in its new home and start to turn it into a service.

Phil 8.17.17

BRI – one hour chasing down research hours from Jan – May

7:00 – 6:00 Research

  • Found this on negative flocking influences: The rise of negative partisanship and the nationalization of US elections in the 21st century.  Paper saved to Lit Review
    • One of the most important developments affecting electoral competition in the United States has been the increasingly partisan behavior of the American electorate. Yet more voters than ever claim to be independents. We argue that the explanation for these seemingly contradictory trends is the rise of negative partisanship. Using data from the American National Election Studies, we show that as partisan identities have become more closely aligned with social, cultural and ideological divisions in American society, party supporters including leaning independents have developed increasingly negative feelings about the opposing party and its candidates. This has led to dramatic increases in party loyalty and straight-ticket voting, a steep decline in the advantage of incumbency and growing consistency between the results of presidential elections and the results of House, Senate and even state legislative elections. The rise of negative partisanship has had profound consequences for electoral competition, democratic representation and governance.
  • Working on putting together an indexable high-dimension matrix that can contain objects. Generally, I’d expect it to be doubles, but I can see Strings and Objects as well.
  • Starting off by seeing what’s in the newest Apache Commons Math (v 3.6.1)
  • Found SimpleTensor, which uses the Efficient Java Matrix Library (EJML) and creates a 3D block of rows, columns and slices. THought it was what I wanted, but nope
  • Looks like there isn’t a class that would do what I need to do, or that I can even modify. I’m thinking that the best option is to use org.apache.commons.math3.linear.AbstractRealMatrix as a template.
  • Nope, coudn’t figure out how to do things as nested lists. So I’m doing it C-Style, where you really only have one array that you index into. Here’s a 4x4x4x4 Tensor filled with zeroes:
    Total elements = 256
    0.0:[0, 0, 0, 0], 0.0:[1, 0, 0, 0], 0.0:[2, 0, 0, 0], 0.0:[3, 0, 0, 0],
    0.0:[0, 1, 0, 0], 0.0:[1, 1, 0, 0], 0.0:[2, 1, 0, 0], 0.0:[3, 1, 0, 0],
    0.0:[0, 2, 0, 0], 0.0:[1, 2, 0, 0], 0.0:[2, 2, 0, 0], 0.0:[3, 2, 0, 0],
    0.0:[0, 3, 0, 0], 0.0:[1, 3, 0, 0], 0.0:[2, 3, 0, 0], 0.0:[3, 3, 0, 0],
    0.0:[0, 0, 1, 0], 0.0:[1, 0, 1, 0], 0.0:[2, 0, 1, 0], 0.0:[3, 0, 1, 0],
    ….
    0.0:[0, 2, 3, 3], 0.0:[1, 2, 3, 3], 0.0:[2, 2, 3, 3], 0.0:[3, 2, 3, 3],
    0.0:[0, 3, 3, 3], 0.0:[1, 3, 3, 3], 0.0:[2, 3, 3, 3], 0.0:[3, 3, 3, 3]
  • The only issue that I currently have is that ArrayLists are indexed by int, so the total size is 32k elements. That should be good enough for now, but it will need to be fixed.
  • set() and get() work nicely:
    lt.set(new int[]{0, 1, 0, 0}, 9.9);
    lt.set(new int[]{3, 3, 3, 3}, 3.3);
    
    System.out.println("[0, 1, 0, 0] = " + lt.get(new int[]{0, 1, 0, 0}));
    System.out.println("[3, 3, 3, 3] = " + lt.get(new int[]{3, 3, 3, 3}));
    
    [0, 1, 0, 0] = 9.9
    [3, 3, 3, 3] = 3.3
  • Started the indexFromLocation method, but this is too sloppy:
    index[i] = (int)Math.floor(Math.round(loc[i]/mappingStep));

Phil 8.16.17

7:00 – 8:00 Research

  • Added takeaway thoughts to my C&C writeup.
  • Working out how to add capability to the sim for P&RCH paper. My thoughts from vacation:
    • The agents contribution is the heading and speed
    • The UI is what the agent’s can ‘see’
    • The IR is what is available to be seen
    • An additional part might be to add the ability to store data in the space. Then the behavior of the IR (e.g. empty areas) would b more apparent, as would the effects of UI (only certain data is visible, or maybe only nearby data is visible) Data could be a vector field in Hilbert space, and visualized as color.
  • Updated IntelliJ
  • Working out how to to have a voxel space for the agents to move through that can also be drawn. It’s any number of dimensions, but it has to project to 2D. In the case of the agents, I just choose the first two axis. Each agent has an array of statements that are assembled into a belief vector. The space can be an array of beliefs. Are these just constructed so that they fill a space according to a set of rules? Then the xDimensionName and yDimensionName axis would go from (0, 1), which would scale to stage size? IR would still be a matter of comparing the space to the agent’s vector. Hmm.
  • This looks really good from an information horizon perspective: The Role of the Information Environment in Partisan Voting
    • Voters are often highly dependent on partisanship to structure their preferences toward political candidates and policy proposals. What conditions enable partisan cues to “dominate” public opinion? Here I theorize that variation in voters’ reliance on partisanship results, in part, from the opportunities their environment provides to learn about politics. A conjoint experiment and an observational study of voting in congressional elections both support the expectation that more detailed information environments reduce the role of partisanship in candidate choice

9:00 – 5:00 BRI

  • Good lord, the BoA corporate card comes with SIX seperate documents to read.
  • Onward to Chapter Three and Spring database interaction
  • Well that’s pretty clean. I do like the JdbcTemplate behaviors. Not sure I like the way you specify the values passed to the query, but I can’t think of anything better if you have more than one argument:
    @Repository
    public class EmployeeDaoImpl implements EmployeeDao {
        @Autowired
        private DataSource dataSource;
    
        @Autowired
        private JdbcTemplate jdbcTemplate;
    
        private RowMapper<Employee> employeeRowMapper = new RowMapper<Employee>() {
            @Override
            public Employee mapRow(ResultSet rs, int i) throws SQLException {
                Employee employee = new EmployeeImpl();
                employee.setEmployeeAge(rs.getInt("Age"));
                employee.setEmployeeId(rs.getInt("ID"));
                employee.setEmployeeName(rs.getString("FirstName") + " " + rs.getString("LastName"));
                return employee;
            }
        };
    
        @Override
        public Employee getEmployeeById(int id) {
            Employee employee = null;
    
            employee = jdbcTemplate.queryForObject(
                    "select * from Employee where id = ?",
                    new Object[]{id},
                    employeeRowMapper
            );
            return employee;
        }
    
        public List<Employee> getAllEmployees() {
            List<Employee> eList = jdbcTemplate.query(
                    "select * from Employee",
                    employeeRowMapper
            );
            return eList;
        }
    }
  • Here’s the xml to wire the thing up:
    <context:component-scan base-package="org.springframework.chapter3.dao"/>
    <bean id="employeeDao" class="org.springframework.chapter3.dao.EmployeeDaoImpl"/>
    
    <bean id="dataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="${jdbc.driverClassName}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="xxx"/>
        <property name="password" value="yyy"/>
    </bean>
    
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource" />
    </bean>
    
    <context:property-placeholder location="jdbc.properties" />
  • And here’s the properties. Note that I had to disable SSL:
    jdbc.driverClassName=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/sandbox?autoReconnect=true&useSSL=false

Phil 7.22.16

7:00 – 1:00 VTX

  • More bubble modelling. Found a nice paper from a financial perspective that looks like a good source for similar models.
  • Split out the calculation and spreadsheet functions to support snapshots and debugging.
    • Set up the base class to be the control. Explorers only look outside their SD, while confirmers and avoiders stay within. Not sure how to tease out the difference between those. I think it will have something to do with the way they look for information, which is beyond the scope of this model for now. Also switched to a random distribution. Here’s an initial result. Much more work to follow

GP

  • I was riding and thinking about something I read on fivethirtyeight.comThis isn’t the most artful way to say it, but it’s like, where do you go when the only people who seem to agree with you on taxes hate black people?” It’s by Ben Howe, a redstate commentator. And it makes me think that rather than basing the sim on only one value, there should be a cluster. Confirmed could look for a match in the cluster while avoiders would clusters if they hit somethings that doesn’t match. And the distance from the value should matter. Adopting a very different concept should take more energy than a similar one. And this makes me think that the CAs have to have a bit more alife in them. They need to budget their energy with reference to their internal and external states.
  • And then mom died. Here’s the OPM web page that matters: https://www.opm.gov/retirement-services/my-annuity-and-benefits/life-events/death/report-of-death/

Phil 7.18.16

7:00 – 3:30 VTX

  • Writing and reworking Lit Review 2. After that, I need to rework the research plan so that RQs and Hs are interchanged.
  • Meeting with Ned Thursday evening?
  • Meeting with Thom second week of August.
  • If there is time today, try to add color change to the table cells to reflect rank. Failing that, add a column that shows relative motion? Both?
    • Added a Rank and Delta field. That seems to be working fine.
  • Finished lockout task
  • Starting Gateway exposes old APIs task

Phil 6.9.16

6:00 – 12:00 Writing

  • Going to go through the RQs and describe how to address them
  • Start with the back end and my local cohort, which I can assume to be diversity-seeking because of where they are.
  • Iteratively develop tool so that it gets used for diversity-related activities
  • Logs and questionairres.
  • Scraping for Google Scholar and CaseLaw? Java code is here.
  • Looks like Google Scholar has also started to add the concept of pertinence in?
  • Finished the Research Plan. Do need a timeline.
  • Finished discussion/conclusion. Done(ish)!

Phil 6.2.16

7:00 – 5:00 VTX

  • Writing
  • Write up sprint story – done
    • Develop a ‘training’ corpus known bad actors (KBA) for each domain.

      • KBAs will be pulled from http://w3.nyhealth.gov/opmc/factions.nsf, which provides a large list.
      • List of KBAs will be added to the content rating DB for human curation
      • HTML and PDF data will be used to populate a list of documents that will then be scanned and analyzed to prepare TF-IDF and LSI term-document tables.
      • The resulting table will in turn be analyzed using term centrality, with the output being an ordered list of terms to be evaluated for each domain.

  • Building view to get person, rating and link from the db – done, or at least V1
    CREATE VIEW view_ratings AS
      select io.link, qo.search_type, po.first_name, po.last_name, po.pp_state, ro.person_characterization from item_object io
        INNER JOIN query_object qo ON io.query_id = qo.id
        INNER JOIN rating_object ro on io.id = ro.result_id
        INNER JOIN poi_object po on qo.provider_id = po.id;
  • Took results from w3.nyhealth.gov and ran them through the whole system. The full results are in the Corpus file under w3.nyhealth.gov-PDF-centrality_06_02_16-13_12_09.xlsx and w3.nyhealth.gov-WEB-centrality_06_02_16-13_12_09.xlsx. The results seem to make incredibly specific searches. Here are the two first examples. Note that there are very few .com sites.: