camera camera camera open camera camera camera open
play

# Camera camera = Camera.open(); Camera camera - PowerPoint PPT Presentation

# Camera camera = Camera.open(); Camera camera = Camera.open(); camera.setDisplayOrientation(90); camera.setDisplayOrientation(90); camera.unlock(); SurfaceHolder holder = getHolder();


  1. #

  2. • • • • • • • • •

  3. Camera camera = Camera.open(); Camera camera = Camera.open(); camera.setDisplayOrientation(90); camera.setDisplayOrientation(90); camera.unlock(); SurfaceHolder holder = getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.STP); MediaRecorder r = new MediaRecorder(); r.setCamera(camera); r.setAudioSource(MediaRecorder.AS); r.setVideoSource(MediaRecorder.VS); r.setOutFormat(MediaRecorder.MPEG4);

  4. C# Java System.out.println("Hi"); Console.WriteLine("Hi") … …

  5. function chunkData(str, step) { var colNames = []; function FZ(e, t) { var n = []; var len = str.length; var r = e.length; var i = 0; var i = 0; for (; i < r; i += t) if (i + t < for (; i < len; i += step) r) n.push(e.substring(i, i + if (i + step < len) t)); else colNames.push(str.substring(i, i + step)); n.push(e.substring(i, r)); else return n; colNames.push(str.substring(i, len)); } return colNames; }

  6.   

  7. JSNice: over a year of usage May 2015 – May 2016

  8. function chunkData(e, t) function chunkData(str, step) var n = []; var colNames = []; var r = e.length; var len = str.length; var i = 0; var i = 0; for (; i < r; i += t) for (; i < len; i += step) if (i + t < r) if (i + step < len) n.push(e.substring(i, i + t)); colNames.push(str.substring(i, i + step)); else else n.push(e.substring(i, r)); colNames.push(str.substring(i, len)); return n; return colNames;

  9. function chunkData(e, t) var n = []; var r = e.length; var i = 0; for (; i < r; i += t) if (i + t < r) n.push(e.substring(i, i + t)); else n.push(e.substring(i, r)); return n;

  10. function chunkData(e, t) var n = []; var r = e.length; var i = 0; for (; i < r; i += t) if (i + t < r) n.push(e.substring(i, i + t)); else n.push(e.substring(i, r)); return n; t r i … length … t i length r

  11. function chunkData(e, t) var n = []; var r = e.length; var i = 0; for (; i < r; i += t) if (i + t < r) n.push(e.substring(i, i + t)); else n.push(e.substring(i, r)); return n; t r i i t w … i step 0.5 t length j step 0.4 … length i r t i r w r length w i i len 0.6 length length 0.5 length r i length 0.3 len length 0.3

  12. function chunkData(e, t) var n = []; var r = e.length; var i = 0; for (; i < r; i += t) if (i + t < r) n.push(e.substring(i, i + t)); else n.push(e.substring(i, r)); return n; t r i 𝒙 𝑈 𝒈(𝑗, 𝑢, 𝑠, 𝑚𝑓𝑜𝑕𝑢ℎ) i t w … i step 0.5 t length j step 0.4 … length i r t i r w r length w i i len 0.6 length length 0.5 length r i length 0.3 len length 0.3

  13. function chunkData(e, t) var n = []; var r = e.length; var i = 0; for (; i < r; i += t) if (i + t < r) n.push(e.substring(i, i + t)); else n.push(e.substring(i, r)); return n; t r i 𝒙 𝑈 𝒈(𝑗, 𝑢, 𝑠, 𝑚𝑓𝑜𝑕𝑢ℎ) i t w … t i step 0.5 step length j step 0.4 … i r length i len t i r w r length w i i len 0.6 length length 0.5 length r i length 0.3 len length 0.3

  14. function chunkData(e, t) function chunkData(str, step) var n = []; var colNames = []; var r = e.length; var len = str.length; var i = 0; var i = 0; for (; i < r; i += t) for (; i < len; i += step) if (i + t < r) if (i + step < len) n.push(e.substring(i, i + t)); colNames.push(str.substring(i, i + step)); else else n.push(e.substring(i, r)); colNames.push(str.substring(i, len)); return n; return colNames; t r i 𝒙 𝑈 𝒈(𝑗, 𝑢, 𝑠, 𝑚𝑓𝑜𝑕𝑢ℎ) i t w … t i step 0.5 step length j step 0.4 … i r length i len t i r w r length w i i len 0.6 length length 0.5 length r i length 0.3 len length 0.3

  15. 1 𝑎(𝑦) exp(𝒙 𝑈 𝒈(𝑧, 𝑦) ) 𝑄 𝑧 𝑦 = 𝒙 𝑈 ∀j ∀ y Σ 𝑥 i f i ( x (j) , y (j) ) ≥ Σ 𝑥 i f i ( x (j) ,y ) + 𝚬 ( y,y (j) ) 𝑎(𝑦)

  16. var n = []; var colNames = []; var r = e.length; var len = str.length; var i = 0; var i = 0; for (; i < r; i += t) for (; i < len; i += step) if (i + t < r) if (i + step < len) n.push(e.subs(i, i + t)); colNames.push(str.subs(i, i + step)); else else n.push(e.subs(i, r)); colNames.push(str.subs(i, len)); return n; return colNames; 150MB 𝑄 𝑧 𝑦 …

  17. package com.example.dbhelper class DBHelper extends package a.b.c SQLiteHelper { class a extends SQLiteHelper SQLiteDatabase db; { SQLiteDatabase b; public public DBHelper(Context ctx) { a(Context ctx) { b = db = getWritableDatabase(); getWritableDatabase(); } } Cursor c(String str) { return b.rawQuery(str); }} Cursor execSQL(String str) { return db.rawQuery(str); } }

  18. Fundamental Problem

  19. D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read();

  20. D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹

  21. D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. open f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹

  22. P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹

  23. P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. read f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹

  24. P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹

  25. → 𝜹 key idea: synthesize a function f:

  26. f best = argmin cost( D , f ) f best ∊ D f ∊ ( ) f best f best 𝜹

  27. elem.notify({ CallExpression position: ‘top’, autoHide: false, MemberExpression ObjectExpression delay: 100 }); Identifier Property Property Property Property elem notify position autoHide delay String Boolean ‘ top’ false

  28. TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, DownFirst, DownLast, NextDFS, PrevDFS, NextLeaf, PrevLeaf,PrevNodeType, PrevNodeValue, PrevNodeContext WriteOp ::= WriteValue, WriteType, WritePos Up Left WriteValue 𝜹 ← 𝜹 ∙

  29. f best f best = argmin cost( D , f ) f ∊

  30. f best f D TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, ... WriteOp ::= WriteValue, WriteType, ... ≈ 10 8 f best = argmin cost( D , f ) f ∊ P D f P(element | f ( )) cost( D , f) = ( P ) 𝑃( 𝐸 )

  31. f best to predict program f best 𝜹 Left {} elem.notify( ... , WriteValue {hide} ... , Up {hide} { WritePos {hide, 3} position: ‘top’, Up {hide, 3} hide: false, DownFirst {hide, 3} ? DownLast {hide, 3} } WriteValue {hide, 3, notify} );

  32. D : f best 22.2% 30.4% 66.6%

  33. D : f best Hutter Prize Wikipedia Dataset uses a char-level DSL with state : 1.94 1.67 1.62 1.60 51% 1.44 51% 1.40 51%

  34. VarPtsTo (“global” , h ) checkIfInsideMethodCall function isBig(v) { checkMethodCallName return v < this .length checkReceiverType } checkNumberOfArguments ... [12, 5].filter(isBig); VarPtsTo( this, h )

  35. • • •

  36. ∈ TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, DownFirst, DownLast, NextDFS, PrevDFS, NextLeaf, PrevLeaf, PrevNodeType, PrevNodeValue, WriteOp ::= WriteValue, WriteType, WritePos f best = argmin cost( D , f ) f best ∊ f ∊ f best ( ) f best 𝜹

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend