Engineering impossible bugs? [closed] - theory

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
How would you engineer an impossible bug? Is it even possible?
Take a simple example: Bob needs to add commenting functionality to his popular internet blog. It gets millions of visitors a month and already has thousands of posts. How would you implement the feature if he hired you?
You would probably add a form at the end of the page which is responsible for rendering posts, right? Its almost common sense. (Forget about security for the sake of simplicity)
However, that solution assumes way too much about how Bob's blog works.
Let's say that the person who made Bob's blog hated Bob. He wanted to make a system where no new features could be implemented without completely rewriting it from scratch.
How would you create a system like that if you were the one that hated Bob? You aren't limited to a specific language, framework, operating system, server software, architecture, or anything. All you need to do is provide working blog pages to clients that connect to your server.
Also assume Bob will do whatever you tell him to. If he has to send in his new hand-written blog posts by carrier pigeon to an offshore processing center, then he will do it.
And before anyone asks, NO, I am NOT asking this question because I want to screw over a client. I think of this like an exercise. We're used to engineering code that isn't supposed to break, but how would we do engineering code that isn't supposed to work? Just like bugs are inevitable, are solutions equally inevitable? Is it just as hard to create inverted code like this as it is to write regular code? If we can create code that can't be fixed, does it mean we can create code that can't be broken?

Because the blog platform itself is fairly expendable, I would think that the only sort of bug that irreversibly cripples Bob's web-presence would have to be a bug targeted at either the content, or at Bob himself. Some examples of this would be placing the only terminal that allows Bob to post in a cage full of lions, or convincing the internet to DDoS every blog written on the same topic as Bob's blog.
That said, as long as Bob is a citizen of the free world where free internet access in public cafes and libraries abounds, I don't think it will ever be possible to introduce a bug so terrible that Bob's blog cannot be published.

Let's say that the person who made Bob's blog hated Bob. He wanted to make a system where no new features could be implemented without completely rewriting it from scratch.
How would you create a system like that if you were the one that hated Bob?
I would create the blogging system in Malbolge.

Related

What is STRIPS in artificial intelligence? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a homework in artificial intelligence.
I need to make a robot go from room A to room B and there are obstacles between the rooms.
The professor asked me to use STRIPS (Stanford Research Institute Problem Solver) but I can not understand how STRIPS works.
Can someone give me a good explanation and examples about what is strips and how it work?
Thank you.
[Please note, this is based on what I half-remember from nearly a year ago]
These days, I would expect that when the Prof. says STRIPS, they would be talking about the problem coding 'language', rather than the planner - check for example the Wikipedia page: STRIPS. I would imagine that your Prof. likely has a particular solver (and quite possibly algorithm too) in mind, and is wanting you to encode the domain and specific problem, to run on the solver. Without knowing more details of the assignment, I can't be sure what you need. If you're looking for a planner, as I understand it, Fast Downward is quite popular among researchers currently. The website has some instructions on how to use it, and IIRC it comes with a bunch of domains and problems for those domains. I would thoroughly recommend looking at those, they're pretty much what I learnt with. I also just found this and this.
STRIPS is essentially a way of encoding information about the nature of the problem you want the computer to find a solution to. Typically you encode a domain, which provides information about the problem overall, such as what objects may be involved, what states they can be in, and what actions can be taken. Then, you also encode a particular problem, which (generally) specifies the starting state of the problem, and what the goal state should look like. Both those files are fed into a solver, which takes them and then finds a solution to the problem. Note that this won't always necessarily be an optimal solution - that depends on what algorithm you use, and how you have told the solver what should be optimised (which I think you can generally do in the problem, though I can't remember for sure now).
I suggest you have a look at those links, and see what you can find out. That should hopefully give you a better idea of what gaps you need filled in your knowledge, and then you can narrow in on exact specifics. If this is a taught course assignment, then I would expect that surely the Prof. would have gone over some of this in lectures (do you have lecture slides available?), or at least pointed everyone towards a recommended planner and material to read up on. If you're still struggling, your best bet is to go back and see the Prof. in office hours.

