Jump to content

straight_stewie

Member
  • Posts

    2,705
  • Joined

  • Last visited

Everything posted by straight_stewie

  1. ^^ This. Cache misses can be so expensive that a relatively small amount of misses can completely negate the overall performance increase of having a cache, or moreover, even give worse performance than not caching. One of the expensive parts here is creating and destroying the threads. You have to set everything up, ask the OS to do allocate resources, wait for the OS to schedule the thread, then wait for the OS to destroy the thread and release it's resources... All of that can take a significant amount of time. One method that you can take is called Thread Pooling. In thread pooling, you have a queue of processing requests, a pool of threads, and a queue of completed requests. The thread pool keeps track of which threads are busy and which are idle. When you get a processing request, you find an idle thread in the pool and let it handle the request. This amortizes the cost of creating and destroying threads. One of the things that can possibly be done in this method is to dynamically change the number of threads in the pool to find the point that yields the highest throughput. This will be easiest when your thread pool rarely has an empty thread: That is, when the request queue is rarely empty. Your mileage may vary with this type of optimization, I haven't thoroughly experimented with it.
  2. I'm the human. The car is the car. I get to make the decisions in that relationship, whether the world is perfect or not. The statement "the goal is impossible" is only trivially counterintuitive to the goal if the goal is legitimately not possible. There are plenty of studies that show that certain types of automation, which happen to be the types we are discussing here (partial automation of crisis response), actually reduce safety by lulling operators into a false sense of security. Performance Consequences of Automation Induced Complacency
  3. Not as much as you might think. It's pointless to do something that is known to be legitimately impossible. I would much prefer to see investments in "traditional" safety techniques rather than in automation. That being said, I treat driving a car the same way I treat firearms: As a rather dangerous thing that you can do safely if you are careful, well trained, and pay attention. I rather like driving, and much prefer cars that don't annoy me with their nonsense. I get to decide where the car goes and what it does, and I don't need it to complain to me about it.
  4. Yeah. There's no point in doing anything other than making cars illegal. They will never get close to that goal, even with full automation. If there are cars, there will be car related deaths.
  5. So you're complaint is that stores are primarily concerned with selling you things? I mean, it would be nice if display models were interactive, they are with sound systems and televisions, to a point, but that's really not a problem with brick and mortar.
  6. So to take a break from the age old best conceal carry caliber argument, I'm planning a long float trip in Arkansas and I'm having trouble finding out if their constitutional carry laws apply to residents of other states as well. Does anyone know where I can go or who I can talk to to find out?
  7. Your current code has movement in local space. You need movement in global space. transform.Translate(Vector3.right * speed * Time.deltaTime, Space.World); // this moves to the right transform.Translate(Vector3.left * speed * Time.deltaTime, Space.World); // this moves to the left What you are dealing with is the difference between local position and world position.
  8. @Hi P what you are saying is the equivalent of "no one who looks at a dictionary or a thesaurus really understands <insert spoken language here>". What you are facing is a common problem to all of engineering. Many students think that engineering is about memorizing solutions to problems. It is not. Engineering is about memorizing how to find solutions to problems. In programming, that involves reading books, StackOverflow, looking at others code, re-reading ones own code, reading language and library documentation, and even looking at this very forum.
  9. The algorithm for A is the one that assumes that he starts at the beginning, and gives O(n) time. This is a simple greedy algorithm. Start at the beginning, and start adding each value to a sum. The minute that you see a negative value, stop, and return the sum. One algorithm for B is simply an extension of A. Without ruining your homework, what you want to do is a variant of the algorithm for A, but run on every start point. Then take the best one and return that. Alternatively, you could generalize your problem, and google the name you come up with. I came up with "maximum sequence sum" and found many good answers, and one very elegant algorithm that I hadn't known before.
  10. I was bored of building my BrainFuck Interpreter, and this thread prompted me to take a break and reup some of my data structure skills. I quickly realized that, for even moderately sized n, a MinHeap or a MaxHeap (depending on sort order) can be made to appear to consumers like a doubly linked list (by using the same API), but will provide faster insert and deletion times. Being a sorted Binary Tree, it also allows Binary Search for lookups, which makes that operation faster as well. Given that you're currently thinking about this type of data structure, this may be a good next step in your study of structures, as they aren't really conceptually harder than a Doubly Linked List, and can be implemented in the same ways in regards to generics, either using an interface or a comparer object.
  11. For all Airline Transport Pilot aircraft, all pilots are required to get what are known as "Type Certifications", which is training specific to that model of aircraft. The type of aircraft are thus also known as "Type certified aircraft", and the pilots who complete the training are referred to as "certified on that type". Usually it involves simulator time, online and classroom training, and ends with a final check ride either in a certified simulator or actual aircraft of the type, given by an experienced type certified pilot who has FAA approval to conduct the check ride. To maintain the Type Certification for that aircraft, a pilot must conduct a certain number of takeoffs and landings under various conditions each month, as well as potentially other activities like practicing missed approaches, rejected takeoffs, and other scenarios. One of the failures here, and one of the things I think Boeing should be held accountable for was it's lack of MCAS training throughout these courses, even after the first accident. That's how all test flights are conducted for all aircraft. Being a Test Pilot or Test Flight Engineer is very similar to being an astronaut pilot, or an engineer working flight control during an Apollo mission (in fact, it is exactly like that: The Apollo team viewed each flight as a test flight of new hardware.)
  12. Angle of Attack indicators are hardly a security measure. In fact, outside of aircraft designed to perform aerobatic maneuvers, they are quite rare. I would go so far as to say that if your aircraft requires an AOA indicator to be safe during normal modes of flight, then the aircraft design itself is the danger. And yes, sometimes things slip through the cracks. It's not like Boeing is one all knowing individual. The reason they need to be held accountable is because they refuse to fix their mistake, not because they made one, Unless it is shown that Boeing knew they made the mistake beforehand. It is unrealistic to think that every mode of failure in any complicated system, from websites to flight control systems, can be caught before show time.
  13. I'm 25. On and off since I was 9 (does anyone else remember freewebs??), but most of the actual learning is concentrated in the last three years.
  14. If it only used one of the sensors, we wouldn't be having this conversation. The fault is that it doesn't fail gracefully when the two sensors are not in agreement with each other... Actually, the whole problem could probably have been avoided if it used only one sensor or three or more sensors. This was a failure in the design of a fault tolerant system, in that they didn't actually succeed in building a fault tolerant system. I'm in full agreement there. I would actually go one step further and make the claim that, at no point should a system take over any vehicle if the operator didn't explicitly tell it to do so. In this case, that means that turning MCAS on should have been a pre-takeoff checklist item, just like every other flight automation system in the plane is. @S w a t s o n It's easy to make that claim now. Hindsight is always 20/20. It's much harder to make that claim when you are in the middle of designing what is one of the most complicated things on the planet, and all of your testing indicates that it is functioning as intended. As I already stated, we can't fault Boeing for not having originally included the indicator in the base configuration, unless we know that they knew there was a problem from the start. In which case, the fault is not that they didn't include the indicator, the fault is that they moved forward with a system that they knew was dangerous.
  15. That's exactly what I'm trying to say. I can't find fault in Boeing for not having initially included the indicators as part of the base system. The aircraft are overwhelmingly complicated and I'm sure that their testing indicated that the MCAS system was reliable. I do find fault in Boeings continuing refusal to actually fix the damn issue now that it's been twice tragically notified of it.
  16. That was a very well written post, and very on point. However, there is a big problem with that statement: Communication, navigation, and safety equipment is always optional, to a point. Take a Cessna 172, for example. Navigation/Instrumentation You can get Steam gauges The aircraft can be IFR certified or not IFR certified aircraft can optionally have DME, or not. You can get a glass cockpit Always IFR certified Optional weather RADAR, considered a safety/navigation feature. Communication There are various radio options, for both internal and external radios, with both instrumentation stacks. The most basic option with the traditional cockpit provides a basic two channel external, one channel internal with PTT external, always on internal. The most advanced option, included with the glass cockpit, provides an unlimited length radio stack, with dual tune stereo (one channel in left ear, one channel in right ear), provides one-push tune when a flight plan is entered (automatically tune to appropriate frequency based on flight plan), and provides two internal channels (pilot-copilot, and pilot-copilot-passengers). The aircraft can be optionally equipped with emergency, always on, or unavailable, supplemental oxygen, depending on the package. The real point is that the minimum provided equipment must be whatever is necessary to fly the aircraft safely and respond to emergencies that might arise as a result of onboard systems. Everything else is optional. In this case, leaving out the differential AOA indicator was probably a mistake, as it is necessary to diagnose problems with the always included MCAS system. Alternatively, Boeing could have provided a Disagree Light, which just indicates that the differential AOA has passed some threshold and is no longer reliable. As another point about optional equipment, there are thousands of Vans RV aircraft that fly safely without even an external radio or their emergency parachute system, there are thousands that fly safety with radios but without the emergency parachute system, and there are thousands that fly safely with both.
  17. A robust tactic, which is used all over the .NET FCL is to allow the user to specify a delegate that is used to sort their objects. If that isn't available, it tries to use a few different default implementations that are basically variations on what you are doing, and if that doesn't work, all objects inherit from the Object type, so all objects have an Object.GetHash method, which is used to sort them. (that last sentence is only applicable to C#. I am unsure what methods that Java.Object provides) Since Java doesn't have function pointers, the equivalent solution would be to allow the user to provide another object which implements some Comparer interface, and use that objects Compare method to sort the objects in the collection. That allows your collection to sort objects that don't implement whatever interface you are requiring, as well as some other benefits, like on the fly changes to sort order.
  18. 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...
  19. 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.
  20. If it's not an IT role, then it probably means "If you're on the LTT forum, you meet that qualification".
  21. 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.
  22. 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.
×