??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲黄色一级毛片,久久亚洲国产午夜精品理论片,亚洲国产精品无码久久久蜜芽http://www.tkk7.com/lihao336/成于坚忍Q毁于Qw?/description>zh-cnMon, 12 May 2025 04:04:13 GMTMon, 12 May 2025 04:04:13 GMT60[转]不同格式证书导入keystoreҎ(gu) http://www.tkk7.com/lihao336/archive/2012/02/03/369303.htmlcalvincalvinFri, 03 Feb 2012 02:06:00 GMThttp://www.tkk7.com/lihao336/archive/2012/02/03/369303.htmlhttp://www.tkk7.com/lihao336/comments/369303.htmlhttp://www.tkk7.com/lihao336/archive/2012/02/03/369303.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/369303.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/369303.html阅读全文

calvin 2012-02-03 10:06 发表评论
]]>
Android exchange 账户讄http://www.tkk7.com/lihao336/archive/2012/01/30/369036.htmlcalvincalvinMon, 30 Jan 2012 09:13:00 GMThttp://www.tkk7.com/lihao336/archive/2012/01/30/369036.htmlhttp://www.tkk7.com/lihao336/comments/369036.htmlhttp://www.tkk7.com/lihao336/archive/2012/01/30/369036.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/369036.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/369036.html关键点: “服务器”一栏,默认为gmail.comQ应该改为?font color="#FF0000">m.google.com”,然后l箋卛_?img src ="http://www.tkk7.com/lihao336/aggbug/369036.html" width = "1" height = "1" />

calvin 2012-01-30 17:13 发表评论
]]>
setComponentEnabledSetting doesn't work on widgethttp://www.tkk7.com/lihao336/archive/2011/12/27/367332.htmlcalvincalvinTue, 27 Dec 2011 06:14:00 GMThttp://www.tkk7.com/lihao336/archive/2011/12/27/367332.htmlhttp://www.tkk7.com/lihao336/comments/367332.htmlhttp://www.tkk7.com/lihao336/archive/2011/12/27/367332.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/367332.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/367332.html
<package name="com.android.setupwizard" codePath="/system/app/SetupWizard.apk" nativeLibraryPath="/data/data/com.android.setupwizard/lib" flags="1" ft="13349457a90" it="13349457a90" ut="13349457a90" version="130" userId="10016">
<sigs count="1">
<cert index="0" />
</sigs>
<disabled-components>
<item name="com.android.setupwizard.SetupWizardActivity" />
</disabled-components>
</package>

现在需要在q行时禁用某个widgetQ同时有一个system property用来标识是否需要禁用?br />因ؓwidget实际上就是个reveiverQ它接收android.appwidget.action.APPWIDGET_UPDATE的actionQ所以开始的思\是:
创徏一个BroadcastReceiverQ接收Intent.ACTION_BOOT_COMPLETEDq个动作Q从而在启动完成后调用SystemProperties.get("disable_widget")Q如果需要禁用这个widgetQ那么调用:
PackageManager.setComponentEnabledSetting(widgetComponentNameQPackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);

但是问题是,调用q个Ҏ(gu)disable掉这个widget后,发现必须把设备重启之后才能生?..
l过googleQ发现问题出在com.android.server.AppWidgetService.java?br />原来开机后QSystemServer会调用AppWidgetService的systemReady()Ҏ(gu)Q这个方法通过PackageManager查询所有的widget receiverlgQ保存到mInstalledProviders变量列表中,q持久化widget信息?data/system/appwidgets.xml中?br />而在Launcher上长按添加widget时的那个widget列表信息也是通过AppWidgetService取得mInstalledProviders列表?br />问题在于我们通过PackageManager.setComponentEnabledSettingQ)用掉某个widget后,packagemanager实这个组件disable了,但是AppWidgetService却没有去从packagemanager reload widget信息Q这导致了mInstalledProviders中保存的widget信息q是开机时loadq来的那些信息,q没有与pmq行同步。直C一ơ开用systemReady重新加蝲widget信息才会hq个列表?br />
参考:
Dynamically enabling or disabling a widget with PackageManager.setComponentEnabledSetting does not work
http://code.google.com/p/android/issues/detail?id=6533

