code-sample

Java + readLine with BufferedReader

I'm trying to read a line of text from a text file and put each line into a Map so that I can delete duplicate words (e.g. test test) and print out the lines without the duplicate words. I must be doing something wrong though because I basically get just one line as my key, vs each line being read one at a time. Any thoughts? Thanks. ...

How to return a 2D String array in java?

I have a method wherein i have to return a 2D String array. The part of code for that method is as follow:- public String[][] retrieveData(){ try{ int noOfRows = 0; pstmt = con.prepareStatement("select * from category"); ResultSet rs = pstmt.executeQuery(); while(rs.next()) noOfRows++; rs.first(); categoryContent = new ...

Android API Sample 8 QuickContactsDemo doesn't do anything.

Android API Sample 8 QuickContactsDemo doesn't do anything. Once you key up some contacts you should get something but the program doesn't work, just loads and stops. If there is something else that needs to be added, it should be dropped into the comments. ...

Android APIDemos8 2.2 SavedRestorState does not save the state of the top text edit.

Android APIDemos8 2.2 SavedRestorState does not save the state of the top text edit. This demo does not work. The initial sate is returned to both the text views. The sequencing of the getSavedText() on line 87 doesn't get called on a onResume. ...

Android API Demos 8 Translucent the class is TranslucentActivity.java doesn't do anything.

TranslucentActivity.java doesn't do anything. There is no translucence, nothing special about it. It just shows an activity screen. ...

Simple (small) and good erlang opensource project to learn from?

Hi, I'm looking for a simple (small) opensource project in erlang, from which I can learn. I've already found a promising looking one: http://github.com/mochi/mochiweb Can you guys suggest more? Thanks! ...

Google App Engine (GAE), Urban Airship, Java, Push notifications. Sample code?

My server is running on GAE (Java), and I'm using Urban Airship service to deliver push notifications. Of course, everything works fine when I use their web-interface to send a test notification, but I'd like to add a test-button to my GAE app/server to have it trigger UA to send the push. The problem is, all of the examples I've seen ...

Help locate C sample code to read lua command line arguments

I am looking for sample code in C which reads Lua command line arguments. Any help? ...

.net: Need samples written by .net in various aspects of programming like Ado.net, web service, user control, ect

hi I was wondering if there be a complete collection of .net code samples with covers various aspects of programming like Ado.net, web service, user control ? Actualy, What I want is some thing like this: Problem: How can we do ......? Solution: .............. .............. ...

.Net samples to receive eBay SOAP notifications

Anybody know of any .Net sample code to receive SOAP notifications from eBay. I can receive the notifications as a POST request and while I could parse out the XML to get what I want I'm hoping there's an easier way to do it by using the classes already defined in the eBay .Net SDK (unfortunately provided without any sample code to recei...

Compiling/Linking OpenCV Sample: camshiftdemo.c

I built the demo on my Ubuntu 10.04 using the headers found in this PPA and with the build_all.sh script found in the same directory as camshiftdemo.c. All I got is a Could not initialize capturing... message. Then I tried to build it with this line (found it after building the demo with CMake in the building directory that CMake create...

Script to flag spam or inappropriate content for Rails

Is there any easy-to-install script out there for Rails app? A flag button just like youtube, for user to click when spam or profanity or inappropriate graphic is found in a community post. That flag will notify the admin to review the complained entry so to take necessary action, such as removing the inappropriate content. ...