Showing posts with label Memos. Show all posts
Showing posts with label Memos. Show all posts

Wednesday, July 26, 2017

Android Development and Debugging Tips

Removing Whitespace

Options in Eclipse for fixing Whitespace errors  automatically
Automatic whitespace removing before git commit

Kernel Log message


We can get last log after rebooting without rooting
cat /proc/last_kmsg

After updating boot.img for eng mode, we can use "cat /proc/kmsg.


Friday, December 12, 2014

A Tutorial on android.hardware.camera2.*

Introduction

Since android.hardware.camera is deprecated after API V21, we use android.hardware.camera2.*. The related reference is http://developer.android.com/reference/android/hardware/camera2/package-summary.html . But this is a kind of a dictionary. We need simple tutorials. There is no good sample code even in http://developer.android.com .


After long googling I found good one :
http://blog.csdn.net/torvalbill/article/details/40378539 . And I made my own document focused on only Camera Preview.

All of my code is here : https://github.com/stereoboy/android_samples

Setup All of related objects

The following list is as follows:

  • CameraManager
    • Select Camera
    • Create CameraDevice
  • CameraDevice
    • Create CaptureRequest
    • Create CameraCaptureSession
  • CaptureRequest, CaptureRequest.CameraBuilder
    • Link Surface for Viewing
    • Make CaptureRequest
  • CameraCaptureSession
    • Capture Camare Image and put the result on the Surface registered in CaptureRequest.

One of reasons why the related objects are a little bit complex is most of set-up process is done asynchronously. For example when we create CameraDevice, at first we register a callback function on CameraManager. When CameraDevice is created and the callback is called, we get CameraDevice in the callback code.

Repeated Capture by using HandlerThread

Main thread should not be blocked by Camera Capture. So we set up a background thread using HandlerThread and Handler

This handler in background thread do repeatedly Capturing set by CaptureRequest and CameraCaptureSession.


Saturday, November 29, 2014

Syntax-Highlighter on blogspot

  • Select "Template" in Setting
  • "Edit HTML"

  • Add the following code in <head> </head>



<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"></link>
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeEmacs.css" rel="stylesheet" type="text/css"></link>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
  
<script language='javascript' type='text/javascript'>
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.all();
</script>
<!-- Syntax Highlighter Additions END -->
  •  Add the following javascript code at the end of every post in HTML mode
<pre class="brush:c;"><code>&lt;script type="text/javascript"&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</code>
</pre>

<script type="text/javascript">
 SyntaxHighlighter.highlight();
</script>

Monday, December 31, 2012

About Macroeconomics



  • Intro
    • stabilization policy
      • fiscal policy vs monetary policy
      • secular long-run growth
    • economic aggregates
      • aggregate output
      • aggregate price level
      • investment spending
      • current account & financial account
    • business cycle
      • depression, recession, expansion
    • employment
      • employment, unemployment
      • labor force = employment + unemployment
      • discouraged worker
      • underemployment
    • inflation vs deflation
      • concepts of nominal vs real
      • consumer price index: CPI
      • price stability
      • inflation rate
    • open economy vs close economy
      • trade balance
      • capital flows
  • CH 24
    • national income and product accounts (national accounts)
    • consumer spending
    • physical capital & financial capital
    • government transfer
      • social security benefit
    • disposable income

    • private saving
      • financial market
    • government borrowing
    • government purchase of goods and services
    • investment spending
    • final goods and services