This is the cloud version of Microsoft Power Point. It is created by the company that I’m working for at the moment. I’m blogging this not because I’m working for them but I’m blogging this based on my personal opinion
It is a powerful web application and It really works as it allows you to use Slide Rocket to share and collaborate your presentation slides with everyone and you don’t need to carry your power point slides file or your laptop. It supports mobile device as well such as an iPad. You just need a connection to the internet
For the standard functionality (Create a presentation slides), it is FREE for life but when you want to use versioning for your presentation, or when you want to have more security control over your presentation, or even to analyse who has accessed your slide and when was it then you need to have monthly subscription. Check it out guys
http://www.sliderocket.com
ps: some guy is using this web application for their resume! and it’s impressive!
http://www.sliderocket.com/blog/2012/05/creative-resume-idea/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SliderocketMissionControl+%28SlideRocket+Mission+Control%29
This is a simple tutorial in how to use Dependency Injection using SimpleInjector (You can get this package from NuGet)
In this case, I use SimpleInjector to manage my Data Context – I want my Data Context to be per request (Unit of Work per request). The concept of this dependency Injection is to have a global container where you can resolve your object from
1. Create an extension method to the Simple Injector
2. Modify Global.asax – The class name will be MvcApplication in MVC Project
Code Snippet
- #region “Dependency Injection”
- private static Container Container;
- public static T GetInstance<T>() where T : class
- {
- return Container.GetInstance<T>();
- }
- protected void RegisterDependency()
- {
- //Create a main containers
- var container = new Container();
- // 2. Configure the container (register)
- container.RegisterPerWebRequest<IUnitOfWork>(() => new UnitOfWork(new PosDataContext()));
- container.Register<ITableRepository, TableRepository>();
- container.Verify();
- Container = container;
- }
- #endregion
- protected void Application_Start()
- {
- AreaRegistration.RegisterAllAreas();
- RegisterGlobalFilters(GlobalFilters.Filters);
- RegisterRoutes(RouteTable.Routes);
- BundleTable.Bundles.RegisterTemplateBundles();
- RegisterDependency();
- }
- protected void Application_EndRequest(object src, EventArgs e)
- {
- ServiceStack.MiniProfiler.Profiler.Stop();
- SimpleInjectorPerWebRequestExtensions.DisposeInstance<IUnitOfWork>();
- }
3. Consume it from the controller – Call the container in the Global.asax to resolve the object (GetInstance function)
Code Snippet
- public ActionResult Index()
- {
- ViewBag.Title = “Tables”;
- return View(MvcApplication.GetInstance<IUnitOfWork>().TableRepository.Get(e => e.Active));
- }
I found this benchmark for different IoC in .NET. Personally I’ve been using Unity, Ninject and SimpleInjector. I like SimpleInjector because it is very simple and surprisingly it is quite fast compared with the rest. Performance is just one of the aspect of IoC but it doesn’t always mean everything
http://www.palmmedia.de/Blog/2011/8/30/ioc-container-benchmark-performance-comparison
http://www.iocbattle.com/
I’ve been learning Knockout recently and I found that sometimes it is hard to find out how your View Model is being formed especially when you create the view from Model in MVC
To inspect your view model, you can use firebug console and run below command, this will give you a full navigated View Model and allow you to drill down
console.group(“Dumping view model”);
console.dir(ko.toJS(new JobResultViewModel()));
console.groupEnd();
alternatively you can also put this code in your template
<div data-bind=”text: ko.toJSON($data)”></div>
Feel free to let me know if you have any other way to debug
1. Change the app.config/web.config of your application that calls the WCF service by adding System.diagnostics detail as below
Code Snippet
- <system.diagnostics>
- <sources>
- <source name=“System.ServiceModel“ switchValue=“Verbose,ActivityTracing“ propagateActivity=“true“>
- <listeners>
- <add type=“System.Diagnostics.DefaultTraceListener” name=“Default“>
- <filter type=“” />
- </add>
- <add name=“ServiceModelTraceListener“>
- <filter type=“” />
- </add>
- </listeners>
- </source>
- <source name=“System.ServiceModel.MessageLogging“ switchValue=“Verbose,ActivityTracing“>
- <listeners>
- <add type=“System.Diagnostics.DefaultTraceListener” name=“Default“>
- <filter type=“” />
- </add>
- <add name=“ServiceModelMessageLoggingListener“>
- <filter type=“” />
- </add>
- </listeners>
- </source>
- </sources>
- <sharedListeners>
- <add initializeData=“MyWCFTraceLog.svclog“
- type=“System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089“
- name=“ServiceModelTraceListener” traceOutputOptions=“Timestamp“>
- <filter type=“” />
- </add>
- <add initializeData=“MyWCFTraceLog.svclog“
- type=“System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089“
- name=“ServiceModelMessageLoggingListener” traceOutputOptions=“Timestamp“>
- <filter type=“” />
- </add>
- </sharedListeners>
- <trace autoflush=“true“ />
- </system.diagnostics>
2. Run your application as usual until it throws the error or until the stage where you can reproduce your issue, once you are done, quit your application or take out the diagnostics section from the config file straight away so your log will not be growing too quickly/massively
3. The log file will be called as MyWCFTraceLog.svclog (as we define in the config file) and it will be located on the same folder as the executable – normally it is in the bin folder

