I'm in the middle of updating my DNS setup to use all CNAMEs instead of A records, because I need support for VIP swaps between Staging and Production. I can't use A records for this because that put..
In a django online course, the instructor has us use the url() function to call views and utilize regular expressions in the urlpatterns list. I've seen other examples on youtube of this.
e.g.
from d..
I'm following the Django tutorial https://docs.djangoproject.com/es/1.10/intro/tutorial01/
I've created a "mysite" dummy project (my very first one) and try to test it without altering it.
django-a..
With Retrofit 2, you can set a full URL in the annotation of a service method like :
public interface APIService {
@GET("http://api.mysite.com/user/list")
Call<Users> getUsers();
}
Howev..
I have a simple class written in Android Studio:
package com.mysite.myapp;
import org.apache.http.client.HttpClient;
public class Whatever {
public void headBangingAgainstTheWallExample () {
..
Please read this carefully. Please do not send me a link on how to import a certificate.
I I am using Postman for QA and testing work. I have a test system I frequently rebuild myself and so it is co..
In my error log i get
[emerg] 10619#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/mysite.com:4
on Line 4 I have:
server_name mysite.com www.mysite.com;
Any sugge..
I'm having trouble configuring SSL on a Debian 6.0 32bit server. I'm relatively new with SSL so please bear with me. I'm including as much information as I can.
Note: The true domain name has been cha..
I am working with configuring Django project with Nginx and Gunicorn.
While I am accessing my port gunicorn mysite.wsgi:application --bind=127.0.0.1:8001 in Nginx server, I am getting the following e..
I have been working on building an Rest API for the hell of it and I have been testing it out as I go along by using curl from the command line which is very easy for CRUD
I can successfully make the..
I am building a website with CodeIgniter, I have various resources that I load with the base_url helper function like this
<link rel="stylesheet" type="text/css" href="'.base_url('assets/css/them..
I have a CentOS server on which I have Apache, Django, Django CMS and mod_wsgi. My Django project files are stored in the /srv directory and I have SELinux turned on for security reasons.
I've manag..
I've read the official documentation and all they say is that I should have a error_reporting() function located at the top of your main index.php file. But I don't have index.php file in my project. ..
I'm using Nginx as a proxy to filter requests to my application. With the help of the "http_geoip_module" I'm creating a country code http-header, and I want to pass it as a request header using "head..
I have 3 domain names and am trying to host all 3 sites on one server (a Digital Ocean droplet) using Nginx.
mysite1.name
mysite2.name
mysite3.name
Only 1 of them works. The other two result in 403..
My current urls look like this [mysite]index.php/[rest of the slug].
I want to strip index.php from these urls.
mod_rewrite is enabled on my apache2 server. In config, $config['index_page'] = '';
..
I'm trying to put my app into production and image and css asset paths aren't working.
Here's what I'm currently doing:
Image assets live in /app/assets/images/image.jpg
Stylesheets live in /app/a..
So I have a httpd server running which has links to a bunch of files. Lets say the user selects three files from a file list to download and they're located at:
mysite.com/file1
mysite.com/file2
my..
When I attempt to run "mvn generate-sources" this is my output :
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J:..
Following the tutorial found here exactly, I cannot create a custom 500 or 404 error page. If I do type in a bad url, the page gives me the default error page. Is there anything I should be checking f..
I am working with WordPress 3.5.8. Yesterday I made some changes into it to a friend. I don't know what happened, but after some time when I try to log in at wp-admin side and execute URL www.mysite.c..
HTML:
<a href="mysite.com/uploads/asd4a4d5a.pdf" download="foo.pdf">
Uploads get a unique file name while there real name is kept in database. I want to realize a simple file download. But th..
I am receiving this error "Warning: Illegal string offset 'type' in /home/mysite/public_html/wp-content/themes/evento/lib/php/extra.class.php on line 32"
and I realized this section of code in the fi..
I have some JavaScript code that I need to convert to C#. My JavaScript code POSTs some JSON to a web service that's been created. This JavaScript code works fine and looks like the following:
var vm..
I'd like to ask about HTML tag
<a href="www.mysite.com" onClick="javascript.function();">Item</a>
How to make this a tag working with href and onClick? (prefer onClick running first th..
I have a class and when I try to use it in another class I receive the error below.
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
..
I have several sets of static .html files on my server, and I would like use nginx to serve them directly. For example, nginx should serve an URI of the following pattern:
www.mysite.com/public/doc/f..
when I had my site on development environment - it was url: testurl.com
Now on production server my codeigniter app's address has to be someurl.com/mysite/
I moved it there, and everytime I'm trying..
I've just started learning the Laravel framework and I'm having an issue with routing.
The only route that's working is the default home route that's attached to Laravel out of the box.
I'm using WA..
I can't believe PHP doesn't have an easy solution for this simple matter. ASP.NET has a ~ sign that takes care of this issue and starts everything from the root level. Here's my problem:
localhost/MyS..
My question is similar to this:
ASP.NET MVC 4 Minification & Background Images
Except that I want to stick with MVC's own bundling if I can. I'm having a brain crash trying to figure out wha..
I'm working with XAMPP on Mac OS X.
I'm trying to run a Symfony website properly for a client, and I really don't know Symfony (yet). I just want to install and launch it.
I've changed my /etc/hosts f..
My all applications were working fine but suddenly all sites under IIS are not loading css, images, scripts. It redirect to login page.
If i login it works fine. e.g. mysite.com/Account/LogOn?Return..
I've been using json_encode for a long time, and I've not had any problems so far.
Now I'm working with a upload script and I try to return some JSON data after file upload.
I have the following code..
I have an images folder at the following URL.
www.mysite.com/uploads/
On a different page:
www.mysite.com/search.php/
I am trying to access the images wherein, with a correct tag link, however ..
How do I include special characters like @ and & in the cURL POST data? I'm trying to pass a name and password like:
curl -d name=john passwd=@31&3*J https://www.mysite.com
This would cause..
I have a website which slides to a "section" called blog in my HTML. I want the user to simply see the page for a brief second or 2 then redirect to my blog engine.
Please suggest a time delayed redi..
I recently upgrade Django from v1.3.1 to v1.4.
In my old settings.py I have
TEMPLATE_DIRS = (
os.path.join(os.path.dirname( __file__ ), 'templates').replace('\\', '/'),
# Put strings here, ..
I created a virtualenv around my project, but when I try to activate it I cannot.
It might just be syntax or folder location, but I am stumped right now.
You can see below, I create the virtualenv an..
I'm new to Java and Android development and try to create a simple app which should contact a web server and add some data to a database using a http get.
When I do the call using the web browser in ..
I'm looking for a way to include a slide effect for when you click a link to a local anchor either up or down the page.
I'd like something where you have a link like so:
<a href="#nameofdivetc"&g..
What is the "less code needed" way to get parameters from a URL query string which is formatted like the following?
www.mysite.com/category/subcategory?myqueryhash
Output should be: myqueryhash
..
I keep getting this error when trying to configure the upload directory with Apache 2.2 and PHP 5.3 on CentOS.
In php.ini:
upload_tmp_dir = /var/www/html/mysite/tmp_file_upload/
In httpd.conf:
Direct..
I am using nginx on Rackspace cloud following a tutorial and having searched the net and so far can't get this sorted.
I want www.mysite.com to go to mysite.com as normal in .htaccess for SEO and oth..
I've followed Adam's answer here and the Entity Framework now works and the Seed() method also works.
But when I try to access the database like this:
public User FindUserByID(int id)
{
..
Why am I getting this error when my git repository url is correct?
jitendra@JITENDRA-PC /c/mySite (master)
$ git push beanstalk master
fatal: '[email protected]/gittest.git' does not appear ..
I've been looking for an efficient way to do this but haven't been able to find it, basically what I need is that given this url for example:
http://localhost/mysite/includes/phpThumb.php?src=http://..
I am using Windows Server 2008 with IIS7. I need to redirect the users who come to www.mysite.com to wwww.mysite.com/menu_1/MainScreen.aspx. Here is the file structure I have for the projects:
-Sites..
I am trying to create a simple configuration file that looks like this
url = http://mysite.com
file = main.exe
true = 0
when the program runs, I would like it to load the configuration settings int..
I am facing the same-origin policy problem, and by researching the subject, I found that the best way for my particular project would be to use JSONP to do cross-origin requests.
I've been reading th..
I´m using the Selenium IDE for Firefox and searching for a wait command.
My problem is that I want to test a website with a embedded external map.
This external map needs 3-5 seconds to load.
My com..
Possible Duplicate:
Modify Address Bar URL in AJAX App to Match Current State
How can I change the URL address without redirecting the page?
For instance, when I click on this link below:
..
If I use:
alert(window.location.href);
I get everything including query strings. Is there a way to just get the main url part, for example:
http://mysite.com/somedir/somefile/
instead of
http:..
I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button.
For example, sharing a link to..
Is there a specification somewhere listing the correct way to pass GET variables to a URL?
Normally I do it like this (first variable indicated by ?, second and subsequent indicated by &:
http:/..
I can't find the right selector for:
<input maxlength="6" size="6" id="colorpickerField1" name="sitebg" value="#EEEEEE" type="text">
I want to change the value to = 000000. I need the selecto..
I'm trying to upload an image via the Django admin and then view that image either in a page on the frontend or just via a URL.
Note this is all on my local machine.
My settings are as follows:
MED..
I am using Google Maps V3 and I want to:
Set the center of the map to a particular latlng. I am using:
map.setCenter(new google.maps.LatLng(mylat,mylong));
Set a point in that center spot. I am cu..
This is my error:
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install lxml
Downloading/unpacking lxml
Running setup.py egg_info for package lxml
Building lxml version 2.3.
Build..
This is the error I get
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded..
I have this testing code in "PAGE A":
<?php
require_once('../mysite/php/classes/eventManager.php');
$x=new EventManager();
$y=$x->loadNumbers();
?>
"eventManager.php" has inside a require_..
While calling a web service I get the following error:
The HTTP request is unauthorized with client authentication scheme 'NTLM'. The authentication header received from the server was 'NTLM'. The..
I'm trying to save an image to a folder in .NET C# but I get this exception:
Access to the path 'C:\inetpub\wwwroot\mysite\images\savehere' is denied.The error occured at mscorlib because at System..
By default after login django redirects the user to an accounts/profile page or if you edit the LOGIN_REDIRECT_URL you can send the user to another page you specify in the settings.py.
This is great ..
this is probably a silly question and I have the answer myself but I want to know if I am doing anything wrong. I have a website, let's call it www.mysite.com. Within this site, I have some FAQs but t..
I'm trying to integrate my project with Facebook. I'm taking baby steps at first and just trying to login, get a Facebook session, and get some user data. I'm developing it locally so my Facebook appl..
I have the following URL:
http://www.mysite.co.uk/?location=mylocation1
I need to get the value of location from the URL into a variable and then use it in jQuery code:
var thequerystring = "get..
How do I get user's IP in django?
I have a view like this:
# Create your views
from django.contrib.gis.utils import GeoIP
from django.template import RequestContext
from django.shortcuts import ren..
In C# ASP.net, could someone show me how I can write entries from an Array/List to a CSV file on the server and then open the file? I think the second part would be something like - Response.Redirect(..
Okay, I have a page on and on this page I have an iframe. What I need to do is on the iframe page, find out what the URL of the main page is.
I have searched around and I know that this is not poss..
I know you can edit a hosts file to redirect a URL to an IP address as so:
127.0.0.1 google.com
but how do you force a redirect to a URL instead of an IP address?
e.g.
mysite.com/welcome.aspx goo..
Is it possible to call in a .js file synchronously and then use it immediately afterward?
<script type="text/javascript">
var head = document.getElementsByTagName('head').item(0);
var s..
I want to send HTML-emails, using Django templates like this:
<html>
<body>
hello <strong>{{username}}</strong>
your account activated.
<img src="mysite.com/logo.gif" />..
How do I install Soap?
I got this error:
Fatal error: Class 'SoapClient' not found in /home/user/mysite.com/path/to/file.php on line 16
I am hosting my site in DreamHost and they don't support..
I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it.
However, every time I try t..
I'm using Versions for SVN.
I attempt to commit and get this message:
Commit failed (details follow):
'/Users/mike/Sites/mysite.com/astss-cvsdude/Trunk/cart/flashfile.swf'
is scheduled for ad..
At home I have a simple network setup containing 2 machines.
On one machine i have a site hosted with IIS7. Rather than the standard localhost/index.htm address I have added an entry in the HOSTS fil..
Example: I'm checking for the existence of an array element like this:
if (!self::$instances[$instanceKey]) {
$instances[$instanceKey] = $theInstance;
}
However, I keep getting this error:
Not..
I'm totally new to this web development stuff. So I see things like "localhost" all the time and ask myself: What's that?
I feel to know what a "host" actually is. Something that executes something...
I need to have an action parameter that has a datetime value? Is there a standard way to do this? I need to have something like:
mysite/Controller/Action/21-9-2009 10:20
but I'm only succeeding i..
In IIS 6.0, is there an easy way to re-direct requests to a folder to another folder, while preserving the rest of the path.
e.g.
If I have moved the content from:
mysite.org.uk/stuff
to
stuff.mysit..
I am trying to create a SlugField in Django.
I created this simple model:
from django.db import models
class Test(models.Model):
q = models.CharField(max_length=30)
s = models.SlugField()
..
Is there a way I can modify the URL of the current page without reloading the page?
I would like to access the portion before the # hash if possible.
I only need to change the portion after the doma..
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..
Can anyone help me please to solve this..
from django.db import models
# Create your models here.
class Poll(models.model):
question = models.CharField(max_length=200)
pub_date = models.Date..
I have a web directory where I store some config files. I'd like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like:
http://mysit..
I have a string that has numbers
string sNumbers = "1,2,3,4,5";
I can split it then convert it to List<int>
sNumbers.Split( new[] { ',' } ).ToList<int>();
How can I convert string ar..
I would like to implement a loading image for my jquery ajax code (this is when the jquery is still processing) below is my code:
$.ajax({
type: "GET",
url: surl,
dataType: "jsonp",
c..
I need to write a function that generates an id that is unique for a given machine running a Windows OS.
Currently, I'm using WMI to query various hardware parameters and concatenate them together an..
I've created a small test app which represents my problem.
I'm using ActionBarSherlock to implement tabs with (Sherlock)Fragments.
My code:
TestActivity.java
public class TestActivity extends Sherlo..
I have a javascript function to which I pass a parameter. The parameter represents the id of an element (a hidden field) in my web page. I want to change the value of this element.
function myFunc(va..
How do you create a static class in C++? I should be able to do something like:
cout << "bit 5 is " << BitParser::getBitAt(buffer, 5) << endl;
Assuming I created the BitParser cla..
I'm working on a website using bootstrap.
Basically, I wanted to use a modal in the home page, summoned by the button in the Hero Unit.
Button code:
<button type="button"
class="btn btn-war..
I'm trying to undo all changes since my last commit. I tried git reset --hard and git reset --hard HEAD after viewing this post. I responds with head is now at 18c3773... but when I look at my local s..
These StackOverflow questions here, here, and here all say the same thing, but I can't get it to run in SSMS or SQLFiddle
CREATE TABLE #Names
(
Name1 VARCHAR(100),
Name2 VARCHAR(100)
)
..
After installing Android studio and creating a new project, I get the following error:
Unknown host 'services.gradle.org'.
Please ensure the host name is correct. If you are behind an HTTP
..
I am starting to use TypeScript in a Node project I am working on in Visual Studio Code. I wanted to follow the "opt-in" strategy, similar to Flow. Therefore I put // @ts-check at the top of my .js fi..
Is it possible to focus on a <div> using JavaScript focus() function?
I have a <div> tag
<div id="tries">You have 3 tries left</div>
I am trying to focus on the above <d..
I'm trying to pass a variable into an include file. My host changed PHP version and now whatever solution I try doesn't work.
I think I've tried every option I could find. I'm sure it's the simplest ..
How many digits can latitude and longitude have, before the decimal, and after the decimal?
Here is an example I am getting from the location sent by a Windows Phone device:
Latitude=-63572375290155
L..
I am in the process of building a Chrome extension, and for the whole thing to work the way I would like it to, I need an external JavaScript script to be able to detect if a user has my extension ins..
It's my first time using FCM.
I download a sample from firebase/quickstart-android and I install the FCM Quickstart. But I can't get any token from the log even hit the LOG TOKEN button in the app.
Th..
Possible Duplicate:
How do I save a stream to a file?
I have got a stream object which may be an image or file (msword, pdf), I have decided to handle both types very differently, as I may ..
I am sent an XML string that I'm trying to parse via an XmlReader and I'm trying to strip out the \" characters.
I've tried
.Replace(@"\", "")
.Replace("\\''", "''")
.Replace("\\''", "\"")
plus s..
In windows form, It has a ComboBox, Which have data binded by the DataSource.
When going to set the text property for a ComboBox.
Selected ComboBox -> Property -> Text : "--Select--".
Design ..
I am trying to check if a dictionary is empty but it doesn't behave properly. It just skips it and displays ONLINE without anything except of display the message. Any ideas why ?
def isEmpty(self, dic..
I need to recursively search for a specified string within all files and subdirectories within a directory and replace this string with another string.
I know that the command to find it might look l..
I'm using the Google Maps JavaScript API V3 and the official examples always have you include this meta tag:
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
Most of the..
On a class library project, I set the "Start Action" on the Debug tab of the project properties to "Start external program" (NUnit in this case). I want to set an environment variable in the environme..
Consider:
struct mystruct_A
{
char a;
int b;
char c;
} x;
struct mystruct_B
{
int b;
char a;
} y;
The sizes of the structures are 12 and 8 respectively.
Are these structures padded..
I've uploaded a sketch to an Arduino Uno whose loop is something like this:
void loop(){
Serial.println("Hello, World!");
}
So, now, I can't upload anything anymore, because the IDE says "port ..
What's the difference between spark.sql.shuffle.partitions and spark.default.parallelism?
I have tried to set both of them in SparkSQL, but the task number of the second stage is always 200...
I have JavaScript that is doing activity periodically. When the user is not looking at the site (i.e., the window or tab does not have focus), it'd be nice to not run.
Is there a way to do this using..
How can I get the nav div to have expand down or have the height the same as its parent div?
_x000D_
_x000D_
* {_x000D_
border:0; _x000D_
padding:0; _x000D_
margin:0;_x000D_
}_x000D_
#c..
I was looking to represent a carriage return within an xml node.
I have tried a whitespace preserve, hex entity with no luck-
and a \n. viewing via a browser.
Example
<Quote>
Alas, poor..
I am trying to install python and a series of packages onto a 64bit windows 7 desktop. I have installed Python 3.4, have Microsoft Visual Studio C++ installed, and have successfully installed numpy, p..
I've recently started programming in Ruby, and I am looking at exception handling.
I was wondering if ensure was the Ruby equivalent of finally in C#? Should I have:
file = File.open("myFile.txt", "..
This is my (rough) code (DAL):
int i;
// Some other declarations
SqlCommand myCmdObject = new SqlCommand("some query");
conn.open();
i = myCmdObject.ExecuteNonQuery();
conn.close();
The problem i..
I'm looking for some kind of formula or algorithm to determine the brightness of a color given the RGB values. I know it can't be as simple as adding the RGB values together and having higher sums be..
Does anyone know of a way, or even if its possible, to call a stored procedure from within another? If so, how would you do it?
Here is my test code:
SET SERVEROUTPUT ON;
DROP PROCEDURE test_sp_1;
..
this is my javascript:
function getWeather() {
$.getJSON('getTemperature/' + $('.data option:selected').val(), null, function(data) {
alert('Success'); ..
Is there a style for a select option's "selected" color? For example:
<HTML>
<BODY>
<FORM NAME="form1">
<SELECT NAME="mySelect" SIZE="7" style="background-color:red;">
<OPT..
I'm new to Grunt. I'm trying to configure Grunt on my Mac OSX Lion.
I followed the instructions here and then created a project folder that contains the files below. When I try to run by typing "gru..
I'm getting an error when I try to call a non-static method in a static class.
Cannot make a static reference to the non-static method methodName() from the type playback
I can't make the method..
In regards to adding an key => value pair to an existing populated hash in Ruby, I'm in the process of working through Apress' Beginning Ruby and have just finished the hashes chapter.
I am tryin..
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 @..
When running the following code (in Python 2.7.1 on a mac with Mac OS X 10.7)
while True:
return False
I get the following error
SyntaxError: 'return' outside function
I've carefully checked..
I have a jQuery UI draggable() that works in Firefox and Chrome. The user interface concept is basically click to create a "post-it" type item.
Basically, I click or tap on div#everything (100% high ..
I edited the apache httpd.conf file recently for the mod_rewrite to work. I don't know if this problem originated from that or not, but i'm getting this problem from that day.
This is what I see on th..
In Linux I want to add a daemon that cannot be stopped and which monitors filesystem changes.
If any changes are detected, it should write the path to the console where it was started plus a newline.
..
Here is my code. I keep getting this error:
error: expected primary-expression before ')' token
Anyone have any ideas how to fix this?
void showInventory(player& obj) { // By Johnny :D
fo..
What the best way to simulate the user pressing "enter"? $(element).keypress() doesn't seem to allow me to pass in the actual key that was pressed.
This is for unit testing. ..
I have a list of locations that i want to implement as a dropdown list in Flutter. Im pretty new to the language. Here's what i have done.
new DropdownButton(
value: _selectedLocation,
onChanged:..
Can someone show me a sample SQL server script that I can look at that uses the "With Clause"?
I am trying to use this clause to iterate through 200 databases that contain the same table that I am ..
Possible Duplicate:
Why does C# not provide the C++ style ‘friend’ keyword?
I'd like the private member variables of a class to be accessible to a Tester class without exposing them to ..
I am still new in the React Native world, and generally in the mobile/native world as well, and I am finding the documentation a bit lacking when it comes to data persistence.
What are my options for..
I have some problem with Html.ValidationSummary. I don't want to display property errors in ValidationSummary. And when I set Html.ValidationSummary(true) it does not display error messages from Model..
I have date stored as string in an sqlite database like "28/11/2010".
I want to convert the string to date.
Specifically I have to convert lots of string dates between two dates.
In postgresql, I ..
Is there a good technique to make a resizable split pane in HTML?
May it be done using CSS / jQuery / JavaScript or is there a good JavaScript library that have been used?
(An example of a split pane ..
I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file
I was wondering if there i..
What solutions accomplish the same auto-completion that SO uses for entering tags?
There are plugins that can handle one word but I haven't seen any that handle multiple words...
At work we have to use a proxy to basically access port 80 for example, we have our own custom logins for each user.
My temporary workaround is using curl to basically login as myself through a proxy..
I am having problems adding all the elements of an array as well as averaging them out. How would I do this and implement it with the code I currently have? The elements are supposed to be defined as ..
players will either be empty or a comma separated list (or a single value). What is the easiest way to check if it's empty? I'm assuming I can do so as soon as I fetch the $gameresult array into $game..
Possible Duplicate:
Getting method parameter names in python
Is there an easy way to be inside a python function and get a list of the parameter names?
For example:
def func(a,b,c):
p..
When I type require(xlsx) in order to load the package xlsx in R, the following messages is shown:
> require(xlsx)
Loading required package: xlsx
Loading required package: xlsxjars
Loading require..
I have two questions, actaully...
First off, Why cant I do this:
List<Object> object = new List<Object>();
And second, I have a method that returns a List<?>, how would I turn tha..
Possible Duplicate:
How do you disable browser Autocomplete on web form field / input tag?
I am building an application which will be accepting credit card data. I would like to make sure th..
I have a View controller displaying some information (not table views).
I have an update call to a remote server which fills my data base. I would like to completely reload my ViewController after th..
I found, that there is related question, about how to find if at least one item exists in a list:
How to check if one of the following items is in a list?
But what is the best and pythonic way to fin..
Hi I'm trying to use the function setTimeout() in javascript except it's not working. Thanks in advance to anyone who can help.
<!DOCTPYE html>
<html>
<head>
<script>
..
Looking through the documentation for the Postgres 9.4 datatype JSONB, it is not immediately obvious to me how to do updates on JSONB columns.
Documentation for JSONB types and functions:
http://w..
I need to redirect to specific url after 5 seconds after putting an error message. First i have used Javascript as below.
document.ready(window.setTimeout(location.href = "https://www.google.co.in",5..
I want a bash command that I can pipe into that will sum a column of numbers. I just want a quick one liner that will do something essentially like this:
cat FileWithColumnOfNumbers.txt | sum
..
I want to edit my host file to forward a website to another IP, but that IP is on a shared host, so the IP doesn't take me to the domain I want. Is there a way around this?
i.e.
Website: http://some..
I'm using Bootstrap for my JSP page.
I want to use <fieldset> and <legend> for my form. This is my code.
<fieldset class="scheduler-border">
<legend class="scheduler-border"..
When using flowplayer with the bandwidth check plugin , you need to state the bitrates for the different video quality.
Here what it looks like:
// the bitrates, video width and file names for thi..
I am trying to insert or edit the bit value to "0" or "1", but either returns me a blank.
Could someone tells me how to insert the value in it?
Also, Is that possible to not use bit type but Boolean..
Using the Google Geocoder v3, if I try to geocode 20 addresses, I get an OVER_QUERY_LIMIT unless I time them to be ~1 second apart, but then it takes 20 seconds before my markers are all placed.
Is t..
I come from PHP world, where declaring a function in the middle of a php page is pretty simple.
I tried to do the same in JSP:
public String getQuarter(int i){
String quarter;
switch(i){
case 1: ..
I need to create border as per the below example.
HTML:
<table width="770">
<tr>
<td>picture (border only to the left and bottom ) </td>
<td>text</td>..
When creating email messages you are supposed to set the Content-Type to multipart/alternative when sending HTML and TEXT or multipart/mixed when sending TEXT and attachments.
So what do you do if yo..
On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start a..
I did like below in xml
<TableRow>
<TextView android:id="@+id/address1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="..
I am getting the error "Uncaught RangeError: Maximum call stack size exceeded" on chrome. here is my jQuery function
$('td').click(function () {
if ($(this).context.id != null && $(th..
I've been struggling with this and can't find a reason why my code is failing to properly read from a TCP server I've also written. I'm using the TcpClient class and its GetStream() method but somethi..
I have been trying text to go in a vertical direction like we can do in ms-word tables but so far I have only been able to do THIS... which I am not happy with because it's a box rotated... Isn't ther..
I'm using Selenium WebDriver, how can I check if some text exist or not in the page? Maybe someone recommend me useful resources where I can read about it. Thanks..
I have used Twitter Bootstrap to develop a website with the fixed container class, but now the client wants the website to be 1000px width and not 1170px. I don't use the .less files.
Is there a quic..
I'm using the PostgreSQL database for my Ruby on Rails application (on Mac OS X 10.9).
Are there any detailed instructions on how to upgrade PostgreSQL database?
I'm afraid I will destroy the data i..
How can I make a button invisible by clicking another button in HTML?
I have written like below, but it doesn't work.
<input type="button" onclick="demoShow();" value="edit" />
<script type=..
I've been through the xpath tutorials and checked many other posts, hence I'm not sure what I'm missing. I'm simply trying to find the following element by xpath:
<input class="t-TextBox" type="e..
I'm trying to add data as one by one row to a datagridview here is my code and it says:
"Index was out of range. Must be non-negative and less than the size of the collection
parameter name:inde..
I have this small piece of code
String[] words = {"{apf","hum_","dkoe","12f"};
for(String s:words)
{
if(s.matches("[a-z]"))
{
System.out.println(s);
}
}
Supposed to print
dkoe..
Which algorithm does the JavaScript Array#sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which ..
I make new branch from master with:
git checkout -b testbranch
I make 20 commits into it.
Now I want to squash those 20 commits. I do that with:
git rebase -i HEAD~20
What about if I don't kno..
I just picked up image processing in python this past week at the suggestion of a friend to generate patterns of random colors. I found this piece of script online that generates a wide array of diffe..
I have the following problem when I try to pull code using git Bash on Windows:
fatal: could not read Username for 'https://github.com': No such file or directory
I already tried to implement the acc..
I have two applications written in Java that communicate with each other using XML messages over the network. I'm using a SAX parser at the receiving end to get the data back out of the messages. On..
How do you use the strpos for an array of needles when searching a string? For example:
$find_letters = array('a', 'c', 'd');
$string = 'abcdefg';
if(strpos($string, $find_letters) !== false)
{
..
I have a browser which sends utf-8 characters to my Python server, but when I retrieve it from the query string, the encoding that Python returns is ASCII. How can I convert the plain string to utf-8?..
I have several same HTML elements going one after another:
<span>1</span>
<span>2</span>
<span>3</span>
I'm looking for the best way of adding space BETWEEN the ..
I know I can mount a directory in my host on my container using something like
docker run -t -i -v '/on/my/host:/on/the/container' ubuntu /bin/bash
Is there a way to create more than one host-conta..
I often use this list command in Unix (AIX / KSH):
ls -Artl
It displays the files as this:
-rw-r--r-- 1 myuser mygroup 0 Apr 2 11:59 test1.txt
-rw-r--r-- 1 myuser mygroup 0 Apr 2 11:59 test2...
The following style is just an example of how to set transitions in CSS3. Is there a pure CSS trick to make this play in loop?
div {
width:100px;
height:100px;
background:red;
transi..
As someone that's new to Objective-C can someone give me an overview of the retain, assign, copy and any others I'm missing, that follow the @property directive? What are they doing and why would I wa..
I have a JAR in my Android project and I want it to be added to final APK.
Okay, here I go:
<dependency>
<groupId>com.loopj.android.http</groupId>
<artifactId..
Android Studio now supports vector assets on 21+ and will generate pngs for lower versions at compile time. I have a vector asset (from the Material Icons) that I want to change the fill color. This..
I have @Autowired service which has to be used from within a static method. I know this is wrong but I cannot change the current design as it would require a lot of work, so I need some simple hack fo..
I am trying to get started with using IIS. I created a new site on IIS Manager, mapped it to a folder on my file system and added index.html to the folder. I have set the port to 85 for this site. Whe..
I am formatting a string to a date using the code
String start_dt = '2011-01-01';
DateFormat formatter = new SimpleDateFormat("YYYY-MM-DD");
Date date = (Date)formatter.parse(start_dt);
But how d..
I'm using the node-request module, regularly sending GET requests to a set of URLs and, sometimes, getting the error below on some sites.
Error: 29472:error:140770FC:SSL routines:SSL23_GET_SERVER_HEL..
I got stuck in another situation: our users enter a text to be stored in a variable. The condition for that text is it can be allowed to enter only 25 characters, Now I have to write a regular express..
I am facing a problem with overlaying a 100% height div. I could use position fixed to solve the cover, but that's not really what I want because you should be able to scroll down on the 'cover' > so ..
I'm trying to get the name of the Python script that is currently running.
I have a script called foo.py and I'd like to do something like this in order to get the script name:
print Scriptname
..
I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:
var data = '{"count" : 1, "stack" : "sometext\n\n"}';
var dataObj = eval('(..
One of my columns is called from. I can't change the name because I didn't make it.
Am I allowed to do something like SELECT from FROM TableName or is there a special syntax to avoid the SQL Server be..
I have seen some posts relating to this but can't seem to get it to work. With the redirect I get a 'resource cannot be found error'.
I am trying to redirect to a Details page. There is an ID in ele..
I've one file, main.rb with the following content:
require "tokenizer.rb"
The tokenizer.rb file is in the same directory and its content is:
class Tokenizer
def self.tokenize(string)
r..
I have a database with 3 columns:
id, name, somethingelse
This table has no index set and i am getting "No index defined!" in phpmyadmin
id is a 7digit alphanumeric value, unique to each row.
I ..
How can I convert the str representation of a dict, such as the following string, into a dict?
s = "{'muffin' : 'lolz', 'foo' : 'kitty'}"
I prefer not to use eval. What else can I use?
The main re..
I am creating a simple RSS application and I am not that good in Objective-c. The application will always build successful and there is no errors or warnings, in the UITableView which reads the RSS, w..
I'm having trouble centering my content in the bootstrap navbar. I'm using bootstrap 3. I've read many posts, but the CSS or methods used will not work with my code! I'm really frustrated, so this is ..
I have this simple script :
var exec = require('child_process').exec;
exec('coffee -cw my_file.coffee', function(error, stdout, stderr) {
console.log(stdout);
});
where I simply execute a comm..
I have a stored procedure that uses the LIKE operator to search for a truck location among some other parameters
@location nchar(20),
@time time,
@date date
AS
select
DonationsTr..
I am in a process of figuring out how to use my university cluster. It has 2 versions of R installed. System wide R 2.11 (Debian 6.0) and R 2.14.2 in non-standard location.
I am trying to use MPI to..
My site is working great over SSL in my desktops (chrome) I have a green lock near the address bar saying "Identity verified"
But using a mobile mobile browser (Chrome/Safari)I see the following mess..
This answer is great for seeing a visual diff between two files that are checked into git:
How do I view 'git diff' output with a visual diff program?
However, I'd like to see a visual diff ..
This is mine
$art = Article::where('id',$article)->firstOrFail();
$products = $art->products;
I just wanna take a limit 'product'
This is wrong way
$products = $art->products-&..
i am trying to send multiple data using j query $.ajax method to my php script but i can pass only single data when i concatenate multiple data i get undefined index error in my php script tat means t..
I'm trying to connect an application (the client) to an exposed WCF service, but not through the application configuration file, but in code.
How should I go about doing this?..
I was trying to get a list of all python and html files in a directory with the command find Documents -name "*.{py,html}".
Then along came the man page:
Braces within the pattern (‘{}’) are ..
In my PHP page I should display two different text contents according to whether the page run under mobile or desktop browser. Is there a way to perform this control in PHP?..
Let's say I instantiate an object in Javascript like this:
var myObj = new someObject();
Now, is it possible to obtain the var object's name as string 'myObj' from within one of the class methods?
A..
I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command
mvn install:install-file -Dfile=jta-1.0.1B.ja..
I'm trying to decode a simple Base64 string, but am unable to do so. I'm currently using the org.apache.commons.codec.binary.Base64 package.
The test string I'm using is: abcdefg, encoded using PHP ..
I am attempting to get cross-compiling for Raspberry Pi working on my Ubuntu machine.
During my initial attempts I was using the arm-linux-gnueabi compiler, which is available in the Ubuntu repo. I ..
I need to display a bunch of collectionViewCells that have different heights. the views are too complex and I don't want to manually calculate the expected height. I want to enforce auto-layout to cal..
I have created a web service which is saving some data into to db. But I am getting this error:
Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASP..
Note: my auto answer at end of the post
I'm trying to make a better experience of nodeJS and i don't really like to get all the script in one file.
so, following a post here i use this structure
./..
I would like to create XML file using Java.
My XML file structure:
<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<BROWSER>chrome</BROWSER>
<BASE>http:..
I wonder what I'm doing wrong:
$(".s").keypress(function(e) {
switch (e.keyCode) {
case 8: // Backspace
//console.log('backspace');
case 9: // Tab
case 13: // Enter
c..
I'm working with a MySQL database that has some data imported from Excel. The data contains non-ASCII characters (em dashes, etc.) as well as hidden carriage returns or line feeds. Is there a way to f..
public class Foo
{
public string FooId{get;set;}
public Boo Boo{get;set;}
}
public class Boo
{
public string BooId{get;set;}
public Foo Foo{get;set;}
}
I was trying to do this in E..
I am running a MySQL Query. But when a new row is added from form input I get this error:
Error: Can't update table 'brandnames' in stored function/trigger because it is
already used by statement wh..
I have some difficulties with mySQL commands that I want to do.
SELECT a.timestamp, name, count(b.name)
FROM time a, id b
WHERE a.user = b.user
AND a.id = b.id
AND b.name = 'John'
AND a.time..
There are many ways the value of a <input type="text"> can change, including:
keypresses
copy/paste
modified with JavaScript
auto-completed by browser or a toolbar
I want my JavaScript funct..
My requirement is as follows:
I want to give actor name, start date, end date and get all the films he acted in that period.
For that reason, my service request is like this.
http://localhost:8..
I'm looking at creating a basic ORM (purely for fun), and was wondering, is there a way to return the list of tables in a database and also the fields for every table?
Using this, I want to be able t..
I have an Amazon EC2 micro instance (t1.micro). I want to upgrade this instance to large. This is our production environment, so what is the best and risk-free way to do this?
Is there any step by st..
I have some fields returned by a collection as
2.4200
2.0044
2.0000
I want results like
2.42
2.0044
2
I tried with String.Format, but it returns 2.0000 and setting it to N0 rounds the other valu..
I've seen similar questions here and here.
But am not getting how to left pad a String with Zero.
input: "129018"
output: "0000129018"
The total output length should be TEN...
Here's the call to the PUT method on my Web API - the third line in the method (I am calling the Web API from an ASP.NET MVC front end):
client.BaseAddress is http://localhost/CallCOPAPI/.
Here's ..
I am trying to discover the list of trusted authorities in my Java Runtime using the instructions in this article. When I typed the command below:
C:\ColdFusion8\runtime\jre\lib>keytool -list -sto..
I have set up a Linux Server and installed Apache and SVN and dav_svn on it. Now, when I try to upload to https://x.x.x.x:x/svn/repo with Tortoise SVN I get
Can't open file '/server/svn/repo/db/txn-..
Every time that I create a non-nullable datetime in my mvc3 application it defaults to now(), where now is current date with current time. I would like to default it to today's date with 12am as the ..
What is the best way to do the below in more functional way (with ES6/ES7)
let cols = [];
for (let i =0; i <= 7; i++) {
cols.push(i * i);
}
return cols;
I tried like,
return [ ...7 ].map(i =..
Is it possible to insert into a BLOB column in oracle using sqldeveloper?
i.e. something like:
insert into mytable(id, myblob) values (1,'some magic here');
..
How in node to split string by newline ('\n') ?
I have simple string like var a = "test.js\nagain.js" and I need to get ["test.js", "again.js"].
I tried
a.split("\n");
a.split("\\n");
a.split("\r\n"..
I am working with Microsoft Excel 2007 and I have one Numeric Column in my Sheet.
Is there any solution that I can convert it's Words equivalent?
I am attaching Excel Sheet's Screen Shot.
..
Is there any way to dynamically create and display 'n' Labels with 'n' corresponding Textboxs when we know value of 'n' after for example, clicking "Display" button.
Let me know if anything make you ..
I'm trying to use Google MAP API v3 with the following code.
<h2>Topology</h2>
<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>..
I have some pages with forms in my application.
How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really wa..
I have a shell script which conditionally calls a function.
For Example:-
if [ "$choice" = "true" ]
then
process_install
elif [ "$choice" = "false" ]
then
process_exit
fi
process_install()
{
..
For generating random numbers, I've used the formula:
(int)(Math.random() * max) + min
The formula I find on Google always seem to be:
(int)(Math.random() * (max - min) + min)
Which one's right? A..
Can we create folder with PHP code? I want that whenever a new user create his new account his folder automatically creates and a PHP file also created.Is this possible?..
The terms WAP Push and SMS Push seems to both be used when talking about pushing messages to a mobile application to trigger download of WAP content.
Do the terms refer to the same mechanism or do th..
So I basically wanna display this (whole row in ONE column):
I like [type column] cake with [icing column] and a [fruit column].
The result should be:
Cake_Column
----------------
I like chocolat..
I want to close a Excel 2010 file with VBA..
but when the code runs, it shows a prompt confirmation....
i dont want to see this prompt..
didnt work:
Application.DisplayAlerts = False
ActiveWorkbook..
I want to create a stored procedure with one argument which will return different sets of records depending on the argument. What is the way to do this? Can I call it from plain SQL?..
Is Eclipse at all theme-able? I would like to install a dark color scheme for it, since I much prefer white text on dark background than the other way around...
I am getting these kind of errors:
2014/05/24 11:49:06 [error] 8376#0: *54031 upstream sent too big header while reading response header from upstream, client: 107.21.193.210, server: aamjanata.co..
I am trying to delete uploaded image files with the AWS-SDK-Core Ruby Gem.
I have the following code:
require 'aws-sdk-core'
def pull_picture(picture)
Aws.config = {
:access_key_id =>..
In R, what is the most efficient/idiomatic way to count the number of TRUE values in a logical vector? I can think of two ways:
z <- sample(c(TRUE, FALSE), 1000, rep = TRUE)
sum(z)
# [1] 498
tabl..
This is just a snippet of my code:
print("Total score for %s is %s ", name, score)
But I want it to print out:
"Total score for (name) is (score)"
where name is a variable in a list and scor..
My dict is like,
{'A':4,'B':10,'C':0,'D':87}
I want to find max value with its key and min value with its key.
Output will be like ,
max : 87 , key is D
min : 0 , key is C
I know how to get mi..