mklink – symbolic link under windows
mklink – symbolic link under windows
Here’s a really handy utility for making symbolic links under windows :-p
Sql server – rename database query
alter database [$(DatabaseName)] modify name = [AnswerBulkMessaging-eLetter]
Service Broker debugging
handy link for debugging service broker
c# – POST request with parameters
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
HttpWebRequest objWebHTTPReq;
Stream objStream;
string requestString = System.IO.File.ReadAllText(@”C:\test.xml”);
string serviceEndPoint = “http://www4.elviab2b.de/ota/trt/start.do”;
DateTime start = DateTime.Now;
StringBuilder returnedXML = new StringBuilder();
string outputstring = string.Empty;
ASCIIEncoding encoding = new ASCIIEncoding();
StreamReader r = null;
try
{
if (!string.IsNullOrEmpty(requestString))
outputstring = Regex.Replace(requestString, “\\s+”, ” “);
outputstring = outputstring.Replace(“utf-16”, “utf-8”);
string PostData = “&data=” + outputstring.Replace(“<?xml version=\”1.0\” encoding=\”utf-16\”?>”, “”);
// TH 19/05/2008 for resolving the & issues in TT.API.TAPI.OLY’s data
//PostData = PostData.Replace(“+”, “&”);
PostData = PostData.Replace(“+”, “%26amp%3B”);
byte[] data = encoding.GetBytes(PostData);
//byte[] data = encoding.GetBytes(System.Web.HttpUtility.UrlEncode(PostData));
objWebHTTPReq = (HttpWebRequest)WebRequest.Create(serviceEndPoint);
// TODO — Change the ContentType to the correct ContentType format for the API.
objWebHTTPReq.ContentType = “application/x-www-form-urlencoded”;
objWebHTTPReq.Accept = “text/html”;
objWebHTTPReq.ContentLength = data.Length;
objWebHTTPReq.Method = “POST”;
// TH 20/11/2007 to remove connection closed message
objWebHTTPReq.KeepAlive = false;
string httpOutput = objWebHTTPReq.Headers.ToString();
objStream = objWebHTTPReq.GetRequestStream();
objStream.Write(data, 0, data.Length);
objStream.Flush();
objStream.Close();
WebResponse resp = objWebHTTPReq.GetResponse();
r = new StreamReader(resp.GetResponseStream());
returnedXML.Append(r.ReadToEnd().Replace(“xmlns:xsd=\”http://www.w3.org/2001/XMLSchema\” xmlns:xsi=\”http://www.w3.org/2001/XMLSchema-instance\””, “”).Replace(“<?xml version=\”1.0\” encoding=\”utf-8\” ?>”, “”).ToString().Replace(“&”, “”));
Console.WriteLine(r.ToString());
return ;
}
catch (Exception ex)
{
throw new Exception (ex.Message + ” ” + ex.StackTrace);
}
finally
{
if (r != null)
r.Dispose();
}
}
}
}
MySql – get creation date for a table
select table_name,create_time from information_schema.tables where table_name = ‘blah’
Three Mobile Broadband Issues.
for those thinking about taking out a three mobile contract, a word of warning :
I’m posting this so that no-one falls into the trap I did, of trying to purchase mobile broadband from Three.
I strongly suggest you avoid it at all costs, here are just some of what’s happened over the last 2 weeks.
I spoke to Three’s online sales team, and asked various questions about their 3g dongle solution
a) can it support more than one connected device – yes, up to 5 including 3g phones
b) can it stream videos from netflix and bbc iplayer to the wii – yes, no problem
c) what speed can i expect in my area – generally around 14MB but off peak up to 21MB
The reality :
If i connect a pc and a laptop, one or either randomly disconnects every 10-15 minutes.
netflix continually reloads itself every 10-15 mins, a tad annoying after 10 or so restarts.
iplayer is virtually unusable, constantly displays insufficient badndwidth and buffers constantly.
3g phone constantly disconnects, and some sites such as facebook are completely inaccessible