Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Code



  MaxHeapSize in JVM

MaxHeapSize is an option which is to set the JVM maximum heap size can be allocated. We can specify the MaxHeapSize as VM argument when we run the program by setting -XX:MaxHeapSize=, here can be 2M, 20M, 200M etc. We can also view the current MaxHeapSize set by setting different JVM options. To view the MaxHeapSize, we can use two JVM options : -XX:+PrintFlagsFinal and -XX:+PrintCommandLineFlags. Below is one example when running -XX:+PrintFlagsFinal: bool MaxFDLimit ...

   JVM,MaxHeapSize,Alignment     2014-06-17 07:01:50

  A Python assignment trap

Python has no assignment, it only has reference. Assume, we have following code snippet: >>> values = [0, 1, 2] >>> values[1] = values >>> values [0, [...], 2] Why the result is not [0, [0, 1, 2], 2], instead it goes into an infinite loop? To understand this, we need to understand some basics about Python. Python has no variables, it only has labels. When we run: values = [0, 1, 2] Python will first create a list object [0,1,2], then it labels it as values. If we later...

   Python,Assignment,Trap,Shallow copy     2013-07-19 22:08:36

  Comparing Floating Point Numbers, 2012 Edition

We’ve finally reached the point in this series that I’ve been waiting for. In this post I am going to share the most crucial piece of floating-point math knowledge that I have. Here it is:[Floating-point] math is hard.You just won’t believe how vastly, hugely, mind-bogglingly hard it is. I mean, you may think it’s difficult to calculate when trains from Chicago and Los Angeles will collide, but that’s just peanuts to floating-point math.Seriously. Each ti...

   Floating point number,Comparison,True value     2012-02-23 07:11:03

  Dieter Rams' 10 principles of good web design

Dieter Rams is one of the most important designers of the 20th century but his famous 10 principles for good design focused on industrial design. Here Lisbon-based designer Nuno Loureiro applies them to web design “My heart belongs to the details. I actually always found them to be more important than the big picture. Nothing works without details. They are everything, the baseline of quality”  â€“ D...

   Web design,Principle,Innovation     2012-02-08 10:29:32

  Apple investigating new iPad WiFi issues, tells AppleCare to replace affected units

According to an internal AppleCare document, Apple is actively investigating a series of WiFi-related issues affecting the third-generation iPad. Since the new iPad’s launch, many users have been complaining about third-generation iPad WiFi issues ranging from connection drops, slow download and upload speeds, or the device’s inability to even pickup local WiFi networks. A thread discussing the issue exists on Apple’s online support forums has almost amassed 700 repl...

   Apple,iPad,Wifi,Hardware issue     2012-04-06 01:37:59

  Eight C++ programming mistakes the compiler won’t catch

C++ is a complex language, full of subtle traps for the unwary. There is an almost infinite number of ways to screw things up. Fortunately, modern compilers are pretty good at detecting a large number of these cases and notifying the programmer via compile errors or warnings. Ultimately, any error that is compiler-detectable becomes a non-issue if properly handled, as it will be caught and fixed before the program leaves development. At worst, a compiler-detectable error results in los...

   C++,Compiler,Error detection     2012-04-08 09:55:20

  Best practices of front end optimization

1. Use DocumentFragment or innerHTML to replace complex elements insertion DOM operation on browser is expensive. Although browser performance is improved much, multiple DOM elements insertion is still expensive and will affect the page load speed. Assume we have an ul element on our page, we now want to retrieve a JSON list using AJAX and then update the ul using JavaScript. Usually we may write it as : var list = document.querySelector('ul'); ajaxResult.items.forEach(function(item) { // ...

   JavaScript,Front end,Optimization,Tips     2013-07-06 11:26:27

  The Future of JavaScript � take a peek today!

The ECMA committee is working hard on designing the next version of JavaScript, also known as "Harmony". It is due by the end of next year and it is going to be the most comprehensive upgrade in the history of this language. Chrome and V8 are committed to pushing JavaScript forward and have already started implementing the new features. You can try some of them today in the latest dev channel release. Here’s a summary: Lexical scoping. Now "let" is the new "var" – traditional "var...

   JavaScript,Future,Feature     2012-02-12 04:56:37

  Chrome’s WebRTC roadmap

Last January, Chrome was the first major browser to preview WebRTC, HTML5's new real time audio and video stack. Since then, we've been hard at work keeping up with the evolving specification, fixing bugs and listening to the web community’s feedback. The main parts of the WebRTC specification are now stable and are coming soon to all 200M+ Chrome users. With this blog post, we want to help developers plan for what will be introduced in this first stable release later this year. ...

   WebRTC,Google,Open source,Roadmap     2012-04-12 10:27:51

  A HTTPS client and HTTPS server demo in Java

In this post, I will create a HTTPS server and HTTPS client demo which can establish HTTPS communication between a server and a client using Java. This should be very useful when we want to test our understanding about SSL communication. We will use both a detailed SSL client and a simple HttpsURLConnection as the HTTPS client. Before creating the actual HTTPS server and HTTPS client, we first need to generate the keystore and truststore to be used by the server and client. To generate the keyst...

   SSL,HTTPS,JAVA,DEMO     2015-10-23 09:04:36