Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

November/2024
SunMonTueWedThuFriSat
     12
3456789
10111213141516
1718 1920212223
24252627282930
       

[ Archives News
for 'Java Technology' ]

home > news > java technology > dropping boxes with javafx

Dropping Boxes with JavaFX

Dropping Boxes with JavaFX If you want to work for DropBox, they have an interesting programming test which solution must be submitted together with the CV. I’m not considering a position at DropBox, but their test was too fun to ignore: an interesting challenge in algorithms, and another opportunity to exercise JavaFX as any geometric problem surely deserves some GUI. (Don’t read this blog if you actually plan to apply for a job at DropBox.  I don’t think the company would use this problem as its single method of recruitment; this is more valuable for the candidate.) The problem is to find the ideal packing of some number of arbitrary “boxes” (rectangular objects), so the total are is minimized. The boxes can be rotated if necessary, and the area of the smaller rectangular area that contains all packed boxes is the solution. Like most geometric problems, this is easy to solve by sketching some empiric solution and pondering how to translate it to an algorithm. The first, somewhat obvious idea: Sorting the boxes: First place those with bigger areas, to avoid inefficient placement that could happen when trying to place large boxes on a very fragmented free space caused by smallish boxes. I don’t have a formal justification for this heuristic... it's just a reasonable analogy with similar fragmentation problems, from memory allocation to disk filesystems. Partitioning by size is usu...


Date: September, 03 2010
Url: http://www.java.net/blog/opinali/archive/2010/09/03/dropping-boxes-javafx


Others News

©2002-2019Java-Virtual-Machine.net Mobirise Templates | icon font | top website builder | bootstrap menu | css3 menu