{"QuestionId": 63295, "AnswerCount": 3, "Tags": "", "CreationDate": "2008-09-15T14:16:54.947", "AcceptedAnswerId": null, "Title": "How do I get sun webserver to redirect from /", "Body": "

I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.\nMy cluster is under /portal/yadda.\nI want anyone who goes to

\n\n
http://the.domain.com/\n
\n\n

to be quickly redirected to

\n\n
http://the.domain.com/portal/\n
\n\n

I have and index.html that does a post and redirect, but the user sometimes sees it.\nDoes anyone have a better way?

\n\n

Aaron

\n\n

I have tried the 3 replies below. None of them worked for me. Back to the drawing board.\nA

\n", "Lable": "No"} {"QuestionId": 295832, "AnswerCount": 2, "Tags": "", "CreationDate": "2008-11-17T15:18:02.433", "AcceptedAnswerId": "295891", "Title": "Embed XML element in inline VB code", "Body": "

Consider the following code in VB9:

\n\n
Dim text = \"Line1<br/>Line2\"\nDim markup = <span><%= text %></span>.ToString\n
\n\n

While I was hoping markup would end up being <span>Line1<br/>Line2</span>, it actually evaluates to <span>Line1&lt;br/&gt;Line2</span>.

\n\n

Is there any way to get the value of the variable not to be HTML encoded?

\n\n

P.S.: This is an oversimplified example of what I'm trying to do. I know this could be rewritten a number of ways to make it work, but the way my code is constructed, un-encoding the variable would be optimal. If that's not possible, then I'll go down a different road.

\n\n

More detail: The \"text\" is coming from a database, where a user can enter free-form text, with carriage returns. The output is HTML, so somehow I need to get the value from the database and convert the carriage returns to line breaks.

\n", "Lable": "No"} {"QuestionId": 310121, "AnswerCount": 2, "Tags": "", "CreationDate": "2008-11-21T20:38:57.793", "AcceptedAnswerId": "310145", "Title": "How do I break the a BoundField's HeaderText", "Body": "

In HTML in the td of a table you can break text by using <BR> between the words. This also works in the HeaderText of a TemplateItem but not the HeaderText of a BoundField. How do I break up the Header text of a BoundField.

\n", "Lable": "No"} {"QuestionId": 355848, "AnswerCount": 7, "Tags": "", "CreationDate": "2008-12-10T12:06:39.020", "AcceptedAnswerId": "355878", "Title": "How can I emulate \"classes\" in JavaScript? (with or without a third-party library)", "Body": "

How can I emulate classes (and namespaces) in JavaScript?

\n\n

I need to create a JavaScript library and have limited experience with the language. I always thought that it had native support for classes, but it is less related to Java than I had assumed. It seems that everything in JavaScript is actually a function.

\n\n

What I have found out so far makes a lot of sense with it being a dynamic weakly typed language, but this makes it a bit of a departure for people who are used to having a strongly typed language and using a compiler to spot our errors :)

\n\n

I mainly work in C# and Java, and was hoping for something syntacticaly similar so the library would look familiar for our other C# developers that will have to maintain it.

\n\n

I have the following sort of code which works, but I was wondering what other developer's takes would be on this. What are the alternatives? Is there a way that is better? Is there a way that is more readable?

\n\n

I understand that what I want is something similar to C# or Java when I should just accept the fact that this is JavaScript, but my aim is to try to ease the learning curve for other developers by making it more familiar and intuitive for them.

