Monday, February 29, 2016

Configuring Eclipse IDE for C/C++ Developers with C++11


Download gcc compiler at http://www.equation.com/servlet/equation.cmd?fa=fortran and install to C:\MinGW directory

Download Eclipse IDE for C/C++ Developers at http://www.eclipse.org/downloads/






Restart eclipse

Friday, February 26, 2016

Compiling GEMU on Fedora 14 x86

Disable SELINUX in /etc/selinux/config
Decompress source file
tar xvfz gprs3gemulator-5.3.3.tgz

find . -type f -exec chmod 777 {} \;

Enable/disable features in makeoptions

export PACKET_ABIS_FLAG=-DPACKET_ABIS
export PCUMS_SBA_FLAG=-UINIT_SBA_MS
export ETP_STUB_FLAG=-DETP_STUB
export ETP_BSC_STUB_FLAG=-UETP_BSC_STUB
export S16_CS_TRAU_FLAG=-US16_CS_TRAU_LEGACY_ABIS

Installing dependencies packages:
yum install lksctp-tools-devel.i686
yum install openssl-devel.i686
yum install tcsh.i686
make clean && make clobber && make

Update correct IP address in system/struct_2g.db
(using vim, this command can be used: :%s/localhost/192.168.0.103/g)

Generate configuration files for all subsystem using iniparser tool:
iniparser/iniparser_PAoE -sgB bsc_3 system/struct_2g.db

Compiling and configuring boost c++ libraries v1.60 for visual studio 2015


  1. Download boost library v1.60




Compiling and configuring boost c++ libraries v1.60 for visual studio 2013

Download boost library v1.60:

Extract zip file to C:\boost\MSVS\1.60

Set environment BOOST_ROOT to C:\boost\MSVS\1.60

Build Project 1:
  • From Visual Studio's File menu, select New > Project…
  • In the left-hand pane of the resulting New Project dialog, select Visual C++ > Win32.
  • In the right-hand pane, select Win32 Console Application
  • In the name field, enter "example"
  • Right-click example project in the Solution Explorer pane and select Properties from the resulting pop-up menu
  • In Configuration Properties > C/C++ > General > Additional Include Directories, enter the path to the Boost root directory, for example
    C:\boost\MSVS\1.60
  • In Configuration Properties > C/C++ > Precompiled Headers, change Use Precompiled Header (/Yu) to Not Using Precompiled Headers.
  • Replace the contents of the example.cpp generated by the IDE with the following code.
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
  • From the Build menu, select Build Solution.

Compiling Boost library

bootstrap
.\b2

Link Your Program to a Boost Library

  1. Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu
  2. In Configuration Properties > VC++ Directories > Library Directories, enter the path to the Boost binaries, e.g. C:\boost\MSVS\1.60\stage\lib.

  1. From the Build menu, select Build Solution.


http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html

Thursday, February 25, 2016

Linux Applications Debugging Techniques/Deadlocks

Analysis[edit]
Searching for a deadlock means reconstructing the graph of dependencies between threads and resources (mutexes, semaphores, condition variables, etc.) - who owns what and who wants to acquire what. A typical deadlock would look like a loop in that graph. The task is tedious, as some of the parameters we are looking for have been optimized by the compiler into registers.

Below is an analysis of an x86_64 deadlock. On this platform, register r8 is the one containing the first argument: the address of the mutex:

(gdb) thread apply all bt
...
Thread 4 (Thread 0x419bc940 (LWP 12275)):
#0  0x0000003684c0d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003684c08e1a in _L_lock_1034 () from /lib64/libpthread.so.0
#2  0x0000003684c08cdc in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000000000400a50 in thread1 (threadid=0x1) at deadlock.c:66
#4  0x0000003684c0673d in start_thread () from /lib64/libpthread.so.0
#5  0x00000036840d3d1d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x421bd940 (LWP 12276)):
#0  0x0000003684c0d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003684c08e1a in _L_lock_1034 () from /lib64/libpthread.so.0
#2  0x0000003684c08cdc in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000000000400c07 in thread2 (threadid=0x2) at deadlock.c:111
#4  0x0000003684c0673d in start_thread () from /lib64/libpthread.so.0
#5  0x00000036840d3d1d in clone () from /lib64/libc.so.6
...


