User Profile

Collapse

Profile Sidebar

Collapse
vermarajeev
vermarajeev
Last Activity: Mar 18 '08, 12:11 PM
Joined: Aug 9 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • vermarajeev
    replied to Displaying ASCII values
    in Ruby
    Homework, absolutely no. Why do you think that could be a homework? I come from a C++ background and learning Ruby. The best way to learn any language is to play with it. I want to know how do I display the ASCII value of a char using the '?'. By the way how do you declare a character in Ruby?...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    replied to Displaying ASCII values
    in Ruby
    But I need to use '?' to display the ASCII values of the characters....
    See more | Go to post

    Leave a comment:


  • vermarajeev
    started a topic Displaying ASCII values
    in Ruby

    Displaying ASCII values

    Hello All,
    How do I display ASCII values from A..Z?
    I tried the following but get some compiler error:

    Code:
    def DisplayAscii()
    	for index in 'A'..'Z' do
    		puts ?index
    	end	
    end
    Please help...
    See more | Go to post

  • vermarajeev
    started a topic What is happening in the following perl code?
    in Perl

    What is happening in the following perl code?

    Please explain what is happening in the following:

    my ($salt) = $$input_stream =~ /^Salted__(.{8})/s;

    What will $salt contain?
    See more | Go to post

  • vermarajeev
    started a topic Script using Crypt::CBC encryption/decryption
    in Perl

    Script using Crypt::CBC encryption/decryption

    Hello friends,

    I am new to Perl scripts.
    Please help me out....

    I am using crypt::CBC to encrypt my files...

    during decryption process it goes through the code as follows
    [CODE=perl]
    if ($header_mode eq 'salt') {
    my ($salt) = $$input_stream =~ /^Salted__(.{8})/s;
    croak "Ciphertext does not begin with a valid header for 'salt' header mode" unless defined $salt;...
    See more | Go to post
    Last edited by miller; Sep 3 '07, 05:45 PM. Reason: Code Tag and ReFormatting

  • vermarajeev
    started a topic Encrypt and decrypt
    in C

    Encrypt and decrypt

    Anyone here know how to use crypto++ library or anyone has used crypto++ library to encrypt or decrypt a file?

    Thanks
    See more | Go to post

  • vermarajeev
    started a topic C/C++ to Perl - unsiged char
    in Perl

    C/C++ to Perl - unsiged char

    How to write this in perl?

    byte pass[] = { 0xA9, 0x9B, 0xC8, 0x32, 0x56, 0x35, 0xE3, 0x03,
    0xA9, 0x9B, 0xC8, 0x32, 0x56, 0x35, 0xE3, 0x03 };

    Thanks
    See more | Go to post

  • vermarajeev
    replied to vector or list ---> confused
    in C
    Code:
       ______________________
      |___mol1____|__mol2____|         
              |            |
              |            |____________________
              |            |_1_|_2_|_3_|_.....|_72__|         
          ____|________________
          |_1_|_2_|_3_|_.....|_72__|
    Assume there are two molecules mol1, mol2.
    mol1 has allocated space for maxatoms 72, and mol2 has allocated space for...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    replied to vector or list ---> confused
    in C
    Dont you think using a vector in the above scenario is a big waste of memory though is helps me to "randomly access" the elements?

    Thanks...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    started a topic vector or list ---> confused
    in C

    vector or list ---> confused

    Hi guys,
    I know what a vector and a list is?

    I have this scenario and I want to know which will be best to use.

    I have a class called "molecule". The maximum number of atoms a molecule can hold is 72. The number of atoms vary depending on the type of molecule, it can be 4 or 10 or 1 or 50 etc etc...upto maxatoms.

    Hence, since the maximum number of atoms is fixed i.e 72, and for current...
    See more | Go to post

  • vermarajeev
    replied to copy constructor V/s assignment operator
    in C
    Awesome.:))
    Thanks
    See more | Go to post

    Leave a comment:


  • vermarajeev
    replied to perl script to crypto++
    in Perl
    Thanks,
    Please do the needful and ship it to C++ section.
    See more | Go to post

    Leave a comment:


  • vermarajeev
    replied to copy constructor V/s assignment operator
    in C
    What was that? Can you please be more clear?...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    started a topic perl script to crypto++
    in Perl

    perl script to crypto++

    Hi guys,
    I have written code to encrypt and decrypt files using perl script. Please help me to port below code to crypto++ library.

    //ENCRYPTION
    [CODE=perl]
    my $cipher = Crypt::CBC->new(
    -cipher => "Crypt::Rijndae l",
    -key => $key,
    -header => 'salt',
    );
    $cipher->start( 'encrypting' );

    while ( read( $original_file, $buffer, 1024 )...
    See more | Go to post
    Last edited by miller; Aug 23 '07, 01:55 AM. Reason: Code Tag and ReFormatting

  • vermarajeev
    replied to copy constructor V/s assignment operator
    in C
    I think this is more clearer,
    Code:
    class A
    {
       char* m_name;
       public:
             A(){ m_name = 0; }
             A(const char* n)
             {
                  m_name = new char[strlen(n)+1];
                  strcpy(m_name,n);
             }
    		 /*A& operator = (const A& obj)
    		 {
    			if( this != &obj )
    			{
    				setData(obj.m_name);
    			}
    ...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    started a topic copy constructor V/s assignment operator
    in C

    copy constructor V/s assignment operator

    Hi guys,
    I know what a copy constructor and an assignment operator is.
    I have read that in a copy constructor, deep copy () happens and in assignment operator shallow copy happens. My question is how?

    NOTE:
    deep copy-->implies duplicating an object
    shallow copy--> is a reference copy, i.e. just a pointer to a shared data block

    Code:
    class MyObject 
    {
    public:
      MyObject();
    ...
    See more | Go to post

  • vermarajeev
    started a topic binary data to a std::string
    in C

    binary data to a std::string

    How to convert a byte array to a std::string. Byte array contains bytes of data.
    See the code below. Help me to write toStdString() function defined in ByteArray class.

    Code:
    int main(int argc, char *argv[])
    {
        ByteArray byteArray;   //is an array of bytes
        ifstream ifs ( "m1_enc.ct", ios::binary );  //binary file    
        if ( !ifs.is_open () )
              {
    ...
    See more | Go to post

  • Did you try clearing the stream?
    I think the stream is corrupted.

    I dont know much about C but in C++ there is a flag called clear which resets all the flag of the stream used.
    Something like this
    Code:
    ifstream ifs("text,txt");
      if( !ifs.isopen() ) 
              return -1;
      while( !ifs.eof() ) 
       {
            //read the data 
            //check if the stream is corrupted
    ...
    See more | Go to post

    Leave a comment:


  • vermarajeev
    started a topic SMPT tag to send encrypted file
    in C

    SMPT tag to send encrypted file

    Hi guys,
    I have a plain text file. I want to encrypt and send this file via mail. I use SMTP to send the file over network. I'm able to send the file in plain text but if I encode and send it, I get some stupid data. I make use of base64 to encode the file. Here is the tags with data that I send to mail server.

    Code:
    MIME-Version: 1.0
    From: abc@gmail.com
    To: xyz@yahoo.com
    Subject: Hi
    Content-Type: multipart/mixed;
    ...
    See more | Go to post

  • vermarajeev
    started a topic SMTP tag for attaching a file

    SMTP tag for attaching a file

    Hello,
    I want to send an email via network. My requirement is to send an encrypted file via email.
    I'm able to send plain text files but if I encrypt and send it, the encrypted file is received but I'm unable to open the file from my application. I get error "incorrect password" though I have entered the correct password.

    what I did???
    1) Using my application encrypted the file using AES::CBC mode...
    See more | Go to post
    Last edited by sicarie; Jul 9 '07, 01:58 PM. Reason: Looks like an obfuscated email, but I'm not sure, so out it goes.
No activity results to display
Show More
Working...