Question about Operating Systems

2 Answers

Pattern matching Input Specification: -------------------- 1. The first line of input contains the Master String. 2. The second line of input contains the Scan String. Both Master String and Scan String will not be greater than 80 characters in length. Sample Input and Output: ------------------------ Input: abcd23Abdaaaa4g9 .*Abd. { dot-star-A-b-d-dot } Output: 10 Input: aaadaaabbbb129cd a.*d { a-dot-star-d } Output: 16 Input: 0AbC1dEf2GhI3jKl4MnO5pQr6StU7vWx8Yz9 3JkL4 { 3-J-k-L-4 } Output Specification: --------------------- Your program must output the length of the longest substring matched. If there is no match, then the length of the matched substring is zero.

Posted by on

2 Answers

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

.* means 0 or more occurences of any char
. Means exactly one occurence of any char
Then the matching patterns char are counted

Posted on Sep 10, 2011

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Brigadier General:

    An expert that has over 10,000 points.

  • Master
  • 10,406 Answers

Nice try!

It's been almost 15 months since you asked your question.

If nobody has helped you with your "homework" assignment,
you probably scored a "zero" on your computer-programming course,
and probably no longer need an answer to your problem.

Posted on Dec 05, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to multiply matrix on fx-991ES calculator?


hi..

Its very easy to do matrix operations in FX 991ES
This calculator can operate up to three Matrices at a time, namely Matrix A (Mat A), Matrix B (MAT B), Matrix C(MAT C).

  1. First to do, is set the calculator in MATRIX Mode
    Its Easy
    Press MODE button and press 6.
    Your Display will show indication of MAT on upper side of screen to show now calculator is in MATRIX Mode

  2. Now we need to Define matrices and set its dimensions.
    This product supports matrix of order up to 3x3. That is you can operate matrix of No. of rows=3 and No. of columns=3
    To input matrix, Press SHIFT and then 4. This will Pop up Menu for Matrix. Now press 1
    Your screen will show as this,
    nightflare_14.png
    MAT A will be your First Matrix and MAT B will be your Second Matrix and so on.
    Press 1 , 2 , or 3 to select Matrix A , B, or C.
    here I will Proceed with Matrix A, so I press Numerical 1 Key

  3. Next screen will ask you about the size of matrix.

    nightflare_15.png
    Press UP or DOWN Keys to view options.
    nightflare_16.png
    Press Corresponding Numerical keys to select corresponding order.

  4. On Next Screen , enter values on each positions
    nightflare_17.png
    Press UP, DOWN, LEFT, RIGHT Keys to move around in matrix and specify each element.

  5. Now we inputed Details about Matrix A. If you want to specify other matrices (MATRIX B, MATRIX C) repeat STEPS 2 To STEP 4


  6. After Specifying required Matrices, we can tell calculator to do operations with them.

    Press SHIFT and then 4 and then It will show a menu contains
    nightflare_18.png

  7. For example, i need to multiply Matrix A with Matrix B, i'll enter as

    SHIFT + 4 + 3 to Input Matrix A

    X
    to enter operator (Here multiplication, You enter + - x / for corresponding arithmetic operations )

    SHIFT + 4 + 4 to Input Matrix B

    = To show Result
    Press UP DOWN LEFT RIGHT Keys to view extra fields, if any.


Hope this will help you.

have a good time with Casio FX 991ES

Mar 26, 2011 | Operating Systems

1 Answer

Error occured in toshiba satelite 1300 in the hard disk code 0101340000


Error code 0101340000, may be due to hardware issues

1. Faulty hard drive or defective memory
2. Damaged recovery media(CD) or faulty CD ROM

OR

Boot system corrupted,
This issue may occur if one or more of the following conditions are true:
The basic input/output system (BIOS) does not detect the hard disk.
The hard disk is damaged.
Sector 0 of the physical hard disk drive has an incorrect or malformed master boot record (MBR).
Note Some third-party programs or disk corruption can damage an MBR.
An incompatible partition is marked as Active.
A partition that contains the MBR is no longer active.

Hope it helps.

Aug 12, 2010 | Operating Systems

1 Answer

I want to pair my laptop (lenovo N100) to my mobile (samsung corby tv) i could not find the pin ? please give me the steps


Does your laptop have a VGA-output port? an S-Video port? a HDMI output port? component-output port?

