Monday, May 20, 2013

Sunday, May 19, 2013

Send 160 character sms instead of 80 character on Samsung galaxy s3

If you can not send sms of 160 character using your samsung galaxy s3 then you can use handcent app from playstore.

Using Handcent should fix the problem.

https://market.android.com/details?id=com.handcent.nextsms&hl=en

Tuesday, February 26, 2013

Generate Class from table using T4 template

here is a t4 file. save it using .tt extension and change the connection accordingly and drag to visual studio solution.



Thursday, January 17, 2013

Retrieving all values from POST in asp.net

Here is the code:
<%@ Page Language="C#" CodeFile="~/listen.aspx.cs" Inherits="listenerTest.listen" %>
<%
Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.AddHeader("Content-Type", "text/plain");

if (Request.Form.Count != 0)
{
string all = "";
foreach (string name in Request.Form.AllKeys)
{
string value = Request.Form[name];
// Do something with (name, value).
all += "key:" + name + "value:" + value;
}
}

Response.End();
%>

Thursday, January 3, 2013

Simple Form post from Codebehind C#

Here is the sample code:
private void PostToUrl(string url, string parameters)
{
string URI = url;
string myParameters = parameters;//"param1=value1&param2=value2&param3=value3";

using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string HtmlResult = wc.UploadString(URI, myParameters);
}
}

Select an element from xml file using where clause

Here is the sample xml file
<?xml version="1.0" encoding="utf-8" ?>
<urls>
<url keyword="RA">http://google.com </url>
<url keyword="NC">http://google.com </url>
</urls>

Here is the sample code
XDocument doc=XDocument.Load(Server.MapPath("~/urllist.xml"));
var url = (from ur in doc.Descendants("url")
where ur.Attribute("keyword").Value=="RA"
select ur.Value).ToList();

What is DaemonSet in Kubernetes

 A DaemonSet is a type of controller object that ensures that a specific pod runs on each node in the cluster. DaemonSets are useful for dep...