http://blog.csdn.net/yinlijun2004/article/details/6136108



calvin 2011-12-27 14:14 发表评论
]]>
[转]unix/linux中的dup()pȝ调用http://www.tkk7.com/lihao336/archive/2011/12/13/366231.htmlcalvincalvinTue, 13 Dec 2011 06:20:00 GMThttp://www.tkk7.com/lihao336/archive/2011/12/13/366231.htmlhttp://www.tkk7.com/lihao336/comments/366231.htmlhttp://www.tkk7.com/lihao336/archive/2011/12/13/366231.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/366231.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/366231.html    sys_dup()的主要工作就是用来“复制”一个打开的文件号Q两个文g号都指向同一个文件。既然说单,我们首先来看一下它的代码(定义在fs/fcntl.c中)Q?br />
 1 asmlinkage long sys_dup(unsigned int fildes)
 2 {
 3     int ret = -EBADF;
 4     struct file * file = fget(fildes);
 5 
 6     if (file)
 7         ret = dupfd(file, 0);
 8     return ret;
 9 }
10 

而sys_dup()的主体是dupfd()Q定义在同一个文件中Q:

 1 static int dupfd(struct file *file, int start)
 2 {
 3     struct files_struct * files = current->files;
 4     int ret;
 5 
 6     ret = locate_fd(files, file, start);
 7     if (ret < 0)
 8         goto out_putf;
 9     allocate_fd(files, file, ret);
10     return ret;
11 
12 out_putf:
13     write_unlock(&files->file_lock);
14     fput(file);
15     return ret;
16 }
17 

注:dup和dup2的原型如下:
#include <unistd.h>

