Hoaxblog.com
Pages:
Categories:
- Apache (6)
- backup (1)
- cache (2)
- Cpanel/WHM (11)
- ddos (1)
- exam (1)
- file hosting (2)
- General (11)
- Hosting (1)
- It’s me (2)
- linux (1)
- Linux Shell (14)
- Make Money Online (2)
- Mysql (2)
- mysqldump (1)
- php (1)
- Programming (3)
- proxy (1)
- Reseller (1)
- SEO (1)
- Servers (21)
- VPN (1)
- Windows (6)
- wordpress (1)
Blogroll
Meta:
Archive for April, 2007
04 19th, 2007
There is no standard library files in C Programming which can do complex number calculations. According to bionomial theoram there can be Complex and Real roots. But as C doesn’t bother with Complex numbers so, we need to use real number canculation to get the complex root at a+bi form.
Here is a short example what i have done:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #include <stdio.h> #include <math.h> #include <conio.h> void main() { double a,b,c,d,e,f,g; clrscr(); printf("Please type the numbers"); scanf("%lf%lf%lf",&a,&b,&c); d=(b*b)-(4*a*c); if (d>=0) { if (d==0) { printf("It has one real root\n"); e=(-b+sqrt(d))/(2*a); printf("Here is the root: %.2lf\n",e); } else { printf("It has real roots\n"); e=(-b+sqrt(d))/(2*a); printf("First Real Root: %.2lf\n",e); e=(-b-sqrt(d))/(2*a); printf("Second Real Root: %.2lf\n",e); } } else { printf("It has complex roots\n"); f=-d; e=(-b/(2*a)); g=(sqrt(f)/(2*a)); printf("First Complex Root: %.2lf+%.2lfi\n",e,g); printf("Second Complex Root: %.2lf-%.2lfi\n",e,g); } getch(); } |
If you enter some value for this programme like 1 3 1 for a,b and c according to a Quadratic or Bionomial Equation then the result will be with two real number outputs. If you enter 1 2 1 for a,b and c then the result will be one real number output as at that time both roots will be equal. And if you enter 1 1 1 then the result will be with two complex numbers.
Happy Coding! ![]()
04 14th, 2007
Today my brother told me that “Is there any way to block a referer from the whole server?” I knew that there are two ways to do. But the most easiest way to do that is using mod_security. But the fun here is, why should someone will block a referer? Its because sometimes referer is gold and sometimes spam. There were some referer sites who were doing spam on his web proxy sites by clicking on the ads. Unfortunately google also warned them as they were using Adsense. You can easily find some footprints of these spammers by checking your referer stats.
Here is a sample code with which you can block a referer who is looking like a spammer or autosurf programme to you. Suppose you want to block a referer named casino.com, then just enter the following line in your mod_sec configuration file:
1 | SecFilterSelective HTTP_REFERER "casino.com" |
If you want to block any referers containing casino word then you need to use the following rule:
1 | SecFilterSelective HTTP_REFERER "casino" |
Again if you want to block multiple words, then you may declare multiple rules with different SecFilterSelective Rule, or may define all in one like this: Suppose you are blocking any keyword with casino or poket:
1 | SecFilterSelective HTTP_REFERER "(casino|poker)" |
Here you need to note, this way is only usable if you are having the root access. Cause mod_sec configuration file access aren’ given to the users
So Have fun with blocking all spammy referers and autosurfers.
04 13th, 2007
Today i was trying to figure a programme which will show the ASCII numbers for different characters. It is really a simple code, but really handy. Lets have a look into the code first:
1 2 3 4 5 6 7 8 9 10 | #include <stdio.h> #include <conio.h> void main() { unsigned char a; for(a=32;a<128;a++) printf("%3d = ā%cā\t",a,a); getch(); } |
Here what is happening is we are startig a look from 32 and ending at 127 as we already know ASCII Numbers ranged from 32-127 and all are serialed, so what i have done is only executed all the equivalent character with the specific number. And definitely now the code has become a simple programme which will display some useful informations for you ![]()
04 13th, 2007
I didn’t work with C before. I have a good experience with php and mysql definitely. But for my course intention, now i m in need to get into C :). Today i was trying to figure out a calculator with some arithmatic operators and conditionals. It is possible to use some math operation to make a full featured cool calculator, but as i said, i have made a simple calculator here with some basic functions.
04 13th, 2007
I was thinking all the time to start a blog of my own. Unfortunately for a lot of days, i didn’t get enough time for starting my own blog. It might looks freaky, but its true
. Although, now i have started it and thinking to continue it for a long time. So just have fun with Hoax ![]()