There’s more than one way to do it

19 Aug
Gui Guan’s Laboratory
There’s more than one way to do it

发现Bluehost的服务器环境非常适合在学校和家里来测试PHP脚本,呵呵。同时为了更好的学习Internet Computing,弄了一个自己的实验室,有点Google’s Lab的感觉,但是差远老:P lol
当你点击进入之后,便是我完成的IC的第二次作业啦(默认用户名:user 密码:password)。以下是这次作业的一些要点:
(待续…)
15 Aug
1. Q: Does importing all classes in a package make my object file (.class or .jar) larger?
A: No, import only tells the compiler where to look for symbols.
2. Q: Is it less efficient to import all classes than only the classes I need?
A: No. The search for names is very efficient so there is no effective difference.
3. Q: Doesn’t it provide better documentation to import each class explicitly? (more…)
14 Aug
Last week, during the prac 2 of CS IB, we were asked to program in Java to build a simple client/server system in which the server takes “commands” from the client and executes them. Due to the time restriction, we were only asked to implement the server, and use telnet to act as client to transact with server. You can have a look here for details.
1 2 3 4 5 | ServerSocket server = new ServerSocket(6666); Socket s= server.accept(); // We now have a client on the end of the socket s BufferedReader in = new BufferedReader( new InputStreamReader( s.getInputStream())); PrintWriter out = new PrintWriter(s.getOutputStream()); |
It’s no more than the knowledge above. Maybe the simplest nextwork program in Java world.
The telnet on lab’s Mac just work well, but after I brought my program to home and run on my own computer, I met a really troublesome problem with the Microsoft’s telnet in Windows XP.
1. First, I started my server.
13 May
传统的网络服务程序,如:ftp、pop和telnet在本质上都是不安全的,因为它们在 网络上用明文传送口令和数据,别有用心的人非常容易就可以截获这些口令和数据。而且,这些服务程序的安全验证方式也是有其弱点的,就是很容易受到"中间人 "(man-in-the-middle)这种方式的攻击。所谓"中间人"的攻击方式,就是"中间人"冒充真正的服务器接收你的传给服务器的数据,然后再 冒充你把数据传给真正的服务器。服务器和你之间的数据传送被"中间人"一转手做了手脚之后,就会出现很严重的问题。
SSH的英文全称是Secure SHell。通过使用SSH,你可以把所有传输的数据进行加密,这样"中间人"这种攻击方式就不可能实现了,而且也能够防止DNS和IP欺骗。还有一个额 外的好处就是传输的数据是经过压缩的,所以可以加快传输的速度。SSH有很多功能,它既可以代替telnet,又可以为ftp、pop、甚至ppp提供一 个安全的"通道"。
6 May
Zend Debugger 5.2.5 and Zend Studio 5.5 are both newest products from Zend, the PHP company. Zend Debugger is a full-featured server side php debugger engine, an interactive tool that helps you debug PHP scripts. Zend Studio is a fantastic IDE for PHP programming(I am really happy with its code assistant). If they work together, we can use them to debug any PHP codes on a web server, and have a good studying and development enviroment of PHP.
The installation of Zend Studio 5.5 is very easy. Just follow its setup sequence. However, the installation and configuration for Zend Debugger 5.2.5 is demanding. Fortunately, we have a really good tutorial here. Following its steps start from "Find the extension directory" and you will have this image from call phpinfo() method which indicate the successful of installation.

If you can’t get Zend Debugger to work although you have followed instruction of that tutorial. Please try following solution:
7 Dec
根本原因:
访问数据库的用户有登录权限,但无操作表的权限
解决办法:
1. 在[企业控制台]窗口–[树]子窗口–[安全性]子树–[登录]项里将你使用的登陆用户的默认数据库设为你所使用的数据库。
2. 在[企业控制台]窗口–[树]子窗口–[安全性]子树–[登录]项里新增一个登录用户(在其中选择SQL Server 身份验证、服务器角色和要访问的数据库),以后便可用些新增用户访问你勾选的数据库了。
大家在用java连接ms sql时可能会这样的问题
原因是sa用户为系统用户,它虽然能够登陆数据库,但是数据库里边的权限都是dbo的,所以,我们现在为这个数据库重新建立一个用户.
当然,这个情况只发生在java里边. .net是不会这样的.
只要新建立一个用户,再在权限那分配权限做好就行了.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public Connection getConnectionDB() { String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; String ConnectionString = "jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=test;"; String userName = "username"; String userPwd = "password"; try { Class.forName(driverName); con = DriverManager.getConnection(ConnectionString, userName, userPwd); //System.out.println("Connection Successful!"); } catch (Exception e) { e.printStackTrace(); } return con; } ConnectionDB prod=new ConnectionDB(); Connection con=prod.getConnectionDB(); CallableStatement callStmt =null; java.sql.Statement stat = null; java.sql.ResultSet rs = null; stat = con.createStatement(); String sql="select * from table"; rs=stat.executeQuery(sql); |
17 Nov
本文逐步介绍了如何在 Access 中重置“自动编号”字段值。在 Access 中删除某个表中的一些行或所有行时,“自动编号”字段不会自动重置。要重置“自动编号”字段值并刷新引用表中的“自动编号”值,必需手动执行一些任务。
17 Nov
今天老师教我们如何使用Visual Studio中集成的Crystal Reports(水晶报表)来制做显示在WinForm中的报表。哈哈,Crystal Reports的强大功能真令人兴奋。简单的几个步骤就能作出非常漂亮的报表来。以下便是我第一次用Crystal Reports做的报表啦:
12 Nov
From Wikipedia, the free encyclopedia
Object-Relational mapping (aka O/RM, ORM, and O/R mapping), is a programming technique that links databases to object-oriented language concepts, creating (in effect) a "virtual object database." There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to code their own object-relational mapping for their systems
Recent Comments