Sunday, November 17, 2013

Configuring Cygwin C/C++ compiler for Netbeans7.4 (under Windows)

Today I tried setting up Netbeans as a C IDE, it has built in support for C, but unfortunately enough you have to manually configure a compiler so that you can actually debug / build your C/C++ programs.

Fortunately there is this helpful page at Netbeans.org to help you install Cygwin, a very popular UNIX/Windows C/C++ compiler. However, this helpful page isn’t as helpful as I’d hope at all! It will point you in the right direction to download Cygwin, and will tell you what packages to select for download, it will even tell you to set up your PATH environment variable for Cygwin, but it will assume Netbeans auto detects the correct settings, which it unfortunately doesn’t do. (Well at least at my pc, and I’ve seen a few threads with the same problems around).
So here is my attempt at a more complete overview on installing Cygwin for Netbeans 7.4.
Go to http://www.cygwin.com/setup.exe and download the small setup program. Run it (if your using Vista, set the compatibility options to XP SP2, and run it as administrator). Follow the pretty standard steps until you get to choose the installation packages. If you thought just pressing next would install the most common Cygwin apps, like the compiler (gcc.exe) and the make implementation, unfortunately Cygwin, is not just a C/C++ compiler, it even includes a java compiler, games, documentation, text editors etc. . Ok so just install everything, well that will install the compiler etc., but also 3GB of (for us) useless data. So don’t make the same mistake I did there. We are going to search for the few packages that we actually need. According to the Netbeans.org these are:
select gcc-core: C compiler, gcc-g++: C++ compiler, gdb: The GNU Debugger, and make: the GNU version of the ‘make’ utility.
Unfortunately these aren’t easy to find. For example there is no core package directly visible (we do have base and development though).  It took me a while but I think I’ve nailed it down. Select the following packages by clicking the weird “refresh” icon next to them until it says install:
-The entire base package
-In the development package select:
–binutils
–gcc core
–gcc g++
–gcc g77
–gcc mingw core
–gcc mingw g++
–gcc mingw g77
–gdb
–make
–mingw runtime
(note I’m not sure about the mingw packages, this seems to be a seperate C compiler but it doesn’t seem to harm)
After that go to windows configuration screen->advanced->environment variables. And add "C:\Cygwin\Bin” to the PATH variables (or wherever you have located your Cygwin\bin folder, (make sure to separate it from the last one with a ‘;’).
Start Netbeans, navigate to tools->options->C/C++. Check to see if Cygwin is in the list on the left panel. Select it, and then fill in the options as following: (I assume that you’ve installed it in C:\Cygwin)
Base Director: C:\Cygwin\bin
C compiler C:\Cygwin\bin\gcc.exe
C++ Compiler: C:\Cygwin\bin\g++-3.exe*
Fortran Compiler: C:\Cygwin\bin\g77-3.exe*
Make Command: C:\Cygwin\bin\make.exe
Debugger: C:\Cygwin\bin\gdb.exe

(* marks optional)
Now make a new C project. And add a new main file to it by right clicking the source directory and selecting New->Main C file. There is an odd chance that the include directives will be underlined with red. This is not a problem, as you will see the program will compile and run fine, but you can’t use intellisense this way so we are going to fix it. (First make sure your PATH variable was correctly set!).
Right click on your project and select properties. Go to build->C compiler (or C++ compiler if you are doing C++).  Select the “…” button after Include Directories. And add the “C:\Cygwin\usr\include” directory to the include directories. Save your settings and reload your project. The red lines should’ve disappeared now, leaving you behind with a fully functional C/C++ IDE and compiler in Netbeans. *Yay*!
Art
I wish someone else would’ve written this before me, so that I wasn’t busy uninstalling a couple of gigabytes of C/C++ tools/compilers/utilities/fonts and text editors :(

Thursday, September 19, 2013

Android's boom in market!!!

Last week, research firm IDC dropped a big bomb on Apple.
Google's smartphone operating system  Apple's iOS operating system for iPhones only powers 13% of smartphones. iOS controlled about 16% of the worldwide smartphone market a year ago, according to IDC.
Apple should be freaking out,
So how did Android, which debuted after the iPhone, get to where it is today. Here's a quick history lesson.

Android started as a separate company in 2003. It was run by Andy Rubin and a few other big names in the early world of mobile tech. They were trying to build software for phones and digital cameras


Saturday, April 6, 2013

John Nash's Game Theroy


GAME THEORY

Before Nash, economists studied the market using sophisticated versions of Adam Smith's price theory -basic supply and demand. Smith said as "buyers and sellers pursue their self-interest, the "invisible hand" of the market distributes products efficiently".

But price theory can't explain the abundant real-world examples of market inefficiency. Nash approached this problem by reformulating economics as a game.
To most people, a game is a way to while away a rainy afternoon. But to mathematicians, a game is not just chess or poker but any conflict situation that forces participants to develop a strategy to accomplish a goal. 
To mathematicians, a game is a regimented world where math is king. And a game can be a window to mathematical insight. When I was a student, Princeton math professors collected every afternoon in the third-floor lounge for tea and a round of backgammon. Professor Conway told us that he stumbled upon the discovery of a lifetime while studying Go, an ancient board game played with smooth stones. Nash's central insight, the one for which he won a Nobel Prize in 1994, was to prove that every economic game has an equilibrium point — that is, an approach to play in which no player would choose to change his strategy. If a player were to try to change his Nash equilibrium strategy, he would end up worse off than before.

John Forbes Nash, Jr.

John Forbes Nash,  Jr. is an American mathematician whose works in game theory, differential geometry, and partial differential equations have provided insight into the forces that govern chance and events inside complex systems in daily life.

This article focuses on John Nash, recipient of the Nobel Prize in Economics in 1994, and subject of the Award winning 2001 film A Beautiful Mind, who was diagnosed with paranoid schizophrenia in 1958 at the age of 29. After presenting an account of the emergence, course, and eventual remission of his illness, the article argues for the relevance of his contribution to game theory, known as the Nash equilibrium, for which he received the Nobel Prize, to research studies of the schizophrenic brain and how it deviates from the normal brain. The case is made that the Nash equilibrium is descriptive of the normal brain, whereas the game theory formulated by John van Neumann, which Nash's theory challenges, is descriptive of the schizophrenic brain. The fact that Nash and his colleagues in mathematics did not make the association between his contributions to mathematics and his mental breakdown and that his later recovery exemplified the validity of this contribution are noted and discussed. Religious themes in his delusional system, including his view of himself as a secret messianic figure and the biblical Esau, are interpreted in light of these competing game theories and the dysfunctions of the schizophrenic brain. His recognition that his return to normalcy came at the price of his sense of being in relation to the cosmos is also noted.