How "Hello World" works in C [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am searching for a month for blog posts about "how C program works". Most of them go like
Compilers do these things
Linkers do these things
Program is put into memory; and stacks, heaps, etc.
I thought I would first read about how compiler works to understand the flow of the program into the machine. Dragon Book seems to be universally preferred. But truthfully, it's too intensive. I am not good enough now to go through it all.
So I began to read about hardware. But There too, they explain about buses, I/O signals, structure of memory, writing cache-friendly code etc. But with no proper examples.
But still I could not find myself satisfied or being able to completely visualize the process.
2 hours ago I decided to ask this question.(Since I am scared of It might be not useful to SO community, or off-topic question or other down-votable categories) and I did not find out any post relating to this exactly. There was one about "how compiler does the compilation", but the answers showed that it's too broad a question.
My question is this:
I would like to know how, in depth, a C program works. If you cannot tell me explicitly, please redirect me to a book or another post on another website that can give me the answer to this.
I am here until I get a response. If you have any suggestions regarding this post, tell me. And It is not my first language, so please take all my sentences as being soft and polite.
Thanks.
UPDATE:
Along with the accepted answer, there are some very nice links as well as suggestions which give partial answers or the way to proceed further to understanding what I am trying to understand.
The best answer to this question by far comes from the book "The Elements of Computing Systems," by Noam Nisan and Shimon Schocken. This book starts from the simplest possible electronic components, assembles them into a working processor, invents a simple assembly language for it, writes an assembler for that, and ultimately shows you how high-level languages can be compiled onto it. Reading the book, and working all the examples (which use a simulator for the hardware, so no workshop required!), will forever change the way you look at computers; he will literally understand everything from the lowest to the highest levels, and see how they work together. See the book's website for more info.
It's too broad a question (as you have observed).
If you really want to understand from bottom up - buy an OLD computer from the 80's off ebay. Sinclair Spectrum/BBC it really doesn't matter but make sure you get plenty of books and manuals that go with it.
You will learn plenty because these machines were well documented and what wasn't documented was discovered and then documented :)
They are also sooooo much simpler than a modern quad core multi-gigabyte memory job. It will all fit inside your head easily
or for a modern start, Arduino or Raspberry pie maybe.

"Free for academic use" license [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am a researcher in Mathematics at a university, and I released a code toolbox that is mostly for research use, but can have applications in engineering and industry.
I would like to have a license that basically says "you can use this code freely if you are in a university and use it for publishing, studying teaching, but not if you are in the industry --- in that case, please reach for the wallet".
CC-NC-BY-SA would look perfect to my eyes, but using it for code is heavily discouraged, I suppose for good reasons. None of the other open source licenses seems to do what I want. Writing my own license looks like a legal mess, and I'd rather avoid it.
How would you solve this issue?
Related questions (but not the exact same thing): https://stackoverflow.com/questions/1232666/proper-open-source-license-to-release-academic-code, https://stackoverflow.com/questions/6443110/practicalities-of-licensing-academic-software
I assume that toolbox is written by your own and you want to share it with other academics. In case someone from industry is making millions you want your share (well, the sunny-day example).
I don't know any license that comes close to that.
The CC-NC-BY-SA is discouraged because of two reasons mainly:
CC licenses are not for software. They know nothing about the two most prominent forms of software: Object Code (binary, compiled) and the Source Code (author version).
Non-Commercial. It is undefined what this term means, especially legally.
So you use your morally and subjective day-to-day terms and every human on the planet comes pretty close in understanding what you mean, but putting this into a copyright related software license is problematic.
I'm not a lawyer, but probably some kind of passive licensing would suit your needs. There just is no license, you put your term:
"you can use this code freely if you are in a university and use it for publishing, studying teaching, but not if you are in the industry --- in that case, please reach for the wallet
and then say this is in your own words, you decide about the meaning in case it's unclear now or in the future. (if you talk with your lawyer, a suggestion will come up that you should disclaim warranties and such which is normally suggested.)
Most academic users I bet are fine with this. Commercial users are pressured for more clarification, so you can run contracts then. Job done.
The other route would be you release under a strong copyleft license like the AGPL. This would engage user-rights (so you give a lot), however this would be the typical something-for-something, because they need to offer the software as well to all of their users under AGPL, including their changes and add-ons.
Additionally you can offer "commercial" licenses (AGPL does not forbid commercial use, however it requires to preserve the freedom of the software) as long as you're the copyright owner.
Probably either the little suspicous, "I name no license" policy, or something that's okay for you to give (strong copyleft) + X might do it. There are pros and cons for either of these two paths, so chew a bit and maybe you get a third idea that's doing it for you.
However, I am not aware of any existing license that covers your case. You might find some through research because I'm normally not interested in licenses that are for some user-groups only (e.g. only academics, only non-commercial), because the borders are not clear.

Better approach to filtering Wikipedia edits [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
When you are watching for news of particular Wikipedia article via its RSS channel,
its annoying without filtering the information, because most of the edits is spam,
vandalism, minor edits etc.
My approach is to create filters. I decided to remove all edits that don't contain a nickname of the contributor but are identified only by the IP address of the contributor, because most of such edits is spam (though there are some good contributions). This was easy to do with regular expressions.
I also removed edits that contained vulgarisms and other typical spam keywords.
Do you know some better approach utilizing algorithms or heuristics with regular expressions, AI, text-processing techniques etc.? The approach should be able to detect bad posts (minor edits or vandalisms) and should be able to incrementally learn what is good/bad contribution and update its database.
thank you
There are many different approaches you can take here, but traditionally spam filters with incremental learning have been implemented using Naive bayesian classifiers. Personally, I prefer the even easier to implement Winnow2 algorithm (details can be found in this paper).
First you need to extract features from the text you want to classify. Unfortunately the Wikipedia RSS feeds don't seem to be particularly machine readable, so you probably need to do some preprocessing. Alternatively you could directly use the Mediawiki API or see if one of the bot frameworks linked at the bottom of this page is of help to you.
Ideally you would end up with a list of words that were added, words that were removed, various statistics you can compute from that, and the metadata of the edit. I imagine the list of features would look something like this:
editComment: wordA (wordA appears in edit comment)
-wordB (wordB removed from article)
+wordC (wordC added to article)
numWordsAdded: 17
numWordsRemoved: 22
editIsMinor: Yes
editByAnIP: No
editorUsername: Foo
etc.
Anything you think might be helpful in distinguishing good from bad edits.
Once you have extracted your features, it is fairly simple to use them to train the Winnow/Bayesian classifier.

Best practices for creating a license for a program? Tie to a hardware or just use a UUID? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm working with a developer who has placed his faith in a license scheme that makes little sense to me. He wants to tie a desktop application to a hardware component value, one of which is easily changed, the MAC address of the ethernet controller.
Now, I know no one likes licenses, he does want to protect his hard work and I can understand that. What can I tell him to help him out? In the very least I'd like to give him a path other than tying a license to a hardware component.
I am sure this will not convince anyone who doesn't already share my view, but I don't see any value in licensing schemes that are more complicated than a short serial number, perhaps "phoning home" so you can detect if it is being abused and disable it. If the software is moderately popular, it will be cracked, whether you invest $5 or $5 million into the licensing scheme. Put those millions toward building a product that honest people (the majority) are willing to pay for and upgrade. If more protection is needed, hopefully the application can be converted to a web service.
In one of the podcasts, Joel said something like this (I'm paraphrasing):
Just make your licensing scheme hard
enough to crack so that it's a little
easier to pick up the check from
accounting and just order another
license. That keeps those people
honest that are worth thinking about.
The rest of them are not going to give
a penny to you anyway.
Good point, I guess.
If he wants to be sure that only the licensed computer can use the software, a hardware key is one of the only options to be sure that the hardware(computer) is the same as the one the license was purchased for.
It can be easily cracked(so can anything), but it's not so easy to use two computers with the same mac address on the same network segment.
I don't see how a UUID will make a license more secure, or help to accomplish the goal of restricting one license per computer.
With licenses it depends on what the goal of the license is, having a unique license per computer may be a valid decision(although I personally don't like it), but it has to be remembered that licenses will only keep honest people honest in the end, and if someone decides to, they will crack your license scheme.
It all depends on how many users he expects and the price of his application, but in any case a mac address can be easily changed and will certainly only annoy valid users. In my opinion a standard serial will just do fine. If something shows up in P2P networks, just talk to the user to whom you issued the serial and ban it in the next release. To make a long story short, in the eye of a fraudulent user the only difference will be, if he downloads "CoolApp.v1.11.Incl.Keymaker-GroupName" or "CoolApp.v1.11.Incl.Keygen.and.Patch-GroupName".

Resources