`
liufei.fir
  • 浏览: 687440 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
@interface Tray : NSObject <NSApplicationDelegate> { NSStatusItem *trayItem; } @end @implementation Tray - (IBAction)testAction:(id)sender; { NSLog(@"Hello World"); } - (IBAction)quitAction:(id)sender; { [NSApp terminate:sender]; } - (void)applicationDidFinish ...
package org.liufei.jweb; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; /** * 向指定的137端口发出固定格式的查询命令,返回结果中即含有客户端mac地址 * * @author liufei * */ public class UDPGetClientMac { ...
package org.liufei.jweb; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; public class MacAddress { private static String hexByte(byte b) { String s = "000000" + Integer.toHexString(b); return s.substring(s.length() - 2); } ...
package my.util; import java.net.MalformedURLException; import java.net.URL; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.lang.Str ...
String agent = request.getHeader("user-agent");   System.out.println(agent);   StringTokenizer st = new StringTokenizer(agent,";");   st.nextToken();   //得到用户的浏览器名   String userbrowser = st.nextToken();   System.out.println(userbrowser);   //得到用户的操作系统名   String useros = st ...
import java.net.InetSocketAddress; import org.apache.mina.core.service.IoConnector; import org.apache.mina.transport.socket.nio.NioSocketAcceptor; import org.apache.mina.transport.socket.nio.NioSocketConnector; /** * (<b>Entry point</b>) Demonstrates how to write a very simple t ...
package core.spider; import java.io.*; import java.net.*; import java.util.*; // This class downloads a file from a URL. class Download extends Observable implements Runnable { // Max size of download buffer. private static final int MAX_BUFFER_SIZE = 1024; // Thes ...
package com.google.code.http4j.example; import java.io.IOException; import java.net.URISyntaxException; import com.google.code.http4j.Client; import com.google.code.http4j.Response; import com.google.code.http4j.impl.BasicClient; import com.google.code.http4j.utils.Metrics; public class ...
var progress_key = '4cd0f29463edb'; // this sets up the progress bar $(document).ready(function() { $("#uploadprogressbar").progressBar(); }); // fades in the progress bar and starts polling the upload progress after 1.5seconds function beginUpload() { // uses ajax to p ...
TypeHere.keyup(function (e) { switch (e.keyCode) { case 188: // ',' var myInputLength = TypeHere.val().length; var myInputText = TypeHere.val().substring(0, myInputLength - 1); // remove ',' TypeHere.width(myInputLength * 6 + 15); // ...
/*** * 插件名称: 中国省市信息联动插件 */ $._cityInfo = [{"n":"北京市","c":["北京市"]}, {"n":"天津市","c":["天津市"]}, {"n":"上海市","c":["上海市"]}, {"n":"重庆市","c":["重庆 ...
public String getIpAddrByRequest(HttpServletRequest request) { String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.leng ...
/* * @(#)tcp.h 8.1 (Berkeley) 6/10/93 */ typedef u_long tcp_seq; /* * TCP header. * Per RFC 793, September, 1981. */ struct tcphdr { u_short th_sport; /* source port */ u_short th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* ackno ...
/* *i.h is a used for creating a library *for server client *Mar 18 2010 * */ #ifndef _I_H #define _I_H #include <math.h> #include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <unistd.h> #include ...
class Program { //This variable determines the number of //SocketAsyncEventArg objects put in the pool of objects for receive/send. //The value of this variable also affects the Semaphore. //This app uses a Semaphore to ensure that the max # of connections //value does not g ...
Global site tag (gtag.js) - Google Analytics