Just a quick refresh on my HTMLWriter utility library. Some minor changes/additions:
1. Added support for the NOBR tag
2. Improved the special character functions including ignoring the ‘&’ sign when needed.
Latest version here.
Just a quick refresh on my HTMLWriter utility library. Some minor changes/additions:
1. Added support for the NOBR tag
2. Improved the special character functions including ignoring the ‘&’ sign when needed.
Latest version here.
A useful JavaScript library I came across recently is the one created by Balamurugan that is based on the wz_jsgraphics library from walterzorn.
I made some modifications to the Pie library so more ‘properties’ can be specified by the calling script/code which makes it easier to use.
An example:
<script type="text/javascript" src="wz_jsgraphics.js"></script> <script type="text/javascript" src="pie.js"></script> <div id="pieCanvas" style="overflow: auto; position:relative;height:300px;width:400px;"></div> <script type="text/javascript">
var p = new pie();
p.radius = 100;
p.labelDistance = 120;
p.xCenter = 200;
p.yCenter = 150;
p.add("Jan",49);
p.add("Feb",51);
p.add("Mar", 87);
p.add("Apr",120);
p.add("May",56);
p.add("Jun",41);
p.add("Jul",31);
p.add("Aug",65);
p.fontName = "Tahoma";
p.labelFontSize = 14;
p.render("pieCanvas", "This is a test");
With this you will get a plain (but nice) pie graph that can use customize a bit if you like.
Here is a link to my modified version: JavaScriptPie
I was reading this morning about the previews of Windows Phone 8 starting to make rounds and the one thing that draw my attention was the things mentioned about older hardware that won’t be supported by the new OS. I have an older ‘first generation’ WMP7 phone (HTC Mozart) that I use as a backup phone so it would have been nice if it was possible to upgrade to WMP8 – but unfortunately MS is greedy and wants us to buys more hardware (that has all the royalties and licenses built in) that makes them even more money.
One interesting thing mentioned in a techreport article is that there will be an upgrade to WMP7 to version 7.8 that will superficially look like the new OS (but many features missing of course). Hopefully this could help until I have the opportunity to upgrade my phone at the end of this year or so.
I have to admit, the general feeling towards Windows 8 is still not a positive one – definitely if you look at it from a desktop/productivity perspective. BUT, seeing the pictures of the newly announced Microsoft tablets there may be some hope for Microsoft/Windows – as long as you are in the ‘tablet’ or consumer market. They are to be branded ‘Surface’ or Microsoft boutique multi-touch tablets. Looks awsum! (but then these are marketing pictures…)

Microsoft tablet (shamelessly copied from techreport site 😉 )
One positive feature of both (yes that’s right two) models is the battery life. The ARM (NVidia) based one has something like a 31 watt-hour battery while the Intel one has 42 watt-hour. If that is true these little machines would really be nice for people that are always on the move. The Intel model features a full HD display while the ARM model has an expansion slot (Micro HD). Both models include an detachable ‘soft’ keyboard. Storage is not in the PC arena but still a useful 32 or 64GB on the ARM model and 64/128GB on the Intel one.

