现在位置: 首页 > extremism发表的所有文章
  • 05月
  • 27日
综合 ⁄ 共 4443字 评论关闭
Activity之间的数据类传递  Parcelable接口和serializable系列,都是用来在不同界面之间进行类形式的数据交互。 1:Parcelable用法:几个界面之间的传递类数据  * 1:定义的数据类实现接口Parcelable  * 2:重写数据类的 writeToParcel(Parcel arg0, int arg1)方法  用来写入数据  * 3:该数据类必须有一个静态领域   而且静态变量名字必须是CREATOR  *    public static final Parcelable.Creator<Data> CREATOR  用来读出写入的数据 Demo: package com.example.intent_class; import android.os.Parcel; import android.o......
阅读全文
  • 05月
  • 21日
综合 ⁄ 共 3681字 评论关闭
以下是Canlendar的经常用到的代码,参考了网上的例子,来源不知道了。 import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class TestCalendar { public static void main(String[] args) throws Exception { Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat format = new java.text.SimpleDateFormat( "yyyy-MM-dd"); System.out.println("今天的日期是:" + format.format(cal.getTime())); // 得到前2天日期 cal.add(Calendar.DATE, -Integer......
阅读全文
  • 05月
  • 15日
综合 ⁄ 共 15034字 评论关闭
http://www.feitec.com/ShowArt.asp?id=1036           <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">     <html>     <head>     <meta http-equiv="Content-Type" content="text/html; charset=gb2312">     <title>井底的蛙</title>     <script type="text/javascript">     /*     选项卡封装     by 井底的蛙     2008-2-4     */     opCard = function()     {     this.bind = new Array();     this.index = 0;//默认显示哪个选项卡,从0开始         t......
阅读全文
  • 05月
  • 11日
综合 ⁄ 共 1153字 评论关闭
出自CareerCup 书中有错误,对于多个重复,解析不正确 Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables are fine. An extra copy of the array is not. FOLLOW UP Write the test cases for this method. 修改后如下 /** * InterTest * cn.ustc.inter.array_string * RemoveDuplicates.java * @version 1.0.0 * 2012-4-11 下午12:28:06 * Copyright (c) ustcxjt * */ package cn.ustc.inter.array_......
阅读全文
  • 04月
  • 19日
综合 ⁄ 共 1325字 评论关闭
Install Ruby 1.9.3 with libyaml on CentOS By Brian Ryckbost on October 31, 2011 in how-to, install, libyaml, ruby, and yaml Ruby 1.9.3-p0 makes psych—the replacement for 1.8.7’s YAML library, Syck—the default YAML parser. Psych is a wrapper around libyaml, so you’re going to need it installed and configured before installing Ruby. If you install 1.9.3-p0 without libyaml, you’ll see warnings like this: It seems your ruby installation is missing psych (for YAML output). To eliminate this ......
阅读全文
  • 04月
  • 09日
综合 ⁄ 共 2237字 评论关闭
1、asp.net源代码下载网站  本篇已做整理提供一些常用的与代码下载以及编程相关网址: asp.net源代码下载,asp源码下载,flash源码下载,网站源码下载,java源代码下载     http://www.codeproject.com   代码方案(THE CODE PROJECT)(英文)  推荐   http://www.chinaspx.com/     中国.net俱乐部(其中有开源项目)   http://www.cncode.com/        中国源码中心(主要提供源码下载)推荐  http://www.knowsky.com       动态网站制作指南(网制作技巧、各开发语言的源码下载)  http://www.gotdotnet.com/    .net微软开发团......
阅读全文
  • 04月
  • 01日
综合 ⁄ 共 834字 评论关闭
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路:暴力方法。先确定线段的一个点a,然后遍历剩下的点b1,b2,...bn-1,由于起始点确定,剩下的b1,b2...bn-1如果与a确定的斜率相等,则共线。对于b1,...bn-1有两处需要注意:1.斜率不存在。2.与a为同一个点。考虑这两种情况思路就清晰了。 class Solution { public: int maxPoints(vector<Point> &points) { int len = points.size(); if (len <= 1) { return len; ......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 357字 评论关闭
由于在写csdn博文时,当我们打下一个回车,在文章的网页源代码中就会生成一对段落标签,而段落间距又是很大的,这样在一些要提前换行的行之间行距就很大,让文章看起来非常不紧凑。要缩小这种行距,可以点击这个直接在文章的网页代码中改,把其中的段落标签<p></p>改为换行的标签<br />。但是这样如果要进行大量的修改会非常不方便,要克服,一方面可以把源码粘到记事本上进行替换,把<p>替换为空,把</p>替换为<br />,再做一下调整,粘回博文的源码界面就可以了。也可以用这种方法:先在wo......
阅读全文
  • 01月
  • 29日
综合 ⁄ 共 609字 评论关闭
如果一个子进程的父进程先于子进程 结束, 子进程就成为一个孤儿进程,它由 init 进程收养,成为 init 进程的子进程。 而一个子进程在其父进程还没有调用wait()或waitpid()的情况下退出。这个子进程就是僵尸进程。 子进程执行exit后: 1.如果父进程已经退出(没有wait),则该子进程将会成为孤儿进程过继给init进程   2.如果其父进程还没有退出,也没有wait(),那么该进程将向父进程发送SIGCHILD信号,进入僵尸状态等待父进程为其收尸。如果父进程一直没有执行wait(),那么该子进程将会持续处于僵尸状态。 僵尸进程会占用系统资源......
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 1901字 评论关闭
Oil Deposits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12195    Accepted Submission(s): 7087 Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing equipment to determine wheth......
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 749字 评论关闭
2.已知一个字符串,比如 asderwsde,寻找其中的一个子字符串比如 sde  的个数,如果没有 返回 0,有的话返回子字符串的个数。 /* 2.已知一个字符串,比如 asderwsde,寻找其中的一个子字符串比如 sde 的个数,如果没有 返回 0,有的话返回子字符串的个数。 int strncmp(char *str1, char *str2, int maxlen); 说明:此函数功能即比较字符串str1和str2的前maxlen个字符。 如果前maxlen字节完全相等,返回值就=0; 在前maxlen字节比较过程中,如果出现str1[n]与str2[n]不等, 则返回(str1[n]-str2[n])。 */ #include<iostream&......
阅读全文
  • 12月
  • 11日
综合 ⁄ 共 3015字 评论关闭
dlopen 基本定义   功能:打开一个动态链接库    包含头文件:    #include <dlfcn.h>    函数定义:    void * dlopen( const char * pathname, int mode );    函数描述:    在dlopen的()函数以指定模式打开指定的动态连接库文件,并返回一个句柄给调用进程。使用dlclose()来卸载打开的库。    mode:分为这两种    RTLD_LAZY 暂缓决定,等有需要时再解出符号    RTLD_NOW 立即决定,返回前解除所有未决定的符号。    RTLD_LOCAL    RTLD_GLOBAL 允许导出符号    RTLD_GROUP    RTLD_WOR......
阅读全文