Mindblown: a blog about philosophy.

  • 非常有用的css伪类

    div>ul:first-child{}选择第一个元素 div>ul:last-child{}选择最后一个元素 :nth-child()选择某个元素的一个或多个特定的子元素;你可以按这种方式进行选择:  :nth-child(length);/*参数是具体数字 length为整数*/ :nth-child(n);/*参数是n,n从0开始计算*/ :nth-child(n*length)/*n的倍数选择,n从0开始算*/ :nth-child(n+length);/*选择大于length后面的元素*/ :nth-child(-n+length)/*选择小于length前面的元素*/ :nth-child(n*length+1);/*表示隔几选一*/ 具体使用时乘号(*)不用写,比如 li:nth-child(2n+1)     :nth-of-type(odd) /*偶数个*/ :nth-of-type(even) /*奇数个*/

  • how to use godaddy custom php.ini(如何在godaddy上修改php.ini文件)

    Today I was find godaddy can change php.ini for self website, that's a suprise for me. I was write a php soft to crawl a mother website , and used multithreading, but the problem is time out. I find more website and they write more , but the same question , how to us custom…

  • 2014,4,8 需要记住的一天 need to remember a day

    2014-4-8 这一天,我们还在睡梦中时我所用的一台服务器被攻击了,没有破坏真题的数据结构,但是一些特殊的功能不能用了,通过机房努力晚上终于可以用了,在美国刚好是白天,有个展会。 这一天,微软xp退役了。我们开心的举起杯子,ie6的用户又要减少了。 这一天,openSSL心脏出血了。这是我在学习网络时觉得最靠谱的一个网络协议。openSSL的这一漏洞爆出,不知道会有多少大小黑客会伸出黑手。最关键的是普通用户不知道这是什么。他们还是在和原来一样输入着他们的账号和密码。openSSL仿佛没有这个漏洞问题,但是我们不知道那一家提供的是最新的。所以,大家快快清楚cookie吧!最好这3天都不要输入密码在网络上。 希望心脏赶紧恢复。 PS:openSSL涉及到:CA证书,https,等等我们在网络上用的证书和加密协议。 中国薄弱的网银,你们怎么办?   2014-4-8 this day, we were still asleep when I use a server was attacked, no datastructure damage., but some special function can not be used, through the roomto night finally can be used, in USA just during the day, a show. On this day, Microsoft XP retired. We are happy to lift the cup, IE6 users but also to reduce the. This day, openSSL heart is bleeding. I think it is a most reliable network protocolin the learning network. This loophole openSSL broke, do not know…

  • 中国的免费svn

    和很多的开发人员一样,我在家里的时候会写一些自己的东西,但是这些都是一些测试代码,但是我们很希望可以保存。svn是我们用的比较多的。所以我们需要一个免费的svn,因为我们的测试代码没有收入,也不愿意为此花费。我在网上找了很多svn提供商。免费的空间太少了。百度云什么的虽然便宜,但是相对来说还是要我们付费的。有人说google code 可以有。但是google现在在中国有时候是打不开的,很纠结。今天有了新的发现,免费容量有1GB,够用了。 地址是:http://www.svnchina.com/ 大家不妨试试

  • 互联网新闻的崛起,科技站点 Mashable 融资 1400 万美元

        科技网站 Mashable 在年初宣布接受外部投资 1330 万美元,不久前他们宣布再次融资 70 万美元。至此,Mashable 已经成功达成 1400 万美元 A 轮融资。 Mashable 是目前世界上访问量最大的博客之一,它主要撰写互联网科技类新闻,同时报道一些社会消息。此次融到的 70 万美元来自电视&报纸传媒公司 Tribune。筹划本次投资的是 Tribune 旗下的数字风投团队(Digital Ventures),该团队的领导人是雅虎前任高管沙什·塞特(Shashi Seth)。 本次融资对 Mashable 来说意义重大。从 2005 年创建初期开始,Mashable 就主要关注 MySpace 等社交媒体。近年来,它已经逐渐发展为一个关注多样新闻的大众资讯站点,话题从奥斯卡晚会延伸到美国核武器政策。Mashable 希望用易于读者消化的方式来撰写新闻,站方宣称网站每月新增 3000 万读者。 而 Tribune 同样在扩大已有的报业规模,公司旗下目前有《芝加哥论坛报》以及《洛杉矶时报》两份大型报刊。本次对 Mashable 的投资后,Tribune 也许会将 Mashable 的内容整合到报纸上,或者利用 Mashable 加快其数字化进程。

  • php fsockopen post data (模拟Post提交)

    网上有很多的代码,但是实际上就只有一个,于是乎我一直认为他们是对的,花了一个上午的时间去理顺这个问题,最后我还是在国外的网站上看到了真确的答案,跟大家分享一下: fsockopen页面代码: $fp = fsockopen("example.com", 80); $vars = array( "hello" => "world" ); $content = http_build_query($vars); fwrite($fp,"POST /reposter.php HTTP/1.1\r\n"); fwrite($fp,"Host: example.com\r\n"); fwrite($fp,"Content-Type: application/x-www-form-urlencoded\r\n"); fwrite($fp,"Content-Length: ".strlen($content)."\r\n"); fwrite($fp,"Connection: close\r\n"); fwrite($fp,"\r\n"); fwrite($fp, $content); header("Content-type: text/plain"); while (!feof($fp)) { echo fgets($fp, 1024); } 接受post数据页面的代码: print_r($_POST);     这个是我的fsockopen页面的代码: $domain="127.0.0.1"; $dport="8087"; $vars=array("content"=>"ff"); $post_data=http_build_query($vars); $fp=fsockopen($domain,$dport,$errno,$errstr,1); if($errno!=0) { die("not connect the host");…

  • test

    echo "Hello world ! <br/>"; echo "Thanks everybody come to see my little blog , your view is my power . "; echo "This is a test for code plungin ."

  • 图片在div中上下居中显示并自适应宽高

    对于图片如和在div中上下居中的问题困扰了偶很多年,今天终于狠下心来把它彻底搞定(实际上是因为Mackes不是专业前端,所以很少用到,经常忘记,网上有没个我喜欢的)。 在网上你会看到有用三层div通过浮动居中的,也有直接写了个dislay:table-cell;的。要么太复杂,要么没有全部适应。 下面我来讲解一下我的方法。 大家知道,在table中 只要在td上设置了 vertical-align:middle;就可以做到这一点。可是div中不行。这到底是为什么呢? 也许大家都知道table被div淘汰的原因,是因为table自带的一些样式太庞大了,页面加载的同时会同步加载样式,导致table布局的页面加载很慢。而div则只只带了一个很简单样式 display:block;。其他的样式是可以通过css样式异步加载的。 OK,因为在table中实现了我们想要的效果,那么我们可以先写个简单的table来看看这个时候table用了哪些样式使得图片可以上下居中。 然后,我用了谷歌浏览器来查看“审查元素”,有些说我用firebug可以不?答案是NO。因为谷歌浏览器的“审查元素”功能会把元素的默认样式也说明的很清楚,但是你用firebug就只能看到自己定义的,而不能看到元素的默认样式。 通过查看发现<tr>中有一个display:table-row;样式,之前我一直以为它的默认样式是display:table-column;,那会不会就是这个table-row;起的作用呢?因为网上有人用table-cell;。Just try it ! <div id="tr" style="display:table-row;height:100px;"> <div id="td" style="display:table-cell; vertical-align:middle;"><img src="your-image-url.gif"/></div> </div> Ok !That all ! 测试成功了,哈哈! 原来就这么简单。 在网上你会看到 只用了talbe-cell,这个样式是table中最小单位的样式,你可以理解成 table中的td。可以在“审查元素”时发现<td>中默认就有这个样式,而<tr>中有 table-row 这个样式。table-row 就像是table中的tr一样控制了整行样式,可以联想到:行、行高;对就是跟高度有关。 所以说:以上的两个div 就像当于是table中的tr和td(看示例代码中的ID值)。但是没有用到table的庞大样式,而且我们所用的是div,所以不会对加载速度产生影响。 如果你想同时左右居中,那就用text-align:center;就可以了(这个其实不需要说明大家都知道)。 同样的像table一样,如果是多个这样的div就只要这样写: <div id="tr" style="display:table-row; height:100px;"> <div id="td" style="display:table-cell; vertical-align:middle;"><img src="your-image-url.gif"/></div> <div id="td1" style="display:table-cell; vertical-align:middle;"><img src="your-image-url.gif"/></div> <div id="td2" style="display:table-cell; vertical-align:middle;"><img src="your-image-url.gif"/></div> <div id="td3"…

  • How to use trim for c#.net when its null

    How to use trim for c#.net when its null ? More body will tell you that //============================ string txt=null; string mystring=""; if(txt!=null){   mystring=txt.Trim(); } //============================ OK,you know,some times we have more string need to check when form submit . This is too tired . We all need a easy way for us . let me show…

  • mysql的一些语句

      右补0:select RPAD(id,8,'0') as pad from tablename;  左补0:select LPAD(id,8,'0') as pad from tablename; 字符串连接:update tableName set title=CONCAT(‘abc’,title,’def’) WHERE id=1 字符串截取【一】:select left(title,50) from tablename 字符串截取【二】: select substring(title,5) as newTitle from tablename select substring(title,5,100) as newTitle from tablename 字符串截取【三】:select substring_index(title,'@') as newTitle from tablename    

Got any book recommendations?