Another competition year has come! Get your programming skills polished and take the challenge! There are more prizes this year. Come eat for free (breakfast, lunch, tea break include) and registration is free. Remember to bring your weapons, books I meant
Let say you have the following data in you database table t1 and you want to select the IDs for the row record that have the same value on COL1 and COL2.
ID COL1 COL2 COL3 ====================== 1 100 200 300 2 200 300 400 3 100 200 500 4 300 300 300 5 200 300 400
And the expected result is ID = 1,2,3,5. The SQL to achive the result is:
select left.ID from t1 left inner join t1 right on left.COL1 = right.COL1 and left.COL2 = right.COL2 and left.ID <> right.ID
You can also use "group by" then "count(*)" method but it is a bit more complicated and slow.
Linux divides its physical memory (or the RAM, random access memory) into chucks of memory called pages. When a program require more memory and there isn't enough physical memory, Linux will starts moving out inactive pages and store them on hard disk.
The process of moving out the pages for physical memory to disk is called swapping. The size of "memory on disk" is depending on the swap file size. The combination of physical memory and the "memory on disk" is called virtual memory. Therefore, you can have virtually unlimited memory.
Swapping has it disadvantage - it is slow when Linux need to keep swapping in and out of memory pages. It is slow because of the disk speed limitation. But if you have a server running with SSD disk (solid-state disk), you may not feel the pain. However, the process is required to make sure the operating system can works under memory pressure.
I have recently moved all my websites to a SSD cloud hosting. I installed Virtualmin in the new server and found that it is very useful, powerful and the most important thing - it is free (open source software).
One may find that using SQL's LIKE clause in Java PreparedStatement is not straight forward. There is no documentation on how the LIKE clause should be used when it is used with the PreparedStatement object. Thus, most of the programmer would rather use the full SQL to execute the statement.
US Certs warns users to disable Java in web browsers on 10 Jan 2013. The main reason is due to Java 7 Update 10 and earlier versions of Java 7 contain a vulnerability that can allow a remote, unauthenticated attacker to execute arbitrary code on a vulnerable system.
To program a web or HTTP server from nothing could be very difficult. It's gonna to take you to write thousands of source instructions. The HTTP protocol it self is pretty to understand but it complicated to implement them in programming language. It involves a lot of parsing and need a lot of understanding how the HTTP requests and HTTP responses work together.
It's time to take challenge again! The eGenting Programming Competition of year is coming this November. It is now open for registration.
Apple has recently released their latest OS for iPhone/iPad/iPod, the iOS 5.1. However I have difficulty in downloading the updates both from my Macbook or iPhone. It just hang without any response. I tried for a few days but I just can't download the updates.
After some trial and error. I found out that actually the update software cannot find the update server's host name. So to fix this problem, you just need to set you Mac/PC/iPhone's DNS to an open/well know DNS so that the update software can find the exact location of the host name. I use Google's open DNS and I can now download the updates without any issue.
Hope this information helps you too!