LRU and FIFO L1 Cache Implementation using C
This is a C program to demonstrate cache mechanism by simulating a cache in C. The source code can run in any C Compiler with minor modifications if required. It can run on real memory traces as input to your cache simulator. We have implemented two cache replacement policies i.e. least recently used (LRU) and First-in first-out (FIFO) replacement policies.
Generating Random Number in C/C++
C Standard Library provides two different methods to generate random numbers. They are: rand() and srand().
C Algorithms Library
This article is about a collection of common Computer Science algorithms which may be used in C projects. The C Programming Language has a much smaller Standard Library as compared to other more modern programming languages such as Java or Python. The library provides a basic set of mathematical functions, string manipulation, type conversions, and file and console-based I/O.
The “Hello, World!” Program in C
This is a simple “Hello, World!” C program to display "Hello, World!" text on the computer screen or display device. Typically, the best way to learn programming is by writing code. The first program beginners write is “Hello, World!” which is often used to illustrate...
C Implementation of Base64 Encoding and Decoding
Base64 encoding and decoding schemes are commonly used to encode binary data. Normally this is required when textual data needs to be transferred over the network or similar media and make sure that data is transferred without any modification. Base64 is commonly used in a number of applications, including email via MIME, and storing complex data in XML. This is a very simple implementation of base64 encoding and decoding in C programming language. There are number of C libraries available for encoding and decoding as well i.e. libb64, OpenSSL Base64, Apple’s Implementations, arduino-base64 etc.
JavaScript – Difference Between [] and {}
In JavaScript, we use {} braces for creating an empty object. We use [] brackets for creating an empty array. I find the Developer console in Mozilla Firefox or Google Chrome more convenient to print out any object and study the details.
C++ Wave File Writer from Text File
This C++ program is capable of turning a text file describing the notes of a piece of music into an audio file (.wav). The program reads the contents of the input file i.e. input.txt, constructs Song, Voice and Note objects describing the notes in the file, and call...
LRU and FIFO L1 Cache Implementation using C
This is a C program to demonstrate cache mechanism by simulating a cache in C. The source code can run in any C Compiler with minor modifications if required. It can run on real memory traces as input to your cache simulator. We have implemented two cache replacement policies i.e. least recently used (LRU) and First-in first-out (FIFO) replacement policies.
Vigenere Encryption and Decryption in C++
The Vigenere cipher is a method of encrypting or decrypting alphabetic text by using a series of interwoven Caesar ciphers (Caesar Shift), based on the letters of a keyword. In cryptography, Caesar shift is one of the simplest known encryption techniques. It employs a form of polyalphabetic substitution, which is using multiple substitution alphabets.
Generating Random Number in C/C++
C Standard Library provides two different methods to generate random numbers. They are: rand() and srand().
C++ Program to solve the Quadratic Equation
This program will solve quadratic equations. It accepts coefficients of a quadratic equation from the user i.e. a, b and c and displays the roots. To compile the program name it quadratic_solver.cpp then type g++ -o quadratic_solver quadratic_solver.cpp You may need to use math.h like this: #include if you are using windows C++ programming software. (I tried it without the math.h and got an “undeclared identifier” error)
C Algorithms Library
This article is about a collection of common Computer Science algorithms which may be used in C projects. The C Programming Language has a much smaller Standard Library as compared to other more modern programming languages such as Java or Python. The library provides a basic set of mathematical functions, string manipulation, type conversions, and file and console-based I/O.
C++ “Hello World” Program
Typically, the best way to learn programming is by writing code. The first program beginners write is “Hello, World!” which is often used to illustrate the syntax of a programming language. You can take a look at the list of Hello World Programs in 300 Programming Languages to see how “Hello, World!” looks like in different programming languages.
The “Hello, World!” Program in C
This is a simple “Hello, World!” C program to display "Hello, World!" text on the computer screen or display device. Typically, the best way to learn programming is by writing code. The first program beginners write is “Hello, World!” which is often used to illustrate...
C Implementation of Base64 Encoding and Decoding
Base64 encoding and decoding schemes are commonly used to encode binary data. Normally this is required when textual data needs to be transferred over the network or similar media and make sure that data is transferred without any modification. Base64 is commonly used in a number of applications, including email via MIME, and storing complex data in XML. This is a very simple implementation of base64 encoding and decoding in C programming language. There are number of C libraries available for encoding and decoding as well i.e. libb64, OpenSSL Base64, Apple’s Implementations, arduino-base64 etc.
Kruskal’s Algorithm Implementation in C
This is the implementation of Kruskal’s Algorithm in C Programming Language. This algorithm is directly based on the generic MST (Minimum Spanning Tree) algorithm. Kruskal’s algorithm is a greedy algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. It finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.
Porter’s Algorithm in C
Originally written in 1979 at Computer Laboratory, Cambridge (England), it was reprinted in 1997 in the book “Readings in Information Retrieval”. Initially it was written in BCPL language. Here is the list of implementations in other programming languages including C, Java and Pearl implementations done by author himself.
Add time using structures in C++
This is a C++ implementation of adding time using structures. A structure is a convenient tool for handling a group of logically related data items. Structure help to organize complex data is a more meaningful way. It is powerful concept that we may after need to use in our program Design.
Common Text Transformation Library
Common Text Transformation Library, CTTL for short, is a set of C++ classes and functions to understand and modify text data. The library implementation is based on STL classes and algorithms. The library provides components for creating lexical analyzers making...
Reading Files
This is a small C language program that can read a text file. The program is given file name as command parameter and it reads the file line by line. The program will prints out number of characters and words in each line. The program will also prints out the number...
C Program of Library Management System
This is a C program of Library Management System by which a librarian can operate a simple library. User can add multiple students, update their records and issue multiple books. This C Program shows different information about library including numbers of books and...
Java Program to demonstrate of Linked List
This is a very simple implementation of linked list in java programming language. Very nice and well commented java source code for beginners.
Java Program to show Stack Implementation
This is a simple Java program to demonstrate Stack data structure implementation. An object of type IntStack is a stack of real numbers, with the standard stack operations push(int N), pop(), and isEmpty(). A makeEmpty() operation is also provided to remove all items...
ASP Program to validate email address
This is a simple ASP Program to validate email address. The IsValidEmail() function checks for a valid email and returns true if the email address is a valid email otherwise it returns false if the email address isn't proper syntax. The code is well commented and...
C Program to calculate Factorial of Number
This C program calculates the the factorial of an integer number entered by the user. The function uses for loop to calculate the factorial and returns the number. Program terminates if a non integer number is entered. This C language program uses for loop in just a...
JavaScript Program to show Clock Type
This is a really neat little script that can display the current time in "Military Time" or "12 Hour Time" with the push of a button. Give it a try, it's neat!
JavaScript Program to show Date and Time Stamp
This is a simple JavaScript Program to show Date and Time Stamp. With this script, you can have the date and time the page was loaded 'stamped' to the page. This would make a wonderful header or footer for any web page.