win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key cheap Win 7 key win 7 professional Windows 7 key windows-7-ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key store Windows 7 Professional Product Key Windows-7-Ultimate-Product-Key windows-7-home-premium buy Windows 7 key Office-2013-key office-professional-plus-2013 Office-2010-key Office-2016-key windows 8 key windows-8-key-sale windows 8.1 key windows 8.1 product key windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key windows 7 home Windows 7 professional windows 7 pro windows 7 key Windows 7 professional windows 10 product key windows 10 key windows 8 key Windows 8.1 professional windows 8.1 pro office 2013 key office-2010 serial key office 2010 key windows 10 key windows 7 home premium windows 7 ultimate windows 8.1 key windows 8 professional windows 7 ultimate windows 7 key windows 7 home windows 7 activation key win 10 professional office 2010 key Windows 7 Product Key Windows 7 Key Windows 7 iso Windows 7 ultimate

Setting Up And Accessing the NI PXIe-6592R High Speed Serial Board from National Instruments

I recently received a brand new PXIe-6592R High Speed Serial Board from National Instruments, along with a PXIe chassis with an integrated controller. Here is a list of the hardware:

The PXIe-8105 embedded controller came with the “High Temperature Option”, which means that only a PATA (IDE) hard drive interface is available, with no SATA hard drive support.  Too bad I have a bunch of spare 256GB and 512GB Solid State Drives, but all of them are SATA, so I am stuck with the 128GB PATA ssd from Kingston which the previous owner had installed.  The previous owner also upgraded the memory to the full 4GB and replaced the processor with an Intel Core 2 T7400 with 2.16GHz, which I was told is the best processor which the embedded controller supports.

As for virtualization, VT-d is not supported by the onboard chipset or the processor.  VT-d is an Intel virtualization technology, which allows a virtual machine to directly access the underlying hardware of a machine, giving near native performance.

PXIe-1062Q PXI Express Chassis (Quiet-edition)

pxie-1062q_3

PXIe-8105 Embedded Controller

PXIe-6592R – High-Speed Serial Module

Setting It Up

I am looking at the front of the chassis and I see some annotations for each chassis slot number, as you can see in the picture below, some have a solid black background, some have an H next to the solid black background, others have a clear background, and one is inside a box.

pxie-1062q_3

The product manual for the NI PXIe-1062Q (see page 1-4: http://www.ni.com/pdf/manuals/371843d.pdf) and describes what each annotation mean:

– The H stands for a Hybrid Peripheral Slot
– The square around the circle indicates a PXI System Express Timing Slot – you would want to plug in an IEEE-1588 card here.
– The solid white (slots 2, 6, 7, and 8) are for regular PXI Peripherals

So I can plug the board in to slot 3, 4, or 5. Slots 3 and 5 are Hybrid, and slot 4 is meant for timing, so I will plug the board in to slot #5 and turn the chassis on. Before attempting to plug the board in, make sure you remove the black plastic screw covers:

pxie-6592r_plastic

Here is a picture of the chassis with the 6592R plugged in:

full_system

I have a clean install of Windows 7 on the PXIe-8105 embedded controller and install the following National Instruments packages:

After rebooting several times, I get a notification from the NI Update Service that there are many available updates. **NOTE** Do not install any updates to NI MAX – The drivers for the 6592R will not install (or work) if you upgrade NI MAX past version 15.0.

Now I run NI MAX (National Instruments Measurement & Automation Explorer), click on “My System->Devices and Interfaces->NI PXIe-1062 ‘Chassis 1′” and I see an entry for the 6592 “NI PXIe-6592R ‘PXI1Slot5′”, which is exactly where I plugged the board in.  After clicking on the device, you will want to look at the right-pane and to get the “RIO Resource Name” which will most likely be RIO0.

Watch the following video for a live demonstration of this:

I recently received a brand new PXIe-6592R High Speed Serial Board from National Instruments, along with a PXIe chassis...

Read More »

Setting Up a 10 Gigabit Network

The cheapest 10Gigabit Network Switch available for sale on newegg.com goes for $749 NETGEAR XS708Ev2 ProSAFE 8-Port 10-Gigabit Ethernet Web Managed (Plus) Switch.  The cheapest 10Gigabit Network Card however is the Mellanox ConnectX-2 10GbE PCIe 2.0 x8 Low Profile Network Interface Card, MNPA19-XTR which sells for $24.  A cable to connect the two goes for $39.99, Ipolex for Cisco SFP-H10GB-CU2M,10GBASE-CU Direct Attach Copper Cable, Twinax Cable, Passive,2-Meter.

So now I have 2 linux machines, each of them are running Fedora 24 and they have 1 of the Mellanox cards mentioned above and are connected to each other via the Direct Attach Copper Cable. How do we set this up?

Well, my local area network is using a Class C network of 192.168.0.x. So I will configure each Mellanox card with a Class A network of 10.x.x.x. How do I do this? Well, first I have to identify the Mellanox Card. You can do this with the following command:

john@localhost ~]$lspci | grep Mellanox

