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

SEARCH KEYWORD -- Resize



  When will resizing be triggered in Java HashMap?

HashMap is one of the most frequently used collection types in Java, it stores key-value pairs. Ideally it expects to use hash table which expects the data access time complexity to be O(1), however, due to hash conflicts, in reality, it uses linked list or red-black tree to store data which makes the worst case time complexity to be O(logn).  Although collections are using data structures like arrays and linked lists, unlike arrays, they will dynamically resize when there is not enough spa...

   JAVA,RESIZE,HASHMAP,THRESHOLD     2020-05-02 20:41:19

  Why accessing Java HashMap may cause infinite loop in concurrent environment

HashMap in Java is frequently used to handle key/value pairs. But it is not a good candidate to be used in concurrent environment where ConcurrentHashMap should be used instead. If used in concurrent environment, it may cause lots of unexpected behavior even including make the program getting into an infinite loop situation. To understand how this can happen, let's first discuss how HaspMap works internally. In this post we will use implementation of HashMap before Java 8 as example, Java 8 prov...

   JAVA,HASHMAP,INFINITE LOOP     2020-03-29 01:47:00

  Getting the most out of your pixels - adapting to view state changes

In Windows 8, your apps run on a variety of screen sizes and under various view states. A user might have your app snapped to the side of a 25-inch desktop monitor, or fill the whole screen of a 10-inch widescreen tablet. In each case, you want your app to take full advantage of the available space. In this post, I show you how you can track the current size and view state of your app in code, and give you tips on how to write your app in the Windows 8 Consumer Preview to handle screen si...

   Windos 8,Metro,Resolution,Style     2012-04-23 06:13:02

  How to Convert Images on Mac Finder

If you have a lot of images in different formats and you want to convert them to a common format, you can use the Mac Finder to do it easily and quickly. Here are the steps to follow: 1. Open the Finder and navigate to the folder where your images are stored. 2. Select the images that you want to convert. You can use the Shift key or the Command key to select multiple images at once. 3. Right-click on the selected images and choose Services > Preview from the context menu. This will open the ...

   MACOS,FINDER,IMAGE CONVERSION     2023-04-16 02:09:54

  The Windows 8.1 Update is here! What to Expect from it?

Windows has finally released the update for Windows phone, the Windows 8.1! Microsoft has finally released the version upgrade which has interesting enhancements. This may not seem like a major upgrade but it definitely looks interesting. This latest update has been released on the Lumia phones that were running using the 8.0 version. There is a lot to look forward to in this new update, and some of it will definitely feel interesting. Folders along Live Tiles For a long time, people were attrac...

   windows 8.1     2014-08-21 08:34:24

  Samsung S3 defeats iPhone 4S in sales in Q3

The market research firm Strategy Analytics publishes a research report which states global sales of Samsung Galaxy S3 is over iPhone 4S in the third quarter of 2012, it becomes the most popular mobile phone.From the chart below, Galaxy S3 was sold 18 million units in Q3, while iPhone 4S was sold 16.2 million units. Galaxy S3 took market share of 10.7%, and iPhone 4S took 9.7%.Perhaps people are not willing to buy iPhone 4S due to the launch of the iPhone 5, the iPhone 4S sales lost to Gala...

   Samsung S3,sale,iPhone 4S     2012-11-08 11:22:54

  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

  FONT SIZING WITH REM

Determining a unit of measurement to size our text can be a topic of heated debate, even in this day and age. Unfortunately, there are still various pros and cons that make the various techniques less desirable. It's just a matter of which less-desirable is most desirable.There are two main techniques that are extolled:Size with pxSize with emLet's review these two approaches before I reveal the magical third.Sizing with pxIn the early days of the web, we used pixels to size our text. It's relia...

   CSS3,Font size,Rem,Font,Html5     2011-09-20 12:42:42

  Create an adaptable website layout with CSS3 media queries

With the rise of both very large screens and mobile devices, web developers have to be able to create websites that display correctly and look good whatever the device is. Sure, you can use good old techniques like fluid layouts, but I’ve got something better to show you today. This tutorial will teach you how you can create an adaptable website layout using CSS3.Getting startedView demo (Horizontally resize your browser to view it in action)Download filesCreating the default layoutT...

   CSS3,Media,Mobile device,Resize,PC,@medi     2011-09-20 12:38:27

  Something you may not know about Shell

Shell is also called command line interface, it is the interface between *nix users and computer. Shell is a program which provides service to access OS kernel services. This article is to introduce some not so well known but useful and interesting knowledge about shell. Wiki shell was born almost at the same time as Unix. The first UNIX shell was written by Ken Thompson in 1971 and its name is Thompson sh. It's older than Linux kernel. The default Shell in most *nix and MacOS is bash, bash was...

   Linux, Unix,Shell,Command     2012-11-24 07:19:47