example

Playing an mp3-file with libsox

Hi all, I have an application in which I need to play an mp3 file. What I'm looking for is some kind of wrapper functions for libsox (or any other audio lib). I have been looking all over the net but have not found any option that is fast to implement. I'm looking for something like; bla=open_file("/mnt/music/my_music.mp3") play_thefil...

Using HTTP proxy in PHP

May you give me an example for using an HTTP proxy in PHP? ...

Example of NSTask performing complex pipelines

Can someone post code to show this? Elijah ...

Using Gears for Geolocation in Webview? (for 1.5 phones)

I was able to setup geolocation accessibility in my webview for any android phone running 2.0 and up easily. However I really need to get this feature working on 1.5 and 1.6 phones as well. From what i've read it seems like this feature used to be accomplished with "Gears" and apparently there is a way to use addJavascriptInterface to im...

A very simple thread pool using pthreads in C++

Hello, I'm trying to understand some of the basics of using POSIX pthreads. The kind of thing I need to do (eventually) is parallelize some computations, using a thread pool model. At present I want to ensure I have a very basic sense for how the POSIX pthread model works. So I'm trying to create the simplest thread pool that's gen...

Handling Shake Events in Android (1.5+?)

Hello, Pretty new to Android development here... Is there an example out there of a working app with source that does something when you shake the phone? Is this doable in a background app? Done quite a bit of googling and can't find any good examples; only tutorials with little context. Thanks! ...

Android: How to use Progress bar on AppWidget?

I like to display a progress bar on my AppWidget as the Widget downloads data from a server. Can someone please post an example or a hint how to implement that? ...

python doctest: stop example execution and use the resulting context in some shell

i think there was some directive i could enter in the test that would allow me to run some commands interactively at the point of the directive and then continue the example, but i dont remember what it was... ...

Multiple window application

I am looking for a cocoa example that illustrates how to create a multi-window app. Two windows, two nibs. Clicking a button in one window shows another window. How can I do this? ...

Need example how to build SQL database in C#

Need example how to create new local database and a connection string, if possible with a using statement. There should be 1 table and the data that I want to put in there are unique words length 2-50 lowercase characters, and thy can contain "a-zõäöüšž", ordered by ascending. There are 2 actions I want to do with that: Put HashSet o...

Simple C# Evernote API OAuth example or guide?

Anybody know where I can find a simple example C# code example? Apparently really tough to find. I'm just starting out, got my Developer key. Initial (really noob question/presumption) - -Can (should/must) my solution be a web service client? No new libraries I need to install in .Net right? Basically, as a test, I want to be able to...

Explanation on "JavaScript - the Good Parts" example (section 4.15)?

Beginner in JS :) needs an explanation of code piece from Crockford's book, section 4.15: var memoizer = function (memo, fundamental) { var shell = function (n) { var result = memo[n]; if (typeof result !== 'number') { result = fundamental(shell, n); memo[n] = result; } return ...

Example of application covered with tests

Hi guys, is there sample/open_source application for download that is covered with tests(integration, unit, ...) and could be example how testing should be done? We want to learn our junior programmers how tests should be written(ok ok, and we(seniors) want to learn, too :)) Thanx ...

Regex Replacement

I have a string: users/554983490\/Another+Test+/Question????\/+dhjkfsdf/ How would i write a RegExp that would match all of the forward slashes NOT preceded by a back slash? EDIT: Is there a way to do it without using a negative lookbehinds? ...

Java's Timer in PHP

Hi, I've readen a book that uses Java's Timer class... something like: final Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { /* Does something */ timer.cancel(); } }, 5000); Is there a way to implement that in PHP? I'm rewrinting the book examples in PHP. Thank you. ...

Anyone have example code using switched Views instead of Activities inside a TabHost on Android ?

The Android developer guide (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) states: `You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities. Which method you want for your application will dep...