no .bbl file generated mac Latex

Remember that it’s not LaTeX that generates the BBL, it’s BibTeX.

  1. Run LaTeX to generate the AUX file. It adds a line every time it finds a cite.
  2. Then run BibTeX (executable: bibtex) to generate the BBL (from the AUX lines).
  3. Then run LaTeX again, which will include the BBL.
  4. Then run LaTeX again to make any updates corresponding to including the possibly massive BBL (e.g., updating your final page count on each of your pages, updating your ToC, etc.).

Android 4.4.2 root issue

1/12

1. driver issue- on media device:

download Google USB driver, connecting with usb debugging and media device, then update the failed automatic driver installation.

2. root issue: the previous root doesn’t work

CF-Auto-Root-mako-occam-nexus4

What’s installed
– SuperSU binary and APK
– Nothing else, that’s it.

Installation and usage

– Download the ZIP file (see post below for link)
– Extract the ZIP file
– Boot your device in bootloader/fastboot mode. Usually this can be done by turning your device off, then holding VolUp+VolDown+Power to turn it on.
– Connect your device to your computer using USB

– Windows:
— Run root-windows.bat

– Linux
chmod +x root-linux.sh
— Run root-linux.sh

– Mac OS X
chmod +x root-mac.sh
— Run root-mac.sh

– Follow the on-screen instructions – watch both the computer and the device !

谷歌发布了安卓4.4.2 KOT49H,也更新了相应的CF-Auto-root工具,支持nexus4安卓4.4.2 KOT49H一键root。解决了fastboot,adb命令需要的工具包问题,也就是说在这个版本我们不必担心fastboot和adb驱动问题了,CF-Auto-root包里已经自带了。再次感谢大神chainfire的辛苦工作,他同时也是SuperSU的作者,是业界真正的大神使用这个工具您不需要刷第三方recovery就可以root了,并且工具非常干净,只是写入supersu而已,真正的一键root操作。
不过如果您之前没有解锁的话,这个工具会解锁手机,这样数据会被清空,建议您备份数据。

nexus 4 安卓4.4.2 KOT49H root包下载:
http://download.chainfire.eu/297/CF-Root/CF-Auto-Root/CF-Auto-Root-mako-occam-nexus4.zip?retrieve_file=1

其官方网站为:http://autoroot.chainfire.eu/

ROOT步骤:

1、将您的nexus 4进入fastboot模式,在关机状态下,同时按音量+/-和电源键进入fastboot模式,然后用USB数据线连接手机和电脑

2、直接运行root-windows.bat如果您是windows系统的话,大神还提供了mac和linux的非常方便,按Enter键继续,等待一下(非常短),然后手机重启。

3、如果手机里没有supersu的话,就去各大市场安装一个,用它就可以管理是否给予应用root权限了就表明root成功了。

如果您的手机没有解锁BL,请忽略以下内容,用上面的工具一键解锁ROOT即可,不过数据会被清空。

特别提醒:解锁BL会清数据。

由于我在升4.4的时候已经解锁BL了,清过一次数据,所以升4.4.2的时候不想再清一次数据,据说bat的批处理不会重复解锁BL,但我还是不放心,用记事本打开root-windows.bat进行修改,删除“tools\fastboot-windows.exe oem unlock”,这一行就是用来解锁的,不知道fastboot-windows.exe会不会判断机器的解锁状态,所以删除这条批处理是绝对保险的。

mac和linux的一键脚本修改方法一样root-linux.sh和root-mac.sh

4.4.2的完美root方法前提条件是BL已经解锁,否则必须先解锁才能ROOT,这样数据会被清空。
判断BL解锁的方法是开机后下面有个白色的打开锁的图标,或者进入fastboot 最后一行会显示UNLOCK.
解锁BL和ROOT不影响OTA升级,不用线刷卡刷,前提条件不要刷第三方recovery,不要修改系统文件和应用,OTA升级前用supersu自己清除ROOT即可(我在升级4.4.2的时候未UNROOT,一样成功OTA升级,为保险起见,最好还是UNROOT)
老鸟请自己动手修改bat
不会修改的可以下我修改后的一键脚本,支持BL已解锁的root,

CF-Auto-root工具

colors in Android

