Добавьте это в свой global.asax
private void Application_BeginRequest(object sender, EventArgs e)
{
Context.RewritePath(System.Text.RegularExpressions.Regex.Replace(
Request.Path, "/rest/(.*)/", "/$1.svc/"));
}
Это заменит / rest / Service1 / arg1 / arg2 на /Service1.svc/arg1/arg2
Недавно я обнаружил это в коде, который написал много лет назад:
// it's a kind of magic (number)
$descr_id = 2;
$url_id = 34;
Я увидел потрясающий код внутри части игры, связанной с ИИ:
..."AI code"...
if(something)
goto MyAwesomeLabel; //Who's gonna be the first to dump crap on me for this?
..."More Ai code"...
MyAwesomeLabel:
//It wasn't that hard to get here, right?
..."Even more AI code"...
[some code]
// [a commented out code line]
// this line added 2004-10-24 by JD.
// removed again 2004-11-05 by JD.
// [another commented out code line]
[some more code]
а) ПОЧЕМУ? б) Какая строка?
This comment was actually written in a different language, but I'll try to get the effect across in a translation:
//we trick it, if forbidden, as if it had already existed
What the comment was trying to describe was the way it was dealing with list items that were turned off - the code marked the item as a duplicate which should therefore be skipped. Yes, a very bass-ackwards way of doing things, but it paled in comparison to the nonsensical comment.
# Ниже приведена документация-заглушка для вашего модуля. Вам лучше его отредактировать
// URGENT TODO: Переделайте это дерьмо, старый код сломан как черт... а мы думали, что решили все проблемы
Только что обнаружил это в одном из своих старых проектов. Сначала я смеялся, но в конце концов я стал ругаться, потому что так и не смог найти ошибку.