Thursday, October 3, 2013

XCode app as Agent in MAC

How to make Agent app in Xcode

If you already wrote the NSApplication using Xcode and want to run the same app in background, it can be done simply by adding a entry in -info.plist . Just add a "Application is agent(UIElement)"- Yes.
This would make your app run in background and provide some service, so that other apps can make use of it. Below is the screenshot of -info.plist entry FYR



Hide the Window in Xcode app

To hide the Xcode app main window or any window inside

1. Choose the xib file from the Xcode project.
2. Select the Window that you want to hide, and check the corresponding attributes from attribute window.
3. Uncheck the "Visible at Launch" checkbox.

And you are done, below attached is the screenshot of the window attributes from Xcode ide FYR.


Sunday, September 29, 2013

make install problem

make[2]: Nothing to be done for `install-exec-am'.
====================================

This may be a error that one may encounter during installation of some linux based sofwares. In the process of executing ./configure, make, make install , this could be a error when we do make install. To eliminate the issue just try

./configure --prefix=/usr

this would work for most of the installation.

Monday, September 23, 2013

QLThumbnailImageCreate Fails


Console Output 

ImageIO:   CGImageDestinationAddImage image parameter is nil

ImageIO:   CGImageDestinationFinalize image destination does not have enough images

The above error happens due to either CGSizeMake size is zero,i.e., the image we are trying to create has maximum size as Zero. or The system doesn't have codec to parse the file passed as parameter. I just spend quite a bit of time puzzling, unable to find why the QLThumbnailImageCreate fails, although all the parameters are valid, the reason was, i was trying to parse a video file, for which my current system didn't have codec. Finally, tried with some .mpg extension and it worked fine. Hope this post help someone save sometime. 

Friday, September 20, 2013

XCode objective-c++ Compilation error


XCode compilation error
==================
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)


The above error is due to .cpp extension used for objective-c++ file, ie., a file that
has the objective-c and c++ code has extension .cpp insted of .mm. Rename to .mm extension
could solve this issue.

Thursday, September 19, 2013

Setting up VIM as IDE in MAC OS X


To setup VIM in mac os x :
#####################

1. By default MAC OS X comes with vim installed.

2. Download and install cscope-15.8a.tar.gz (601.2 kB) from cscope.org.

3. Unzip the cscope-15.8a.tar.gz from terminal. (tar -xvzf cscope-15.8a.tar.gz).

4. cd cscope-15.8.a folder, and do ./configure, make, and make install.

5. the above install may fail due to ncurses dependency with following error.
 
In file included from main.c:49:
/usr/include/ncurses.h:539:40: error: macro "cbreak" passed 1 arguments, but takes just 0
/usr/include/ncurses.h:564:44: error: macro "erasechar" passed 1 arguments, but takes just 0
/usr/include/ncurses.h:600:43: error: macro "killchar" passed 1 arguments, but takes just 0
make[2]: *** [main.o] Error 1

6. The above error can be resolved by making changes in src/constants.h file. Open this file in vim and modify the below line
 
 #if (BSD || V9 ) && !__NetBSD__ && !__FreeBSD__
with this
#if (BSD || V9 ) && !__NetBSD__ && !__FreeBSD__ && !__APPLE__

 
7. Now repeat step 4. It will succeed.
 
8. Download and install Exuberant Ctags from crags website http://ctags.sourceforge.net

9. Follow the similar procedure to install ctags
tar xzvf ctags-5.8.tar.gz
cd ctags-5.8
./configure
make
sudo make install
 
10. After exuberant crags installed, you can verify it using the below commands
which -a ctags

/usr/bin/ctags ==> original ctags
/usr/local/bin/ctags ==> exuberant ctags

11. To set OS X to use exuberant crags, just export the path
 
  export PATH="/usr/local/bin:$PATH"

12. Downlod Taglist plugin and unzip using tar -xzvf and do the following
 
Copy the tag list.vim to /usr/share/vim/vim73/plugin/.
Copy the tag list.txt to /usr/share/vim/vim73/doc/.

13. Thats it you are ready to go. If any problem such as Taglist showing empty or no tags appears add the following lines in vimrc file

let Taglist_Ctags_Cmd = "/usr/local/bin/ctags"
"to inform vim about filetype
filetype on
"to inform vim about syntax highlighting
  syntax on

14. To permanently avoid exporting path export PATH="/usr/local/bin:$PATH" each time, add following line in top of /etc/paths
 
/usr/local/bin

15. Add the below line  vimrc file to automatically find the tags file generated in current directory , all the way to root

 set tags = ./tags; /

If any doubt related to creating scope db and others refer to my previous posts. thank you.

Ref: http://vim-taglist.sourceforge.net/faq.html

Monday, September 2, 2013

To Know the Library architecture

To Know the Library architecture for which the library has been compiled for

Execute the following command from the Windows command prompt

It will be 14c for x86 and 8664 for x64

Following is sample output of the command

c:\> dumpbin ex.lib /headers

Microsoft (R) COFF/PE Dumper Version 11.00.50727.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file ex.lib
File Type: LIBRARY
FILE HEADER VALUES
             14C machine (x86)
 

Thursday, August 29, 2013

Solving C1083 error for Visual Studio 2012 Express with Windows Kit

To solve error c1083 cannot open include file 'windows.h' no such file or directory
===========================================================
(The following solution assume, you have installed Visual Studio 2012 Express / Windows Kit for x86 or x64 platforms)

  • Change the following properties (if you installed the SDK to a different location, replace the SDK path with your custom install location):

  • - In “Executable Directories” replace $(WindowsSdkDir)bin with $(ProgramFiles)\Windows Kits\8.0\bin\x86
    - In “Include Directories” add $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared at the beginning and remove $(WindowsSdkDir)include
    - In “Library Directories” replace $(WindowsSdkDir)lib with $(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x86
    - In “Exclude Directories” replace $(WindowsSdkDir)include with $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared
    - When targeting x64, replace x86 with x64

    That’s it – you should be ready to build and run!

    Ref : You can dynamically include path of Program Files folder using the following in Windows.
              On 64bit Windows, things are a little more complicated, as application can be installed both in
               %ProgramFiles% and %ProgramFiles(x86)%

     

    Thursday, March 14, 2013

    Touchpad turning off

    To turn off the laptop/notebook touchpad in ubuntu, type the following command in the terminal window

                 $synclient TouchpadOff=1

    to enable the touchpad again

                  $synclient TouchpadOff=0

    Synaptic Package Manager behind Proxy

    To configure the Synaptic Package manager behind the proxy, follow the below simple steps
    1. Open Synaptic Package manager, by searching it from Ubuntu dash or clicking open it from launcher panel.
    2. Click, Settings->Preferences menu.
    3. The below screen would appear.

    4. Select "Network tab".
    5. Select "Manual proxy configuration"
    5. Enter the "HTTP proxy:" ip address and "Port", and also "FTP proxy:" ip address and "Port".
    6. Enter "localhost" in the "No proxy for:" text box.
    7. Click on the "Authentication" button near HTTP proxy port spinner box.
    8. Enter your network "username" and "password" for proxy authentication.
    9. Thats all, you are through to download and install packages.