Android uses standard RGB (red, green and blue) color model. Each primary color value is usually represented by hexadecimal number.  At the beginning of such a color definition you have to put a pound character (#).

The simplest is just #RGB format, where #000 is black and #FFF is white. But in this format we have only 16 values per color so it gives 4096 combinations. That’s why #RRGGBB format is mainly used. In this format we have 256 values per primary color, so 16 777 216 colors in total. Black is #000000 and white is #FFFFFF.

decide which test to use

One-Way ANOVA: An ANOVA hypothesis tests the difference in population means based on one characteristic or factor. a—–>b

“An example of when a one-way ANOVA could be used is if you want to determine if there is a difference in the mean height of stalks of three different types of seeds.  Since there is more than one mean, you can use a one-way ANOVA since there is only one factor that could be making the heights different.

Two-Way ANOVA: An ANOVA hypothesis tests comparisons between populations based on multiple characteristics. a—->c<—-b “Suppose that there are three different types of seeds, and the possibility that four different types of fertilizer is used, then you would want to use a two-way ANOVA. The mean height of the stalks could be different for a combination of several reasons

Multivariate analysis of variance (MANOVA): it is simply an ANOVA with several dependent variables. That is to say, ANOVA tests for the difference in means between two or more groups, while MANOVA tests for the difference in two or more vectors of means. a—–>c, b——>d, a——d, b—–>c

http://www.uk.sagepub.com/upm-data/11886_Chapter_3.pdf

 

gridview -image+text/keep selected item highlight

 public static class ViewHolder
    {
        public ImageView imgViewFlag;
        public TextView txtViewTitle;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        ViewHolder view;
        LayoutInflater inflator = activity.getLayoutInflater();
        if(convertView==null)
        {
            view = new ViewHolder();
            convertView = inflator.inflate(R.layout.gridview_row, null);
            view.txtViewTitle = (TextView) convertView.findViewById(R.id.textView1);
            view.imgViewFlag = (ImageView) convertView.findViewById(R.id.imageView1);
            convertView.setTag(view);
        }
        else
        {
            view = (ViewHolder) convertView.getTag();
        }
        view.txtViewTitle.setText(listCountry.get(position));
        view.imgViewFlag.setImageResource(listFlag.get(position));
        return convertView;
    }

Gridview have option to modify it’s selector (listSelector). When we click on item in Gridview, we saw blink blue and then dissapear after we release it.

To make it stay, all we need just declare it at “android:listSelector” in GridView XML.

<?xml version=”1.0″ encoding=”utf-8″?>
<GridView xmlns:android=”http://schemas.android.com/apk/res/android&#8221;
android:id=”@+id/calendar_gridview”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:listSelector=”@color/caldroid_sky_blue”
android:adjustViewBounds=”true”
android:background=”@color/caldroid_lighter_gray”
android:gravity=”center_horizontal”
android:horizontalSpacing=”1dp”
android:numColumns=”7″
android:padding=”1dp”
android:stretchMode=”columnWidth”
android:verticalSpacing=”1dp” />

To make selector background not overriden / set in bottom side, use “setDrawSelectorOnTop(false)” :

gridView = (GridView) inflater.inflate(R.layout.date_grid_fragment, container, false);
gridView.setDrawSelectorOnTop(false); //work for gridview activity, but not the dialog.
焦点不见了是因为设置了background颜色,而selector的被background挡住了,设置这个属性即可                gridView.setDrawSelectorOnTop(true);
1.我自己用PS做了一张框图”frame”;
2.GridView.setSelector(frame)
3.GridView.setDrawSelectorOnTop(true)

 在adapter getView() 中设置 v.setSelected(true); 不起作用,而在点击的时候设置就有用?而一定要通过

gridview.setSelection(position);

这个是为啥?

我认为是当adapter初始化View之前已经设置select position ,通过onItemSelect 可以看到select 在 getView() 之前已经触发。

for (int i = 0; i < adatper.colorList.size(); i++) {
if (currentPenColor == adatper.colorList.get(i)) {
// gridViewColors.setDrawSelectorOnTop(true);
pos = i;
gridViewColors.post(new Runnable() {
@Override
public void run() {
gridViewColors.requestFocusFromTouch();
gridViewColors.setSelection(pos);
}
});
}
}

get lighter/darker shades of color Android

代码通过判断颜色(RGB)值获得颜色的深浅

Color choosers are a dime a dozen online, but 0to255.com is a very nice one. Even then, finding lighter and darker colors in Photoshop is somewhat unintuitive due to it using HSV rather than HSL for its color picker. Its stated purpose is to allow you to specify a color and then find shades that are darker and lighter than that color. HSV(又称HSB)表示方法。它把颜色分为三个参量,一个是色相Hue,具体表示在色相环上的一种纯色,一个是饱和Saturation,具体表示纯色在颜色中的百分比,当S=1时,表示颜色最纯,当S=0时,表示灰度值。一个是亮度Value,表示颜色的亮度,当V=0时,表示黑色。 HSV颜色系统在不破坏图像结构的基础上更该颜色方面起着不小的作用。直接更改按钮的各个颜色的色相值,这样由于是整体更改颜色的色相值,各种颜色搭配还是比较协调的。

人对浅颜色的色调变化比对深颜色的色调变化,更加敏感。当饱和度很小亮度很小,较小的RGB变化量会引起较大的色调变化。

多颜色空间:在hsv颜色空间中引入其他的颜色空间。

RGB 诉求于人眼对色彩的感应,YUV则着重于视觉对于亮度的敏感程度,Y 代表的是亮度,UV 代表的是彩度(因此黑白电影可省略UV,相近于RGB),分别用Cr和Cb来表示,因此YUV的记录通常以 Y:UV 的格式呈现。 第一个方案,是把 RGB 的值求和,然后取一个值,当和大于等于此值就为浅色: if ($R + $G + $B >= 450) { // add shadow } 这个算法很傻很简单,但效果不理想,特别是在 B 较大的时候,估计是眼睛对 RGB 各种颜色的敏感度都不一样。 可以使用YUV颜色编码来判断颜色的深浅。Y 是明亮度(灰阶),因此只需要获得 Y 的值而判断他是否足够亮就可以了:$grayLevel = $R * 0.299 + $G * 0.587 + $B * 0.114; if ($grayLevel >= 192) { // add shadow } 这个效果就是类似去 Photoshop 的去色功能

何为色差

色差简单来说就是颜色的差别, 定量表示的色知觉差异。从明度色调彩度这三种颜色属性的差异来表示。明度差表示深浅的差异,色调差表示色相的差异(即偏红或偏蓝等),彩度差表示鲜艳度的差异。通过明度(L)、色调(A)和彩度(B)表示的颜色模型,称为LAB颜色模型,区别于RGB和CMYK颜色模型。

如何计算色差

色差计算公式 A good way is to convert it to HSL color space, adjust the “lightness” component, and convert back to RGB. Another option is to use YUV color space, for which the calculations are easier. In YUV color space you can adjust darkness by changing the Y value.

onRestoreInstanceState()

onRestoreInstanceState() is called only when recreating activity after it was killed by the OS. Such situation happen when:

  • orientation of the device changes (your activity is destroyed and recreated)
  • there is another activity in front of yours and at some point the OS kills your activity in order to free memory (for example). Next time when you start your activity onRestoreInstanceState() will be called.

用户极少有机会自己来调用OnDraw函数
如果数据内容改变,应该调用父窗口的UpdataData 或者是Invalidata函数,通知窗口内容已经发生了改变,系统自己来调用OnDraw函数处理这个改变消息。

Invalidate(Rect),只渲染Rect区域.Rect是一个矩形, Draw是在Invalidate调用时它才会被触发.

 

Setup the Preferences

Android preferences is a key/value entries that store data that can be specific to a certain activity or shared among all activities within the application. 

the data are stored in a xml file.

  1. Preferences can be retrieved only by a single activity, we do it like this: we get a SharedPreferences object by calling getPreferences(int mode)

SharedPreferences prefs=getPreferences(Context.MODE_PRIVATE);

SharedPreferences.Editor editor=prefs.edit(); editor.putString(“pref 1”, “some text”); editor.commit();

  • the mode value can be one of the following:
      1. Context.MODE_PRIVATE (0): a file creating mode that makes the created file only accessible by applications with the same user ID (access the file from the same application context, will desctribe later).
      2. Context.MODE_WORLD_READABLE (1): file mode makes the file readable from other applications.
      3. Context.MODE_WORLD_WRITEABLE (2): file mode allows other applications to write to the file.

we get an instance of SharedPreferences.Editor and write the preference value with editor.putString(String key, String value) method.
shared preferences allows you to insert preferences using the following methods:

  1. editor.putBoolean(String key, boolean value).
  2. editor.putFloat(String key,float value).
  3. editor.putInt(String key, int value).
  4. editor.putLong(String key, long value)
  5. editor.putString(String key, String value)

then we call edit.commit() to save the preferences to the file. commit returns a boolean indicating the result of saving, true if successful and false if failed.

It can be shared and retrieved among all activities within the application, or through all applications on the device. To save preferences that can be retrieved from all activities in the application we do it like this:

SharedPreferences prefs= getSharedPreferences("demopref", Context.MODE_WORLD_READABLE);
        SharedPreferences.Editor editor=prefs.edit();
        editor.putString("demostring", "hello");
        editor.commit();

we give our preferences file a name (demopref in this case) so that other activities can reference that preferences file.
Sharing preferences across applications: 

We can store preferences in one application and read them in another application, this is done reading the preferences file by loading them through the first application’s context. let’s assume we have two applications:

  1. Application 1 with package name “com.mina.prefdemo“.
  2. Application2 with package name “com.mina.demoapp“.
If application1 creates a preferences file with the name “demopref” and inserts a String preference with the key/value “demostring/hello”.
now we access this file and value from application 2 like this:
Context con;
  try {
   con = createPackageContext("com.minasamy.prefdemo", 0);
   SharedPreferences pref=con.getSharedPreferences("demopref", Context.MODE_PRIVATE);
   String x=pref.getString("demostring", "not found");
   txt.setText(x);
  } catch (NameNotFoundException e) {
   Log.e(Tag, e.toString());
  }

// Setup the Preferences for this application, by class.
    Preferences prefs = Preferences.userNodeForPackage(MainClass.class);

   // Retrieve some preferences previously stored, with defaults in case this is the first run.
    String text = prefs.get(“A”“a”);
    String display = prefs.get(“B”“b”);

// Assume the user chose new preference values: Store them back.
    prefs.put(“A”“aa”);
    prefs.put(“B”“bb”);

 

sorting colors

Different people will sort a color palette in different ways. Our goal was to find a sorting mechanism that looked pleasing to the eye, but of course the results are completely subjective.

  • For aesthetics, we prefer the YIQ sort. It highlights trends in value change, but information about hue variation is hidden and sometimes invisible.
  • To communicate more information about hues, HSV sorting is by far superior, but it lacks the pleasant gradient-effect of the YIQ sort.
  • RGB sorting proves inferior to HSV and YIQ, though the results can still be interesting.
  • HSV sort is excellent for grouping colors of similar hues, but the IYQ and YIQ sorts also do this well and they can look cleaner than their HSV counterpart.

 

“web” palette sorted by saturation. see the sortpal pages for fuller versions.  It shows a set of color palettes, sorted by the various attributes like it’s redness, or brightness, or saturation. For example, in the “red” row, the reddest colors are at the far left and decreasingly red colors to the right. The width of the color depends on the number of colors in the palette.

Lots of ways to sort them mathematically. Some map well to what people perceive as correct. Some do not. e.g. web palette sorted by proximity in rgb colorspace:

Different color palettes can be chosen, including the 216 “web safe” palette (wiki), theX11/css “named” colors (wiki), the xkcd color survey (xkcd color survey), a rough approximation of the spot colors often used in print, a Hilbert curve through rgb space(wiki), misc artistic palettes, etc.

sorting methods:

  • Sorting by one component of a color space, the most obvious being the red, blue, green values of RGB:
  • Hue, saturation, and value (HSL and HSV) is another color space, that maps a lot more naturally to how people understand colors. e.g. web palette sorted by hue, saturation, value, lightness, respectively.

  • sorting by proximity in the 3d color space. The idea being to start at the origin, and find the closest colors in 3d.

The code is up at github. No promises to it’s correctness or functionality. secondary and tertiary parameters sort as well (hsv3d, and chroma ) mostly just to stabilize the sorts.

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web