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?

Raspberry Pi – How to setup remote access with VNC

Last month I ordered a Raspberry Pi for learning purpose. I heard a lot of about this mini computer and waited until its 2nd generation comes to market to get one. Depending on purposes, there are a lot of kits for Raspberry Pi in the market (from starter to professional). I myself don’t know what I can do with this mini computer therefore I just buy at least hardware first (listed in next section). Just enough so that Raspberry Pi runs and I can remote access it. So my first project is pretty simple : go shopping and make a remote access to Raspberry Pi with VNC (Virtual Network Computing). In this post I will write down the steps I’ve done to finish this mini project.

Continue reading Raspberry Pi – How to setup remote access with VNC

C# – An example of OCR web service

Years ago I wrote a small post about C# – OCR library candidates for comparing between OCR libraries of Tesseract and Microsoft Office Document Imaging. Tesseract is an open source OCR framework. Unfortunately its inaccuracy is still high and can’t be used in commercial products. Last week I would like to make a small OCR web service for training myself and to test Tesseract again. The result is still as bad as last time (I guess FineReader of Abby may be the best OCR SDK but I have no full version for testing). Although Tesseract is not able to recognize complex documents, I also used it for this example because there is no other better candidate. The sample OCR web service works pretty simply, he receives a file which is uploaded from client, runs OCR and returns text back. No big deal.

Continue reading C# – An example of OCR web service

Android – Use AccountManager with ASP.NET Identity

User or account management is a must-have feature in business applications. For examples, one device should be used by many employees and the employees have different roles in the project. The apps must be able to authenticate user, authorize them and let them access the resources corresponding to their roles. We can manage all these things in app databases within our own tables or we can use AccountManager providing access to a centralized registry of the user’s online accounts. With AccountManager, the user enters credentials (username and password) once per account, granting applications access to online resources with “one-click” approval. In this blog post, I would like to make a small demo how we can integrate ASP.NET Identity service for authenticating user with AccountManager. I’ll only focus on addAccount part, the other functions will be discussed in other posts if necessary.

Continue reading Android – Use AccountManager with ASP.NET Identity

How to install Kali 1.0.9a on Virtual Box?

For research purposes I have to install Kali (successor of Backtrack) on Virtual Box. The installation is pretty fast however we have to know what we have to configure the VM settings and what we should choose in the installation step. I just write down these steps for my own documentation, maybe you will find it also helpful.

The most advanced penetration testing distribution, ever.
From the creators of BackTrack comes Kali Linux, the most advanced and versatile penetration testing distribution ever created. We have a whole set of amazing features lined up in our security distribution, geared at streamlining the penetration testing experience.

Continue reading How to install Kali 1.0.9a on Virtual Box?