Save image to sdcard from drawable resource on Android

Save image to sdcard from drawable resource on Android

I'm wondering how to save an image to user's sdcard through a button click. Could some one show me how to do it. The Image is in .png format and it is stored in the drawable directory. I want to program a button to save that image to the us

How to disable the beep in emacs on Windows

How to disable the beep in emacs on Windows

Hi I'm new to Emacs and I downloaded GNU emacs on my windows machine. I just finished the short tutorial but I found there's a beep sound whenever I hit the beginning/end of a file and in many other cases, which is a little disturbing to me

VIM Disable Automatic Newline At End Of File

VIM Disable Automatic Newline At End Of File

So I work in a PHP shop, and we all use different editors, and we all have to work on windows. I use vim, and everyone in the shop keeps complaining that whenever I edit a file there is a newline at the bottom. I've searched around and fou

The application was unable to start correctly (0xc000007b)

The application was unable to start correctly (0xc000007b)

I have a client/server app which I have been developing on a single PC. Now it needs two serial ports, so I borrowed a PC from a friend.When I build my app and try to run or debug it (whether in the Delphi IDE or from Windows File manager),

Ruby's double colon (::) operator usage differences

Ruby's double colon (::) operator usage differences

Is there any difference betweenmodule Foo class Engine and module Foo class Engine 1:Constants in Ruby are nested like files and directories in filesystem. So, constants are uniquely identified by their paths.To draw an analogy with t

Response.Redirect to new window

Response.Redirect to new window

I want to do a Response.Redirect("MyPage.aspx") but have it open in a new browser window. I've done this before without using the JavaScript register script method. I just can't remember how? 1:I just found the answer and it works :)You

static files with express.js

static files with express.js

I want to serve index.html and /media subdirectory as static files. The index file should be served both at /index.html and / URLs.I haveweb_server.use("/media", express.static(__dirname + '/media'));web_server.use("/", express.static(__dir

How to set-up a Django project with django-storages and Amazon S3, but with different folders for st

How to set-up a Django project with django-storages and Amazon S3, but with different folders for st

I'm configuring a Django project that were using the server filesystem for storing the apps static files (STATIC_ROOT) and user uploaded files (MEDIA_ROOT).I need now to host all that content on Amazon's S3, so I have created a bucket for t

How to get the file extension in PHP? [duplicate]

How to get the file extension in PHP? [duplicate]

Possible Duplicate: How to extract a file extension in PHP? I wish to get the file extension of an image I am uploading, but I just get an array back. $userfile_name = $_FILES['image']['name'];$userfile_extn = explode(".", strtolower($_FI

File redirection in Windows and %errorlevel%

File redirection in Windows and %errorlevel%

Lets say we want to create an empty file in windows with the following command:type nul > C:\does\not\exist\file.txtthe directory does not exist, so we get the error:The system cannot find the path specifiedIf you print out the %errorlevel%

What is the preferred Bash shebang?

What is the preferred Bash shebang?

Is there any Bash shebang objectively better than the others for most uses?#!/usr/bin/env bash#!/bin/bash#!/bin/sh#!/bin/sh -etcI vaguely recall a long time ago hearing that adding a dash to the end prevents someone passing a command to you

Get the current URL with JavaScript?

Get the current URL with JavaScript?

All I want is to get the website URL. Not the URL as taken from a link. On the page loading I need to be able to grab the full, current URL of the website and set it as a variable to do with as I please. 1:Use:window.location.href As not

How to modify PATH for Homebrew?

How to modify PATH for Homebrew?

Trying to install ruby 1.9.3, read that I need to install homebrew first. Ran brew doctor, and it's giving me a bunch of warnings. One of which is: Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs wi

How to execute a file within the python interpreter?

How to execute a file within the python interpreter?

I'm trying to execute a file with python commands from within the interpreter. EDIT: I'm trying to use variables and settings from that file, not to invoke a separate process. 1:Several ways.From the shellpython someFile.pyFrom inside ID

bundle install fails with SSL certificate verification error

bundle install fails with SSL certificate verification error

When I run bundle install for my Rails 3 project on Centos 5.5 it fails with an error:Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://bb-m.rubygems.org

Diff between getExternalFilesDir and getExternalStorageDirectory()

Diff between getExternalFilesDir and getExternalStorageDirectory()

I understand that ExternalFiles is to be used on API 8 and up and getExternalStorageDirectory is for 7 and down. However I am a little confused between the use. For example I wanted to check that a folder that exists and previously you woul

帝国cms自定义页面模板添加函数自动获取当前自定义页面链接地址

帝国cms自定义页面模板添加函数自动获取当前自定义页面链接地址

帝国cms自定义页面模板,添加函数,自动获取当前自定义页面链接地址。用于canonical标签,页面搜索优化。

自动化部署(三)----linux下maven的安装

自动化部署(三)----linux下maven的安装

wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gztar -zxvf apache-maven-3.5.3-bin.tar.gz export MAVEN_HOME=/var/local/apache-maven-3.5.3 export PATH=PATH