Keyboard choices
On a slightly negative side they only have USB 2.0 ports (not 100% sure about the Intel one) plus only the ARM model includes a copy of Office. The tablets will be sold in Microsoft ‘stores’ thus meaning it won’t be available in our beloved S of A. Our only option would be to try to buy it online or smuggle one in with a friend that was visiting the US of A.
Well, good luck Microsoft, perhaps there is some hope for ya.
Update: apparently the Intel based version does have USB 3.0. Nice.
Just a quick tip how to handle using an UI object’s innerText property properly. Even today there are differences on how web browsers give you access to the ‘Text’ content of an HTML element. Let say you have the following html:
<p id=”mine”>This is some text</p>
To get the ‘content you must use the following:
IE and Chrome
mine.innerText
but in Firefox
mine.textContent
To make a ‘universal function to get this text you can use the following function:
function getInnerText(obj){
if (obj){
if (obj.innerText)
return obj.innerText;
else
return obj.textContent
}
else
return "";
}
Ok, Microsoft has restored some faith from my side in them – after announcing that the new Visual Studio 11 (now called VS 2012) would NOT support any desktop development anymore.
They eventually changed their minds due to a lot of pressure and decided to release a desktop specific version as well – see this.
A quote from the article:
With this new Express edition, developers will be able to use C++, C#, or Visual Basic to create Windows desktop and console applications. Developers will also get access to new advances available across the Express family in Visual Studio 2012, such as the latest compilers and programming language tools, integrated unit testing, and the ability for small development teams to collaborate via Team Explorer and TFS Express.
Now, we just need to get MS to drop Metro and BioWare to fix Mass Effect 3’s ending… and the world could be a happy place again… hehe
This may be just a hoax or misunderstood info but apparently there might be a different ending for ME3 (in the works) after all – or at least a better explanation of why certain things happened the way they did.
Look at this screenshot.
There is some possible explanation why the ending was so ‘bad’ and how they possibly changed it just before the final release to give themselves more time to complete the ‘real’ ending – called something like ‘The Truth’. They do mention release dates of April/May which have passed already…
There is also mentions of more Multiplayer character classes like the Prothean Adept and Vanguard. Well, perhaps this is just grabbing at straws for hope but it may just give some hope for the Mass Effect story line/universe after all.
But perhaps the best option would be to just have some ammo (like Grunnt would say. I don’t need luck – I have ammo)
There is one thing I hate more than the ending of Mass Effect 3… yep, you can guess it from the title…
How any major software/game company can produce a piece of c.r.a.p. like that I don’t know. The developers that wrote it must really be ashamed of themselves. You can’t be proud of something that virtually never works properly.
Somewhere after some recent update on either the Origin client or some Windows security patch I have been having major issues with this software. I use Windows 7 pro 64-bit. In the beginning the origin client manages to log in fine the first time I booted up my pc after getting back from work. Then if I leave it idle for a while doing other chores and stuff like supper and I come back nothing in and through the Origin client can connect any more. It gives a stupid error just saying it cannot connect to the Origin network. If I deliberately use a wrong password it does give an error that the username/password is incorrect. Trying the right username/password just keeps on giving the errors. I suspect it is timing out internally or there is some kind of resource/memory leak (just a raw suspicion)
The strange thing is my previous old computer I still use for general stuff and which physically stands next to the main pc connects fine using the Origin client. It still runs Windows XP but it’s too old/slow to handle games. Both machines are connected to the exact same physical network switch. I installed Origin on this machine out of frustration just to see if the Origin network still works.
Using the ‘Reconnect’/’Go online’ option does not work. Neither does restarting the Origin client itself, or rebooting or flushing the dns (ipconfig trick) or netsh winsock reset statement or pulling the power on my network switch or disabled my firewall or run as ‘Admin’. Checked for any errors in the Windows Event logs (none). I’ve reinstalled the Origin client multiple times. Even downloaded a special version of the client they created for people with launching game issues. Nothing helps. I’ve searched the BioWare/EA forums for similar issues – lots of things that are similar but nothing that actually helps.
If the Origin client was a horse I would have taken it outside and shot it… Emptied whatever gun’s magazine I had on it!! If I had any more spare ammunition I would have reloaded and emptied that on it too!!!
If any one knows of a way to fix this issue please shout! Better yet, if EA can fix this piece of shitty software that would be wonderful! Best would be if we can play ME3 (SP/MP) without it altogether!!! Steam got some new respect from my side! At least it ‘works’ (despite it also having some issues when it started). It’s a big shame ME3 could not have been released on Steam.
Note: I even sent a copy of the error log file to EA support and they haven’t even bother to respond/acknowledge receipt of the message. So much for ‘client support’
Update: My Origin connection problems magically ended when I changed my machine’s IP address from dynamic to static…. go figure… (plus I reverted back to 2.5.8 version as well.)
I don’t do (or particularly like) ASP.Net development often but recently had to quickly add some ‘Export to CSV’ functionality of a displayed table to a page. Personally I would have just used ‘copy and paste’ to do it (the export) but since the user isn’t in the habit of thinking for themselves I had to create new functionality which turn out to be very nice – and even opens the door for some future more advanced functionality.
Anyway, to achieve this is really easy if you use the HttpContext.Current.Response class and add an attachment ‘header’ to your page. The header must be named ‘content-disposition‘ and ContentType ‘text/csv‘. See the following methods I created to simply take a DataSet and convert it to ‘CSV file’:
public class CSVExportUtils
{
public void ExportDataSetToCSV(string title, DataSet ds, string columnNamesCSV = "")
{
string attachment = "attachment; filename=" + title.Replace(",", "").Replace(".", "") + ".csv";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", attachment);
HttpContext.Current.Response.ContentType = "text/csv";
HttpContext.Current.Response.AddHeader("Pragma", "public");
if (columnNamesCSV.Length == 0)
{
WriteColumnName(ds);
foreach (DataRow r in ds.Tables[0].Rows)
{
if (ds.Tables[0].Columns.Count > 0)
{
string value = r[0].ToString();
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write(value);
for (int i = 1; i < ds.Tables[0].Columns.Count; i++)
{
value = r[i].ToString();
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write("," + value);
}
}
HttpContext.Current.Response.Write(Environment.NewLine);
}
}
else
{
HttpContext.Current.Response.Write(columnNamesCSV);
HttpContext.Current.Response.Write(Environment.NewLine);
string[] columns = columnNamesCSV.Split(',');
foreach (DataRow r in ds.Tables[0].Rows)
{
string value = r[columns[0]].ToString();
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write(value);
for (int i = 1; i < columns.Length; i++)
{
value = r[columns[i]].ToString();
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write("," + value);
}
HttpContext.Current.Response.Write(Environment.NewLine);
}
}
HttpContext.Current.Response.End();
}
private static void WriteColumnName(DataSet ds)
{
StringBuilder sb = new StringBuilder();
if (ds.Tables[0].Columns.Count > 0)
{
string value = ds.Tables[0].Columns[0].Caption;
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write(value);
for (int i = 1; i < ds.Tables[0].Columns.Count; i++)
{
value = ds.Tables[0].Columns[i].Caption;
if (value.Contains(","))
value = "\"" + value + "\"";
HttpContext.Current.Response.Write("," + value);
}
}
HttpContext.Current.Response.Write(Environment.NewLine);
}
}
This method also allows you to specify the fields you want to export – or alternatively it just use the ones in the DataSet. For example, you can use it like this:
if (Request.QueryString["csvexport"] != null)
{
CSVExportUtils csvExportUtils = new CSVExportUtils();
csvExportUtils.ExportDataSetToCSV(fileName, dataSet, "Field1,Field2,...");
}
The calling page can then simply have a hyperlink like this:
SomePage.aspx?csvexport=Yes
Well, perhaps that is what Microsoft is trying to achieve with its latest move to remove all desktop development functionality from its Express versions of Visual Studio. Yes, you can still create desktop apps in the ‘pro’ version but at something like $500 it isn’t cheap for hobbyist op someone that is still learning. Lately they have been making all kind of wild and ridiculous decisions trying to push their new ‘Retro’, eh I mean ‘Metro’ interface down our throats. I for one don’t like this new interface ‘on the desktop’ at all and I’m definitely not the only one!
Just looking at the comments in articles like these you can get the impression that more and more people (developers) are really not liking this new direction that ‘they’ are taking. It is one thing to create something new and exciting but another to actively alienate/irritate your existing followers just to try and push them into a new direction (which might or might not suit them). Is this rush to try and play ‘catch-up’ with ‘the fruit company’ so important that they actually are shooting themselves in the foot? Yes, that is right, they are actively playing the catch-up game but is loosing it with every move they are trying. Not a good move if you want to survive in the end. As big as they are (once) ‘they’ are now in the ‘failing’ game – as Adam Savage would say – Failure is always an option. Microsoft is now ‘living’ that lotto!
Was good knowing ya: RIP Microsoft 1975-2012