Archive

Posts Tagged ‘digits’

Osticket Ticket Number Customization

December 7th, 2011 Comments off

Hi,

I am a complete newbee for PHP and MySQL. I would need your help for change in the ticketing number schema of osticket. I want the ticket number to be of 11 digits for ex. 20111207001. In this the first four digits are the year, next two digits are the month, the next two digits are day. The last three digits are the numbers that would increment every time a ticket is opened.

I would like the date of the system be used here, for the first eight digits of the ticket. These eight digits …

Desktop Windows Application Renaming Files Modifing Text

April 22nd, 2011 Comments off

I need a desktop application that will look into a directory and sub directorys on my pc. The app will rename the files it finds based on the name of the subfolder.

Once this is done we need to collect all the files in the sub fiolders and place them on a master folder

Next we need to look at each file, look at the first 6 digits of each files and match that with the line items in a master text file

To be considered for this job, you need to provide examples of previous completed projects similar to this one.

Once you find the line item (by matching the first 6 digits in the name to the last 6 digits of the text line item) you beed to modify the master text file

See attahced pdf for more information

C++ Validate Isbn

March 10th, 2010 Comments off

Write a C++ program that will validate ISBNs. For each ISBN, the program should
state if it is a valid or invalid ISBN, along with the appropriate error message,
if invalid. The ISBN numbers are entered by user and your program should run as
long as the user enters ISBN numbers to validate. Exit when user enters “q” or
“Q”.

Java Program: Simple File Sort

December 8th, 2009 Comments off

Overview
An input file will be provided. The application should generate the appropriate output in a new file(s). Please create is as project that I can load into eclipse.

Please provide me with an executable. After testing from my end, payment will be made for source code.

Input file
Type: CSV
Format: Field 1, Field 2, Field 3, Field 4
Int. int, string, int

Field 1 can be anywhere between 1 and 10 digits. If is greater than 10 digits, display error and quit.
Field two will be 11 digits. Run check to see that it is exactly 11 digits, otherwise, display error and quit.

Output
File name will be a Field 3

Categories: Java Tags: , , , , , ,

Validation Program

December 1st, 2009 Comments off

Must be written in C++ as an “empty project”.

Program that will validate ISBNs. For each ISBN, the program should state if it is a valid or invalid ISBN, along with the appropriate error message, if invalid. The ISBN numbers are entered by user and your program should run as long as the user enters ISBN numbers to validate. Exit when user enters “q” or “Q”.

ISBN background:
An ISBN (International Standard Book Number) identifies a unique publication. An ISBN is ten digits. The first nine digits must be decimal digits (0…9). The tenth digit can be either a decimal digit or the letter X. Three single dashes may be between any of the characters. (i.e., an ISBN number may either have no dashes or exactly three dashes). Also, an ISBN must not begin or end with a dash, and sequential dashes are not allowed.

Some example ISBNs:
0-201-88337-6
0-13-117334-0
0821211315 (no dashes is ok)
1-57231-866-X

The last character of an ISBN number is a checksum. The checksum is determined from the first 9 digits; it is computed by taking modulo 11 (the remainder after dividing by 11) of the sum of each digit multiplied by its position in the ISBN. The letter X corresponds to a value of 10.

Here are two ISBNs and the calculations that show how the check sum is determined:

0-201-88337-6:(0*1 + 2*2 + 0*3 + 1*4 + 8*5 + 8*6 + 3*7 + 3*8 + 7*9)mod 11=6

1-57231-866-X:(1*1 + 5*2 + 7*3 + 2*4 + 3*5 + 1*6 + 8*7 + 6*8 + 6*9)mod 11=10(X)

For more info, check out: www.isbn.org.

Some invalid ISBNs:
0-201-8A337-6 (bad digit)
0-201-88337-63 (too many digits)
0-201-88-337-6 (too many dashes)
0-201883376 (not enough dashes)
0-201-88337-3 (wrong check sum)
-013-117334-0 (beginning or ending dash)
157231–866-X (sequential dashes)
013-1134-0 (too few digits)

