Jump to content

Rasori

Senior Members
  • Posts

    396
  • Joined

  • Last visited

Everything posted by Rasori

  1. I've been trying to get this post up, but I've been travelling: I've actually been thinking about Xittenn's suggestion quite a bit and I'm trying to determine if it really is optimized. Say each customer has a list of Vehicle references (presumably primary key values for the corresponding vehicles). To then pull up the information for those vehicles still requires a query on the entire database of vehicle entries, does it not? Whereas before the query was (in pseudocode) "get all VEHICLES where OWNER is Owner_Name," now isn't it "get all VEHICLES where PRIMARY_KEY is one of [PK_Values]" ? It seems a massive memory improvement over storing the entire vehicle, but does it truly save performance? I think, basically, this question comes down to: are databases generally optimized for Primary Key checks? If (as I believe) yes, then just how speedy is this optimized query?
  2. Hi all, I'm trying to find out how to establish when to optimize for processor usage versus memory usage. In the application I'm working on it's not actually a big deal (not large-scale enough to worry about) but I'm curious how it's decided for more critical tasks. The situation is something like this: Vehicle X has Customer Y, where Y is the Owner of X. It would be possible for each Customer Y to have a list of all Vehicles they own stored within them. Which would be preferred: the increased memory usage of having each Customer Y list all Vehicles they own, or the increased processing time required to go through all Vehicles and return a list of all Vehicles where Vehicle.Owner is Customer Y? In my application, with a locally-stored database that isn't remarkably large, I intend to just go ahead and use the extra memory. Both usage cases (needing to select one of the customer's vehicles in order to start an invoice or similar, or needing to find the owner of a certain vehicle currently on the premises) are quite likely to crop up, so I figure it would be nice to be able to approach the problem equally effectively from either direction. Is there a best-practice to determine how to make a decision like this under more critical circumstances? Thanks!
  3. Haha you guys take the fun out of passing time with idle thought. Of course I could use two different screwdrivers, but that eliminates the project aspect of it all. The concept is to enable someone like me who does a lot of tinkering, sometimes with sensitive electronics and other times just pulling stuff apart, and who gets attached to that particularly comfortable ratcheting screwdriver, to get both options with low hassle. The end result would, in my mind, be a single ratcheting screwdriver, with one set of tips, which could be both magnetic or non-magnetic depending on requirements. I do like the idea of the already-electric screwdriver, but tearing one of those apart is a bit beyond what I had in mind. It sounds like, if I really do want to go this route, standard batteries are the way to go rather than capacitors, and there's no point working out any dynamo-based option. At least when dealing with batteries I'll be able to handle the power considerations more easily on my own.
  4. Hey all, I've been toying with the idea of an electromagnetic screwdriver, allowing for the convenience of a magnetic tip and the sensitivity of a standard tip. Yeah, forgive me, I'm bored. Anyway, toying with the idea I've been wondering about power. I'm sure I can make an electromagnet with batteries, and given the low mass of the screws, probably (haven't gotten around to testing it yet) even with just one AA or similar. Worst-case, I've been reading that D-cells are quite useful in these things. What I've been wondering is if it would be possible to use a capacitor bank. I know they're usually used for high power for short periods, but I also know that they can be used for other purposes. For example, I have a squeeze dynamo LED flashlight which doesn't need to be squeezed every time I want to turn it on, and from wikipedia I can see that these are sometimes capacitor-powered. In the end, my preference would be similar to this--a battery-free option. I'd like it not to be obnoxious: squeeze the handle once for around a minute (or more) of magnetic awesomeness, which hopefully would last through a standard working session without needing to recharge if left unused. Or, if a crank dynamo, turn the crank a few times, perhaps? I'm not familiar enough with the electronics to know if this might be possible without simply building it and testing, as I can't get a value for the resistance of the coil. I'm not asking anyone else to do that, but if people know offhand that it would be possible, I'd be more willing to splurge on the components to build it (I'm a college student with no money for pizza, let alone components which won't work), and if people know offhand it wouldn't be, I'll stop following this little path. Thanks for any advice!
  5. Cool. I've got some work to do for school, but I'll probably work on transferring it over tonight. I'll let you know if anything goes wrong. Merged post follows: Consecutive posts mergedThe importing of my blog was quick and painless. Only complaint is that it imported my tags as categories . That said, I'm liking the features I didn't know I didn't have, and I'll be able to change from categories to tags in the near future. Thanks, SFN!
  6. What version of Wordpress is this using? I'd happily transfer my blog over (presuming programming counts as science enough) but I've been posting daily for just over a month now on Blogger and I'm finding that only Wordpress 2.2 and above can import from the current Blogger.
  7. Hi all. I'm working on a little simulation-like game, basically an excel spreadsheet on steroids that relies on player interaction and creativity for the fun bits. Ignoring whether or not the game itself would be fun, I've come across a couple of questions. If you need more information, feel free to either ask for it here or check out the pertinent posts on my blog to see if you can see where I'm going. First question is about JButtons. I have a series of buttons, standard "add one," "fill," "subtract one," and "empty" buttons. They're to be labeled simply with "+", "+ +", "-", and "- -" respectively. The problem is it seems that the JButton is set to have a default requirement for distance-from-edge for the text. In other words, it looks like it needs 15 pixels from the edge to the start of the string, 10 pixels per character, and another 15 pixels from the end of the string to the last edge. If it doesn't have this minimum, Java has been truncating my string down to "..." for whatever reason, despite the fact that I'm almost certain "+" is shorter than "..." physically. I've worked these numbers out on the premise that the minimum size for a properly displayed add-one button is 40 pixels, and the fill button (with the space between the plus signs) must be 60 pixels. I'm trying to get it down to have both of the buttons simply be little squares with these strings in them. Is there no way to change these defaults? I'm thinking the only method is to make a custom graphic for the button, which I'll do eventually but it takes a while for me because I'm good at coding, not graphics Second question is about databases. I'm planning on hooking this up, via JDO, to a database structure. I've found a convenient e-book, available for free online here, that is really helping me to understand what I need to do on my end, and everything tells me there's not much that needs to be done to set up the database for it. But I have the problem that everything assumes I understand the basics of Java database connectivity and setup. While I have researched a good deal of MySQL back before I settled on JDO, and know some of this, I would like a nice guide for the initial setup of a JDO-compatible database, if you've got any suggestions. Thanks! Thanks for any and all help, in advance!
  8. The electricity would be used to power a very powerful laser or something like that. I'm not entirely sure how they create black holes, but allegedly they already happen in labs on occasion, it mostly has to be scaled up slightly. In terms of the radiation, the suggestion was to use a parabolic mirror I believe--anything already going away from the ship provides thrust just like any other engine, and anything going towards the ship bounces back and also provides thrust.
  9. Aha. That, my friends, takes the cake. Simple yet perfect (and blatantly missed by me). Thank you very much!
  10. The temporary table won't be deleted on the client logging out? That was the understanding the link gave me. If not, sweet and thank you, but if it does I may need to fall back on manual labor (or some jury-rigged scripting, which is really what programming is about to me anyway ). It does certainly seem that a view is not going to work. I'll do some more research on temporary tables.
  11. I read about this recently in NewScientist (no claims are being made by me on validity of any source). From what I read it sounded feasible and certainly interesting, but it's one of those things where "feasible" means that I understood what was being said, not that I verified the facts he used. The biggest drawback was the power needed to create the black hole. Something on the order of a gigantic solar panel pretty close to the sun being able to produce a large enough power source once every 3 years? Still, more feasible than travelling the stars with the technology we're currently using.
  12. Hmm... A useful tool but I don't think it's going to work for what I'm looking at (it is, however, entirely possible that what I'm looking for isn't going to have a nice solution). I'm thinking more of something that can be initiated, say, on Saturday, and then will have the same values through to Friday night, where it will be updated to new values. [Edit: this would be through potentially multiple iterations of a client logging in and out, hence why the temporary table doesn't seem to fit my needs] In honesty, because of the scale of what I'm looking at (read: very small), it may be better to just manually make the tables I need each week.
  13. I'm just kind of playing around with programming, I've gotten a relatively solid grasp on Java and eventually decided what I actually wanted to do with it. Then I realized that, for my program I need a database. SQL has been the best option so far, but I need to find out if I can make a view that doesn't refresh when its referenced tables are updated. Alternatively, if I could make a table that is based off of the values of another table (only at the time of creation), that would also be acceptable. The basic concept is to create a view that allows a user to see selected pieces of a table they don't normally have access to. Preferably, I'd like a specific procedure to be the only way to refresh the view's values, though it's acceptable if I'd have to outright drop the view and create a new one every time I want to update it. I can easily see why this may not have been implemented in SQL, but nonetheless I was hoping there was some way I could do it. If you've got any ideas, please let me know! (I'm using MySQL and InnoDB but all I've gotten so far is a rough outline so it's still early enough for me to change (foreign keys are a must for the database, as a note, and preferably I'd like something free/open-source)).
  14. I'm actually specifically unclear about the start-up. According to a brief google search, yes, latch is what I'm talking about. Null is my own terminology, I guess (I've been playing with programming too much lately). Basically, when a system containing an S-R Latch is first started (batteries freshly inserted and everything), I don't understand how the NAND gates have any output at all, as they're based off of two inputs and only receiving one. The second input to the NAND gate is inherently dependent on the past values of the other input, of which there are none. As I think about it more and more I slowly come up with my own reasoning--the best idea I've had so far is that a two-input NAND gate with one of the inputs being neither logic 0 or logic 1 (logic 0 inherently has some reading, it's not absolutely empty if I understand correctly) thinks of itself as simply an inverter on the one valid input. Is that right?
  15. I've been doing some digital electronics in my studies lately, and I'm just not getting this part. Well, rather, I can do all the work just fine, I'm just not understanding something that my lecturer claims is unimportant. I'm sure many of you know what it is, but to make the problem I have clear I'm going to explain: S NAND (NOT)Q = A = Q R NAND Q = B = (NOT)Q They both seem simple enough, but I'm not getting how it /starts/. On start-up, S and R are defined, but I can't fathom how S[or R] NAND (NULL) gives a value at all. My best guess would be to set S and R = logic 0 to start with, so that regardless of (NULL) the NAND would be logic 1, but A and B can't be the same value by definition of the SR Flip-Flop. Is it acceptable to break that rule for this initialization or is something else going on here?
  16. Yeah, I suppose it would. Unfortunately it's not a physical thing, so I'll see what I can throw together in paint or GIMP. I'm beginning to think I'm vastly overthinking the issue here, but I'll save the comments until I post my picture(s).
  17. So, I'm trying to conceptualize something and there's a part of torque I'm not sure if (more how) I should consider. There are four legs. Each leg is on the corner of a square object, pointing outwards in an extension from the center of the square. Each leg is on a pivot that will allow it to move up and down, but not side to side. If I have two vectors for torque, one up-and-down and one side-to-side, do I need to take the side-to-side one into consideration for how the whole object would end up moving? I'm thinking yes. In that case, do I use the length of the arm or the distance to the center of the object for the length of the moment arm? As an extension, if I don't need to take the side-to-side one into consideration (please explain why if that is the case), do I then need to take up-and-down into consideration if the pivot is lockable (ie, I set the pivot to the angle I want before setting the object down)? Another, nastier piece of this torque issue: If I have a third force (sometimes called FRad), I believe I have to take this force into consideration in how the whole object moves (even though it doesn't, from my understanding, affect the leg). The torque arm in this case is hard to define--can I say that the force is applied at the point where the leg meets the central object, or must I take other factors into account? Then, I believe, the torque arm will be the length from the corner to the center of the square (we're in three dimensions, I suppose the object's a cube). Is this right? Either telling me or linking me elsewhere is more than good. Thanks a bunch in advance.
  18. One (covers many things said); yes, a brake light is odd, and yes it probably is a waste of effort. That doesn't change the fact that it would also be a good excercise to get myself familiarized with some of these things. Two; I know I will feel resistance, as you can't get energy from nothing. However, is wheel-driven the only way? Nothing that can get power by acting like a baseball card in the spokes or something? There probably isn't anything like that, but one can never tell these days. I just have a feeling that wheel-driven is about the most resistant method there is, and other (less efficient but workable) methods should be available. These may not normally work for the power for these lights, but the concept is that I can charge the battery for a long period when the light isn't needed, and needn't run the lights direct from the generator.
  19. Hallo Alle, I'm posting from Deutschland here, on a foreign exchange. Naturally, I ride the bike a whole lot more here than back in the States, and that includes night riding. My bike has lights and a commercial dynamo for them, but the dynamo's broken and I have time so I figure I'd like to try to rig something up myself. I'm pretty good at making circuits and switches (which can be triggered in a near infinite amount of ways), but that's about it; consider me a fresh recruit on the electrical bandwagon (as in, transistors, resistors, capacitors, etc. are just fancy names to me). So, I suppose one of my first questions is where to get a nice base knowledge of the vocabulary and common equations necessary for electrical systems. Now, I have a list of needs and a list of wants. I'll post both, and if you can, let me know how feasible the wants are (the needs are basic). Needs: ---Two lights (headlight and rear/brake light). ---A power generator (which can take power from something on the bike that moves; often a wheel) ---The lighting of the lights. ---A water (and preferably temperature, esp. low temperature) resistant design. Wants: ---My dynamo now does contact the wheel, and it adds a noticeable increase in resistance (then again, it's broken) when connected. If I could sneak in something that perhaps creates less energy per second but also gives less resistance to me, that'd be nice. ---I'd really like to have a rechargeable system, where the generator charges a battery (or, if what I think (and wikipedia says) a capacitor is is correct, a capacitor//capacitor bank) which can then power the light--good for if I've been spending the night the German way and should be walking the bike home. ---If I could have a rechargeable system, I'd also really like a charge meter--perhaps simply a red, yellow, green LED--to prevent overcharging. Two completely manual switches: one to open/close the charge circuit (again, prevent overcharging), one to turn the lights on/off. ---If possible, two intensities for the rear light (night light and brake light intensity). I think this could be done simply by putting a bit more power into it when braking, ie two circuits going to the rear light, one turns it on when the switch for lights is on, the second when the brakes are pulled. Perhaps have the first circuit a double-switch (I'm almost certain that term is incorrect) so that pulling the brakes also activates that circuit if the main switch is off (as, to be able to see during the day time, the brake light would need a decent intensity). ---I think I'd also like the ability to transfer from bike to bike, as I'm borrowing my current bike for the next couple of months and will be switching afterwards. I think this mostly depends on the way I mount the whole system though. Now, like I said, I'm pretty good with circuits and switches, mainly what I need is a list of parts and how to rig the more advanced stuff up. Some of it may be completely the stuff of dreams, but I really think a decent amount of it could be done. I know it would be easier to buy a commercial dynamo (possibly more reliable and even cheaper, as well, as I have no parts to start with), however I have free time and I'd like the self-satisfaction of having made it myself, so as long as the project won't bankrupt me I'll be happy to attempt it (let's set a price limit at 50 Euros, but I'd be willing to go higher if that's completely unfounded... feel free to link me to online suppliers of what I might need). Any online guides that might help with the whole project are also appreciated. I'm looking at this as my introductory project to intermediate circuitry, so if you can come up with more nifty features (regardless of necessity) to be a good learning exercise, feel free to suggest them. Thanks, all!
  20. Here's a curious thing to throw out there: after the first day (last Friday), I became sore late Friday night and remained sore until going to the gym Monday morning (barely sore by that point, but it was still there). After going Monday, however, I came home with no actual muscle aches, and after developing midday Monday, they were gone that evening, and haven't resurfaced. I did the same workout both days, it amazes me that I don't have similar pains.
  21. I'm going to say no. Even though we see 3-dimensional objects, the image we see is 2 dimensional. If you take a photograph, it looks 3d (so long as you focus on the same thing the camera did) despite it being 2d. Technically, no image is 2-dimensional, as if it is nonexistant in one dimension then it can't exist.
  22. No but it is easy to believe they are and hard for someone without a proper education in relativity to realize why they aren't. It is easy for the layperson (myself included) to think of the speed of light the same way we think of the speed of sound--if something goes faster than the speed of sound, the sound of it will arrive after it does, and it should be the same way with light. It takes a much more indepth knowledge of inertial reference frames and the skewing of spacetime at different velocities to realize this isn't true.
  23. At the moment I seem to be doing alright (I am a fat lazy slug, but there has always been the occasional physical activity, and I've done the gym thing before, so I seem to be taking to it pretty well). The way I've been doing it is what I believe is called "circuit training." Basically, spending a long time at the gym bores me, and spending any significant part of that time on a treadmill or similar also bores me, so instead I spend my time between sets with one muscle group on a different muscle group, and swap back and forth accordingly. This keeps my heart rate up and, if I remember correctly, makes my whole workout serve as a kind of cardio. I also have a plus in that I'm only 17, so, as was mentioned before I'm a little more elastic (both as far as stretching before working out and recovering after a workout) than, say, my father.
  24. Thanks. I kinda figured as much (definitely knew I'd work to the point of not getting so sore), but it's always good to check. TBH, I don't think I'm too concerned about injuring myself, but there're always so many warnings around about not overdoing it that I want to confirm I'm not. I've heard from some source before (possibly my cool but cooky health teacher) that the best course of action is to go when still sore, just not quite as sore as the day after. I think the reasoning behind this was that if you wait for the muscle to completely heal, then you're just going to wound it again when you go, whereas if you go while it is still somewhat wounded, you're not going to undo as much of the healing process. Something like that. Is there any merit to that statement or is it just a load of crocks? Just out of curiousity.
  25. So, I'm not a fit person. In nice terms, I'd call myself an overweight-bordering-on-obese lazy slug. But, the point of the matter is that I'm working to change that. I go to the gym in the morning, and I'm working on a M-W-F schedule, eventually I'll probably mix a fourth day in. My question is a simple one. Because of my overweight and lazy nature, going to the gym (when I actually work out a decent bit) causes muscle pains. No pain, no gain, right? The question then becomes, if I am still in pain 48 hours later when I go to the gym again, what is my best option? Is it to seek medical help because I should have recovered, to wait until I do recover to go again, to take it easier until I've recovered, or to push through it? Just don't want to injure myself too badly. I'm not in any excruciating pain, it's just, y'know, the type of "well, if I can avoid that position, I certainly should," pain. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.