{"QuestionId": 3016223, "AnswerCount": 4, "Tags": "", "CreationDate": "2010-06-10T16:10:54.273", "AcceptedAnswerId": "3016704", "Title": "How to determine if a directory path was SUBST'd", "Body": "

How can I figure out if a file is in a folder that has been SUBST'ed or is located in a user folder using C#?

\n", "Lable": "No"} {"QuestionId": 3019400, "AnswerCount": 1, "Tags": "", "CreationDate": "2010-06-11T00:05:17.670", "AcceptedAnswerId": "3019419", "Title": "Customizing Rails XML rendering to include extra properties", "Body": "

Let's say I have a model like this:

\n\n
create_table :ninjas do |t|\n  t.string name\nend\n
\n\n

And the Ninja class with an extra property:

\n\n
class Ninja < ActiveRecord::Base\n  def honorific\n    \"#{name}san\"\n  end\nend\n
\n\n

And in my controller I just want to render it to XML:

\n\n
def show\n  render :xml => Ninja.find(params[:id])\nend\n
\n\n

The honorific part isn't rendered. That makes sense, since it's just a method, but is there a way of tricking it?

\n\n

I'm totally up for answers to the effect of, \"You're doing this totally wrong.\" I'll just add that I really do want to calculate the honorific on the fly, and not, like, store it in the database or something.

\n", "Lable": "No"} {"QuestionId": 3048949, "AnswerCount": 1, "Tags": "", "CreationDate": "2010-06-15T20:56:35.850", "AcceptedAnswerId": null, "Title": "Can I get a tab to display in a rendered report?", "Body": "

I have built an RDL report and after rendering any tab characters contained within my returned data do not appear in the generated report. Is it possible to display tab characters? (Users want to have the basic formatting of their 'comments' field to appear.) Tabs added to the rdl itself are maintained, but those in the data seemed to be stripped out by the rendering engine.

\n", "Lable": "No"} {"QuestionId": 3118401, "AnswerCount": 3, "Tags": "", "CreationDate": "2010-06-25T13:34:24.707", "AcceptedAnswerId": null, "Title": "iPad UIWebView position a UIPopoverController view at a href link coords", "Body": "

I'm hoping that this question isn't a stupid one but how does one go about positioning a UIPopoverController view over a UIWebView so that the popup view arrow points at the UIWebView link that was clicked to show it?

\n\n

I'm using the delegate method;

\n\n
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {\nif ( [[[inRequest URL] absoluteString] hasPrefix:@\"myscheme:\"] ) {\n//UIPopoverController stuff here\nreturn NO;\n}\n
\n\n

}

\n\n

to capture and route the click but I'm unsure how to get the link coords to position the popup view.

\n\n

Any help or pointer to relevant info would be very much appreciated.

\n", "Lable": "No"} {"QuestionId": 3119409, "AnswerCount": 1, "Tags": "", "CreationDate": "2010-06-25T15:44:32.863", "AcceptedAnswerId": null, "Title": "sandboxd Notice: deny file-write-data", "Body": "

I am working through some crash logs and keep seeing messages like this one:

\n\n

Fri Jun 25 09:09:01 unknown sandboxd[427] : MyApp(422) deny file-write-data /private/var/mobile/Media/PhotoData

\n\n

Am I doing something wrong that is causing this? This one has to do with taking photos from within the app, but I have seen others in parts of my app as well.

\n\n

As far as I can tell I am seeing no errors in my app and am not trying to write to the device outside my sandbox area.

\n\n

Thanks for any help you can provide.

\n", "Lable": "No"} {"QuestionId": 3121597, "AnswerCount": 2, "Tags": "", "CreationDate": "2010-06-25T21:34:44.337", "AcceptedAnswerId": "3121657", "Title": "How to handle REST Exceptions?", "Body": "

We are in the middle of a ongoing discussion about how to handle REST exceptions.

\n\n

Response Content type : JSON

\n\n

Two solutions we have:

\n\n
    \n
  1. Throw all the unchecked exceptions as a JSON response.
  2. \n
  3. Send Request Invalid Response code.
  4. \n
\n\n

Arguments:

\n\n
    \n
  • When its a error, why return JSON? Just send a invalid response code.
  • \n
\n\n

Counter Argument:

\n\n
    \n
  • Response code are too technical to handle for normal developers.
  • \n
\n\n

Whats your say??

\n", "Lable": "No"} {"QuestionId": 3160829, "AnswerCount": 3, "Tags": "", "CreationDate": "2010-07-01T18:58:48.563", "AcceptedAnswerId": "3781015", "Title": "Identifying frequent formulas in a codebase", "Body": "

My company maintains a domain-specific language that syntactically resembles the Excel formula language. We're considering adding new builtins to the language. One way to do this is to identify verbose commands that are repeatedly used in our codebase. For example, if we see people always write the same 100-character command to trim whitespace from the beginning and end of a string, that suggests we should add a trim function.

\n\n

Seeing a list of frequent substrings in the codebase would be a good start (though sometimes the frequently used commands differ by a few characters because of different variable names used).

\n\n

I know there are well-established algorithms for doing this, but first I want to see if I can avoid reinventing the wheel. For example, I know this concept is the basis of many compression algorithms, so is there a compression module that lets me retrieve the dictionary of frequent substrings? Any other ideas would be appreciated.

\n", "Lable": "No"} {"QuestionId": 3236070, "AnswerCount": 1, "Tags": "