Sunday, June 26, 2011
Tips encoding bytes for REST services (or any Uris)
Use Base64Url to encode any bytes as part of a url. It replaces the normal "/" and "+" with "-" and "_", makes it url safe.
Windows Azure: WebRole.cs is NOT running in the same process as the website
WebRole.cs is running in WaIISHost.exe in local dev, and website is in w3wp.exe. This causes code running in the WebRole.cs having no access to the website's in memory classes/code, thus several confusing issues:
1. If you initialized something in Run/OnStart, it is actually not effective for the website.
2. The code running in WebRole.cs can not access the web.config file, as it is not run as a website.
When I tried to start a Quartz.NET scheduler, such an architecture caused many mysterious behaviors and issues for me. E.g., the scheduled job has a EF object that can not get its connection string (because it is in the web.config). And trying to run a scheduled job code in the website ondemand can not access the main scheduler (because it is in another process!). After I moved the initialization code for the scheduler into the Global.asax.cs, everthing starts working.
1. If you initialized something in Run/OnStart, it is actually not effective for the website.
2. The code running in WebRole.cs can not access the web.config file, as it is not run as a website.
When I tried to start a Quartz.NET scheduler, such an architecture caused many mysterious behaviors and issues for me. E.g., the scheduled job has a EF object that can not get its connection string (because it is in the web.config). And trying to run a scheduled job code in the website ondemand can not access the main scheduler (because it is in another process!). After I moved the initialization code for the scheduler into the Global.asax.cs, everthing starts working.
Friday, June 24, 2011
Ad Idea: Information in one shot
A guy standing and saying "I don't value my phone as much as the other guy." Showing the other guy standing beside, head in shoulders, tapping crazy on his iPhone.
"I value myself more, though". Swooshing out a Windows Phone, click open, took a look, then tuck it in and walk away.
Big start screen with weather, stock, mail, calender live tiles for 5 seconds. Weather updated and stocks turn green from red, price go up. Overhead voice "This is how I get my information in one shot". Then phone screen turns off.
Tag line: "Information in one shot".
"I value myself more, though". Swooshing out a Windows Phone, click open, took a look, then tuck it in and walk away.
Big start screen with weather, stock, mail, calender live tiles for 5 seconds. Weather updated and stocks turn green from red, price go up. Overhead voice "This is how I get my information in one shot". Then phone screen turns off.
Tag line: "Information in one shot".
Thursday, June 23, 2011
LED Clock Windows Phone 7 app Privacy Policy
LED Clock is a client application designed for displaying and telling current time, weather and other information on your Windows Phone. In order for providing weather information for you, we may need to access your location information as a convience feature. As such, we are providing the following privacy policy.
This Privacy Policy may be updated and you can receive information about updates through the web site or the service. The latest version of the privacy policy is available to you at http://laorient.blogspot.com/2011/06/led-clock-windows-phone-7-app-privacy.html.
This Privacy Policy may be updated and you can receive information about updates through the web site or the service. The latest version of the privacy policy is available to you at http://laorient.blogspot.com/2011/06/led-clock-windows-phone-7-app-privacy.html.
Information Collected
When you chose to enable location service for weather information, we collect the location of your phone and send it over the internet to get the weather information. If the application is in Trial mode, we may use this location information to deliver ads appropriate to your location. We do not store the location information or use it for other purposes. You can turn off the feature in the settings and still use the weather feature by entering the city and state.Tuesday, June 7, 2011
How to escape invalid characters in XAML within a Markup Extension
Use %20 for a space and other XML Character Entities for the invalid characters, such as "{d:Design Data Source=/Sample%20Data/SampleData.xaml}" for the source path of "/Sample Data/SampleData.xaml".
In the case that you do NOT want to interpret "{" as the start of a Markup Extension, then put "{}" before it so it becomes "{}{". No need to do the same for the closing bracket "}".
In the case that you do NOT want to interpret "{" as the start of a Markup Extension, then put "{}" before it so it becomes "{}{". No need to do the same for the closing bracket "}".
Sunday, May 29, 2011
Windows Phone 7's limited Generic support
It finally occurred to me that I was delusional. :) Turns out that Windows Phone 7, which uses Compact .NET Framework, has limited support of Generic type reflection. Such that, when a Generic type is used in reflection, it mostly raises NotSupportedException for most of its methods.
The .NET Compact Framework provides limited reflection functionality for generic types and methods, sufficient for supporting C# and Visual Basic runtime and class library dependencies.This causes hideous problems in places that relies on this behavior, and it could be in surprisingly many places.
However, Mango (Windows Phone 7.1) does seem to fix it.
Tuesday, May 24, 2011
When in doubt, redeploy (SSRS)
Got a really persistent and "consistent" error in deployed SSRS report, which is a fairly complex one with maps: rsUnknownDataSetParameter. Just can not figure out why it complains as everything is in there. So I took the advise of a webpage and redeployed the whole report site, and whola! it works. Guess sometimes SSRS just got confused by the versions and maybe I missed something when deploy... (But I double checked!?...)
Subscribe to:
Posts (Atom)