The output of this command should look like the following and will give you the PCI bus address, which in this case is 02:00.0.

 

02:00.0 Ethernet controller: Mellanox Technologies MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)

 

Now you can use this PCI bus address to get the MAC or hardware address of the card,

 

john@localhost ~]$sudo lspci -vvv -s 02:00.0 | grep Device\ Serial
Capabilities: [148 v1] Device Serial Number 00-02-c9-03-00-55-08-44

 

In my case, the mac address is 00-02-c9-03-00-55-08-44. Funny, this number has 16 octets as opposed to the normal 12 octets. After running ifconfig, I see that the true MAC address is the first three and the last three octets, which is 00-02-c9-55-08-44. To see how Mellanox maps to 00-02-c9, visit Mac Vendor Lookup at: http://www.macvendorlookup.com/

So now we can identify which configuration file is the appropriate one to modify for this network card by examining the output of ifconfig:

john@localhost ~]$ifconfig

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::202:c9ff:fe55:844  prefixlen 64  scopeid 0x20<link>
        ether 00:02:c9:55:08:44  txqueuelen 1000  (Ethernet)
        RX packets 189  bytes 21776 (21.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 443  bytes 47771 (46.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.4  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::be5f:f4ff:feac:12e3  prefixlen 64  scopeid 0x20<link>
        ether bc:5f:f4:ac:12:e3  txqueuelen 1000  (Ethernet)
        RX packets 723088  bytes 1093485296 (1.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 337046  bytes 23950834 (22.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 308  bytes 32354 (31.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 308  bytes 32354 (31.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Notice how there is no inet (IPv4) address, but there is a defualt IPv6 address, the Ethernet or MAC or Hardware address does match the output that we saw from lspci. So now we know that the device is assigned network device name of enp2s0. Now if you are using Fedora 24, or a close version, you have to become root and go to the /etc/sysconfig/network-scripts/ directory. Then search each file that starts with ifcfg and contains the MAC address. Note: I only used the first 6 octets, because the first 6 octets are used to identify the manufacturer of a network card and that should be unique to my system since I only have one Mellanox card.

[root@localhost network-scripts]# grep -i 00:02:c9 *
ifcfg-Wired_connection_1:HWADDR=00:02:C9:55:08:44

So now I know that I have to modify the file named ifcfg-Wired_connection_1. What I want to do is the following:

  • Disable IPv6
  • Set an IPv4 IP Address using the Class A network
  • Set the network mask corresponding to the Class A network

To disable IPv6, simply make sure the following line exists:

IPV6INIT=no

To set the IPv4 IP Address, set the following:

IPADDR=10.0.1.100

To set the IPv4 network mask:

NETMASK=255.0.0.0

Now, go to the other linux machine which has the other card, and follow these instructions and set the ip address to 10.0.1.101.

So after I did this, on both machines I took down my network interface by using the “ifdown enp3s0” and “ifdown enp2s0” commands. Then I brought the interfaces back up by using the “ifup enp2s0” and “ifup enp2s0” commands.

Then I tested my connections by pinging computer A from computer B and computer B from computer A. Now normally I would have done more exhaustive tests, but I was staring right at the network card when I saw the activity light turn green at exactly when I saw the ping response, regardless of which computer I was on. Nevertheless, I used ssh to connect to computer A from computer B and vice versa and I verified that I indeed was on each computer by running the ifconfig command.

Now, what about a speed test? I am going to write a quick Python script and let’s see what happens…

The cheapest 10Gigabit Network Switch available for sale on newegg.com goes for $749 NETGEAR XS708Ev2 ProSAFE 8-Port 10-...

Read More »

How Much You Should Be Making… as a Developer (Updated for 2016)

A few years ago I was working for a small Broker-Agent in midtown Manhattan making what I thought was a lot of money at the time.  I was making 55$ per hour on a W2 basis.  At first I was like “wow!” over 50$ per hour! I don’t believe it!  Of course that didn’t come with any benefits such as sick days, paid vacation, 401k…etc.  Then one day I came across the 2007 version of the Robert Half Technology Salary Guide and instantly realized that I was being underpaid.  Not just underpaid, very underpaid.  Not to mention the fact that I was a very productive developer, this Broker-Agent was really getting a good bang for its buck.

So, make a visit to the following link on the Robert Half Technology Website and click on the link titled “2016 IT Salary Guide”.

http://www.roberthalf.com/technology/it-salary-center

 

In order to save you some time, I have crunched some of the numbers for various roles and adjusted them for C#/Java Developers working in the New York City Metropolitan area:

National Range Add 9% for C# or Java Add 40% for New York City
Title 25th Percentile 75th Percentile 25th Percentile 75th Percentile 25th Percentile 75th Percentile Average
Applications Development /Manager $105,750 $160,500 $115,267 $174,945 $161,374 $244,923 $203,148
Project Manager $95,250 $146,500 $103,822 $159,685 $145,351 $223,559 $184,455
Applications Architect $121,250 $171,750 $132,162 $187,207 $185,027 $262,090 $223,559
Mobile Applications Developer $115,250 $175,750 $125,622 $191,567 $175,871 $268,194 $222,033
Software Engineer $103,000 $156,250 $112,270 $170,312 $157,178 $238,437 $197,807
Software Developer $91,000 $145,250 $99,190 $158,322 $138,866 $221,651 $180,258

Here is the raw data.  For each role the 25th percentile and 75th percentile base salaries for entering an organization are listed.

Applications Development Manager – 105,750 – 160,500
Project Manager – 95,250 – 146,500
Applications Architect – 121,250 – 171,750
Mobile Applications Developer – 115,250 – 175,750
Software Engineer – 103,000 – 156,250
Software Developer – 91,000 – 145,250

If your role is primarily a Java role, add 9%, if your role is primary a C# role, add 8%.  Finally, the adjustment for the New York City Metropolitan area is 40%, so multiple the final salary by 1.40 to get to the numbers listed above.

C# – add 8%
Java – add 9%
NYC 1.40

A few years ago I was working for a small Broker-Agent in midtown Manhattan making what I thought was a lot of money at...

Read More »

How to Calculate a SHA Checksum on all Files in a Directory

It took me some time to figure this one out, so I figured I would share this with everybody on the internet.  I had a directory with a bunch of tgz files and I wanted to make a checksum on every single file without having to write a script, I always knew that the find command had an “exec” option, but I had problems with the redirection.  After some trial-and-error, here is the command I used, it worked out perfectly!

find . -name “*.tgz” -exec sha256sum {} > checksums.sha256 \;

The results were a simple file that I could use to verify that I did indeed download the files off of my server without any corruption.

It took me some time to figure this one out, so I figured I would share this with everybody on the internet.  I had a di...

Read More »

GlassDoor.com and Emolument.com – Use these sites!

I have always been a follower of salary guides, salary statistics…etc  In fact, had it not been for me getting my hands on the Robert Half Technology Salary guide from… 2007, I would probably be making a lot less money at my current job.  Knowledge is empowerment.

That is why I recommend that you visit the following salary sites and to enter your information, the more information and statistics that we have, the better salaries we will get when searching for a new job:

And finally, after you enter your salary/rate information, these sites will allow you to browse their information for free!

I have always been a follower of salary guides, salary statistics...etc  In fact, had it not been for me getting my hand...

Read More »

Adding Boost to your Autotools Project

Do you want to take your existing autotools project and to add support for the Boost libraries?  I want to specifically use Boost Threading, so I have included everything that I did to make my project as well as the full source code included at the bottom of this article.

If you want to read a nice guide on how to use threading in Boost visit this link:

 http://antonym.org/2009/05/threading-with-boost—part-i-creating-threads.html

Step 1 – Download Boost M4 Macros

Modify your configure.ac file to use some Boost macros.  In order for autotools to find these macros you will have to download them from the GNU autoconf archive.  For Boost Threading support you will need to download:

Place those files into the m4 sub-directory of your project.

Step 2 – Reference M4 Macros Directory

Your configure.ac should now reference the m4 macros directory by adding the AC_CONFIG_MACRO_DIR macro call like so:

AC_CONFIG_MACRO_DIR([m4])

Your Makefile.am file should also have a call to another macro to enable these changes as well:

ACLOCAL_AMFLAGS = -I m4

Step 3 – Call the Boost Macros from your configure.ac file

Now we have to make another change to your configure.ac file, we need to call the actual Boost Macros provided by the m4 files which you added to your project before. Make sure you add these calls after the call to the AC_CONFIG_MACRO_DIR (obviously):

AX_BOOST_BASE([1.53],,[AC_MSG_ERROR([projectX needs Boost, but it was not found in your system])])

AX_BOOST_SYSTEM
AX_BOOST_THREAD

Step 4 – Modify your Makefile.am file to add the bootstrap directory

Add a reference to a variable named EXTRA_DIST so that your project will find the necessary Boost files when building.

EXTRA_DIST = bootstrap

Step 5 – Modify your src/Makefile.am to add some link parameters to allow your linker to properly find the Boost libraries.

Modify your src/Makefile.am file to include some parameters to cause it to link to the proper boost libraries as well:

AM_CPPFLAGS = $(BOOST_CPPFLAGS)
AM_LDFLAGS = $(BOOST_LDFLAGS)

&lt;app_name&gt;_LDADD = \
   $(BOOST_THREAD_LIB)

Step 6 – Recreate your config files by running the same steps as you normally do and rebuild your code, now with Boost Threading support!

autoreconf -fvi
./configure
make

You can download the associated source code here:

myBoostProject

Note to cygwin users:

If you want to download the boost libraries, you will have to use a mirror that has the boost-devel package.  You can use the truefunny.com mirror here: http://truefunny.com/cygwin while running the cygwin installer.  If you are using apt-cyg, run the following command:

apt-cyg -m http://truefunny.com/cygwin install boost-devel

Do you want to take your existing autotools project and to add support for the Boost libraries?  I want to specifically...

Read More »

A Very Basic Autotools Project

So recently I wanted to learn enough about Autotools so that I could convert a C++ project which I was working on into an Autotools project.  After searching and searching the internet, I finally came across enough information to make a basic, very vanilla project.

After creating that basic project I decided that I also wanted to add support for the Boost libraries.  So I figured that I would post the files for the basic project first here and then I would modify it to support boost and to post that project here as well.

The important Files

I had a hard time figuring this out, but an autotools project consists of a lot of files.  Most of these files are autogenerated and are not really necessary for you to know what they do, especially if all you want to do is create a simple project…etc.  So you really only need to worry about the following files:

  • configure.ac
  • Makefile.am
  • src/Makefile.am
  • your source files – put them under the src and include directories

What a very simple project looks like

  • configure.ac
  • Makefile.am
  • src/Makefile.am
  • src/main.cpp
  • include/my_include.h

How it works

So, how does autotools work? Well, if you go to the documentation on its homepage, you will have to read the entire documentation for autoconf, automake, aclocal, m4, libtool and a bunch of other components of autotools and only then will you know how it works.  Or, you can read my explanation here:

  1. Create configure.ac file
  2. Create Makefile.ac file
  3. Copy source files in
  4. Run “autoreconf -fvi”

Now your project is ready for use via the normal commands that you are used to using such as “./configure” and “make”… Let us start with creating our own project that contains one source file – “main.cpp” and one include file “my_include.h”

Project Format

./myProject/configure.ac
./myProject/Makefile.ac
./myProject/src/main.cpp
./myProject/src/my_include.h

configure.ac

dnl Comments are lines that begin with the letters "dnl"
dnl Comments that begin with # are also an option, and those
dnl comments will appear in the resulting configure script

dnl Specify required version of autoconf
AC_PREREQ([2.6])

dnl Set some parameters for our project
dnl Project Name - Version - Contact Email Address
AC_INIT([myProject], [1.0.0], [johnstratoudakis@gmail.com])

dnl Specify that we are using C++
AC_PROG_CXX

dnl Detect host operating system
dnl If we don't want to support an operating system
dnl we use "AC_MSG_ERROR" to cause our configure script
dnl to stop executing
AC_CANONICAL_HOST
case $host_os in
 darwin* )
 echo "OS X Platform"
 ;;
 linux* )
 echo "Linux Platform"
 ;;
 cygwin*)
 echo "Cygwin Platform"
 ;;
 *)
 echo "Unknown Platform"
 AC_MSG_ERROR([Your platform is not supported])
 ;;
esac

dnl Set some parameters for automake
dnl Note: These parameters are for automake, not make
dnl and the foreign parameter means that it is not using
dnl the standard autotools project format which includes
dnl several extra files and directories (files like README
dnl COPYING and similar)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

dnl Tells autoconf which Makefiles need to be generated and
dnl it will search for files named Makefile.am in these locations
AC_CONFIG_FILES(Makefile src/Makefile)

dnl Tells autoconf to start creating the output. To be more specific
dnl it tells autoconf to generate and run config.status.
AC_OUTPUT

All you need to know is that the Makefile and src/Makefile files will be used for building your project. That means if you create a sub-directory in your source code, add that Makefile reference into this file. Now on to the actual Makefile.am files themselves

Makefile.am and src/Makefile.am

Your project needs to contain a Makefile.am at the root of each directory containing source files.  Now this is known as “recursive make”, which is bad.  I am not going to get into the reasons why at this time, but I will try to find an example which does not use recursive make in the future.

The Makefile.am file in the project root directory is simple, it only contains one line which is used to reference the Makefile in the src sub-directory:

# SUBDIRS specifies that automake should continue searching for
# more Makefile.am files in the directories listed below
SUBDIRS = src

The Makefile.am file in the src directory is a little longer

# bin_PROGRAMS specifies the name of an output binary
# which is to be created
bin_PROGRAMS = myProject

# _SOURCES specifies the required source files
myProject_SOURCES = main.cpp

# CPPFLAGS are parameters that will be passed to the
# compiler, in this case the inclusion of the include
# directory
myProject_CPPFLAGS = -I$(top_srcdir)/include

Now all you need to do to build your project is to execute the following:

autoreconf -fvi
./configure
make

And that’s it! Download the source here:

myProject.tgz

So recently I wanted to learn enough about Autotools so that I could convert a C++ project which I was working on into a...

Read More »

Reflection with Java-style Annotations in C++ on Linux (Part 2 of 3)

Part 2 – Linux (Fedora Core 20 32-bit and 64-bit)

For part 2 of this article, I tested out the instructions using a Fedora Core 20 installation on a virtual machine created with Oracle VirtulBox and the Fedora Core 20 (32-bit, and 64-bit) Live DVDs.

  • Fedora-Live-Desktop-i686-20-1.iso
  • Fedora-Live-Desktop-x86_64-20-1.iso

These instructions should work on most, if not all distributions of linux, if you run into any problems, please post them as comments or message me directly and I will be more than happy to assist you.

For different platforms, see the other parts of this series:

Step 1

Enable Port Forwarding on your Virtual Machine

I like to access my virtual Machine via Putty, so I set the following Port Forwarding Rules:

( Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding )

Protocol – Host IP – Host Port – Guest IP – Guest Port

TCP – 127.0.0.1 – 2222 – 10.0.2.15 – 22

(and make sure you unmount the Fedora Live Disk before restarting your virtual machine!)

Step 2

Enable SSH Daemon on your Virtual Machine

Turn your virtual machine back on and login interactively and enabled SSHD via:

sudo chkconfig sshd on
sudo service sshd start

Step 3

Enable Sudo without password.

Start Putty and ssh in from your locahost and edit the “sudo users” file by issuing the command:

sudo visudo

Then in the subsequent editor, uncomment the line that says:

#%wheel  ALL=(ALL)       NOPASSWD: ALL

becomes:

%wheel  ALL=(ALL)       NOPASSWD: ALL

Step 4

Update all Packages (may take a few minutes)

From your putty session, issue the following command to update all packages:

sudo yum update

Note: If you are getting one of those invalid certificate errors, it could be because your employer is blocking those certificates, you can get around this by modifying your /etc/yum.conf file and by adding the following line to allow unsecured ssl connections:

sslverify=0

Step 5

Install a bunch of developer tools, including GccXml:

sudo yum install gccxml git automake make cmake gcc gcc-c++ libtool

Step 6

Install Reflex Reflection library

git clone git://github.com/GiannisRambo/Reflex.git
cd Reflex
build/autogen
./configure --enable-minimal
make
sudo make install
echo "export LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH" >> ~/.bash_profile
 source ~/.bash_profile

Step 7

Run Sample Reflection Application

cd SampleReflectionApp
make
./SampleReflectionApp

Part 2 - Linux (Fedora Core 20 32-bit and 64-bit) For part 2 of this article, I tested out the instructions using a Fedo...

Read More »

Reflection with Java-style Annotations in C++ on Windows using Cygwin (Part 1 of 3)

Motivation

I wanted to have reflection with Java-style Annotations in my C++ Applications.  I didn’t want to use C++11 or anything fancy like that and I wanted to be able to take my existing, old C++ applications the way they were and to simply add reflection in the same cool way that my Java applications already have the capability to do so.  Additionally, I wanted my friends that exclusively use OS X or cygwin to be able to run my applications with reflection support as well.  So after a lot of time researching and testing on as many Virtual Machines and actual machines that I could get my hands on, here is a set of instructions that are current as of Tuesday, January 7th, 2014, which also happens to be my name day! (My name is John btw)

Part 1 – Windows via Cygwin

For part 1 of this article, I am including the instructions for running a sample application that takes advantage of C++ Reflection (with function Annotations) using the Cygwin 32-bit and 64-bit platforms.  If you are using a different platform you can skip to those instructions by following one of the links here:

  • Part 1: Cygwin (32-bit and 64-bit) (this article)
  • Part 2: Linux (Fedora Core 19, 32-bit and 64-bit)
  • Part 3: Mac OS X (Homebrew with Intel-based processors only)

Step 1

Install Cygwin with at a bare minimum the git and wget packages with all of their dependencies using the setup installer that you can download from www.cygwin.com.  During the installation process, select the following 2 packages:

  • All->Devel->git
  • All->Web->wget

Step 2

Install apt-cyg, a cool, command line based package manager for cygwin:

git clone git://github.com/GiannisRambo/apt-cyg.git
cd apt-cyg
chmod +x apt-cyg
cp apt-cyg /usr/local/bin
cd ..
rm -rf apt-cyg

Step 3

Using apt-cyg, install several required packages.

apt-cyg update
apt-cyg install make automake gcc-core gcc-g++ libtool ncurses util-linux cmake python

Step 4

Install GccXml

If you are running 32-bit Cygwin, you can build it yourself as there is no package available from the default Cygwin repositories, or you can follow the instructions to install it from the Cygwin Ports repository.

For more information about the gccxml project, visit the project homepage at: http://gccxml.github.io

git clone git://github.com/gccxml/gccxml.git
cd gccxml
mkdir gccxml-build
cd gccxml-build
cmake ..
make
make install
cd ../..
rm -rf gccxml

If you are running 64-bit Cygwin, you will have to download it from the Cygwin Ports project:

apt-cyg -m ftp://ftp.cygwinports.org/pub/cygwinports install gccxml

Step 5

Install Reflex (C++ Reflection Library developed at CERN)

git clone git://github.com/GiannisRambo/Reflex.git
cd Reflex
build/autogen
./configure --enable-minimal
make
make install

Step 6

Run Sample Reflection App

Now don’t go ahead and delete the Reflex git repository just yet.  In the forked version of this project which I have created, I have included a sample application that demonstrates reflection in it under the directory called “SampleReflectionApp.”  There is a simple Makefile in that directory, and the sample application checks for all annotated functions that reside in the MyClass class.  This should be enough for you to get started for now.  Good luck and have fun!

cd SampleReflectionApp
make
./SampleReflectionApp.exe

Motivation I wanted to have reflection with Java-style Annotations in my C++ Applications.  I didn't want to use C++11 o...

Read More »

Creating a VBA Variant with type “Missing”

How do you test an Excel VBA function that takes lots of optional parameters without making a lot of calls to the same function?

Instead of:

If NumberOfArguments = 1 Then
MyFunction varg1
ElseIf NumberOfArguments = 2 Then
MyFunction varg1, varg2 ...

Do this:

Dim varg1, varg2 As Variant
arg1 = "Some Value"
varg2 = GetMissing()
MyFunction varg1, varg2
Private Function GetMissing(Optional var1 As Variant) As Variant
GetMissingAsVariant = var1
End Function

How do you test an Excel VBA function that takes lots of optional parameters without making a lot of calls to the same f...

Read More »