I am trying to convert my base64 image string to an image file. This is my Base64 string:
http://pastebin.com/ENkTrGNG
Using following code to convert it into an image file:
function base64_to_jpeg..
I have to include some images (company logo's etc) in email signatures. I've had all sorts of issues using the embedded images produced by the email system in question (they get sent as attachments ge..
My Express app is receiving a base64-encoded PNG from the browser (generated from canvas with toDataURL() ) and writing it to a file. But the file isn't a valid image file, and the "file" utility simp..
I want to load a PNG image encoded in Base64 to canvas element. I have this code:
<html>
<head>
</head>
<body>
<canvas id="c"></canvas>
<script type="text/javas..
I have the following piece of base64 encoded data, and I want to use python base64 module to extract information from it. It seems that module does not work. Can anyone tell me how?
Q5YACgAAAABDlgA..
hi i'm actually sending a base64 image string trough ajax to a php script which just decodes string and save content as .jpg file.
But the result is an empty image.
How can this be possible?
php sc..
I am trying to make an installer using batch. Of course, an installer needs to consist of files that will be installed, so I'm thinking of encoding the files in base64, and simply decode them and writ..
I'm trying to read an image from client side encoded in base64.
How to read with nodejs?
My code:
// add to buffer base64 image
var encondedImage = new Buffer(image.name, 'base64');
fs.readFile(enc..
How do you convert an image from a path on the user's computer to a base64 string in C#?
For example, I have the path to the image (in the format C:/image/1.gif) and would like to have a data URI like..
I want to convert Base64String extracted from file(ex: "AAAAA....~") to a javascript file object.
The javascript file object what I mean is like this code:
HTML:
<input type="file" id="selectFi..
I have a PHP script that can encode a PNG image to a Base64 string.
I'd like to do the same thing using JavaScript. I know how to open files, but I'm not sure how to do the encoding. I'm not used to ..
Does anyone know how to convert a UIImage to a Base64 string, and then reverse it?
I have the below code; the original image before encoding is good, but I only get a blank image after I encode and d..
I keep getting a Base64 invalid character error even though I shouldn't.
The program takes an XML file and exports it to a document. If the user wants, it will compress the file as well. The compress..
I am trying to convert a Base64String to an image which needs to be saved locally.
At the moment, my code is able to save the image but when I open the saved image, it says "Invalid Image".
Code:
..
I'm having a problem while converting a gif image to a base 64 string.
When I converts it, the code adds me like 100,000 AAAAAA whereas the image is really small!
Here is my code:
import java.io.Bu..
Is it possible to use a RegEx to validate, or sanitize Base64 data? That's the simple question, but the factors that drive this question are what make it difficult.
I have a Base64 decoder that can ..
I am developing a Java EE application in which I need Base64 Encoding/Decoding
So I added commons-codec-1.5.jar in WEB-INF/lib folder of my application and used
import org.apache.commons.codec.bina..
I am trying to:
Generate a byte array.
Convert that byte array to base64
Convert that base64 string back to a byte array.
I've tried out a few solutions, for example those in this question.
Fo..
I am trying to crop/resize user profile image using jquery plugin namely crop.js which sends user image as base64 via ajax to my controller as
$.ajax({
type: "post",
dataType: "jso..
I want to change background dynamically in JS and my set of images is in base64 encoded.
I try:
document.getElementById("bg_image").style.backgroundImage =
"url('http://amigo.com/300107-2853.jpg'..
I know how to encode / decode a simple string to / from base64.
But how would I do that if the data is already been written to a FileStream object. Let's say I have only access to the FileStream obj..
I'm having trouble displaying a Base64 image inline.
Can someone point me in the right direction?
<!DOCTYPE html>
<html>
<head>
<title>Display Image</title>
<..
I am trying to "decode" this following Base64 string:
OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy..
I want to encode an image into a string using the base64 module. I've ran into a problem though. How do I specify the image I want to be encoded? I tried using the directory to the image, but that sim..
I'm using Nihilogic's "Canvas2Image" JavaScript tool to convert canvas drawings to PNG images.
What I need now is to turn those base64 strings that this tool generates, into actual PNG files on the s..
I want to decode a Base64 encoded string, then store it in my database. If the input is not Base64 encoded, I need to throw an error.
How can I check if a string is Base64 encoded?..
The JSON format natively doesn't support binary data. The binary data has to be escaped so that it can be placed into a string element (i.e. zero or more Unicode chars in double quotes using backslash..
Is there a way in C# to see if a string is Base 64 encoded other than just trying to convert it and see if there is an error? I have code code like this:
// Convert base64-encoded hash value into a ..
I'm converting an image to base64 string and sending it from android device to the server. Now, I need to change that string back to an image and save it in the database.
Any help?..
Using a rich-text editor, our users can drag and drop a saved image from their desktop to the editor. The image appears and displays properly in the web page after they submit.
Since the image is not..
It may be a duplicate but i am facing some problem to convert the image into Base64 for sending it for Http Post. I have tried this code but it gave me wrong encoded string.
public static void main(..
I have a Base64 String that represents a BitMap image.
I need to transform that String into a BitMap image again to use it on a ImageView in my Android app
How to do it?
This is the code that I use..
I have converted the source content from the <img> html tag to a base64String using JavaScript. The image was displayed clearly. Now I want to save that image to user's disk using javascript.
&..
The common method to store images in a database is to convert the image to base64 data before storing the data. This process will increase the size by 33%. Alternatively it is possible to directly sto..
I have a normal string in Powershell that is from a text file containing Base64 text; it is stored in $x. I am trying to decode it as such:
$z = [System.Text.Encoding]::Unicode.GetString([System.Conv..
I have written some code for image capturing using javascript/jquery
Below is the code:
function capture_image(){
alert("capture_image");
var p = webcam.capture();
webcam.save(); ..
I'm trying to send a confirmation email after user registration. I'm using the JavaMail library for this purpose and the Java 8 Base64 util class.
I'm encoding user emails in the following way:
byte..
What is the code to transform an image (maximum of 200 KB) into a Base64 String?
I need to know how to do it with Android, because I have to add the functionality to upload images to a remote se..
I am trying to encode a text string to base64.
i tried doing this :
name = "your name"
print('encoding %s in base64 yields = %s\n'%(name,name.encode('base64','strict')))
But this gives me the foll..
I got a webSocket comunication, I recieve base64 encoded string, convert it to uint8 and work on it, but now I need to send back, I got the uint8 array, and need to convert it to base64 string, so I c..
I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these ..
I have a bitmap taken of a Base64 String from my remote database, (encodedImage is the string representing the image with Base64):
profileImage = (ImageView)findViewById(R.id.profileImage);
byte[] i..
I have a regular HTML page with some images (just regular <img /> HTML tags). I'd like to get their content, base64 encoded preferably, without the need to redownload the image (ie. it's already..
Does anyone know how to decode and encode a string in Base64 using the Base64. I am using the following code, but it's not working.
String source = "password";
byte[] byteArray = source.getBytes("UT..
Does node.js have built-in base64 encoding yet?
The reason why I ask this is that final() from crypto can only output hex, binary or ascii data. For example:
var cipher = crypto.createCipheriv('des-..
I have two base64 encoded in PNG, and I need to compare them using Resemble.JS
I think that the best way to do it is to convert the PNG's into file objects using fileReader. How can I do it?..
I have some data that is base64 encoded that I want to convert back to binary even if there is a padding error in it. If I use
base64.decodestring(b64_string)
it raises an 'Incorrect padding' erro..
I have binary data in an unsigned char variable.
I need to convert them to PEM base64 in c.
I looked in openssl library but i could not find any function.
Does any body have any idea?..
Following this python example, I encode a string as Base64 with:
>>> import base64
>>> encoded = base64.b64encode(b'data to be encoded')
>>> encoded
b'ZGF0YSB0byBiZSBlbmNvZ..
Wikipedia says
Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data. Thi..
I'm trying to decode a simple Base64 string, but am unable to do so. I'm currently using the org.apache.commons.codec.binary.Base64 package.
The test string I'm using is: abcdefg, encoded using PHP ..
I want to select a blob col from one table, base64 encode it and insert it into another tables. Is there any way to do this without round tripping the data out of the DB and through my app?..
I want to set the Image source to a base64 source but it does not work:
JSfiddle.net/NT9KB
<img id="img" src="" />
the JavaScript
document.getElementById("img").src = "data:image/png;base64..
I'm trying to render a page from a pdf with pdf.js
Normally, using a url, I can do this:
PDFJS.getDocument("http://www.server.com/file.pdf").then(function getPdfHelloWorld(pdf) {
//
// Fetch the..
UPD TypeScript version is also available in answers
Now I'm getting File object by this line:
file = document.querySelector('#files > input[type="file"]').files[0]
I need to send this fi..
I'm trying to convert UTF-8 to base64 string.
Example: I have "abcdef==" in UTF-8. It's in fact a "representation" of a base64 string.
How can I retrieve a "abcdef==" base64 string (note that I don..
As the title says, I am getting:
Invalid length for a Base-64 char
array.
I have read about this problem on here and it seems that the
suggestion is to store ViewState in SQL if it is large...
I want to convert a string to Base64. I found answers in several places, but it does not work anymore in Swift. I am using Xcode 6.2. I believe the answer might be work in previous Xcode versions and ..
I have a registration form where users can choose an avatar. They have 2 possibilities:
Choose a default avatar
Upload their own avatar
In my HTML page I have this.
<img id="preview" src="img/..
I need to convert a base64 encode string into an ArrayBuffer.
The base64 strings are user input, they will be copy and pasted from an email, so they're not there when the page is loaded.
I would like ..
Can we convert a byte array into an InputStream in Java? I have been looking on the internet but couldn't find it.
I have a method that has an InputStream as argument.
The InputStream cph I have is ..
I need to convert my image to a Base64 string so that I can send my image to a server.
Is there any JavaScript file for this? Else, how can I convert it?..
I want to encode a string into base64 and transfer it through a socket and decode it back.
But after decoding it gives different answer.
Following is my code and result is "77+9x6s="
import javax..
I don't know what we call this. but i found a image at google 404
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAADVCAMAAAAfHvCaAAAAGFBMVEVYn%2BH%2F%2F%2F%2Bex%2B3U5vd7s%2Bfq8%2Fs0itq72PMLUP..
I'd like to write a T-SQL query where I encode a string as a Base64 string. Surprisingly, I can't find any native T-SQL functions for doing Base64 encoding. Does a native function exist? If not, wh..
I have a REST service that reads a file and sends it to another console application after converting it to Byte array and then to Base64 string. This part works, but when the same stream is received a..
So here my problem: I have a pdf file as a base64 String that i am getting from the server. I would like to use this string to either display the PDF directly to the browser or give it a option of "Sa..
I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug.
My only issues is that I'm trying to base64 encode the file data before it's sent to the server whe..
I'm trying to base64 encode an image in a shell script and put it into variable:
test="$(printf DSC_0251.JPG | base64)"
echo $test
RFNDXzAyNTEuSlBH
I've also tried something like this:
test=\`echo..
I was implementing password hashing with salt, so I generated salt as binary, hashed the password, base64 encoded the password and salt then stored them into database.
Now when I am checking password..
How to write a Base64-encoded image to file?
I have encoded an image to a string using Base64.
First, I read the file, then convert it to a byte array and then apply Base64 encoding to convert the im..
I'd like to do base64 encoding and decoding, but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library?..
In this question Erik needs to generate a secure random token in Node.js. There's the method crypto.randomBytes that generates a random Buffer. However, the base64 encoding in node is not url-safe, it..
I actually have a file input and I would like to retrieve the Base64 data of the file.
I tried:
$('input#myInput')[0].files[0]
to retrieve the data. But it only provides the name, the length, the..
I am retrieving a Blob image from a database, and I'd like to be able to view that image using JavaScript. The following code produces a broken image icon on the page:
var image = document.createElem..
I have Base64-encoded binary data in a string:
const contentType = 'image/png';
const b64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAA..
I was looking at the source of a greasemonkey userscript and noticed the following in their css:
.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj..
I need to encode some data in the Base64 encoding in Java. How do I do that? What is the name of the class that provides a Base64 encoder?
I tried to use the sun.misc.BASE64Encoder class, without s..
If I convert an image (jpg or png) to base64, then will it be bigger, or will it have the same size? How much greater will it be?
Is it recommended to use base64 encoded images on my website?..
<input type="file" id="asd"/>
I would like to get the image in base64 once the user chose that (before submitting the form)
Something like :
$(input).on('change',function(){
var data = $(t..
I know what base64 encoding is and how to calculate base64 encoding in C#, however I have seen several times that when I convert a string into base64, there is an = at the end.
A few questions came u..
The title says it all:
I read in a tar.gz archive like so
break the file into an array of bytes
Convert those bytes into a Base64 string
Convert that Base64 string back into an array of bytes
Write..
Purely out of curiosity, which browsers does Base64 image embedding work in? What I'm referring to is this.
I realize it's not usually a good solution for most things, as it increases the page size q..
After reading the base64 wiki ...
I'm trying to figure out how's the formula working :
Given a string with length of n , the base64 length will be
Which is : 4*Math.Ceiling(((double)s.Length/3)..
For a JUnit test I need a String which consists of multiple lines. But all I get is a single lined String. I tried the following:
String str = ";;;;;;\n" +
"Name, number, address..
I want to create a dictionary whose values are lists. For example:
{
1: ['1'],
2: ['1','2'],
3: ['2']
}
If I do:
d = dict()
a = ['1', '2']
for i in a:
for j in range(int(i), int(i) + 2..
Whenever I make a webapp and I get a CORS problem, I start making coffee. After screwing with it for a while I manage to get it working but this time it's not and I need help.
Here is the client side..
I have a small GUI test with a "Start" button and a Progress bar. The desired behavior is:
Click Start
Progressbar oscillates for 5 seconds
Progressbar stops
The observed behavior is the "Start" b..
I have a yeoman scaffolded app (the angular fullstack generator).
grunt serve works fine, but grunt build produces a distribution that locks up memory, most probably because of circular references i..
I have the following data:
SQL> select * from booking_session;
BK_ID|BK_DATE
-----|-------------------------
1|18-MAR-12 10.00.00.000000
2|18-MAR-12 10.25.00.000000
3|18-MAR-12 10.30...
I got a table-cell with fixed width and height and if text is too large, cell size should remain the same and text should be hidden by overflow:hidden.
div {
display: table-cell
height: 100px;
..
If I change the value of :rows, it works. But it stays at the default cols whatever value I set with ':cols =>'. Column width won't change.
I viewed the html source and it reflected the change. I won..
There are a couple of posts about this on Stack Overflow but none with an answer that seem to fix the problem in my current situation.
I have a page with a table in it, each row has a number of text ..
Is it possible to get a history of queries made in postgres? and is it be possible to get the time it took for each query? I'm currently trying to identify slow queries in the application I'm working ..
I would like to automate ssh login from my mac.
It does have a simple solution:
sshpass -p my_password ssh m_username@hostname
but my problem is installing sshpass on my mac. ..
Summary
I am trying to mount a host directory in Docker, but then I can not access it from within the container, even if the access permissions look good.
Details
I am doing
sudo docker run -i -v /dat..
I have installed Laravel and began trying to write an app. I made some directories for my assets in the same directory as /app. But when I try to visit an image in my localhost for example: http://lo..
Is it possible to stop an Android app from the console? Something like:
adb stop com.my.app.package
It would speed up our testing process so much. Right now we uninstall/install the app each time t..
I have the following problem: I would like to visualize a discrete and a continuous variable on a boxplot in which the latter has a few extreme high values. This makes the boxplot meaningless (the poi..
Suppose if I add person class instance to list and then I need to query the list using linq.
List lst=new List();
lst.add(new person{ID=1,Name="jhon",salary=2500});
lst.add(new person{ID=2,Name="Sena..
There are a couple of different ways to remove HTML tags from an NSString in Cocoa.
One way is to render the string into an NSAttributedString and then grab the rendered text.
Another way is to use ..
I have defined the following variable:
myVar=true
now I'd like to run something along the lines of this:
if [ myVar ]
then
echo "true"
else
echo "false"
fi
The above code does work, but ..
Currently the left bar button default value is the title of the view that loaded the current one, in other words the view to be shown when the button is pressed (back button).
I want to change the te..
I am moving my projects from eclipse to Android Studio. While running one of my app I get the following error. Not able to find any solution. I have enabled multidex as well.
Error:Execution faile..
I am working on a cross-platform React Native mobile app. I am writing console.log statements as I develop. I want to see these logging statements in Chrome while I'm running the Android app in the de..
I use md5sum to generate a hash value for a file.
But i only need to receive the hash value, not the file name.
md5=`md5sum ${my_iso_file}`
echo ${md5}
3abb17b66815bc7946cefe727737d295 ./iso/somef..
I'm trying to write some code that uses Numpy. However, I can't import it:
Python 2.6.2 (r262, May 15 2009, 10:22:27)
[GCC 3.4.2] on linux2
Type "help", "copyright", "credits" or "license" for more..
I am looking for solution to pick number randomly from an integer array.
For example I have an array new int[]{1,2,3}, how can I pick a number randomly?..
Is it possible to set up the headers in a multicolumn listbox without using a worksheet range as the source?
The following uses an array of variants which is assigned to the list property of the list..
I want to INSERT a record in a database (which is Microsoft SQL Server in my case) using JDBC in Java. At the same time, I want to obtain the insert ID. How can I achieve this using JDBC API?..
I would like to check if users enter correct phone number in, with help of jQuery, so far I got to this stage:
var phone = $("input#phone").val();
if (phone !== "") {
//Check if phone is numeric
..
I finally released my project to the production level and suddenly I have some issues I never had to deal with in the development phase.
When the users posts some actions, I sometimes get the followi..
I have a .bak file, and I want to use this file to recreate the database in a fresh install of SQL Server 2008 Management Studio.
Can someone point me in the right direction on how this can be done?
..
Can someone please tell me how exactly to use getExtra() and putExtra() for intents? Actually I have a string variable, say str, which stores some string data. Now, I want to send this data from one a..
From my DB im getting the following string:
Johan Öbert
What it should say is:
Johan Öbert
I've tried to convert it into utf-8 like so:
nameString.toString("utf8");
But still same proble..
I'm trying to find out whether a Java TCP Socket is currently connected, the following just seems to tell me whether the socket has been connected at some point - not whether it is currently still con..
I would like to read a text file in R, line by line, using a for loop and with the length of the file. The problem is that it only prints character(0). This is the code:
fileName="up_down.txt"
con=fi..
public class doublePrecision {
public static void main(String[] args) {
double total = 0;
total += 5.6;
total += 5.8;
System.out.println(total);
}
}
The abov..
In Python, I have a list:
L = [1, 2, 45, 55, 5, 4, 4, 4, 4, 4, 4, 5456, 56, 6, 7, 67]
I want to identify the item that occurred the highest number of times. I am able to solve it but I need the f..
I saw some code that seems to use an operator I don't recognize, in the form of two exclamation points, like so: !!. Can someone please tell me what this operator does?
The context in which I saw thi..
I am creating a GUI with a browse button which I only want to return the path. I've been looking at solutions using code like below.
Tkinter.Button(subframe, text = "Browse", command = self.loadtemp..
Have an array of chars like char members[255]. How can I empty it completely without using a loop?
char members[255];
By "empty" I mean that if it had some values stored in it then it should not. F..
I need to insert HTML content into an XML document, is this possible or should HTML content be, for example, encoded in BASE64 or with something else like that?..
I'm working on a web app that has a topBar similar to facebook's blue bar at the top. I have an unordered list within the div of that bar to list some items, like Inbox, Notifications, etc. The UL ha..
I have tried to use exec() with 'whoami' to check if it works and I got the result of
nt authority\system
Now I need to run a .exe file with parameters from php via exec() function.
I tried this..
I notice that most people use the words HTML tags and HTML elements interchangeably.
But what is the difference between them?
The way I see it is that tags are in the source code and elements are ..
What is the proper way to modify environment variables like PATH in OS X?
I've looked on Google a little bit and found three different files to edit:
/etc/paths
~/.profile
~/.tcshrc
I don't ..
I have an integer
{% set curYear = 2013 %}
In {% if %} statement I have to compare it with some string. I can't set curYear to string at the beginning because I have to decrement it in loop.
How c..
Given a value I want to validate it to check if it is a valid year. My criteria is simple where the value should be an integer with 4 characters. I know this is not the best solution as it will not al..
How to split the string "Thequickbrownfoxjumps" to substrings of equal size in Java.
Eg. "Thequickbrownfoxjumps" of 4 equal size should give the output.
["Theq","uick","brow","nfox","jump","s"]
Sim..
I opened an existing iOS project with Xcode6 beta6, and Xcode lists the following warning for both Storyboard and Xib files:
Automatic Preferred Max Layout Width is not available on iOS versions
..
What is the difference between running a Java application withjava -cp CLASSPATH and java -jar JAR_FILE_PATH? Is one of them preferred to the other for running a Java application? I mean which one of ..
I am actually new to REST WS but really I don't get this 415 Unsupported Media Type.
I am testing my REST with Poster on Firefox and the GET works fine for me, also the POST (when it's a application..
Is there a quick way to create an input text element with an icon on the right to clear the input element itself (like the google search box)?
I looked around but I only found how to put an icon as b..
I need some help writing a MySQL query to show me rows from last month, but not the whole month, only up and until the same day, hour and minute as it is now(), but 1 month before.
So for example, if..
How do I access a page's HTTP response headers via JavaScript?
Related to this question, which was modified to ask about accessing two specific HTTP headers.
Related:
How do I access the HTTP r..
I have 2 variables (x,y) that change with time (t). I want to plot x vs. t and color the ticks based on the value of y. e.g. for highest values of y the tick color is dark green, for lowest value is d..
I need a command line tool to dump standard Windows DLL version info so I can process it by means of a bash script (Cygwin).
As a Java developer I am not very used to Microsoft development tools (tho..
I am trying to add some text into circle. I have been following example from a mbostock tutorial, but wasn't able to get the right output.
The code snippet is:
var data;
var code;
d3.json("/json/tr..
I have the following code in my web service:
string str_uploadpath = Server.MapPath("/UploadBucket/Raw/");
FileStream objfilestream = new FileStream(str_uploadpath +
fileName, FileMod..
I'm calling this function from my asp.net form and getting following error on firebug console while calling ajax.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote ..
I want to change these lines in my excel VBA code to something much faster, instead of looping through all the rows, i did saw examples but could not understand them as i am not a VBA user.
When I us..
I'm new to R but I've made numerous correlation plots with smaller data sets. However, when I try to plot a large dataset (2gb+), I can produce the plot just fine, but the legend doesn't show up. Any ..
I am trying to use a Node.JS application to make and receive API requests. It does a get request to another server using Axios with data it receives from an API call it receives. The second snippet is..
How do I select the <li> element that is a direct parent of the anchor element?
As an example, my CSS would be something like this:
li < a.active {
property: value;
}
Obviously there ..
I am using Python/NumPy, and I have two arrays like the following:
array1 = [1 2 3]
array2 = [4 5 6]
And I would like to create a new array:
array3 = [[1 2 3], [4 5 6]]
and append items to it. S..
I'm outside gdb's target executable and I don't even have a stack that corresponds to that target. I want to single-step anyway, so that I can verify what's going on in my assembly code, because I'm ..
Looking at the last JUnit test case I wrote, I called log4j's BasicConfigurator.configure() method inside the class constructor. That worked fine for running just that single class from Eclipse's "ru..
I want an idiomatic way to find the first element in a list that matches a predicate.
The current code is quite ugly:
[x for x in seq if predicate(x)][0]
I've thought about changing it to:
from i..
What's the best way to add vertical whitespace using Twitter's Bootstrap?
For example, let's say that I am creating a landing page and would like a bit (100px) of blank whitespace above and below a ..
I've a lot of tables in Lovefield and their respective Interfaces for what columns they have.
Example:
export interface IMyTable {
id: number;
title: string;
createdAt: Date;
isDeleted: boolea..
I know that we can use os.walk() to list all sub-directories or all files in a directory. However, I would like to list the full directory tree content:
- Subdirectory 1:
- file11
- file12
-..
It is supposed to be generally preferable to use a StringBuilder for string concatenation in Java. Is this always the case?
What I mean is this: Is the overhead of creating a StringBuilder object, ca..
How do you convert an array to a JSON string in swift?
Basically I have a textfield with a button embedded in it.
When button is pressed, the textfield text is added unto the testArray.
Furthermore, I..
I have the following:
function refreshGrid(entity) {
var store = window.localStorage;
var partitionKey;
...
...
I would like to exit from this function if an "if" condition is met. ..
I have two existing dictionaries, and I wish to 'append' one of them to the other. By that I mean that the key,values of the other dictionary should be made into the first dictionary. For example:
or..
I am searching for a file in all the folders.
Copyforbuild.bat is available in many places, and I would like to search recursively.
$File = "V:\Myfolder\**\*.CopyForbuild.bat"
How can I do it in P..
I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window.
Is there a way to do this? I ..
On a layout I want to scale the background image (keeping its aspect ratio) to the space allocated when the page gets created. Does anyone have an idea how to do this?
I am using layout.setBackground..
I am writing Python code using Vim, and every time I want to run my code, I type this inside Vim:
:w !python
This gets frustrating, so I was looking for a quicker method to run Python code inside V..
I have n number of text fields named in the form "Question.....". How can I get all the parameters which starts with "question" from the JSP page to the Action?..
I wrote a simple test application to log something in a log file. I am using linux mint and after the application executes I try to view the log using this command:
tail -n 100 /var/log/messages
b..
I have a css class defined so I can make a div to use all the browser's viewport, the rule is the following:
.fullscreenDiv {
background-color: #e8e8e8;
width: 100%;
height: auto;
bot..
So I have a Windows Phone solution that has an ad in it. When my Solution References Microsoft.Advertising.SDK Advertising.Mobile Advertising.Mobile.UI Everything works fine and I get ads. Unfortu..
I am trying to access localhost:8080 but it is showing me I need to enter user name and pass word. I remember messing up with the server some 4 months ago while I was trying to develop a web applicati..
I looked around a lot before posting this question so my apologies if it is on another post and this is only my second quesiton on here so apologies if I don't format this question correctly.
I have ..
The position of a UIView can obviously be determined by view.center or view.frame etc. but this only returns the position of the UIView in relation to it's immediate superview.
I need to determine th..
I am new to Magento. I can't find log files in Magento. I googled it, but the Magento Commerce site returns closed and some other sites explain how to create custom log files. I want to know the locat..
What's the most idiomatic way in Java to verify that a cast from long to int does not lose any information?
This is my current implementation:
public static int safeLongToInt(long l) {
int i = (..
I am currently developing a web application with the Facebook Graph API.
My current goal is to retrieve only posts which have a location attached.
While retrieving posts with and without location is..
I cannot figure out a problem I am having with code written in Python 2.7. I am converting the references to ints, but I keep getting a type exception bad operand type for unary +: 'str'. Can anyone a..
I am trying to specify the Font Face and Size for text in a table. It seems to respect the FACE= but ignores the SIZE=. For example, I have the HTML shown below. It correctly displays the text in Co..
This has been asked on this site before but I couldn't find a sufficient answer. If I'm doing a query like:
Select Seller from Table where Location = 'San Jose'
How can I make it return only Seller..
Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work!
Is it possible to switch TFS into an offline mode in the ..
Here is some code I'd like to execute. I'd like to wait for AJAX response so I can return something from the server. Any way to achieve this?
function functABC(){
$.ajax({
url: 'myPage.ph..
I'm trying to pick up the windows username when debugging in Visual Studio 2013. I am simply using:
httpcontext.current.user.identity.name
If I run this on my Dev Server it works fine, if I run it ..
<select >
<option value="something">something</option>
<option value="something_else">something else</option>
</select>
<input type="text" >
So that when us..
I'm trying to use importlib.import_module in Python 2.7.2 and run into the strange error.
Consider the following dir structure:
a
|
+ - __init__.py
- b
|
+ - __ini..
There are many legends about them. I want to know the truth. What are the differences between the two following examples?
<input type='submit' value='text' />
<button type='submit'>text&..
I want to read and write an Excel file from Java with 3 columns and N rows, printing one string in each cell. Can anyone give me simple code snippet for this? Do I need to use any external lib or doe..
I have created a class file in the App_Code folder in my application. I have a session variable
Session["loginId"]
I want to access this session variables in my class, but when I am writing the fo..
Using Angular 2, I want to duplicate a line in a template multiple times. Iterating over an object is easy, *ngFor="let object of objects". However, I want to run a simple for loop, not a fo..
Possible Duplicates:
Images in MySQL
Storing images in MySQL
I'm trying to develop a website where users upload their images as part of registration. I want it that for each image, there ..
I want to store an image(from url) into a sqlite database.
For that I use:
db = new DataBase(getApplicationContext());
URL url = new URL("http://sree.cc/wp-content/uploads/schogini_team.png");
URLC..
Consider:
#div p {
color: red !important;
}
...
#div p {
color: blue;
}
I understand how !important works. In this case the div will render red because now it has priority (!important). But..
I have a string like this:
"o1 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467"
How do I extract only "o1 1232.5467"?
The number of characters to be extracted are not the same always. H..
What's the shortest way to see how many full days have passed between two dates?
Here's what I'm doing now.
math.floor((b - a).total_seconds()/float(86400))
..
Let's say I have the following data in the Customers table: (nothing more)
ID FirstName LastName
-------------------------------
20 John Mackenzie
21 Ted Green
22 Marcy ..
How can I randomize lots of rows in Excel?
For example I have an excel sheet with data in 3 rows.
1 A dataA
2 B dataB
3 C dataC
I want to randomize the row order. For example
2 B dataB
1 A dataA
..
From the PyQt4 website their instructions for installing the package are to download the tarball and use the config file. I have two versions of Python, one is my normal system and the other is within..
I opened the console (chrome\firefox) and ran the following lines:
$("body").append("<div id=\"popupFrame\" style=\"width:100%;height:100%;background-color:black;opacity:0.5;position:absolute;top:..
I'm trying to preform setup and teardown for a set of integration tests, using jUnit 4.4 to execute the tests. The teardown needs to be run reliably. I'm having other problems with TestNG, so I'm look..
I once had the task of determining the following performance parameters from inside a running application:
Total virtual memory available
Virtual memory currently used
Virtual memory currently used ..
I need a regular expression that validates a number, but doesn't require a digit after the decimal.
ie.
123
123.
123.4
would all be valid
123..
would be invalid
Any would be greatly appreciated..
Is there a way I can launch a tab (not a new Window) in Google Chrome with a specific URL loaded into it from a custom app? My application is coded in C# (.NET 4 Full).
I'm performing some actions v..
Say now I have a numpy array which is defined as,
[[1,2,3,4],
[2,3,NaN,5],
[NaN,5,2,3]]
Now I want to have a list that contains all the indices of the missing values, which is [(1,2),(2,0)] at this..
Suppose I have String like :
var abc : NSString = "ABC"
and I want to check that it is nil or not and for that I try :
if abc == nil{
//TODO:
}
But this is not working and giving m..
I installed Anaconda and can run Python, so I assume that I installed it correctly. Following this introductory documentation, I am trying to install Python v3.3, so I am copying and pasting the follo..
How can I convert a 'normal' Git repository to a bare one?
The main difference seems to be:
in the normal Git repository, you have a .git folder inside the repository containing all relevant data a..
The following code gives me error 9 "subscript out of range". I meant to declare a dynamic array so that the dimension changes as I add elements to it. Do I have to create a "spot" on the array before..
When I try to push to a shared git remote, I get the following error:
insufficient permission for adding an object to repository database
Then I read about a fix here: Fix This worked for the next p..
I already added a custom domain to my Heroku app and it works with www.domain.com.
I need to know how to set up the domain without www to resolve to the app, too.
Here are my current DNS settings:
..
I am working with the Selenium WebDriver 2.25.0 on multilingual web application & mainly test the page content (For different languages like Arabic, English, Russian & so on).
For my applicat..
Listening to Scott Hanselman's interview with the Stack Overflow team (part 1 and 2), he was adamant that the SQL server and application server should be on separate machines. Is this just to make su..
Could you explain the difference between CLOCK_REALTIME and CLOCK_MONOTONIC clocks returned by clock_gettime() on Linux?
Which is a better choice if I need to compute elapsed time between timestamps ..
I am very new for Android development, and I am trying to use HashMap in Android sample project. Now, am doing sample project for learn android. I just store keys and values in HashMap, i want to show..
I'm having issues with redrawing the figure here. I allow the user to specify the units in the time scale (x-axis) and then I recalculate and call this function plots(). I want the plot to simply upda..
I 'm currently building a full background image layout and I want to change the image based on which page the user is visiting. To get to the point: I need to change a images attribute when the user c..
I've installed mongodb and have been able to run it, work with it, do simple DB read / write type stuff. Now I'm trying to set up my Mac to run mongod as a service.
I get "Command not found" in resp..
I am trying to create a basic authentication through the browser, but I can't really get there.
If this script won't be here the browser authentication will take over, but I want to tell the browser ..
I'm working on a map that has multiple markers on it.
These markers use a custom icon, but I'd also like to add numbers on top. I've seen how this has been accomplished using older versions of the AP..
The <video> tags autoplay="autoplay" attribute works fine in Safari.
When testing on an iPad, the video must be activated manually.
I thought it was a loading issue, so I ran a loop checking f..
I apologize, but this is kind of a two part question.
I'm extremely new to SQL and am trying to develop a time clock application for the small office that I work in. I'm playing around with the SQL b..
I am doing some penetration testing on my localhost with OWASP ZAP, and it keeps reporting this message:
The Anti-MIME-Sniffing header X-Content-Type-Options was not set to
'nosniff'
This c..
I have the following simple react code in my JSX file:
/** @jsx React.DOM */
var Hello = React.createClass({
render: function() {
return <div><img src='http://placehold.it/400x2..
I know that Java enums are compiled to classes with private constructors and a bunch of public static members. When comparing two members of a given enum, I've always used .equals(), e.g.
public useE..
Which is more correct way to return from function:
void function() {
// blah some code
}
OR
void function() {
// blah some code
return;
}
Rationale for second way:
It expresses develop..
I am trying to perform this AJAX post but for some reason I am getting a server 500 error. I can see it hit break points in the controller. So the problem seems to be on the callback. Anyone?
$.ajax(..
I have a directive that has its own controller. See the below code:
var popdown = angular.module('xModules',[]);
popdown.directive('popdown', function () {
var PopdownController = function ($sco..
I am writing a program in Bash that needs to get the user's username.
I have heard of a thing called whoami, but I have no idea what it does or how to use it.
What command do I use to get the curren..
In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.
How do I get a list of all files that were changed on the branch compared to what's on the trun..
I am just wondering, if I want to divide a by b, and am interested both in the result c and the remainder (e.g. say I have number of seconds and want to split that into minutes and seconds), what is t..
I'm trying to do do the following:
GetString(
inputString,
ref Client.WorkPhone)
private void GetString(string inValue, ref string outValue)
{
if (!string.IsNullOrEmpty(inValue))
{
..
I'm trying to create a ZIP archive with a simple demo text file using a MemoryStream as follows:
using (var memoryStream = new MemoryStream())
using (var archive = new ZipArchive(memoryStream , ZipAr..
Is typeof in C, really an operator?
I'm thinking because there is no polymorphism in C, that there is nothing to do at run-time. That is, the answer to typeof is known at compile-time. (I can't thin..
I would like to declare an enum Direction, that has a method that returns the opposite direction (the following is not syntactically correct, i.e, enums cannot be instantiated, but it illustrates my p..
I have two sets, A and B, of the same type.
I have to find if A contains any element from the set B.
What would be the best way to do that without iterating over the sets?
The Set library has contai..
I got an error with the following exception message:
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in
position 155: ordinal not in range(128)
Not sure what u'\ufeff' is, it shows..
I'd like to know what is the best practice/way of programmatically register a broadcast receiver. I want to register specific receivers according to user choice.
As the registration is done through t..
I'm trying to create a hello world project for Linux dynamic libraries (.so files). So I have a file hello.c:
#include <stdio.h>
void hello()
{
printf("Hello world!\n");
}
How do I create..
I am developing a website on a server I only have access to MySQL and FTP, so all commands I run are through the b374k php shell . I am experiencing a Laravel problem with SQL driver. I tried switchin..
I open terminal and enter the following commands
sudo mongod
which then outputs
[initandlisten] waiting for connections on port 27017
I open another terminal and enter
sudo mongo
which open t..
I'm using twitter bootstrap for some web app I'm forced to do (I'm not a web developer) and I can't find a way to disable the row lines for tables.
As you can see from the Bootstrap documentation, th..
How do I use a progress bar when my script is doing some task that is likely to take time?
For example, a function which takes some time to complete and returns True when done. How can I display a pr..
I want to kill all my hadoop jobs automatically when my code encounters an unhandled exception. I am wondering what is the best practice to do it?
Thanks..
Every time I have to iterate over a collection I end up checking for null, just before the iteration of the for-each loop starts. Like this:
if( list1 != null ){
for(Object obj : list1){
}
}..
I need a conversion utility/script that will convert a .sql dump file generated on Mac to one readable on Windows. This is a continuation of a problem I had here. The issue seems to be with newline ..
I can't seem to find how to print out the date of a file. I'm so far able to print out all the files in a directory, but I need to print out the dates with it.
I know I need to attach a date format ..
When I convert a factor to a numeric or integer, I get the underlying level codes, not the values as numbers.
f <- factor(sample(runif(5), 20, replace = TRUE))
## [1] 0.0248644019011408 0.0248644..
I use XPather Browser to check my XPATH expressions on an HTML page.
My end goal is to use these expressions in Selenium for the testing of my user interfaces.
I got an HTML file with a content simi..
I want to fade the images when I do this code:
$("#large-img").css('background-image', 'url('+$img+')');
I've tried putting fade in so many places.
Thanks..
I need to replace all digits.
My function only replaces the first digit.
var s = "04.07.2012";
alert(s.replace(new RegExp("[0-9]"), "X")); // returns "X4.07.2012"
..
I am looking to find the index of a given element, knowing its contents, in Java.
I tried the following example, which does not work:
class masi {
public static void main( String[] args ) {
..
Running the following code, I get an exception:
using (var client = new Pop3Client())
{
client.Connect(provider.ServerWithoutPort, provider.Port, true);
}
The Exception I get:
The remote certi..
I have the following list created from a sorted csv
list1 = sorted(csv1, key=operator.itemgetter(1))
I would actually like to sort the list by two criteria: first by the value in field 1 and then b..
I was reading the Twitter documentation at https://dev.twitter.com/overview/general/user-profile-images-and-banners and it clearly states that:
Alternative image sizes for user profile images You ..
I am looking for a way to determine what the Name/IP Address of the domain controller is for a given domain that a client computer is connected to.
At our company we have a lot of small little networ..
I'm curious if there is a way to paste text to the end of every line in Sublime 2? And conversely, to the beginning of every line.
test line one
test line two
test line three
test line four
...
..
How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that position. For example, x: 520px..
I am trying to access the MyCustomView from another class using the following code in ViewController.swift ..
var view = MyCustomView(frame: CGRectZero)
.. in the viewDidLoad method. The problem is..
I have two dictionaries. I need to find the difference between the two which should give me both key and value.
I have searched and found some addons/packages like datadiff, dictdiff-master but when ..
How can we shrink temp tablespace in oracle? And why it is increasing so much like upto 25 GB since there is only one schema in the database for the application and data table space size is 2 GB and i..
While working on a question/answer program for school, it occurred to me that I can use Console.Clear() to wipe out everything on the screen. I wonder if I can use Console.Readline(valueOne), then out..
I am looking for a text editor that will be able to load a 4+ Gigabyte file into it. Textpad doesn't work. I own a copy of it and have been to its support site, it just doesn't do it. Maybe I need ..
I am trying to use Console class to get input from user but a null object is returned when I call System.console(). Do I have to change anything before using System.console?
Console co=System.console..
I know the error message is common and there are plenty of questions on SO about this error, but no solutions have helped me so far, so I decided to ask the question. Difference to most of similar que..