(gdb) thread 4
[Switching to thread 4 (Thread 0x419bc940 (LWP 12275))]#2  0x0000003684c08cdc in pthread_mutex_lock ()
   from /lib64/libpthread.so.0

(gdb) frame 2
#2  0x0000003684c08cdc in pthread_mutex_lock () from /lib64/libpthread.so.0

(gdb) info reg
...
r8             0x6015a0 6296992
...

(gdb) p *(pthread_mutex_t*)0x6015a0
$3 = {
  __data = {
    __lock = 2, 
    __count = 0, 
    __owner = 12276,   <== LWP 12276 is Thread 3
    __nusers = 1, 
    __kind = 0,        <== non-recursive
    __spins = 0, 
    __list = {
      __prev = 0x0, 
      __next = 0x0
    }
  }, 
  __size =     "\002\000\000\000\000\000\000\000\364/\000\000\001", '\000' <repeats 26 times>, 
  __align = 2
}

(gdb) thread 3
[Switching to thread 3 (Thread 0x421bd940 (LWP 12276))]#0  0x0000003684c0d4c4 in __lll_lock_wait ()
   from /lib64/libpthread.so.0
   
(gdb) bt
#0  0x0000003684c0d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003684c08e1a in _L_lock_1034 () from /lib64/libpthread.so.0
#2  0x0000003684c08cdc in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000000000400c07 in thread2 (threadid=0x2) at deadlock.c:111
#4  0x0000003684c0673d in start_thread () from /lib64/libpthread.so.0
#5  0x00000036840d3d1d in clone () from /lib64/libc.so.6
#2  0x0000003684c08cdc in pthread_mutex_lock () from /lib64/libpthread.so.0

(gdb) info reg
...
r8             0x6015e0 6297056
...

(gdb) p *(pthread_mutex_t*)0x6015e0
$4 = {
  __data = {
    __lock = 2, 
    __count = 0, 
    __owner = 12275,  <=== Thread 4
    __nusers = 1, 
    __kind = 0, 
    __spins = 0, 
    __list = {
      __prev = 0x0, 
      __next = 0x0
    }
  }, 
  __size =     "\002\000\000\000\000\000\000\000\363/\000\000\001", '\000' <repeats 26 times>, 
  __align = 2
}
Threads 3 and 4 are deadlocking over two mutexes.


Note: If gdb is unable to find the symbol pthread_mutex_t because it has not loaded the symbol table for pthreadtypes.h, you can still print the individual members of the struct as follows:

(gdb) print *((int*)(0x6015e0))
$4 = 2
(gdb) print *((int*)(0x6015e0)+1)
$5 = 0
(gdb) print *((int*)(0x6015e0)+2)
$6 = 12275


Automation[edit]
An interposition library can be built to automate deadlock analysis. A significant number of APIs have to be interposed and even then there are cases that would go unnoticed by the library. For instance, one creative way to deadlock two threads without involving any userland locking mechanism is to have each thread join the other. Thus, interposition tools have limited diagnostic functionality.

There are a number of other tools available:

Userspace lockdep. Incipient work.
Locksmith. Basic.
Valgrind Helgrind. Does not suffer from the terrible slowdown other Valgrind tools have (in particular the memory analysis ones) but does not survive long on an amd64 platform.
pthreads[edit]
pthreads has some built-in support for certain synchronization mechanisms (e.g. PTHREAD_MUTEX_ERRORCHECK mutexes).

Also, there's a POSIX mutex construction attribute for robust mutexes (a recoverable mutex that was held by a thread whose process has died): an error return code indicates the earlier owner died; and lock acquisition implies acquired responsibility for dealing with any cleanup.



lockdep[edit]
On lockdep-enabled kernels, pressing Alt+SysRq+d will dump information about all the locks known to the kernel.

How To Install Windows 7 Or Windows 8 From USB Drive

Requirements:
  * USB Flash Drive (Minimum 4GB)
  * Windows 7 or Vista installation files.

