theory

Text editor theory [closed]

我的梦境 提交于 2019-11-26 18:46:52
问题 As I'm always dissatisfied with existing editors, a project I always wanted to start is my own text editor. However doing text editing is serious business. Besides analyzing the source code of existing text editors, is there any book or other resource (like academic work) about this topic? I'm interested especially in something that teaches how to handle memory and how to manage text insertion (if you have a 100 MB file and want to add a char at x position, you can't just memmove the huge

What will be the DFA for the regular expression 0(0+1)*0+1(0+1)*1?

♀尐吖头ヾ 提交于 2019-11-26 18:36:37
问题 This is the DFA i have drawn- Is it correct? I am confused because q4 state has 2 different transitions for same input symbol which violates the rule of DFA , but I can't think of any other solution. 回答1: Your DFA is not correct. your DFA is completely wrong so I don't comment DFA for RE: 0(1 + 0)*0 + 1(1 + 0)*1 Language Description : if string start with 0 it should end with 0 or if string start with 1 it should end with 1 . hence two final states (state-5, state-4). state-4 : accepts 1(1 +

How to test randomness (case in point - Shuffling)

别来无恙 提交于 2019-11-26 17:31:39
First off, this question is ripped out from this question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me. Assume that you have a algorithm that generates randomness. Now how do you test it? Or to be more direct - Assume you have an algorithm that shuffles a deck of cards, how do you test that it's a perfectly random algorithm? To add some theory to the problem - A deck of cards can be shuffled in 52! (52 factorial) different ways. Take a deck of cards, shuffle it by hand and write down the order of all cards. What is the

Is it possible for a computer to “learn” a regular expression by user-provided examples?

☆樱花仙子☆ 提交于 2019-11-26 16:52:57
Is it possible for a computer to "learn" a regular expression by user-provided examples? To clarify: I do not want to learn regular expressions. I want to create a program which "learns" a regular expression from examples which are interactively provided by a user, perhaps by selecting parts from a text or selecting begin or end markers. Is it possible? Are there algorithms, keywords, etc. which I can Google for? EDIT : Thank you for the answers, but I'm not interested in tools which provide this feature. I'm looking for theoretical information, like papers, tutorials, source code, names of

What is Turing Complete?

徘徊边缘 提交于 2019-11-26 16:46:11
What does the expression "Turing Complete" mean? Can you give a simple explanation, without going into too many theoretical details? Here's the briefest explanation: A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory). So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in practice) it could be used to solve any computation problem. Sometime's it's a joke... a guy wrote a Turing Machine simulator in vi, so it's possible to say that vi is the

Recovering built-in methods that have been overwritten

你离开我真会死。 提交于 2019-11-26 16:44:04
问题 Let's say that our script is included in a web-page, and a prior script (that already executed) did this: String.prototype.split = function () { return 'U MAD BRO?'; }; So, the split string method has been overwritten. We would like to use this method, so we need to recover it somehow. Of course, we could just define our own implementation of this method and use that instead. However, for the sake of this question, let's just say that we really wanted to recover the browser's implementation

Interface or abstract class?

半腔热情 提交于 2019-11-26 15:28:34
For my new Pet-Project I have a question for design, that is decided already, but I want some other opinions on that too. I have two classes (simplified): class MyObject { string name {get;set;} enum relation {get;set;} int value {get;set;} } class MyObjectGroup { string name {get;set;} enum relation {get;set;} int value {get;set;} List<MyObject> myobjects {get;set;} } Later in the Project MyObjectGroup and MyObject should be used equally. For this I could go two ways: Create an interface: IObject Create an abstract class: ObjectBase I decided to go the way of the interface, that I later in

Where do I start learning about image processing and object recognition? [closed]

被刻印的时光 ゝ 提交于 2019-11-26 15:24:13
问题 I'm interested in writing some basic computerized object recognition application, so I figure I need some theoretical background in image processing algorithms, along with some AI for decision making capabilities. I'm a computer science graduate, and one day I plan to get my Master's degree, hopefully in one of these fields. In the mean time, I'd like to get a head start and do some self-learning. So my question is, where do I start? I'd appreciate an arrow in the right direction, a few links

How do streaming resources fit within the RESTful paradigm?

狂风中的少年 提交于 2019-11-26 15:05:07
问题 With a RESTful service you can create, read, update, and delete resources. This all works well when you're dealing with something like a database assets - but how does this translate to streaming data? (Or does it?) For instance, in the case of video, it seems silly to treat each frame as resource that I should query one at a time. Rather I would set up a socket connection and stream a series of frames. But does this break the RESTful paradigm? What if I want to be able to rewind or fast

Difference between user-level and kernel-supported threads?

拈花ヽ惹草 提交于 2019-11-26 14:59:17
问题 I've been looking through a few notes based on this topic, and although I have an understanding of threads in general, I'm not really to sure about the differences between user-level and kernel-level threads . I know that processes are basically made up of multiple threads or a single thread, but are these thread of the two prior mentioned types? From what I understand, kernel-supported threads have access to the kernel for system calls and other uses not available to user-level threads. So,