随笔分类 - 编程技术
摘要:说明遇到了非法字符,原因在于xml放在了res/xml下,导致xml文件被sdk编码,解决办法就是将xml放在res/raw下,这样就能完整地保持原来的xml。
阅读全文
摘要:只要在onCreate中加入如下代码即可,这里使用了反射: try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if(menuKeyField != null) { menuKeyField.setAccess...
阅读全文
摘要:Java中建立Socket的一种方法是直接使用构造函数:Socket(InetAddress address, int port)但是可能导致服务器无响应而卡死,所以可以设定建立连接时的时间限制。先建立Socket,然后再使用connect,即可指定连接超时的时间:Socket serverSocket = new Socket();SocketAddress socketAddress = new InetSocketAddress(“192.168.1.101”, 6666);serverSocket.connect(socketAddress, timeout);
阅读全文
摘要:2976#include <stdio.h>#define MAX 3 int main(){ int pn; //problem count int a[MAX][MAX]; int b[MAX][MAX]; scanf("%d",&pn); int c=0; //case while (c<pn) { int n; int i,j; for (i=0;i<MAX;i++) { for (j=0;j<MAX;j++) { ...
阅读全文
浙公网安备 33010602011771号