Follow the below steps to create bootable Windows 7/Vista USB drive using which 
you can install Windows 7/Vista easily.
  1.  Plug-in your USB flash drive to USB port and move all the contents from 
      USB drive to a safe location on your system.
  2.  Open Command Prompt with admin rights. Use any of the below methods to 
      open Command Prompt with admin rights.
      
      * Type cmd in Start menu search box and hit Ctrl+ Shift+ Enter.
      * Go to Start menu > All programs > Accessories, right click on Command 
        Prompt and select Run as administrator.
  3.  You need to know about the USB drive a little bit. Type in the following 
      commands in the command prompt:

      First type DISKPART and hit enter to see the below message.
      Next type LIST DISK command and note down the Disk number (ex: Disk 1) of 
      your USB flash drive. In the below screenshot my Flash Drive Disk no is 
      Disk 1.
  4.  Next type all the below commands one by one. Here I assume that your disk 
      drive no is "Disk 1". If you have Disk 2 as your USB flash drive then use 
      Disk 2. Refer the above step to confirm it.
      
      So below are the commands you need to type and execute one by one:

SELECT DISK 1
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS
(Format process may take few seconds)
ASSIGN
EXIT

      Don't close the command prompt as we need to execute one more command at 
      the next step. Just minimize it.
  5.  Next insert your Windows7/Vista DVD into the optical drive and check the 
      drive letter of the DVD drive. In this guide I will assume that your DVD 
      drive letter is "D" and USB drive letter is "H" (open my computer to know 
      about it).
  6.  Maximize the minimized Command Prompt in the 4th step. Type the following 
      command now:
D:
CD BOOT

  7.  Type another command given below to update the USB drive with BOOTMGR 
      compatible code.

BOOTSECT.EXE /NT60 H:
  8.  Copy your Windows 7/Vista DVD contents to the USB flash drive.
  9.  Your USB drive is ready to boot and install Windows 7/Vista. Only thing 
      you need to change the boot priority at the BIOS to USB from the HDD or 
      CD ROM drive. I won't explain it as it's just the matter the changing the 
      boot priority or enabling the USB boot option in the BIOS.



oom-killer - anon-rss and total-vm


kernel: [1799319.246494] Out of memory: Kill process 28536 (java) score 673 or sacrifice childSep 
kernel: [1799319.246506] Killed process 28536 (java) total-vm:1271568kB, anon-rss:426528kB, file-rss:0kB

Jan 21 15:58:14 msdc02 kernel: Out of memory: Kill process 35864 (process1) score 926 or sacrifice child
Jan 21 15:58:14 msdc02 kernel: Killed process 35864, UID 0, (process1) total-vm:41163224kB, anon-rss:31795776kB, file-rss:92kB

The size of the virtual memory that a process uses is listed as total-vm. Part of it is really mapped into the RAM itself (allocated and used). This is RSS. Part of the RSS is allocated in real memory blocks (other than mapped into a file or device). This is anonymous memory (anon-rss) and there is also RSS memory blocks that are mapped into devices and files (file-rss).

If you open a huge file in vim, the file-rss would be high, on the other size, if you malloc() a lot of memory and really use it, your anon-rss would be high also. On the other side, if you allocate a lot of space (with malloc()), but nevers use it, the total-vm would be higher, but no real memory would be used (due to the memory overcommit), so, the rss values would be low.

vm.overcommit_memory = 2
vm.overcommit_ratio = 80

SOLID Principles

The Single Responsibility Principle

The Open / Closed Principle

The Liskov Substitution Principle

The Interface Segregation Principle

The Dependency Inversion Principle

SFone Network Diagram (02 Aug 2007)

SFone logo




SMPP Log Trace


[16:26:17]

======>> SMPP SUBMIT =======>>
-----------------------------------------------------------
43 4D 54 00 02 00 31 38 30 30 30 39 35 00 02 00 30 39 35 38 
38 36 38 36 39 36 00 01 00 00 00 00 00 00 00 00 50 51 43 3A 
54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 20 31 36 30 25 
74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 20 35 30 30 30 
30 20 74 72 6F 20 6C 65 6E 3A 36 30 25 6E 67 6F 61 69 20 6D 
61 6E 67 20 26 31 30 30 25 6E 6F 69 20 6D 61 6E 67 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 
-----------------------------------------------------------
[16:26:17]

