//方法一: <?php $now = time(); //指定日期用法 $now = strtotime('2014-01-08') ; $day = 3600*24; $total = 12; $days =array() ; for ($i=2;$i<$total;$i++) { $timer = $now+$day*$i; $num= date("N",$timer)-2; //周一开始 if($num>=-1 and $num<=3) { if(cou…
分享下php获取数组中重复数据的两种方法. 1,利用php提供的函数,array_unique和array_diff_assoc来实现 <?php function FetchRepeatMemberInArray($array) { // 去掉重复数据的数组 $unique_arr = array_unique ( $array ); // 获取重复数据的数组 $repeat_arr = array_diff_assoc ( $array, $unique_arr ); return $rep…
一.标准C和C++都可用 1.获取时间用time_t time( time_t * timer ),计算时间差使用double difftime( time_t timer1, time_t timer0 ). 精确到秒. 测试程序如下: #include <time.h> #include <stdio.h> int main() { time_t start ,end ; double cost; time(&start); sleep(); time(&end…
http://blog.csdn.net/coder_xia/article/details/6566708 一.标准C和C++都可用 1.获取时间用time_t time( time_t * timer ),计算时间差使用double difftime( time_t timer1, time_t timer0 ). 精确到秒. 测试程序如下: #include <time.h> #include <stdio.h> int main() { time_t start ,end …
在之前的 调用百度地图API的总结 中获取当前位置信息我用的是 H5 ,其实微信也提供了获取用户地理位置的方法,现将这两种方法都贴出来,看情况选择使用. 一.H5 获取当前地理位置得到经纬度 // H5 获取当前位置经纬度 var location_lon = '',location_lat = ''; // 经度,纬度 if (navigator.geolocation){ navigator.geolocation.getCurrentPosition(function (position)…
public void GetWMDay() { List<string> list = new List<string>(); "; DateTime counYear = Convert.ToDateTime(year + "-01-01"); // DateTime nestYear = counYear.AddYears(); )) { ) { // 周日 to do } list.Add("周日" + i.ToShortD…
http://blog.csdn.net/caimagic/article/details/50696609 我用的是GetTickCount(), 获取到的是毫秒.…
在JSP里,获取客户端的IP地址的方法是:request.getRemoteAddr(),这种方法在大部分情况下都是有效的.但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实IP地址了. 如果使用了反向代理软件,将http://192.168.1.110:2046/ 的URL反向代理为 http://www.javapeixun.com.cn / 的URL时,用request.getRemoteAddr()方法获取的IP地址是:127.0.0.1 或 192.168.1.…
1.openstack日志一般放在什么什么位置?2.如何调试openstack命令执行过程? 我们会经常错误,但是我们碰到错误该怎么做,该如何找到原因.对于openstack有两种办法:在上一篇文章http://www.aboutyun.com/thread-7236-1-1.html中,已经提及这里整理一下.方法1:查看日志我们进入/var/log. 如果是keystone错误,就是进入keystone目录,查看相关日志 方法2:debug 1.正常命令 keystone  user-list…
方法一: 直接先上源码: private System.Collections.Generic.SortedDictionary<string, string> ReadFontInformation() { var dictionary = new System.Collections.Generic.SortedDictionary<string, string>(); Microsoft.Win32.RegistryKey localMachineKey = Microsof…