theory

Simple basic explanation of a Distributed Hash Table (DHT)

ぐ巨炮叔叔 提交于 2019-12-02 23:58:34
问题 Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics. 回答1: Ok, they're fundamentally a pretty simple idea. A DHT gives you a dictionary-like interface, but the nodes are distributed across the network. The trick with DHTs is that the node that gets to store a particular key is found by hashing that key, so in effect your hash-table buckets are now independent nodes in a network. This gives a lot of fault-tolerance and reliability, and possibly some

Split down a number in seconds to days, hours, minutes, and seconds?

一曲冷凌霜 提交于 2019-12-02 23:50:37
I've heard that it's possible to accomplish this using the modulus % operator present in most programming languages. The real question is, how? I'm unfamiliar with how modulus works, so I've had difficulties using it in the past. Given the present time here in seconds since 1970, 1307758473.484 , how can I calculate how many years that is, days that is, hours that is, and minutes that is using modulus? I'm essentially looking to format it like this: "5 years, 10 days, 12 hours, 7 minutes, and 18.56 seconds". How would I do this? I'm really interested in learning the logic behind this and not

计算机会议排名

匿名 (未验证) 提交于 2019-12-02 22:56:40
CORE Computer Science Conference Rankings Acronym Standard Name Rank AAAI National Conference of the American Association for Artificial Intelligence A+ AAMAS International Conference on Autonomous Agents and Multiagent Systems A+ ACL Association of Computational Linguistics A+ ACMMM ACM Multimedia Conference A+ ASPLOS Architectural Support for Programming Languages and Operating Systems A+ CAV Computer Aided Verification A+ CCS ACM Conference on Computer and Communications Security A+ CHI International Conference on Human Factors in Computing Systems A+ COLT Annual Conference on Computational

Storing item positions (for ordering) in a database efficiently

孤街醉人 提交于 2019-12-02 22:46:46
Scenario: There is a database of movies a user owns, movies are displayed on a page called "my-movies", the movies can be displayed in the order that the user desires. For example "Fight Club" in position #1, "Drive" in position #3 and so on and so forth. The obvious solution is to store a position with each item, for example: movieid, userid, position 1 | 1 | 1 2 | 1 | 2 3 | 1 | 3 Then when outputting the data is ordered by the position. This method works fine for output however it has a problem when updating: the position of an item all the other positions need to be updated because

RegEx / computer theory - construct a regEx in alphabetical order

荒凉一梦 提交于 2019-12-02 20:03:09
问题 In my grammars - Computer theory class I am trying to create a regular expression in alphabetical order(a-z) l = {a, b, x, y, z, i, o, u, e, c} This is what i have come up with using the kleene closure aeiou(x*, y*, z*, i*, o*, u* e*) With the kleene close * thats zero or more so that should force abceioxyz? We have not been learning this type of form [^abc] am i on the right track? 回答1: As far as I understand, you want to capture strings with the following format: The string contains any

Do theoretical computer science topics have “real world” development applications?

隐身守侯 提交于 2019-12-02 19:14:58
By "theoretical computer science topics", I am referring to things such as regular vs non-regular languages, the pumping lemma, and grammars. I'm familiar with the real world applications of finite automata and regular expressions, but topics such as these other ones are giving me more problems as I'm not seeing any real world applications. These things are useful if you want to know whether trying to do something is futile with regular expressions. For example, knowing that XML is non-regular is useful if the idea to parse XML with regex ever enters your mind. And if you don't know off the

In terms of programming, what do semantics mean?

泄露秘密 提交于 2019-12-02 19:03:13
This is a sentence from Eric Lippert's blog : Given that unfortunate situation, it makes sense to emphasize the storage mechanism first, and then the semantics second. It's easy to get a dictionary definition of what "semantic" means but what does it mean in terms of computer jargon? but what does it mean in terms of computer jargon? Essentially the same thing. Example: x = 5; The above is the syntax (representation). The meaning (i.e. the semantics) of this term is to assign the value 5 to a symbol (variable, whatever) called x . Different languages offer different syntaxes to provide the

Are GHC's Type Famlies An Example of System F-omega?

巧了我就是萌 提交于 2019-12-02 18:28:41
I'm reading up about the Lambda-Cube, and I'm particularly interested in System F-omega, which allows for "type operators" i.e. types depending on types. This sounds a lot like GHC's type families. For example type family Foo a type instance Foo Int = Int type instance Foo Float = ... ... where the actual type depends on the type parameter a . Am I right in thinking that type families are an example of the type operators ala system F-omega? Or am I out in left field? System F-omega allows universal quantification, abstraction and application at higher kinds , so not only over types (at kind *

Can liftM differ from liftA?

隐身守侯 提交于 2019-12-02 17:59:41
According to the Typeclassopedia (among other sources), Applicative logically belongs between Monad and Pointed (and thus Functor ) in the type class hierarchy, so we would ideally have something like this if the Haskell prelude were written today: class Functor f where fmap :: (a -> b) -> f a -> f b class Functor f => Pointed f where pure :: a -> f a class Pointed f => Applicative f where (<*>) :: f (a -> b) -> f a -> f b class Applicative m => Monad m where -- either the traditional bind operation (>>=) :: (m a) -> (a -> m b) -> m b -- or the join operation, which together with fmap is