Saturday, October 29, 2011

String concatenation in C++

#include <iostream>
#include <cstdarg>
#include <cstdio>

using namespace std;

char* concat(char* des, ...);

int main(){
  char str[100]="Fardad";
  cout << concat(str, " Soleimanloo","test\n", "more", " and more", 0) 
       << endl;
  return 0;

char* concat(char* des, ...){
 va_list args;
 va_start(args, des);
 char* get = va_arg(args, char*);

 while(get && sprintf(des,"%s%s",des,get) && (get=va_arg(args,char*)));

 return des;

Thursday, September 8, 2011

IRC - auto nickname identification

Most likely you hate retyping the identification command for your nickname each time you connect to Freenode, so why not automate the process?

If you are an mIRC user(for windows only):

  • While you're inside the client press ALT+R on your keyboard.
  • Make sure the Remote tab is selected and write the following script:
on *:connect: {
     if ($network == Freenode) nickserv identify <nickname> <password>

Replace <nickname> with your nickname and <password> with your password.

If you're using Konversation client on Linux, follow this guide for auto identification.

P.S I also advice you to join #freenode and ask one of the staff to cloak your hostname.

What do I mean? Everytime you connect to Freenode and join a channel, anybody can perform a /whois on you which would reveal your hostname/IP. For security reasons it is a good idea to have your hostname hidden while being connected to the network.

Have fun!


If you're not a windows user then TortoiseSVN is not an option for you. Consider using SVN plug-ins designed for Eclipse and Netbeans IDE.

I was going to write a tutorial on installing and using the plug-ins, but then I realized that there's no point in doing so, since there are plenty of them that exist on the web. A tutorial on installing and using Netbeans plugin can be found here. The one for Eclipse is here.

Good luck!