Categories: C/C++ Tags: , , , , , ,

Vxml Project

October 27th, 2009 Comments off

Hello,

I need a script in vxml and php interacting with mysql database in order to do the following :

When the user calls my vxml file using phone (plateform will be given).

1. Script will detect his phone number
2. If phone number is not recognisable, play voice message “A” and hang up
3. If phone number is recongisable and it has more or less than 10 digits, play voice message “B” and hang-up
4. If phone number is recognisable and has 10 digits, move to point 5.
5. Check if phone number is not already registered into a database (database1>table1>field1)
6. If number is already in database, play voice message “C” and hang up
7. If number is not already in database, ask user to type in 4 digit password.
8. Insert into database some info (phone number and prompted password 4 digits)
9. If all data was inserted with no mysql error, then transfer call to another number.

Please quote after you’re sure that you understand, it’s easy, but you’ve got to know this stuff :)

Please ask any questions in the PMB
Thank you

G

Categories: MySQL, PHP, XML Tags: , , , , , ,

Mid-square Hashing Program

July 14th, 2009 Comments off

1) The random access file program of section 8.8 uses the division-remainder method to
hash a record’s key to its relative address in the file. one competing method, known as mid-square hashing, works as follows: given a key with N digits, to compute a relative address with K digits, we square the key and then extract the middle K digits from the squared key. for example, if N is 9 and K is 4, we have
sample key: 200120472
key squared: 40048203313502784
middle 4 digits: 3313

revise the program of section 8.8 so that it uses mid-square hashing.

sec 8.8) The BNPL (“Borrow Now, Pay Later”) Credit Bureau maintains a master file that lists, for each of its customers, the social security number, name, current principal that the customer owes, and his or her credit limit. the master file might be
222-11-33-49 Nancy Zoe 51.20 5000.00
333-22-1265 Willard Smith 2341.50 4500.00

The BNPL Credit Bureau also maintains a transaction file that tracks its customers’ loans and payments. each record in this file lists the customer’s social security number, together with the transaction’s amount and its date. A positive number indicates a payment, and a negative number indicates a loan. for example, the entries
333-22-1265 +25.00 9-7-96
222-11-3349 -1273.00 9-18-96
333-22-1265 -1350.50 9-18-96

mean that customer 333-22-1265 paid back $25.00 on 9-7-96 and borrowed $1,350.50 on 9-18-96 and that customer 222-11-3349 borrowed $1,273.00 on 9-18-96. once a month the BNPL Credit Bureau updates its mater file by processing entries in the transaction file. Assume that the master file entries are sorted by social security number but that the transaction file is not sorted. write one program that creates a transaction file, another that sorts the transaction file, and a third that updates the master file.

Program Using Queues In C

July 7th, 2009 Comments off

The Problem
A university lacks a credible grocery store on campus. After a year of getting lousy over-priced food in the convenience store in the Student Union, you and all of your friends are frustrated. One of your friends majoring in business comes up with the brilliant idea of opening a grocery store on campus. But, they need your help to decide if their idea is viable or not. Your job will be to run various simulations of customers in line.

The model for the store is as follows:

Normally, there will be three lines in operation or customers to buy their groceries. Each line will have a capacity of 8 customers. The first line (line A) will only be for customers with 10 or fewer items. The other two lines (line B and C) will be for all customers. When a customer is ready to check out, here is how they decide what line to go to:

If the customer has 10 or fewer items and the

Large Integer

May 31st, 2009 Comments off

The Problem

The unsigned int type in C requires 4 bytes of memory storage. With 4 bytes we can store integers as large as 232-1; but what if we need bigger integers, for example ones having hundreds of digits? If we want to do arithmetic with such very large numbers we cannot simply use the unsigned data type. One way of dealing with this is to use a different storage structure for integers, such as an array of digits. We can represent an integer as an array of digits, where each digit is stored in a different array index. Since the integers are allowed to be as large as we like, a dynamically-sized array will prevent the possibility of overflows in representation. However we need new functions to add, subtract, compare, read and write these very large integers.