>>>> SMPP MESSAGE RECEIVED FROM CCBS >>>> 

-----[header]-----------------------------------------
Command Length        : [133]
Command ID            : [00000004, SUBMIT]
Command Status        : [0]
Sequence Number       : [14466]
-----[body]-------------------------------------------
Service Type          : [CMT]
Orig Address[ton]     : [2]
Orig Address[npi]     : [0]
Orig Address[address] : [1800095]
Orig Address[ton]     : [2]
Dest Address[npi]     : [0]
Dest Address[address] : [0958868696]
Orig SubAddress       : [Not include]
Dest SubAddress       : [Not include]
ESM Class             : [1]
Protocol ID           : [0, 0x00]
Priority Flag         : [0]
Schedule Time         : []
Validity Period       : []
Registered Delivery   : [0]
Replace if Present    : [0]
Data Coding Scheme    : [0]
SM Default Msg ID     : [0]
SM Length             : [80]
Short Message         : [QC:Tu 25-27/8,tang 160%the dau tien tu 50000 tro len:60%ngoai mang &100%noi mang]
                        [51 43 3A 54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 20 31 36 30 25 74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 20 35 30 30 30 30 20 74 72 6F 20 6C 65 6E 3A 36 30 25 6E 67 6F 61 69 20 6D 61 6E 67 20 26 31 30 30 25 6E 6F 69 20 6D 61 6E 67 ]
-----[optional]---------------------------------------
[16:29:59]

======>> SMPP SUBMIT =======>>
-----------------------------------------------------------
43 4D 54 00 02 00 31 38 30 30 30 39 35 00 02 00 30 39 35 38 
38 36 38 36 39 36 00 01 00 00 00 00 00 00 00 00 50 51 43 3A 
54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 20 31 36 30 20 
74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 20 35 30 30 30 
30 20 74 72 6F 20 6C 65 6E 3A 36 30 20 6E 67 6F 61 69 20 6D 
61 6E 67 20 26 31 30 30 20 6E 6F 69 20 6D 61 6E 67 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 
-----------------------------------------------------------
[16:29:59]

>>>> SMPP MESSAGE RECEIVED FROM CCBS >>>> 

-----[header]-----------------------------------------
Command Length        : [133]
Command ID            : [00000004, SUBMIT]
Command Status        : [0]
Sequence Number       : [14543]
-----[body]-------------------------------------------
Service Type          : [CMT]
Orig Address[ton]     : [2]
Orig Address[npi]     : [0]
Orig Address[address] : [1800095]
Orig Address[ton]     : [2]
Dest Address[npi]     : [0]
Dest Address[address] : [0958868696]
Orig SubAddress       : [Not include]
Dest SubAddress       : [Not include]
ESM Class             : [1]
Protocol ID           : [0, 0x00]
Priority Flag         : [0]
Schedule Time         : []
Validity Period       : []
Registered Delivery   : [0]
Replace if Present    : [0]
Data Coding Scheme    : [0]
SM Default Msg ID     : [0]
SM Length             : [80]
Short Message         : [QC:Tu 25-27/8,tang 160 the dau tien tu 50000 tro len:60 ngoai mang &100 noi mang]
                        [51 43 3A 54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 20 31 36 30 20 74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 20 35 30 30 30 30 20 74 72 6F 20 6C 65 6E 3A 36 30 20 6E 67 6F 61 69 20 6D 61 6E 67 20 26 31 30 30 20 6E 6F 69 20 6D 61 6E 67 ]
-----[optional]---------------------------------------
[16:29:59]
############### IXSUBMIT ENGINE RECEIVED  ###############
Command Type    :   [0:CMD_SUBMIT]
ESME NAME       :   [CCBS]
ESME ID         :   [CCBS]
Orig. Addr      :   [ton=2, npi=0, addr=1800095]
Dest. Addr      :   [ton=2, npi=0, addr=0958868696]
Time Stamp      :   [2009/08/21 16:29:59]
Validity Period :   [2009/08/23 16:34:59]
ReplyOpt        :   [0:REPLY_OPT_NONE]
Retry Profile   :   [0]
Sequence Number :   [37]
Cnx ID          :   [57]
[16:29:59]

