总结13.11.9

登录使按钮无效

<input style="float:left;" type="submit" id = "loginSub" class="type05_button" value="登录" />

<script type="text/javascript">
function loginDeal(){
$("#loginSub").val("登录中...");
$("#loginSub").attr("disabled", "true");
}
</script>

trim():除去多余的空格。

//获取客户端ip

public static String getIpAddr() {
       String ipAddress = null;
        //ipAddress = this.getRequest().getRemoteAddr();
       ipAddress = ServletActionContext.getRequest().getHeader("x-forwarded-for");
       if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
            ipAddress = ServletActionContext.getRequest().getHeader("Proxy-Client-IP");
       }
       if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
            ipAddress = ServletActionContext.getRequest().getHeader("WL-Proxy-Client-IP");
       }
       if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
            ipAddress = ServletActionContext.getRequest().getRemoteAddr();
           if(ipAddress.equals("127.0.0.1")){
              //根据网卡取本机配置的IP
               InetAddress inet = null;
           try {
               inet = InetAddress.getLocalHost();
           }catch (UnknownHostException e) {
               e.printStackTrace();
           }
           ipAddress= inet.getHostAddress();
       }
       }
       //对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
       if(ipAddress!=null && ipAddress.length()>15){             //"***.***.***.***".length() = 15
           if(ipAddress.indexOf(",")>0){
               ipAddress = ipAddress.substring(0,ipAddress.indexOf(","));
           }
       }
       return ipAddress;
     }

 

 //时间工厂类

/**
 * 日期格式化工具类
 * @author sl 2011-11-17
 *
 */
public class FormatDate {