Write a program that will manipulate such arbitrarily large integers. Each integer should be represented as an array of digits, where the least significant digit is stored in index 0. Your program should we able to read in a string of digits and create a struct that stores the big integer.

Your program should store each decimal digit (0-9) in a separate array element. In order to perform addition and subtraction more easily, it is better to store the digits in the array in the reverse order. For instance, the value 1234567890 would be stored as:

index 0 1 2 3 4 5 6 7 8 9
array 0 9 8 7 6 5 4 3 2 1

Note: Although this seems counter-intuitive, it makes the code slightly easier, because in all standard mathematical operations, we start with the least significant digits. It also makes sense that the digit at the place 10i is stored in index i.

Your program should include the following functions:

Programming Project 3726965

May 24th, 2009 Comments off

1) The random access file program of section 8.8 uses the division-remainder method to
hash a record’s key to its relative address in the file. one competing method, known as mid-square hashing, works as follows: given a key with N digits, to compute a relative address with K digits, we square the key and then extract the middle K digits from the squared key. for example, if N is 9 and K is 4, we have
sample key: 200120472
key squared: 40048203313502784
middle 4 digits: 3313

revise the program of section 8.8 so that it uses mid-square hashing.

sec 8.8) The BNPL (“Borrow Now, Pay Later”) Credit Bureau maintains a master file that lists, for each of its customers, the social security number, name, current principal that the customer owes, and his or her credit limit. the master file might be
222-11-33-49 Nancy Zoe 51.20 5000.00
333-22-1265 Willard Smith 2341.50 4500.00

The BNPL Credit Bureau also maintains a transaction file that tracks its customers’ loans and payments. each record in this file lists the customer’s social security number, together with the transaction’s amount and its date. A positive number indicates a payment, and a negative number indicates a loan. for example, the entries
333-22-1265 +25.00 9-7-96
222-11-3349 -1273.00 9-18-96
333-22-1265 -1350.50 9-18-96

mean that customer 333-22-1265 paid back $25.00 on 9-7-96 and borrowed $1,350.50 on 9-18-96 and that customer 222-11-3349 borrowed $1,273.00 on 9-18-96. once a month the BNPL Credit Bureau updates its mater file by processing entries in the transaction file. Assume that the master file entries are sorted by social security number but that the transaction file is not sorted. write one program that creates a transaction file, another that sorts the transaction file, and a third that updates the master file.

Isbn Validation

May 6th, 2009 Comments off

Need a program that validates both ISBN-10 and ISBN-13 from user input. Must follow the instruction below, its an assignment for a class and I have a family emergency I have to go out of town for and don’t know how else to get it done. The instructions are as follows:

INSTRUCTIONS

Write a program which asks for an ISBN number, then strips the
last digit (saving it) then re-calculates that last (check) digit from
the rest of the number. If they match, the function will validate the
ISBN number, otherwise the function will sound an alarm. See the bottom of this file for some sample runs.

Specific directions:

Create a function:

bool chk_isbn(string)

which receives a String Object containing user keyboard input. If the
user is in hir right mind and the keyboard is cooperating, the string
SHOULD contain a valid ISBN (International Standard Book Number).
The chk_isbn() function should parse the number, and calculate the
check digit from the first 10 data characters, ignoring dashes, spaces,and all non-digits in the first 9 columns. Once it has calculated the check digit, it should compare its answer with the check digit in the last column of the String Object. If they agree, the function should return true, otherwise it should return false.

Include a main() function which exercises the chk_isbn()
function, accepting command-line or interactive input from
the user. CLEAN UP THE USER INPUT so that what you pass to the
chk_isbn() function is ONLY a string of digits, no hyphens
or any other non-digit characters.

Your program will be tested against valid ISBNs from the real world,
and invalid ones. It should give the proper output in all cases.

Samples of VALID input:

“0-321-40939-6″
“ISBN 0-321-40939-6″
“ISBN 0 321 40939 6″
“0.321.40939.6″
“0321409396″

See the situation here? We are accepting input from USERS, and about
all we can demand from a USER is that s/he gets the digits right.
They will use any random character for the separator, or none at all,
so we have to write our code to cope. If a user can break our software, or get it to emit the wrong answer, we lose.

