Submitted by gouki on 2013, June 10, 10:11 PM
就在wwdc 2013的前夜。osx升级了。。10.8.4就这样提示我安装了。
The OS X Mountain Lion v10.8.4 Update is recommended for all OS X Mountain Lion users and includes new features and fixes.
Updating your system
- You should back up your system before installation. To do this you can use Time Machine.
- Do not interrupt the installation process once you have started to update your system.
- You may experience unexpected results if you have third-party system software modifications installed, or if you've modified the operating system through other means.
- Click the Apple () menu and choose Software Update to check for the latest Apple software via the Mac App Store, including this update.
- Other software updates available for your computer may appear, which you should install. Note that an update's size may vary from computer to computer when installed using Software Update. Also, some updates must be installed prior to others.
You can also download the manual update installer. This is a useful option when you need to update multiple computers but only want to download the update once. These versions of the standalone installers are available from Apple Support Downloads.
About the update
The OS X Mountain Lion v10.8.4 Update is recommended for all OS X Mountain Lion users and includes features and fixes that improve the stability, compatibility, and security of your Mac, including the following:
- Compatibility improvements when connecting to certain enterprise Wi-Fi networks
- Microsoft Exchange compatibility improvements in Calendar
- A fix for an issue that prevented FaceTime calls to non-U.S. phone numbers
- A fix for an issue that may prevent scheduled sleep after using Boot Camp
- Improves VoiceOver compatibility with text in PDF documents
- Includes Safari 6.0.5, which improves stability for some websites with chat features and games
- A fix for an issue that may cause iMessages to display out of order in Messages
- Resolves an issue in which Calendars Birthdays may appear incorrectly in certain time zones
- A fix for an issue that may prevent the desktop background picture from being preserved after restart
- A fix for an issue that may prevent documents from being saved to a server using SMB
- Addresses an issue that may prevent certain files from opening after copied to a volume named “Home"
- A fix for an issue that may prevent changes to files made over NFS from displaying
- Resolves an issue saving files to an Xsan volume from certain applications
- Improves Active Directory log-in performance, especially for cached accounts or when using a .local domain
- Improves OpenDirectory data replication
- Improves 802.1X compatibility with ActiveDirectory networks
- Improves compatibility when using mobile accounts
Important: Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. Apple assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. Apple provides this only as a convenience to our users. Apple has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and Apple assumes no responsibility in this regard. Please understand that a third-party site is independent from Apple and that Apple has no control over the content on that website. Please
contact the vendor for additional information.
好吧,反正闲着也是闲着,而且说不定也没资格升级到10.9,我还是就这么随便先升到10.8.4吧。
Flutter | 评论:0
| 阅读:15946
Submitted by gouki on 2013, June 10, 12:12 AM
在用一个jQuery插件的时候,突然报错:b.browser undefined。。。
最初的时候想想不太可能啊?browser的判断不是从1.2.1的时候就一直就有了吗?于是搜索了一下jquery.mini.js,搜索browser,居然找不到。。。。
然后去官网看了一下,看到官方居然有这么一段:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
居然建议我们加载migrate,打开这个文件搜索browser。。果然找到了。
于是在项目里加入这一行,不报错的。做个记录。(不就7K嘛。干嘛不放进去,真是的。。)
Tags: jquery
Javascript | 评论:0
| 阅读:21394
Submitted by gouki on 2013, June 8, 11:24 PM
说实话,我还是挺喜欢这个标签选择器的,但是评论里说了,除了chrome外,其他浏览器几乎都不支持。因此,我就很纠结了。。
代码也不多,不过我不懂CSS,所以。。。不知道怎么改,明天找个人纠结纠结:
JavaScript代码
- ;(function(){
- $.fn.extend({
- iSelectTags:function(options){
- var iset={
- name:'.tagsbox',
- drop:$('#dropbox'),
- pseudoClass:$('#dropbox>p>a'),
- close:$('em.close'),
- separator:',',
- maxCount:10
- }
- options=$.extend(iset, options || {});
- var _input=$(iset.name);
- var _inputVal=_input.val();
- var _arr=new Array();
- var _left=_input.offset().left;
- var _top=_input.offset().top+_input.outerHeight();
- var _dropW=_input.outerWidth()-parseInt(_input.css('border-left-width'))-parseInt(_input.css('border-right-width'))-parseInt(iset.drop.css('paddingLeft'))-parseInt(iset.drop.css('paddingRight'));
- iset.drop.css({'position':'absolute','left':_left+'px','top':_top+'px','width':_dropW+'px'});
-
- var _txt=null;
- var _maxCount=parseInt(_input.attr('data-count'));
- if(isNaN(_maxCount)){
- _maxCount=iset.maxCount
- }
-
- _input.click(function(){
- iset.drop.show();
- iset.drop.bgiframe();
- }).bind('keyup change',function(){
-
-
- if ($(this).val() == '') {
- _arr = new Array();
- }else {
- _arr = $(this).val().split(iset.separator);
- }
- });
-
- $(document).click(function(e){
-
-
- if(iset.name.charAt(0)=='#'){
- if(e.target.id!=iset.name.substring(1)){
- iset.drop.hide();
- }
- }else if(iset.name.charAt(0)=='.'){
- if(e.target.className!=iset.name.substring(1)){
- iset.drop.hide();
- }
- }
- });
-
- iset.drop.click(function(e){
-
- e.stopPropagation();
- });
-
- iset.pseudoClass.click(function(){
-
- _txt=$(this).text();
-
-
- if(($.inArray(_txt,_arr)==-1) && (_arr.length<_maxCount )){
- _arr.push(_txt);
- _inputVal=_arr.join(iset.separator);
- _input.val(_inputVal);
- }
-
- });
-
- iset.close.click(function(){
- iset.drop.hide();
- });
- }
- });
- })(jQuery);
反正先转一下喽,先备着,再找其他新的。
这个插件的网址是:http://mrthink.net/jquery-plugin-iselecttags/,可以欣赏一下
Tags: 标签
Javascript | 评论:1
| 阅读:20709
Submitted by gouki on 2013, June 8, 5:54 PM
说实话,关于存储过程的博客还真的不多,有几个是值得看一下的
1、官方;http://dev.mysql.com/doc/refman/5.1/zh/stored-procedures.html
2、http://www.netingcn.com/tag/%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B
3、http://blog.why100000.com/?p=711
也发现,如果不做复杂查询,存储过程对我来说几乎没有,本来是想解决查找GEO相关的信息的,但发现这样的SQL:
SQL代码
- SELECT userid,lat,lng,gender,
- ( 6371 * acos( cos( radians(31.000700) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(120.000099) ) + sin( radians(31.000700) ) * sin( radians( lat ) ) ) ) AS distance
- FROM `user_geo` WHERE last_activity_time > '2013-03-11 00:00:00'
- ORDER BY distance ASC limit 100
这其中的复杂度就在于distance每次都要计算,所以我尝试换成了存储过程:
SQL代码
- DROP PROCEDURE IF EXISTS search_around_user;
- DELIMITER //
- CREATE PROCEDURE search_around_user
- (
- s_lat float(10,6),
- s_lng float(10,6),
- s_last_act datetime,
- s_gender tinyint,
- s_number tinyint,
- s_page tinyint
- )
- LABEL_PROC:
- BEGIN
- if s_number <= 1 then
- set s_number = 20;
- end if;
- if s_page <= 0 then
- set s_page = 0;
- end if;
- if s_gender <= 0 then
- set @genderQuery = "";
- else
- set @genderQuery = concat(" and gender = " , s_gender , " ");
- end if;
- set @limitQuery = concat("LIMIT " , s_page * s_number , " , " , s_number , " ");
-
- set @strsql = CONCAT("select userid, ",
- "( 6371 * acos( cos( radians(",s_lat,") ) * cos( radians( lat ) ) * cos( radians( lng ) - radians( ",s_lng," ) ) ",
- "+ sin( radians( ",s_lat," ) ) * sin( radians( lat ) ) ) ) AS distance ",
- " FROM user_geo where last_activity_time >= '", s_last_act , "' " , @genderQuery , " ORDER BY distance " , @limitQuery) ;
-
- prepare stmtsql from @strsql;
- execute stmtsql;
-
-
- END LABEL_PROC;
- //
- DELIMITER ;
然后再次调用:
SQL代码
- call search_around_user(31.000700,120.000099,'2013-03-11 00:00:00',0,20,0)
所耗费的时间和上述直接写SQL的时间是几乎一样的。想来,这也是因为distance的计算不能被优化而导致的。。。于是乎,放弃用存储过程
Tags: mysql, 存储过程
Baby | 评论:0
| 阅读:19282
Submitted by gouki on 2013, June 7, 1:59 PM
继昨天的处理之后,又来新的笔记 ,这次的笔记纯粹是个人的测试,与实际条件有关,比如,我要查询的字段不超过varchar的255的长度,所以我才这么做。
昨天做普通索引后,1100万条记录,索引 为220M,改成全文索引后,索引文件为1.1G,存储空间上,涨了5倍左右。
以下是笔记 ,请不要笑话,场景不同而已
- 经过测试
- title 字段改为全文索引后,在1100万条的时候
- 优点:
- 速度也为0.0x秒级。速度非常快
- 即使有or条件,只要带了limit参数,速度也非常快
- 缺点:
- 如果查询不带limit ,直接卡死,因为他要计算total count
- select count() 卡死
- 如果查询不存在的关键字,卡死
- 使用方法
- 尽量不做select count 查询 (数量低于100万时可以考虑,超过100万时,其实已经没有必要)
- 查询一定要带上limit条件
- 每次查询到不存在的关键字时,记录到关键词库,每次有新增记录时,select 关键词库一下,如果新增房间中有关键字,则将关键词去除,避免卡死
- 暂时不使用coreseek(sphinx)/xunsearch等第三方工具
- xunsearch只支持分词查询,不支持完全匹配
- 第三方工具,耗内存,而且增量的时候,不够及时
Tags: 索引
Baby | 评论:0
| 阅读:17963