    /**
     * 得到当前系统日期,格式:yyyy-mm-dd
     *
     * @return
     */
    public static String getCurrentDate(){

        return getFormatDate("yyyy-MM-dd");
    }
    /**
     * 返回年份
     * @return
     */
    public static String getCurrentYear(){

        return getFormatDate("yyyy");
    }
    /**
     * 返回月份
     */
    public static String getCurrentMonth(){
        return getFormatDate("MM");
    }
    /**
     * 返回特定格式的日期
     * 格式如下:
     * yyyy-mm-dd
     * @param formatString
     * @return
     */
    protected static String getFormatDate(String formatString){
        String currentDate="";
        SimpleDateFormat format1 = new SimpleDateFormat(formatString);
        currentDate = format1.format(new Date());
        return currentDate;
    }
    /**
     * 返回时间格式样式
     * @return
     */
    public static String getFormateDateAll(){
        return getFormatDate("yyyy-MM-dd HH:mm:ss");
    }
    /**
     * 获取简化时间格式
     * @return
     */
    public static String getFormateDateSimple(){
        return getFormatDate("yyyyMMddHHmmss");
    }
    /**
     * 获取几天后的时间
     * @param d
     * @param day
     * @return
     */
    public static Date getDateAfterDay(Date d, int day) {
        Calendar now = Calendar.getInstance();
        now.setTime(d);
        now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
        return now.getTime();
    }
    public static String getDateAfterDay(String d, int day) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date now = sdf.parse(d);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(now);
        calendar.add(Calendar.DATE, day);
        return sdf.format(calendar.getTime());
    }
    /**
     * 获得几个月后的时间
     * */
    public static String getDateAfterMonth(String d, int month) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date now = sdf.parse(d);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(now);
        calendar.add(Calendar.MONTH, month);
        return sdf.format(calendar.getTime());
    }
    /**
      * 得到几天前的时间
      * @param d
      * @param day
      * @return
     * @throws ParseException
      */
      public static String getDateBefore(String d,int day) throws ParseException{
        Date date = stringToDate(d);
        Calendar now =Calendar.getInstance();
        now.setTime(date);
        now.set(Calendar.DATE,now.get(Calendar.DATE)-day);
        return dateToString(now.getTime());
      }
    /**
     * 返回几个小时后的时间
     * @param d
     * @param hour
     * @return
     * @throws ParseException
     */
    public static String getDateAfterHour(String d,int hours) throws ParseException{
        /*Date date = stringToDate(d);
        Calendar now = Calendar.getInstance();
        now.setTime(date);
        now.set(Calendar.HOUR, now.get(Calendar.HOUR) + hour);
        return dateToString(now.getTime());*/
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date now = sdf.parse(d);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(now);
        calendar.add(Calendar.HOUR, hours);
        return sdf.format(calendar.getTime());
    }
    /**
     * 返回几分钟后的某个时间
     * @param d
     * @param minutes
     * @return
     * @throws ParseException
     */
    public static String getDateAfterMinute(String d,int minutes) throws ParseException{
        /*Calendar now = Calendar.getInstance();
        now.setTime(d);
        now.set(Calendar.MINUTE, now.get(Calendar.MINUTE) + minutes);
        return now.getTime();*/
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date now = sdf.parse(d);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(now);
        calendar.add(Calendar.MINUTE, minutes);
        return sdf.format(calendar.getTime());
    }
    /**
     * 比较两个日期的大小
     * true date1比date2前
     * false date1比date2后
     * @param date1
     * @param date2
     * @return
     */
    public static boolean dateCompare(Date date1,Date date2){
        boolean dateComPareFlag = true;
        if (date2.compareTo(date1) != 1) {
            dateComPareFlag = false;
        }
        return dateComPareFlag;
    }
    public static boolean dateCompare(String date1,String date2) throws ParseException{
        boolean dateComPareFlag = true;
        if (stringToDateAll(date2).compareTo(stringToDateAll(date1)) != 1) {
            dateComPareFlag = false;
        }
        return dateComPareFlag;
    }
    /*public static void main(String[] args) throws ParseException {
        System.out.println(dateCompare(stringToDate("2012-02-01"),stringToDate("2012-02-02")));
    }*/
    /**
     * 返回两时间之差
     * @param startTime
     * @param endTime
     * @return
     */
    public static long dateMinus(Date startTime,Date endTime){
        return endTime.getTime()-startTime.getTime();
    }

    //计算两个string类的时间差
    public static String time(String startTime, String endTime) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 格式化时间
        Date outdate = sdf.parse(endTime);
        Date indate =  sdf.parse(startTime);
        long totalhours = (outdate.getTime()-indate.getTime())/(1000*60*60);//时
        long totalminutes = (outdate.getTime()-indate.getTime())/(1000*60)-totalhours*60;//分
        long totalseconds = (outdate.getTime()-indate.getTime())/(1000)-totalminutes*60;//秒
        String total_time = totalhours+"时"+totalminutes+"分"+totalseconds+"秒";
        return total_time;
    }

    //计算两个时间之差,返回秒数
    public static long totalseconds(String startTime, String endTime) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 格式化时间
        Date outdate = sdf.parse(endTime);
        Date indate =  sdf.parse(startTime);
        long totalseconds = (outdate.getTime()-indate.getTime())/1000;        //秒
        return totalseconds;
    }
    /**
     * String类型日期转Date
     * @throws ParseException
     * */
    public static Date stringToDate(String date) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");// 格式化时间
        Date toDate = sdf.parse(date);
        return toDate;
    }
    /**
     * Date类型日期转String类型
     * */
    public static String dateToString(Date date) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 格式化时间
        String toStrDate = sdf.format(date);
        return toStrDate;
    }
    /**
     * String类型日期转Date
     * @throws ParseException
     * */
    public static Date stringToDateAll(String date) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 格式化时间
        Date toDate = sdf.parse(date);
        return toDate;
    }
    /**
     * Date类型日期转String类型
     * */
    public static String dateToStringAll(Date date) throws ParseException{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");// 格式化时间
        String toStrDate = sdf.format(date);
        return toStrDate;
    }
        /**
         * 取得两个时间段的时间间隔
         *
         * @author color
         * @param t1
         *            时间1
         * @param t2
         *            时间2
         * @return t2 与t1的间隔天数
         * @throws ParseException
         *             如果输入的日期格式不是0000-00-00 格式抛出异常
         */
        public static int getBetweenDays(String t1, String t2)
                throws ParseException {
            DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            int betweenDays = 0;
            Date d1 = format.parse(t1);
            Date d2 = format.parse(t2);
            Calendar c1 = Calendar.getInstance();
            Calendar c2 = Calendar.getInstance();
            c1.setTime(d1);
            c2.setTime(d2);
            // 保证第二个时间一定大于第一个时间
            if (c1.after(c2)) {
                c1 = c2;
                c2.setTime(d1);
            }
            int betweenYears = c2.get(Calendar.YEAR) - c1.get(Calendar.YEAR);
            betweenDays = c2.get(Calendar.DAY_OF_YEAR)
                    - c1.get(Calendar.DAY_OF_YEAR);
            for (int i = 0; i < betweenYears; i++) {
                c1.set(Calendar.YEAR, (c1.get(Calendar.YEAR) + 1));
                betweenDays += c1.getMaximum(Calendar.DAY_OF_YEAR);
            }
            return betweenDays;
        }  

        /**
         * 根据年月得到最后一天和第一天
         * 需要注意的是:月份是从0开始的,比如说如果输入5的话,实际上显示的是4月份的最后一天
         * 这里好像有点问题
         * */
         public static String getLastDayOfMonth(int year, int month) {
             Calendar cal = Calendar.getInstance();
             cal.set(Calendar.YEAR, year);
             cal.set(Calendar.MONTH, month);
             cal.set(Calendar.DAY_OF_MONTH,cal.getActualMaximum(Calendar.DATE));
            return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
         }
         public static String getFirstDayOfMonth(int year, int month) {
             Calendar cal = Calendar.getInstance();
             cal.set(Calendar.YEAR, year);
             cal.set(Calendar.MONTH, month);
             cal.set(Calendar.DAY_OF_MONTH,cal.getMinimum(Calendar.DATE));
             return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
         } 

         /**
          * 获取某年第一天日期
          * @param year 年份
          * @return Date
         * @throws ParseException
          */
         public static String getCurrYearFirst(int year) throws ParseException{
             Calendar calendar = Calendar.getInstance();
             calendar.clear();
             calendar.set(Calendar.YEAR, year);
             Date currYearFirst = calendar.getTime();
             return dateToString(currYearFirst);
         }   

         /**
          * 获取某年最后一天日期
          * @param year 年份
          * @return Date
         * @throws ParseException
          */
         public static String getCurrYearLast(int year) throws ParseException{
             Calendar calendar = Calendar.getInstance();
             calendar.clear();
             calendar.set(Calendar.YEAR, year);
             calendar.roll(Calendar.DAY_OF_YEAR, -1);
             Date currYearLast = calendar.getTime();
             return dateToString(currYearLast);
         }

         //获取季度
         public static String getThisSeasonTime(int month){
             String quarter="";
             if(month>=1&&month<=3){
                 quarter="Spring";
             }
             if(month>=4&&month<=6){
                 quarter="Summer";
             }
             if(month>=7&&month<=9){
                 quarter = "Autumn";
             }
             if(month>=10&&month<=12){
                 quarter = "Winter";
             }
             return quarter;
         }

         //获取几月到几月
         public static String getMonthToMonth(int month){
             String monthToMonth="";
             String[] months={"(January-March)","(April-June)","(July-September)","(October-December)"};
             int index=month/3;
             monthToMonth=months[index];
             return monthToMonth;
         }
         //根据月得到该季度的第一个月
         public static int getFirstMonthByQuarter(int month){
             int quarter = 0;
             if(month>=1&&month<=3){
                 quarter = 1;
             }
             if(month>=4&&month<=6){
                 quarter = 4;
             }
             if(month>=7&&month<=9){
                 quarter = 7;
             }
             if(month>=10&&month<=12){
                 quarter = 10;
             }
             return quarter;
         }

         //取得当前时间
         public static Date getDateTime(String dateTime){
             Date strDate=java.sql.Date.valueOf(dateTime);
             return strDate;
         }    

         @SuppressWarnings("static-access")
        public static int getMonth(String dateTime)
         {
            Calendar c=Calendar.getInstance();
            c.setTime(getDateTime(dateTime));
            int month=c.get(c.MONTH)+1;
            return month;
         }

         @SuppressWarnings("static-access")
        public static int getYear(String dateTime)
         {
            Calendar c=Calendar.getInstance();
            c.setTime(getDateTime(dateTime));
            int year=c.get(c.YEAR);
            return year;
         }

         // 用来全局控制 上一周,本周,下一周的周数变化
         private static int weeks = 0;

         // 获得当前日期与本周一相差的天数
         private static int getMondayPlus(String date) {
             Calendar cd = Calendar.getInstance();
             cd.setTime(getDateTime(date));
             // 获得今天是一周的第几天,星期日是第一天,星期二是第二天......
             int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK);
             if (dayOfWeek == 1) {
                 return -6;
             } else {
                 return 2 - dayOfWeek;
             }
         }

         // 获得上周星期一的日期
         public static String getPreviousMonday(String date) {
             weeks--;
             int mondayPlus = getMondayPlus(date);
             GregorianCalendar currentDate = new GregorianCalendar();
             currentDate.setTime(getDateTime(date));
             currentDate.add(GregorianCalendar.DATE, mondayPlus + 7 * weeks);
             Date monday = currentDate.getTime();
             DateFormat df = DateFormat.getDateInstance();
             String preMonday = df.format(monday);
             return preMonday;
         }

         // 获得本周星期一的日期
         public static String getCurrentMonday(String date) {
             weeks = 0;
             int mondayPlus = getMondayPlus(date);
             GregorianCalendar currentDate = new GregorianCalendar();
             currentDate.setTime(getDateTime(date));
             currentDate.add(GregorianCalendar.DATE, mondayPlus);
             Date monday = currentDate.getTime();
             DateFormat df = DateFormat.getDateInstance();
             String preMonday = df.format(monday);
             return preMonday;
         }

         // 获得下周星期一的日期
         public static String getNextMonday(String date) {
             weeks++;
             int mondayPlus = getMondayPlus(date);
             GregorianCalendar currentDate = new GregorianCalendar();
             currentDate.setTime(getDateTime(date));
             currentDate.add(GregorianCalendar.DATE, mondayPlus + 7 * weeks);
             Date monday = currentDate.getTime();
             DateFormat df = DateFormat.getDateInstance();
             String preMonday = df.format(monday);
             return preMonday;
         }

         // 获得相应周的周日的日期
         public static String getSunday(String date) {
             int mondayPlus = getMondayPlus(date);
             GregorianCalendar currentDate = new GregorianCalendar();
             currentDate.setTime(getDateTime(date));
             currentDate.add(GregorianCalendar.DATE, mondayPlus + 7 * weeks + 6);
             Date monday = currentDate.getTime();
             DateFormat df = DateFormat.getDateInstance();
             String preMonday = df.format(monday);
             return preMonday;
         } 

         //获得该日期所在周的所有日期
         public static List<String> getWeekAllDate(String date) {
             SimpleDateFormat dateformat = new SimpleDateFormat("MM-dd");
             Calendar c = new GregorianCalendar();
             c.setFirstDayOfWeek(Calendar.MONDAY);
             c.setTime(getDateTime(date));
             List<String> dateList = new ArrayList<String>();
             for(int i=0;i<7;i++){
                   c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()+i);
                   dateList.add(dateformat.format(c.getTime()));
             }
            return dateList;
         }
         //获得两个日期所在周的所有日期组合
         public static List<String> getTwoWeekAllDate(String date1, String date2) {
             System.out.println("ppp"+date1+date2);
             SimpleDateFormat dateformat = new SimpleDateFormat("MM-dd");
             Calendar c1 = new GregorianCalendar();
             c1.setFirstDayOfWeek(Calendar.MONDAY);   //中国传统每个星期是从星期一开始的,如需从星期天开始则为  Calendar.MONDAY-1
             c1.setTime(getDateTime(date1));
             Calendar c2 = new GregorianCalendar();
             c2.setFirstDayOfWeek(Calendar.MONDAY);
             c2.setTime(getDateTime(date2));
             List<String> dateList = new ArrayList<String>();
             for(int i=0;i<7;i++){
                   c1.set(Calendar.DAY_OF_WEEK, c1.getFirstDayOfWeek()+i);
                   c2.set(Calendar.DAY_OF_WEEK, c2.getFirstDayOfWeek()+i);
                   dateList.add(dateformat.format(c1.getTime())+"/"+dateformat.format(c2.getTime()));
             }
            return dateList;
         }

         /*public static void main(String[] args) {
            System.out.println(getTwoWeekAllDate("2012-08-22","2012-08-30").get(0));
            //System.out.println(getPreviousMonday("2012-08-30"));
            //System.out.println(getLastDayOfMonth(2012, 1));
            List<Date> list = getAllTheDateOftheMonth(new Date());
            for(Date date: list){
                SimpleDateFormat matter1=new SimpleDateFormat("MM-dd");
                System.out.println(matter1.format(date));
                //System.out.println(date.toString());
                }
        }*/
         /**
          * 获得指定日期的月中的所有日期
          * */
        public static List<Date> getAllTheDateOftheMonth(Date date) {
            List<Date> list = new ArrayList<Date>();
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            cal.set(Calendar.DATE, 1);
            int month = cal.get(Calendar.MONTH);
            while(cal.get(Calendar.MONTH) == month){
                list.add(cal.getTime());
                cal.add(Calendar.DATE, 1);
                }
            return list;
        }
        /**
         * 根据日期计算所在周的周一和周日
         * @param time 指定的日期
         */
        public static String convertWeekByDate(Date time) {
            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式
            Calendar cal = Calendar.getInstance();
            cal.setTime(time);
            //判断要计算的日期是否是周日,如果是则减一天计算周六的,否则会出问题,计算到下一周去了
            int dayWeek = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天
            if(1 == dayWeek) {
                cal.add(Calendar.DAY_OF_MONTH, -1);
            }
            System.out.println("要计算日期为:"+sdf.format(cal.getTime())); //输出要计算日期
            cal.setFirstDayOfWeek(Calendar.MONDAY);//设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
            int day = cal.get(Calendar.DAY_OF_WEEK);//获得当前日期是一个星期的第几天
            cal.add(Calendar.DATE, cal.getFirstDayOfWeek()-day);//根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
            String imptimeBegin = sdf.format(cal.getTime());
            System.out.println("所在周星期一的日期:"+imptimeBegin);
            cal.add(Calendar.DATE, 6);
            String imptimeEnd = sdf.format(cal.getTime());
            System.out.println("所在周星期日的日期:"+imptimeEnd);
            return imptimeBegin+","+imptimeEnd;
        }

        /*public static void main(String[] args) {
              Calendar c_begin = new GregorianCalendar();
              Calendar c_end = new GregorianCalendar();
              DateFormatSymbols dfs = new DateFormatSymbols();
              String[] weeks = dfs.getWeekdays();

              c_begin.set(2011, 11, 31);                         // Calendar的月从0-11,所以4月是3.
              c_end.set(2012, 11, 31);                         // Calendar的月从0-11,所以5月是4.

              int count = 1;
              c_end.add(Calendar.DAY_OF_YEAR, 1);             // 结束日期下滚一天是为了包含最后一天

              while (c_begin.before(c_end)) {
               System.out.println("第" + count + "周  日期:"
                 + new java.sql.Date(c_begin.getTime().getTime()) + ", "
                 + weeks[c_begin.get(Calendar.DAY_OF_WEEK)]);

               if (c_begin.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
                count++;
               }
               c_begin.add(Calendar.DAY_OF_YEAR, 1);
              }

             }*/

        /*public static void main(String[] args) throws ParseException {
            String startDate = FormatDate.dateToString(FormatDate.getDateAfterDay(FormatDate.stringToDate("2012-01-01"), 7));
            System.out.println(startDate);
            convertWeekByDate(new Date());
        }*/

            public static void main(String[] args)
            {
                List<String> testStr = getDays(new Date(), 4, "yyyy-MM-dd");

                for(int i=0; i<testStr.size(); i++)
                {
                    System.out.println(testStr.get(i));
                }

            }

            public static List<String> getDays(Date day, int preDays, String format)
            {
                List<String> returnValue = new ArrayList<String>();
                SimpleDateFormat sdf = new SimpleDateFormat(format);
                Calendar c = Calendar.getInstance();
                c.setTime(day);
                for(int i=0; i<preDays; i++)
                {
                    c.add(Calendar.DAY_OF_YEAR, -1);
                    /*while(c.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY || c.get(Calendar.DAY_OF_WEEK)==Calendar.SATURDAY)
                    {
                        c.add(Calendar.DAY_OF_YEAR, -1);
                    }*/
                    returnValue.add(new String(sdf.format(c.getTime())));
                }
                return returnValue;
            }

}