So your first task will be to “condition” the input. Lucky for
you, you’re taking this into a string object, and strings have the
string.erase(start,length) method to make it easy to “remove” characters from the string which don’t belong there using something like:

for ( int x = 0 ; x < 10 ; x++)
if (!isdigit(stringvar[x])
stringvar.erase(x, 1) ;

We ALWAYS ALWAYS ALWAYS have our USERS enter their input into
CHARACTER STRINGS. Then, if we are expecting a number from
them, we can examine and “validate” user input before risking
our program’s health by computing with unknown input.

USERS take a little management, and the programmer who learns
this Grate Trooth early will avoid much heayd hoortingz.

Here is some background information on ISBNs, which
illustrates how often even “learned” posters don’t
validate their factoids:

“ISBN is the abbreviation for the International Standard Book
Number. ISBN numbers are 10 digits in length. In an ISBN of
the form X-XX-XXXXXX-X:

-The first block of digits on the left represents the language
of the book (0 is used to represent English). This block is
usually 1 digit in length.

-The second block of digits represents the publisher. This
block is usually 2 or 3 digits in length

-The third block of digits represents is the number assigned
to the book by the publishing company. This is usually 5 or
6 digits in length.

-The fourth block consists of the check digit.”
(from: http://www.cs.queensu.ca/~bradbury/checkdigit/isbncheck.htm)

“An International Standard Book Number consists of 10 characters of information, organized into 4 groups with adjacent groups separated by a dash character.

The first group identifies the continent of publication,
the second group identifies the publisher,
the third group is the book number that the publisher assigns and
the last group with one character is a check digit determined by an algorithm.

Each non dash character, except possibly the last is a digit.

The last is either a digit or the character X for ten.

The value of the check digit comes from the following algorithm.

The ISBN is a number composed of digits 0-9 and X in
either 10 or 13 columns. The LAST COLUMN contains a
“check digit” which is computed from the other 9 or 12
digits. It is computed in a way that will reveal if
numbers are transposed (swapped) by careless humans.

Initialize sum to zero.
for i from 1 to 9(length of number string)
Calculate C = the number in COLUMN number i * COLUMN
Increase the sum by the product of the COLUMN and the value
of the digit in column i of the book number.
Reduce the sum mod 11.
(Replace the sum by its remainder when you divide the sum by 11.)
The value of the check digit C equals 11 – sum mod 11.
If C is 10, then C = the character X>

Example:
I will write down an arbitrary 9 digit number and compute its check digit.
digits = 918273645

Simulate the algorithm.

i digit[ i ] sum
0
1 9 0 + 9 * ( 11 – 1 ) = 90 mod 11 = 2
2 1 2 + 1 * ( 11 – 2 ) = 2 + 9 mod 11 = 11 mod 11 = 0
3 8 0 + 8 * ( 11 – 3 ) = 0 + 64 mod 11 = 64 mod 11 = 9
4 2 9 + 2 * ( 11 – 4 ) = 9 + 14 mod 11 = 23 mod 11 = 1
5 7 1 + 7 * ( 11 – 5 ) = 1 + 42 mod 11 = 43 mod 11 = 10
6 3 10 + 3 * ( 11 – 6 ) = 10 + 15 mod 11 = 25 mod 11 = 3
7 6 3 + 6 * ( 11 – 7 ) = 3 + 24 mod 11 = 27 mod 11 = 5
8 4 5 + 4 * ( 11 – 8 ) = 5 + 12 mod 11 = 17 mod 11 = 6
9 5 6 + 5 * ( 11 – 9 ) = 6 = 10 mod 11 = 16 mod 11 = 5

C = 11 – 5 mod 11 = 6 “

from: http://www.cbu.edu/~yanushka/j0/n.3

Extra Credit: on your own, research and impliment ISBN-13 logic,
and write your program so that it can process either ISBN-10 or
ISBN-13 without any special input from the user other than the number
itself.

Sample data I will use to test your programs:

0-13-615250-3
0-13-615250-8
0-13-613950-X
0-13-615250-X
–0—13-6–15–250-3
0–13—6 152 50.3

…and similar.

Here Are Some Sample Runs:

Script started on Mon 13 Apr 2009 07:25:32 PM PDT

ISBN: 0-13-615-25-8
0-13-615-250-8
0-13-615-250-8
013-615-250-8
013-615-250-8
013-615-250-8
013615-250-8
013615-250-8
013615-250-8
013615-250-8
013615250-8
013615250-8
013615250-8
013615250-8
0136152508
Stripped checkdigit: 8
checking: 013615250
sum: 124
MODDED sum: 3
Original checkdigit: 8 newly calculated checkdigit: 3
ERROR: BAD ISBN CHECKDIGIT!!
: Success
Updated/recalculated ISBN: 0136152503

ISBN: 0-13-615-250-3
0-13-615-250-3
0-13-615-250-3
013-615-250-3
013-615-250-3
013-615-250-3
013615-250-3
013615-250-3
013615-250-3
013615-250-3
013615250-3
013615250-3
013615250-3
013615250-3
0136152503
Stripped checkdigit: 3
checking: 013615250
sum: 124
MODDED sum: 3
Original checkdigit: 3 newly calculated checkdigit: 3
Updated/recalculated ISBN: 0136152503

ISBN: –0–13–615-250-3
–0–13–615-250-3
-0–13–615-250-3
0–13–615-250-3
0–13–615-250-3
0-13–615-250-3
013–615-250-3
013–615-250-3
013–615-250-3
013-615-250-3
013615-250-3
013615-250-3
013615-250-3
013615-250-3
013615250-3
013615250-3
013615250-3
013615250-3
0136152503
Stripped checkdigit: 3
checking: 013615250
sum: 124
MODDED sum: 3
Original checkdigit: 3 newly calculated checkdigit: 3
Updated/recalculated ISBN: 0136152503
ISBN: 9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
9780814408902
Stripped checkdigit: 2
checking: 978081440890
sum: 332
MODDED sum: 2
Original checkdigit: 2 newly calculated checkdigit: 2
Updated/recalculated ISBN: 9780814408902
ISBN: 9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408–90-2
9780814408-90-2
978081440890-2
978081440890-2
978081440890-2
9780814408902
Stripped checkdigit: 2
checking: 978081440890
sum: 332
MODDED sum: 2
Original checkdigit: 2 newly calculated checkdigit: 2
Updated/recalculated ISBN: 9780814408902

Categories: C/C++ Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Appt Scheduler By Zip Code

April 9th, 2009 Comments off

Our small business involves visiting patients in their homes. We need a scheduler that will organize the patients homes based on zip codes, specifically the last 4 digits of the zip code, since any one zip code can be quite large and we need to group patients who are in close proximity to one another. This could involve grouping patients together who are on the border of one zip code, but can also be in close proximity to another zip code. That is why the last four digits should be the best differentiator. We would like to have a simple tool that allows the scheduler to schedule appointments using the following sequence: The software needs to enable scheduling appointments taking the customer’s location into account. 1)Client receives a call from her customer requesting an appointment 2)Client asks customer for the home address AND zip code of the home where she will have to go & service needed 3)Client enters address AND zip code in screen to determine the customer’s complete zip code with unique 4 digit identifier. 3a) Complete zip code with Unique 4 digit identifier is displayed on screen based on information entered. 4)Computer displays all appointments for today and beyond that are in the same or within close proximity of the zip code with unique 4 digit identifier. Appointments are arranged in date and then time sequence 5)Client agrees with the customer on an acceptable day and time to schedule the new appointment 6)Client adds the new appointment information into the database Design Features: Zones – Each zip code with it’s unique last four digits has a unique identifier. Appointments -Appointments are by date and then by time. Each appointment needs to contain the following information: -Customer Name (Entered by Client) -Zip code with unique last four digits -Appointment date (Entered by Client) -Appointment start time (Entered by Client) -Appointment Service: This is duration of time based on the type of service Needed (

Bear