SQL Server: Examples of PIVOTing String data

SQL Server: Examples of PIVOTing String data

Trying to find some simple SQL Server PIVOT examples. Most of the examples that I have found involve counting or summing up numbers. I just want to pivot some string data. For example, I have a query returning the following.Action1 VIEW

Why does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the re

Why does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the re

I am trying to do authorization using JavaScript by connecting to the RESTful API built in Flask. However, when I make the request, I get the following error: XMLHttpRequest cannot load http://myApiUrl/login. No 'Access-Control-Allow-Origi

BinaryWrite exception “OutputStream is not available when a custom TextWriter is used” in MVC 2 ASP.

BinaryWrite exception “OutputStream is not available when a custom TextWriter is used” in MVC 2 ASP.

I have a view rendering a stream using the response BinaryWrite method. This all worked fine under ASP.NET 4 using the Beta 2 but throws this exception in the RC release: "HttpException" , "OutputStream is not available when a custom Tex

Understanding the WPF Dispatcher.BeginInvoke

Understanding the WPF Dispatcher.BeginInvoke

I was under the impression that the dispatcher will follow the priorityof the operations queued it and execute the operations based on the priorityor the order in which the operation was added to the queue(if same priority)until I was told

Set UIButton Layer Border Width and Color in Interface Builder

Set UIButton Layer Border Width and Color in Interface Builder

Can I use IB_DESIGNABLE and/or IBInspectable to set layer.borderWidth and layer.borderColor in Interface Builder? I am currently creating my button in code but I'd like to be able to set all of this in IB but I'm not sure if these propertie

How to call a controller method from a button in rails 4

How to call a controller method from a button in rails 4

So I feel really stupid right now, but I can't seem to find an answer.So I have a method which needs to be called EXACTLY once, and since this is only the experimental phase, I decided that a simple button should suffice. However, I can't s

how to generate Html.ActionLink with icon

how to generate Html.ActionLink with icon

I'm starting to learn ASP.NET MVC, and have a problem, how generate code with Html.ActionLink like this: Create please. 1:Html.ActionLink() only supports plain-text links.You should use for more-complex lin

ASP.NET MVC Error Handling - Remove aspxerrorpath

ASP.NET MVC Error Handling - Remove aspxerrorpath

I'm working on some error handling in my MVC app, and I'd like to change asperrorpath to something that doesn't give away the fact that I'm using .NET... something like pathCan anyone give me some direction on how to change that out? 1:A

What is the HTTP response code for failed HTTP Delete operation?

What is the HTTP response code for failed HTTP Delete operation?

I have a resources with uri /api/books/122 , if this resource doesn't exist at the point where a client sends HTTP Delete for this resource, what is the appropriate response code from this action? Is it 404 Not Found?Thanks 1:Yes, it wou

iOS, How to find selected row Of UITableView?

iOS, How to find selected row Of UITableView?

I'm trying to find selected UITableViewCell as following: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tabl

How to reload current route in Ember.js?

How to reload current route in Ember.js?

in Ember.js I have route with model. Could you help me, when I'm on route playlist how to reload this route (or set new data to model) called by callback from another JS function? I've been looking to documentation so long, but no help for

Jade - missing space before text for line x of jade file

Jade - missing space before text for line x of jade file

I'm making an Express based web application and everytime someone visits this jade file i get the following error:Warning: missing space before text for line 28 of jade file "C:\x\app\views\login.jade"It also spits it out a few times for ea

Rails paperclip gem - Get file from private folder

Rails paperclip gem - Get file from private folder

I'm using paperclip to upload files to my server.If I don't specify the path, paperclip saves the file to a public folder, and then I can download it by accessing in the view.But if I specify the path to a non-public folder, it's not possi

Getting data into a partial view or layout using MVC

Getting data into a partial view or layout using MVC

I want to display information about the logged in user (username, company name, number of notifications, etc) in the layout and/or partial views. These will be common on every page. Is there a trick for getting this data to them, or is it

BackgroundWorker multithread access to form

BackgroundWorker multithread access to form

I am using 5 BackgroundWorker objects running at the same time for a certain purpose, and all of them have to change the same label. How do I do that?How do I modify the form from more than one thread then? And how do i do it in case i want

MVC5 ApplicationUser custom properties

MVC5 ApplicationUser custom properties

I am trying to get to grips with the new Membership system introduced in ASP.NET MVC 5 and I've come across a small issue which I am pretty sure you will be able to help me with.I am going based off this tutorial and have introduced custom

Android sensor listening when app in background

Android sensor listening when app in background

Is it possible to track motion sensor events on Android continuously, even if the app is not in foreground?If yes - what's the drain on battery?A client asked if it would be possible to write an app that would initiate an action if the pers

Center labels stacked bar (counts) ggplot2

Center labels stacked bar (counts) ggplot2

I'm attempting to place labels on a stacked bar plot using this approach (though if there's now a better approach I'm open to what ever):Showing data values on stacked bar chart in ggplot2Here's my original plot:dat Here's my attempt to cen

Rails clone copy or duplicate

Rails clone copy or duplicate

I have a nested form and once I save, I want to be able to click a link on the show page to copy or clone that form and open a new one. From there I should be able to make edits (like a new id) and save as a new record. I have seen some exa

Hibernate one to zero or one mapping

Hibernate one to zero or one mapping

I'm trying to map a one to "zero or one" relationship in Hibernate. I think I may have found a way using a many-to-one. class A { private B b; // ... getters and setters}class B { private A a;}Class A's mapping specifies:and Class B's

“session has already been started…” exception in Zend Framework application

“session has already been started…” exception in Zend Framework application

I get this error when trying to load a Zend Framework application: Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()' in /www/htdocs/w00a1e

How do I prevent 'Publish Web' from overwriting config files?

How do I prevent 'Publish Web' from overwriting config files?

When I publish my Asp.Net MVC website to the production server (via VS2008), the web.config & castle.xml files are overwritten. The content of these files is obviously different between my local dev environment and the production server.How

Using a custom font in WPF

Using a custom font in WPF

I need my WPF app to use a true-type font for a different language. I have the font located in a folder called 'fonts' inside the project. The font I'm using is available for free download hereSince the font is installed in my system i firs

How to pass dynamic value in @Url.Action?

How to pass dynamic value in @Url.Action?

I have written following jquery in my partial view: $.ajax({ type: "POST", url: '@Url.Action("PostActionName", "ControllerName")', data: { Id: "01" }, success: function(data) { if (data.s

How do you enforce lowercase routing in ASP.NET Core MVC 6?

How do you enforce lowercase routing in ASP.NET Core MVC 6?

In ASP.NET 4 this was as easy as routes.LowercaseUrls = true; in the RegisterRoutes handler for the app.I cannot find an equivalent in ASP.NET Core MVC6 for achieving this. I'd think it would be here:app.UseMvc(configureRoutes =>{ config