//Java Logger(java日志)

比较常用的用法,就是根据类名实例化一个静态的全局日志记录器:

static Logger logger = Logger.getLogger(test.class);

//关于异常(自写抛出异常)

if(loginInfor == null){
            throw new NameNotFoundException();
        }else if(!new String(AESCoder.decrypt(Base64.decodeBase64(loginInfor.getPassword()), SecurityCenter.KEY)).equals(pwd)){
            throw new PasswordNotMatchException();
        }
package xidian.sl.netcredit.exception;

@SuppressWarnings("serial")
public class NameNotFoundException extends Exception{
    public NameNotFoundException(){}

    public NameNotFoundException(String msg)
    {
        super(msg);
    }
}

回去了解下 ,org.apache.log4j.Logger。写篇博客。

时间: 2024-11-05 16:33:48

总结13.11.9的相关文章

《代码整洁之道》—第13章13.11节文献

13.11 文献 [Lea99]:Concurrent Programming in Java: Design Principles and Patterns, 2d. ed., Doug Lea, Prentice Hall, 1999. [PPP]:Agile Software Development: Principles, Patterns, and Practices, Robert C. Martin, Prentice Hall, 2002. [PRAG]:The Pragmati

诺基亚周四收盘大跌13.11%

美国东部时间4月22日16:00(北京时间4月23日4:00)消息,由于2010年一季度业绩未达预期,诺基亚周四收盘大跌13.11%. 诺基亚周四在纽约证券交易所常规交易中收报12.99美元,跌1.96美元,跌幅为13.11%.过去52周,诺基亚在纽约证券交易所最高股价为16.58美元,最低价为12.10美元.