Does your TV have a VGA-input port? an S-Video port? a HDMI input-port? component-input ports?

Match the "output" to the "input", and you should be OK.

Jul 03, 2010 | Operating Systems

2 Answers

Task filter


Following are a handful things u have to know about VB file handling

for more details...go to http://www.5starsupport.com/info/vb.htm

File Handling (Generic)

While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data other than through the VB database capabilities. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are used even more often! It's also a given that you'll use the DIR function regularly.
Dir - Returns a filename that matches a pattern
temp$ = Dir ("*.*")
CurDir - Returns the current directory
temp$ = CurDir
MkDir - Creates a directory
mkdir ( "newdirectoryname" )
ChDir - Changes the current directory to a new location
chdir ( "newdirectoryname" )
ChDrive - Changes the current drive
ChDirve "A"
RmDir - Removes the indicated directory
rmdir ( "directoryname" )
Freefile - Returns an unused file handle
i = freefile
Open - Opens a file for access, locking it from other applications
open "filename" for input as #1
Close - Closes a file so that other applications may access it
close #1
LOF - Returns the length of a file in bytes
i = lof ( #1 )
EOF - Returns a boolean value to indicate if the end of a file has been reached
statusvariable = eof ( #1 )
Name As - Renames a file
name "filename1" as "filename2"
Kill - Deletes a file
kill "filename"
Fileattr - Returns attribute information about a file
i = int ( tempvariable )
GetAttr - Returns attributes of a file or directory
i = GetAttr("c:\windows\temp")
SetAttr - Sets the attributes of a file
SetAttr pathname, vbHidden
Reset - Closes all disk files opened by the OPEN statement
Reset
FileDateTime - Returns data file was created or last edited
FileDateTime ( filename )
FileLen - Returns length of file in bytes
FileLen ( filename )
FileCopy - Copies a file to a new name
FileCopy sourcefile, destinationfile
Lock - Controls access to a part or all of a file opened by OPEN
Lock #1
UnLock - Restores access to a part or all of a file opended by OPEN
UnLock #1
Width # - Set the output line width used by the OPEN statement
Width #2, 80
File Handling - ASCII-specific

While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data outside of a data base. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are necessary to build useful code.
Line Input - Reads an entire line of ASCII text
line input #1, tempvariable$
Write - Puts data in a file, with separators for the data
write #1, tempvariable$
Print - Puts data in a file with no separators
print #1, tempvariable$
Spc - Used in a print statement to move a number of spaces
Print #2, var1; spc(15); var2
Tab - Used in a print statement to move to TAB locations
Print #2, var1; Tab(20); var2
File Handling - Binary-specific

VB also support features which allow you to access a file on a byte-by-byte basis. The good thing about it is that you have more control, the bad thing is that you may have to write more code. Generally, a programmer will use the option (ASCII or Binary access) according to the least code he has to write. For binary access the Get/Put are equivalent to the Line Input and Print functions used in ASCII text file access. The big difference between the two is that binary access will read (Get) an exact number of bytes of data, and the reading can start at any byte within the file.
Get - Reads data from a file
get #1, anyvariable
Put - Puts data into a file
put #1, anyvariable
Seek - Moves the current pointer to a defined location in a file
seek #1, 26
Input
input #1, anyvariable
Loc - Returns current position with an open file
i = Loc(#2)

Sep 14, 2009 | Microsoft Windows XP Professional With...

1 Answer

I am an MCA student.To read the file from PC to handheld device


you might need to run a anti-virus through your computer. it might have a bug. :) hope this helps!!

May 20, 2009 | Microsoft Windows XP Professional

1 Answer

Please explain the working of this code


It's a Java http server (webserver) that serves random "prices" if they match a search string.

Well here is an explaination:

private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};
These are search strings

private static Random rnd = new Random();
This generates a random number

private static Charset cs = Charset.forName("UTF-8");
This is the charset that the http server uses

ServerSocketChannel server = ServerSocketChannel.open();
Create a new server

server.socket().bind(new InetSocketAddress(8055));
Bind the http server to port 8055

The rest is handling the request and processing it

But here:
if(Arrays.binarySearch(symbols, symbol) >= 0)
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;
else
response = "Price not available";
channel.write(cs.encode("HTTP/1.0 200 OK "));
channel.write(cs.encode("Content-type: text/plain "));
channel.write(cs.encode(response));
channel.close();
}
It sees if the string input matchs: DELL INTC MSFT ORCL SUNW.