int dup(int file_descriptor);
int dup2(int file_descriptor1, int file_descriptor2)
dupq回的文件描q符L取最的可用?br />dup2q回的文件描q符或者与file_descriptor2相同Q或者是W一个大于该参数的可用倹{?/font>

    而这么一个简单的pȝ调用是如何完成重定向q个艰巨的Q务的呢?我们不妨先看个例子?br />    当我们在shell下输入如下命令:“echo hello!”,q条命o要求shellq程执行一个可执行文gechoQ参Cؓ“hello!”。当shell接收到命令之后,先找? bin/echoQ然后fork()Z个子q程让他执行bin/echoQƈ参C递给它,而这个进E从shelll承了三个标准文Ӟx准输? QstdinQ,标准输出QstdoutQ和标准出错信息QstderrQ,他们三个的文件号分别????/font>而至于echoq程的工作很单,是参数“hello!”写到标准输出文件中去,通常都是我们的显C器上。但是如果我们将命oҎ(gu)“echo hello! > foo”,则在执行时输出将会被重定向到盘文gfoo?font color="#0000FF">Q注Q重定向于文件描q符有关Q?/font>。我们假定在此之前该shellq程只有三个标准文g打开Q文件号分别???Q以上命令行按如下序列执行Q?br />    (1) 打开或创建磁盘文件fooQ如果foo中原来有内容Q则清除原来内容Q其文g号ؓ3?br />    (2) 通过dup()复制文gstdoutQ即文件号1出的filel构指针复制到文件号4处,目的是将stdout的file指针暂时保存一?br />    (3) 关闭stdoutQ即1hӞ但是׃4h件对stdout也同时有个引用,所以stdout文gq未真正关闭Q只是腾?h件号位置?br />    (4) 通过dup()Q复?hӞ即磁盘文件fooQ,׃1h件关闭,其位|空~,?h件被复制?P卌E中原来指向stdout的指针指向了foo?br />    (5) 通过pȝ调用fork()和exec()创徏子进Eƈ执行echoQ子q程在执行echo前夕关闭3号和4hӞ只留???三个文gQ请注意Q这 时的1h件已l不是stdout而是盘文gfoo了。当echo惛_stdout文g写入“hello!”时自然写入到了foo中?br />    (6) 回到shell后,关闭指向foo?号与3h件文Ӟ再用dup()和close()?h复至stdoutQ这样shell恢复了0??三个标准输入/输出文g?br />
    由此可见Q?font color="#FF0000">当echoE序Q或其他Q在q行的时候ƈ不知道stdoutQ对于stdin和stderr同样Q指向什么,q程与实际输出文件或讑֤的结合是在运行时由其父进E“包办”的。这样就化了子进E的E序设计Q因为在设计时只要跟三个逻辑上存在的文g打交道就可以?/font>。可能有Z觉得q很像面向对象中 的多态和重蝲Q没有什么新奇之处,但是如果你活?0甚至40q前Q可能你会改变你的看法。?

calvin 2011-12-13 14:20 发表评论
]]>
Activity的onSaveInstanceState调用时机http://www.tkk7.com/lihao336/archive/2011/11/22/364585.htmlcalvincalvinTue, 22 Nov 2011 09:56:00 GMThttp://www.tkk7.com/lihao336/archive/2011/11/22/364585.htmlhttp://www.tkk7.com/lihao336/comments/364585.htmlhttp://www.tkk7.com/lihao336/archive/2011/11/22/364585.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/364585.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/364585.html
Activity的生命周期里q没有提到onSaveInstanceState的触发,q个函数提供了ؓ我们在某些情况下保存Activity信息的机会,但需要注意的是这个函C是什么时候都会被调用的,官方文解释的比较清楚,Ҏ(gu)
译一下?
原文出处Qandroid-sdk-windows-1.5_r3/docs/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)
protected void onSaveInstanceState (Bundle outState)
       Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method will be passed to both). This method is called before an activity may be killed so that when it comes back some time in the future it can restore its state. For example, if activity B is launched in front of activity A, and at some point activity A is killed to reclaim resources, activity A will have a chance to save the current state of its user interface via this method so that when the user returns to activity A, the state of the user interface can be restored via onCreate(Bundle) or onRestoreInstanceState(Bundle).

    在activity被杀掉之前调用保存每个实例的状?以保证该状态可以在onCreate(Bundle)或? onRestoreInstanceState(Bundle) (传入的Bundle参数是由onSaveInstanceState装好的)中恢复。这个方法在一个activity被杀d调用Q当? activity在将来某个时d来时可以恢复其先前状态。例如,如果activity B启用后位于activity A的前端,在某个时刻activity A因ؓpȝ回收资源的问题要被杀掉,A通过onSaveInstanceState有Z保存其用L面状态,使得来用户q回到activity A时能通过onCreate(Bundle)或者onRestoreInstanceState(Bundle)恢复界面的状态?

    Do not confuse this method with activity lifecycle callbacks such as onPause(), which is always called when an activity is being placed in the background or on its way to destruction, or onStop() which is called before destruction. One example of when onPause() and onStop() is called and not this method is when a user navigates back from activity B to activity A: there is no need to call onSaveInstanceState(Bundle) on B because that particular instance will never be restored, so the system avoids calling it. An example when onPause() is called and not onSaveInstanceState(Bundle) is when activity B is launched in front of activity A: the system may avoid calling onSaveInstanceState(Bundle) on activity A if it isn't killed during the lifetime of B since the state of the user interface of A will stay intact.
  
    不要这个方法和activity生命周期回调如onPause()或onStop()搞؜淆了QonPause()在activtiy被放|到背景或? 自行销毁时M被调用,onStop()在activity被销毁时被调用。一个会调用onPause()和onStop()Q但不触? onSaveInstanceState的例子是当用户从activity Bq回到activity AӞ没有必要调用B的onSaveInstanceState(Bundle)Q此时的B实例永远不会被恢复,因此pȝ会避免调用它。一个调? onPause()但不调用onSaveInstanceState的例子是当activity B启动q处在activity A的前端:如果在B的整个生命周期里A的用L面状态都没有被破坏的话,pȝ是不会调用activity A的onSaveInstanceState(Bundle)的?

    The default implementation takes care of most of the UI per-instance state for you by calling onSaveInstanceState() on each view in the hierarchy that has an id, and by saving the id of the currently focused view (all of which is restored by the default implementation of onRestoreInstanceState(Bundle)). If you override this method to save additional information not captured by each individual view, you will likely want to call through to the default implementation, otherwise be prepared to save all of the state of each view yourself. If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause().

      默认的实现负责了大部分UI实例状?的保?Q采用的方式是调用UI层上每个拥有id的view的onSaveInstanceState() Qƈ且保存当前获得焦点的view的id(所有保存的状态信息都会在默认的onRestoreInstanceState(Bundle)实现中恢?? 如果你覆写这个方法来保存额外的没有被各个view保存的信息,你可能想要在默认实现q程中调用或者自׃存每个视囄所有状态。如果被调用Q这个方法会 在onStop()前被触发Q但pȝq不保证是否在onPause()之前或者之后触发?

很多不明白ActivitycM包含的onSaveInstanceState和onRestoreInstanceState有什么用Q首先声 明下使用q两个方法时一定要注意情况和了解Activity的生命周期,否则有的时候? onSaveInstanceState和onRestoreInstanceState 可能不会被触发,虽然他们都是Activity的重写方法。(?Android开发网Q?

他们比较常用到的地方? Sensor、Land和Port布局的自动切换,q去Android开发网曄说过解决横屏和竖屏切换带来的数据被置I或者说onCreate被重复调 用问题,其实Android提供的onSaveInstanceStateҎ(gu)可以保存当前的窗口状态在卛_布局切换前或当前Activity被推入历? 栈,其实布局切换也调用过onPause所以被推入Activity的history stackQ如果我们的Activity在后台没有因行内存吃紧被清理Q则切换回时会触发onRestoreInstanceStateҎ(gu)?

q两个方法中参数均ؓBundleQ可以存攄?SharedPreferences 的数据,所以用它们作为当前窗口的状态保存是比较合适的。实际用代?
@Override
  protected void onSaveInstanceState(Bundle outState){
            outState.putString("lastPath", "/sdcard/android123/cwj/test");
  }


@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);

String cwjString = savedInstanceState.getString("lastPath");
}

