If I wish to store the current value of an iterator to compare to the next value of the iterator in a Reduce method, Hadoop requires that I clone it instead of simply assigning its reference to a temp..
I have an existing Web API 2 service and need to modify one of the methods to take a custom object as another parameter, currently the method has one parameter which is a simple string coming from the..
I'm trying to establish SSL/TLS connection to test server with self-signed certificate. Communication through unsecure channel worked without issues.
Here is my sample code, which I've written based ..
I created Windows Phone 8.1 project and I am trying to run async method GetResponse(string url) on button click and waiting for the method to finish, but method is never finishing. Here is my code:
p..
I try to connect to a web service hosted on a different server using the WebRequest Class. The web service returns a string as a Response. While doing so I get an Error:
"System.Net.Sockets.Socke..
I am testing an endpoint that I am experiencing some issues with.
I am simply using HttpClient in a loop that performs a request each hour.
var httpClient = new HttpClient();
var message = httpClien..
I've been using Selenium for a number of months, which we're using to automate some of our internal testing processes. The scripts have been passing fine. I've recently upgraded to C# 2.40.0 webdriver..
I have the following code:
private Uri currentUri;
private void Form1_Load(object sender, EventArgs e)
{
currentUri = new Uri(@"http://www.stackoverflow.com");
HttpWebRequest myRequest = (Ht..
I am trying to send an SMTP email when certain values in database crosses its threshold value.
I have already allowed ports 25,587 and 465 in the Windows firewall and disabled the option of preventin..
This is how I call a service with .NET:
var requestedURL = "https://accounts.google.com/o/oauth2/token?code=" + code + "&client_id=" + client_id + "&client_secret=" + client_secret + "&re..
I am developing a WCF service, running IIS6 on Window server 2003. I have built a test client to talk to the WCF service and I am getting the error below. I have been looking at this error for days an..
I've written an app that has worked fine for months, in the last few days I've been getting the error below on the installed version only.
If I run the source code in VS everything works fine. Also, ..
I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references.
This is the error I..
I am getting The remote server returned an error: (400) Bad Request error while running the following code.
I am trying to upload xml file on the http server.
My xml file contains tag for the username..
Using Powershell v3's Invoke-WebRequest and Invoke-RestMethod I have succesfully used the POST method to post a json file to a https website.
The command I'm using is
$cert=New-Object System.Securi..
This is the code I have so far:
public class Class1
{
private const string URL = "https://sub.domain.com/objects.json?api_key=123";
private const string DATA = @"..
TL; DR: I'm new to this language and have no idea what I'm doing
here is my class so far:
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Web;
using System.Net;
u..
I created a asp.net website and published it in iis 7. I deleted the default website option in the iis 7 and created the new website in the iis 7. When i click the default document I got the error lik..
For example, in one place...
//---------------a
try
{
// some network call
}
catch(WebException we)
{
throw new MyCustomException("some message ....", we);
}
...and in another place...
//-..
I am using the WebClient class to post some data to a web form. I would like to get the response status code of the form submission. So far I've found out how to get the status code if there is a exce..
Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.
System.Net.WebException: Unable to connect to the remote server ---> System.Net.So..
I know there's a lot of questions on SO similar to this, but I couldn't find one for this particular issue.
A couple of points, first:
I have no control over our Sharepoint server. I cannot tweak any..
Any ideas why on some links that I try to access using HttpWebRequest I am getting "The remote server returned an error: (304) Not Modified." in the code?
The code I'm using is from Jeff's post here ..
This is the try catch in PowerShell 2.0
$urls = "http://www.google.com", "http://none.greenjump.nl", "http://www.nu.nl"
$wc = New-Object System.Net.WebClient
foreach($url in $urls)
{
try
{
..
I'm having a problem using a WCF call from a Windows service to my WCF service running on my web server. This call has been working for a number of weeks, but then stopped working all of a sudden, an..
I have a big problem: I need to send 200 objects at once and avoid timeouts.
while (true)
{
NameValueCollection data = new NameValueCollection();
data.Add("mode", nat);
using (var clien..
I've created one WCF service and deployed it on Server. When I browse this service it gives me positive response with ?wsdl URL. Now I'm trying to test the service through WCF Test client. It shows pr..
I've encountered this apparently common problem and have been unable to resolve it.
If I call my WCF web service with a relatively small number of items in an array parameter (I've tested up to 50), ..
I have a web service written in C# that is living on a SharePoint site. I have modified the web.config with the following code:
<configuration>
<system.web>
<httpRuntime executi..
I'm using C# and connecting to a WebService via an auto-generated C# proxy object. The method I'm calling can be long running, and sometimes times out. I get different errors back, sometimes I get a S..
I have a problem with my edit page. When I submit I get this error:
The POST method is not supported for this route. Supported methods: GET, HEAD.
I have no clue where it comes from as I am pre..
I'm trying to disable submit button if the user hasn't provided any text.
At first sight it looks that everything works just fine, but if user types some text, then deletes it, the submit button bec..
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..
I looked around some and didn't find what I was after so here goes.
SELECT * FROM trees WHERE trees.`title` LIKE '%elm%'
This works fine, but not if the tree is named Elm or ELM etc...
How do I m..
I need to draw a horizontal line in a UIView. What is the easiest way to do it. For example, I want to draw a black horizontal line at y-coord=200.
I am NOT using Interface Builder. ..
I need to export private key from Windows store. What should I do if the key is marked as non-exportable? I know that it is possible, program jailbreak can export this key.
To export key I use Org.Bo..
I'm looking for a way to stop iterations of underscore.js _.each() method, but can't find the solution. jQuery .each() can break if you do return false.
Is there a way to stop underscore each()?
_([..
I am able to list all the directories by
find ./ -type d
I attempted to list the contents of each directory and count the number of files in each directory by using the following command
find ./ -..
Why does Eclipse give me the warming "Resource leak: 'in' is never closed" in the following code?
public void readShapeData() {
Scanner in = new Scanner(System.in);
System.out.println..
I am looking to set curl to use a proxy server. The url is provided by an html form, which has not been a problem. Without the proxy it works fine. I have found code on this and other sites, but they ..
I'm currently stuck setting borders in an html table. (I use inline styles for a better rendering in e-mail-clients) I have this piece of code:
<html>
<body>
<table style="..
I have an array of distances called dists. I want to select dists which are between two values. I wrote the following line of code to do that:
dists[(np.where(dists >= r)) and (np.where(dists <..
I'm trying to create a maven project - so that I can compile Java files in the root folder and output the class files in another folder.
I've already downloaded mvn.
I'm trying to integrate with VS ..
What I want to do is shown below in 2 stream calls. I want to split a collection into 2 new collections based on some condition. Ideally I want to do it in 1. I've seen conditions used for the .map fu..
I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14.
In MVNrepository site the dependency to put in the POM is:
<dependency>
<groupId>com.oracle..
Given is a simple CSV file:
A,B,C
Hello,Hi,0
Hola,Bueno,1
Obviously the real dataset is far more complex than this, but this one reproduces the error. I'm attempting to build a random forest classi..
I am getting this error when running JUnit test in Eclipse:
Class not found com.myproject.server.MyTest
java.lang.ClassNotFoundException: com.myproject.server.MyTest
at java.net.URLClassLoader$1...
I am running C# ASP.NET 4.5 web application on Windows 7 64-bit using IIS 7.5. The application pool it uses has the name 'ASP.NET v4.0' and its identity is ApplicationPoolIdentity. The application use..
Using pip install zipline on Windows 8 with Python 2.7 gives me the error:
Downloading/unpacking six (from python-dateutil==2.1->delorean->zipline[all])
Running setup.py egg_info for package ..
I have reviewed quite a few demos and have no idea why I can't get the CSS3 spin to function. I am using the latest stable release of Chrome.
The fiddle:
http://jsfiddle.net/9Ryvs/1/
_x000D_
_x000D_..
When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent():
Use escape:
escape("% +&=");
OR
use encodeURI() / e..
I tried to run the command 'Enable-Migrations' in a new project and I got the message:
PM> Enable-Migrations
The term 'Enable-Migrations' is not recognized as the name of a cmdlet, function, scrip..
I have table in which I am inserting rows for employee but next time when I want to insert row I don't want to insert again data for that employee just want to update with required columns if it exits..
I have been trying all day to get this to work.
Does anyone know how to get grep, or something of the like, to retrieve offsets of hex strings in a file?
I have a bunch of hexdumps that I need to che..
I am making an app that processes sensitive credit card data.
If my code is running in debug mode I want to log this data to the console and make some file dumps.
However on the final appstore ve..
I have this:
<li><a href="/Users/Index)" class="elements"><span>Clients</span></a></li>
Which works fine. But if I am already on this page or on the controller e..
How do you connect to a MySQL database in Java?
When I try, I get
java.sql.SQLException: No suitable driver found for jdbc:mysql://database/table
at java.sql.DriverManager.getConnection(DriverM..
Say you catch an exception and get the following on the standard output (like, say, the console) if you do a e.printStackTrace() :
java.io.FileNotFoundException: so.txt
at java.io.FileInputSt..
I am a VBA newbie, and I am trying to write a function that I can call from Excel cells, that can open a workbook that's closed, look up a cell value, and return it.
So far I know how to write a macr..
Is there a way to tell AngularJS that I want links to be opened in new windows when the user clicks on them?
With jQuery I would do this:
jQuery("a.openInNewWindow").click( function() {
window.o..
Many Java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of Java, locate JRE JARs, and so on.
In macOS X 10.6, ..
I need to look up rows within a particular time frame.
select *
from TableA
where startdate >= '12-01-2012 21:24:00'
and startdate <= '12-01-2012 21:25:33'
I.e.: I need to look up rows w..
I have the following html and I want to get the value of the div which is "Other"
How can I do this with jQuery?
<div class="readonly_label" id="field-function_purpose">
Other
</d..
When I attempt to connect to a MySQL server from PHP, I see the following error:
Deprecated: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /path..
I am working on shortcuts in C#. I succeed implementing Ctrl, Alt and Shift with SendKeys.
Like this;
Ctrl + C:
System.Windows.Forms.SendKeys.SendWait("^c");
or Alt + F4:
System.Windows.Forms.Se..
This is a C++ interview test question not homework.
#include <iostream>
using namespace std;
enum months_t { january, february, march, april, may, june, july, august, september,
october,..
I want to reduce load times on my websites by moving all cookies into local storage since they seem to have the same functionality. Are there any pros/cons (especially performance-wise) in using local..
cat a.txt | xargs -I % echo %
In the example above, xargs takes echo % as the command argument. But in some cases, I need multiple commands to process the argument instead of one. For example:
cat a...
Generally speaking, we all hear about the functions or procedures in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong).
So,..
I have a NumPy array 'boolarr' of boolean type. I want to count the number of elements whose values are True. Is there a NumPy or Python routine dedicated for this task? Or, do I need to iterate over ..
I'm writing a program in C++ using the Qt library. There is a symbolic link in my home bin directory to the executable. I would like the current working directory of my program to be the directory in ..
I know that Git tracks changes I make to my application, and it holds on to them until I commit the changes, but here's where I'm hung up:
When I want to revert to a previous commit I use:
git rese..
there is a rule which says:
Names representing constants (final variables) must be all uppercase
using underscore to separate words
(taken from http://geosoft.no/development/javastyle.html)
..
How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have contro..
So, I can create an input button with an image using
<INPUT type="image" src="/images/Btn.PNG" value="">
But, I can't get the same behavior using CSS. For instance, I've tried
<INPUT type..
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..
How to bring my application window to front? For example whan my app needs attention.
This is for my personal program. I need that functionality.
This is what I got. But it's NOT working 100% times...
Can someone explain to me what the documents directory is on an iOS app and when to use it?
Here is what I believe at present:
To me, it seems to be a central folder where the user can store any fil..
I have a remote bare repository hub. I work only in the master branch.
The last sentence of this error message below makes me wonder: How do I find out which is the "default configured remote for your..
I am new to the Java world and JPA. I was studying JPA and came across many new terms like Entity, persistence. While reading, I could not understand the exact definition for Persistence Context.
Can..
I am currently developing a REST-API which is HTTP-Basic protected for the development environment. As the real authentication is done via a token, I'm still trying to figure out, how to send two auth..
I'm making an Ajax.request to a remote PHP server in a Sencha Touch 2 application (wrapped in PhoneGap).
The response from the server is the following:
XMLHttpRequest cannot load http://nqatalog...
I have a data array which contains many objects (JSON format). The following can be assumed as the contents of this array:
var data = [
{
"name": "Jim",
"age" : 25
},
{
"name": "Je..
I am trying to run a JavaScript/jQuery function and Firebug gets the error:
$ is not defined $(function()".
The JavaScript code is placed inside a file called core.js and referenced by index.php. W..
I'm trying to create an iframe from JavaScript and fill it with arbitrary HTML, like so:
var html = '<body>Foo</body>';
var iframe = document.createElement('iframe');
iframe.src = 'data:t..
I have nginx up and running with a Ruby/Sinatra app and all is well. However, I'm now trying to have a second application running from the same server and I noticed something weird. First, here's my n..
I am very new to symfony. In other languages like java and others I can use request.getParameter('parmeter name') to get the value.
Is there anything similar that we can do with symfony2.
I have seen..
I am Using Spring WebServiceTemplate to make webservice call which uses JAXB to generate request XML. My requirement needs all the elements (including root) to have a namespace prefix (there is only a..
I have a custom ListView. This ListView contains 1 Image and 6 TextViews. To retrieve the value I have created a setOnItemClickListener(...). Whenever I click on the ListView how could I actually retr..
I need to create a comma-separated list of items:
<li ng-repeat="friend in friends">
<b ng-repeat="email in friend.email">{{email}}{{$last ? '' : ', '}}</b>...
</li>..
function getInputElements() {
var inputs = document.getElementsByTagName("input");
}
The above code gets all the input elements on a page which has more than one form. How do I get the input ele..
How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.
Excel 2007 has a possible range of 1 to 16384, which is the number ..
I'm attempting to install the PHP Zip extension.
My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the latest ..
How can I convert a JSON File as such into a dataframe to do some transformations.
For Example if the JSON file reads:
{"FirstName":"John",
"LastName":"Mark",
"MiddleName":"Lewis",
"username":"..
I would like to have a way to reference the project's manifest version number in the main part of the code. What I have been doing up until now is to link the version number in a String XML file to th..
There are multiple ways to create a HTML button to navigate to other page.
Method 1
<button id="btn_click">Click Me</button>
<script>
$('#btn_click').on('click', function() { windo..
Possible Duplicate:
Easiest way to compare arrays in C#
How can I compare two arrays in C#?
I use the following code, but its result is false. I was expecting it to be true.
Array.Equals(..
I want to build a macro that inserts a row below the selected cell with the same format. This is the code I have so far:
Public Sub insertRowBelow()
ActiveCell.Offset(1).EntireRow.Insert Shift:=xlDo..
I've spent the last couple of hours trying to find a solution to my problem but it seems to be hopeless.
Basically I need to know how to call a parent method from a child class.
All the stuff that I'..
Is there a way to create a Distinct query in HQL. Either by using the "distinct" keyword or some other method. I am not sure if distinct is a valid keywork for HQL, but I am looking for the HQL equi..
So I'm making a java application in Neatbeans 7.4, been working at it for a while, everything was fine, running the project worked fine, but now when I hit run project, I get the error
Error: Could ..
I have a MongoDB collection with documents in the following format:
{
"_id" : ObjectId("4e8ae86d08101908e1000001"),
"name" : ["Name"],
"zipcode" : ["2223"]
}
{
"_id" : ObjectId("4e8ae86d08101..
Another developer and I disagree about whether PYTHONPATH or sys.path should be used to allow Python to find a Python package in a user (e.g., development) directory.
We have a Python project with a ..
I noticed that
HTTP://STACKOVERFLOW.COM/QUESTIONS/ASK
and
http://stackoverflow.com/questions/ask
both works fine - actually the previous one is converted to lowercase.
I think that this makes..
is there anyway i could trigger a change event on select box on page load and select a particular option.
Also the function executed by adding the trigger after binding the function to the event.
I..
I have something like /Date(1370001284000+0200)/ as timestamp. I guess it is a unix date, isn't it? How can I convert this to a date like this: 31.05.2013 13:54:44
I tried THIS converter for 13700012..
I was wondering how I am able to plot images side by side using matplotlib for example something like this:
The closest I got is this:
This was produced by using this code:
f, axarr = plt.subpl..
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'm having some trouble navigating Java's rule for inferring generic type parameters. Consider the following class, which has an optional list parameter:
import java.util.Collections;
import java.util..
I frequently make use of Request.QueryString[] variables.
In my Page_load I often do things like:
int id = -1;
if (Request.QueryString["id"] != null) {
try
{
..
I have a div tag
<div id="theDiv">Where is the image?</div>
I would like to add an image tag inside of the div
End result:
<div id="theDiv"><img id="theImg" src="theImg.png"..
I have set up a dynamic web project in Eclipse with a Tomcat 5.5 installation.
I want to be to set the server to us the Tomcat installation instead of the workspace metadata location, but when Eclips..
PAY ATTENTION!
The Bootstrap icons are back after this pull request merge.
After going back and forth on this for the last couple weeks, I've decided to restore the Glyphicons icon ..
I installed the maven plugin for eclipse. Then tried updating the index and got the following error:
Unable to update index for central|http://repo1.maven.org/maven2
While trying to edit the proxy s..
I want to color the background of svg text similar to background-color in css
I was only able to find documentation on fill, which colors the text itself
Is it even possible?..
Trying to follow the instructions for building a docker image from the docker website.
https://docs.docker.com/examples/running_redis_service/
this is the error I get will following the instructions..
I'd like to know if it is possible to include a .js file within another .js file?
The reason for me wanting to do this is to keep client includes to a minimum. I have several .js files already writte..
I have searched far and wide for an answer to this problem. I'm using a Microsoft SQL Server, suppose I have a table that looks like this:
+--------+---------+-------------+-------------+
| ID | ..
In JSF an component can be rendered or not using the EL empty operator
rendered="#{not empty myBean.myList}"
As I've understood the operator works both as null-check, but also check checks if the ..
In my db, I have a table (Defaults), and when I generate an entity from table, I get these two classes:
@Entity
public class Defaults implements Serializable {
private static final long serialVer..
I'm really new to HTML5 for mobile. I use jQuery Mobile for my current app and I have some problems hiding the navigation bar.
I found this site: http://m.somethingborrowedmovie.warnerbros.com/. (I d..
I need to go from milliseconds to a tuple of (hour, minutes, seconds, milliseconds) representing the same amount of time. E.g.:
10799999ms = 2h 59m 59s 999ms
The following pseudo-code is the only th..
I have created a CSS class called 'button' and applied it to all of my INPUT tags by simply using :
.button input
{
//css stuff here
}
<p class="button">
<input type="submit" Name='submit' ..
I'm creating an app that uses the Facebook SDK to authenticate users. I'm trying to consolidate the facebook logic in a separate class. Here is the code (stripped for simplicity):
import Foundation
..
How do I query the database name in Oracle SQL Developer? I have tried the following and they all fail:
SELECT DB_NAME();
SELECT DATABASE();
Why do these basic MySQL queries fail in SQL Developer? ..
Well first of all I found couple of answers while googling but most of the forums are blocked in my Office Network hence asking this question here! One more intention is to get an answer in plain Engl..
Ive some classes that share some attributes, and i would like to do something like:
$dog = (Dog) $cat;
is it possible or is there any generic work around?
Its not a superclass, or a interface or r..
I'm trying to run a query that has a few columns that are a CLOB datatype. If i run the query like normal, all of those fields just have (CLOB) as the value.
I tried using DBMS_LOB.substr(column) and..
When I was studying for my undergraduate degree in EE, MATLAB required each function to be defined in its own file, even if it was a one-liner.
I'm studying for a graduate degree now, and I have to w..
When trying to show a div element with jQuery, i got this error:
[23:50:35.971] TypeError: p.easing[this.easing] is not a function @ file:///D:/html5%20puzzle/jquery.js:2
The relevant function is t..
What is the major difference between for and foreach loops?
In which scenarios can we use for and not foreach and vice versa.
Would it be possible to show with a simple program?
Both seem the same ..
What is this?
This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.
Why ..
I have a table to store information about my rabbits. It looks like this:
create table rabbits (rabbit_id bigserial primary key, info json not null);
insert into rabbits (info) values
('{"name":"He..
How do I specify the column that I want in my query using a model (it selects all columns by default)? I know how to do this with the sqlalchmey session: session.query(self.col1), but how do I do it w..
How can I get the class name from an ActiveRecord object?
I have:
result = User.find(1)
I tried:
result.class
# => User(id: integer, name: string ...)
result.to_s
# => #<User:0x3d07cdc&g..
Suppose this string:
The fox jumped over the log.
Turning into:
The fox jumped over the log.
What is the simplest (1-2 lines) to achieve this, without splitting and going into lists?..
I'm trying to create a script that simplifies the process of creating a new user on an iOS device. Here are the steps broken down.
fullname="USER INPUT"
user="USER INPUT"
group=$us..
I am new in R and I am trying to do something really simple. I had load a txt file with four columns and now I want to get the minimum value of the second column.
This is the code that I have:
## Ch..
I want to set a background image on the body tag, then run some code - like this:
$('body').css('background-image','http://picture.de/image.png').load(function() {
alert('Background image done lo..
I've got a script that checks for 0-size, but I thought there must be an easier way to check for file sizes instead. I.e. file.txt is normally 100k; how to make a script check if it is less than 90k ..
I would like list dates between two date in a SQL Server stored procedure.
For example:
Date1: 2015-05-28
Date2: 2015-05-31
Results :
2015-05-29
2015-05-30
How to calculate all dates between t..
I'm using IntelliJ 10 IDEA Ultimate Edition.
I've created a new file Test.py, and IntelliJ has correctly switched to Python parsing mode. (I can confirm this by typing "d", it pops up "def" as a sug..
I've noticed the following code is legal in Python. My question is why? Is there a specific reason?
n = 5
while n != 0:
print n
n -= 1
else:
print "what the..."
..
I have used a CheckedListBox over my WinForm in C#. I have bounded this control as shown below -
chlCompanies.DataSource = dsCompanies.Tables[0];
chlCompanies.DisplayMember = "CompanyName";
chlCompan..
I'm trying to parse some JSON data from the Google AJAX Search API. I have this URL and I'd like to break it down so that the results are displayed. I've currently written this code, but I'm pretty lo..
I know this question has been asked here a few times before. But i haven't seen any possible solution yet.
Before i make the project 'Run as Android Application' , if i do not clean it, i receive the..
I am trying to load an image to use as an icon in my application. The appropriate method according to this tutorial is:
protected ImageIcon createImageIcon(String path, String description)
{
jav..
I am rarely getting this error while making an API call.
java.lang.IllegalStateException: Fragment not attached to Activity
I tried putting the code inside isAdded() method to check whether fragm..
I develop web applications, which use a number of third party applications/code/services. As part of the job, we regularly check with the Full Disclosure mailing list http://seclists.org/fulldisclosu..
I just copy all the jar files of Http but Android Studio cann't import all these jar files.It gives an error :
Cannot resolve symbol HttpGet,HttpClient,HttpResponse.
My Activity file is here:-
publ..
I am using Spring MVC .I have to write a service that would take input from the request body, add the data to the pdf and returns the pdf file to the browser. The pdf document is generated using itext..
Here is the code:
def myfirst_yoursecond(p,q):
a = p.find(" ")
b = q.find(" ")
str_p = p[0:a]
str_q = p[b+1:]
if str_p == str_q:
result = True
else:
result = False
return..
That sounds weird I know, but I am having trouble getting a piece of text to move down a tiny bit so it's centered on the tab it's on.
here's what it looks like:
I want buy to be centered vertica..
I have a DataFrame with many missing values in columns which I wish to groupby:
import pandas as pd
import numpy as np
df = pd.DataFrame({'a': ['1', '2', '3'], 'b': ['4', np.NaN, '6']})
In [4]: df.g..
I'm currently working on a website, which triggers a net::ERR_HTTP2_PROTOCOL_ERROR 200 error on Google Chrome. I'm not sure exactly what can provoke this error, I just noticed it pops out only when ac..
I am doing a C# project using Razor in VS2010 (MVC 4).
I need to return an error message from Controller to View and show it to the user.
What I have tried:
CONTROLLER:
[HttpPost]
public ActionRes..
I'm beginning python and I'm trying to use a two-dimensional list, that I initially fill up with the same variable in every place. I came up with this:
def initialize_twodlist(foo):
twod_list = [..
I have a shell script that has user execution permission on OS X, but when I double click on it, it opens in a text editor. How can I get it to run by double-clicking it?..
I'm using VMware workstation 8 on windows 7 and having some Linux hosts such as Centos, Backtrack and ... on it.
The problem is the screen of the virtual machines is not fixed with my screen.
here is ..
I'm using Jersey to implement a RESTful API that is primarily retrieve and serve JSON encoded data. But I have some situations where I need to accomplish the following:
Export downloadable documents..
I have a string as
string = "firstName:name1, lastName:last1";
now I need one object obj such that
obj = {firstName:name1, lastName:last1}
How can I do this in JS?..
I am using docker for the first time and I was trying to implement this -
https://docs.docker.com/get-started/part2/#tag-the-image
At one stage I was trying to connect with localhost by this command -..
I have a solution with multiple projects in it. Most of the third party references are missing, yet there are packages.config file for each project. How do I get NuGet to install/update all the packa..
I am trying to define some endpoints and do a test using nodejs. In server.js I have:
var express = require('express');
var func1 = require('./func1.js');
var port = 8080;
var server = express();
se..
This question is related to Should I be concerned about excess, non-running, Docker containers?.
I'm wondering how to remove old containers. The docker rm 3e552code34a lets you remove a single one, b..
I have a MySQL table with a primary key field that has AUTO_INCREMENT on.
After reading other posts on here I've noticed people with the same problem and with varied answers. Some recommend not using ..
I am getting this error while on of my .Net application are trying to make a connection to oracle database.
The error says that This problem will occur when running in 64 bit mode with the 32 bit Ora..
several questions about this and diffrent answeres. But none of them realy answeres the question. So again:
Setting default of a Dropdown select by value isnt working in my case. why?
This is from th..
I am building a mobile web app with jQuery Mobile and I want to check if a checkbox is checked. Here is my code.
<script type=text/javascript>
function validate(){
if (remember.checked ==..
The following code works for me:
var webProxy = WebProxy.GetDefaultProxy();
webProxy.UseDefaultCredentials = true;
WebRequest.DefaultWebProxy = webProxy;
Unfortunately, WebProxy.GetDefaultProxy() i..
I have following code that gets and prints a string.
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
int main()
{
string str;
cout << "Ente..
How can I make it act as if a line of div is anchor so when I hover on it it returns to red
CSS
.e
{
width:90px;
border-right:1px solid #222;
text-align:center;
float:left;
paddi..
I'm trying to set up role-based Security with permissions. I'm trying to do this together with Spring-Security.
I don't want to set up ACL as it seems it's an overkill for my requirements.
I just w..
I have got a little problem with setting a background image for <button>.
Here is the html I have got on site:
<button id="rock" onClick="choose(1)">Rock</button>
And here is th..
I'm learning Flutter, and I'm starting from the very basics. I'm not using MaterialApp. What's a good way to set the background color of the whole screen?
Here's what I have so far:
import 'package:..
I am quite confused. I should be able to set
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
and IE8 and IE9 should render the page using the latest rendering engine. However, I just..
I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides thi..
I'm trying to Integrate HTML Purifier http://htmlpurifier.org/ to filter my user submitted data but I get the following error below. And I was wondering how can I fix this problem?
I get the followin..
I know that in C and C++, when casting bools to ints, (int)true == 1 and (int)false == 0. I'm wondering about casting in the reverse direction...
In the code below, all of the following assertions he..
I am trying to mimic the functionality of this curl command in Java:
curl --basic --user username:password -d "" http://ipaddress/test/login
I wrote the following using Commons HttpClient 3.0 but s..
Okay, I implemented this SO question to my code: Return True or False Randomly
But, I have strange behavior: I need to run ten instances simultaneously, where every instance returns true or false jus..
int total = (int) Math.ceil(157/32);
Why does it still return 4? 157/32 = 4.90625, I need to round up, I've looked around and this seems to be the right method.
I tried total as double type, but ge..
I am writing a program in Python, and I realized that a problem I need to solve requires me, given a set S with n elements (|S|=n), to test a function on all possible subsets of a certain order m (i.e..
I want to create string using integer appended to it, in a for loop. Like this:
for i in range(1,11):
string="string"+i
But it returns an error:
TypeError: unsupported operand type(s) for +: 'i..
Well it looks like Dreamweaver CS5 will try to smoother the HTML5 thing for a few more years (weeks actually). Seems like the next rung down is right to Notepad!
Anyone know a good HTML5 editor with ..
How can I erase the current printed console line in C? I am working on a Linux system. For example -
printf("hello");
printf("bye");
I want to print bye on the same line in place of hello...
When I use chmod() to change permissions at run time, it gives me the below message:
Warning: chmod() [function.chmod]: Operation not permitted in /home/loud/public_html/readalbum.php
How can I..
Possible Duplicate:
How to decode HTML entities using jQuery?
I want to convert this text:
"<p>name</p><p><span style="font-size:xx-small;"..
I have a few queues running with RabbitMQ. A few of them are of no use now, how can I delete them? Unfortunately I had not set the auto_delete option.
If I set it now, will it be deleted?
Is there a..
I have been fighting with this for a bit now. I’m trying to convert epoch to a date object. The epoch is sent to me in UTC. Whenever you pass new Date() an epoch, it assumes it’s local epoch. I tr..
How to increase transaction timeout? I want to upload videos, but large size of videos not uploaded?
It throws error The process *** exceeded the timeout of 60 seconds...
I'm looking for a way to display the hamburger icon whitout using the Drawer/DrawerToggle and use the default icon included in Android
By setting getSupportActionBar().setDisplayHomeAsUpEnabled(true..
I have installed Ubuntu and Docker. I am trying to launch Raik container:
$ DOCKER_RIAK_AUTOMATIC_CLUSTERING=1 DOCKER_RAIK_CLUSTER_SIZE=5 DOCKER_RIAK_BACKEND=leveldb make start-cluster ./bin/start
..
I'm looking for a way to disable SSH clients from accessing the password prompt as noted here.
I am unable to disable the password: prompt for root login. I have change the sshd_config file to read:
..
There are three loops in C: for, while, and do-while. What's the difference between them?
For example, it seems nearly all while statements can be replaced by for statements, right? Then, what's the ..
I have noticed that some newer TensorFlow versions are incompatible with older CUDA and cuDNN versions. Does an overview of the compatible versions or even a list of officially tested combinations exi..
I have done some searching for the answer to this question, but all I can figure out is this:
df[df.columns[len(df.columns)-1]]
which to me seems unweildy, and un-pythonic (and slow?).
What is t..
Alright been racking my brain on this (im terrible at this) but yea ive tried reading all i can and still cant get it to work.
trying to do autocomplete with jquery ui
my json looks like this
{"dea..
I'm trying to sort an array of numbers that are strings and I'd like them to sort numerically.
The catch is that I cannot convert the numbers into int.
Here is the code:
string[] things= new string..
The developer who created a platform my company uses is no longer working for us and I don't know how I can retrieve the passwords from a custom PHP application
When I look in the PHPmyAdmin the pas..
I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node --version, it still indicates that I'm r..
Thanks to StackOverflow, I managed to get the following code working perfectly, but I have a follow up question.
$.get('http://example.com/page/2/', function(data){
$(data).find('#reviews .card')...
I am new to VBA...I want to copy a row from Sheet2 to Sheet1 if the first cell in this row says X and then do so for all the rows that meet this criteria. I have an error in the If condition...I don't..
As SQL Server returns timestamp like 'Nov 14 2011 03:12:12:947PM', is there some easy way to convert string to date format like 'Y-m-d H:i:s'.
So far I use
date('Y-m-d H:i:s',strtotime('Nov 14 2011..