Questions Tagged with #Apple touch icon

`apple-touch-icon` is an iOS-specific custom kind of icon which users can display on their Home screens using the `Web Clip` feature

Why am I getting error for apple-touch-icon-precomposed.png

I have created a new rails3 project but I am seeing following logs many times in my server logs. Why I am getting these request and how can I avoid these? Started GET "/apple-touch-icon-precompose..

JAXB :Need Namespace Prefix to all the elements

I am Using Spring WebServiceTemplate to make webservice call which uses JAXB to generate request XML. My requirement needs all the elements (including root) to have a namespace prefix (there is only a..

Java JDBC - How to connect to Oracle using Service Name instead of SID

I have a Java application that uses JDBC (via JPA) that was connecting to a development database using hostname, port and Oracle SID, like this: jdbc:oracle:thin:@oracle.hostserver1.mydomain.ca:1521:..

How do I call an Angular.js filter with multiple arguments?

As from the documentation, we can call a filter such as date like this: {{ myDateInScope | date: 'yyyy-MM-dd' }} Here date is a filter that takes one argument. What is the syntax to call filters w..

Print array without brackets and commas

I'm porting a Hangman game to Android and have met a few problems. The original Java program used the console, so now I have to somehow beautify the output so that it fits my Android layout. How do I..

How to know if .keyup() is a character key (jQuery)

How to know if .keyup() is a character key (jQuery) $("input").keyup(function() { if (key is a character) { //such as a b A b c 5 3 2 $ # ^ ! ^ * # ...etc not enter key or shift or Esc or space ...e..

How to select min and max values of a column in a datatable?

For the following datatable column, what is the fastest way to get the min and max values? AccountLevel 0 1 2 3 ..

Pass a password to ssh in pure bash

I want to pass a password to ssh using a bash script (Yes, I know that there are ssh keys that I could use, but this is not what I intend). I found some solutions that were using expect but since it ..

Batch file include external file for variables

I have a batch file and I want to include an external file containing some variables (say configuration variables). Is it possible?..

Use Ant for running program with command line arguments

My program getting command line arguments. How can I pass it when I use Ant?..

Under what circumstances can I call findViewById with an Options Menu / Action Bar item?

I am trying to obtain a handle on one of the views in the Action Bar. I have tried calling: findViewById(R.id.menu_item) but this returns null unless I call it in the onOptionsItemSelected method. ..

Left/Right float button inside div

How can I make button float only in div area? Here is my example CSS and HTML. _x000D_ _x000D_ .test {_x000D_ width: 60%;_x000D_ display: inline;_x000D_ overflow: auto;_x000D_ white-space: n..

Adding a HTTP header to the Angular HttpClient doesn't send the header, why?

Here is my code: import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http'; logIn(username: string, password: string) { const url = 'http://server.com/index.php'; ..

With android studio no jvm found, JAVA_HOME has been set

I have a JAVA_HOME variable set to: C:\Program Files (x86)\Java\jdk1.7.0_45\ And the path to the jdk is: C:\Program Files (x86)\Java\jdk1.7.0_45 However when I try to start android studio I..

Conversion from List<T> to array T[]

Is there a short way of converting a strongly typed List<T> to an Array of the same type, e.g.: List<MyClass> to MyClass[]? By short i mean one method call, or at least shorter than: MyC..

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

Why is &#65279; appearing in my HTML?

I see this character in Firebug &#65279;. I don't know why this is happening, there's no such character in my code. For Firefox it's OK, but in IE everything breaks. I can't even search for this ..

How to load all the images from one of my folder into my web page, using Jquery/Javascript

I have a folder named "images" in the same directory as my .js file. I want to load all the images from "images" folder into my html page using Jquery/Javascript. Since, names of images are not some ..

Good beginners tutorial to socket.io?

I am very new to the world of webdevelopment and jumped into the bandwagon because I find the concept of HTML5 very interesting. I am fairly confident on working with canvas and would now like to move..

Compare 2 arrays which returns difference

What's the fastest/best way to compare two arrays and return the difference? Much like array_diff in PHP. Is there an easy function or am I going to have to create one via each()? or a foreach loop?..

Opening Chrome From Command Line

I have the following batch file: @echo off REM Starts a chrome browser with multiple tabbed sites C:\Users\UserName\AppData\Local\Google\Chrome\Application\chrome.exe "site1.com" "site2.com" But wh..

Adding click event for a button created dynamically using jQuery

How to add a button click event on a button that was added dynamically using jQuery? The jQuery code that adds the dynamic buttons inside a div container: $('#pg_menu_content').empty(); $div = $('&l..

When a 'blur' event occurs, how can I find out which element focus went *to*?

Suppose I attach an blur function to an HTML input box like this: <input id="myInput" onblur="function() { ... }"></input> Is there a way to get the ID of the element which caused the b..

Easiest way to use SVG in Android?

I have found a myriad of libraries in order to use svg in Android and avoid the frustrating creation of different resolutions and dropping files for each resolution, this becomes very annoying when th..

unknown type name 'uint8_t', MinGW

I get "unknown type name 'uint8_t'" and others like it using C in MinGW. Any ideas how to solve this?..

How to check if cursor exists (open status)

How do I check if a cursor is open or not? Because many times I am encountering the error 'Cursor already exists'. Please let me know how can I check whether a cursor is already in open status. In fa..

TypeError: 'int' object is not subscriptable

I'm trying to create a simple program that tells you your lucky number according to numerology. I keep on getting this error: File "number.py", line 12, in <module> sumln = (int(sumall[0])+..

How to resolve "Waiting for Debugger" message?

I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build - the application does not run; though it does get installed on the device. On the device I get this message box on the Comet scr..

Disable/Enable Submit Button until all forms have been filled

I want my form submit button to be disabled/enabled depending on if the form is completely filled. When the inputs are filled, the disabled button changes to enabled. That works great. But I would li..

Resolving MSB3247 - Found conflicts between different versions of the same dependent assembly

A .NET 3.5 solution ended up with this warning when compiling with msbuild. Sometimes NDepend might help out but in this case it didn't give any further details. Like Bob I ended up having to resort ..

Set specific precision of a BigDecimal

I have an XSD that requires me to use a BigDecimal for a lat/lon. I currently have the lat/lon as doubles, and convert them to BigDecimal, but I am only required to use about 12 places of precision. ..

JBoss AS 7: How to clean up tmp?

I noticed that in my JBoss Application Server 7 installation under standalone/tmp I have 400 MB of files related to past deployments, some of them a few months old. How is it cleaned up? Should it ha..

What's the difference between integer class and numeric class in R

I want to preface this by saying I'm an absolute programming beginner, so please excuse how basic this question is. I'm trying to get a better understanding of "atomic" classes in R and maybe this g..

What is FCM token in Firebase?

In the new Firebase, under Notification, they have mentioned that developer can send notification to a particular device. For that, in console it asks for an FCM token. What is it exactly and how can ..

changing minDate option in JQuery DatePicker not working

I have declared a date picker instance as follows: $("#datePickerId").datepicker( { dateFormat: 'DD, d MM yy', minDate: 0, showOn: 'button', buttonImage: '../../images/calen..

How to insert current_timestamp into Postgres via python

I need to insert rows into PG one of the fields is date and time with time stamp, this is the time of incident, so I can not use --> current_timestamp function of Postgres at the time of insertion, so..

get size of json object

i have a json object that gets returned by an AJAX request and I am having some trouble with the .length because it keeps returning undefined. Just wondering if I'm using it right: console.log(data.l..

PHP float with 2 decimal places: .00

When I do this typecasting: (float) '0.00'; I get 0. How do I get 0.00 and still have the data type as a float? ..

AngularJS custom filter function

Inside my controller, I would like to filter an array of objects. Each of these objects is a map which can contain strings as well as lists I tried using $filter('filter')(array, function) format but..

Sum up a column from a specific row down

It seem simple but I cannot find a way to define a range that goes up to the end of the column in an Excel formula. For instance I can use this equation SUM(C:C) to sum all number found on the column..

Query EC2 tags from within instance

Amazon recently added the wonderful feature of tagging EC2 instances with key-value pairs to make management of large numbers of VMs a bit easier. Is there some way to query these tags in the same wa..

How do I erase an element from std::vector<> by index?

I have a std::vector<int>, and I want to delete the n'th element. How do I do that? std::vector<int> vec; vec.push_back(6); vec.push_back(-17); vec.push_back(12); vec.erase(???); ..

How can I avoid getting this MySQL error Incorrect column specifier for column COLUMN NAME?

How can I avoid getting this MySQL error Incorrect column specifier for column topic_id ? MySQL Error... #1063 - Incorrect column specifier for column 'topic_id' SQL Schema... CREATE TABLE disc..

Fastest way to check if a file exist using standard C++/C++11/C?

I would like to find the fastest way to check if a file exist in standard C++11, C++, or C. I have thousands of files and before doing something on them I need to check if all of them exist. What can ..

How to print a number with commas as thousands separators in JavaScript

I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show the number 1234567 as "1,234,567". How would I go about doing this? Here is how I am do..

scrollTop jquery, scrolling to div with id?

So this is the current code I have $(document).ready(function() { $('.abouta').click(function(){ $('html, body').animate({scrollTop:308}, 'slow'); return false; }); $('.po..

How to put scroll bar only for modal-body?

I have the following element: <div class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog" style="overflow-y: scroll; max-..

Generate table relationship diagram from existing schema (SQL Server)

Is there a way to produce a diagram showing existing tables and their relationships given a connection to a database? This is for SQL Server 2008 Express Edition...

How can I get a process handle by its name in C++?

I'm trying to get the process handle of, say example.exe, so I can call TerminateProcess on it. How can I do this? Notice, it doesn't have a window so FindWindow won't work...

Check if all values in list are greater than a certain number

my_list1 = [30,34,56] my_list2 = [29,500,43] How to I check if all values in list are >= 30? my_list1 should work and my_list2 should not. The only thing I could think of doing was: boolean = 0 de..

How can I get a precise time, for example in milliseconds in Objective-C?

Is there an easy way to get a time very precisely? I need to calculate some delays between method calls. More specifically, I want to calculate the speed of scrolling in an UIScrollView...

How to add 20 minutes to a current date?

Possible Duplicate: How to add 30 minutes to a javascript Date object? I can get the current date object like this: var currentDate = new Date(); How can I add 20 minutes to it? var twe..

Use Font Awesome Icons in CSS

I have some CSS that looks like this: #content h2 { background: url(../images/tContent.jpg) no-repeat 0 6px; } I would like to replace the image with an icon from Font Awesome. I do not see an..

iTunes Connect: How to choose a good SKU?

I'm reading the iTunes Connect Developer Guide as I'm trying to add a new application to iTunes Connect. I'm a bit confused about the SKU number which I should provide. On page 81 in the above deve..

parent & child with position fixed, parent overflow:hidden bug

I don't know if there is an issue, but I was wondering why the overflow:hidden does not function on fixed parent/children element. Here's an example: CSS and HTML: _x000D_ _x000D_ .parent{_x000D_ ..

Android Horizontal RecyclerView scroll Direction

I made a Horizontal RecyclerView and it works fine(thanks to this) but the direction of scroll and data are expand from left to right; then How can I change the RecyclerView scroll direction like in t..

WPF checkbox binding

While it is trivial to store a checkbox's checked state in a variable using the checkbox's Click event, how would I do it via databinding? All the examples I have found have the UI updated from some ..

In angular $http service, How can I catch the "status" of error?

I'm reading a book called, "Pro Angular JS". However, I have a question about how to catch a status of error. What I coded is : $http.get(dataUrl) .success(function (data){ $scope.data.p..

execJs: 'Could not find a JavaScript runtime' but execjs AND therubyracer are in Gemfile

I'm getting this error: rake aborted! Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs, I have already spent more hours searching google then I am willing to ad..

How to return XML in ASP.NET?

I have encountered many half-solutions to the task of returning XML in ASP.NET. I don't want to blindly copy & paste some code that happens to work most of the time, though; I want the right code,..

How to generate a range of numbers between two numbers?

I have two numbers as input from the user, like for example 1000 and 1050. How do I generate the numbers between these two numbers, using a sql query, in seperate rows? I want this: 1000 1001 10..

MySQL update CASE WHEN/THEN/ELSE

I am trying to update a LARGE MyISAM table (25 million records) using a CLI script. The table is not being locked/used by anything else. I figured instead of doing single UPDATE queries for each reco..

Java correct way convert/cast object to Double

I need to convert Object o to Double. Is the correct way to convert it to String first?..

C# Change A Button's Background Color

How can the background color of a button once another button is pressed? What I have at the moment is: ButtonToday.Background = Color.Red; And it's not working...

How to recover deleted rows from SQL server table?

I accidentaly ran a DELETE command against a table with a wrong WHERE clause. I am using SQL Server 2005. Is there a way that could help me recover the lost data?..

number several equations with only one number

How can I number several equations in a align environment using only one number? For example \begin{align} w^T x_i + b \geqslant 1-\xi_i \text{ if } y_i=1, \nonumber \\ w^T x_i + b \leqslant -1+\xi..

Python iterating through object attributes

How do I iterate over an object's attributes in Python? I have a class: class Twitt: def __init__(self): self.usernames = [] self.names = [] self.tweet = [] self...

Difference between Relative path and absolute path in javascript

Have small clarifications, As of my knowledge these are the relative and absolute paths, Completely relative: <img src="kitten.png"/> Absolute in all respects: <img src="http://www.foo.c..

How do I force Internet Explorer to render in Standards Mode and NOT in Quirks?

I am coding a Frontend which works well in IE7 Standards Mode and IE8 Standards Mode. When I start up Internet Explorer and load the page both IE7 and IE8 go to Quirks Mode directly. How can I force ..

Vba macro to copy row from table if value in table meets condition

i'm trying to make a macro which: goes through a table looks if value in column B of that table has a certain value if it has, copy that row to a range in an other worksheet The result is similar ..

Padding In bootstrap

Im using bootstrap: <div id="main" class="container" role="main"> <div class="row"> <div class="span6"> <h2>Welcome</h2> <p>Hello and welcome t..

Getting value GET OR POST variable using JavaScript?

How to get value of the get or post variable on page load using JavaScript?..

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

Best design for a changelog / auditing database table?

I need to create a database table to store different changelog/auditing (when something was added, deleted, modified, etc). I don't need to store particularly detailed info, so I was thinking somethin..

How to draw circle in html page?

How do you draw a circle using HTML5 and CSS3? Is it also possible to put text inside?..

jQuery Show-Hide DIV based on Checkbox Value

Using AJAX I populate a DIV with a bunch of checkboxes (each with it's own unique ID). The IDs are "projectID1", "projectID2", "projectID3" and so on... I have given all checkboxes a class of "pChk". ..

Passing bash variable to jq

I have written a script to retrieve certain value from file.json. It works if I provide the value to jq select, but the variable doesn't seem to work (or I don't know how to use it). #!/bin/sh #this..

Java array assignment (multiple values)

I have a Java array defined already e.g. float[] values = new float[3]; I would like to do something like this further on in the code: values = {0.1f, 0.2f, 0.3f}; But that gives me a compile er..

How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in ..

PowerShell and the -contains operator

Consider the following snippet: "12-18" -Contains "-" You’d think this evaluates to true, but it doesn't. This will evaluate to false instead. I’m not sure why this happens, but it does. To av..

Loading custom configuration files

I know I can open config files that are related to an assembly with the static ConfigurationManager.OpenExe(exePath) method but I just want to open a config that is not related to an assembly. Just a ..

How do you add input from user into list in Python

print ('This is your Shopping List') firstItem = input('Enter 1st item: ') print (firstItem) secondItem = input('Enter 2nd item: ') print (secondItem) Ho..

ArrayList vs List<> in C#

What is the difference between ArrayList and List<> in C#? Is it only that List<> has a type while ArrayList doesn't?..

What does cv::normalize(_src, dst, 0, 255, NORM_MINMAX, CV_8UC1);

What does the cv::normalize(_src, dst, 0, 255, NORM_MINMAX, CV_8UC1); do in OpenCV? I went through the documentation and was unable to understand what alpha, beta, NORM_MINMAX and CV_8UC1 actually d..

Multiplication on command line terminal

I'm using a serial terminal to provide input into our lab experiment. I found that using $ echo "5X5" just returns a string of "5X5". Is there a command to execute a multiplication operation?..

How do I handle the window close event in Tkinter?

How do I handle the window close event (user clicking the 'X' button) in a Python Tkinter program?..

How to set the size of button in HTML

I have some buttons on my pure HTML/JS page. When the page is opened in browser, the button size is normal. But on refresh/reloading page, the button size is reduced. In fact, I have not set the butto..

Python != operation vs "is not"

In a comment on this question, I saw a statement that recommended using result is not None vs result != None I was wondering what the difference is, and why one might be recommended over the oth..

Padding characters in printf

I am writing a bash shell script to display if a process is running or not. So far, I got this: printf "%-50s %s\n" $PROC_NAME [UP] The code gives me this output: JBoss ..

Multiple conditions with CASE statements

I need to query some data. here is the query that i have constructed but which isn't workig fine for me. For this example I am using AdventureWorks database. SELECT * FROM [Purchasing].[Vendor] WHERE..

Convert string to number and add one

I want to turn the value I get from the id into a number and add one to it then pass the new value into the dosomething() function to use. When I tried this and the value is one I get back 11 not 2. ..

Yahoo Finance All Currencies quote API Documentation

I've being using this feed for a long time, I believe Apple does it as well in one of the mac widgets. but what is really curious is that I simply can't find any documentation for it, I've tried googl..

Rails: How does the respond_to block work?

I'm going through the Getting Started with Rails guide and got confused with section 6.7. After generating a scaffold I find the following auto-generated block in my controller: def index @posts = ..

Adjust width of input field to its input

<html> <head> </head> <body> <input type="text" value="1" style="min-width:1px;" /> </body> </html> This is my code and it is not working. Is th..

Printing chars and their ASCII-code in C

How do I print a char and its equivalent ASCII value in C?..

How do I list one filename per output line in Linux?

I'm using ls -a command to get the file names in a directory, but the output is in a single line. Like this: . .. .bash_history .ssh updater_error_log.txt I need a built-in alternative to get..

Radio/checkbox alignment in HTML/CSS

What is the cleanest way to align properly radio buttons / checkboxes with text? The only reliable solution which I have been using so far is table based: <table> <tr> <td><i..

How get an apostrophe in a string in javascript

I'm doing some stuff with javascript and I'm wondering, how do I put an apostrophe in a string in javascript? theAnchorText = 'I apostrophe M home'; ..

How to convert a unix timestamp (seconds since epoch) to Ruby DateTime?

How do you convert a Unix timestamp (seconds since epoch) to Ruby DateTime?..

When or Why to use a "SET DEFINE OFF" in Oracle Database

I'm watching a Script in Oracle and I see something I don't recognize REM INSERTING into database1."Users" SET DEFINE OFF; Insert into database1."Users" ("id","right") values ('1','R'); I'm lookin..

How to download a file from my server using SSH (using PuTTY on Windows)

When I try downloading a file from my server onto my computer, it actually downloads the file onto the server. (Note I am already SSH'd into my server before typing this command. I've watched tutoria..

What is the 'open' keyword in Swift?

The ObjectiveC.swift file from the standard library contains the following few lines of code around line 228: extension NSObject : Equatable, Hashable { /// ... open var hashValue: Int { retu..

Deleting elements from std::set while iterating

I need to go through a set and remove elements that meet a predefined criteria. This is the test code I wrote: #include <set> #include <algorithm> void printElement(int value) { std..

In Tkinter is there any way to make a widget not visible?

Something like this, would make the widget appear normally: Label(self, text = 'hello', visible ='yes') While something like this, would make the widget not appear at all: Label(self, text = 'hel..

How do you validate a URL with a regular expression in Python?

I'm building an app on Google App Engine. I'm incredibly new to Python and have been beating my head against the following problem for the past 3 days. I have a class to represent an RSS Feed and in ..

Finding partial text in range, return an index

I need to find a partial text in a specific range and get a value which is X rows under cell index of found text. I have tried with INDEX and MATCH functions but without success. As in example: loo..

How can I replace newline or \r\n with <br/>?

I am trying to simply replace some new lines and have tried three different ways, but I don't get any change: $description = preg_replace('/\r?\n|\r/', '<br/>', $description); $description = str..

Select all from table with Laravel and Eloquent

I am using Laravel 4 to set up my first model to pull all the rows from a table called posts. In standard MySQL I would use: SELECT * FROM posts; How do I achieve this in my Laravel 4 model? Se..

How to query nested objects?

I have a problem when querying mongoDB with nested objects notation: db.messages.find( { headers : { From: "[email protected]" } } ).count() 0 db.messages.find( { 'headers.From': "reservation..

When to use extern in C++

I'm reading "Think in C++" and it just introduced the extern declaration. For example: extern int x; extern float y; I think I understand the meaning (declaration without definition), but I wonder..

User Authentication in ASP.NET Web API

This topic has been incredibly confusing for me. I am a rookie in HTTP apps but need to develop an iPhone client that consumes JSON data from somewhere. I chose Web API from MS because it seemed easy ..

Adding hours to JavaScript Date object?

It amazes me that JavaScript's Date object does not implement an add function of any kind. I simply want a function that can do this: var now = Date.now(); var fourHoursLater = now.addHours(4); fun..

Where are environment variables stored in the Windows Registry?

I need to access an environment variable remotely. To do this, I think the best way is to read it from registry. Where are environment variables stored in the Windows Registry?..

Wordpress 403/404 Errors: You don't have permission to access /wp-admin/themes.php on this server

Some background: I setup six blogs this week, all using Wordpress 2.92, installed with Fantastico on a baby croc plan with Hostgator. I used the same theme (heatmap 2.5.4) and plugins for each blog...

Error message 'java.net.SocketException: socket failed: EACCES (Permission denied)'

I get the error message java.net.SocketException: socket failed: EACCES (Permission denied) when I try to apply the code below. This is the function I call and gives me this exception. public v..

How can I debug git/git-shell related problems?

How can I have some debug information regarding git/git-shell? I had a problem, that user1 could clone a repository without problem, while user2 could clone only an empty one. I had set GIT_TRACE=1,..

Use SQL Server Management Studio to connect remotely to an SQL Server Express instance hosted on an Azure Virtual Machine

Initial Attempt I have an Azure VM with Windows Server 2012, on which I just installed SQL Server 2012 Express Database Engine component. Then, I followed the instructions here to connect remotely wi..

How to remove \xa0 from string in Python?

I am currently using Beautiful Soup to parse an HTML file and calling get_text(), but it seems like I'm being left with a lot of \xa0 Unicode representing spaces. Is there an efficient way to remove a..

R: Break for loop

Can you confirm if the next break cancels the inner for loop? for (out in 1:n_old){ id_velho <- old_table_df$id[out] for (in in 1:n) { id_novo <- new_table_df$ID[in..

Where is SQL Profiler in my SQL Server 2008?

I downloaded SQL Server 2008 and can't seem to find SQL Profiler anywhere. I believe I installed the SQL Server Enterprise Express/trial version? I guess it was Express and not Enterprise after all ..

Git status ignore line endings / identical files / windows & linux environment / dropbox / mled

How do I make git status ignore line ending differences? Background info: I use randomly Windows and Linux to work on the project. The project is in Dropbox. I found a lot about how do make ..

DIV table colspan: how?

How do I achieve colspan/rowspan behavior in tableless (e.g. div.table {display: table;} div.tr {display: table-row;} etc.) table?..

Difference between string object and string literal

What is the difference between String str = new String("abc"); and String str = "abc"; ..

How do I localize the jQuery UI Datepicker?

I really need a localized dropdown calendar. An English calendar doesn't exactly communicate excellence on a Norwegian website ;-) I have experimented with the jQuery DatePicker, their website says i..

Cannot serve WCF services in IIS on Windows 8

When I try to serve a WCF service on IIS in a Windows 8 machine, I get the well known error The page you are requesting cannot be served because of the extension configuration. If the page is a sc..

How to create JSON string in C#

I just used the XmlWriter to create some XML to send back in an HTTP response. How would you create a JSON string. I assume you would just use a stringbuilder to build the JSON string and them forma..

How to Populate a DataTable from a Stored Procedure

Possible Duplicate: How can i retrieve a table from stored procedure to a datatable I am trying to populate my datatable. I have created a datatable tmpABCD but i need to populate this with..

How to run Python script on terminal?

I want to run a Python script in Terminal, but I don't know how? I already have a saved file called gameover.py in the directory "/User/luca/Documents/python"...

How can I add the sqlite3 module to Python?

Can someone tell me how to install the sqlite3 module alongside the most recent version of Python? I am using a Macbook, and on the command line, I tried: pip install sqlite but an error pops up...

How to make several plots on a single page using matplotlib?

I have written code that opens 16 figures at once. Currently they all open as separate graphs. I'd like them to open all on the same page. Not the same graph. I want 16 separate graphs on a single ..

How to use youtube-dl from a python program?

I would like to access the result of the following shell command, youtube-dl -g "www.youtube.com/..." to print its output direct url to a file, from within a python program. This is what I ..

Cannot stop or restart a docker container

When trying to stop or restart a docker container I'm getting the following error message: $ docker restart 5ba0a86f36ea Error response from daemon: Cannot restart container 5ba0a86f36ea: [2] Contain..

Calculate difference in keys contained in two Python dictionaries

Suppose I have two Python dictionaries - dictA and dictB. I need to find out if there are any keys which are present in dictB but not in dictA. What is the fastest way to go about it? Should I conver..

Is there a css cross-browser value for "width: -moz-fit-content;"?

I need some divs to be center-positioned and to fit their content width at the same time. I am now doing it like this: .mydiv-centerer{ text-align: center; .mydiv { background: none no-rep..

SQL Query to concatenate column values from multiple rows in Oracle

Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table A PID A B C Table B PID SEQ Desc A 1 Have A 2 ..

Error in data frame undefined columns selected

I've been working on an assignment where I have to read in some csv files from a directory "specdata". The files are very similar in that there are 332 titled 001.csv - 332.csv. They have consistent c..

How to connect Robomongo to MongoDB

I am have MongoDB and Robomongo in my running system, and I am using Robomongo as the client. I have installed MongoDB on a different system which I am treating as server, and I want to connect Robomo..

Best Practices for mapping one object to another

My question is, what is the best way I can map one object to another in the most maintainable manner. I cannot change the way the Dto object that we are getting is setup to be more normalized so I nee..

Setting up and using environment variables in IntelliJ Idea

I set up an environment variable (Under IDE Settings -> Path Variables) APP_HOME = /path/to/app_home One of my tests is failing however with System.out.println("APP HOME: " + APP_..

Converting a double to an int in C#

In our code we have a double that we need to convert to an int. double score = 8.6; int i1 = Convert.ToInt32(score); int i2 = (int)score; Can anyone explain me why i1 != i2? The result that I get ..

Async image loading from url inside a UITableView cell - image changes to wrong image while scrolling

I've written two ways to async load pictures inside my UITableView cell. In both cases the image will load fine but when I'll scroll the table the images will change a few times until the scroll will ..

Ansible: How to delete files and folders inside a directory?

The below code only deletes the first file it gets inside the web dir. I want to remove all the files and folders inside the web directory and retain the web directory. How can I do that? - name: ..

What is causing the error `string.split is not a function`?

Why am I getting... Uncaught TypeError: string.split is not a function ...when I run... _x000D_ _x000D_ var string = document.location;_x000D_ var split = string.split('/');_x000D_ _x000D_ _x00..

How do I pass along variables with XMLHTTPRequest

How do I send variables to the server with XMLHTTPRequest? Would I just add them to the end of the URL of the GET request, like ?variable1=?variable2=, etc? So more or less: XMLHttpRequest("GET", "b..

jQuery .slideRight effect

I need for a div tag to slide out on the right side of the screen, how do I get this effect with jQuery? I've been looking here: http://api.jquery.com/category/effects/sliding/ and it doesn't seem to..

Why is Github asking for username/password when following the instructions on screen and pushing a new repo?

I'm the owner of an organization on github and just created a repo and tried pushing but I'm running into an issue where it's asking me for my username even though I can SSH just fine: $ ssh -T git@g..

How to use Python requests to fake a browser visit a.k.a and generate User Agent?

I want to get the content from this website. If I use a browser like Firefox or Chrome I could get the real website page I want, but if I use the Python requests package (or wget command) to get it, i..

What does value & 0xff do in Java?

I have the following Java code: byte value = 0xfe; // corresponds to -2 (signed) and 254 (unsigned) int result = value & 0xff; The result is 254 when printed, but I have no idea how this code w..

What is the correct syntax for 'else if'?

I'm a new Python programmer who is making the leap from 2.6.4 to 3.1.1. Everything has gone fine until I tried to use the 'else if' statement. The interpreter gives me a syntax error after the 'if' in..

Check a collection size with JSTL

How can I check the size of a collection with JSTL? Something like: <c:if test="${companies.size() > 0}"> </c:if> ..

Spring MVC: Error 400 The request sent by the client was syntactically incorrect

This seems to be a common issue. I have gone all the answers given in SO but could not make it work.I am trying to integrate Spring MVC+Freemarker in already existing web application. It works fine fo..

Return JSON response from Flask view

I have a function that analyzes a CSV file with Pandas and produces a dict with summary information. I want to return the results as a response from a Flask view. How do I return a JSON response? @ap..

Using Pipes within ngModel on INPUT Elements in Angular

I've an HTML INPUT field. <input [(ngModel)]="item.value" name="inputField" type="text" /> and I want to format its value and use an existing pipe: .... [(ngModel)]="item.va..

What does double question mark (??) operator mean in PHP

I was diving into Symfony framework (version 4) code and found this piece of code: $env = $_SERVER['APP_ENV'] ?? 'dev'; I'm not sure what this actually does but I imagine that it expands to something..

Color Tint UIButton Image

I noticed that when I place a white or black UIImage into a UISegmentedControl it automatically color masks it to match the tint of the segmented control. I thought this was really cool, and was wonde..

swift UITableView set rowHeight

I am trying to set the height of each row in the tableView to the height of the corresponding cell with this code: override func tableView(tableView: UITableView!, heightForRowAtIndexPath indexPath: ..

Bitbucket fails to authenticate on git pull

I use BitBucket and had to change my password because it was compromised. git pull remote: Invalid username or password. If you log in via a third party service you must ensure you have an accou..

Angular2, what is the correct way to disable an anchor element?

I'm working on an Angular2 application, and I need to display -- but disable an <a> HTML element. What is the correct way to do this? Updated Please note the *ngFor, this would prevent the opt..

Hide particular div onload and then show div after click

I have two divs div1 and div2. I want div2 to be automatically hidden but when i click on preview div then div2 to be made visible and div1 to hide. This is the code i tried but no luck :( <script..

Stuck at ".android/repositories.cfg could not be loaded."

brew cask install android-sdk ==> Caveats We will install android-sdk-tools, platform-tools, and build-tools for you. You can control android sdk packages via the sdkmanager command. You may w..

Replace one substring for another string in shell script

I have "I love Suzi and Marry" and I want to change "Suzi" to "Sara". #!/bin/bash firstString="I love Suzi and Marry" secondString="Sara" # do something... The result must be like this: firstStrin..

Upload a file to Amazon S3 with NodeJS

I ran into a problem while trying to upload a file to my S3 bucket. Everything works except that my file paramters do not seem appropriate. I am using Amazon S3 sdk to upload from nodejs to s3. These..

Send email by using codeigniter library via localhost

public function sendemail(){ $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => '[email protected]', 'smtp..

How to determine if a String has non-alphanumeric characters?

I need a method that can tell me if a String has non alphanumeric characters. For example if the String is "abcdef?" or "abcdefà", the method must return true...

Appending an id to a list if not already present in a string

I am trying to check if id is in a list and append the id only if its not in the list using the below code..however I see that the id is getting appended even though id is already present in the list..

PHP: Get the key from an array in a foreach loop

print_r($samplearr) prints the following for my array containing 3 items: Array ( [4722] => Array ( [value1] => 52 [value2] => 46 ) Array ( [4922] => Array ( [value1] => 22 [value2] =&..

Navigation bar show/hide

I have an app with a navigation bar consisting of 2 bar buttons. I would like to hide and show this navigation bar when a user double taps the screen. Initially, the navigation bar should be hidden. ..

How to remove all duplicate items from a list

How would I use python to check a list and delete all duplicates? I don't want to have to specify what the duplicate item is - I want the code to figure out if there are any and remove them if so, kee..

Using the star sign in grep

I am trying to search for the substring "abc" in a specific file in linux/bash So I do: grep '*abc*' myFile It returns nothing. But if I do: grep 'abc' myFile It returns matches correctly. No..

How to check the first character in a string in Bash or UNIX shell?

I'm writing a script in UNIX where I have to check whether the first character in a string is "/" and if it is, branch. For example I have a string: /some/directory/file I want this to return 1, a..

AWS Lambda import module error in python

I am creating a AWS Lambda python deployment package. I am using one external dependency requests . I installed the external dependency using the AWS documentation http://docs.aws.amazon.com/lambda/la..

How to configure Docker port mapping to use Nginx as an upstream proxy?

Update II It's now July 16th, 2015 and things have changed again. I've discovered this automagical container from Jason Wilder: https://github.com/jwilder/nginx-proxy and it solves this prob..

AngularJS error: 'argument 'FirstCtrl' is not a function, got undefined'

I noticed the same question was asked a few times here, I tried so solve it but nothing helps. I'm following this tutorial with the egghead videos. But when I get at the section of Controllers and ..

Remove menubar from Electron app

How do I remove this menu-bar from my electron apps: Also it says "Hello World"(is this because I downloaded electron pre-built, and will go away once I package the application?). I didn't code the..

Inverse of matrix in R

I was wondering what is your recommended way to compute the inverse of a matrix? The ways I found seem not satisfactory. For example, > c=rbind(c(1, -1/4), c(-1/4, 1)) > c [,1] [,2..

How to use LINQ Distinct() with multiple fields

I have the following EF class derived from a database (simplified) class Product { public string ProductId; public string ProductName; public string CategoryId; public string Cat..

What does -Xmn jvm option stands for

I tried searching the internet about -Xmn option, without success. Can someone please explain what this stands for and how can I use it to tune JVM? ..

MongoDB inserts float when trying to insert integer

> db.data.update({'name': 'zero'}, {'$set': {'value': 0}}) > db.data.findOne({'name': 'zero}) {'name': 'zero', 'value': 0.0} How do I get Mongo to insert an integer? Thank you..

Python for and if on one line

I have a issue with python. I make a simple list: >>> my_list = ["one","two","three"] I want create a "single line code" for find a string. for example, I have this code: >>> [..

How to convert a date String to a Date or Calendar object?

I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creatin..

Increasing heap space in Eclipse: (java.lang.OutOfMemoryError)

try { // CompareRecord record = new CompareRecord(); Connection conn = new CompareRecord().getConection("eliteddaprd","eliteddaprd","192.168.14.104","1521"); ResultSet res = null; if ..

How to list the files inside a JAR file?

I have this code which reads all the files from a directory. File textFolder = new File("text_directory"); File [] texFiles = textFolder.listFiles( new FileFilter() { public boole..

Declaring a boolean in JavaScript using just var

If I declare a JavaScript boolean variable like this: var IsLoggedIn; And then initialize it with either true or 1, is that safe? Or will initializing it with 1 make the variable a number?..

How to set a default value with Html.TextBoxFor?

Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it is easy to set a default value on a textbox because there is an overload Html.TextBox(string name, object value). When I tr..

How can I make a countdown with NSTimer?

How can I make a countdown with an NSTimer using Swift?..

What do the python file extensions, .pyc .pyd .pyo stand for?

What do these python file extensions mean? .pyc .pyd .pyo What are the differences between them and how are they generated from a *.py file?..

Delete a single record from Entity Framework?

I have a SQL Server table in Entity Framework named employ with a single key column named ID. How do I delete a single record from the table using Entity Framework?..

Find package name for Android apps to use Intent to launch Market app from web

I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found instructions for creating the links to launch the Market but this assu..

iOS 9 not opening Instagram app with URL SCHEME

The following URL opens on iOS 8.3 and lower, but it does not work and iOS 9 let instagramURL = NSURL(string: "instagram://app") Why won't the URL open?..

How do you clear a slice in Go?

What is the appropriate way to clear a slice in Go? Here's what I've found in the go forums: // test.go package main import ( "fmt" ) func main() { letters := []string{"a", "b", "c", "d"} ..

Display only 10 characters of a long string?

How do I get a long text string (like a querystring) to display a maximum of 10 characters, using JQuery? Sorry guys I'm a novice at JavaScript & JQuery :S Any help would be greatly appreciated...

Java LinkedHashMap get first or last entry

I have used LinkedHashMap because it is important the order in which keys entered in the map. But now I want to get the value of key in the first place (the first entered entry) or the last. Should ..

pandas: filter rows of DataFrame with operator chaining

Most operations in pandas can be accomplished with operator chaining (groupby, aggregate, apply, etc), but the only way I've found to filter rows is via normal bracket indexing df_filtered = df[df['c..

Multiple parameters in a List. How to create without a class?

This is probably a pretty obvious question, but how would I go about creating a List that has multiple parameters without creating a class. Example: var list = new List<string, int>(); list.A..

Automating running command on Linux from Windows using PuTTY

I have a scenario where I need to run a linux shell command frequently (with different filenames) from windows. I am using PuTTY and WinSCP to do that (requires login name and password). The file is ..

Angular2 Material Dialog css, dialog size

Angular2 material team recently released the MDDialog https://github.com/angular/material2/blob/master/src/lib/dialog/README.md I'd like to change the looking and feel about the angular2 material's d..

Compiled vs. Interpreted Languages

I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my ..

Passing data to a bootstrap modal

I've got a couple of hyperlinks that each have an ID attached. When I click on this link, I want to open a modal ( http://twitter.github.com/bootstrap/javascript.html#modals ), and pass this ID to the..

how to insert a new line character in a string to PrintStream then use a scanner to re-read the file

I have several classes designed to simulation a book catalog. I have a book class (isbn, title, etc...), a BookNode class, a BookCatalog which is a LinkedList of books and a driver class (gui). My pro..

How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is easy enough but then it seems like there is something that needs to be done to signal the e..

Angular HttpPromise: difference between `success`/`error` methods and `then`'s arguments

According to AngularJS doc, calls to $http return the following: Returns a promise object with the standard then method and two http specific methods: success and error. The then method takes two ..