通过W3C标准发现用户的地理位置(Google Maps)

Google Maps version 3支持发现用户的地理位置,Google建议使用W3C Maps的标准发现用户的Geolocation,下面的js代码来源Google Code:


// Note that using Google Gears requires loading the Javascript
// at http://code.google.com/apis/gears/gears_init.js

var initialLocation;
var siberia = new google.maps.LatLng(60, 105);
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var browserSupportFlag =  new Boolean();

function initialize() {
  var myOptions = {
    zoom: 6,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

  // Try W3C Geolocation (Preferred)
  if(navigator.geolocation) {
    browserSupportFlag = true;
    navigator.geolocation.getCurrentPosition(function(position) {
      initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
      map.setCenter(initialLocation);
    }, function() {
      handleNoGeolocation(browserSupportFlag);
    });
  // Try Google Gears Geolocation
  } else if (google.gears) {
    browserSupportFlag = true;
    var geo = google.gears.factory.create('beta.geolocation');
    geo.getCurrentPosition(function(position) {
      initialLocation = new google.maps.LatLng(position.latitude,position.longitude);
      map.setCenter(initialLocation);
    }, function() {
      handleNoGeoLocation(browserSupportFlag);
    });
  // Browser doesn't support Geolocation
  } else {
    browserSupportFlag = false;
    handleNoGeolocation(browserSupportFlag);
  }

  function handleNoGeolocation(errorFlag) {
    if (errorFlag == true) {
      alert("Geolocation service failed.");
      initialLocation = newyork;
    } else {
      alert("Your browser doesn't support geolocation. We've placed you in Siberia.");
      initialLocation = siberia;
    }
    map.setCenter(initialLocation);
  }
}

预览

成都今天暴雨来袭

成都今天下雨了,刚刚下车到公司座下,大雨就来了。辛好…嘿嘿,不然淋得全身透湿。其实也不怕,成都公交上面有爱心伞,不知道是否可以用,也没有用过,不过刚才在网上看到“落雨了才知道,成都公交上的爱心雨伞纯粹就是摆设”

成都公交爱心伞

昨天下午4点过刚出门就开始下大雨,没有带伞顿时郁闷了。在站牌上等了几分钟公车。身上被淋得焦湿~
赶的58路往双桥子方向走~我上车之后就一直往车厢后面走,就看见这个放爱心雨伞的铁架子在黄色座位后面搁起的。心想这下巴适了,等哈下车的时候拿一把就不怕淋雨了噻。正当我准备伸手去抓伞柄的时候才发现上头有个锁,额。。。。锁起滴

这个为成都市民提供方便的爱心雨伞,搞半天是摆设嗦?下雨天都还拿来锁起,这是为什么呢?
这个东西到底有没有人管哦?好久打开,好久锁?哪个晓得?
善哉善哉~铁盒子上美其名曰“成都好人”,希望可以真正的为咋们成都市民提供用处哈。

Linq的sum函数InvalidOperationException异常解决办法

表A中有一列StorageByte(int, not null),求和

A.Where(a => a.JobId ==@jodid).Select(c=>c.StorageByte).Sum()

如果这个@jodid不存在,程序会报InvalidOperationException:The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type.

解决方案:

1.

public int GetSum(int jobId)

{

if (! A.Any(a => a.JobId == jobId)) return 0;

return A.Where(a => a.JobId ==jobId).Select(c=>c.StorageByte).Sum();

}

虽然能解决问题,但毕竟需要一次查询,于是想出方案2

2.

public int GetSum(int jobId)

{

return A.Where(a => a.JobId ==jobId).Select(c=>c.StorageByte).ToArray().Sum()

//or

//return A.Where(a => a.JobId ==jobId).Select(c=>c.StorageByte).ToList().Sum()

}

 

出处:http://www.cnblogs.com/yuxuanji/archive/2010/04/21/1716887.html

中国邮政编码查询网站

彼岸之远现在推出邮政编码查询,欢迎大家使用….如果有什么问题,欢迎与我联系:

Email:limingru@xnwai.com

QQ围脖:http://t.qq.com/blue-nature

邮政编码查询网站:http://tool.xnwai.com/youbian/

按城市浏览邮政编码:http://tool.xnwai.com/youbian/postcode/province.html

检验显示器,如果只能看到6,就可以扔了

检验显示器,如果只能看到6,就可以扔了

花的主题

翻电脑的时候发现了曾今何时的照片,一大堆的花,下面上图:

花 花 花 花 花 花 花 花 花 花 花 花

两个人共享的幸福我一个人收纳不了

当我24岁时,我们在一起,我们牵手去见彼此的家人,获取他们的认同。

image

如果当我26岁时,我们还在一起,我会挽起你留了很久的长发,要你做我最美的新娘。

image

如果当28岁时,我们还在一起,我们一起期待着迎接那个加入我们小家庭的新生命的降临。

image

如果当我29岁时,我们还在一起,我们一起用心经营我们的家,每天听着宝宝稚嫩的声音叫我们“爸爸”,“妈妈”。

image

如果当我33岁时,我们还在一起,不管周围的人如何分分合合,我们一起携手坚定的走过那3年之痛、7年之痒,继续着我们的幸福。

image

如果当我40岁时,我们还在一起,就算最初的激情已被现实的生活打磨殆尽,一切归于平淡,但彼此的目光依然会追逐着对方的身影,相视一笑也会觉得安心。

image

如果当我50岁时,我们还在一起,孩子离开我们去追寻他的幸福,虽然想念孩子,依然还有你陪在我的身边,每天傍晚手牵手一起散步。

image

如果当我60岁时,我们还在一起,我们都已改休息,有了大把的时间一起去做彼此曾经想做而没有做的事,去想去而没有去过的地方。

image

如果当我70岁时,我们还在一起,身边的孩子都已经称呼我们“爷爷”,“奶奶”,你还是当我是个不会照顾自己的孩子,呵护着你眼中的“孩子”。

image

如果当我76岁时,我们还在一起,我们要通知所有认识的人,邀请所有的人来参加我们的金婚纪念日,

分享我们的幸福快乐。

image

如果当我80岁时,我们还在一起,我们会每天躺在摇椅上一起晒太阳,虽然不知道生命会持续到哪一天,因为身边有彼此的陪伴,不在恐惧死亡,享受生命的每一天。

image

如果当我走到生命的最后一天时,

我希望身边有你陪伴,我不要做那个留下的人,

请允许我自私的先离开这个世界,

又或者你坚持不了了,我愿意陪你一同远去…

因为,

没有你的世界是冰冷的,

所以,

亲爱的,

如果到了那一天,

请让我先走,或带上我一起,

因为,

曾经属于

两个人共享的幸福我一个人收纳不了…..

asp.net开发网站遇到Ambiguous match found错误怎么办?

今天在用asp.net写网站的时候,莫名其妙报错:Ambiguous match found,然后就一直找错误,后面发现asp.net页面有一个控件的名字和我定义变量是一样的,虽然两个名字大小写不一样。后面把其中的一个改了其他的名字,结果一下子就好了,为什么asp.net会这样呢?不解…

其他网友也遇到了这样的错误:http://blog.csdn.net/snlei/archive/2009/11/04/4766385.aspx

http://www.cnblogs.com/smjack/archive/2008/08/15/1268566.html

分享两首英文歌曲《without you》和《Sabre Dance》

Mariah Carey – Without You
No I can’t forget this evening
Or your face as you were leaving
But I guess that’s just the way
The story goes
You always smile but in your eyes
Your sorrow shows
Yes it shows
No I can’t forget tomorrow
When I think of all my sorrow
When I had you there
But then I let you go
And now it’s only fair
That I should let you know
What you should know
I can’t live
If living is without you
I can’t live
I can’t give anymore
I can’t live
If living is without you
I can’t give
I can’t give anymore
Well I can’t forget this evening
Or your face as you were leaving
But I guess that’s just the way
The story goes
You always smile but in your eyes
Your sorrow shows
Yes it shows
I can’t live
If living is without you
I can’t live
I can’t give any more
I can’t live
If living is without you
I can’t give
I can’t give anymore

Mariah Carey – Without YouLRC by lzh ,from jiangxi pingxiang
No I can’t forget this eveningOr your face as you were leavingBut I guess that’s just the wayThe story goesYou always smile but in your eyesYour sorrow showsYes it shows
No I can’t forget tomorrowWhen I think of all my sorrowWhen I had you thereBut then I let you goAnd now it’s only fairThat I should let you knowWhat you should know
I can’t liveIf living is without youI can’t liveI can’t give anymoreI can’t liveIf living is without youI can’t giveI can’t give anymore
Well I can’t forget this eveningOr your face as you were leavingBut I guess that’s just the wayThe story goesYou always smile but in your eyesYour sorrow showsYes it shows
I can’t liveIf living is without youI can’t liveI can’t give any moreI can’t liveIf living is without youI can’t giveI can’t give anymore

without youSabre-Dance

人生就像走翘翘板

人的一生就像在翘翘板上面行走

image

总是得从低的那一头开始往高处走,每走一步,下一步就变得更加困难

image

愈往高处走时,便愈难找到平衡

image

当你以为自己愈来愈高时,其实你已经开始走下坡路

image

于是你发现,你永远无法站上你严重所见的高点

image

来来回回挣扎许多次,你发现要站上高点是多么的困难,因为你要始终找不到平衡点

image 

终于有一天,你认识到:原来只有找到人生的平衡点时,就是最高处….

image

如果你想要站在高出,还有另一种办法:就是有人在翘翘板的地处支撑你…..也许是家人,是爱人,或许…

被你干掉的敌人。

image