`
guzizai2007
  • 浏览: 353882 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表
花了两天时间做了个小小的个人网站,功能不多但基本够用:   前后台页面基本都是从别人网站上爬下来的,对于前端不是很强的我的说真是省心省力,后台代码逻辑都很简单,主要是发布文章和页面缓存、静态化那块,其实做的还挺粗糙的,不过用起来也还好了,毕竟2天弄完,希望自己以后还是坚持写写博客吧,虽然挺忙的~   前台:http://coriger.com/   后台:  

select()和poll()函数

select()函数和poll()函数均是主要用来处理多路I/O复用的情况。比如一个服务器既想等待输入终端到来,又想等待若干个套接字有客户请求到达,这时候就需要借助select或者poll函数了。   1、select()函数 int select(int fdsp1, fd_set *readfds, fd_set *writefds, fd_set *errorfds, const struct timeval *timeout); 各个参数含义如下: int fdsp1:最大描述符值 + 1 fd_set *readfds:对可读感兴趣的文件描述符集 fd_set *wr ...

linux文件描述符

1、文件描述符是一个简单的整数,用以标明每一个被进程所打开的文件或socket 2、每一个进程都有自己的文件描述符集合 3、当创建进程时,通常默认会有3个文件描述符(0,1,2),0代表标准输入,1代表标准输出,2代表标准错误,它 ...
public void onPageSelected(int arg0)   此方法是页面跳转完后得到调用,arg0是你当前选中的页面的Position(位置编号)。  
public void onPageScrollStateChanged(int arg0)   此方法是在状态改变的时候调用,其中arg0这个参数有三种状态(0,1,2)。arg0 ==1的时辰默示正在滑动,arg0==2的时辰默示滑动完毕了,arg0==0的时辰默示什么都没做。   当页面开始滑动的时候,三种状态的变化顺序为(1,2,0)  
public void onPageScrolled(int arg0, float arg1, int arg2)   当页面在滑动的时候会调用此方法,在滑动被停止之前,此方法回一直得到调用。其中三个参数的含义分别为: arg0 :当前页面,及你点击滑动的页面 arg1:当前页面偏移的百分比 arg2:当前页面偏移的像素位置     

头条新闻(6)

修改了一下评论的样式:   <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="ve ...

头条新闻(5)

新闻详情页面初步设计:   <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="ve ...

头条新闻(4)

  填充ListView 新闻列表: // 填充ListView 显示新闻列表 ListView listView = (ListView)findViewById(R.id.newsList); List<HashMap<String, Object>> newList = new ArrayList<HashMap<String, Object>>(); for (int i = 0; i < 20; i++) { HashMap<String, Object> map = new Ha ...

头条新闻(3)

默认选中推荐类型: 需要自定义adapter: package com.cmge.news; import java.util.List; import java.util.Map; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.SimpleAdapter; import android.widget.TextView; public class CustomSimplerAdapte ...

头条新闻(2)

  新闻分类动态生成: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation=&quo ...

头条新闻(1)

  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical& ...
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //设置无标题 requestWindowFeature(Window.FEATURE_NO_TITLE); //设置全屏 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContent ...

Service1.1

  定义一个服务:   package com.example.android_service; import android.app.Service; import android.content.Intent; import android.os.IBinder; import android.util.Log; /** * @desc 自定义Service * @author ljt * @time 2014年8月29日 下午5:25:21 */ public class HelloService extends Service{ @ ...

Intent1.1

Intent intent = new Intent(); ComponentName comName = new ComponentName(MainActivity.this, MainActivity2.class); intent.setComponent(comName); startActivity(intent);   配置Action Category:  默认Category: <activity android:name="com.example.android_intent.Main ...
Global site tag (gtag.js) - Google Analytics