(private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};)
If so, it gives a price based on a random number.
(
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;)
Or else
It says "price not available"
then it gives a html header to end the error message.

Hope I helped you :)
Gook luck

Nov 26, 2008 | Operating Systems

1 Answer

On repitition


What is your question

RCF

Sep 01, 2008 | Operating Systems

1 Answer

How to create program in delphi


i wants to create form for data input
with the condition

Mar 13, 2008 | Operating Systems

2 Answers

File handling in visual basic 6.0


Following are a handful things u have to know about VB file handling

for more details...go to http://www.5starsupport.com/info/vb.htm

File Handling (Generic)

While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data other than through the VB database capabilities. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are used even more often! It's also a given that you'll use the DIR function regularly.
Dir - Returns a filename that matches a pattern
temp$ = Dir ("*.*")
CurDir - Returns the current directory
temp$ = CurDir
MkDir - Creates a directory
mkdir ( "newdirectoryname" )
ChDir - Changes the current directory to a new location
chdir ( "newdirectoryname" )
ChDrive - Changes the current drive
ChDirve "A"
RmDir - Removes the indicated directory
rmdir ( "directoryname" )
Freefile - Returns an unused file handle
i = freefile
Open - Opens a file for access, locking it from other applications
open "filename" for input as #1
Close - Closes a file so that other applications may access it
close #1
LOF - Returns the length of a file in bytes
i = lof ( #1 )
EOF - Returns a boolean value to indicate if the end of a file has been reached
statusvariable = eof ( #1 )
Name As - Renames a file
name "filename1" as "filename2"
Kill - Deletes a file
kill "filename"
Fileattr - Returns attribute information about a file
i = int ( tempvariable )
GetAttr - Returns attributes of a file or directory
i = GetAttr("c:\windows\temp")
SetAttr - Sets the attributes of a file
SetAttr pathname, vbHidden
Reset - Closes all disk files opened by the OPEN statement
Reset
FileDateTime - Returns data file was created or last edited
FileDateTime ( filename )
FileLen - Returns length of file in bytes
FileLen ( filename )
FileCopy - Copies a file to a new name
FileCopy sourcefile, destinationfile
Lock - Controls access to a part or all of a file opened by OPEN
Lock #1
UnLock - Restores access to a part or all of a file opended by OPEN
UnLock #1
Width # - Set the output line width used by the OPEN statement
Width #2, 80
File Handling - ASCII-specific

While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data outside of a data base. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are necessary to build useful code.
Line Input - Reads an entire line of ASCII text
line input #1, tempvariable$
Write - Puts data in a file, with separators for the data
write #1, tempvariable$
Print - Puts data in a file with no separators
print #1, tempvariable$
Spc - Used in a print statement to move a number of spaces
Print #2, var1; spc(15); var2
Tab - Used in a print statement to move to TAB locations
Print #2, var1; Tab(20); var2
File Handling - Binary-specific

VB also support features which allow you to access a file on a byte-by-byte basis. The good thing about it is that you have more control, the bad thing is that you may have to write more code. Generally, a programmer will use the option (ASCII or Binary access) according to the least code he has to write. For binary access the Get/Put are equivalent to the Line Input and Print functions used in ASCII text file access. The big difference between the two is that binary access will read (Get) an exact number of bytes of data, and the reading can start at any byte within the file.
Get - Reads data from a file
get #1, anyvariable
Put - Puts data into a file
put #1, anyvariable
Seek - Moves the current pointer to a defined location in a file
seek #1, 26
Input
input #1, anyvariable
Loc - Returns current position with an open file
i = Loc(#2)

Jan 23, 2008 | Operating Systems

1 Answer

Dna problem...


Sir that is a school poject and i cannot assist you with such, cause projects like this although they seem hard, are actrually quite simple..

1.) Plan out exactly what needs to be done
2.) figure out how to get it done
3.) do it as planned..

for examply yours is 1.) open a file
2.) get the value of the string to be seached
3.) Search the string
If found, record location, update
occurence
4.) Update results

5.) GET A GOOD GRADE

There are a lot of source code aviable on the net.. You didnt specify which language you were using, here a a site with tons of written applications, source code and tutorials..

www.planetsourcecode.com



Jan 21, 2008 | Operating Systems

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

111 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18304 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...