上一页 1 ··· 222 223 224 225 226 227 228 229 230 ··· 329 下一页
摘要: 今天我测试了一下MongoDB的副本集的配置。首先从概念上说一下MongoDB副本集和主从复制的区别。其实副本集(Replica Set)是主从复制的高级形式。高级在哪里呢?主动复制实现了数据备份+读扩展,但是master一旦down掉,需要手动启动slave。副本集在此基础上实现了备份自动重启的功能,也就是某一台slave会挺身而出,担当起master的职责。所以有三个角色,master(Primary),slave(Secondary),还有仲裁服务器(这哥们指定哪台slave应该挺身而出)。我的测试环境和上次基本相同:一台master(primary):mmaster 192.168.4 阅读全文
posted @ 2013-06-20 19:21 jlins 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 一、新建投稿页面模板 把主题的 page.php 另存为 tougao.php,并且在第一行的 <?php 之后添加模板的标识注释:/* Template Name: tougao */ 紧接着把下面的函数插入上面的标识注释下面 if( isset($_POST['tougao_form']) && $_POST['tougao_form'] == 'send'){ if ( isset($_COOKIE["tougao"]) && ( time() - $_COOKIE["to 阅读全文
posted @ 2013-06-20 19:20 jlins 阅读(2655) 评论(0) 推荐(0) 编辑
摘要: 1、JQ部分:var tds = $("#table1 td");tds.click(function(){//给所有td添加点击事件 var tdSeq = $(this).parent().find("td").index($(this)[0])+1;//获取总列数 var trSeq = $(this).parent().parent().find("tr").index($(this).parent()[0])+1;..获取总行数 var pagevhMeal1=$("#table1 tr:nth-child(&qu 阅读全文
posted @ 2013-06-20 19:18 jlins 阅读(6170) 评论(0) 推荐(0) 编辑
摘要: 转载注明出处:http://blog.csdn.net/bendanban/article/details/9136755 以两台计算机为例,将这两台计算机应用于MPI运行环境。第一步:在两台机器上安装Linux 操作系统我安装的是ubuntu 12.04,主机名随便你自己取,我命名两台机器为sinco和cosin。 第二步:为两台机器设置固定的IP当然,我这里假设两台机器属于同一个局域网中。我设置sinco的IP为192.168.0.2 cosin的IP为192.168.0.3 第三步:设置通过主机名登录(需要ROOT)编辑sinco上的/etc/hosts 文件,文件的前几行修改成如下形式 阅读全文
posted @ 2013-06-20 19:16 jlins 阅读(6334) 评论(0) 推荐(0) 编辑
摘要: 写python时,用到了日期计算。于是写了datetime.datetime(*d_startTime[0:6])这样的代码。结果编译不通过,报'datetime.datetime' has no attribute 'datetime'错误。但是看了一下引用:from datetime import datetime 已经写了。而且其他地方都引用的好好的啊。仔细看了一下,原来是这个问题:from datetime import datetime 已经相当于把命名空间引入到datetime.datetime一层,所以datetime.datetime(*d_st 阅读全文
posted @ 2013-06-20 19:14 jlins 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 这个录音实现是我在Bus上看到并下载的,他那个源码不完整,再次把我整理完整的代码贴出,源码地址在这:http://download.csdn.net/detail/chaozhung/5618649Bus上的那个网址找不到了,见谅!!!下为核心代码:核心代码1.. package com.lv.reco;import java.io.File;public class SoundRecorder extends Activity implements Button.OnClickListener, Recorder.OnStateChangedListener { priv... 阅读全文
posted @ 2013-06-20 19:12 jlins 阅读(2939) 评论(0) 推荐(0) 编辑
摘要: 1、定义样式<style type="text/css"> .striped { background-color:red; } .over { background-color:#BEBEBE; }2、定义事件<script type="text/javascript">$(document).ready(function(){$("table tr:nth-child(even)").addClass("striped"); 偶数行 变化$("table tr:nth-chil 阅读全文
posted @ 2013-06-20 19:10 jlins 阅读(510) 评论(0) 推荐(0) 编辑
摘要: /** * Helper for tracking the velocity of touch events, for implementing * flinging and other such gestures. Use {@link #obtain} to retrieve a * new instance of the class when you are going to begin tracking, put * the motion events you receive into it with {@link #addMovement(MotionEvent)}, * and w 阅读全文
posted @ 2013-06-20 19:08 jlins 阅读(5847) 评论(0) 推荐(0) 编辑
摘要: 严重: The web application [/dmscs] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@55a106]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1be9f72]) but failed to remove it when the w 阅读全文
posted @ 2013-06-20 19:06 jlins 阅读(1948) 评论(0) 推荐(0) 编辑
摘要: /** * 使用循环输出杨辉三角 * * */public class Test6 { public static void main(String[] args) { // 创建二维数组 int triangle[][] = new int[8][]; // 遍历二维数组的第一层 for (int i = 0; i < triangle.length; i++) { // 初始化第二层数组的大小 triangle[i] = new int[i + 1]; // 遍历第二层数组 for (int j = 0; j <= triangle[i].length - 1;... 阅读全文
posted @ 2013-06-20 19:04 jlins 阅读(346) 评论(0) 推荐(0) 编辑
上一页 1 ··· 222 223 224 225 226 227 228 229 230 ··· 329 下一页