Activate Viber on Android or iPhone in blocked countries

When I and my friend installed Viber on Android and iPhone we can’t activate it as we live in Syria and Viber activations SMS messages doesn’t send to Syria and activate.viber.com doesn’t open too. Many countries like Syria and Iran can’t activate Viber because of this, but I didn’t give up.

After trying many ways to activate Viber I finally activated it on both android and iphone and here is the way.

android For Android

To activate viber on android I used a VPN program. I first installed “Vpn One Click” which allows you to connect to a VPN in many countries around the world with only one click. You can download it for free from here or from Google Play.

Read the rest of this entry »

0xc000007b Error Solution

Two days ago I was working on a C++ project using OpenCV, when suddenly my project couldn’t run anymore!

I just have changed my OpenCV dlls to parallel version and ended up with this Error: "The application was unable to start correctly (0xc000007b). Click OK to close the application." every time I tried to run my application.

0xc000007b-error

After some hours of hard search I found that 0xc000007b error didn’t come from an exception in my code or even OpenCV dlls. I found that the error is just wrong configurations and the solution is easy, so I decided to write this article to show you how you cans solve this error permanently.

The Problem

0xc000007b error comes mainly from mixing up 32bit environment with 64bit one, that is you have an 32bit application that tries to load a 64bit dll.

Read the rest of this entry »

Building Qt Applications using your favorite text editor

I have used C++ for about 5 years now, and it is really a very powerful programming language. But I found one big disadvantage; it is too hard to make a C++ GUI. I used to do that by Windows API, but it is difficult to learn and I can’t learn my students all Windows API concepts for just making some forms and buttons!

Recently I heard about Qt and decided to learn it. As usual I stuck at the beginning; how could I build a Qt Application? and as usual too I do it my way😉

Building Qt Applications using Notepad

If your favorite text editor is still Notepad!, you must build your Qt Applications using command line.

To let it easy to you, I made a batch file depends on what compiler you want to use to build Qt Applications.

Building Qt Opensource Version using MingW

If you are using Qt Opensource Version you can use this batch file to build and run Qt Applications:

::::::::::::::::::::::: This is Qt building batch by Madhat Alsoos :::::::::::::::::::::::
:: First argument is the directory of the project
:: Second argument is the name of the cpp file without .cpp

@echo off
cd %1
set QTDIR=%1
set PATH=C:\Qt\2009.04\qt\bin;C:\Qt\2009.04\bin;C:\Qt\2009.04\mingw\bin;C:\WINDOWS\System32;%PATH%
set QMAKESPEC=win32-g++
qmake -project
qmake
mingw32-make.exe
IF not ERRORLEVEL 1 start debug\%2.exe

You can use this batch by passing the directory of the .cpp file and its name like this:

build.bat c:\qt\test\helloworld helloworld

It is so easy! First set Qt base directory to directory of file which we want to build (which will be passed as an argument to this batch file), then add Qt installation directory to the PATH system variable (just in case) and set QMAKESPEC to win32-g++ which tells Qt that it should make the project for g++ compiler. After that we make the .pro file (Qt project file) and compile it using mingw32 (which came by default with your Qt open source verison).

Note that you must change Qt path in this batch to where you installed Qt, or simply add your Qt bin folders to PATH system variable.

Building Qt Commercial Version using Visual Studio

If you are using Qt Commercial Version you can use this batch file to build and run Qt Applications:

Read the rest of this entry »

QtNpp: Notepad++ Plugin to build Qt Applications

I really love Qt and began to learn it recently, but I didn’t find a way to build Qt files from inside Notepad++ so as usual I made mine😉

QtNpp is my Notepad++ plugin to build and run Qt applications.

Notepad++  Qt

The idea

The idea of QtNpp is simple; just build the file by using these lines:

@echo off
set QTDIR=%1
set PATH=C:\Qt\2009.04\qt\bin;C:\Qt\2009.04\bin;C:\Qt\2009.04\mingw\bin;C:\WINDOWS\System32;%PATH%
set QMAKESPEC=win32-g++
qmake -project
qmake
mingw32-make.exe

but the implementation of QtNpp is not that simple!

By default QtNpp try to build Qt files by using the above script which works in one of these cases:

Read the rest of this entry »

