300 likes | 427 Views
Matrix Review. Progress/Features Source: Workshop Notes, Matrix Sketches, Trello , GXT Grid examples, Ideas…. Progress/Requirements. Demo. http://128.196.105.79:8080/mr/. Progress/Requirements. ?. ?. Progress/Requirements. Control Mode: Numerical to specify unit?
E N D
Matrix Review Progress/Features Source: Workshop Notes, Matrix Sketches, Trello, GXT Grid examples, Ideas…
Demo • http://128.196.105.79:8080/mr/
Progress/Requirements • Control Mode: Numerical to specify unit? • Or extra feature to convert values between units? • How to store values in backend? Retain original e.g. “3mm” “4 cm” before converting anything? ?
Progress/Requirements • Additional features: • Filtering of character values (default: free text) • Control mode: Numerical, Categorical, Off • Control mode controls filtering options: free text, checkbox, > < = • Commenting values, taxa, characters • Lock values, taxa, characters, grid • Coloring • Hovering values: • Hovering shows a “summary” • matrix control cell • Taxa • character • Frozen character row, taxa column • Drag and Drop move of taxa and characters • Includes autoscroll when dragging next to boundaries of scrollable area • Character A of Organ B of Taxon C has value X • Color red “not sure” • Comment: “Can you take a look?”
Decisions made along the way • No character – organ grouping but rather “name based” • Will make character reordering complicated • Categorical control input box not to add new values: Possibly introduces noise. New values can be added by switching between modes • No word wrap cells: Makes matrix less space efficient and values can be shown in their entirety in tooltip • “Grouping grid” / “Filtering” / “Hiding” of taxa • Leverage taxonomic hierarchy: TODO
Feature Possiblities • Taxa ordering mode: Taxonomic hierarchy • Taxa carry hierachical information and rank in model • A tree • Order taxa (rows) according to DFS of tree (+ Indentation?) • Color code taxon cells for ranks? (conflict with annotation coloring: Color depending on a mode?) • Hierarchy view to manipulate hierachy for desired taxa order • Hierarchy allows to filter descendants family genus species species genus species
Feature Possiblities • Taxa ordering mode: Taxonomic hierarchy • Alterative: Try to marry table with tree • Expansion of tree node shows additional rows for the child nodes • Probably complex to implement • Other ideas?
Feature Possiblities • Switch between taxon order modes or a one-time-action • Complete manual ordering via Drag and Drop and possibly a new ordering view • Alphabetical • Coverage • Hierachy • E.g. • Rename a taxa in alphabetical mode: Is it moving or staying until alphabetical order is triggered?
Feature Possiblities • Analysis panel (e.g. to slide in from bottom) • Allows to edit matrix while “analyzing” • http://www.sencha.com/examples/#ExamplePlace:aggregationgrid • http://www.sencha.com/examples/#ExamplePlace:livegroupsummary • At some point: Diagrams, etc. • Compare open requirements shown previously
Feature Possiblities • Row expander • http://www.sencha.com/examples/#ExamplePlace:rowexpandergrid • Would this be a prefered way to show the description? • Configurable to not span over entire row? (description not well readable) • DnD of values should be possible (Click in character values table no longer reserved) • Other options to display description if needed? • Cf. Matrix sketch
Feature Possiblities • Preview step for entering controlled mode of a character • Numerical • Specify unit • Range values? • Are there Min/Max allowed values? • …? • Categorical • Overview of states currently in table: Can review by inspecting examples where they appear • User can manipulate the list • Upon confirmation, possibly values in matrix are removed
Open Questions • Visualization • Color code: Multiple aspects, how to do? • Aspects I can currently see • Colored e.g. “Expert can you verify?”, • Colored e.g. “interesting” • Touched • Visited • Locked • Merged • Dirty • Commented • Rank • Control Mode • Taxon name • Character name • Organ • Ways to incorporate information: • Cell Tooltip • Cell Color • Cell Background icon(s) • …?
Open Questions • Selection mode • Cell vs. row: Click is now available in character values grid • Single vs. multiple? E.g. for some kind of compare functionality? • Column Autosize not supported • Small tweaks • Control mode: Look ahead to filter values? Column seperation lines • Stripe rows • Track mouse over • Widgets where appropriate: • Progress bar instead of Coverage <div>? • Color cell? • Date? • Taxon name: Button to open text? • … that’s where the user is supposed to dream • http://www.sencha.com/examples/#ExamplePlace:cellgrid
Parallel Computing • Dining philosophers problem
Synchronization • “Doing things at the same time trying not to get into each others way“ • Doing things at the same time can mean many things, crucial for us is: sharing computational resources, e.g. stanford parser access
Another way of looking at it… You as the designer/coder are “creating the streets and traffic rules”
Critical Section • The critical section (CS) of a process is the block of code where shared state (e.g., global variables) are accessed and possibly manipulated • (Sidenote: Knowing this should influence the design of your code) • Problems: • Non-deterministic execution order: Explosion of possible behavior • Data Race, Race Condition • Mutual Exclusion • Absence of Deadlock • Absence of Starvation public class ApplePicker() { private int count = 0; public void pickApple() { count++; System.out.println(“Picked an apple, we now have: “ + count + “apples”); } }
Synchronization Primitives • Semaphore, lock, monitor, barrier, or latch to guard critical section • Block execution until “free”. Don’t do: booleanresourceIsInUse = true; … while(resourceIsInUse() { }
Example • Shared resource by multiple threads: HashMap -> ConcurrentModificationException • http://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html
Synchronization in Java • Each object in java has a lock associated • The thread who holds the lock may perform actions on the object, others have to wait. • Also, each object Is associated with a monitor: wait(), wait(n), notify(), notifyAll() can be used to synchronize • If interested in details, e.g. http://pages.cs.wisc.edu/~fischer/cs538.s06/lectures/Lecture34.4up.pdf Object obj; …. synchronized(obj) { //implicitelygetLock(obj) obj.doSomething(); //implicitelyfreeLock(obj) } …. public class ApplePicker() { private int count = 0; public synchronized void pickApple() { count++; System.out.println(“Picked an apple, we now have: “ + count + “apples”); } }
In practice • Speed up of computation -> Optional concurrency to obtain result quicker Vs. • “Multiple agents” – like application -> Inherently concurrent execution E.g. POS-Tag sentences vs. modeling Dining Philosophers
In practice • Identify part of code that can naturally be parallelized (can be executed independent from each other, e.g. sentence POS tagging) • Then likely no critical section at all • Avoids all complications and can be implemented relatively easy. • However, beware: • Sentence POS tagging itself may be in nature independently solvable for each sentence. However, the resources to complete the task (e.g. Stanford CoreNLP) may pose a CS. They then can either be instantiated multiple times, synchronized as shown, … or rewritten • Not all parallelization results in speedup. • Depending on the task to solve the overhead to create and manage a number of threads can overweight. • Amdahls law
In practice • Debugging becomes harder, due to • Non-deterministic execution order: Explosion of possible behavior • What that means • Multiple threads in Eclipse debug mode that may need to be stepped through and coordinated to achieve the desired execution order • Log files are written by multiple threads at the same time leading to less intuitively readable results • Turn off parallelization for debugging, if possible
As an addition: I believe all of the classes we use from Java for creation of threads and to synchronize them if necessary * come from this package: • http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/package-frame.html • Notable ones (because they are used in our code): • ExecutorService • Future • CountDownLatch • and subclasses of those