onSaveInstanceState和onRestoreInstanceState触发的时?
已有 199 ơ阅?2011-3-10 10:32 |个h分类:Android|关键?onSaveInstanceState onRestoreInstanceState
先看Application Fundamentals上的一D话Q?
Android calls onSaveInstanceState() before the activity becomes vulnerable to being destroyed by the system, but does not bother calling it when the instance is actually being destroyed by a user action (such as pressing the BACK key)
从这句话可以知道Q当某个activity变得“容易”被pȝ销毁时Q该activity的onSaveInstanceState׃被执行,除非该activity是被用户d销毁的Q例如当用户按BACK键的时候?
注意上面的双引号Q何为“容易”?a下之意就是该activityq没有被销毁,而仅仅是一U可能性。这U可能性有哪些Q通过重写一? activity的所有生命周期的onXXXҎ(gu)Q包括onSaveInstanceState和onRestoreInstanceStateҎ(gu)Q我 们可以清楚地知道当某个activityQ假定ؓactivity AQ显C在当前task的最上层Ӟ其onSaveInstanceStateҎ(gu)会在什么时候被执行Q有q么几种情况Q?
1、当用户按下HOME键时。这是显而易见的Q系l不知道你按下HOME后要q行多少其他的程序,自然也不知道activity A是否会被销毁,故系l会调用onSaveInstanceStateQ让用户有机会保存某些非怹性的数据。以下几U情늚分析都遵循该原则
2、长按HOME键,选择q行其他的程序时?
3、按下电(sh)源按键(关闭屏幕昄Q时?
4、从activity A中启动一个新的activity时?
5、屏q方向切换时Q例如从竖屏切换到横屏时。在屏幕切换之前Q系l会销毁activity AQ在屏幕切换之后pȝ又会自动地创建activity AQ所以onSaveInstanceState一定会被执?
总而言之,onSaveInstanceState的调用遵循一个重要原则,卛_pȝ“未l你许可”时销毁了你的activityQ则 onSaveInstanceState会被pȝ调用Q这是系l的责QQ因为它必须要提供一个机会让你保存你的数据(当然你不保存那就随便你了Q?
至于onRestoreInstanceStateҎ(gu)Q需要注意的是,onSaveInstanceStateҎ(gu)? onRestoreInstanceStateҎ(gu)“不一定”是成对的被调用的,onRestoreInstanceState被调用的前提 是,activity A“确实”被pȝ销毁了Q而如果仅仅是停留在有q种可能性的情况下,则该Ҏ(gu)不会被调用,例如Q当正在昄activity A的时候,用户按下HOME键回C界面Q然后用L接着又返回到activity AQ这U情况下activity A一般不会因为内存的原因被系l销毁,故activity A的onRestoreInstanceStateҎ(gu)不会被执?
另外QonRestoreInstanceState的bundle参数也会传递到onCreateҎ(gu)中,你也可以选择在onCreateҎ(gu)中做数据q原

calvin 2011-11-22 17:56 发表评论
]]>
InputStream.available()Ҏ(gu)http://www.tkk7.com/lihao336/archive/2011/11/18/364225.htmlcalvincalvinFri, 18 Nov 2011 06:16:00 GMThttp://www.tkk7.com/lihao336/archive/2011/11/18/364225.htmlhttp://www.tkk7.com/lihao336/comments/364225.htmlhttp://www.tkk7.com/lihao336/archive/2011/11/18/364225.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/364225.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/364225.html
看文:
Returns an estimated number of bytes that can be read or skipped without blocking for more input.

