How to install Mac OS X Yosemite 10.10 on VirtualBox?

Years ago I wrote a post for installing Mac OS X on VirtualBox. At that time the version of Mac OS X was 10.7.3 Lion. The installation may not work with current version of VirtualBox anymore. Therefore I would like to make another post for updating this hack. This time we’ll use VirtualBox 4.3.26 for hosting Mac OS X Yosemite 10.10 in Windows 8.

Continue reading How to install Mac OS X Yosemite 10.10 on VirtualBox?

C# – Use ASP.NET Identity External Authentication with desktop application

In previous posts we get to know with ASP.NET Identity and use it in many platforms such as Desktop or Android application. In all of them, I used local identity management system of ASP.NET Identity which connects to local database and manages users. So if users want to use our services, they have to register an account with our systems. They can’t use their Facebook or Google account to login to our system. Today I’ll show you how to extend our services by enabling OAuth 2 so that the users can authenticate themselves with their Facebook, Google+, Microsoft or Twitter accounts. You may find a lot of tutorials out there in Internet for integrating this external authentication within a web application. Therefore I wouldn’t like to write the same thing again but I will use a WPF application as my client and authenticate with ASP.NET Identity service over external authentication of Google+. This concept can be also used for mobile application such as Android, IOS or Windows Phone.

Continue reading C# – Use ASP.NET Identity External Authentication with desktop application

C# – Introduction to Aspect Oriented Programming with RealProxy

In many complex business applications, software developers are maybe asked for making protocol of all changes on an object. For example, in a task management system, changes of a task such as dead line, attachments, comments… by users should be logged and displayed in his history. Or in a fault management system, all changes of a fault such as status, companies, workers,… should be also recorded. Who adds what, who deletes what, tracking changes… is the point of interest. How should we solve these requirements without violating our software architecture and duplicating code? We need something that can cross the boundaries of an object or a layer and Aspect Oriented Programming (AOP) is exactly what we need. According to Wikipedia,

Continue reading C# – Introduction to Aspect Oriented Programming with RealProxy

C# – Introduction to SignalR

Mobile apps have a native support for pushing notifications from server to clients on many platforms such as Android, IOS or Windows Phone. I discussed about this feature in Android while ago in Google Cloud Messaging, ASP.NET Web Api and Android client post. Because it’s an interesting feature, we also want to have it in desktop or web application which can be done easily with SignalR, a new ASP.NET library for real-time web application. On SignalR’s homepage http://signalr.net/, you’ll find a lot of examples and codes for demonstrating how it works. In this post, I just want to show how to host SignalR on a WPF application (outside of IIS) and how SignalR basically works. The demo has a server-client model but the clients can also “broadcast” his message to other clients and the server can notify all clients with his notification.

Continue reading C# – Introduction to SignalR

C# – How to use Google Custom Search API?

Google search engine has a market share of over 60%. For some advanced features, such as searching metadata or relevant info of an object, we maybe want to integrate search result of Google search engine instead of inventing our own one. In this post, I would like to write down the steps how we can consume Google Custom Search API in .Net. The code itself is pretty short. However, because of lacking documentation it’s really time consuming to find out how the code should be, where to get the API Key or Search Engine ID for authentication. These all settings stuff drive me crazy because they locate on different control panel.
Please note that Custom Search Engine is a free API edition. For CSE users, the API provides 100 search queries per day for free. If you need more, you may sign up for billing in the Developers Console. Additional requests cost $5 per 1000 queries, up to 10k queries per day.
The other paid version is Google Site Search which is out of scope of this post.

Continue reading C# – How to use Google Custom Search API?

How to create a C++ dll with Visual Studio?

Following previous post How to create a CLR wrapper of C++ for using in C#, I will continue with C++ project in this post. C++ is not my main programming language anymore in last 10 years but I would like to keep some ‘important’ things (to me) of C++ projects before I have to leave it again in next 5 years for focusing on web development. I would like to spend more time for web development (backend and frontend) where C#, Javascript, HTML and CSS are in a more dominant position. In this post, I’ll write down the steps to create a C++ DLL by Visual Studio. This DLL can again be wrapped by a wrapper like in previous post and consumed in C#.

Continue reading How to create a C++ dll with Visual Studio?

C# – How to create a CLR wrapper of C++ for using in C#?

It has been almost 10 years since last time when I worked with C++. I don’t remember much about C++ syntax and can’t even write a small app with C++ anymore. Since Visual Studio introduces C# and CLR and a lot of changes in C++ development environment. I just ‘quit’ out of this programming language. Moreover in next years, I will focus more in web development, not only for private but also for occupational activities. That mean no chance to come back with C++. I’m afraid that many important things of C++ (that I want to keep) will go with the wind after years. When I need them again, it’ll take me days to bring them back. Creating a CLR wrapper is for me such important thing. So in this small post, I just would like to write down the steps to make a simple CLR wrapper for a C++. This is only a simple CLR wrapper, nothing special, but it always helps me a lot when I try to use C++ library in my C# program.
Continue reading C# – How to create a CLR wrapper of C++ for using in C#?

How to create relative shortcut to .exe file with icon?

One year ago I encountered a problem relevant to create a shortcut for relative path. I had to deliver a software package to customers over DVD. The app is kind of archive. It should run live on DVD, connect to a read-only SQLite database (also on that DVD) and display data in read-only mode. It’s pretty easy to deploy such software but when I copy files into a sub folder and create a shortcut to program on its parent folder. The shortcut won’t work on other machine because it uses absolute path and the icon won’t also appear. So a consideration raised if I should develop a Start.exe just to start the program or use some tricks to create a same thing.

Continue reading How to create relative shortcut to .exe file with icon?