Programming

Giovanni Asproni expands upon the idea that usable APIs help writing clean code. By Giovanni Asproni
Giovanni Asproni expands upon the idea that usable APIs help writing clean code. By Giovanni Asproni
about 1 hour ago
Irakli Nadareishvili, Jon Moore, and Anthony Cuellar share insight in creating teams and building media APIs for distributing content. By Irakli Nadareishvili, Jon Moore, Anthony Cuellar
Irakli Nadareishvili, Jon Moore, and Anthony Cuellar share insight in creating teams and building media APIs for distributing content. By Irakli Nadareishvili, Jon Moore, Anthony Cuellar
about 1 hour ago
Hello all, Our cluster of machines have NUMA architecture and I went through the following -- [link] Problem is numactl package is not installed on our cluster and our admin isn't responding. Are there any other alternatives? Ho...
Hello all, Our cluster of machines have NUMA architecture and I went through the following -- [link] Problem is numactl package is not installed on our cluster and our admin isn't responding. Are there any other alternatives? How badly will this
about 3 hours ago
For those who were wanting a copy of the DVD Collection software made in Python, I have now open sourced it and it is live on BitBucket! DVD Collection software
For those who were wanting a copy of the DVD Collection software made in Python, I have now open sourced it and it is live on BitBucket! DVD Collection software
about 3 hours ago
Do you need to display raw Django template code in your Django 1.4 project? Look no further than this script! It's rather crude, but gets the job done. I haven't yet updated a few Django websites to Django 1.5, which has a new templat...
Do you need to display raw Django template code in your Django 1.4 project? Look no further than this script! It's rather crude, but gets the job done. I haven't yet updated a few Django websites to Django 1.5, which has a new template tag to do this for you, so I created this script to use in legacy Django sites, and it works like a charm! #!/usr/bin/python import sys try: filename = sys.argv[1] except IndexError: print "This command needs exactly 1 parameter!" sys.exit() data = open(filename, 'r').read() data = data.replace('{%', '{! templatetag openblock !}').replace('%}', '{! templatetag closeblock !}') data = data.replace('{{', '{% templatetag openvariable %}').replace('}}', '{% templatetag closevariable %}') print data.replace('{!', '{%').replace('!}', '%}') You should Pygments to highlight the syntax like I do on this blog of course. If you are using Django 1.5 or greater, you should use the verbatim template tag over this.
about 3 hours ago
The popular open source project GraphLab received a major boost early this week when a new company comprised of its founding developers, raised funding to develop analytic tools for graph data sets. GraphLab Inc. will continue to use the...
The popular open source project GraphLab received a major boost early this week when a new company comprised of its founding developers, raised funding to develop analytic tools for graph data sets. GraphLab Inc. will continue to use the open …
about 4 hours ago
Well, I watched the tech session. Unbelievably, in an hour long session, which btw, was really sloppy and poorly presented, there was not a single mention of testing.. !! What year is it?? I thought we stopped arguing whether TDD was a p...
Well, I watched the tech session. Unbelievably, in an hour long session, which btw, was really sloppy and poorly presented, there was not a single mention of testing.. !! What year is it?? I thought we stopped arguing whether TDD was a priority a decade ago. Not google, apparently. Went on to find out that there is no test runner support in the IDE at all right now! You have to run the gradle script to get your tests run. That makes this ‘tool‘ completely unfit for development AFAIC. Meantime, the session showed a few things that were decent. So let me get a few positives out there. The use of gradle is a good idea. I could not figure out how to open the view preview, but that also looks like a step forward. The most impressive part of the session was when the IntelliJ guy came up and showed how extensive the code completion is. Not much more than eclipse (but much more than xcode): will create variables that don‘t exist, move them, stub out methods, etc. I wish the Xcode team would just do this stuff, but it‘s still not enough to make up for all the things Xcode has. Frankly, a point-by-point comparison of this to Xcode would be a total wipeout. Yet most Android tweakers don‘t even know cause they‘ve never even looked at Xcode. Meantime, one mystery solved in this session: Android Studio will be free, unless you want the real edition, then standard IntelliJ pricing applies. Which is hysterical because if I have a team of 10 I will end up spending $5000 and a yearly stipend. In Xcode, I can have a team of 100 and my prices is $99 per year, and that includes a support incident! I also watched a session about scaling Java that was bizarre and witless. People are saying that it‘s Google v. Apple. It‘s really Google v. the world at this point. They are trying to knock Amazon out on the cloud front, their purchased Moto division is competing against Samsung, their new music service against Spotify and Pandora, their ads and social network against Facebook. No wonder Larry wants a vacuum. I predict that Amazon will get a serious challenger for the cloud space, but that it probably won‘t be google. I also have some advice for Amazon‘s challengers: look at their service, it‘s really a bridge technology, aimed at getting the existing generation of technology infrastructure goat herders to move their operations into the virtual world. Of course, the screw will get turned again, and the result will look very different. It‘s doubtful Amazon will have the vision and dexterity to do that themselves; much more likely they will have been the ones who deflated the old model and evacuated its captors, only to have someone else present a new model now that the underlying business is in free agency.
about 4 hours ago
For more than one scenario, the developer might want to have access to the pictures stored in the device photo hub. That can be done in two ways - either by using PhotoChooserTask which is the most common way to retrieve the image conten...
For more than one scenario, the developer might want to have access to the pictures stored in the device photo hub. That can be done in two ways - either by using PhotoChooserTask which is the most common way to retrieve the image content, given that the user himself will select the single entity that needs to be read, or with the help of MediaLibrary - an XNA sub-layer that allows direct access to the media directory.
about 4 hours ago
Please welcome another of my Infodev blogging comrades, Brenda, to the Oracle blogosphere. Check out her typewriter-girl-turned-into-technical-support post. [Read More]
Please welcome another of my Infodev blogging comrades, Brenda, to the Oracle blogosphere. Check out her typewriter-girl-turned-into-technical-support post. [Read More]
about 4 hours ago
As a heavy java programmer, most of the time I encounter a problem where I have two lists and need to find out the differences between these two. One of the ways I sometimes quickly find out the difference is: To print out the list and ...
As a heavy java programmer, most of the time I encounter a problem where I have two lists and need to find out the differences between these two. One of the ways I sometimes quickly find out the difference is: To print out the list and then use microsoft excel to compare the two columns. Upload the file to temporary database tables and the run SQL query to find out the difference As I started encountering the list compare more often, I thought of writing a tool that takes two lists and then simply print out the differences. Thus I coded the following simple piece of java program to achieve this. The following program: Can take an input of two ArrayLists presumably containing Strings, numbers of mix of both It then compares the two lists and then prints out all items from first list which are not in the second lists and also prints out the items in second lists which are not in the first list I can now use this program as often as I want and solves the hassle of me having to upload the data to database for compare or even import to excel to do the same. Most of the programs from my blog come from my real world working experience. They are simple programs but sometimes save your huge time. Feel free to copy and modify any of the programs for your own use. Everything is open sourced and free in my blog package com.kushal.tools; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * @author Kushal Paudyal Last Modified On 2011-09-16 * * This simple utility compares two String or number lists or a list * that contains either strings or number and then prints out a list of * items that are in first list but not in the second list and also a * list of items that are in second list but not in the first list. */ public class ListCompare { public static void main(String args[]) { List listA = new ArrayList(); listA.add(1); listA.add(2); listA.add("Kushal"); listA.add("Madan"); listA.add("Pooja"); listA.add("Kripa"); List listB = new ArrayList(); listB.add(2); listB.add(3); listB.add("Kushal"); listB.add("Madan"); listB.add("Jenny"); listB.add("Betsy"); ListCompare listComp = new ListCompare(); listComp.compareLists(listA, listB); } public void compareLists(List firstList, List secondList) { Map mapForFirstList = new HashMap(); Map mapForSecondList = new HashMap(); Iterator firstListIterator = firstList.iterator(); Iterator secondListIterator = secondList.iterator(); while (firstListIterator.hasNext()) { String firstListKeyValue = firstListIterator.next().toString(); /** * Put the value from the list into the map, only if the same value * already does not exists. That means if there are duplicates, we * put only one instance into the hashmap. */ if (!mapForFirstList.containsKey(firstListKeyValue)) { mapForFirstList.put(firstListKeyValue, firstListKeyValue); } } while (secondListIterator.hasNext()) { String secondListKeyValue = secondListIterator.next().toString(); /** * Put the value from the list into the map, only if the same value * already does not exists. That means if there are duplicates, we * put only one instance into the hashmap. */ if (!mapForSecondList.containsKey(secondListKeyValue)) { mapForSecondList.put(secondListKeyValue, secondListKeyValue); } } compareAndPrintResults(mapForFirstList, mapForSecondList); } private void compareAndPrintResults(Map mapForFirstList, Map mapForSecondList) { /** Compare first map against the second one and print the difference **/ printItemsFromFirstListThatAreNotOnSecondList(mapForFirstList, mapForSecondList); /** Compare second map against the first and print the difference */ printItemsFromSecondListThatAreNotOnFirstList(mapForSecondList, map
about 4 hours ago