0 Comments

Hyper-V disables the fastboot option. One of the main advantages of the surface pro is having the fastboot option, which disappears after having hyper-v enabled. Hyper-V is enabled if you install the windows phone dev tools and if you want to run vhd files. Hanselman made a blogpost about adding an extra bootoption to switch between with and without hyper-v

 

But after installing the january firmware update, it gave me the blue screen with both boot entries, each time I boot.

This can be disabled in Windows. Press the windows key + pause/break and go to the ‘advanced system settings’. in tab ‘advanced’ click the button ‘settings’ next to “boot- and recoverysettings”

image

remove the checkbox to disable the list of operating systems and hit ok and that’s it. Enjoy the speed of the fastboot with the surface pro 3.

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

I have developed several small apps for Windows Phone. Most of the time it is just to test how publishing an app works. I have developed an app for wp7, wp8.0, wp8.1 and universal apps and they are all free in the windows (phone) store. I try to earn back my developer fee of 19 euro by adding some small ads to it. I have used the adrotator version 1 and version 2 plugin and Microsoft's  own admediator.

You can download that visual studio extension of the visualstudio gallery website.

and you can read how to use admediator on msdn.

my three ad networks are:

  • mobfox
  • smaato
  • pubcenter

My conclusion: pubcenter has the best revenue and smaato serves the most ads. Please let me know if you disagree or have some advice. You can download my excel report here.

 

p.s. here is a 27 minute video of the admediator control on channel 9.

p.p.s. more info on the windows blog http://blogs.windows.com/buildingapps/2014/11/07/how-to-maximize-the-impact-of-windows-ad-mediation-for-windows-phone/

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

There are various options to build a word document in your C# code, I choose the lightweight docx nuget package. There are some really good examples on the Codeplex website of docx http://docx.codeplex.com/ if you look at the “Advanced Examples”

The thing is that Office products tend to localize variables such as table designs:

image

I am dutch, but I cannot translate it to a value of the enum `TableDesign`

If I would translate it, it would be something like listtable 7 colorful accent 6. It is still (even after this test file) not a valid entry of the table design enumeration.

using (DocX document = DocX.Create("C:/Temp/tables.docx"))
{
    foreach (TableDesign td in (TableDesign[])Enum.GetValues(typeof(TableDesign)))
    {
        Table aTable = document.InsertTable(5, 5); // because office preview is also 5 x 5
        aTable.Design = td;
        aTable.Rows[0].Cells[0].Paragraphs.First().Append(td.ToString());
    }
    document.Save();
}

 

The “source” (all 6 lines of code, lol) is available on github https://github.com/jphellemons/DocxTables but perhaps more important is the output file. This might save you some time. https://github.com/jphellemons/DocxTables/raw/master/tables.docx

 

Good luck with this small, but awesome nuget package!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

Microsoft SQL Server has the ability to format the query output to xml, which is great. I used version “Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64)” to output XML to have a nested data structure, but there is unfortunately no first citizen support for JSON which is big on the web these days. Perhaps it is left out on purpose to make sure that people are unable to direct output their data as JSON and are forced to build a layer in between so that it can also authenticate and add security to a request. Web API is great for this. But back to the subject: I wanted to output my nested data as JSON really quickly with the minimum amount of code.

In a nutshell, I got the data as xml and converted that to JSON and send it to the output of a generic handler (*.ashx)

Here is my source code for my easy SQL2JSON solution:

private XDocument GetProducts(string q)
{
    SqlCommand comProd = new SqlCommand(@"SELECT ProductCode, ProductEan13, CategoryName FROM PRODUCTS 
        inner join CATEGORIES on products.CategoryID = CATEGORIES.CategoryID
        WHERE ((FactoryCode LIKE @name) OR (ProductCode LIKE @name)) AND (ProductDeleted = 0) for xml raw ('Product'), ROOT ('Products');");
    comProd.Parameters.AddWithValue("name", q + "%");
    string xml = SsDb.GetScalar(comProd).ToString();
    return XDocument.Parse(xml);
}

This gave me an `XDocument` object which I still have to convert to JSON

Since I was using an generic handler I retrieved the search parameter from the query string and used it as input parameter for the `GetProducts` method.

public void ProcessRequest(HttpContext context)
{
    context.Response.ContentType = "application/json";
    context.Response.Cache.SetCacheability(HttpCacheability.Public);
    context.Response.Cache.SetExpires(DateTime.Now.AddDays(1));
    context.Response.Cache.SetMaxAge(new TimeSpan(24, 0, 0));

    string q = context.Request.QueryString.Get("q");
    context.Response.Write(JsonConvert.SerializeXNode(GetProducts(q)));
}

So the most important line is the last one:

context.Response.Write(JsonConvert.SerializeXNode(GetProducts(q)));

Do not forget to use the one-nuget-package-that-rules-them-all (Install-Package Newtonsoft.Json)

using Newtonsoft.Json;

 

Now you can access your JSON data source with the C# generic handler from your JavaScript

yourHandler.ashx?q=yourproductcode

I hope this has been of any help. good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

The first step is of course install the remote debugging tools on the debug host http://msdn.microsoft.com/en-us/library/bt727f1t.aspx#BKMK_Installing_the_Remote_Tools 

When I fire up the Visual Studio Remote Debugging Monitor (latest version 12.0.30501.0), it says that it is already running on port 4018 so I have selected a different port. I selected 4019 and went to the “Tools” menu and then “Options (Ctrl + o) I have selected 'No authentication' and check 'allow any user to debug'. 

All there is left to do, is press play on the Visual studio side and make sure that you have the same port and no-auth set.

The other option is not to go to options but go to permissions (Ctrl + p) and add my Live ID/ Microsoft account from my developing machine, but that takes more clicks and my debugging device also forgets these settings. So you have to set it at every launch. Since I am also the admin of this tiny LAN, there is no security risk here and I can go with option 1.

screenshot taken from the interwebz

I am able to remotely debug, it's just that I have to setup the debugging every time on the client side (Lenovo Miix 2 8" tablet running win8.1) The development side does not need to be reconfigured every time.

After spending some time on google/bing/duckduckgo I have found http://msdn.microsoft.com/en-us/library/bt727f1t%28v=vs.71%29.aspx which gives me details about launching the remote debugging monitor from the command line and give it some parameters.

I ended up with a small .bat file having these command line options:

`msvcmon -anyuser -noauth -port=4019`

Here is a good read with more info about remote debugger settings:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/174c2039-b316-455a-800e-18c0d93b74bc/visual-studio-2010-remote-debugger-settings-dont-persist?forum=vsdebug

Good luck debugging!

Pin on pinterest Plus on Googleplus Post on LinkedIn