Questions Tagged with #Mysite

How is VIP swapping + CNAMEs better than IP swapping + A records?

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..

Is it better to use path() or url() in urls.py for django 2.0?

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..

How to solve SyntaxError on autogenerated manage.py?

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..

How to download a folder from github?

I wished to download the mysite folder from this link: https://github.com/username/repository/master/..

Retrofit 2 - Dynamic URL

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..

HttpClient won't import in Android Studio

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 () { ..

How-to turn off all SSL checks for postman for a specific site

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..

nginx- duplicate default server error

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..

SSL Error: unable to get local issuer certificate

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..

(13: Permission denied) while connecting to upstream:[nginx]

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..

Curl and PHP - how can I pass a json through curl by PUT,POST,GET

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..

how to get the base url in javascript

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..

Attempt to write a readonly database - Django w/ SELinux error

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..

How to disable PHP Error reporting in CodeIgniter?

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. ..

Forward request headers from nginx proxy server

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..

Nginx 403 error: directory index of [folder] is forbidden

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..

CodeIgniter removing index.php from url

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'] = ''; ..

Rails 4: assets not loading in production

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..

How can I let a user download multiple files when a button is clicked?

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..

How to generate classes from wsdl using Maven and wsimport?

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:..

Django, creating a custom 500/404 error page

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..

wp-admin shows blank page, how to fix it?

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..

Angularjs simple file download causes router to redirect

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..

How do I correct this Illegal String Offset?

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..

POSTing JSON to URL via WebClient in C#

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..

HTML tag <a> want to add both href and onclick working

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..

A field initializer cannot reference the nonstatic field, method, or property

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 ..

Use nginx to serve static files from subdirectories of a given directory

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..

How to set proper codeigniter base url?

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..

My Routes are Returning a 404, How can I Fix Them?

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..

PHP absolute path to root

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..

MVC4 StyleBundle not resolving images

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..

Apache VirtualHost and localhost

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..

CSS, Images, JS not loading in IIS

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..

Why is json_encode adding backslashes?

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..

.htaccess file to allow access to images folder to view pictures?

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 ..

Special characters like @ and & in cURL POST data

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..

time delayed redirect?

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..

Using Python's os.path, how do I go up one directory?

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, ..

Issue with virtualenv - cannot activate

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..

Http Get using Android HttpURLConnection

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 ..

How to scroll up or down the page to an anchor using jQuery?

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..

Get URL query string parameters

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 ..

move_uploaded_file gives "failed to open stream: Permission denied" error

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..

Nginx no-www to www and www to no-www

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..

Entity Framework throws exception - Invalid object name 'dbo.BaseCs'

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) { ..

fatal: does not appear to be a git repository

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 ..

How to replace url parameter with javascript/jquery?

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://..

IIS7 URL Redirection from root to sub directory

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..

Creating a simple configuration file and parser in C++

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..

Simple jQuery, PHP and JSONP example?

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..

Selenium IDE - Command to wait for 5 seconds

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..

jquery: change the URL address without redirecting?

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: ..

How to get the URL without any parameters in JavaScript?

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:..

Sharing a URL with a query string on Twitter

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..

URL format with GET parameters?

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:/..

jQuery change input text value

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..

Django MEDIA_URL and MEDIA_ROOT

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..

Google Maps: Set Center, Set Center Point and Set more points

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..

converting a base 64 string to an image and saving it

Here is my code: protected void SaveMyImage_Click(object sender, EventArgs e) { string imageUrl = Hidden1.Value; string saveLocation = Server.MapPath("~/PictureUploads..

libxml install error using pip

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..

pip install mysql-python fails with EnvironmentError: mysql_config not found

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..

require_once :failed to open stream: no such file or directory

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_..

The HTTP request is unauthorized with client authentication scheme 'Ntlm'

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..

Access to the path is denied

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..

Django - after login, redirect user to his custom page --> mysite.com/username

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 ..

Links not going back a directory?

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..

Facebook API error 191

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..

Get querystring from URL using jQuery

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 IP address in django?

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..

check if file exists in php

if (!(file_exists(http://mysite.com/images/thumbnail_1286954822.jpg))) { $filefound = '0'; } why won't this work?..

Write to CSV file and export it?

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(..

Access parent URL from iframe

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..

Editing hosts file to redirect url?

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..

document.createElement("script") synchronously

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..

Creating email templates with Django

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 extension?

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..

ASP.NET MVC on IIS 7.5

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..

SVN (Subversion) Problem "File is scheduled for addition, but is missing" - Using Versions

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..

Viewing my IIS hosted site on other machines on my network

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..

Parse query string in JavaScript

I need to parse the query string www.mysite.com/default.aspx?dest=aboutus.aspx. How do I get the dest variable in JavaScript?..

How to check if an array element exists?

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..

What's the whole point of "localhost", hosts and ports at all?

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...

How do I pass a datetime value as a URI parameter in asp.net mvc?

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..

How to redirect a URL path in IIS?

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..

How do I create a slug in Django?

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() ..

How do I modify the URL without reloading the page?

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..

Redirect with CodeIgniter

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..

AttributeError: 'module' object has no attribute 'model'

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..

Using wget to recursively fetch a directory with arbitrary files in it

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..

Split string, convert ToList<int>() in one line

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..

How do I check if an index exists on a table field in MySQL?

I've needed to Google this a couple times, so I'm sharing my Q/A...

Jquery Ajax Loading image

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..

Generating a unique machine id

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..

Fragment MyFragment not attached to Activity

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..

Javascript Get Element by Id and set the value

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++?

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..

Bootstrap Modal immediately disappearing

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..

git undo all uncommitted or unsaved changes

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..

Insert Multiple Rows Into Temp Table With SQL Server 2012

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) ) ..

Create new project on Android, Error: Studio Unknown host 'services.gradle.org'

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 ..

js 'types' can only be used in a .ts file - Visual Studio Code using @ts-check

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..

What is token-based authentication?

I want to understand what token-based authentication means. I searched the internet but couldn't find anything understandable...

Is it possible to focus on a <div> using JavaScript focus() function?

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..

PHP pass variable to include

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 ..

What are the lengths of Location Coordinates, latitude and longitude?

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..

Check whether user has a Chrome extension installed

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..

Firebase (FCM) how to get token

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..

saving a file (from stream) to disk using c#

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 ..

Sass Nesting for :hover does not work

I've written this code, but it does not work. What is my problem? .class { margin:20px; :hover { color:yellow; } } ..

c# replace \" characters

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..

How to set combobox default value?

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 ..

Python: Checking if a 'Dictionary' is empty doesn't seem to work

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..

How to grep and replace

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..

What's the point of 'meta viewport user-scalable=no' in the Google Maps API

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..

How do I set specific environment variables when debugging in Visual Studio?

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..

Structure padding and packing

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..

How can I "reset" an Arduino board?

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 is the difference between spark.sql.shuffle.partitions and spark.default.parallelism?

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...

Is there a way to detect if a browser window is not currently active?

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 to get a div to resize its height to fit container?

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..

XML Carriage return encoding

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..

Windows Scipy Install: No Lapack/Blas Resources Found

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..

Begin, Rescue and Ensure in Ruby?

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", "..

ExecuteNonQuery doesn't return results

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..

Formula to determine brightness of RGB color

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..

What is the difference between bindParam and bindValue?

What is the difference between PDOStatement::bindParam() and PDOStatement::bindValue()?..

Call a stored procedure with another in Oracle

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; ..

Spring JSON request getting 406 (not Acceptable)

this is my javascript: function getWeather() { $.getJSON('getTemperature/' + $('.data option:selected').val(), null, function(data) { alert('Success'); ..

Remove all special characters except space from a string using JavaScript

I want to remove all special characters except space from a string using JavaScript. For example, abc's test#s should output as abcs tests...

HTML <select> selected option background-color CSS style

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..

grunt: command not found when running from terminal

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..

Calling Non-Static Method In Static Method In Java

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..

How to add to an existing hash in Ruby

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..

How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name?

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 @..

Python return statement error " 'return' outside function"

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..

How can I make a jQuery UI 'draggable()' div draggable for touchscreen?

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 ..

PHP Warning: Unknown: failed to open stream

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..

Creating a daemon in Linux

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. ..

How do I fix a "Expected Primary-expression before ')' token" error?

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..

Converting float to char*

How can I convert a float value to char* in C language?..

jquery (or pure js) simulate enter key pressed for testing

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. ..

How to implement drop down list in flutter?

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:..

What is a daemon thread in Java?

Can anybody tell me what daemon threads are in Java?..

Using the "With Clause" SQL Server 2008

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 ..

What is the C# equivalent of friend?

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 ..

MySQL CONCAT returns NULL if any field contain NULL

I have following data in my table "devices" affiliate_name affiliate_location model ip os_type os_version cs1 inter Dell 10.125.103.25 Linux ..

What are my options for storing data when using React Native? (iOS and Android)

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..

ASP.NET MVC Html.ValidationSummary(true) does not display model errors

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..

Sqlite convert string to date

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 ..

Best way to do a split pane in HTML

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 ..

Freeing up a TCP/IP port?

netstat -tulnap shows me what ports are in use. How to free up a port in Linux?..

Number of lines in a file in Java

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..

jQuery autocomplete tagging plug-in like StackOverflow's input tags?

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...

file_get_contents behind a proxy?

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..

How to compute the sum and average of elements in an array?

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 ..

How to set background color in jquery

How to set background color of td in jQuery? e.g $(this).css({**BackgroundColor:Red**}) Thanks..

How to check whether an array is empty using PHP?

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..

Getting list of parameter names inside python function

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..

Problems when trying to load a package in R due to rJava

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..

List<Object> and List<?>

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..

Disable text input history

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..

Reloading a ViewController

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..

How to check if all of the following items are in a list?

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..

javascript setTimeout() not working

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> ..

How to perform update operations on columns of type JSONB in Postgres 9.4

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..

Page Redirect after X seconds wait using JavaScript

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..

Converting a vector<int> to string

In C++, what is the simplest way to convert a vector of ints (i.e. vector<int>) to a string ?..

Bash command to sum a column of numbers

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 ..

top nav bar blocking top content of the page

I have this Twitter Bootstrap code <div class='navbar navbar-fixed-top'> <div class='navbar-inner'> <div class='container'> <a class='btn btn-navbar' data-ta..

How to access site through IP address when website is on a shared host?

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..

Use Fieldset Legend with bootstrap

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"..

How can I remove the top and right axis in matplotlib?

Instead of the default "boxed" axis style I want to have only the left and bottom axis, i.e.: +------+ | | | | | | ---> | | | | +------+ +------- ..

How to combine GROUP BY, ORDER BY and HAVING

How do I combine correctly this statement. SELECT *, COUNT(*) FROM user_log GROUP BY Email ORDER BY UpdateDate DESC HAVING COUNT(*) > 1 Let me know..

CORS: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true

I have a setup involving Frontend server (Node.js, domain: localhost:3000) <---> Backend (Django, Ajax, domain: localhost:8000) Browser <-- webapp <-- Node.js (Serve the app) Browser (weba..

What bitrate is used for each of the youtube video qualities (360p - 1080p), in regards to flowplayer?

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..

What value could I insert into a bit type column?

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..

Get Selected value from dropdown using JavaScript

I have the following HTML <form> <div class="answer1wrap"> <select id="mySelect"> <option value="void">Choose your answer</option> <option value="To..

How do I Geocode 20 addresses without receiving an OVER_QUERY_LIMIT response?

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..

Declaring functions in JSP?

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: ..

Table border left and bottom

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>..

How to search for a string in cell array in MATLAB?

Let's say I have the cell array strs = {'HA' 'KU' 'LA' 'MA' 'TATA'} What should I do if I want to find the index of 'KU'?..

Mail multipart/alternative vs multipart/mixed

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..

How to run a shell script at startup

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..

Multiline TextView in Android?

I did like below in xml <TableRow> <TextView android:id="@+id/address1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="..

Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded

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..

What is the correct way to read from NetworkStream in .NET

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..

Vertical Text Direction

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..

How can I check if some text exist or not in the page using Selenium?

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..

Bootstrap: how do I change the width of the container?

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..

How to upgrade PostgreSQL from version 9.6 to version 10.1 without losing data?

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..

Making a button invisible by clicking another button in HTML

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=..

Selenium WebDriver findElement(By.xpath()) not working for me

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..

Index was out of range. Must be non-negative and less than the size of the collection parameter name:index

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..

Regex doesn't work in String.matches()

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..

Javascript Array.sort implementation?

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 ..

Git: How to squash all commits on branch

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..

Generate random colors (RGB)

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..

fatal: could not read Username for 'https://github.com': No such file or directory

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..

How do you embed binary data in XML?

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..

Using an array as needles in strpos

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) { ..

How to convert a string to utf-8 in Python

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?..

Add space between HTML elements only using CSS

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 ..

Mounting multiple volumes on a docker container?

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..

Unix ls command: show full path when using options

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...

How to play CSS3 transitions in a loop?

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..

@property retain, assign, copy, nonatomic in Objective-C

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..

Maven and adding JARs to system scope

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..

Change fill color on vector asset in Android Studio

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..

@Autowired and static method

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..

IIS - 401.3 - Unauthorized

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..

Convert string to date then format the date

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..

How do I measure execution time of a command on the Windows command line?

Is there a built-in way to measure execution time of a command on the Windows command line?..

node-request - Getting error "SSL23_GET_SERVER_HELLO:unknown protocol"

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..

How can I add a class to a DOM element in JavaScript?

How do I add a class for the div? var new_row = document.createElement('div'); ..

Checking character length in ruby

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..

Set height 100% on absolute div

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 ..

Get name of current script in Python

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 ..

How do I handle newlines in JSON?

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('(..

How to deal with SQL column names that look like SQL keywords?

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..

MVC Redirect to View from jQuery with parameters

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..

Ruby 'require' error: cannot load such file

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..

SQL: set existing column as Primary Key in MySQL

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 ..

Convert a String representation of a Dictionary to a dictionary?

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..

Xcode error - Thread 1: signal SIGABRT

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..

Center content in responsive bootstrap navbar

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 ..

Exec : display stdout "live"

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..

Using LIKE operator with stored procedure parameters

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..

How to find out which package version is loaded in R?

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..

SSL certificate is not trusted - on mobile only

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..

git visual diff between branches

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 ..

caching JavaScript files

Which is the best method to make the browser use cached versions of js files (from the serverside)?..

Convert int to string?

How can I convert an int datatype into a string datatype in C#?..

Laravel Eloquent limit and offset

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-&..

how to send multiple data with $.ajax() jquery

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..

How to programmatically connect a client to a WCF service?

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?..

Using find to locate files that match one of multiple patterns

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 ..

PHP - Check if the page run on Mobile or Desktop browser

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?..

How to get class object's name as a string in Javascript?

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..

How to manually install an artifact in Maven 2?

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..

Decoding a Base64 string in Java

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 ..

How to install the Raspberry Pi cross compiler on my Linux host machine?

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 ..

UICollectionView - dynamic cell height?

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..

Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'

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..

Error: Failed to lookup view in Express

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 ./..

How to create XML file with specific structure in Java

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:..

What is the strict aliasing rule?

When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about?..

jQuery: keyPress Backspace won't fire?

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..

How can I find non-ASCII characters in MySQL?

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..

What does principal end of an association means in 1:1 relationship in Entity framework

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..

MySql Error: Can't update table in stored function/trigger because it is already used by statement which invoked this stored function/trigger

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..

Grouping into interval of 5 minutes within a time range

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..

CMD what does /im (taskkill)?

I just read the following command: taskkill /f /im something.exe I read that /f forces the task to close, but what does /im do?..

Detect all changes to a <input type="text"> (immediately) using JQuery

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..

Adding days to a date in Java

How do I add x days to a date in Java? For example, my date is (dd/mm/yyyy) = 01/01/2012 Adding 5 days, the output should be 06/01/2012...

how to send an array in url request

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..

Getting list of tables, and fields in each, in a database

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..

How to safely upgrade an Amazon EC2 instance from t1.micro to large?

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..

Remove trailing zeros

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..

Left padding a String with Zeros

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...

Web API Put Request generates an Http 405 Method Not Allowed error

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 ..

Keytool is not recognized as an internal or external command

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..

Can't open file 'svn/repo/db/txn-current-lock': Permission denied

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-..

How to set time to midnight for current day?

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 ..

functional way to iterate over range (ES6/7)

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 =..

How to implement class constructor in Visual Basic?

I just would like to know how to implement class constructor in this language...

How can I insert into a BLOB column from an insert statement in sqldeveloper?

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')?

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"..

How to Convert Excel Numeric Cell Value into Words

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. ..

How to create many labels and textboxes dynamically depending on the value of an integer variable?

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 ..

Google MAP API Uncaught TypeError: Cannot read property 'offsetWidth' of null

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>..

Warn user before leaving web page with unsaved changes

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..

How to call a function in shell Scripting?

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() { ..

php is null or empty?

I have a question regarding NULL in PHP: $a = ''; if($a == NULL) { echo 'is null'; } Why do I see is null when $a is an empty string? Is that a bug?..

Random numbers with Math.random() in Java

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..

How to create folder with PHP code?

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?..

What is the difference between "SMS Push" and "WAP Push"?

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..

Oracle SQL, concatenate multiple columns + add text

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..

Excel 2010 VBA - Close file No Save without prompt

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..

How to return multiple rows from the stored procedure? (Oracle PL/SQL)

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?..

How to create exe of a console application

How can we create the exe for a console forms application ?..

Get and Set Screen Resolution

How can I collect and change screen resolution using Visual C#?..

Dark color scheme for Eclipse

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...

upstream sent too big header while reading response header from upstream

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..

AWS S3: The bucket you are attempting to access must be addressed using the specified endpoint

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 =>..

Reading PDF documents in .Net

Is there an open source library that will help me with reading/parsing PDF documents in .Net/C#?..

How to count TRUE values in a logical vector

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..

Print multiple arguments in Python

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..

print highest value in dict with key

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..

How to include layout inside layout?

How to include layout inside layout in Android? I am creating common layout. I want to include that layout in another page...