So i could care less if i get my name on a piece of software. i love coding so thats my best reward. however not everyone feels the same as me. so what my question. how should i give credit to someone? a specific example is im building a parser, but i need to check for balanced [ { and (. I dont know how to build one for myself. i remember one on this site. now in this case i can just ask the guy what he wants, but what about people who dont respond to emails or dont provide a way to contact him or her.
And now let this thread become five pages long with an incredibly long discussion about a problem that has been solved. Oh, and don't forget the usual argument.
fair enough, but people will still post to a solved thread long after it should be in the archives.
People other than then OP might come across this thread. That the OP is satisfied with an answer is less important than wether or not the question has been adequately addressed.
Your algorithm fails to remember more than one level of nesting, beyond the count of types of brackets. A string where the right brackets are in a different order than the left brackets but the innermost brackets match, such as "{(()})", breaks it.
You need a stack of tokens. When a left bracket comes it, it gets pushed. When a right bracket comes in, if the stack is empty or the token doesn't match the top of the stack, the string is invalid. After the loop, the string is valid iff the stack is empty.
Just because you write someone's name at the bottom of some text file you distribute with your program, doesn't mean you can just use their code. You have to get permission first, unless it's explicitly stated somewhere you can use it if you give credit, or if the license says you can redistribute the code or make derivative works.
Hey, someone seems to have accidentally left the bank vault open...I would like some money but there is no sign or any workers around to ask if I can, does that mean it's legal for me to take it?
Speaking of parsers, this is the forum post from which I learned how to parse expressions. This is the only article/forum post on parsing I've ever read, and it has covered all my parsing needs so far.