13.11. GFS - Cluster Storage

yum groupinstall "Cluster Storage" # egrep 'GFS2|DLM' /boot/config-2.6.32-* /boot/config-2.6.32-131.2.1.el6.x86_64:CONFIG_GFS2_FS=m /boot/config-2.6.32-131.2.1.el6.x86_64:CONFIG_GFS2_FS_LOCKING_DLM=y /boot/config-2.6.32-131.2.1.el6.x86_64:CONFIG

13.11. Querying Properties

freebsd# zfs get all tank NAME  PROPERTY              VALUE                  SOURCE tank  type                  filesystem             - tank  creation              Sat Jun 19 17:49 2010  - tank  used                  98.5K                  - tank  a

11月11日还有捉猫猫游戏吗

11月11日还有捉猫猫游戏吗? 答:活动时间:2012年11月9日-10日11:11.13:11.15:11.17:11.19:11总共5个时间点;11月11日当天3:11.5:11.7:11.9:11.11:11.13:11.15:11.17:11总共8个时间点,每个时间点进行60秒钟的捉猫猫游戏.

Hadoop专业解决方案-第13章 Hadoop的发展趋势

一.前言: 非常感谢Hadoop专业解决方案群:313702010,兄弟们的大力支持,在此说一声辛苦了,经过两周的努力,已经有啦初步的成果,目前第13章 Hadoop的发展趋势小组已经翻译完成,在此对:hbase-深圳-18361.旅人AQUARION表示感谢. 二.意见征集: 本章节由<Hadoop专业解决方案群:313702010>翻译小组完成,为小组校验稿,已经通过小组内部校验通过,特此面向网络征集意见,如果对本章节内容有任何异议,请在评论中加以说明,说明时,请标明行号,也可以以修订的方

