How to open multiple buffers in JEdit like in GEdit or Mousepad

Many of us use a text editor to edit program code. The simplest and clean edit is GEdit on the Gnome desktop. However, if you are not on the Gnome desktop, you may miss it. You can use JEdit which is much more powerful, however, by default, it does not open multiple programs alongside each … Continue reading How to open multiple buffers in JEdit like in GEdit or Mousepad

Use Code::Blocks with wxWidgets

# yum install gcc-c++ # yum install wxGTK-devel.x86_64 # yum install codeblocks codeblocks-contrib You will also get the GUI builder wxSmith. # cd /usr/include # ln -sv wx-2.8/wx wx # Now run the default project it opens If you get fatal error: wx/setup.h: No such file or directory, add the line: `wx-config --cflags` in Settings … Continue reading Use Code::Blocks with wxWidgets

Projects in Anjuta

Create new Project Copy your src and include files onto it. Then refresh the left panel. Select Project Name Right Click → Properties Compiler Settings Compiler Flags /include/mysql Linker Flags /usr/lib/mysql/ In all programs cinlude mysql as # include Project → Properties → Packages Addressbook, remove libglade. We are not using it.

Install and setup GTK+ and MySQL in Windows

Install Dev C++ (devcpp) Install gtk-dev-2.8.6.DevPak Install mysql.devPak Install mysql gtk_win32_devel_2.8.6_rc3.exe gtk-2.8.6-runtime.exe In Dev C++, do the following steps: Add all of Dev_cpp/ lib to Project->ProjectOptions Add libmysql-lib to above also Copy MySQLLib.dll into windows/system32 and this gets rid of the mysql DLL runtime error. Remove files not recognized during build such as ../lib/jpeg-bcc.lib. … Continue reading Install and setup GTK+ and MySQL in Windows

Using sscanf for dates in C

Sscanf with following does NOT WORK void change_date_format(char *date_vlaue, char *fmt) { char day[2], month[2], year[4]; sscanf (date_value “%2s/%2s/%4s”, day, month, year); } Always use the following method: void change_date_format(char *date_value, char *fmt) { int day, month, year; sscanf (date_value, “%2d/%2d/%4d”, day, month, year); sprintf (date_value, “%02d/%02d/%04d”, month, day, year); }

Segmentation Fault in C Program

Reason for error: - Declared a string sql[200] - Did sprintf(sql, “......”, variables); - String in sql crossed 200 characters. Therefore, program memory space got corrupt leading to above segmentation fault in other variables. Overcome by debugging - Watch variables for statement where sprintf was there, to see if any memory variable pointers were changed. … Continue reading Segmentation Fault in C Program