4. How to open svclog file? Go to your program files (x86) or program files/Microsoft SDKs/Windows/v7.0A/Bin/SvcTraceViewer.exe

5. SVCTraceViewer will display you the story line of your WCF and it will help you to pinpoint the underlying issue

I was struggling in finding out of how to make a simple delegate like in AJAX request through javascript. It takes me a few days to figure this out
Basically the problems are:
-I need to execute a piece code of javascript after getting the ticket from web service function
-The webservice function might not be responding to the first request because it waits for the state of the other external component
-The webservice will give the response when the external component is ready
-The client does not know when the external component is ready, neither the web service. But it wil be ready within 1-5 minutes which again depending external component
Possible Solution:
-Using the setTimeOut(function(){acquireTicket();}, 300000) will cause the application to wait for 5 mins before calling the web service , this approach will slowing down the user experience and waste of time because the external component can be ready earlier than 5 mins
-Using the while loop is not good because it makes the browser freezing while waiting and it will wasting the processing power because of the looping
Recommended Solution:
-Recall the function by itself using setTimeout Function using parameter to indicate whether it should go out of the loop or not
-The web service will be checked for every 2 seconds to check the response from the external component. Once the external component is ready then it will move on to execute the next line of code
-
ParseJSON returning you an object from your AJAX Call, the problem that I have is my object properties has invalid character (e.g “#”)
Assuming jsonData is my variable that contains the following information

I’d like to grab the property of “#innerxml”
Normally I can do this to get the property of an object but in this case I can’t due to invalid character
(jQuery.parseJSON(jsonData)[0]).#innerxml

So How do I access an object which has properties where one of the property name is using an invalid character (e.g “#”)
I can access with the following style
(jQuery.parseJSON(jsonData)[0])['#innerxml']

I tried to install umbraco in shared webhosting from the control panel but instead the error that I’m getting is
The application could not be installed: Error occured in Web App Gallery module
From my research it seems that there is an error in the Web App Gallery module, some article it says that the Web App Gallery module is out of date. But this is shared web hosting so there is nothing much I can do to fix this. So how to install umbraco manually?
1. Create a blank DB in your SQL Server 2008 for your Umbraco
2. Create a SQL User for the Umbraco DB in the step 1
3. Download umbraco from http://umbraco.codeplex.com
4. Extract the content to the downloaded package to the root of your domain wwwroot folder via FTP
5. Make sure the default website is already created
6. Make sure the .NET framework is being set to .NET 4.0 (Integrated)
7. Run the installation through www.yourdomain.com/install/default.aspx
8. Follow the steps, it will ask you the database name and the database user along the way
9. Once the installation finished, please make sure you delete the install folder for security purpose
I have a function that is used to save a file base on the user input (basically the user can type whichever filename and whichever path) and the code is not handling the invalid filename or path hence what it does is just throwing .NET general exception like below

To fix it I created a new function that basically get the invalid path characters and invalid filename characters from the system and remove invalid character in the input (file name). By doing this the user does not need to replace the character.
If you use Path.GetFileName it will actually remove the illegal character automatically but the way it removes the illegal character is so aggressive
e.g Path.GetFileName(“c:\workflow\Clearance:Photo ID Badge:Access abc-123.ist”) will return Access abc-123.ist
Well this problem itself will give different argument like why do we let people put the garbage character in?and why don’t we give the validation?or the other argument is “why do we need to change the input from the user without letting them knowing it?
236 ”’ <summary>
237 ”’ this function is used to clean up invalid/illegal characters from filename and replace it with blank
238 ”’ </summary>
239 ”’ <param name=”FileName”></param>
240 ”’ <returns></returns>
241 ”’ <remarks></remarks>
242 Private Function CleanFileName(ByVal FileName As String) As String
243 Dim invalid As String = New String(Path.GetInvalidFileNameChars()) + New String(Path.GetInvalidPathChars())
244 Dim originalPath As String = FileName.Substring(0, FileName.LastIndexOf(“\”) + 1)
245 FileName = FileName.Substring(FileName.LastIndexOf(“\”))
246
247 For Each c As Char In invalid
248 FileName = FileName.Replace(c.ToString(), “”)
249 Next
250
251 ‘readd the path
252 FileName = originalPath + FileName
253
254 Return FileName
255 End Function
This is an application to access your Web Service/API without worrying to create your own client application for the sake of testing. Personally, I’m using soapUI (an open source application to test web service)
http://sourceforge.net/projects/soapui/files/
I’d prefer to use tool this because it provides you a transparent communication between the client and the Web Service and it’s really simple to use and configure. It’d save you a lot of time to debug the issue for your client. You can trace it down whether the issue is in the client or in the web service itself
