Saturday, 25 February 2017

Formula Behind log Calculation


1. log(y)  means that
                                    base^(x) = y
 For example :
                         For example, the base 10 logarithm of 1000 is 3, as 10 to the        power 3 is 1000(1000 = 10 × 10 × 10 = 103); 10 is used as a factor three times.





2.  logxy = logY/logX
1+x1x1+x1x

Thursday, 23 February 2017

Reading All ASCII(with Extended 0-255) Character to a Binary file Using C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ifstream myfile ("compress.bin", ios::binary);
    for(int i=0; i<256; i++)
    {
        unsigned char c ;
        myfile.seekg(i);//position of the character in the file
        myfile.read ((char*)&c, sizeof (c));
       cout << c;
    }
    cout << endl;
    return 0;

}

Writing All ASCII(with Extended 0-255) Character to a Binary file Using C++


The reason I use here binary file because using binary file we can  both read and write easily




#include<bits/stdc++.h>
using namespace std;
int main ()
{
    string s ="";
    fstream file("compress.bin", ios:: binary | ios::in | ios::out | ios:: trunc);
    for(int i= 0; i<256; i++)
    {
        char  c=i;
        file.write((char *)&c,sizeof(c));

    }
}

Saturday, 4 February 2017

Writing and Reading all ASCII character from a file(Binary) using c++



#include<bits/stdc++.h>
using namespace std;
int main ()
{
    for(int i=0; i<256; i++)
    {
        fstream file("compress.bin", ios:: binary | ios::in | ios::out | ios:: trunc);
        char  c=i;
        file.write((char *)&c,sizeof(c));
        file.seekg(0);
        unsigned char p;
        file.read((char *)&p,sizeof(c));
        cout << p ;
        printf(" %d\n",p);
    }
}

ট্রিগার এর মাধ্যমে ডাটা ইনসার্ট - insert data using Database Trigger (Mysql)

সর্বপ্রথম আমরা প্রবলেমটা বুঝিঃ আমি একটা টেবিলের একটা কলামের ভ্যালুর উপর ডিপেন্ড করে আরেকটা কলামে ডাটা insert করব । এই কাজটা ট্রি...