Block Facebook using Squid at office

Many weeks ago, almost all people working at office with me stuck at Facebook! They were working on it for hours every day. I do not understand that at all (I don’t see any thing attractive in Facebook, I don’t have a Facebook account yet!). We tried everything to change this bad habit with no luck.

Because I am the Technical Manager at my Company, I have access to all computers and equipments. So I use the extreme solution and block Facebook! I searched the Internet for about 2 days about an easy solution or a free firewall to block websites, but I find nothing. So I decided to do it my way. So if you see that you have a hopeless case at you work like me, here is how I blocked Facebook:

ADSL Router Configuration

In our office we have an ADSL Router which is our connector to the Internet. This router and all our computers are connected through a switch. Our ISP already has a Proxy and all requests at port 80 is redirected to it. Fortunately, Facebook is forbidden at this proxy! so how can my employees open it? I discovered that all my employees have proxies with different ports, so they can bypass ISP Proxy which is filtering port 80 only (no proxy requests).

Now my first challenge is: how can I stop all these proxies? and force all people to use ISP Proxy? The easy way is to close all other proxies ports (normally 3128, 8080). But there is some proxies working on other ports like 808, so you must block all possible ports.

From the web interface of my router I added some rules to block all ports above 80 for all computers (except SQL port and Remote Access port).

Squid Proxy

I thought that my problem is solved and that is right, because now my employees can’t open Facebook but that was wrong!. My problem is just began, unfortunately our ISP proxy blocks many websites not only Facebook. So how can we open these websites now?

Read the rest of this entry »

OpenGL vs. DirectX

 OpenGL              DirectX

I have been using OpenGL for about 4 years until now, it is really a very good library. But I heard a lot about DirectX and many of my students began to learn it, so I decided to do a research about it to know why they need something other than OpenGL?

In my research I read a lot of articles comparing DirectX with OpenGL, but many of them were old, also I didn’t find any article that can tell me everything I want to know. So I created this post to be an exhaustive, up-to-date comparison between OpenGL and DirectX.

I will compare current version of OpenGL which is OpenGL 3.1 with current version of DirectX (or Direct3D if we want to be more exact) which is DirectX 10.

1. Historical View

OpenGL

OpenGL was designed to be a cross platform 2D and 3D Graphics Library, so it doesn’t handle audio or input/output devices but it has many extensions that is made especially to handle this devices. It was developed by Silicon Graphics Incorporated in 1992.

OpenGL is no more than 250 commands which can create, manage and render any complicated scene in many fields like CAD, Virtual Reality, flight simulation and video games.

It is considered a state machine for controlling primitive objects in a scene, so usually programs written in OpenGL are small and efficient.

DirectX

It was developed by Microsoft in 1995 to be an OpenGL competitive. It is a kind of API handles multimedia and specializes in games field.

It is made of a components like Direct3D (3D graphics library included DirectDraw for 2D draw), DirectMusic and DirectSound.

Nowadays there is not any product that can do all these things that DirectX can do, even though we can find an alternative for every single component.

2. Idea

DirectX was designed to be an Interface for the hardware that is provided by graphics card vendors, so it isn’t hide low details from the user.

Read the rest of this entry »

Install Windows 7 (64 bit) on HP 530 Notebook

Windows Versions

When Windows Vista became pre-release I immediately installed it because of the stories that we heard about it. We all remember that Microsoft says a lot about Windows Vista, so that we believed it will satisfy all our dreams.

But I couldn’t use it more than one month!! I realized that Windows Vista is not stable, beside that it used a lot of RAM comparing to Windows XP, so I felt that I was stupid because I believed Microsoft trivialities about Windows Vista. From that day I stuck with Windows XP and refuse even thinking about changing it!

Now a days, Windows 7 become pre-release and many people (includes IT professionals) says that Windows 7 is the best ever Windows, they always repeat that Windows 7 is the soul of Windows XP with Windows Vista style. So after I heard this story from a lot of my friends I finally decide to try Windows 7

Preparing to Install

I installed Windows 7 Ultimate (64 bit) on my HP 530 Notebook, and realized a lot of people in forums tried to do that on almost the same laptop, so I deiced to add this post to be a step by step tutorial about installing Windows 7 and almost all programs you need on it.
Read the rest of this entry »