[ create a new paste ] login | about

novatech

Name: azwan bin ali
Email:
Site/Blog: http://wan.pengganas.net
Location: malaysia
Default language:
Favorite languages: no such thing
About: nothing

Saved pastes by novatech:

Ruby, pasted on Feb 11:
1
2
3
4
5
class Straddling 
def initialize( key_text, n1, n2, n3 )
   key_text = key_text+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   key_text = key_text.upcase.split(//).uniq
   @key_text = key_text
...
view (106 lines, 17 lines of output)
Ruby, pasted on Jan 31:
1
2
3
4
5
class Straddling 
def initialize( key, n1, n2, n3 )
   key = key+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   key = key.upcase.split(//).uniq
   @key = key;@n1 = n1;@n2 = n2;@n3 = n3
...
view (102 lines, 12 lines of output)
Ruby, pasted on Jan 25:
1
2
3
4
5
def julian (year, month, day)
a = (14-month)/12
y = year+4800-a
m = (12*a)-3+month
return day + (153*m+2)/5 + (365*y) + y/4 - y/100 + y/400 - 32045
...
view (24 lines, 4 lines of output)
C, pasted on Jan 15:
1
2
3
4
5
#include <stdio.h>
#include <time.h>
int s(int i, int j, int a,int b){
  return (i == 0 || j == (b-1)) ? \
  (a*b) - (1 + i + j) : (i == (a-1) || j == 0) ?\
...
view (19 lines, 10 lines of output)
C, pasted on Jan 15:
1
2
3
4
5
#include <stdio.h>
#include <time.h>
int s(int i, int j, int a,int b){
  return (i == 0 || j == (b-1)) ? \
  (a*b) - (1 + i + j) : (i == (a-1) || j == 0) ?\
...
view (18 lines, 12 lines of output)
C++, pasted on Jan 15:
1
2
3
4
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
...
view (57 lines, 6 lines of output)
C++, pasted on Jan 15:
1
2
3
4
5
/* print list of numbers in spiral direction */
#include <iostream>
using namespace std;
int i=0,x=25,y=10,spiral[100][100];
char direction = 'r';
...
view (53 lines, 26 lines of output)
C, pasted on Jan 13:
1
2
3
4
5
/*
numeric diamond algorithm..
not sure if this is the fastest algorithm
novatech - http://wan.pengganas.net
*/
...
view (31 lines, 56 lines of output)
C, pasted on Jan 13:
1
2
3
4
5
#include <stdio.h>

int main() {
 int i,j,k,x,size = 100;
 x = sqrt(size);
...
view (20 lines, 19 lines of output)
C, pasted on Jan 12:
1
2
3
4
5
/*
 * coded by novatech
 * http://wan.pengganas.net
 * print doreamon song (modified) malay version
 * lyrics is not 100% correct because i didn't remember it
...
view (36 lines, 8 lines of output)
C++, pasted on Jan 12:
1
2
3
4
5
/*
find what is the smallest number that is evenly divisible by all of the numbers from 1 to 20?.
using LCM formula refer to http://en.wikipedia.org/wiki/Least_common_multiple
*/
#include <iostream>
...
view (21 lines, 18 lines of output)
C, pasted on Jan 12:
1
2
3
4
5
#include <stdio.h>
/* malaysia.c will print the map of
/* peninsular malaysia in ascii form
/* copyright novatech@pengganas.net
/* http://wan.pengganas.net - July 2009
...
view (17 lines, 69 lines of output)
C, pasted on Jan 12:
1
2
3
4
5
#include <stdio.h>
#include <math.h>
#define PI 3.141592654
/*
long double factorial(int n)
...
view (39 lines, 3 lines of output)