AuburnMathTutor 37 Junior Poster

Hey if you go to Notepad, type in "Stop posting this stuff in the CS forum" and read it 100 times, you will be amazed by the results! This is really super special cool one!

teja_dt commented: why do you bother +0
jonsca commented: Offset +1 +0
Nick Evan commented: :-) +0
Vinita_B commented: Yes no one cares!!! +0
AuburnMathTutor 37 Junior Poster

Jeez I'm a conservative and that just makes me cringe. Why are conservatives so dumb? Am I that dumb? I'm going to go cry now.

AuburnMathTutor 37 Junior Poster

can some one explain the full detail for computer organization thx....

Probably. I'd like to meet him, too.

AuburnMathTutor 37 Junior Poster

Upon rereading, I realized I left out a few things that will be important later. This is the first of what might be several addenda to An Introduction to Alphabets, Strings, and Formal Languages.

We will call s' a substring of s if s' occurs anywhere within s. That is, if s' is a substring of s if and only if s can be written as a concatenation of the form rs't for arbitrary strings r and t. We call s' a prefix of s if and only if s can be written as a concatenation of the form s't for arbitrary string t, and a postfix of s if and only if s can be written as a concatenation of the form rs' for arbitrary string t. Note: prefixes and postfixes are substrings.

We will say that a language L is a subset of language R if and only if every string in L is also in R.

We will say that a language L is equal to a language R if and only if L is a subset of R and R is a subset of L.

We will also allow some shorthand notations. By L^n (where L is a language and n is natural number) we will denote that language T which contains all strings which can be formed by concatenating any n strings of L.

There may be further addenda, but for now this is all I can think of.

AuburnMathTutor 37 Junior Poster

Some of the arguments in this thread are just plain ridiculous.

PCSAWICK829:
How much are you selling your TV for? I guarantee I *could* come into your house and take it for free, if I feel you're overcharging me. That seems pretty black-and-white to me.

AuburnMathTutor 37 Junior Poster

Here's the answer to the question you're really begging here.

1. Show some effort. Come on. Give me something.
2. Have you tried this? It's very easy if you think about it.
3. If you haven't thought about it and don't plan to, I suggest you drop out of your course.
4. If you have thought about it and really don't get it, I suggest you drop out of your course.
5. If you haven't thought about it but will do so now that someone has chided you for your ways, consider staying in your course with your newfound maturity.

You're welcome.

jonsca commented: Well put +4
AuburnMathTutor 37 Junior Poster

Calling main results in undefined behaviour, so not really.

Huh. I wasn't aware of that... it looks like you're right though, you're not supposed to do it in C++ though it's legal in C. And it works for me when I try it on g++. Weird... whatever. I don't want to get too far off-topic, but was there any compelling reason for the change, other than the nagging feeling that having a recursive main is a funky bad idea?

It's sort of a non-issue though, because you can always have main() call a dummy main2() function immediately, and you can certainly call main2() recursively. You can even pass main2() the command-line arguments.

But of course even that is something of a non-issue, because in principle I agree that looping probably is the better solution.

AuburnMathTutor 37 Junior Poster

im pradeesh giv me some of ideas to my project it is "online exam for blind persons"

I wouldn't worry too much about the graphical layout of the page. Audio is probably a good idea.

You know, I imagine blind people know they are blind before they get online. Something about not seeing the screen probably tips them off.

AuburnMathTutor 37 Junior Poster

i am doing mca .i want develop a application software in programming language using java. and iam not getting ideas.so plse give me some title related to project.

Yeah, not a CS question. What Daniweb needs is a "Software Development" subforum entitled "Poorly-written pleas by lazy unimaginative students looking for handouts". It might clutter the menu, but I guess an acronym could be devised...

Nick Evan commented: You have my vote +15
AuburnMathTutor 37 Junior Poster

Sure.

You know the definition of an NFA, correct? You will need a structure that corresponds as closely as possible to this. In particular, you're going to need the concepts of:
- NFA
- State
- Transition
- Symbol
Java's OOP framework will make it easy to define each of these things in a vacuum. An NFA has a bunch of states, one of which is designated as a start state and some subset of which are accepting states. Transitions go between two (possibly non-unique) states and are activated on either one symbol or no symbol (lambda/epsilon transition).

Now to actually process stuff, you'll want a backtracking (I'd suggest recursive) algorithm that tries each of the relevant transitions at every symbol read. Of course you'll want to save the input because you might need it later... probably best to get the entire string you're testing first. Remember, an NFA accepts if there is any path that accepts, so you'll only need to keep exploring the possibilities until you find a hit.

An alternative is to construct the equivalent DFA from your NFA before testing, but that's more work. The benefit I guess is that if you will be checking lots of strings, this approach is almost guaranteed to be faster.

AuburnMathTutor 37 Junior Poster

Well, at some point you're going to need to do the following...
- define syntax
- define semantics
- write a formal grammar
- write a compiler/interpreter

Also, if you want your language to actually be used,
- port to a variety of popular systems
- have a genuinely good idea and reason for making a new language
- have something new to offer or do what is already done better
- provide support for writing all kinds of domain-specific apps... a standard library

AuburnMathTutor 37 Junior Poster

There are different degrees of portability. Probably the best you can hope for in terms of portability is a language that either runs on a virtual machine (then your code is as portable as there are virtual machines for different computers) or in an interpreter (ditto, for interpreters) and even then if you try to do hardware or OS specific things, it won't work. Examples:

portable: a Java program that has two integer variables declared statically at compile time, with values A and B, and the program computers the average and puts the answer in a third variable declared at compile time initialized to 0.

not portable: a program written in assembly language that controls a robotic arm and hand and saves the data in a parallel file system across a distributed network of heterogeneous hosts. Oh and it does some vector processing on the side.