I have been trying from a couple of days to resolve the following error but I am unable to resolve it :(
My module's pom.xml file is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xs..
What response code should be passed to client in case of following scenarios?
Invalid data passed while user registration like wrong email format
User name/ Email is already exists
I chose 403. I ..
if(isset($_POST['submit'])) {
if(!isset($_POST['userName'])) {
$username = 'Anonymous';
}
else $username = $_POST['userName'];
}
I cannot get the $username to be "Anonymous..
while maintaining my colleague's code from even someone who claims to be a senior developer, I often see the following code:
try
{
//do something
}
catch
{
//Do nothing
}
or sometimes they write ..
I checked in a project on one computer, checked out on another, and find that the binaries installed by NuGet are missing. I could check them in to source control as well, but it looks like there's a..
I want to change the image from normal to brighter when it's on hover, My code:
<div class="nkhome">
<a href="Home.html"><img src="Images/btnhome.png" /></a>
&..
How can I access a JSON file in ECMAScript 6?
The following doesn't work:
import config from '../config.json'
This works fine if I try to import a JavaScript file...
According to this page http://kangax.github.io/compat-table/es6/, ES6 features are not implemented in IE 11.
Does IE 11 have a plan for implementing them one day or can I forget about it?
Is there a..
Due to a plugin being used, I can't add the "onClick" attribute to the HTML form inputs like usual.
A plugin is handling the forms part in my site and it doesn't give an option to do this automaticall..
I have got downloaded a file that got downloaded in a format .pynb.txt extension. Can anyone help me to figure how to make it in a readable format?
Attaching a screenshot of the file when i tried open..
consider the following scenario: I have a storyboard-based app. I add a ViewController object to the storyboard, add the class files for this ViewController into the project and specify the name of th..
I cannot see a app.config file generated for a class library by the VS2008 wizard. In my research I found that in an application only one app.config exists.
Is it a bad thing to add an app.config ma..
Following on from my last question (Table Variables in Oracle PL/SQL?)...
Once you have values in an array/table, how do you get them back out again? Preferably using a select statement or something..
I am using Datagrip for Postgresql. I have a table with a date field in timestamp format (ex: 2016-11-01 00:00:00). I want to be able to:
apply a mathematical operator to subtract 1 day
filter it..
How do I get the difference in days between 2 dates in SQLite? I have already tried something like this:
SELECT Date('now') - DateCreated FROM Payment
It returns 0 every time...
I have created a JAR file in this way jar cf jar-file input-files. Now, I'm trying to run it. Running it does not work (jre command is not found):
jre -cp app.jar MainClass
This does not work eithe..
I want to convert a DateTime instance into a TimeSpan instance, is it possible?
I've looked around but I couldn't find what I want, I only find time difference. More specifically, I want to convert ..
I'm trying to build GNU grep, and when I run make, I get:
[snip]
/bin/bash: line 9: makeinfo: command not found
What is makeinfo, and how do I get it?
(This is Ubuntu, if it makes a difference)..
I just finished an app on iOS 6 and bought a developer account a week ago so haven't had much time playing with the iOS 7 SDK. Just downloaded the Golden Master version and trying to upgrade my app to..
I am trying to sort an array of Strings using compareTo(). This is my code:
static String Array[] = {" Hello ", " This ", "is ", "Sorting ", "Example"};
String temp;
public static void main(String[]..
I am trying to resize an img with a percentage of itself. For example, I just want to shrink the image by half by resizing it to 50%. But applying width: 50%; will resize the image to be 50% of the co..
Before, in an older version of express, I could do this:
express.createServer({key:'keyFile', cert:'certFile'});
However, in newer versions of express this no longer works:
var app = express();
..
For example if I have this:
n = c(2, 3, 5)
s = c("aa", "bb", "cc")
b = c(TRUE, FALSE, TRUE)
df = data.frame(n, s, b)
n s b
1 2 aa TRUE
2 3 bb FALSE
3 5 cc TRUE
Then how do I combine th..
When writing an Angular directive, one can use any of the following functions to manipulate the DOM behaviour, contents and look of the element on which the directive is declared:
compile
controller
..
I would like to use the .replace function to replace multiple strings.
I currently have
string.replace("condition1", "")
but would like to have something like
string.replace("condition1", "").r..
I have a large image and I want to make certain sections of the image clickable. I also want to specify the shape of the clickable area (square, circle, custom). Without relying on Javascript, how c..
When I go to mydomain.com:8080 there is no authorization mechanism by default. I have had look at the configuration area but cannot find anywhere to add a basic username and password..
Is there a way to execute JavaScript and display the results using Visual Studio Code?
For example, a script file containing:
console.log('hello world');
I assume that Node.js would be needed but ..
I want something like
0x2022 8226 BULLET •
But bigger.
I can't even seem to find them at http://www.ssec.wisc.edu/~tomw/java/unicode.html
What should I search for? Dots? bullets?..
When I set firstThing to default nil this will work, without the default value of nil I get a error that there is a missing parameter when calling the function.
By typing Int? I thought it made it op..
How do i write an SQL query to count the total number of a specific num value in the num column of a table.
e.g. select where num = 1
result: 2
+-----+-----+
| NAME | NUM |
+=====+=====+
| SAM | ..
How are \r and \n different? I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure exactly how they're different, and which to search for/match in regexes...
I have just switched from a MAMP installation to a native Apache, MySql and PHP installation. I have got everything working, but I have started using my web app in the new environment and suddenly any..
I want to write a program that checks for the existence of a directory; if that directory does not exist then it creates the directory and a log file inside of it, but if the directory already exists,..
Im playing around with the soundcloud api, in its instructions it says to
drag SoundCloudAPI.xcodeproj into your project
add it as a build dependency
I can drag the project in pretty easily, but h..
When I run perl, I get the warning:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"..
I recently downloaded JDK 1.8.0.0_06 that comes bundled with NetBeans. I then got to find out that my JavaFx project, that I have been developing in Java 1.7 won't compile in Java 1.8, and so I steppe..
I'm making an activity to configure my app, and I have to divide the sections of my configuration window with a line. I used this: divider_horizontal_bright, from this example:
http://android.cryx.li..
I'm trying to add input fields dynamically while the user clicks the add button and for each form field there must be a remove button, when the user clicks that the form fields must be removed, I need..
I need my script to send an email from terminal. Based on what I've seen here and many other places online, I formatted it like this:
/var/mail -s "$SUBJECT" "$EMAIL" << EOF
Here's a line of my..
Solution can use jQuery or be plain JavaScript.
I want to remove a table row after user has clicked the corresponding button contained in the table row cell so for example:
<script>
function S..
Let's say I've got a simple class in python
class Wharrgarbl(object):
def __init__(self, a, b, c, sum, version='old'):
self.a = a
self.b = b
self.c = c
self.sum = ..
I want to read the onClick event value properties. But when I click on it, I see something like this on the console:
SyntheticMouseEvent {dispatchConfig: Object, dispatchMarker: ".1.1.0.2.0.0:1", na..
I'm trying to create a <div> with a series of photos which are horizontally scrollable only.
It should look something like this LINK;
However the above is only achieved by specifying a width..
Is there an easy way to create a multiline string literal in C#?
Here's what I have now:
string query = "SELECT foo, bar"
+ " FROM table"
+ " WHERE id = 42";
I know PHP has
<<<BLOCK
BLO..
I'm receiving an unhandled exception while debugging, and the program stops executing. The debugger doesn't show me the line so I don't know what to fix.
An unhandled exception of type 'System.Agg..
I have a python list with strings in this format:
A1 = [' "29.0" ',' "65.2" ',' "75.2" ']
How do I convert those strings into decimal numbers to perform arithmetic operations on the list elements?..
I have a string called CurrentString and is in the form of something like this
"Fruit: they taste good". I would like to split up the CurrentString using the : as the delimiter.So that way the word "..
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 want to write a query like this:
SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice)
FROM Order o
But this isn't how the MAX function works, right? It is an aggregate function so it expec..
Is there any simple way of generating (and checking) MD5 checksums of a list of files in Python? (I have a small program I'm working on, and I'd like to confirm the checksums of the files)...
How do I reference the row number of an observation? For example, if you have a data.frame called "data" and want to create a variable data$rownumber equal to each observation's row number, how would ..
I am looking to do some error checking for my command line arguments
public static void main(String[] args)
{
if(args[0] == null)
{
System.out.println("Proper Usage is: java program f..
I have a JS code in which when you change a field it calls a search routine. The problem is that I can't find any jQuery events that will fire when the Datepicker updates the input field.
For some re..
I am trying to find first highest number and second highest number in excel. What shall i do for that. I did not find the right formula.
Note: I have already used the large and max formula.
=LARGE(E..
I am trying to get a small box to appear on the bottom-left side of an image when a mouse moves over it. Inside the box there will be a link to a different page.
Here is somewhat similar to what I wa..
I would like to draw a standard 2D line graph with pylot, but force the axes' values to be between 0 and 600 on the x, and 10k and 20k on the y. Let me go with an example...
import pylab as p
p.tit..
I would like to ask if there are examples out there on how to implement radio-button options on an iPhone app.
I find the Picker View quite big for a simple selection feature.
I'm not sure if Apple ..
I have a thread which wait for a boolean value to change like this:
while(!value)
{
Thread.sleep(1000)
}
// Do some work after change of the value
This is not my prefered way to do this, cause of..
In C:
I'm trying to get char from the user with scanf and when I run it the program don't wait for the user to type anything...
This is the code:
char ch;
printf("Enter one char");
scanf("%c", &..
I have following html:
<div id="note">
<textarea id="textid" class="textclass">Text</textarea>
</div>
How can I get textarea element? I can't use document.getElementById("te..
I have always been trying to avoid using most of the HTTP protocol's properties for the sake of fear of the unknown.
However, I said to myself that I'm going to face fear today and start using header..
In my site host, I have seen (via phpinfo) that
post_max_size = 8Mb
upload_max_filesize = 16Mb
This led me to think that I should be able to upload as file as big as 16Mb.
However, when I do this..
Is there a shorthand way to assign a variable to something if it doesn't exist in PHP?
if(!isset($var) {
$var = "";
}
I'd like to do something like
$var = $var | "";
..
I use html5 canvas elements to resize images im my browser. It turns out that the quality is very low. I found this: Disable Interpolation when Scaling a <canvas> but it does not help to increas..
A colleague once told me that the last option when everything has failed to debug on Linux was to use strace.
I tried to learn the science behind this strange tool, but I am not a system admin guru a..
I am often confused with the concept of virtualization in operating systems. Considering RAM as the physical memory, why do we need the virtual memory for executing a process?
Where does this virtual..
How do I perform an IF...THEN in an SQL SELECT statement?
For example:
SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
..
I've recently noticed something interesting when looking at Python 3.3 grammar specification:
funcdef: 'def' NAME parameters ['->' test] ':' suite
The optional 'arrow' block was absent in Python..
In my ~/.gitconfig, I list my personal email address under [user], since that's what I want to use for Github repos.
But, I've recently started using git for work, too. My company's git repo allows m..
I have just found out that my script gives me a fatal error:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 440 bytes) in C:\process_txt.php on line 109
That line ..
Can anyone tell me why my redirect helper does not work the way I'd expect it to? I'm trying to redirect to the index method of my main controller, but it takes me www.mysite.com/index/provider1/ when..
This is a bit of my JS code for which this is needed:
var secDiff = Math.abs(Math.round((utc_date-this.premiere_date)/1000));
this.years = this.calculateUnit(secDiff,(86400*365));
this.days = this.ca..
I am doing a find and then getting a list of files. How do I pipe it to another utility like cat (so that cat displays the contents of all those files) and basically need to grep something from these ..
I have a list of objects. How do I grab the name of just one object from the list? As in:
LIST <- list(A=1:5, B=1:10)
LIST$A
some.way.cool.function(LIST$A) #function I hope exists
"A" #yay! it..
Impressed by is-latex-worth-learning-today, and many how-to's on Windows,
How do you have someone started with LaTeX on Linux?
How do you generate a pdf out of it and give up the OOO Word processer?..
How can I loop through a List and grab each item?
I want the output to look like this:
Console.WriteLine("amount is {0}, and type is {1}", myMoney.amount, myMoney.type);
Here is my code:
static ..
I'm refactoring an old site, and that maze is full of tables.
We're moving to HTML5 and I need to fix a table full of
<td align="center">
code.
I found a partial solution by creating a class..
I generate some images using a PHP lib.
Sometimes the browser does not load the new generated file.
How can I disable cache just for images created dynamically by me?
Note: I have to use same name..
I have looked through all of the forums that I could find relevant to this question and my problem yet nothing works. I have apache2.2 with php5, phpMyAdmin, and MySQL. I have uncommented the extensio..
Can jQuery provide a fallback for failed AJAX calls? This is my try:
function update() {
var requestOK = false;
$.getJSON(url, function(){
alert('request successful');
reques..
I am running this DB call to get me multi-dimensional array
I am trying to get the keys of each but when I try it comes up blank or as array.
$root_array = array();
$sites = $this->sites($membe..
I want to copy files from one directory to another (subdirectory) using Java. I have a directory, dir, with text files. I iterate over the first 20 files in dir, and want to copy them to another direc..
Is there a way to reset all (or just disable the security settings) from the command line without a user/password as I have managed to completely lock myself out of Jenkins?..
I need to set image source dynamically, please note my image is in somewhere on the Network, here is my code
BitmapImage logo = new BitmapImage();
logo.BeginInit();
logo.UriSource = new Uri(@"pack://..
I have three stored procedures Sp1, Sp2 and Sp3.
The first one (Sp1) will execute the second one (Sp2) and save returned data into @tempTB1 and the second one will execute the third one (Sp3) and sav..
I'm integrating with an existing servlet that pulls some properties out of the HTTP header. Basically, I'm implementing an interface that doesn't have access to the actual request, it just has access..
There are plenty of JavaScript-based libraries that show tooltips when you hover your mouse over a certain area of a web page. Some are rather plain, some allow the tooltip to display HTML content sty..
I am trying to learn assembly language. I have searched and found how to disassemble a .c file but I think it produces some optimized version of the program. Is there any way so that I can see the exa..
how can I execute a shell command in the background from within a bash script, if the command is in a string?
For example:
#!/bin/bash
cmd="nohup mycommand";
other_cmd="nohup othercommand";
"$cmd &..
My question is a simple one, and it is about regular expression escaping. Do you have to escape a forward slash / in a regular expression? And how would you go about doing it?..
I'm trying to execute the following code in R
comments = c("no","yes",NA)
for (l in 1:length(comments)) {
if (comments[l] != NA) print(comments[l]);
}
But I'm getting an error
Error in if (com..
I am making an Order model for a shopping cart and I need to make a field that auto increments when the order is made:
class Order(models.Model):
cart = models.ForeignKey(Cart)
add_date = mod..
I'm thinking of having different color of text in one line. How could that be possible?
<p style="color:#4C4C4C;font-weight:bold;font-family:Calibri;font-size:20"> My Name is:
<"color:#FF..
I have this code:
Dim wsFunc As WorksheetFunction: Set wsFunc = Application.WorksheetFunction
Dim ws As Worksheet: Set ws = Sheets("2012")
Dim rngLook As Range: Set rngLook = ws.Range("A:M")
'within..
I want to install Visual Studio Ultimate 2013 on my Windows 10 but I have this error:
I have done these two things (they have solved the problem on Windows 8)
but still I cannot install it. ..
I'm trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I'm getting an error "Couldn't resolve host" wit..
I have a string that looks like this:
$str = "bla_string_bla_bla_bla";
How can I remove the first bla_; but only if it's found at the beginning of the string?
With str_replace(), it removes all bl..
I have two functions, one which produces messages like Starting initialization... and another which checks return codes and outputs "Ok", "Warning" or "Error". However, t..
I'm trying to make a simple web app in IntelliJ by following this tutorial:
http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_for_Tomcat_in_IntelliJ_IDEA_12
I believe my Tomcat is ..
I have question, that maybe someone here wouldn't mind to help me with. I have lets say 3 datatables, each one of them has the following columns:
size, quantity, amount, duration
Name of datatables an..
IE seems to ignore the height set in CSS when rendering a HTML SELECT. Are there any work around's for this or do we have to just accept IE will not look as good as other browsers?..
I followed the instructions here to run Django using the built-in webserver and was able to successfully run it using python manage.py runserver. If I access 127.0.0.1:port locally from the webserver..
I am working with the Exchange Web Services Managed API, with contact data. I have the following code, which is functional, but not ideal:
foreach (Contact c in contactList)
{
string openItemUrl ..
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..
Possible Duplicate:
How to horizontally center a div?
One simple way to make an object centered in HTML is using align='center', but it's not working for a div.
I tried:
style='text-alig..
I had developed a PhoneGap app which is now being transformed to a mobile website. Everything works smoothly besides one small glitch. I use a certain third party API via a POST request, which works f..
I've been banging my head against the wall for hours trying to figure out this issue and think it must be something small I'm missing. I've searched online, but nothing I have found seems to work. T..
I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\temp\fet..
Consider the URL:
https://foo:password@example.com
Does the username/password portion in the above example qualify as a "URL parameter", as defined in this question?..
I am using Jake's ViewPageIndicator and want to display Images like a swipe gallery.
Any refernce link where i can get started. I have implemented the basic viewpager and now want to implement image v..
Using spring, with this code :
List<HttpMessageConverter<?>> messageConverters = restTemplate.getMessageConverters();
for(HttpMessageConverter httpMessageConverter : messageConverters){
..
I just wasted one morning trying to get SQL developer to work on my current setup:
OS: Windows 8.1 virtual machine running on mac via Parallels.
No oracle client or instant client installed
No Java i..
I'm trying to figure out how to traverse a generic list of items that I want to remove from another list of items.
So let's say I have this as a hypothetical example
List<car> list1 = GetTheLi..
This has probably been answered else where but how do you get the character value of an int value?
Specifically I'm reading a from a tcp stream and the readers .read() method returns an int.
How do ..
How do I create a namespace in JavaScript so that my objects and functions aren't overwritten by other same-named objects and functions? I've used the following:
if (Foo == null || typeof(Foo) != "ob..
I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping ..
In PHP I can do the following:
$name = 'John';
$var = "Hello {$name}"; // => Hello John
Is there a similar language construct in C#?
I know there is String.Format(); but I want to know if it..
I have Hudson as continuous integration server and I want to use option 'Publish JUnit test result report'. But I don't use xUnit tools for testing, instead of that i have shell scripts which run test..
I would like to use ansible-playbook command instead of 'vagrant provision'. However setting host_key_checking=false in the hosts file does not seem to work.
# hosts file
vagrant ansible_ssh_private..
I have a simple issue -- I would like to check a field to see if it's an integer if it is not blank. I'm not using any additional plugins, just jQuery. My code is as follows:
if($('#Field').val() != ..
I have floated images and inset boxes at the top of a container using float:right (or left) many times. Recently I hit a need to float a div at the bottom right corner of another div with the normal t..
Using Google Test 1.6 (Windows 7, Visual Studio C++). How can I turn off a given test? (aka how can I prevent a test from running). Is there anything I can do besides commenting out the whole test?..
I need to open my database through PHP. But I need to know my username and the name of my host (e.g. localhost), and I don't know them.
When I used mysql and did my database, it just asked me directly..
I'm trying to start serving some static web pages using connect like this:
var connect = require("connect");
var nowjs = require("now");
var io = require("socket.io");
var app = connect.createServe..
I have this parameters to download a XML file:
wget --http-user=user --http-password=pass http://www.example.com/file.xml
How I have to use that in php to open this xml file?..
I'm trying to setup a Amazon Linux AMI(ami-f0091d91) and have a script that runs a copy command to copy from a S3 bucket.
aws --debug s3 cp s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.noar..
What are the differences between multidimensional arrays double[,] and array-of-arrays double[][] in C#?
If there is a difference, what is the best use for each one?..
I'm looking for a way to automatically "click" an item when the page loads.
I've tried using
$("document").ready(function() {
$("ul.galleria li:first-child img").trigger('click');
});
but it ..
My code is:
import scriptlib.abc
import scriptlib.xyz
def foo():
... some operations
but the scriptlib is in some other directory, so I will have to include that directory in environment variabl..
I have a situation in which I need to re-attach detached objects to a hibernate session, although an object of the same identity MAY already exist in the session, which will cause errors.
Right now, ..
I have a popup list which is a div that contains a vertical list of child divs. I have added up/down keyboard navigation to change which child is currently highlighted.
Right now, if I press the dow..
A recurring Excel problem I have is formulas such as INDEX(array,row,column) that return 0 when there's no result, rather than returning blank.
What is the best way to change the zero result to blank..
I seem to remember that in PHP there is a way to pass an array as a list of arguments for a function, dereferencing the array into the standard func($arg1, $arg2) manner. But now I'm lost on how to d..
In Python, how to check if a string only contains certain characters?
I need to check a string containing only a..z, 0..9, and . (period) and no other character.
I could iterate over each character ..
I use the following command:
mysql -u root -h 127.0.0.1 -p
and the error message is :
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
Who can help me to fix it?..
I read once that git commit messages should be in the imperative present tense, e.g. "Add tests for x". I always find myself using the past tense, e.g. "Added tests for x" though, which feels a lot mo..
I want to deny direct access to all .php files except one: index.php
The only access to the other .php files should be through php include.
If possible I want all files in the same folder.
UPDATE:
..
I'm using xampp portable server and I'm having some trouble with Apache http server, it says "ServerRoot must be a valid directory"
Command line output:
Please close this command only for Shutdown
A..
When I'm debugging in Python using IPython, I sometimes hit a break-point and I want to examine a variable that is currently a generator. The simplest way I can think of doing this is converting it to..
I am using a Bootstrap modal for users to choose product options before adding an item to their cart. I've used them before in this scenario with no issues but this one isn't closing as expected.
Wh..
We have the following string which is a valid JSON written to a file on HDFS.
{
"id":"tag:search.twitter.com,2005:564407444843950080",
"objectType":"activity",
"actor":{
"objectType":"..
This
STR="Hello\nWorld"
echo $STR
produces as output
Hello\nWorld
instead of
Hello
World
What should I do to have a newline in a string?
Note: This question is not about echo.
I'm aware of e..
The ObjectiveC.swift file from the standard library contains the following few lines of code around line 228:
extension NSObject : Equatable, Hashable {
/// ...
open var hashValue: Int {
retu..
I used the following code to draw a scatterplot. How to increase the font size and change colour of x-axis and y-axis label?
data=read.csv("data.csv")
plot(data$column1,data$column2,xlab="x axis", ..
I have a C program that aims to be run in parallel on several processors. I need to be able to record the execution time (which could be anywhere from 1 second to several minutes). I have searched for..
Edit: I've added the source for the example.
I came across this example:
char source[MAX] = "123456789";
char source1[MAX] = "123456789";
char destination[MAX] = "abcdefg";
char destination1[MAX] = ..
I am having an issue in setting up a one to many relationship in my annotated object.
I have the following:
@MappedSuperclass
public abstract class MappedModel
{
@Id
@GeneratedValue(strategy..
I have a part of HTML source file that contains strings that I want to select and copy at once, using the regex functionality of Notepad++.
Here is a part of the text source:
<option value="Perfo..
simplified version of my query
SELECT *
FROM logs
WHERE pw='correct' AND CASE WHEN id<800 THEN success=1 ELSE END
AND YEAR(timestamp)=2011
this doesn't work. What i'm trying to do is to add i..
I want to loop through a Python list and process 2 list items at a time. Something like this in another language:
for(int i = 0; i < list.length(); i+=2)
{
// do something with list[i] and list..
I have 3 modified files (no new files) in a pull request at the moment.
I would like to remove one of those files from the pull request, so that the pull request only contains changes to two files a..
I want to count the number of itemids in my array, can i get an example of how i would go about adding this to my code. code below;
if (value != null && !value.isEmpty()) {
Set set = valu..
I have an Excel file with data in it. I want to write some specific rows of it to another Excel file that I created by code. By the way I have the indexes of these rows in a list. How can i do that?..
I'm new to angular2. I want to store user input from a text area in a variable in my component so I can apply some logic to this input. I tried ngModel but it doesn't work. My code for the textarea:
..
Why would someone prefer either the Lodash or Underscore.js utility library over the other?
Lodash seems to be a drop-in replacement for underscore, the latter having been around longer.
I think both ..
I plan to use it with JavaScript to crop an image to fit the entire window.
Edit: I'll be using a 3rd party component that only accepts the aspect ratio in the format like: 4:3, 16:9...
This is quite n00bish, but I'm trying to learn/understand functional programming in python. The following code:
foos = [1.0,2.0,3.0,4.0,5.0]
bars = [1,2,3]
def maptest(foo, bar):
print foo, bar
..
I get this error message:
ERROR 1217 (23000) at line 40: Cannot
delete or update a parent row: a
foreign key constraint fails
... when I try to drop a table:
DROP TABLE IF EXISTS `area`;
..
After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error
"Please select Android SDK"
when I click on the button to run the application in simulator, bu..
In my code, I am allowing the user to upload an image. Now I want to show this selected image as a preview in this same popup. How can I do it using jQuery?
The following is the input type I am using..
What is the code to get the current date and time in groovy? I've looked around and can't find an easy way to do this. Essentially I'm looking for linux equivalent of date
I have :
import java.text...
I'm doing some benchmarking, and I want to use Excel to produce graphs of the results. I've got a simple but annoying problem which is baking my noodle.
The problem is that Excel insists that "time" ..
If I issue the find command as follows:
$ find . -name *.ear
It prints out:
./dir1/dir2/earFile1.ear
./dir1/dir2/earFile2.ear
./dir1/dir3/earFile1.ear
What I want to 'print' to the command line..
I have a property in a top level Component that is used data from a HTTP source like so (this is in a file called app.ts):
import {UserData} from './services/user-data/UserData';
Component({
sel..
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @..
I want a regular expression to check that:
A password contains at least eight characters, including at least one number and includes both lower and uppercase letters and special characters, for exam..
I have succeeded in getting git to start Beyond Compare 3 as a diff tool however, when I do a diff, the file I am comparing against is not being loaded. Only the latest version of the file is loaded ..
What's the difference between java.lang.String 's replace() and replaceAll() methods,
other than later uses regex? For simple substitutions like, replace . with / ,
is there any difference?..
I set the c:/android-sdk/tools path to the path environment and commands like emulator is working just fine. But the adb command is still not recognized, what should I do ?
In the path system variabl..
In plain old javascript I have the DIV
<div class="movie" id="my_movie">
and the following javascript code
var myMovie = document.getElementById('my_movie');
myMovie.addEventListener('nv-en..
I'm trying to concatenate several fields and want certain fields to start and end with quotes ("....."). When I put a cell (B2) inside this, the cell (B2) is shown as plain text with quotes around it...
I'm new to parallel programming. There are two classes available in .NET: Task and Thread.
So, my questions are:
What is the difference between those classes?
When is it better to use Thread over Tas..
I would like to cut a Java String when this String length is > 50, and add "..." at the end of the string.
Example :
I have the following Java String :
String str = "abcdefghijklmnopqrtuvwxyz";
I..