======>> SMPP SUBMIT RESP =======>>
-----------------------------------------------------------
00 00 00 1B 80 00 00 04 00 00 00 00 00 00 38 CF 30 30 36 33 
32 36 39 38 30 34 00 
-----------------------------------------------------------
[16:29:59]

<<<< SMPP MESSAGE TRANSMIT TO CCBS <<<< 

-----[header]-----------------------------------------
Command Length        : [27]
Command ID            : [80000004, SUBMIT_RESP]
Command Status        : [0]
Sequence Number       : [14543]
-----[body]-------------------------------------------
Message ID            : [0063269804]
[16:29:59]

======>> SMPP SUBMIT =======>>
-----------------------------------------------------------
00 00 00 8E 00 00 00 04 00 00 00 00 00 00 5F 54 43 4D 54 00 
02 00 31 38 30 30 30 39 35 00 02 00 30 39 35 38 38 36 38 36 
39 36 00 01 00 00 00 00 00 00 00 00 59 2A 31 38 30 30 30 39 
35 20 51 43 3A 54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 
20 31 36 30 20 74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 
20 35 30 30 30 30 20 74 72 6F 20 6C 65 6E 3A 36 30 20 6E 67 
6F 61 69 20 6D 61 6E 67 20 26 31 30 30 20 6E 6F 69 20 6D 61 
6E 67 
-----------------------------------------------------------
[16:29:59]

<<<< SMPP MESSAGE TRANSMIT TO HCM_SMSC3 <<<< 

-----[header]-----------------------------------------
Command Length        : [142]
Command ID            : [00000004, SUBMIT]
Command Status        : [0]
Sequence Number       : [24404]
-----[body]-------------------------------------------
Service Type          : [CMT]
Orig Address[ton]     : [2]
Orig Address[npi]     : [0]
Orig Address[address] : [1800095]
Orig Address[ton]     : [2]
Dest Address[npi]     : [0]
Dest Address[address] : [0958868696]
Orig SubAddress       : [Not include]
Dest SubAddress       : [Not include]
ESM Class             : [1]
Protocol ID           : [0, 0x00]
Priority Flag         : [0]
Schedule Time         : []
Validity Period       : []
Registered Delivery   : [0]
Replace if Present    : [0]
Data Coding Scheme    : [0]
SM Default Msg ID     : [0]
SM Length             : [89]
Short Message         : [*1800095 QC:Tu 25-27/8,tang 160 the dau tien tu 50000 tro len:60 ngoai mang &100 noi mang]
                        [2A 31 38 30 30 30 39 35 20 51 43 3A 54 75 20 32 35 2D 32 37 2F 38 2C 74 61 6E 67 20 31 36 30 20 74 68 65 20 64 61 75 20 74 69 65 6E 20 74 75 20 35 30 30 30 30 20 74 72 6F 20 6C 65 6E 3A 36 30 20 6E 67 6F 61 69 20 6D 61 6E 67 20 26 31 30 30 20 6E 6F 69 20 6D 61 6E 67 ]
-----[optional]---------------------------------------
[16:29:59]

======>> SMPP SUBMIT RESP =======>>
-----------------------------------------------------------
30 41 30 45 36 31 42 45 00 6F 64 79 5D 2D 2D 2D 2D 2D 2D 2D 
2D 2D 2D 2D 2D 
-----------------------------------------------------------
[16:29:59]

>>>> SMPP MESSAGE RECEIVED FROM HCM_SMSC3 >>>> 

-----[header]-----------------------------------------
Command Length        : [25]
Command ID            : [80000004, SUBMIT_RESP]
Command Status        : [0]
Sequence Number       : [24404]
-----[body]-------------------------------------------
Message ID            : [0A0E61BE]
[16:29:59]
############### IXRCVACK ENGINE RECEIVED ###############
    Command Type    :   [0:CMD_SUBMIT]
    Orig Node ID    :   []
    SMSS Message ID :   [63269804]
    SMSC Message ID :   [168714686]
    CDR_KEY         :   []
    Orig. Addr      :   [ton=2, npi=0, addr=1800095]
    Dest. Addr      :   [ton=2, npi=0, addr=0958868696]
    NODE ID         :   [HCM_SMSC3]
    NODE NAME       :   [HCM_SMSC3]
    Result          :   [S]
    Cause Code      :   [0]
    Done Time       :   [2009/08/21 16:29:59]