\n\n
//Perform the namespace setup (this will actually be done with checking \n//in real life so we don't overwrite definitions, but this is kept short \n//for the code sample).\nvar DoctaJonez = new function();\nDoctaJonez.Namespace1 = new function();\n\n/**\n * Class description.\n */\nDoctaJonez.Namespace1.SomeClass = function()\n{\n    /**\n     * Public functions listed at the top to act like a \"header\".\n     */\n    this.publicFunction = privateFunction;\n\n    /**\n     * Private variables next.\n     */\n    var privateVariable;\n\n    /**\n     * Finally private functions.\n     */\n    function privateFunction()\n    {\n\n    }\n}\n\n//Create an instance of the class\nvar myClass = new DoctaJonez.SomeClass();\n\n//Do some stuff with the instance\nmyClass.publicFunction();\n
\n", "Lable": "No"} {"QuestionId": 447171, "AnswerCount": 1, "Tags": "", "CreationDate": "2009-01-15T15:30:14.030", "AcceptedAnswerId": null, "Title": "Find out SSL version (V2 or V3)", "Body": "

How can one tell if the SSL communication between a client and a server is SSLv2 or SSLv3?

\n", "Lable": "No"} {"QuestionId": 534119, "AnswerCount": 8, "Tags": "", "CreationDate": "2009-02-10T20:43:55.263", "AcceptedAnswerId": "534254", "Title": "Semi-editable Files (eg config files) and version control - best practices?", "Body": "

So, I killed the build today by checking in a config file. It knows where the server is (think SQL server or the like), and I've been working against the server which runs on my box. Normally, or rather, under other circumstances, we'd run against the central server. The daily build, of course, didn't find 'my' server, hence the breakage. Then again, editing the config file to point to the 'normal' server before the checkin, and editing it again after checkin is tendious.

\n\n

I've been tempted to have VC just ignore the config file, so that it doesn't get checked in accidentally. On the other hand, the repository should contain a clean, usable version of the file. I can't possibly ignore it and have it checked in at the same time, now, could I?

\n\n

So, what I'm looking for would be a way to have a file which, errr, which checks out, but never checks in. At least in the most common case - should the config file change significantly, some special procedure to get the new version into the repository would be doable.

\n\n

If You folks have come across this problem before, I'd be interested about any solutions You have found. As long as they don't break the build, that is ;)

\n", "Lable": "No"} {"QuestionId": 666828, "AnswerCount": 6, "Tags": "", "CreationDate": "2009-03-20T16:09:49.430", "AcceptedAnswerId": "666878", "Title": "Create a new db user in SQL Server 2005", "Body": "

how do you create a new database user with password in sql server 2005?

\n\n

i will need this user/password to use in the connection string eg:

\n\n
uid=*user*;pwd=*password*;\n
\n", "Lable": "No"} {"QuestionId": 710127, "AnswerCount": 2, "Tags": "", "CreationDate": "2009-04-02T15:09:58.250", "AcceptedAnswerId": null, "Title": "Observing changes of derived properties: CALayer KVO example", "Body": "

Is there a way to observe changes in derived properties? For example, I want to know when a CALayer has been added as a sublayer so that I can adjust its geometry relative to its (new) parent.

\n\n

So, I have a subclassed CALayer, say CustomLayer, and I figured I could register an observer for the property in init:

\n\n
[self addObserver:self forKeyPath:@\"superlayer\" options:0 context:nil]\n
\n\n

and implement observeValueForKeyPath:ofObject:change:context. Nothing ever happens because, presumably, superlayer is a derived property (the attr dictionary stores an opaque ID for the parent). Similarly, I can't subclass setSuperlayer: because it is never called. In fact, as far as I can tell there are no instance methods called or public properties set on the sublayer when a parent does [self addSublayer:aCustomLayer].

\n\n

Then I thought, OK, I'll subclass addSublayer like this:

\n\n
- (void)addSublayer:(CALayer *)aLayer {\n    [aLayer willChangeValueForKey:@\"superlayer\"];\n    [super addSublayer:aLayer];\n    [aLayer didChangeValueForKey:@\"superlayer\"];\n}\n
\n\n

but still nothing! (Perhaps it's a clue that when I make a simple standalone test class and use the will[did]ChangeValueForKey: then it works.) This is maybe a more general Cocoa KVO question. What should I be doing? Thanks in advance!

\n", "Lable": "No"}