In a blog post I use the following PHP to set the content-type of a response:
header('content-type: application/json; charset=utf-8');
I just got a comment on that post saying that content-type nee..
I know this has been asked in other places and answered, but I'm having issues with MS Visual Studio 2010. I've developed a C++ executable but if I run the Release version on a machine that doesn't ha..
How can I get an ASP.net web form (v3.5) to post a file using a plain old <input type="file" />?
I am not interested in using the ASP.net FileUpload server control...
What's a good way to check if a cookie exist?
Conditions:
Cookie exists if
cookie1=;cookie1=345534;
//or
cookie1=345534;cookie1=;
//or
cookie1=345534;
Cookie doesn't exist if
cookie=;
//or
<b..
I'm looking for a php function that will take an input string and return a sanitized version of it by stripping away all special characters leaving only alpha-numeric.
I need a second function that d..
I have installed Android SDK 22.3 and JDK 1.7 update 21 on Win7 x64. Now I created an empty android application project using intelliJ 13.0.1 (also use Emulator as target device) and tried to build th..
I can easily grant access to one IP using this code:
$ mysql -u root -p
Enter password:
mysql> use mysql
mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'..
I am using as an environment, a Cloud9.io ubuntu VM Online IDE and I have reduced by troubleshooting this error to just running the app with Webpack dev server.
I launch it with:
webpack-dev-server..
I am using Ubuntu 16.10 and recently installed Docker (v1.12.4) using the Xenial build by following the instructions found here. I haven't encountered any problems creating containers, ensuring they r..
mydict = {"key1":"value1", "key2":"value2"}
The regular way to lookup a dictionary value in a Django template is {{ mydict.key1 }}, {{ mydict.key2 }}. What if the key is a loop variable? ie:
{% fo..
I try to send an POST request from Angular 4 to my Laravel backend.
My LoginService has this method:
login(email: string, password: string) {
return this.http.post(`http://10.0.1.19/login`, { em..
I need to copy a file to another path, leaving the original where it is.
I also want to be able to rename the file.
Will FileInfo's CopyTo method work?..
Is there a way to calculate mean and standard deviation for a vector containing samples using Boost?
Or do I have to create an accumulator and feed the vector into it?..
I'm trying to insert information in a partition table, but I don't know what I'm doing wrong!
Show me this error: ORA-14400: inserted partition key does not map to any partition"
The table dba_tab_pa..
So Im learning to develop in Rails, and have discovered the power of zsh. However, for some of my other tasks, I wish to use normal Bash. Although they are the same, I just feel comfortable with the l..
I have downloaded and extracted Eclipse. I have Eclipse in the following directory: C:\Applications\eclipse. When I try and run the executable , I get the following message :
I currently have the f..
What I understood by the documentation is that:
kubectl create = Creates a new k8s resource in the cluster
kubectl replace = Updates a resource in the live cluster
kubectl apply = If I want to do cr..
I'm trying to create a function in package that returns a table. I hope to call the function once in the package, but be able to re-use its data mulitple times. While I know I create temp tables in ..
Possible Duplicate:
Multiple Inheritance in C#
I have two classes Class A and Class B. These two classes cannot inherit each other. I am creating new class called Class C. Now, I want to implement ..
Given a transparent PNG displaying a simple shape in white, is it possible to somehow change the color of this through CSS? Some kind of overlay or what not?..
I am trying to change the color of the first option to grey color, that only the text (select one option) but here it's not working here:
_x000D_
_x000D_
.grey_color {_x000D_
color: #ccc;_x000D_
..
I have a dynamically created select option using a javascript function. the select object is
<select name="country" id="country">
</select>
when the js function is executed, the "countr..
I am processing a text file containing coordinates x, y, z
1 128 1298039
123388 0 2
....
every line is delimited into 3 items using
words = line.split()
After processing..
Suppose we are using Row from React-Bootstrap... How do we style it without using a wrapper or inner element:
<Row>
<div className='some-style'>
...
</Row>
Ideally, we could ju..
How can we retrieve data from a website and parse it into a readable format in the Android application? This means I want to extract data from website and use it in my android application, formatted i..
i'm trying using cURL for a GET request like this:
function connect($id_user){
$ch = curl_init();
$headers = array(
'Accept: application/json',
'Content-Type: application/json',
..
what is the correct way to clear cache in android Application programmatically. I already using following code but its not look work for me
@Override
protected void onDestroy() {
// TODO Auto-gen..
I have written some stylesheets - including a print.css - and it's working fine.
I'd like to remove the URL from printing out on each of the pages. I am beginning to wonder if it is impossible. Is t..
Hello Stackoverflowers,
I'm trying to use a button, that first goes to another excel file in a specific directory. While performing something, I want to add a row in a sheet the excel file i'm runnin..
I have done serial port RS-232 connection in C++ using 16-bit compiler (I was using Turbo C++ IDE). It included header file bios.h which contain all the required functions for reading values from the ..
I would like to delete the empty rows my ERP Quotation generates. I'm trying to go through the document (A1:Z50) and for each row where there is no data in the cells (A1-B1...Z1 = empty, A5-B5...Z5 = ..
So I have a cell with 7/6/2012 10:26:42 inputted, I want to show the date difference from today in another cell.
I tried to extract 7/6/2012 with =LEFT(A1, Find(" ", A1, 1) -1) but turned out theres..
I have a TextView that I want to limit characters of it. Actually, I can do this but the thing that I'm looking for is how to add three dots (...) at the end of string. This one shows the text has con..
Is there a shorter way to write the following? (Something that would check for null without explicitly writing != null)
from item in list
where item.MyProperty != null
select item.MyProperty
..
I've got a python project with a configuration file in the project root.
The configuration file needs to be accessed in a few different files throughout the project.
So it looks something like: <..
Is it possible to create user-defined exceptions and be able to change the SQLERRM?
For example:
DECLARE
ex_custom EXCEPTION;
BEGIN
RAISE ex_custom;
EXCEPTION
WHEN ex_custom THEN
..
I have an array X of 10 elements. I would like to create a new array containing all the elements from X that begin at index 3 and ends in index 7. Sure I can easily write a loop that will do it for me..
May I know what is the difference between C# and .NET? When I think of C#, right away I would say it is a .NET language, but when I search for job posts, they require candidates to have C# and .NET ex..
I tried to assign a new value into the hidden input and checkbox of an input form. It's working fine in Firefox but not in IE (I'm using IE 7). Does anyone know what is wrong with my code?
HTML:
<..
The only way I have found to check for duplicates is by inserting and checking the std::pair.second for false, but the problem is that this still inserts something if the key is unused, whereas what I..
I'm trying to learn JavaScript, but the following code has been giving me a lot of trouble:
window.onload = function () {
for ( var i = 0; i < seats.length; i++) {
for ( var j = 0; j &..
What is the purpose of the self word in Python? I understand it refers to the specific object created from that class, but I can't see why it explicitly needs to be added to every function as a parame..
Is it possible to make a table row expand and collapse? Can anyone refer me to a script or an example?
I prefer jQuery if possible. I have a drawing concept I would like to achieve:
..
In MySQL Workbench table editor there are 7 column flags available: PK, NN, UQ, BIN, UN, ZF, AI.
PK obviously stands for Primary Key. What about others?..
I'm trying to base64 encode an image in a shell script and put it into variable:
test="$(printf DSC_0251.JPG | base64)"
echo $test
RFNDXzAyNTEuSlBH
I've also tried something like this:
test=\`echo..
I want to run Cilkscreen command with a cilk++ program but I'v got this error
/usr/local/cilk/bin/../lib32/pinbin: error while loading shared
libraries: libstdc++.so.6: cannot open shared objec..
Possible Duplicate:
Pretty-Printing JSON with PHP
I'm working on a script that creates a JSON file. Right now I'm just using json_encode (PHP 5.2.x) to encode an array into JSON output. The..
I am using Visual Studio 2013 fully patched. I am trying to use JQuery, JQueryUI and JSRender. I am also trying to use TypeScript. In the ts file I'm getting an error as follows:
Property 'fadeDiv' ..
OK so I'm trying to improve my asp data entry page to ensure that the entry going into my data table is unique.
So in this table I have SoftwareName and SoftwareType. I'm trying to get it so if the e..
I'm looking to create a formula with 3 conditions. It is currently only working with 2 conditions. Here's what I'm looking for:
E9 has a number
If the number is 21+ then I want it to show Text 1
I..
The Binary Tree here is may not necessarily be a Binary Search Tree.
The structure could be taken as -
struct node {
int data;
struct node *left;
struct node *right;
};
The maximum solu..
I'm using T-SQL with ASP.NET, and c# and i'm pretty new to SQL.
I was wondering how i could combine the results of two queries
Query1:
SELECT tableA.Id, tableA.Name, [tableB].Username AS Owner, [t..
I am receiving a syntax error in a form that I have created over a query. I created the form to restrict access to changing records. While trying to set filters on the form, I receive syntax errors ..
I am trying to import component from one file another root component file.
it give error as ..
zone.js:484 Unhandled Promise rejection: Template parse errors:
'courses' is not a known element:
..
I just uninstalled my older versions of Ruby, removed all of my gems
(including Rails), and installed Ruby 2.0. In other words, a totally clean re-install. Upon starting IRB, I received this message:
..
Say we have these two Runnables:
class R1 implements Runnable {
public void run() { … }
…
}
class R2 implements Runnable {
public void run() { … }
…
}
Then what's the diffe..
So I'm running this javascript, and everything works fine, except the paths to the background image. It works on my local ASP.NET Dev environment, but it does NOT work when deployed to a server in a v..
So I've spent way to much time on this, and it seems to me like it should be a simple fix. I'm trying to use Facebook's Authentication to register users on my site, and I'm trying to do it server side..
This is an easy question but say I have an MxN matrix. All I want to do is extract specific columns and store them in another numpy array but I get invalid syntax errors.
Here is the code:
extractedD..
I'm trying to compare 2 lists:
assertThat(actual.getList(), is(Matchers.containsInAnyOrder(expectedList)));
But idea
java: no suitable method found for assertThat(java.util.List<Agent>,org...
Hi I have two classes like this:
public class Indicator implements Serializable {
...
@OneToMany(mappedBy = "indicator",fetch=FetchType.LAZY)
private List<IndicatorAlternateLabel> ind..
I'm trying to load up image in my Image Folder, but it's not working.
Upon debugging, I see this error:
Failed to load resource: the server responded with a status of 404 (Not Found)
My image..
I try again and again to test sending an email from localhost but I still cannot. I don't know anymore how to do it. I try search to find solution but I cannot find one. I edited config/mail.php:
&l..
OK, I'm losing it. PowerShell is annoying me. I'd like a pause dialog to appear, and it won't.
PS W:\>>> $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Exception calling "ReadKey" with "1" ..
Working on a project, one of the webpages will display a list of people (specifically, a list of people from a graduation class that haven't been located yet).
Instead of manually updating these lists..
I'm looking to do a little custom validation with JSR-303 javax.validation.
I have a field. And If a certain value is entered into this field I want to require that a few other fields are not null.
..
I have an ajax call passing data to a page which then returns a value.
I have retrieved the successful call from the page but i have coded it so that it raises an error in the asp. How do i retrieve ..
I'm using Oracle for development. The password for a bootstrap account that I always use to rebuild my database has expired.
How do I turn off password expiration for this user (and all other users)..
Let's say you wanted to implement a breadth-first search of a binary tree recursively. How would you go about it?
Is it possible using only the call-stack as auxiliary storage?..
I have two SELECT statements in SQL Server like these:
(SELECT [UserID] FROM [User])
(SELECT [TailUser], [Weight] FROM [Edge] WHERE [HeadUser] = 5043)
I want to perform a LEFT JOIN between these tw..
I am using C#.net Windows Desktop Application.I want to run these application with other platform also. So, i am using Mono 2.10 as a cross compiler.While running,unexpectedly my Application is termin..
Duplicate: This is a duplicate of Best practices to parse xml files with C#? and many others (see https://stackoverflow.com/search?q=c%23+parse+xml). Please close it and do not answer.
How do you p..
below is my My Code
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
..
The code pasted below was taken from java docs on HttpURLConnection.
I get the following error:
readStream(in)
as there is no such method.
I see this same thing in
the Class Overview for URLC..
I want to do something like this, so npm install also installs the package.json of ../somelocallib or more importantly its dependencies.
"dependencies": {
"express": "*",
"../somelocallib": "..
I am getting that exception from this code:
class Transaction:
def __init__ (self):
self.materials = {}
def add_material (self, m):
self.materials[m.type + m.purity] = m
..
I have a 3 column matrix; plots are made by points based on column 1 and column 2 values, but colored based on column 2 (6 different groups). I can successfully plot all points, however, the last plot..
I built a web application containing a WCF service contract and a Silverlight control which makes calls to that WCF service. On my development and test servers it works great.
When I deploy to our l..
I'm trying to install LESS on my machine and have installed node already. However, when I enter "node install -g less" I get the following error and am not sure what to do?
FPaulMAC:bin paul$ npm ins..
I've read the examples in python docs, but still can't figure out what this method means. Can somebody help? Here are two examples from the python docs
>>> from collections import defaultdic..
I am trying to send a GET request to a URL that I know returns data in the form of JSON using python.
I would like to know how to send this request to http://someurl/path/to/json, and how to parse i..
I have been looking at game engine design (specifically focused on 2d game engines, but also applicable to 3d games), and am interested in some information on how to go about it. I have heard that ma..
I have some PNG images which consist of a black shape and a transparent background.
Unfortunately, IrfanView shows transparent background as black color, so I see just black on black. I've found in Ir..
I can convert a unix timestamp to a Date() object by putting the long value into the Date() constructor. For eg: I could have it as new Date(1318762128031).
But after that, how can I get back the un..
I have an SSIS package that is being executed by an SQL Job which runs twice a day. I recently updated the SSIS package by removing a where clause of a Select statement in it. Now the results have aro..
Possible Duplicate:
Calculating the Difference Between Two Java Date Instances
I know this might be a duplicate thread. But I am trying to figure out a way to compute the difference between..
In Chrome for desktop I have options in the dev tools to disable cache completely when dev tools are opened and I have the options to manually do a hard reload when long clicking on the reload button ..
I am using IPython with --pylab=inline and would sometimes like to quickly switch to the interactive, zoomable matplotlib GUI for viewing plots (the one that pops up when you plot something in a termi..
Configuring a new Digital Ocean droplet with SSH keys. When I run ssh-copy-id this is what I get:
ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), ..
I'm trying to check for a palindrome with Python. The code I have is very for-loop intensive.
And it seems to me the biggest mistake people do when going from C to Python is trying to implement C log..
Consider:
int testfunc1 (const int a)
{
return a;
}
int testfunc2 (int const a)
{
return a;
}
Are these two functions the same in every aspect or is there a difference?
I'm interested in an a..
How can i center the form called form_login horizontally and vertically in my page ?
Here is the HTML I'm using right now:
<body>
<form id="form_login">
<p>
..
I have a MySQL statement that inserts some variables into the database. I recently added 2 fields which are optional ($intLat, $intLng). Right now, if these values are not entered I pass along an emp..
I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other sort algorithm other than bubble or merge would suffice.
Please note that this is to work ..
I'm looking to create a hash with sha256 using openssl and C++. I know there's a similar post at Generate SHA hash in C++ using OpenSSL library, but I'm looking to specifically create sha256.
UPDATE:..
I'm running Windows 8 and I can not get javac to work.
I have set my PATH in environmental variables to
C:\Program Files (x86)\Java\jdk1.7.0_17\bin
I have tried both with and without ';' but to ..
I know how to "transform" a simple Java List from Y -> Z, i.e.:
List<String> x;
List<Integer> y = x.stream()
.map(s -> Integer.parseInt(s))
.collect(Collectors.toList()..
If I write like this:
form action="Images" method="post" enctype="multipart/form-data"
it works.
But in Razor with '@' it doesn't work. Did I make any mistakes?
@using (Html.BeginForm("Upload..
I'm somewhat new to Javascript, so maybe this is just a noob mistake, but I haven't found anything that specifically helps me while looking around. I'm writing a game, and I'm trying to build an objec..
I need to do a LINQ2DataSet query that does a join on more than one field (as
var result = from x in entity
join y in entity2
on x.field1 = y.field1
and
x.field2 = y.field2
I ha..
I try to write the following in latex:
\begin{itemize}
\item \textbf{insert(element|text)} inserts the element or text passed at the start of the selection.
\item \textbf{insert_after(element..
I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK's since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path but that is hard to maintain...
When trying to register for push notifications under iOS 8.x:
application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType..
The question is: How do i insert the variable (echo $url_endpoint;) as a part of the link in the last line: header('Location: http://linkhere.com/HERE_I_WANT_THE_VARIABLE');
<?php
$url_endpoint = ..
So, I've got a bunch of content that was delivered to us in the form of Excel spreadsheets. I need to take that content and push it into another system. The other system takes its input from an XML fi..
I thought .net had some kind of easy conversion method to use for converting an int into a byte array? I did a quick search and all solutions are bit masking/shifting one byte at a time, like "the goo..
What I am trying to implement is basically a "on ng repeat finished rendering" handler. I am able to detect when it is done but I can't figure out how to trigger a function from it.
Check the fiddle:..
I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller:
$scope.initRestId = function(){
var catapp = document.g..
When I do a merge conflict resolution with Kdiff3 (and other merge tool I tried) I noticed that on resolution a *.orig file is created. Is there a way for it to not create that extra file?..
Shall this be the example:
#include <iostream>
using namespace std;
int main()
{
cout << "Hola, moondo.\n";
}
It throws the error:
gcc -c main.cpp gcc -o edit main.o main.o: In fu..
I'm having an issue that is driving me crazy. I'm trying to modify the openid-selector to support facebook. I'm using RPXNow as my provider so it requires the form to be submitted to a different url t..
I have made an XML Schema - all the code basically - and was wondering if there is a way that the code can generate something like this:
If so how can I do it?..
json.net (newtonsoft)
I am looking through the documentation but I can't find anything on this or the best way to do it.
public class Base
{
public string Name;
}
public class Derived : Base
{
..
So I want to iterate for each character in a string.
So I thought:
for (char c : "xyz")
but I get a compiler error:
MyClass.java:20: foreach not applicable to expression type
How can I do this?..
I am fairly new to python.
I am trying to make a script that will read sudoku solutions and determent if they are correct or not.
Things I need:
1] Prompt the user to enter a file/file path which i..
You can set the initial size for an ArrayList by doing
ArrayList<Integer> arr=new ArrayList<Integer>(10);
However, you can't do
arr.add(5, 10);
because it causes an out of bounds exc..
I have a navigation bar on the left hand side of my page, and I want it to stretch to 100% of the page height. Not just the height of the viewport, but including the areas hidden until you scroll. I d..
I've tried to install Font Awesome using Laravel Mix but when executing run npm dev I get the following message:
ERROR Failed to compile with 1 errors
error in ./~/font-awesome/scss/font-aweso..
I need to have such thin line for the whole table as seen above. The above image is a sample only. My solution, doesn't work. The table shows no border at all.
Here is my CSS:
table {
border-w..
I'm trying to install an apache server on my AWS instance, however, it seems that it doesn't have the apt package installed.
I googled and all I found was some broken links to this package. I am usin..
I just installed the ADO.NET connector from here http://dev.mysql.com/downloads/connector/net/
Yet MySQL doesn't appear as a data source like it should. I tried restarting Visual Studio. It doesn't f..
I'm trying to send a call using Ajax but in Chrome it is rising error but in Firefox there is no error. But still it can't calling the method. I tried to record my call in Firebug but there is no call..
I am running Python 2.7 in Visual Studio 2013. The code previously worked ok when in Spyder, but when I run:
import numpy as np
import scipy as sp
import math as mt
import matplotlib.pyplot as plt
im..
My Activity is trying to create an AlertDialog which requires a Context as a parameter. This works as expected if I use:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
However, I am l..
How can I mock my location on a physical device (Nexus One)?
I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device...
I have users table in my MySql database. This table has id, name and age fields.
How can I delete some record by id?
Now I use the following code:
user = User.query.get(id)
db.session.delete(user)
..
I want to select records from sqlite3 database by string matching. But if I use '=' in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-ins..
How can I remove a line (or lines) of a matplotlib axes in such a way as it actually gets garbage collected and releases the memory back? The below code appears to delete the line, but never releases..
My site uses http and https protocol; it doesn't affect the content. My site uses jQuery ajax calls, which fills some areas on the page, too.
Now, I would like to do all ajax calls over https. (plea..
int temp = 0x5E; // in binary 0b1011110.
Is there such a way to check if bit 3 in temp is 1 or 0 without bit shifting and masking.
Just want to know if there is some built in function for this, or ..
Possible Duplicate:
How to generate a vector containing a numeric sequence?
In R, how can I get the list of numbers from 1 to 100? Other languages have a function 'range' to do this. R's ra..
I recently came to know about the availability of IIF function in SQL Server 2012. I always use nested CASE in my queries. I want to know the exact purpose of the IIF statement and when should we pref..
I have been looking at jquery plugin and was wondering how to adapt that plugin to turn a number (like 4.8618164) into a 4.8618164 stars filled out of 5. Basically interpreting a number <5 into sta..
I have an image that is 6400 × 3200, while my screen is 1280 x 800. Therefore, the image needs to be resized for display only. I am using Python and OpenCV 2.4.9.
According to OpenCV Documentation,
..
In Sublime, we have an easy and convent way to run Python or almost any language for that matter using ? + b (or ctrl + b)
Where the code will run in a small window below the source code and can easi..
very new to mongodb and databases in general. whenever i run mongo i receive this error message:
MongoDB shell version: 2.4.9
connecting to: test
Thu Jan 30 13:03:33.170 Error: ..
If I execute set PATH=%PATH%;C:\\Something\\bin from the command line (cmd.exe) and then execute echo %PATH% I see this string added to the PATH. If I close and open the command line, that new string ..
I have a :not css selector in SASS mixin but it doesn't do anything:
Code Snippet:
@mixin dropdown-pos($pos:right) {
&:not(.notip) {
@if $comp-tip == true{
@if $pos == right {
..
In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web applicat..
I would like make a countDown with Angular js. this is my code:
Html File
<div ng-app ng-controller = "countController"> {{countDown}} <div>??????????????????????????????????????????????..
I need to compile a jar file using ant (1.7.0) to run under a specific version of Java (1.5). I currently have Java 1.6 on my machine. I have tried setting:
<target name="compile">
<javac ..
I have folder run in folder system32. When I run cmd from within Total Commander opening a command prompt window with C:\Users\admin as current directory and want to go into that folder, the following..
I'm new to Python. I need to query items from a dict and save the result to a text file. Here's what I have:
import json
import exec.fullog as e
input = e.getdata() #input now is a dict() which has ..
How does one get date-1 and format it to mm-dd-yyyy in PowerShell?
Example: If today is November 1, 2013, and I need 10-31-2013 in my code.
I've used AddDays(-1) before, but I can't seem to get it t..
I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web API. I have a UsersController, and I want to have a method named Authenticate. I see examples of how to do GetAll, GetOne, Post, and De..
I'm getting this error in Firefox's Console: SecurityError: The operation is insecure and the guilty is HTML5 feature: window.history.pushState() when I try to load something with AJAX. It is supposed..
I need to get the access token from FB.login method in Javascript SDK. My login code is
FB.login(function(response) {
if (response.session) {
if (response.perms) {
} else {
..
I m trying to send a simple mail using IPython. I have not set up any models still getting this error. What can be done?
Error :
/home/sourabh/Django/learn/local/lib/python2.7/site-packages/djan..
I have a main div in my page with a specific id. Now some input elements of the same class are present in this div. So how can I count the number of these elements of same class in this div using jQue..
I would like a RegExp that will remove all special characters from a string. I am trying something like this but it doesn’t work in IE7, though it works in Firefox.
var specialChars = "!@#$^&%*..
I am trying to GET a URL using Python and the response is JSON. However, when I run
import urllib2
response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/XXXXXX')
html=response.rea..
There are quite a few modules which are listed on node's github page but are not published with the npm-registry. These modules can't be installed using npm.
What is the correct way to install these..
I am working on something fairly simple, well I thought it would be.
What I want is when button1 is clicked I want it to disable button1 and enable button2. I get the error below:
Error 1 Only ass..
I am trying to pass a parameter to a WordPress site using a URL - for instance:
www.fioriapts.com/?ppc=1 will be the URL.
I am intending to write a function in the functions.php file but the mecha..
How can I use the DISTINCT clause with WHERE? For example:
SELECT * FROM table WHERE DISTINCT email; -- email is a column name
I want to select all columns from a table with distinct email addresse..
I have a program that does some data analysis and is a few hundred lines long.
Very early on in the program, I want to do some quality control and if there is not enough data, I want the program to..
How do I iterate over a Java array of variable length.
I guess I would setup a while loop, but how would I detect that I have reached the end of the array.
I guess I want something like this [just ..
I don't completely understand how wait and notify (of Object) work, and as a result I'm forced to slim down my attempts into the following section of code.
Main.java:
import java.util.ArrayList;
cl..
I can't get autocompletion to work on Eclipse.
I'm working on the project on svn. I set up project in Eclipse by going into
File -> Import -> Checkout As a Project -> New Project Wizard.
I choos..
I need to install OpenSSL on my python2.7.
I tried
$ pip install pyopenssl
And I got the following
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'..
I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirel..
The code below crops the image well, which is what i want, but for larger images, it wotn work as well. Is there any way of 'zooming out of the image'
Idealy i would be able to have each image roughl..
How can I create a larger space between each link on my navbar, so they are further apart?
Is it something I change the CSS or HTML?
Here's how I've implemented my navbar in the html:
<div class="..
In a WPF application, when a user clicks on a button I want to open the Windows explorer to a certain directory, how do I do that?
I would expect something like this:
Windows.OpenExplorer("c:\test")..
I have two maps declared as Map<String, Object>. The Object here could be another Map<String, Object> (and so on). I want to check if two maps are exactly the same without knowing their de..
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 just wondering, if I need a toolbox which not available in my MATLAB, how do I do that? For example: if I need image processing toolbox, how do I get it?..
I'm building a query with a GROUP BY clause that needs the ability to count records based only on a certain condition (e.g. count only records where a certain column value is equal to 1).
SELECT UID..
I am trying to pass array parameter to SQL commnd in C# like below, but it does not work. Does anyone meet it before?
string sqlCommand = "SELECT * from TableA WHERE Age IN (@Age)";
SqlConnection sq..
I have a form that allows the user to either upload a text file or copy/paste the contents of the file into a textarea. I can easily differentiate between the two and put whichever one they entered in..
I am using the following code to use the date in a specific format and running into following error..how to put date in m/d/y format?
from datetime import datetime, date
def main ():
cr_date = '..
How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process)
Thanks,..
I'm pretty new to Angular so I'm not sure the best practice to do this.
I used angular-cli and ng new some-project to generate a new app.
In it created an "images" folder in the "assets" folder, s..
I just typed the follow to try and get my SharePoint site:
$spWeb = Get-SPWeb -Identity "http://nycs00058260/sites/usitp"
It gave me the following error
The term 'Get-SPWeb' is not recognized a..
I am trying to get 25 random samples of 15,000 IDs from a table. Instead of manually pressing run every time, I'm trying to do a loop. Which I fully understand is not the optimum use of Postgres, but ..
In a piece of software, I merge two arrays with array_merge function. But I need to add the same array (with the same keys, of course) to an existing array.
The problem:
$A = array('a' => 1, 'b'..
I want the user to give me the full path where the file exists and not just the file name. How do I open the file this way?
Is it something like this:
ifstream file;
file.open("C:/Demo.txt", ios::in..
In Maven2, to exclude a single transitive dependency, I have to do something like this:
<dependency>
<groupId>sample.group</groupId>
<artifactId>sample-artifactB</artif..
Following this python example, I encode a string as Base64 with:
>>> import base64
>>> encoded = base64.b64encode(b'data to be encoded')
>>> encoded
b'ZGF0YSB0byBiZSBlbmNvZ..