Note that this method provides such a weak guarantee that it is not very useful in practice.

Firstly, the guarantee is "without blocking for more input" rather than "without blocking": a read may still block waiting for I/O to complete ?the guarantee is merely that it won't have to wait indefinitely for data to be written. The result of this method should not be used as a license to do I/O on a thread that shouldn't be blocked.

Secondly, the result is a conservative estimate and may be significantly smaller than the actual number of bytes available. In particular, an implementation that always returns 0 would be correct. In general, callers should only use this method if they'd be satisfied with treating the result as a boolean yes or no answer to the question "is there definitely data ready?".

Thirdly, the fact that a given number of bytes is "available" does not guarantee that a read or skip will actually read or skip that many bytes: they may read or skip fewer.

It is particularly important to realize that you must not use this method to size a container and assume that you can read the entirety of the stream without needing to resize the container. Such callers should probably write everything they read to a ByteArrayOutputStream and convert that to a byte array. Alternatively, if you're reading from a file, length() returns the current length of the file (though assuming the file's length can't change may be incorrect, reading a file is inherently racy).

The default implementation of this method in InputStream always returns 0. Subclasses should override this method if they are able to indicate the number of bytes available.



calvin 2011-11-18 14:16 发表评论
]]>
端存储和大端存?/title><link>http://www.tkk7.com/lihao336/archive/2011/11/15/363850.html</link><dc:creator>calvin</dc:creator><author>calvin</author><pubDate>Tue, 15 Nov 2011 07:36:00 GMT</pubDate><guid>http://www.tkk7.com/lihao336/archive/2011/11/15/363850.html</guid><wfw:comment>http://www.tkk7.com/lihao336/comments/363850.html</wfw:comment><comments>http://www.tkk7.com/lihao336/archive/2011/11/15/363850.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lihao336/comments/commentRss/363850.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lihao336/services/trackbacks/363850.html</trackback:ping><description><![CDATA[所有网l协议都是采用big endian的方式来传输数据的。所以有时我们也会把big endian方式UC为网l字节序。当两台采用不同字节序的L通信Ӟ在发送数据之前都必须l过字节序的转换成ؓ|络字节序后再进行传输? <p><wbr> <wbr> <wbr> 判断端q是大端规则的方法:</wbr></wbr></wbr></p><p><wbr>int x = 1;<br /><wbr>if(*(char *)&x == 1)//取x指针强制转换为char*cd再取|此时取到的值是int最低字节?br /><wbr> <wbr> <wbr> <wbr> printf(“little-endian\n?;<br /><wbr>else<br /><wbr> <wbr> <wbr> <wbr> printf(“big-endian\n?;</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></p><p><wbr></wbr></p><p><wbr> <wbr> <wbr> <wbr> 另外补充Q?/wbr></wbr></wbr></wbr></p><p>1QBIG-ENDIAN、LITTLE-ENDIAN、跟CPU有关的,每一UCPU不是BIG-ENDIAN是LITTLE- ENDIAN、。IA架构的CPU中是Little-EndianQ而PowerPC 、SPARC和Motorola处理器。这其实是所谓的L字节序。而网l字节序是指数据在网l上传输时是大头q是头的,在Internet的网l字 节序是BIG-ENDIAN。所谓的JAVA字节序指的是在JAVA虚拟Z多字节类型数据的存放序QJAVA字节序也是BIG-ENDIAN?/p><p>2Q所以在用C/C++写通信E序Ӟ在发送数据前务必用htonl和htonsL整型和短整型的数据进行从L字节序到|络字节序的转换Q而接 收数据后对于整型和短整型数据则必调用ntohl和ntohs实现从网l字节序C机字节序的{换。如果通信的一Ҏ(gu)JAVAE序、一Ҏ(gu)C/C++E? 序时Q则需要在C/C++一侧用以上几个方法进行字节序的{换,而JAVA一侧,则不需要做M处理Q因为JAVA字节序与|络字节序都是BIG- ENDIANQ只要C/C++一侧能正确q行转换卛_Q发送前从主机序到网l序Q接收时反变换)。如果通信的双斚w是JAVAQ则Ҏ(gu)不用考虑字节序的? 题了?/p><p><br /></p><p>转自<a >http://www.embest.net/index.php/archives/259</a><br /></p><img src ="http://www.tkk7.com/lihao336/aggbug/363850.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lihao336/" target="_blank">calvin</a> 2011-11-15 15:36 <a href="http://www.tkk7.com/lihao336/archive/2011/11/15/363850.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>重写equals和hashCodeҎ(gu)http://www.tkk7.com/lihao336/archive/2011/11/10/363457.htmlcalvincalvinThu, 10 Nov 2011 10:25:00 GMThttp://www.tkk7.com/lihao336/archive/2011/11/10/363457.htmlhttp://www.tkk7.com/lihao336/comments/363457.htmlhttp://www.tkk7.com/lihao336/archive/2011/11/10/363457.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/363457.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/363457.html实现equalsҎ(gu)的过E如下:
1 使用==q算W来判断是否引用同一个对象?br />2 使用instance of操作W来判断参数是否是正的cd?br />3 实参cast成正的cd?br />4 对于每个关键属性,q行比较:
对于非float或double的primitivecdQ?=判断{h(hun)?
对于floacdQ先使用Float.floatToIntBits转换成intcdQ然后?=比较intcd的?
对于doublecdQ先使用Double.doubleToLongBits转换成longcdQ然后?=比较longcd;
对于对象引用Q递归的调用equalsҎ(gu)?br />对于数组cdQ对其中的元素进行上q的操作,或者用Arrays.equalsҎ(gu)(version 1.5)?br />Z避免NPEQ可以?br />field == null ? o.field == null : fleld.equals(o.field);

重写hashCodeҎ(gu)如下Q?br />1 把某个非零常数|例如17Q保存在int变量result中;
2 对于对象中每一个关键域fQ指equalsҎ(gu)中考虑的每一个域Q?计算散列码cQ?br />2.1 boolean型,计算(f ? 0 : 1);
2.2 byte,char,short型,计算(int);
2.3 long型,计算(int) (f ^ (f>>>32));
2.4 float型,计算Float.floatToIntBits(f);
2.5 double型,计算Double.doubleToLongBits(f)得到一个longQ再执行[2.3];
2.6 对象引用Q递归调用它的hashCodeҎ(gu);
2.7 数组域,对其中每个元素按照上面的规则计算hash code?br />3 上面计得到的散列码保存到int变量cQ然后执?result=37*result+c;
4 q回result?br />


calvin 2011-11-10 18:25 发表评论
]]>
利用javap生成Ҏ(gu){֐http://www.tkk7.com/lihao336/archive/2011/10/24/361901.htmlcalvincalvinMon, 24 Oct 2011 08:04:00 GMThttp://www.tkk7.com/lihao336/archive/2011/10/24/361901.htmlhttp://www.tkk7.com/lihao336/comments/361901.htmlhttp://www.tkk7.com/lihao336/archive/2011/10/24/361901.html#Feedback2http://www.tkk7.com/lihao336/comments/commentRss/361901.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/361901.html如:
 1 package com.demo;
 2 
 3 public class SigTest {
 4 
 5     public static final String name = null;
 6 
 7     public int getName(int[] data,long index) {
 8         return 0;
 9     }
10 }
11 

[calvin@calvin-desktop /tmp 15:59:50 ]
$ javac SigTest.java
[calvin@calvin-desktop /tmp 15:59:57 ]
$ javap -s -p -classpath . SigTest
Compiled from "SigTest.java"
public class com.demo.SigTest extends java.lang.Object{
public static final java.lang.String name;
  Signature: Ljava/lang/String;
public com.demo.SigTest();
  Signature: ()V
public int getName(int[], long);
  Signature: ([IJ)I
static {};
  Signature: ()V
}


-s表示打印{֐信息
-p表示打印所有函数和成员的签名信息,默认只打印public的签名信息?br />
注意Q?br />_体部分?class文g的文件名Q不?class后缀Q否则提C?br />ERROR:Could not find SigTest.class.



calvin 2011-10-24 16:04 发表评论
]]>
Ubuntu10.04安装无线|卡ath9k_htc驱动http://www.tkk7.com/lihao336/archive/2011/10/18/361521.htmlcalvincalvinTue, 18 Oct 2011 05:55:00 GMThttp://www.tkk7.com/lihao336/archive/2011/10/18/361521.htmlhttp://www.tkk7.com/lihao336/comments/361521.htmlhttp://www.tkk7.com/lihao336/archive/2011/10/18/361521.html#Feedback0http://www.tkk7.com/lihao336/comments/commentRss/361521.htmlhttp://www.tkk7.com/lihao336/services/trackbacks/361521.html型号为TL_WN721NQ插在Ubuntu10.04上没有反应。据?0.10以后插上可以用了,没有试?br />
W一?定
ath9k_htc驱动支持你的|卡型号
http://linuxwireless.org/en/users/Drivers/ath9k_htc/devices 列出了支持的型号列表Q你可以通过lsusb查看自己的网卡型h否在列表当中?br />
W二?安装f(xi)irmwire
?a >q里下蝲
htc_9271.fwQ拷贝到/lib/firmwire?br />
W三?安装compact wireless
安装compact wireless有打包好的deb包,?a >q里下蝲GUI Program to install ath9k_htcQ安装完后直接运行,{待安装完成重启机器可以了?br />爱折腄也可以到http://wireless.kernel.org/download/
最新的compact wireless驱动Q然后编译安装:
sudo make
sudo make install
sudo make unload
sudo make load ath9k_htc
重启机器卛_?br />
http://forum.ubuntu.com.cn/viewtopic.php?f=116&t=326568&p=2388841
http://blog.chinaunix.net/space.php?uid=20620288&do=blog&id=2691282


calvin 2011-10-18 13:55 发表评论
]]>
վ֩ģ壺 þѾƷav| Ļɫ| AëƬ߲| ۺɫһС˵| Ļ߹ۿվַ| ޾Ʒ456˳| ޹һ| ձһ| ɫ߹ۿ| ԲaëƬ| ҹƵ| 337pձŷ޴ɫ| Ƶһ| aaaƬѿ| Ļþ| ɫƵ| Ļѿ| ɫۺϽѹۿ| ޸һ| ޹ҹĻƷվ | ޹Ʒþþþվ | Ʒһʽֱ| AVɫ߹ۿ| ޹һҳwww| ԴСƵ߹ۿ| Ʒ׽߹ۿ| װɫƵ| ޹˾žۺ| ޙպ߶| Դ߹ۿѸ| һƬɫ | ʹA18Ƭ| ձѹۿ| һҹaëƬƵ| ˳վ߲| þþþþþþ| ޾ƷԲ߹ۿ| Ƭ߹ۿ| ˳߲վ| ȫӰѹۿȫ| vƬ߹ۿ|