Monday, May 30, 2011

odata блин

http://social.msdn.microsoft.com/Forums/en-US/dataservices/thread/255d9dc4-a083-4558-92bd-6aa96fed09d0

бляяяяяяя! кассини не надо использовать а надо настраивать IIS Express.

/////////////////////

http://blogs.msdn.com/b/astoriateam/archive/2011/03/09/announcing-wcf-data-services-march-2011-ctp2-for-net4-amp-sl4.aspx

Although proudly anonced - Properties on derived types, it still haven't been implemented thorougly, you cant orderby by such properties nor select their value by select.

я был не прав

http://localhost:53449/ITSServiceOData.svc/Subjects?oftype='Company'&orderby=Name

It is neccessary to use oftype, still can't find proper documentation on thios topic, only found this one http://www.odata.org/blog/2010/7/30/enhancing-odata-support-for-querying-derived-types, but looks like blue print

Thursday, May 26, 2011

ubuntu stuff

netstat -lntup

chmod o+wx file2

sudo vi config.xml

$ sudo ufw allow $port
---


https://help.ubuntu.com/community/FilePermissions
http://www.jonathanhui.com/fisheye-ubuntu
http://bitnami.org/faq/virtual_machines

Шаблон JQuery plugin

Thursday, May 19, 2011

ODATA Custom Exceptions

http://msdn.microsoft.com/en-us/library/ee391967.aspx#Y1700
   1:  public class AuthenticationInterceptor : RequestInterceptor
   2:  {
   3:      public AuthenticationInterceptor() : base(false) { }
   4:      public override void ProcessRequest(ref RequestContext requestContext)
   5:      {
   6:          if (!IsValidApiKey(requestContext))
   7:              GenerateErrorResponse(requestContext,
   8:                  HttpStatusCode.Unauthorized,
   9:                  "Missing or invalid user key (supply via the Authorization header)");
  10:      }
  11:      public bool IsValidUserKey(Message req, string key, string uri)
  12:      {
  13:          ... // ommitted for brevity
  14:      }
  15:      public void GenerateErrorResponse(RequestContext requestContext,
  16:          HttpStatusCode statusCode, string errorMessage)
  17:      {
  18:          // The error message is padded so that IE shows the response by default
  19:          string errorHtml =
  20:              "<html><HEAD><TITLE>Request Error</TITLE></HEAD><BODY>" +
  21:              "<H1>Error processing request</H1><P>{0}</P></BODY></html>";
  22:          XElement response = XElement.Load(new StringReader(
  23:              string.Format(errorHtml, errorMessage)));
  24:          Message reply = Message.CreateMessage(MessageVersion.None, null, response);
  25:          HttpResponseMessageProperty responseProp = new HttpResponseMessageProperty()
  26:          {
  27:              StatusCode = statusCode
  28:          };
  29:          responseProp.Headers[HttpResponseHeader.ContentType] = "text/html";
  30:          reply.Properties[HttpResponseMessageProperty.Name] = responseProp;
  31:          requestContext.Reply(reply);
  32:          // set the request context to null to terminate processing of this request
  33:          requestContext = null;
  34:      }
  35:  }

ODATA Custom Exceptions

 
http://msdn.microsoft.com/en-us/library/ee391967.aspx#Y1700

public class AuthenticationInterceptor : RequestInterceptor
{     public AuthenticationInterceptor() : base(false) { }     public override void ProcessRequest(ref RequestContext requestContext)     {         if (!IsValidApiKey(requestContext))             GenerateErrorResponse(requestContext,                 HttpStatusCode.Unauthorized,                 "Missing or invalid user key (supply via the Authorization header)");     }     public bool IsValidUserKey(Message req, string key, string uri)     {         ... // ommitted for brevity     }     public void GenerateErrorResponse(RequestContext requestContext,         HttpStatusCode statusCode, string errorMessage)     {         // The error message is padded so that IE shows the response by default         string errorHtml =             "<html><HEAD><TITLE>Request Error</TITLE></HEAD><BODY>" +             "<H1>Error processing request</H1><P>{0}</P></BODY></html>";         XElement response = XElement.Load(new StringReader(             string.Format(errorHtml, errorMessage)));         Message reply = Message.CreateMessage(MessageVersion.None, null, response);         HttpResponseMessageProperty responseProp = new HttpResponseMessageProperty()         {             StatusCode = statusCode         };         responseProp.Headers[HttpResponseHeader.ContentType] = "text/html";         reply.Properties[HttpResponseMessageProperty.Name] = responseProp;         requestContext.Reply(reply);         // set the request context to null to terminate processing of this request         requestContext = null;     }
}

Wednesday, May 18, 2011

КРИТИ[Ц|Н]ИЗМ

 

http://thisdeveloperslife.com/post/2-0-1-criticism

Ayende Rahien звезда, критик и девелопер NHIBERNATE, любит критиковать, говорит с чмошным французским акцентом (нот персонал инсалт бат, лет ми спик форм май харт, франзузский язык звучит чмошно а тем более его англицкий аналог), сказал важную вещь чуваки которые делают Light Switch лохи и лэйзи вот – дальше бла-бла-бла – дальше Хасельман – “зачто ты назвал мой подкаст о революции в еджипте крапом?” (это он уже какокумо то петру петровичу в твите) – петр петрович сказал что он ваще сам с балкан и знает что такое революции это когда главный меняется а система остается той же а делаьше дженерал дизапойтмент – бла-бла-бла – вис девлоперс лайв – кул стафф эктуали

Monday, May 16, 2011

mvc wish list

1. Support complex type models. Now MVC can't get access to the comtainers metadata properties, lot of problems.
2.why it is needded to validate in ModelValidator, values which don't passed in request parameteres.
3. ValidateMessageFor - Template as for types