I haven't seen anything here or on MDN. I'm sure I'm just missing something. There's got to be some documentation on this somewhere?
Functionally, it looks like it allows you to nest a variable insid..
I try to hash a string using SHA256, I'm using the following code:
using System;
using System.Security.Cryptography;
using System.Text;
public class Hash
{
public static string getHashSha256..
I am coding this with Groovy
I am currently trying to convert a string that I have to a date without having to do anything too tedious.
String theDate = "28/09/2010 16:02:43";
def newdate = new Da..
When I want to do a print command in Python and I need to use quotation marks, I don't know how to do it without closing the string.
For instance:
print " "a word that needs quotation marks" "
Bu..
How do I wrap long lines in Python without sacrificing indentation?
For example:
def fun():
print '{0} Here is a really long sentence with {1}'.format(3, 5)
Suppose this goes over the 79 cha..
I have the following string:
",'first string','more','even more'"
I want to transform this into an Array but obviously this is not valid due to the first comma. How can I remove the first comma fro..
The idea is to have a String read and to verify that it does not contain any numeric characters. So something like "smith23" would not be acceptable. ..
I am fetching the current date & time using NOW() in mysql. I want to convert the date value into a varchar and concat it with another string. How do I do it?..
I have this string:
My name is Marco and I'm from Italy
I'd like to split it, with delimiter is Marco and, so I should get an array with
My name at [0] and
I'm from Italy at [1].
How can I do i..
How do you replace a NULL value in the select with an empty string?
It doesnt look very professional to output "NULL" values.
This is very unusual and based on my syntax I would expect it to work.
Ho..
I have a comma-separated string that I want to convert into an array, so I can loop through it.
Is there anything built-in to do this?
For example, I have this string
var str = "January,February,..
I have a String with an unknown length that looks something like this
"dog, cat, bear, elephant, ..., giraffe"
What would be the optimal way to divide this string at the commas so each word could b..
Is it possible to convert an Uri to String and vice versa?
Because I want to get the the Uri converted into String to pass into another activity via intent.putextra() and if it's not possible can anyo..
The following fails with the error prog.cpp:5:13: error: invalid conversion from ‘char’ to ‘const char*’
int main()
{
char d = 'd';
std::string y("Hello worl");
y.append(d); // Line 5 -..
I have
@str = "<b>Hi</b>"
and in my erb view:
<%= @str %>
What will display on the page is: <b>Hi</b> when what I really want is Hi. What's the ruby way to "interpr..
For example I'm extracting a text String from a text file and I need those words to form an array. However, when I do all that some words end with comma (,) or a full stop (.) or even have brackets at..
Are they really same? Today, I ran into this problem. Here is the dump from the Immediate Window:
?s
"Category"
?tvi.Header
"Category"
?s == tvi.Header
false
?s.Equals(tvi.Header)
true
?s == ..
Possible Duplicate:
First split then join a subset of a string
I'm trying to split a string into an array, take first element out (use it) and then join the rest of the array into a seperat..
I would like to sort and binary search a static array of strings via the String.CompareTo comparator.
The problem is that both sorting, and binary searching requires that a Comparator object be passe..
I tried to search online to solve this question but I didn't found anything.
I wrote the following abstract code to explain what I'm asking:
String text = "how are you?";
String[] textArray= text.s..
I need to make a conditional that is true if a particular matching text is found at least once in a string of text, e.g.:
str = "This is some text containing the word tiger."
if string.match(str, "ti..
How can I get the nth character of a string? I tried bracket([]) accessor with no luck.
var string = "Hello, world!"
var firstChar = string[0] // Throws error
ERROR: 'subscript' is unavailable..
What's the difference between the text data type and the character varying (varchar) data types?
According to the documentation
If character varying is used without length specifier, the type acc..
I got this list:
words = ['how', 'much', 'is[br]', 'the', 'fish[br]', 'no', 'really']
What I would like is to replace [br] with some fantastic value similar to <br /> and thus getting..
On my team, we usually do string concatentation like this:
var url = // some dynamically generated URL
var sb = new StringBuffer();
sb.append("<a href='").append(url).append("'>click here</a..
I am extracting a character in a Javascript string with:
var first = str.charAt(0);
and I would like to check whether it is a letter. Strangely, it does not seem like such functionality exists in J..
I've been using the Split() method to split strings, but this only appears to work if you are splitting a string by a character. Is there a way to split a string, with another string being the split b..
I wrote the following in the strings.xml file:
<string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string>
I got the following error:
The reference to entity "Dr..
What is the most efficient way to remove the first 3 characters of a string?
For example:
'apple' change to 'le'
'a cat' change to 'at'
' a b c'change to 'b c'
..
This problem seems very simple, yet I just can not find the solution (I am already loosing my mind about it :) )
OK, so I just want to put a certain value into an excel cell, using vba code, just as ..
I would like to write a regular expression that starts with the string "wp" and ends with the string "php" to locate a file in a directory. How do I do it?
Example file: wp-comments-post.php..
Possible Duplicate:
How do I treat an ASCII string as unicode and unescape the escaped characters in it in python?
How do convert unicode escape sequences to unicode characters in a python stri..
How do I use a javascript regular expression to check a string that does not match certain words?
For example, I want a function that, when passed a string that contains either abc or def, returns fa..
How can I find given text within a string? After that, I'd like to create a new string between that and something else. For instance, if the string was:
This is an example string and my data is here
..
I have a string with line breaks in my database. I want to convert that string into an array, and for every new line, jump one index place in the array.
If the string is:
My text1
My text2
My text3
..
Text to Binary Code
I want JavaScript to translate text in a textarea into binary code.
For example, if a user types in "TEST" into the textarea, the value "01010100 01000101 01010011 0..
I am reading a book for Java that I am trying to learn, and I have a question. I can't understand what is the difference between the variable type char and String. For example, there is a difference b..
What is the difference between null and the "" (empty string)?
I have written some simple code:
String a = "";
String b = null;
System.out.println(a == b); // false
System.out.println(a.equals(b));..
Here is what I need to do.
Get Date, convert to string and pass it over to a third party utility.
The response from the library will have date in string format as I passed it. So, I need to convert..
I'm converting something from VB into C#. Having a problem with the syntax of this statement:
if ((searchResult.Properties["user"].Count > 0))
{
profile.User = System.Text.Encoding.UTF8.GetStr..
I have the following in my application controller:
def is_number?(object)
true if Float(object) rescue false
end
and the following condition in my controller:
if mystring.is_number?
end
The c..
I need a robust and simple way to remove illegal path and file characters from a simple string. I've used the below code but it doesn't seem to do anything, what am I missing?
using System;
using Sys..
I am trying to print the last part of a string before a certain character.
I'm not quite sure whether to use the string .split() method or string slicing or maybe something else.
Here is some ..
How do i simply write out a file including real tabs inside? tab means real tab which is not the spaces. How to write the tab or what is the character for real tab?
For example here:
$chunk = "a,b,c..
How can I extract a substring using PowerShell?
I have this string ...
"-----start-------Hello World------end-------"
I have to extract ...
Hello World
What is the best way to do that?..
I've seen similar questions here and here.
But am not getting how to left pad a String with Zero.
input: "129018"
output: "0000129018"
The total output length should be TEN...
How do I find multiple occurrences of a string within a string in Python? Consider this:
>>> text = "Allowed Hello Hollow"
>>> text.find("ll")
1
>>>
So the first occurre..
I have a small function I found that takes a string from a textarea and then puts it into a canvas element and wraps the text when the line gets too long. But it doesn't detect line breaks. This is wh..
Does the .NET String.Format method allow placement of a string at a fixed position within a fixed length string.
" String Goes Here"
" String Goes Here "
"String Goes Here ..
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 have a shopping cart that displays product options in a dropdown menu and if they select "yes", I want to make some other fields on the page visible.
The problem is that the shopping cart also inc..
I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.
Is there a function that can do this easily?
For example:
$string1 = "I am ..
I know the concept of a constants pool and the String constant pool used by JVMs to handle String literals. But I don't know which type of memory is used by the JVM to store String constant literals. ..
How do I write a function to split and return an array for a string with delimiters in the C programming language?
char* str = "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC";
str_split(str,',');
..
I have a string that looks like '%s in %s' and I want to know how to seperate the arguments so that they are two different %s. My mind coming from Java came up with this:
'%s in %s' % unicode(self.a..
I need to write some kind of loop that can count the frequency of each letter in a string.
For example: "aasjjikkk" would count 2 'a', 1 's', 2 'j', 1 'i', 3 'k'. Ultimately id like these to end up i..
I need to strip a specific word from a string.
But I find python strip method seems can't recognize an ordered word. The just strip off any characters passed to the parameter.
For example:
>>..
I'm trying to do something common enough: Parse user input in a shell script. If the user provided a valid integer, the script does one thing, and if not valid, it does something else. Trouble is, I h..
I know there are other topics on this but I can't seem to find out how to implement it.
I'm trying to limit a UITextField to only 5 Characters
Preferably Alphanumeric and - and . and _
I've see..
I have an excel sheet full of times.
They are formatted so that they look like: 1:00:15
However if I change the format on the cells to text, they change to the underlying numeric representation of t..
String.Format does not work in TypeScript.
Error:
The property 'format' does not exist on value of type
'{ prototype: String; fromCharCode(...codes: number[]): string;
(value?: any): string; new..
What's the simplest way to count the number of occurrences of a character in a string?
e.g. count the number of times 'a' appears in 'Mary had a little lamb'..
What is the best way to convert a String in the format 'January 2, 2010' to a Date in Java?
Ultimately, I want to break out the month, the day, and the year as integers so that I can use
Date date =..
I have the following method to save an Object to a file:
// Save an object out to the disk
public static void SerializeObject<T>(this T toSerialize, String filename)
{
XmlSerializer xmlSeri..
My understanding was that Python strings are immutable.
I tried the following code:
a = "Dog"
b = "eats"
c = "treats"
print a, b, c
# Dog eats treats
print a + " " + b + " " + c
# Dog eats treats
..
Is it possible to have the contain function find if the string contains 2 words or more?
This is what I'm trying to do:
string d = "You hit someone for 50 damage";
string a = "damage";
string b = "so..
This is what I have now - which looks too verbose for the work it is doing.
@title = tokens[Title].strip! || tokens[Title] if !tokens[Title].nil?
Assume tokens is a array obtained by splitti..
I have a string array:
String[] fruits = {"Apple","Mango","Peach","Banana","Orange","Grapes","Watermelon","Tomato"};
and i am getting random element from this by:
String random = (fruits[new Rando..
I was following this article
And I came up with this code:
string FileName = "C:\\test.txt";
using (StreamReader sr = new StreamReader(FileName, Encoding.Default))
{
string[] stringSeparators..
I have the following:
if (referrer.indexOf("Ral") == -1) { ... }
What I like to do is to make Ral case insensitive, so that it can be RAl, rAl, etc. and still match.
Is there a way to say that Ral..
Is there a way to parse strings as JSON in Typescript.
Example: In JS, we can use JSON.parse(). Is there a similar function in Typescript?
I have a JSON object string as follows:
{"name": "Bob", "er..
In the following code :
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
string x = "This is C++.";
ofstream of("d:/tester.txt");..
I have a dataframe in pandas with mixed int and str data columns. I want to concatenate first the columns within the dataframe. To do that I have to convert an int column to str.
I've tried to do as ..
I am using R to parse a list of strings in the form:
original_string <- "variable_name=variable_value"
First, I extract the variable name and value from the original string and convert the value..
In Perl I can repeat a character multiple times using the syntax:
$a = "a" x 10; // results in "aaaaaaaaaa"
Is there a simple way to accomplish this in Javascript? I can obviously use a function, b..
I would like to convert a python variable name into the string equivalent as shown. Any ideas how?
var = {}
print ??? # Would like to see 'var'
something_else = 3
print ??? # Would print 'something..
I think what I want to do is a fairly common task but I've found no reference on the web. I have text with punctuation, and I want a list of the words.
"Hey, you - what are you doing here!?"
shoul..
Is there a simple way to format a string in Go without printing the string?
I can do:
bar := "bar"
fmt.Printf("foo: %s", bar)
But I want the formatted string returned rather than printed so I can ..
Apparently, the following is the valid syntax:
my_string = b'The string'
I would like to know:
What does this b character in front of the string mean?
What are the effects of using it?
What are a..
I'm working on a project where all conversions from int to String are done like this:
int i = 5;
String strI = "" + i;
I'm not familiar with Java.
Is this usual practice or is something wrong, as..
How is it possible to initialize (with a C# initializer) a list of strings? I have tried with the example below but it's not working.
List<string> optionList = new List<string>
{
"Add..
I have multiple strings in different cells like
CO20: 20 YR CONVENTIONAL
FH30: 30 YR FHLMC
FHA31
I need to get the substring from 1 to till index of ':' or if that is not available till ending..
Do you know a fast and simple way to encode a Javascript Object into a string that I can pass via a GET Request?
No jQuery, no other frameworks - just plain Javascript :)..
I am using TypeScript with Express/Node.js.
For consuming modules, the TypeScript Handbook shows the following syntax:
import express = require('express');
But also the typescript.d.ts file shows:
..
I am getting the error:
HTTP Error 500.21 - Internal Server Error
Handler "CloudConnectHandler" has a bad module "ManagedPipelineHandler" in its module list
my web.config file looks like this:
<..
I am looking for a pattern that matches everything until the first occurrence of a specific character, say a ";" - a semicolon.
I wrote this:
/^(.*);/
But it actually matches everything (including..
I am looking for a way to get a list of all resource names from a given classpath directory, something like a method List<String> getResourceNames (String directoryName).
For example, given a c..
Is there a way to grab a list of attributes that exist on instances of a class?
class new_class():
def __init__(self, number):
self.multi = int(number) * 2
self.str = str(number)
..
Is there any difference (performance, best-practice, etc...) between putting a condition in the JOIN clause vs. the WHERE clause?
For example...
-- Condition in JOIN
SELECT *
FROM dbo.Customers AS C..
As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY.
Specifically, if I've got a purchases table that looks like this:
SELECT * FROM purchases;
My O..
I am trying to export the DataBase i have at MySQL Workbench but I am having troubles to generate the INSERT statements on the .sql file.
I order to export the data, I do the reverse engineering for ..
Possible Duplicate:
symbol(s) not found for architecture i386
I have an app to complete, and when I start trying to understand what the previous developer did (it was done with Xcode 3 I th..
Guys I'm currently using the POI 3.9 library to work with excel files. I know of the getLastRowNum() function, which returns a number of rows in an Excel file.
The only problem is getLastRowNum() ret..
How can i position a div to the bottom of the containing div?
<style>
.outside {
width: 200px;
height: 200px;
background-color: #EEE; /*to make it visible*/
}
.inside {
position..
I want to kill python interpeter - The intention is that all the python files that are running in this moment will stop (without any informantion about this files).
obviously the processes should be c..
I am developing a small Java EE Hibernate Spring application and an error appeared:
Error creating bean with name 'articleControleur': Injection of autowired dependencies failed;
oct. 26, 2011 3:51:4..
I need to build a web page for mobile devices. There's only one thing I still haven't figured out: how can I trigger a phone call through the click of text?
Is there a special URL I could enter like ..
When I run:
git status
I see this:
rebase in progress; onto 9c168a5
You are currently rebasing branch 'master' on '9c168a5'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit,..
I have an Angular 5 form application using all the usual models but on the forms I want the form to submit without having to physically click on the 'Submit' button.
I know it's normally as easy as a..
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..
When installing process of OpenERP 6, I want to generate a config file with this command,
cd /home/openerp/openerp-server/bin/
./openerp-server.py -s --stop-after-init -c /home/openerp/openerp-serve..
I am trying to move the page to a <div> element.
I have tried the next code to no avail:
document.getElementById("divFirst").style.visibility = 'visible';
document.getElementById("divFirst").s..
I am creating a header that once scrolled to a certain amount of pixels it fixes and stays in place.
Can I do this using just css and html or do i need jquery too?
I have created a demo so you can..
I'm using placeholders for text inputs which is working out just fine. But I'd like to use a placeholder for my selectboxes as well. Of course I can just use this code:
<select>
<option ..
I have this piece of code:
for element in json[referenceElement].keys():
When I run that code, I get this error:
TypeError: unhashable type: 'dict'
What is the cause of that error and what ca..
I am doing an online quiz application in PHP. I want to restrict the user from going back in an exam.
I have tried the following script, but it stops my timer.
What should I do?
The timer is stored in..
Can anyone tell me how to print line numbers including zero using awk?
Here is my input file stackfile2.txt
when I run the below awk command I get actual_output.txt
awk '{print NR,$0}' stackfil..
I like design patterns very much, but I find it difficult to see when I can apply one. I have read a lot of websites where design patterns are explained. I do understand the most of them, but I find i..
I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version.
I have done a git log ..
Do you think it is a good practice to commit .gitignore into a Git repo?
Some people don't like it, but I think it is good as you can track the file's history. Isn't it?..
I am stumped. I have a form with a dropdown list, and I would like to grab a list of all the values in the list. I pulled the below example from w3 schools (yes, I know it's unreliable, but other solu..
How do I extract the epoch value to Long from instances of LocalDateTime or LocalDate? I've tried
the following, but it gives me other results:
LocalDateTime time = LocalDateTime.parse("04.02.2014 ..
I have set up PHP, MySQL, and Apache. localhost() for PHP and it is working well. But after I downloaded MySQL, it reports:
Fatal error: Call to undefined function mysql_connect()
How can I fix ..
I've made a page for a client and I initially was working in Chrome and forgot to check if it was working in Firefox. Now, I have a big problem because the whole page is based upon a script that doesn..
I want to convert the first character of a string to Uppercase and the rest of the characters to lowercase. How can I do it?
Example:
String inputval="ABCb" OR "a123BC_DET" or "aBcd"
String output..
Mercurial has a way of printing the root directory (that contains .hg) via
hg root
Is there something equivalent in git to get the directory that contains the .git directory?..
In Linux I want to add a daemon that cannot be stopped and which monitors filesystem changes.
If any changes are detected, it should write the path to the console where it was started plus a newline.
..
I've finished my C# application, but I have a little problem:
When I try to run my application in another PC, I need always to Install .NET Framework 4.0.
Is there something to do to make it work wi..
I'm trying to use multiprocessing's Pool.map() function to divide out work simultaneously. When I use the following code, it works fine:
import multiprocessing
def f(x):
return x*x
def go():
..
I'm using Angular, TypeScript to send a file, along with JSON Data to a server.
Below is my code:
import {Component, View, NgFor, FORM_DIRECTIVES, FormBuilder, ControlGroup} from 'angular2/angular2'..
I am trying to download mongodb and I am following the steps on this link.
But when I get to the step:
sudo apt-get install -y mongodb-org
I get the following error:
Reading package lists... Done..
It looks as though Google has made offline speech recognition available from Google Now for third-party apps. It is being used by the app named Utter.
Has anyone seen any implementations of how to d..
I'm trying to figure out why I'm getting an error when using the sum function on a range.
Here is the code:
data1 = range(0, 1000, 3)
data2 = range(0, 1000, 5)
data3 = list(set(data1 + data2)) # mak..
I am just switching from Ant to Maven and am trying to figure out the best practice to set up a EAR file based Enterprise project?
Let's say I want to create a pretty standard project with a jar file..
I have just downloaded latest android studio from official android site and installed it. But I am getting this error instead of having Intel X 86 Emulator accelerator. What can cause this error
emul..
I'm trying to setup up MySQL on mac os 10.6 using Homebrew by brew install mysql 5.1.52.
Everything goes well and I am also successful with the mysql_install_db.
However when I try to connect to the ..
I use the following function to calculate log base 2 for integers:
public static int log2(int n){
if(n <= 0) throw new IllegalArgumentException();
return 31 - Integer.numberOfLeadingZeros(..
I'm very new to CodeIgniter and Active Record in particular, I know how to do this well in normal SQL but I'm trying to learn.
How can I select some data from one of my tables, and then count how man..
I am sure the configuration of matplotlib for python is correct since I have used it to plot some figures.
But today it just stop working for some reason. I tested it with really simple code like:
i..
I have a data service that looks like this:
@Injectable()
export class DataService {
baseUrl = 'http://localhost'
constructor(
private httpClient: HttpClient) {
}
get(url,..
I am creating an Android application where I have a ListView that displays all of the applications that were installed in my mobile phone.
My ListView is customized, it is contains a Icon, TextView a..
I want to remove square brackets from a string, but I don't know how.
String str = "[Chrissman-@1]";
str = replaceAll("\\[\\]", "");
String[] temp = str.split("-@");
System.out.println("Nickname: " ..
I did some research on this topic, and there are some experts who have said that it is not possible, so I would like to ask for an alternative solution.
My situation:
Page A: [checkout.php] Customer..
I am getting a lot of these warnings from 3rd party code that I cannot modify.
Is there a way to disable this warning or at least disable it for certain areas (like #pragma push/pop in VC++)?
Example..
I'm doing simple string input parsing and I am in need of a string tokenizer. I am new to C# but have programmed Java, and it seems natural that C# should have a string tokenizer. Does it? Where is it..
I'm hoping someone can enlighten me as to what could possibly be causing this error:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I cann..
I'm developing an application which displays images, and plays sounds from a database. I'm trying to decide whether or not to use a separate JFrame to add images to the database from the GUI.
I'm ju..
ASP.NET MVC can generate HTML elements using HTML Helpers, for example @Html.ActionLink(), @Html.BeginForm() and so on.
I know I can specify form attributes by creating an anonymous object and pass t..
I have looked around StackOverflow, but I cannot find a solution specific to my problem, which involves appending rows to an R data frame.
I am initializing an empty 2-column data frame, as follows.
..
I have a csv file, and I would like to sort it by column priority, like "order by". For example:
3;1;2
1;3;2
1;2;3
2;3;1
2;1;3
3;2;1
If this situation was the result of a "select", the "order by" w..
I would like to increase the RAM to at least 1 GB and I would like to configure “Host-Only” networking to use "199.188.44.20".
This is my Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
V..
I want to send a request to a server and process the returned value:
private static string Send(int id)
{
Task<HttpResponseMessage> responseTask = client.GetAsync("aaaaa");
string resul..
I've seen similar errors on SO, but I don't find a solution for my problem.
I have a SQL query like:
SELECT DISTINCT
a.maxa ,
b.mahuyen ,
a.tenxa ,
b.tenhuyen ,
..
I started to use Json.NET to convert a string in JSON format to object or viceversa. I am not sure in the Json.NET framework, is it possible to convert a string in JSON to XML format and viceversa?..
I am newbie in git and I am working on git.
I added some files in git :
git add <file1>
git add <file2>
then I wanted to push that for review, but mistakenly I did
git commit
so..
I am working on a learning how to execute SQL in python (I know SQL, not Python).
I have an external sql file. It creates and inserts data into three tables 'Zookeeper', 'Handles', 'Animal'.
Then I..
I want to find which stored procedure I've created and also I want to find which stored procedure I've modified in my SQL Server on a particular date like 27 september 2012 (27/09/2012).
Is there any..
How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can't find a good cross-browser solution.
Firefox stores the page zoom level for fu..
I'm trying to ask the user to enter numbers that are put into a vector,
then using a function call to count the numbers, why is this not
working? I am only able to count the first number.
template &..
I have a div with the following CSS
#mydiv{
top: 50px;
left: 50px;
width: 200px;
height: 200px;
}
and my HTML looks like this
<div id = "mydiv">
<img src = "folder/fil..
This question is asked many times in SO. But still I can't get stuff.
I want to get some value from callback. Look at the script below for clarification.
function foo(address){
// google map..
Possible Duplicate:
Detecting an undefined object property in JavaScript
javascript undefined compare
How we can add a check for an undefined variable, like:
function A(val) {
if (val ..
I am trying to write into a csv file row by row using C# language. Here is my function
string first = reader[0].ToString();
string second=image.ToString();
string csv = string.Format("{0},{1}\n", fir..
I'm reading the Laravel Blade documentation and I can't figure out how to assign variables inside a template for use later. I can't do {{ $old_section = "whatever" }} because that will echo "whatever"..
I just checked out a revision from Subversion to a new folder. Opened the solution and I get this when run:
Could not load file or assembly 'xxxx' or one of its dependencies. An attempt was made to ..
If I modify a submodule, can I push the commit back to the submodule origin, or would that require a clone?
If clone, can I store a clone inside another repository?..
In python, I am trying to replace a single backslash ("\") with a double backslash("\"). I have the following code:
directory = string.replace("C:\Users\Josh\Desktop\20130216", "\", "\\")
However, ..
I have a .net windows application that needs to run in full screen. When the application starts however the taskbar is shown on top of the main form and it only disappears when activating the form by ..
I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is sed for this tasks. Is there any useful native equivalent in windows?..
I'm using Jackson JSON library to convert some JSON objects to POJO classes on an android application. The problem is, the JSON objects might change and have new fields added while the application is ..
Possible Duplicate:
How do I convert a double into a string in C++?
I want to combine a string and a double and g++ is throwing this error:
main.cpp: In function ‘int main()’:
main.cpp..
This is a simple question from algorithms theory.
The difference between them is that in one case you count number of nodes and in other number of edges on the shortest path between root and concrete ..
Is there any real difference between using <strong> and <em> instead of the CSS properties:
font-weight: bold;
font-style: italic;
Also, what is really the reason that both options exis..
I am just trying to display a list from an array that I have in my arrays.xml. When I try to run it in the emulator, I get a force close message.
If I define the array in the java file
String[] te..
How can I change the size of only the yaxis label?
Right now, I change the size of all labels using
pylab.rc('font', family='serif', size=40)
but in my case, I would like to make the y-axis label l..
I have installed MS Visual Web Developer 2010 which includes IIS Express.
Before this, I had installed XAMPP server for my php applications.
I would like to know how can I stop IIS in order to be ab..
After reviewing an article Exception Handling in ASP.NET Web API I am a bit confused as to when to throw an exception vs return an error response. I am also left wondering whether it is possible to mo..
I knew boolean in mysql as tinyint (1).
Today I see a table with defined an integer like tinyint(2), and also others like int(4), int(6) ...
What does the size means in field of type integer and ti..
I am using git and working on master branch. This branch has a file called app.js.
I have an experiment branch in which I made a bunch of changes and tons of commits. Now I want to bring all the chan..
My questions are:
How do I change the overall colors (background and font)?
How do I change the colors based on the file type that is open?
Do I need to learn how to create a whole theme?
I read ..
Recently I noticed that when I am converting a list to set the order of elements is changed and is sorted by character.
Consider this example:
x=[1,2,20,6,210]
print x
# [1, 2, 20, 6, 210] # the or..
I recently converted a website project to a web application project in Visual Studio 2008. I finally got it to compile, and the first page (the login screen) displayed as normal, but then when it red..
I'm doing a basic thing in C# (MS VS2008) and have a question more about proper design than specific code.
I am creating a datatable and then trying to load the datatable from a datareader (which is ..
In the Windows command prompt, I can type notepad helloworld.cpp which will then create a .cpp file with the name helloworld and open up Notepad for me.
Is there a similar function for Mac Terminal, ..
I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?..
I'm trying to get a list of the names of all the files present in a directory using Node.js. I want output that is an array of filenames. How can I do this?..
What alternatives do I have to implement a union query using hibernate? I know hibernate does not support union queries at the moment, right now the only way I see to make a union is to use a view tab..
I want to create a table based on the definition of another table.
I'm coming from oracle and I'd normally do this:
CREATE TABLE schema.newtable AS SELECT * FROM schema.oldtable;
I can't seem to ..
I find myself using the current pattern quite often in my code nowadays
var dictionary = new Dictionary<type, IList<othertype>>();
// Add stuff to dictionary
var somethingElse = dictiona..
I am trying to define a border around a div tag in HTML. In some browsers the border does not appear.
Here is my HTML code:
_x000D_
_x000D_
<div id="divActivites" name="divActivites" style="bord..
I'm trying to replace html using innerHTML javascript.
From:
aaaaaa/cat/bbbbbb
To:
<a href="http://www.google.com/cat/world">Helloworld</a>
This's my code
<html>
<head>..
I'm rather new to both python/matplotlib and using it through the ipython notebook. I'm trying to add some annotation lines to an existing graph and I can't figure out how to render the lines on a gra..
I need to add custom headers to EVERY request coming from the WebView. I know loadURL has the parameter for extraHeaders, but those are only applied to the initial request. All subsequent requests d..
I just learned about Java's Scanner class and now I'm wondering how it compares/competes with the StringTokenizer and String.Split. I know that the StringTokenizer and String.Split only work on String..
Please am trying to implement a filter on my listview. But whenever the text change, the list disappears.Please Help
Here are my codes. The adapter class.
package com.talagbe.schymn;
import java.ut..
My application's main icon consists of two parts in one image: a logo and a few letters below it. This works well for the launcher icon for the app, but when the icon appears on the left edge of the A..
I want to use radio button in a form using Angular 2
Options : <br/>
1 : <input name="options" ng-control="options" type="radio" value="1" [(ng-model)]="model.options" ><br/>
2 ..
I am learning Python virtual environment. In one of my small projects I ran
pipenv run python myproject.py
and it created a virtualenv for me in C:\Users\USERNAME\.virtualenvs
I found it also created..
When passing a -D parameter in Java, what is the proper way of writing the command-line and then accessing it from code?
For example, I have tried writing something like this...
if (System.getPrope..
What is the difference between CROSS JOIN and INNER JOIN?
CROSS JOIN:
SELECT
Movies.CustomerID, Movies.Movie, Customers.Age,
Customers.Gender, Customers.[Education Level],
Customers.[..
I have a series of svg rectangles (using D3.js) and I want to display a message on mouseover, the message should be surrounded by a box that acts as background. They should both be perfectly aligned t..
I am trying to run rtsp url from the VLC player. But an error appears, and "see logs for details" comes up in a dialog box.
How can I enable logs in VLC?..
I simply want to do this with my KeyboardEvent
var tag = evt.target.tagName.toLowerCase();
While Event.target is of type EventTarget it does not inherit from Element. So I have to cast it like this..
So I have been searching for a while and cannot find the answer to a simple question. Is it possible to have an array of objects in PHP? Such as:
$ar=array();
$ar[]=$Obj1
$ar[]=$obj2
For so..
I need to select last two characters from the variable, whether it is digit or letters.
For example:
var member = "my name is Mate";
I would like to show last two letters from the string in..
I want to pass the B int array pointer into func function and be able to change it from there and then view the changes in main function
#include <stdio.h>
int func(int *B[10]){
}
int main(v..
How do I convert a byte[] to a string? Every time I attempt it, I get
System.Byte[]
instead of the value.
Also, how do I get the value in Hex instead of a decimal?..
I have a data frame with four fields. one of the field name is Status and i am trying to use a OR condition in .filter for a dataframe . I tried below queries but no luck.
df2 = df1.filter(("Status=2..
I would like to use an IPython notebook as a way to interactively analyze some genome charts I am making with Biopython's GenomeDiagram module. While there is extensive documentation on how to use mat..
What is a classy way to way truncate a python datetime object?
In this particular case, to the day. So basically setting hour, minute, seconds, and microseconds to 0.
I would like the output to als..
I have a problem with a Java application running under Linux.
When I launch the application, using the default maximum heap size (64 MB), I see using the tops application that 240 MB of virtual Memor..
I'm looking into Angular RxJs patterns and I don't understand the difference between a BehaviorSubject and an Observable.
From my understanding, a BehaviorSubject is a value that can change over time..
I'm trying to do a back to top button but to scroll down and up to a certain point on the page. For instance you have a long text and you want to bring the user to the next paragraph by simply having ..
A long time ago I have read an article (I believe a blog entry) which put me on the "right" track on naming objects: Be very very scrupulous about naming things in your program.
For example if my app..
I want to disable the back button for a website.
Whenever the person clicks on the browser back button it should not be able to go on the page the user visited before...
I am using the below code for replacing a string
inside a shell script.
echo $LINE | sed -e 's/12345678/"$replace"/g'
but it's getting replaced with $replace instead of the value of that variable.
..
I need to code the layout of the android widgets using dip/dp (in java files). At runtime if I code,
int pixel=this.getWindowManager().getDefaultDisplay().getWidth();
this return the screen width..
Regarding the Youtube API Blog they are experimenting with their new HTML5 Video Player.
Apparently to play a video in html5, you have to use the iframe embedding code :
<iframe class="youtube-pl..
Is it possible to filter an array using a single formula (without autofilter, VBA, or additional columns)?
For example, I have the following spreadsheet:
A | B | C
--------------------
1| I..
<a href="#">Alink</a>
All i need is while i hover the color should change for the link, But it should be completely using only inline CSS
*No Scripting or external CSS
Please he..
I am getting a little confused. I was reading the below from Java Database Connectivity:
Connection conn = DriverManager.getConnection(
"jdbc:somejdbcvendor:other data needed by some jdbc ve..
I have a div which I have attached an onclick event to. in this div there is a tag with a link. When I click the link the onclick event from the div is also triggered. How can i disable this so that ..
I want to change the class of a td tag given the td tag's id:
<td id="td_id" class="change_me"> ...
I want to be able to do this while inside the click event of some other dom object. How do..
An AngularJS application works fine on desktop, but is not rendering properly on mobile (actual code is showing). This is on an Android phone.
I would like to see what errors are showing in the conso..
I am trying to import a file which was saved using json.dumps and contains tweet coordinates:
{
"type": "Point",
"coordinates": [
-4.62352292,
55.44787441
]
}
My code ..
I have a script that does various things and the end result is one large table. I was wondering how I could export this final table to a new Excel file (with column headers as well).
I would need to ..
I've been trying to include a structure called "student" in a student.h file, but I'm not quite sure how to do it.
My student.h file code consists of entirely:
#include<string>
using namespace..
using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way):
convert -density 300 -depth 8 -qua..
I had the latest angular-cli installed globally and my project was building successfully.
While reading a suggested solution for another issue, (https://github.com/angular/angular-cli/issues/917) I..
I'm trying to use a List<T> with a custom class of mine, and being able to use methods like Contains(), Find(), etc., on the list. I thought I'd just have to overload the operator == but apparen..
In Excel 2007, how do I add a description and parameter hints to a user-defined function? When I start typing a function invocation for a built-in function, Excel shows a description and parameter lis..
What is the best way to make a series of scatter plots using matplotlib from a pandas dataframe in Python?
For example, if I have a dataframe df that has some columns of interest, I find myself typi..
I need multiple cases in switch statement in JavaScript, Something like:
switch (varName)
{
case "afshin", "saeed", "larry":
alert('Hey');
break;
def..
I'm developing an OAuth authentication flow purely in JavaScript and I want to show the user the "grant access" window in a popup, but it gets blocked.
How can I prevent pop up windows created by eit..
I have a data.frame containing some columns with all NA values, how can I delete them from the data.frame.
Can I use the function
na.omit(...)
specifying some additional arguments?..
I'm currently doing some evaluation on the Jenkins Pipeline plugin (formerly know as Workflow plugin).
Reading the documentation I found out that I currently cannot retriev the workspace path using
en..
I cannot log with Morgan. It doesn't log info to console. The documentation doesn't tell how to use it.
I want to see what a variable is. This is a code from response.js file of expressjs framework:
..
When I'm using a rooted Android device as ADB host to send adb command "adb devices" to Samsung S4, I received device unauthorized error message. However when I tried adb to Samsung Galaxy Nexus, it i..
How can I continuously capture images from a webcam?
I want to experiment with object recognition (by maybe using java media framework).
I was thinking of creating two threads
one thread:
Node 1..
I'm working on an iPad-based web app, and need to prevent overscrolling so that it seems less like a web page. I'm currently using this to freeze the viewport and disable overscroll:
document.body.ad..
Can anybody tell me details about the hs_err_pid.log file generated when Tomcat crashes?
Are any specific settings required on the Java tab of Tomcat configuration tool in order to generate a hs_err_..
I need to set the time on the current date. The time string is always in 24 hour format but the result I get is wrong:
SimpleDateFormat df = new SimpleDateFormat("kk:mm");
Date d1 = df.parse("10:..
I am getting the following error
ERROR 2013 (HY000): Lost connection to MySQL server at
'reading authorization packet', system error: 0
when trying to connect to my MySQL server.
What I am doing..
As the title says, is this possible?
I want to "mirror" my actions on the iPhone so it shows on the computer monitor.
We've seen this on the Apple key notes, but I am not sure if this feature is publ..
Is that possible to invoke a javascript function in success of datatable ajax call.
Here is the code am trying to use,
var oTable = $('#app-config').dataTable(
{
"bAutoWid..
If I have such string in XAML:
Storyboard.TargetProperty="Margin" From="1,2,3,4" To="0,0,0,0"
What is Top Bottom Right and Left?
1- right
2- top
3- left
4 - bottom
Is that right?..
If I have a URL that, when submitted in a web browser, pops up a dialog box to save a zip file, how would I go about catching and downloading this zip file in Python?..
I made a usercontrol in my project, and after building project, I need to put it in my toolbox, and use it as a common control. but i can't. the UserControl is in my project namespace, and I tried Cho..
I've been stuck on this for the last few hours. I got it working by hacking a few lines in /lib/Varien/Data/Collection/Db.php, but I'd rather use the proper solution and leave my core untouched.
All ..
Can I use a <video> or <audio> tag to play a playlist, and to control them?
My goal is to know when a video/song has finished to play and take the next and change its volume...
Is there a good way of differentiating between row and column vectors in python? So far I'm using numpy and scipy and what I see so far is that If I was to give one a vector, say
from numpy import *
..
I have the following function that I doesn't work so far. I would like to ping an IP address and then to echo whether the IP is alive or not.
function pingAddress($ip){
$pingresult = shell_exec("..
The XMLHttpRequest Level 2 standard (still a working draft) defines the FormData interface. This interface enables appending File objects to XHR-requests (Ajax-requests).
Btw, this is a new feature -..
I need to choose some elements from the given list, knowing their index. Let say I would like to create a new list, which contains element with index 1, 2, 5, from given list [-2, 1, 5, 3, 8, 5, 6]. W..
In PHP there a function called isset() to check if something (like an array index) exists and has a value. How about Python?
I need to use this on arrays because I get "IndexError: list index out of ..
This question is linked to Searching for Unicode characters in Python
I read unicode text file using python codecs
codecs.open('story.txt', 'rb', 'utf-8-sig')
And was trying to search strings in ..
I to want convert PDF pages into an image (PNG,JPEG/JPG or GIF). I want them in full-page sizes.
How can this be done using Java? What libraries are available for achieving this? ..
Say I have a python project that is structured as follows:
project
/data
test.csv
/package
__init__.py
module.py
main.py
__init__.py:
from .module import test
..
I'm using the JDBC template and want to read from a database using prepared statements. I iterate over many lines in a .csv file, and on every line I execute some SQL select queries with corresponding..
I'm trying to get self sizing UICollectionViewCells working with Auto Layout, but I can't seem to get the cells to size themselves to the content. I'm having trouble understanding how the cell's size ..
I am extremely new to MySQL and am running it on Windows. I am trying to restore a Database from a dumpfile in MySQL, but I get the following error:
$ >mysql -u root -p -h localhost -D database -..
I'm trying to run the following code in R, but I'm getting an error.
I'm not sure what part of the formula is incorrect. Any help would be greatly appreciated.
> censusdata_20$AGB93 = WD * exp(-1..
I am currently working on a slide with an animation of sunrise to sunset as a background.
Then there are some pictures fade in and fade out.
Now, I am having difficult to loop the series of animation..
So how can I only allow a user to select only one checkbox?
I know radio buttons are "ideal", but for my purpose...it's not.
I have a field where users need to select either or of the two options, b..
I started a new Spring boot project, I want to change the port number and I read that I have to modify the /resource/application.properties to do so.
I cannot locate this file however, did I miss so..
I have a question about LINQ query. Normally a query returns a IEnumerable<T> type. If the return is empty, not sure if it is null or not. I am not sure if the following ToList() will throw an e..
I have a variable "x" in my view. I need to display some code "x" number of times.
I basically want to set up a loop like this:
for i = 1 to x
do something on (i)
end
Is there a way to do this?..