horspool string matching using C#

using System;
using System.Collections;

namespace ConsoleApplication1 {
	class Program {
		static ArrayList generateShiftTable(string needle) {
			ArrayList shiftTable = new ArrayList();
			for (int i = 0; i < 27; i++) {
				shiftTable.Add(needle.Length);
			}
			// KINGMICKEY
			// E = 1 K = 2 C = 3 I = 4 dst
			// E= needle[needle.length - 2] , 3 , 4 , dst
			// convert E to ascii - 65 = 4
			// array ke 4 = 1.
			// array ke 10 = 2
			// array ke 2 = 3 dst

			for (int i = 1; i < needle.Length; i++) {
				Int32 temp = More >

draft code deteksi spasi ganda

UPDATE : versi 0.2

// sote.c
// deteksi spasi ganda
// by Erius, 2009
// ver 0.2

// functionality:
// - input sebanyak jumlah karakter yang ditentukan sebelumnya.
// - menghitung jumlah jeda dan banyak karakter spasi per jeda.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

#define FALLBACK 254

int deteksi_spasi (char *string) {
	int i = 0;
	int j = 0;
	while (string[i] != '\0' && i < FALLBACK) {
		i++;
	}
	int num_char = i;	// jumlah karakter yang actually diinput
	int spasi = 0;	// penghitungan spasi per jeda

	// jeda kan ada banyak dalam sebuah kalimat. More >

The Real Cause of Swine Flu

Through StumbleUpon.

Protected: My xenogears final team

This post is password protected. To view it please enter your password below:

Error message

Setting up Canon Pixma iP1880 in OpenSUSE 11.1 (KDE 4.1.3)

  1. Download the generic RPM from Canon site.
  2. Download the specific RPM from Canon site.
  3. Optional: Download the printing guide from Canon site.
  4. Connect the printer, and turn it on.
  5. Install the generic RPM. If you got error, go to Yast > Software > software management, and install gtk (yes the old gtk). Be ready with online repositories, DVD repositories, or your installation DVD. Then retry installing the generic RPM.
  6. Try installing the specific RPM. I got error like this.
  7. You shouldn’t have the cnijfilter-common error because we have installed it. In this step, all I did was installing libpng3 (yes old libpng), libxml (yes old libxml). If you More >
Opensuse.org is owned by Batman

Opensuse.org is owned by Batman

Opensuse.org is owned by Batman

Now we know that IRL Batman works at Novell Corporation instead of Wayne Corporation.

And he works at Provo, UT, not Gotham City.

source

polymorphism?

#include <iostream>
using namespace std;

class motor {
public:
	motor () {
		cout<<"Motor"<<endl;
	}
	void namaku () {
		cout<<"Motor"<<endl;
	}
};

class yamaha : public motor {
public:
	yamaha () {
		cout<<"Yamaha"<<endl;
	}
		void namaku () {
		cout<<"yamaha"<<endl;
	}
};

class suzuki : public motor {
public:
	suzuki () {
		cout<<"suzuki"<<endl;
	}
		void namaku () {
		cout<<"suzuki"<<endl;
	}
};

class jupiter : public yamaha {
public:
	jupiter () {
		cout<<"jupiter"<<endl;
	}
		void namaku () {
		cout<<"jupiter"<<endl;
	}
};

class shogun : public suzuki {
public:
	shogun () {
		cout<<"shogun"<<endl;
	}
		void namaku () {
		cout<<"shogun"<<endl;
	}
};

int main () More >

Delete file

Cpp code for various file operations, including deleting file contents

#include <iostream>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <string>

using namespace std;
ifstream infile;
ofstream errorlog;

int tulis (int mode) {
	infile.close();
	ofstream outfile;
	if (mode == 1) {
		outfile.open("into.dat",ios::app);
	} else {
		outfile.open("into.dat",ios::out);
	}
	cout<<"Silakan masukkan nim, nama, jurusan, ipk"<<endl;
	cout<<"Tekan ctrl z utk selesai" << endl;
	char nim[20];
	char nama[30];
	char jurusan[30];
	double ipk;
	while (cin>>nim>>nama>>jurusan>>ipk) {
		outfile<<nim<<' '<<nama<<' '<<jurusan<<' '<<ipk<<endl;
		cout<<"> ";
	}
	cin.clear();
	infile.open("into.dat",ios::in);
	return 1;
}

int search () {
	infile.seekg(0,ios::beg);
	char nim[20];
	char nama[30];
	char jurusan[30];
	double ipk;
	int match;
	cout<<"Search berdasarkan:";
	cout<<"1. nim"<<endl<<"2.nama"<<endl<<"3.jurusan"<<endl<<"4.ipk"<<endl; More >

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!