The World Health Organization estimates that 30,000 deaths can be attributed to the Chernobyl disaster. Over seven million people have been exposed to radiation from the accident. (source)
Man, I think I need a refresher with Java or something. I've been programming for 8 years in Java, and I need to remember how to set the first three bits of a number.
Can someone refresh my memory? What happens if I use super.hashCode() & 0b000? What is the shorthand equivalent of super.hashCode() & 0b11111111111111111111111111111000?
yes, yes I know that, but lately I've been having a hard time thinking and what not. "brain fog". For some reason, I couldn't figure out that & 0x8 is not the same as & 0xFFFF_FFF8
I don't mean to be bitter, but it is pretty terrible to have been able to remember everything near-instantly and think up complex ideas off the top of my head, to all of a sudden be brought down by "brain fog"; thinking, and your mind just stays blank; saying in your mind, "I need to do this", then arriving and forgetting what it was you were doing, even though you just thought of it 1 second ago.
I'm just trying to figure out if I should make a class for each defined Production, or if I should just have one class called JavaProduction that I can instantiate and give a name that stands for the type of Production.
Not on the project, just what I'm trying to design.
I asked this question here before, but couldn't find a good conclusion really: is there something better than instance factory methods for instantiating a Production after looking it up using a Trie?
It doesn't make the code look any prettier. It doesn't feel right to have a non-static factory generator, even if it is powerful.
It would probably help if I also stated that the purpose of this compiler is to be able to compile any arbitrary Token sequence to valid bytecode iff the given Token sequence resolves to valid syntax and correct grammar.
The Trie is essentially a forest of 5 different trees for each kind of Token type as defined by the JLS: Identifier, Keyword, Literal, Operator, Separator.
each Node contains an array of 5 Nodes.
So essentially, you have an arbitrary Token sequence, you get the ID of the token, and access the root node for the corresponding Token ID, and you walk the hierarchy of Tokens down the tree in the same manner for the given Token sequence until you reach the end or a fatal condition occurs. You would then create a Production from the Tokens.
@fredoverflow you can correctly declare int int = int;, but it is invalid grammar since you are 1) defining a variable called "int" and "int" is reserved; and for the same reason, 2) you are defining the value as int which, given any context (arbitrary or not), cannot compile because there cannot exist a variable named "int".
I don't know, perhaps "correct grammar" is the wrong clause to describe the above scenario and all scenarios like it, but its just what popped into my head. I think anyone reading the above will get the point, despite how I initially described it. If you have more questions about it, I am glad to answer.
@fredoverflow that is what I just said, it is a "reserved word", hence the above is syntactically correct, but grammatically incorrect.
Yes, thank you, I must have forgotten about that word "semantics".
Do you understand, though, what I meant by the process for identifying a particular Production from a series of Tokens?
I should also note that the compiler works in one pass without back-tracking or look-ahead inasmuch as it will push Productions onto a stack and walk the tree until it finds the largest possible matching Production sequence in the Trie.
I actually haven't even heard of that site until now
I enjoy philosophy
I figured making a compiler from scratch wasn't that hard. So I thought one up. It works, in theory, and I believe it will work in practice, though I don't believe it will be the most efficient or versatile compiler.
I say easy because really it is just a matter of converting a higher-level grammar to a lower-level one (considering the chomsky hierarchy)
In the formal languages of computer science and linguistics, the Chomsky hierarchy (occasionally referred to as Chomsky–Schützenberger hierarchy) is a containment hierarchy of classes of formal grammars.
This hierarchy of grammars was described by Noam Chomsky in 1956. It is also named after Marcel-Paul Schützenberger, who played a crucial role in the development of the theory of formal languages.
== Formal grammars ==
A formal grammar of this type consists of a finite set of production rules (left-hand side → right-hand side), where each side consists of a finite sequence of the following symbols...
Java is type-2
We are effectively converting from type-2 to type-3 (no different than a CLI)
If we wanted to convert type-0 to type-3, we would just convert to type-1, then type-2, and finally type-3...
For Java specifically and it's grammars, converting this type-2 language to JVM bytecode is actually quite simple to perform if we create an arbitrary token parser that treats the type-2 tokens as type-3 instructions: we assign a definite parse operation for every possible kind of Token and production, and a previous Token alters the state of the machine and determines what is done with the next Token.
You have to believe in the abstract and also believe in what is real, or else you are not real [not a realist].
Considering that mathematics is based entirely on logic, and philosophy just uses a priori and a posteriori knowledge to make conclusions on some concept, philosophy would have much use of computers as a tool to come to a conclusion about a certain concept insofar as it helps with logical computation.
I just know logic, and everything that I have ever thought of, it is like trying to understand all of science, but on your own, and with nothing but our feeble minds to simulate our ideas and theories. Quite limiting if you ask me, but it has served me well enough, else I would have learned nothing useful in school!
"His wife believed that remedies should resemble their cause, so she poured water on him,"
@Permian Presumably, Spring MVC is just about the Model View Controller part of Spring? I own Springing into Action, and it covers much more (for example, security).
@Permian I love reading books about programming languages and theory. Practical stuff? I mostly dive into YouTube tutorials. But everybody is different!
@fredoverflow Okay, I've declared that my parser is a Top-Down, Recursive Descent, Non-backtracking, non-predictive, LL(k) parser, where k varies according to the length of the current (plausible) production. How is that?
All I did was make a quick google search, consider all the given kinds of parsers on that page from tutorialspoint, and make a conclusion based on their descriptions.
@fredoverflow I guess you could technically consider it a Backtracking parser since if you removed the Trie array lookup, you would have to backtrack on the waiting stack (containing all the Tokens which would have matched to something on the Trie array) every time, causing the parser to be, instead of O(n), more like O(n*(k*i)) where n is the number of Tokens, and k is the size of the stack on the current loop iteration, i.
If you don't know Java and want to learn it from a book, Effective Java would be a terrible choice, because Effective Java assumes that you are already somewhat familiar with Java.
Can't get a better learning environment than that. That's where I started in 2011, until I got bored, played a flash game, liked it a lot, and starting trying to recreate that 2D game as my first program, even though I just started programming... well, it got me into the wonderful world of Eclipse IDE, and everything went uphill from there and I... yeah... now I'm using IntelliJ IDEA.
The C Programming Language (sometimes termed K&R, after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as co-designed the Unix operating system with which development of the language was closely intertwined. The book was central to the development and popularization of the C programming language and is still widely read and used today. Because the book was co-authored by the original language designer, and because the first edition of the book served for many years...
Why was Spring made the way it was... I mean I hardly know a thing about it; I just know that it uses reflection and Annotations. The web is slow enough as it is; we don't need to add another 50ms of latency to our backend web applications!
Mandatory warning: Angular is not the same as AngularJS. Angular is the shiny new thing with TypeScript support, and AngularJS is the dusty legacy stuff.
I am looking to display images on a webpage that I have in a file but since images and info can change I am looking for a solution where the system does it dynamically
I have read around 50 examples today by eyes are starting to twitch at this point but I am going to code that example up and see if it brings me more luck then I have been having today, thanks for the link
Good luck! I am not sure how well that approach would go but maybe linking the source attribute of whatever the jsf equivalent of the image tag is to a String in a Bean might even work as well?
Alright, so I'm going to go back here again and ask what would be better in terms of API and performance. Should I implement all Productions as their own classes so that a method and its parameter is insert(Statement statement);, or have one concrete class changing the method to insert(JavaProduction statement);