How to pick an image from gallery (SD Card) for my app?

How to pick an image from gallery (SD Card) for my app?

This question was originally asked for Android 1.6.I am working on photos options in my app. I have a button and an ImageView in my Activity. When I click the button it would redirect to the gallery and I would be able to select an image. T

How do I download a file over HTTP using Python?

How do I download a file over HTTP using Python?

I have a small utility that I use to download a MP3 from a website on a schedule and then builds/updates a podcast XML file which I've obviously added to iTunes.The text processing that creates/updates the XML file is written in Python. I u

mysqli_free_result necessary?

mysqli_free_result necessary?

I was looking through my code and read that it was recommened to use mysqli_free_result when your result object is not needed anymore. But after seeing that each query is outputed to the $result variable repeatedly throughout the script, I

Android NDK overflows dalvik JNI local reference table

Android NDK overflows dalvik JNI local reference table

I have the following problem, from c++ I send huge string[] to java. huge = at most 20 rows; I am doing the following jint jtype = 2;jstring emptyString = env->NewStringUTF("");jobjectArray data = (jobjectArray)env->NewObjectArray(7, env->F

rails + carrierwave + fog + S3 socket error

rails + carrierwave + fog + S3 socket error

I'm having this problem trying to use S3 services with fog and the Jquery File Upload (https://github.com/blueimp/jQuery-File-Upload)The error Excon::Errors::SocketError (getaddrinfo: nodename nor servname provided, or not known (SocketErro

SharedPreferences Clear/Save

SharedPreferences Clear/Save

Iam trying to make a checker and I want to save a value into SharedPreferences. But i'am not sure if it worksThis what I do to save the value is : * SharedPreferences prefs = getSharedPreferences("PREFERENCE", MODE_PRIVATE); boolean f

How to open/run .jar file (double-click not working)?

How to open/run .jar file (double-click not working)?

I can't open or run my .jar file.I just installed java, but I tried to open the .jar with other programs first, so the double-click defaults to something else and I can't change it back.java -jar myfile.jar returns "'java' is not recognized

What is the simplest way to write a text file in java

What is the simplest way to write a text file in java

Hello, I am wondering what is the easiest (and simplest) way to write a text file in java. Please be simple, because I am a beginner :DI searched the web and found this code, but I understand 50% of it.import java.io.BufferedWriter;import j

I18n for model-specific Rails submit button

I18n for model-specific Rails submit button

I've found that Rails allows for generic i18n of submit buttons via the following in config/locales/en.yml:en: helpers: submit: create: "Create %{model}" submit: "Save %{model}" update: "Update %{model}"However, I'm looki

Using sql date data type and EF4

Using sql date data type and EF4

I have a table w/ a sql date data type. When I look at the EDM markup, the storage element reflects this. The conceptual entity has a data type of DateTime (there doesn't appear to be a Date data type). When I call save changes and have a D

django - get() returned more than one topic

django - get() returned more than one topic

When I tried to relate an attribute with another one which has an M to M relation I received this error: get() returned more than one topic -- it returned 2!Can you guys tell me what that means and maybe tell me in advance how to avoid thi

Passing parent_id to a comment

Passing parent_id to a comment

In my app I have Posts which have comments. Now I also want to add comments to those comments (nested commenting).I currently do it like this, but it does not write my parent_id to the database:My comment link in my _comment.html.erb partia

get pcm data from mp3 file in android

get pcm data from mp3 file in android

My question is simple. How do I get PCM data from the mp3 file?Now I found only ne way to get PCM bytes from the song, I loaded and played mp3 by MediaPlayer and tried listen to the change of waves by Visualizer.OnDataCaptureListener . This

Generate CSV sample iphone app/code

Generate CSV sample iphone app/code

Does anyone have a sample app or some sample code to generate a CSV file on iOS? 1:My CHCSVParser will both read and write CSV files on OS X and iOS. It comes with some examples of how to use it. 2:Here is a simple code to generate C

Is location provider really a battery drain?

Is location provider really a battery drain?

I need to implement location-based service. I don't need fine location, so no GPS is needed.Easiest would be to start listening for locations updates at app start, and leave it ON: mLocationMgr.requestLocationUpdates(LocationManager.NETW

Correct way to persist Quartz triggers in database

Correct way to persist Quartz triggers in database

I'm quite new to Quartz and now I need to schedule some jobs in Spring web application.I know about Spring + Quartz integration (I'm using Spring v 3.1.1) but I'm wondering if this is the right way to follow.In particular I need to persist

Sending OutputStream to browser and let browser save it [duplicate]

Sending OutputStream to browser and let browser save it [duplicate]

This question already has an answer here: How to provide a file download from a JSF backing bean? 4 answers I want to export Data from a Rich Faces Dat

How to use a return value in another function in Javascript?

How to use a return value in another function in Javascript?

I'm self-teaching myself JavaScript and out of curiosity I'm wondering what is the proper way of returning a value from one function to be used in another function. For example:function firstFunction() { // do something; return somevalue

Upload Images to Amazon S3 using Django

Upload Images to Amazon S3 using Django

I'm currently resizing images on the fly when a user uploads a picture. The original picture is stored on Amazon S3 in a bucket called djangobucket. Inside this bucket, contains thousands of folders. Each folder is named after the user. I d

Fourier space filtering

Fourier space filtering

I have a real vector time series x of length T and a filter h of length t import numpy as npfrom scipy.signal import fft, iffty = np.real( np.ifft( np.fft(x) * h ) ) )Since the conditions don't hold, I tried the following hack:Select a padd

Git stash fails 'error: unable to resolve reference refs/stash: No such file or directory'

Git stash fails 'error: unable to resolve reference refs/stash: No such file or directory'

Git pull command is working fine, but git stash is giving the following error:$git stasherror: unable to resolve reference refs/stash: No such file or directoryfatal: Cannot lock the ref 'refs/stash'.Cannot save the current statusHow do i r

Saving and loading Python dict with savemat results in error

Saving and loading Python dict with savemat results in error

Here is an minimal example of the error I get. If I understood the documentation correctly, this should be working, but it seems I did not.a={}a['test1']=1a['test2']=2a['test3']=3import scipy.io as ioio.savemat('temp',{'a':a})b = io.loadmat

Preserve data between application executions

Preserve data between application executions

I have an application with some textboxes. My user fills the textboxes and runs some methods, when they close the application data is lost (normally). I want to keep the value of a couple of textboxes and some local variables. It's not wor

Standard Naming Convention for DAO Methods

Standard Naming Convention for DAO Methods

Is there a standard naming convention for DAO methods, similar to JavaBeans?For example, one naming convention I've seen is to use get() to return a single entity and find() to return a List of entities.If there isn't one, what's the one yo

Capturing image from gallery & camera in android

Capturing image from gallery & camera in android

First thing I know this is repeated question but I don't have problem in capturing image from gallery or camera. I created on dummy project to check my code here it's working fineBut when I used same code in my project & here it's not worki