《响应式Web图形设计》一13.3 自适应图像解决方案

13.3 自适应图像解决方案 响应式Web图形设计 为了处理自适应图像的大小问题,下面给出一些可以采用的方法. 13.3.1 另寻他法 一个看起来不太像解决方法的方法是:永远不要使用光栅图像,而要依赖其他格式的图像. 既然问题的核心是光栅图像的文件大小,那么如果我们可以使用其他文件格式或者技术来进行视觉呈现,自然也就可以减轻甚至消除自适应图像的麻烦了. 可以使用的技术有以下两种. SVG--矢量图像就是为了缩放图像而存在的(见图13.8).凭借前所未有的强大的浏览器的支持,如果你想要一张色彩简单

Linux内核爆出远程DoS漏洞CVE-2017-6214 目前只看到4.9.11不受影响

Linux内核近期漏洞频出.今天SecurityFocus又公开了Iinux远程DoS漏洞,攻击者可以利用漏洞使Linux内核进入无限循环,进而导致拒绝服务.这个很容易形成DDoS攻击的,建议大家小心. 受影响范围 受影响的版本一大堆,看下面的列表,不受影响的只给出了一个 Linux kernel 4.9.11,各版本的补丁,见这里 https://www.kernel.org/ 你还可以看看 [下载]Linux内核漏洞分析实战 看看专家是怎么一步步用gdb Kgdb调试linux内核驱动的 B

诺基亚Q1净赚4.65亿美元股价反跌13%

全球手机巨头诺基亚日前发布了2010财年第一季度财报.报告显示,诺基亚一季度销售额为95.2亿欧元(约合127.1亿美元), 同比增长3%,净利润3.49亿欧元(约合4.65亿美元),同比增长186%.这原本已算是张相当不错的成绩单,但二级市场却似乎并不买账,缘起业绩并未达到预期.财报公布当日,诺基亚收盘大跌13.11%,随后的一个交易日(4月23日)又下跌了1.77%,报收每股12.99美元. 终端.服务事业部仍占销售大头 财报显示,2010年第一季度诺基亚销售额为95.2亿欧元,比去年同期的