instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm using the following code, using the SharpZipLib library, to add files to a .zip file, but each file is being stored with its full path. I need to only store the file, in the 'root' of the .zip file. string[] files = Directory.GetFiles(folderPath); using (ZipFile zipFile = ZipFile.Create(zipFilePath)) { zipFil...
stackexchange/codereview
While designing a table my colleague here says that I should avoid identity column as it is specific to SQL Server and MS Access, But I differ with his views as it makes my coding simpler. Should I use identity column or not? If not what is best way to create the identity columns from application code?
stackexchange/codereview
I am currently plowing my way through IBM's tutorial on CakePHP At one point I run into this snippet of code: <?php class Dealer extends AppModel { var $name = 'Dealer'; var $hasMany = array ( 'Product' => array( 'className' => 'Product', 'conditions'=>, // is this allowed? ...
stackexchange/codereview
I am attempting to write an application that uses libCurl to post soap requests to a secure web service. This Windows application is built against libCurl version 7.19.0 which, in turn, is built against openssl-0.9.8i. The pertinent curl related code follows: FILE *input_file = fopen(current->post_file_name.c_str()...
stackexchange/codereview
Which is the best timer approach for a C# console batch application that has to process as follows: Connect to datasources process batch until timeout occurs or processing complete. "Do something with datasources" stop console app gracefully. related question: How do you add a timer to a C# console application
stackexchange/codereview
In the Google C++ Style Guide, there's a section on Operator Overloading that has a curious statement: Overloading also has surprising ramifications. For instance, you can't forward declare classes that overload operator&. This seems incorrect, and I haven't been able to find any code that causes GCC to have a ...
stackexchange/codereview
I have few asynchronous tasks running and I need to wait until at least one of them is finished (in the future probably I'll need to wait util M out of N tasks are finished). Currently they are presented as Future, so I need something like /** * Blocks current thread until one of specified futures is done and returns ...
stackexchange/codereview
What is the best procedure for deploying web apps that rely on cron jobs (for cache maintenance, db updates, ...)? For things like DB schema changes, there are tools such as DBDeploy for managing the changes between versions, but how do you automate updates to the crontab? I know that the actual cron files are store...
stackexchange/codereview
Many database systems don't allow comments or descriptions of tables and fields, so how do you go about documenting the purpose of a table/field apart from the obvious of having good naming conventions? (Let's assume for now that "excellent" table and field names are not enough to document the full meaning of every tab...
stackexchange/codereview
Ok, let's see if I can make this make sense. I have a program written that parses an Excel file and it works just fine. I use the following to get into the file: string FileToConvert = Server.MapPath(".") + "\\App_Data\\CP-ARFJN-FLAG.XLS"; string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + F...
stackexchange/codereview
I have a readonly Excel workbook containing a VBA application. The application saves any data that needs to be saved in a database, and the workbook is always closed without saving (by setting ThisWorkbook.Saved = True in BeforeClose). I have the following problem: User double-clicks on the workbook in Windows Explor...
stackexchange/codereview
I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything. I'd rather not use Disabled, since I want the checked check boxes to be submitted with the rest of the form, I just don't want the client to be able to change th...
stackexchange/codereview
i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being: get rid of all navigation organize data as it would appear on a typical paper form (a customer requirement) i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for.....
stackexchange/codereview
I have a request to display VRML models within a .NET application. Does someone know an easy way, maybe with standard .NET components, to achieve this? What are the issues I maybe have to face when representing VRML within an application?
stackexchange/codereview
When you create a procedure (or a function) in Oracle PL/SQL, you cannot specify the maximum length of the varchar2 arguments, only the datatype. For example create or replace procedure testproc(arg1 in varchar2) is begin null; end; Do you know the maximum length of a string that you can pass as the arg1 argument to...
stackexchange/codereview
This is a very basic problem that's frustrating me at the moment. Let's say within a single solution, I have two projects. Let's call the first project SimpleMath. It has one header file "Add.h" which has int add(int i, int j) and the implementation "Add.cpp" which has int add(int i, int j) { return i+j; } Now let...
stackexchange/codereview
Do you know what may cause memory leaks in JavaScript? I am interested in browsers: IE 7, FireFox 3, Safari 3
stackexchange/codereview
I'm setting the cookie expiration using the following code: // remove existing cookies. request.Cookies.Clear(); response.Cookies.Clear(); // ... serialize and encrypt my data ... // now set the cookie. HttpCookie cookie = new HttpCookie(AuthCookieName, encrypted); cookie.Expires = DateTime.Now.Add(TimeSpan.FromHour...
stackexchange/codereview
I have a "span" element inside a "table" "td" element. The span tag has a Title. I want to get the title of that span tag and pull it out to make it the "mouseover" tip for the "td" element. For example: I want to turn this: <td> <a href="#"><span id="test" title="Acres for each province">Acres</span></a> </td> I...
stackexchange/codereview
I frequently run into problems of this form and haven't found a good solution yet: Assume we have two database tables representing an e-commerce system. userData (userId, name, ...) orderData (orderId, userId, orderType, createDate, ...) For all users in the system, select their user information, their most recent ord...
stackexchange/codereview
It's very easy to mark an image file to become an embedded resource however how does one access the image thereafter. Please can I have some example code?
stackexchange/codereview
I need to add a xml:lang attribute on the root xml node in the outbound document from BizTalk. This is a fixed value, so it may be set in the schema or something. This is what I want to get out: <Catalog xml:lang="NB-NO"> ... </Catalog> I've tried to define the attribute "xml:lang", but it doesn't allow me to use ":" ...
stackexchange/codereview
I'm working on a system were a user can edit existing objects ("Filter" domain objects to be exact) through a GUI. As a UI hint, we only want to enable the save button if the user really modified something to the object. I was wondering if anyone had any experience with this problem and what the best way would be to ap...
stackexchange/codereview
SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not "borrow" the session cookie from the parent window. DETAILS: I'm working on an ASP.NET website (.NET 2.0). I use FormsAuthentication. It is a requirement to use cookies to handle the session. On a page I have a button. When the user ...
stackexchange/codereview
Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as: $numbers = array(1,3,4,5,6,8,11,12,14,15,16); The ranges would be: 1,3-6,8,11-12,14-16
stackexchange/codereview
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window? Should the first call be to pango_win32_get_contex...
stackexchange/codereview
I am developing a Compact Framework 3.5 application for Windows CE 6.0. Help.ShowHelp() throws a NotSupportedException. At windowsembedded.com I found this statement: "Help is not included in the Core run-time because it requires a browser." Is this the reason for the exception? If so, is there any recommended way t...
stackexchange/codereview
I have a function that includes a file based on the string that gets passed to it i.e. the action variable from the query string. I use this for filtering purposes etc so people can't include files they shouldn't be able to and if the file doesn't exist a default file is loaded instead. The problem is that when the fu...
stackexchange/codereview
Does anyone have a good recommendation for a drop shadow jQuery plugin? I've been working on a project that had every element on the page with a subtle drop shadow, we started using RUZEE to do the shadows but there was a severe performance hit when you had more then 4 or 5 shadows being calculated on the page. I went ...
stackexchange/codereview
How do I create subdomain like http://user.mywebsite.example? Do I have to access .htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language? To those who answered: Well, then, should I ask my hosting if they provide some sort of DNS acces...
stackexchange/codereview
I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment details have been confirmed, PayPal redirects back to the URL you originally set ...
stackexchange/codereview
Foo* set = new Foo[100]; // ... delete [] set; You don't pass the array's boundaries to delete[]. But where is that information stored? Is it standardised?
stackexchange/codereview
I'm working with embedded C for the first time. Although my C is rusty, I can read the code but I don't really have a grasp on why certain lines are the way the are. For example, I want to know if a variable is true or false and send it back to another application. Rather than setting the variable to 1 or 0, the origin...
stackexchange/codereview
I want to do some checking in a writer accessor. My first idea was returning a boolean. class MyClass def var=(var) @var = var # some checking return true end end m = MyClass.new retval = (m.var = 'foo') => "foo" Can I set a return value in a writer accessor? If yes, how can I get this value?
stackexchange/codereview
In WCF, what is the difference between Binding.RecieveTimeout and Binding.ReliableSession.InactivityTimeout?
stackexchange/codereview
I'm trying to display a boolean field in Report Designer in Visual Studio 2008. When I tried to run it, an error occurred: "An error has occurred during report processing. String was not recognized as a valid Boolean." I tried to convert it using CBool() but it didn't work.
stackexchange/codereview
I'm writing an app that contains the following tables: (1) employee_type, (2) employee and (3) employee_action. Employee_action is foreign-keyed to employee, and contains a description of what happened and the date of the event, just as you might expect. However, employees can change their type over time (promotion, de...
stackexchange/codereview
UPDATED: on win2k it seems it works OK. Sorry for the confusion. MS Windows Vista internal ftp client has a strange behavior. When redirecting its output and error to a file, the errors do not show up there: ftp -n -s:commands.txt host >output.log 2>&1 When running it from Task Scheduler inside a batch file, I don'...
stackexchange/codereview
I once had a MySQL database table containing 25 million records, which made even a simple COUNT(*) query takes minute to execute. I ended up making partitions, separating them into a couple tables. What i'm asking is, is there any pattern or design techniques to handle this kind of problem (huge number of records)? Is ...
stackexchange/codereview
I'm looking to use a VBScript variable within a reference to a DOM element for a web-app I'm building. Here's a brief excerpt of the affected area of code: dim num num = CInt(document.myform.i.value) dim x x = 0 dim orders(num) For x = 0 To num orders(x) = document.getElementById("order" & x).value objFile.wri...
stackexchange/codereview
After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator (quote) (or equivalent ') function does, yet this has been all over Lisp code that I've seen. What does it do?
stackexchange/codereview
The non-virtual interface idiom describes how the virtual methods are nonpublic customisation points, and public methods are nonvirtual to allow the base class to control at all times how the customisation points are called. This is an elegant idiom and I like to use it, but how does it work if the derived class is a ...
stackexchange/codereview
I have a web application that syncs Outlook contacts to a database (and back) via CDO. The DB contains every contact only once (at least theoretically, of course doublets happen), providing a single point of change for a contact, regardless of how many users have that particular contact in Outlook (like Interaction or ...
stackexchange/codereview
I'm trying to localize my aspx pages. I'm done with content localization using L10n features provided by .net f/w, like resource files. But I'm finding it difficult to set local data in page titles. Most of the browsers, including IE and FF, shows content on window title with some boxes (FF will show properly localize...
stackexchange/codereview
What's the difference between absolute path & relative path when using any web server or Tomcat?
stackexchange/codereview
I have a J2ME application that needs to communicate with my server, and download information for the application in XML. My application could run a lot faster if I had a better format of data, which would allow me to have more efficient parsing code. Does anyone know an efficient substitute for XML? Maybe something spe...
stackexchange/codereview
I have created a Dynamic Web Project in my Eclipse workspace. It is also a Maven project, and under SVN control. But in "Open Resource" (Ctrl+Alt+R) no file from this project appears, unless I check from the window's options (top right drop-down) "Show Derived Resources". I have checked on some of the project's folders...
stackexchange/codereview
I am writing a custom ant task that extends Task. I am using the log() method in the task. What I want to do is use a unit test while deveoping the task, but I don't know how to set up a context for the task to run in to initialise the task as if it were running in ant. This is the custom Task: public class CopyAndSetP...
stackexchange/codereview
In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ is the list of installed programs in my machine (at least most of them). There, there's a String Value called UninstallString which has what you need to run in order to uninstall the program. The thing is not every installer writes the same kind...
stackexchange/codereview
On a question of just performance, how does Python 3 compare to Python 2.x?
stackexchange/codereview
According to the feedparser documentation, I can turn an RSS feed into a parsed object like this: import feedparser d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml') but I can't find anything showing how to go the other way; I'd like to be able do manipulate 'd' and then output the result as XML: ...
stackexchange/codereview
I agree, that programming against interfaces is a good practice. In most cases in Java "interface" in this sense means the language construct interface, so that you write an interface and an implementation class and that you use the interface instead of the implementation class most of the time. I wonder if this is a g...
stackexchange/codereview
I'm interested in actual examples of using fixed point combinators (such as the y-combinator in C++. Have you ever used a fixed point combinator with egg or bind in real live code? I found this example in egg a little dense: void egg_example() { using bll::_1; using bll::_2; int r = fix2( ...
stackexchange/codereview
I'm working on moving a client/server application created with C# and WinForms into the SOA/WPF/Silverlight world. One of the big hurdles is the design of the UI. My current UI is MDI driven and users rely heavily on child windows, having many open at the same time and toggling back and forth between them. What might ...
stackexchange/codereview
If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from: Type.GetType(string).TypeHandle is it?
stackexchange/codereview
I have a C# console app "App1" that reads a row of data from a table in a SQL Server 2005 DB. I want App1 to pass all the data in this row to App2, another C# console app. What is the best way to do this? My first (naive) attempt was to do this: object[] o = myrow.ItemArray; // make a string that separates each item ...
stackexchange/codereview
I have a UI widget that needs to be put in an IFRAME both for performance reasons and so we can syndicate it out to affiliate sites easily. The UI for the widget includes tool-tips that display over the top of other page content. See screenshot below or go to the site to see it in action. Is there any way to make cont...
stackexchange/codereview
I know that attributes are extremely useful. There are some predefined ones such as [Browsable(false)] which allows you to hide properties in the properties tab. Here is a good question explaining attributes: What are attributes in .NET? What are the predefined attributes (and their namespace) you actually use in your ...
stackexchange/codereview
I'm working in a web application using VB.NET. There is also VisualBasic code mixed in it, in particular the Date variable and the Month function of VB. The problem is this part: Month("10/01/2008") On the servers, I get 10 (October) as the month (which is supposed to be correct). On my machine, I get 1 (January) (whi...
stackexchange/codereview
What ReSharper 4.0 templates for C# do you use? Let's share these in the following format: [Title] Optional description Shortcut: shortcut Available in: [AvailabilitySetting] // Resharper template code snippet // comes here Macros properties (if present): Macro1 - Value - EditableOccurence Macro2 - Value - Editable...
stackexchange/codereview
Is there a library function that performs binary search on a list/tuple and return the position of the item if found and 'False' (-1, None, etc.) if not? I found the functions bisect_left/right in the bisect module, but they still return a position even if the item is not in the list. That's perfectly fine for their in...
stackexchange/codereview
I'm currently working on a simple CRUD application. One requirement is preventing users from editing things concurrently. In order to do this I "lock" records to see if they're being edited, to prevent other users from editing at the same time. I was thinking a good way of implementing this might be to use an AJAX keep...
stackexchange/codereview
I have an embedded webserver that has a total of 2 Megs of space on it. Normally you gzip files for the clients benefit, but this would save us space on the server. I read that you can just gzip the js file and save it on the server. I tested that on IIS and I didn't have any luck at all. What exactly do I need to ...
stackexchange/codereview
A friend of mine claims that in a typical database, using (for example) nvarchar[256] will give marginally better performance than nvarchar[200] or nvarchar[250] because of the granularity of page allocations. Is there any truth to this whatsoever? Thanks!
stackexchange/codereview
I am trying to create a multi dimensional array using this syntax: $x[1] = 'parent'; $x[1][] = 'child'; I get the error: [] operator not supported for strings because it is evaluating the $x[1] as a string as opposed to returning the array so I can append to it. What is the correct syntax for doing it this way? The o...
stackexchange/codereview
We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc. Ideally we want to get QTP to understand that ...
stackexchange/codereview
I have found that SP2 doesn't execute from within SP1 when SP1 is executed. Below is the structure of SP1: ALTER PROCEDURE SP1 AS BEGIN Declare c1 cursor.... open c1 fetch next from c1 ... while @@fetch_status = 0 Begin ... Fetch Next from c1 end close c1 deallocate c1 exec sp2 end I see non of the PRINT sta...
stackexchange/codereview
Which search engine would you recommend for a Commerce website? We have millions of products in a catalog and we want it to be as quick as possible. We would also want to make sure that the marketing driven through the search engine will be fast and effective. What are your opinions?
stackexchange/codereview
From the Java 6 Pattern documentation: Special constructs (non-capturing) (?:X)   X, as a non-capturing group … (?>X)   X, as an independent, non-capturing group Between (?:X) and (?>X) what is the difference? What does the independent mean in this context?
stackexchange/codereview
Let's take the code int a, b, c; ... if ((a + b) > C) If we add the values of a and b and the sum exceeds the maximum value of an int, will the integrity of the comparison be compromised? I was thinking that there might be an implicit up cast or overflow bit check and that will be factored into the evaluation of this...
stackexchange/codereview
So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL! Everything's all jumbled: some containers aren't big en...
stackexchange/codereview
It's been a while since I've programmed a GUI program, so this may end up being super simple, but I can't find the solution anywhere online. Basically my problem is that when I maximize my program, all the things inside of the window (buttons, textboxes, etc.) stay in the same position in the window, which results in...
stackexchange/codereview
I was wondering what would be the best strategy to implement a badges system using asp.net mvc. The one that stackoverflow has is pretty interesting. What do you suggest? I guess I need to clarify the question a bit. The problem would be the different criteria for earning every badges. How do make that logic extensible...
stackexchange/codereview
I'm attempting to deliver the same message whether its over FTP or email, but the saved file keeps coming out as different sizes. The textual content of the message is the same, but the nonprintable characters must be accounting for the different size! When transferring the text file over FTP (in Binary mode to prevent...
stackexchange/codereview
How do I pick a random element from a set? I'm particularly interested in picking a random element from a HashSet or a LinkedHashSet, in Java.
stackexchange/codereview
My company has code that integrates with activedirectory/LDAP for centralized userid/password login. Currently, the configuration page can only show the LDAP server linked to the Exchange domain the current computer is on. I'd like to list all available LDAP servers, similar to when you go to Windows Explorer and vie...
stackexchange/codereview
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For instance use a asp:RequiredFieldValidator leave the server side code alone but implement your own client notification using jQuery to highlight the field or background color for example.
stackexchange/codereview
From Wikipedia, the free encyclopedia: Closure (computer science) In computer science, a closure is a function that is evaluated in an environment containing one or more bound variables. When called, the function can access these variables. The explicit use of closures is associated with functional program...
stackexchange/codereview
Is there any way to view the activity log for the integrate SourceSafe inside Visual Studio 2005 Pro? I'd like to be able to quickly see the results of any Get Latest Version, Check In and Checkout actions, and I can't find a way to get that information without having to open the VSS client.
stackexchange/codereview
I need to access some members marked internal that are declared in a third party assembly. I would like to return a value from a particular internal property in a class. Then I'd like to retrieve a value from a property on that returned value. However, these properties return types that are also internal and declared i...
stackexchange/codereview
Is the WriteFile call properly synchronous, and can I delete the file written immediately after the call?
stackexchange/codereview
For my server app, I need to check if an ip address is in our blacklist. What is the most efficient way of comparing ip addresses? Would converting the IP address to integer and comparing them efficient?
stackexchange/codereview
We have a system that is used by a few hundred separate customers, at the end of the month the customer likes to generate a report of the activity with his/her clients. These reports are nothing special; they maybe contain a logo, address and a few lines of mathematical data. Currently we use Crystal Reports but that i...
stackexchange/codereview
we're running in this issue. We're using a web service (using soap4r) to run some kind of searches and the problem appears when the webservice server is down and our aplication is trying to connect to it. At that point the application is unreachable, and all the customers are blocked. What can we do to avoid that? Is ...
stackexchange/codereview
Is the singleton class in Ruby a class in and of itself? Is it the reason why all objects belong to "class?" The concept is fuzzy, but I believe it has something to do with why I can define a class method at all (class foo; def foo.bar ...). What is the singleton class in Ruby?
stackexchange/codereview
I'm a Java developer looking to learn some C#/ASP.NET. One thing I've never liked about .NET from the get-go was that it didn't have support for MVC. But now it does! So I was wondering if anybody knew where to get started learning C# MVC. Also, do you need the non-free version of developer-studio to do this?
stackexchange/codereview
How can I go about making my routes recognise an optional prefix parameter as follows: /*lang/controller/id In that the lang part is optional, and has a default value if it's not specified in the URL: /en/posts/1 => lang = en /fr/posts/1 => lang = fr /posts/1 => lang = en EDIT Ideally, I'm looking to do this...
stackexchange/codereview
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable class. Each webservice exposes a set of objects that share commonality. I have created a set of intermediary objects which exploit the commonality. However in my layer I need to convert between the web service objects and my obje...
stackexchange/codereview
These for-loops are among the first basic examples of formal correctness proofs of algorithms. They have different but equivalent termination conditions: 1 for ( int i = 0; i != N; ++i ) 2 for ( int i = 0; i < N; ++i ) The difference becomes clear in the postconditions: The first one gives the strong guarantee t...
stackexchange/codereview
How do I obtain the serial number of the installed Vista system? Also is there a tool that does the same thing so I can verify MY results?
stackexchange/codereview
As the title states, is there a way to prevent extra elements from showing up in VBA dynamic arrays when they are non-zero based? For example, when using code similar to the following: While Cells(ndx, 1).Value <> vbNullString ReDim Preserve data(1 To (UBound(data) + 1)) ndx = ndx + 1 Wend You have an extra e...
stackexchange/codereview
We have 5 balanced web servers with various websites. What I am trying to achieve is to ensure a single login. i.e. the same user account cannot login to the same website more than once at any given time. The method i'm considering for solving this, is to share session amongst the servers so I can control which sessio...
stackexchange/codereview
I want to create a function like a for loop where I will ideally enter a variable for the times the iteration should happen and some functions inside brackets my function will execute. I hope I was clear enough. Example superFor (1) { // Commands to be executed here add(1 + 2); }
stackexchange/codereview
I need to return only the facet counts from solr. So I basically want to search over all documents and return the facet counts, but I don't want to return any search results. Is this possible? Thanks
stackexchange/codereview
I develop and manage about 45 WindowsCE5 devices. Updating applications on the devices is a nightmare. Is it possible/feasible to do Click-Once on the CF? I take the lack of answers to be "No". :) EDIT: This is a duplicate of question 116713
stackexchange/codereview
I found the Alert Service but it only seems to have methods for Getting and Deleting. How do I add a new alert?
stackexchange/codereview
I have an iframe and couple of tables on my aspx page. Now when the page loads these tables are hidden. The iframe is used to upload file to database. Depending on the result of the event I have to show a particular table on my main page (these tables basically have "Retry","next" buttons...depending on whether or not ...
stackexchange/codereview
Is there a way to use .NET reflection to capture the values of all parameters/local variables?
stackexchange/codereview
I have run across an XML Schema with the following definition: <xs:simpleType name="ClassRankType"> <xs:restriction base="xs:integer"> <xs:totalDigits value="4"/> <xs:minInclusive value="1"/> <xs:maxInclusive value="9999"/> </xs:restriction> </xs:simpleType> However, it seems to me that...
stackexchange/codereview
What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it?
stackexchange/codereview