Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

straight_stewie

Member
  • Content Count

    1,854
  • Joined

  • Last visited

Awards


5 Followers

About straight_stewie

  • Title
    Veteran
  • Birthday 1994-05-10

Profile Information

  • Gender
    Male
  • Location
    North Mississippi
  • Interests
    Audio, Programming, Engineering. Just a hobbyist now, unfortunately.

Recent Profile Visitors

3,405 profile views
  1. straight_stewie

    Low level programming languages

    Well, there's your mistake in your logic: "expressiveness" is open to interpretation. Does it mean: Says the most with the least. Makes it explicit what's happening. The two are quite different statements, and "expressiveness" is open to interpretation. In the first definition, a language like python is highly expressive, and by your logic highly preferred. In the other mode of thinking, assembly is more expressive, because it hides (if we ignore that the physical processor is different than the programmers model) no details about what's going on. RegEx is probably the most expressive thing ever in the first statement, and the least expressive thing ever in the second. And, as for your example about using the preprocessor in C, that is not a language feature, that is a toolchain feature. And yes, any good assembler also has a macro language. Just because it uses a different syntax doesn't mean it isn't as powerful. Some assemblers (notably MPASM for PIC) even have builtin macros for managing arrays, both constant and not. That's a feature that C can't even dream of, so let's not get into a pissing contest about who's favorite language has a better toolchain...
  2. straight_stewie

    Index of a Node List

    You have a circular doubly linked list, there is an optimization there: If the index is greater than the half the length of the linked list Loop on Node.prev Else Loop on Node.next Return the node that you find For small lists, that doesn't matter one bit. For larger lists, that can make a huge difference in random access performance.
  3. straight_stewie

    What do employer's mean when they talk about "desktop experience"?

    If it's not an IT role, then it probably means "If you're on the LTT forum, you meet that qualification".
  4. straight_stewie

    Whatever happened to floppy disks?

    They are used in those systems because those systems were built when those were the best solution available. Nuclear weapons and their safety and launching technologies are not something that you want to change every time computer technology advances. Since they are very hard, very dangerous, and very expensive to design and test, and must be absolutely 100% reliable and failsafe with absolutely no tolerance for down time, the statement "if it ain't broke, don't fix it" was seemingly created just for this situation.
  5. straight_stewie

    Calling all math-heads: How did i surpass infinity?

    What you've just discovered is called a "supertask". A super task is essentially a countably infinite sequence of "tasks" that seems like it should work. The commonly cited case of your example is called "Zenos runner" In which Zeno of Elea argues that motion is actually impossible by showing that a runner who moves half the distance to the finish line every "step" will never reach the finish line. Michael from VSauce does a way better job explaining super tasks than I will ever be able to: Edit:: I feel like I should mention that all super tasks are trivially paradoxes, since the definition of a "super task" is "some infinite series of operations that can be completed in finite time". For that statement to work, you would have to be able to complete tasks in "instantaneous time" or, in an equivalent sense, "The function V(t) that describes the velocity of task completion would approach infinity".
  6. straight_stewie

    Nodes in Java

    Well that's true enough. There is a whole world of self referential structures out there. Linked lists are often introduced first because they are relatively simple to understand. There is, however, one case in which I would consider a variation of a linked list a possibly optimal structure: Given a very large multidimensional dataset which is parsed into a single dimensional structure using a space filling curve (like the popular Z-Order Curve, for example), and where the set will be randomly accessed, then a linked list with an array of references to every nth node might be a good solution. The array can be orders of magnitude smaller than the linked list, and thus be cachable, and yet we still get relatively fast access to the "local" data necessary to do the bounding box check that is required for searching a linear structure built on a multidimensional space filling curve.
  7. straight_stewie

    Nodes in Java

    In many languages the number of indexes in an array is limited by whatever the maximum positive value of a signed integer is. If you need to store more items than that in a quickly searchable structure, and for some reason a database or a file isn't a viable option, you will need some form of self referential structure.
  8. straight_stewie

    Nodes in Java

    Just because it hasn't been mentioned, what you are referencing is called a "self referential structure", and the "Node" is what makes them possible. A basic definition might look like this: class Node { Node Left; Node Right; Object Value; }
  9. straight_stewie

    Pascal, help with program

    How Blaise of you. That was Wirth alot.
  10. straight_stewie

    Low level programming languages

    You seem to always purposefully misread arguments. The focus of my example was the "LABEL: break LABEL" construct, which acts as a goto inside a for loop that jumps to a label... Oh, and yes, a for loop is either a LOOP, GOTO, or JUMP construct. So is a while loop, and a foreach loop.
  11. straight_stewie

    Low level programming languages

    Just wait until you study formal languages. Then you'll realize that they are all the same, just with different words. If anything, assembly is more expressive because it makes it explicit what is going on, whereas other languages hide those details from you. Just as an example, in C, return means "Push this value onto the stack, then pop the call stack and jump to that location". For the record, GOTO is not an instruction, it is an assembler directive which means "Insert a jump to literal address instruction where the address is the address of the first instruction following the label that I give you as an operand". And yes, quite a few languages have GOTO statements. In Java they look like: MYLABEL: for (int i = 0; i < 10; i++) { if (myCondition) break MYLABEL; else // do something }
  12. straight_stewie

    Low level programming languages

    Who is talking about CALL? We are talking about the LOOP instruction which is not a CALL. LOOP: Loop According to ECX counter Decrement ECX, jump short if ECX is not zero Alternatively, decrement ECX, jump short if ECX is not zero and Zero Flag is one. CALL: Push the program counter onto the stack and jump to the given address. The two are completely different and unrelated instructions. I'll repeat myself because you missed it: Statements like return, break, continue, and pass are just special cases of goto. And yes, return can be implemented without using CALL/RET instructions, if one so desires to do so. Additionally, an optimal implementation of the switch statement is also a goto, involving indexing into a jump table where the indices are the case labels. And yes: int MyFunction(int myArgument) { return myArgument * 2; } MyFunction(myArgument); Is exactly the same as: MyFunction: POP REGISTER MUL REGISTER, 2 PUSH REGISTER RET PUSH myArgument CALL MyFunction Which is the same as: MyFunction: POP REGISTER MUL REGISTER, 2 POP OTHERREGISTER PUSH REGISTER JUMP OTHERREGISTER PUSH PROGRAMCOUNTER PUSH myArgument GOTO MyFunction
  13. straight_stewie

    Low level programming languages

    No. X86 actually has a LOOP instruction with a unique opcode, set of operands, and unique state effects. It is not just an assembler macro... It does exactly what a loop statement does in any language: Evaluate the condition, and either "goto" the next line, or "goto" the line after the last line of the loop block. Lot's of languages? Most languages have a goto keyword. Java doesn't, but you do get labels and you can write break labelName to "goto" a label... Trivially, statements like break, continue, and pass are just special cases of goto.
  14. straight_stewie

    Having difficulty understanding "net neutrality"

    Net Neutrality was primarily designed to make sure that ISPs make it equally easy for you to access all sites. Or, in other words: ISPs won't slow down sites that don't pay them extra ISPs won't censor sites that they don't like, agree with, or couldn't bully around. ISPs won't charge you extra money to access certain sites. However, there are three big problems with "Net Neutrality" as proposed in the US that are large enough for me to be entirely against it: The text of the "bill" is thousands of pages long. This means that it's realistically impossible to know what it actually does, and means that we have to rely on what politicians and business owners tell us it does. Those people are not known for their unbiased truthfulness. It creates an opening for strong government regulation of internet, something that history has shown is inherently a bad idea: Throughout history governments have always increased the amount of law and regulation they impose on their constituents, and seldom reduce it. It was a law that was not to be passed by any of the constructs which we have for passing law. The passing of net neutrality in the way it was attempted would further strengthen a dangerous precedent where government agencies are starting to go around writing their own laws, without any action from our legislature.
  15. straight_stewie

    Low level programming languages

    Spaghetti code is not a paradigm, it's a smell... "Spaghetti code" is just a derogatory term used to refer to programs that use goto statements and jump tables for control flow instead of proper constructs that are easy to read. But there's a hint in that statement: In the end, all programs are eventually transformed into jump tables and "goto statements"... If we ignore that physical chips are different than their programmers model, processor only execute assembly. Stop saying that. Many people have informed you of appropriate reasons that one should learn assembly. Stop trying to scare people away from learning more about computers: That is only detrimental to their understanding of what is really going on when they write a program. If everyone listened to you, suddenly we would be stuck in time because no one could ever write optimizing compilers, optimized interpreters, or even bleeding edge video games (which yes, sometimes have functions written in assembly)... Not everyone is scared of having to think about what they are writing, and everyone understands that you don't use assembly as the primary language for an application. Just because you don't want to understand what's really going on when you write something like: class Token { private Action _func; public Token(Action function) => _func = function; public void Execute() => _func.Invoke(); } static class TokenBuilder { public static Token Build(char ident) { ident = ident.ToLower() switch (ident) { case 'a': return new Token(MyFunction1); case 'b': return new Token(myFunction2); case 'c': return new Token(myFunction3); } } public static void MyFunction1() => Console.WriteLine(1); public static void MyFunction2() => Console.WriteLine(2); public static void MyFunction3() => Console.WriteLine(3); } Doesn't mean that some people don't want or even need to know that this is really just a few arrays salted with a healthy dose of indirect addressing.
×