[16:29:59]

Success to push iXBill Queue[16:29:59]
############## IXBILL RECEIVED ###################
 Orig Addr  : 1800095
 Dest Addr  : 0958868696

 SCP RESULT: NO ROUTE SCP
 RESULT.................................[CDR,DONE OK]
[16:29:59]
<============= 'SCPIB1' WRITE CCBS CDR <===============
 CDR_MODE : NORMAL(0)
 ORIG : 1800095
 DEST : 0958868696
 PPS  : '0'
 CDR  : '1800095             0958868696                              2009082116295920090821162959CCBSV2    0080 000                                                     63269804    1 '
 WRITE CCBS CDR..............................[OK]

Different states of Android activities


Extending gdb using Python

URL: http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Python
URL: http://askubuntu.com/questions/513626/cannot-compile-gdb7-8-with-python-support

Compile gdb with python support

Install python-devel
sudo yum install python-devel
Install texinfo
./configure --with-python
Download the gdb source and gunzip it and untar it. 
cd to the gdb-7.9 directory with the configure file. 
./configure --prefix=/usr --with-python
make 
sudo make install



You can extend gdb using the Python programming language. This feature is available only if gdb was configured using --with-python.

Python scripts used by gdb should be installed in data-directory/python, where data-directory is the data directory as determined at gdb startup (see Data Files). This directory, known as the python directory, is automatically added to the Python Search Path in order to allow the Python interpreter to locate all scripts installed at this location.

Additionally, gdb commands and convenience functions which are written in Python and are located in the data-directory/python/gdb/command or data-directory/python/gdb/function directories are automatically imported when gdb starts.

Python Commands: Accessing Python from gdb.
Python API: Accessing gdb from Python.
Python Auto-loading: Automatically loading Python code.
Python modules: Python modules provided by gdb.

SugarCRM - Audit relate fields


URL: http://urdhva-tech.blogspot.com/2013/02/audit-relate-fields.html

How to audit relate fields?

Step 1: Create a before save definition logic hook under custom/modules/Contacts/logic_hooks.php
<?php
$hook_array['before_save'][] = Array(90, 'Audit account name', 'custom/modules/Contacts/auditAcc.php','auditAccC', 'auditAccF');

Step 2: Create file auditAcc.php under custom/modules/Contacts folder and add following code.


<?php
class auditAccC {
    function auditAccF($bean) {
        if($bean->fetched_rel_row['account_id'] != $bean->account_id) {
            $aChange = array();
            $aChange['field_name'] = 'account_id';
            $aChange['data_type'] = 'relate';
            $aChange['before'] = $bean->fetched_rel_row['account_id'];
            $aChange['after'] = $bean->account_id;
            $bean->db->save_audit_records($bean, $aChange);
        }
    }
} 

HTTP GET

Python

import urllib2

URL = "http://www.mswipe.com"
HEADERS = {
 'X-User-Email' : 'warex03@gmail.com',
 'X-User-Token' : '_KHS4euMs1At4jsUHHdR'
}
request = urllib2.Request(URL, headers=HEADERS)
response = urllib2.urlopen(request).read()

Ruby

require 'net/https'

uri = URI("http://www.mswipe.com")
http = Net::HTTP.new(uri.host, uri.port)
request_uri = Net::HTTP::Get.new(uri.request_uri)
request_uri.add_field('X-User-Email', 'warex03@gmail.com')
request_uri.add_field('X-User-Token', '_KHS4euMs1At4jsUHHdR')
response = http.request(request_uri)
body = response.body

CURL

curl -X GET -H "X-User-Email: warex03@gmail.com" -H "X-User-Token: _KHS4euMs1At4jsUHHdR" http://www.mswipe.com

Hello World

C#

using System;

class Program
{
 static void Main()
 {
  Console.WriteLine("Hello, World!");
 }
}

csc.exe /nologo Program.cs

C:\Program Files (x86)\Microsoft Visual Studio 14.0>where csc.exe
C:\Program Files (x86)\MSBuild\14.0\Bin\csc.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe

ildasm.exe Program.exe