Jump to content

timo

Senior Members
  • Posts

    3451
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by timo

  1. Then do it and present the answer here to have someone have a look at it
  2. timo

    "_____" expert.

    The mods invite you for a drink, it quickly becomes a few more drinks, and when you wake up the next morning you have that blue star tatooed on your forehead and can´t rub it off anymore. There is no formal test if you mean that. It´s just about whose contributions the mods and the other experts found valuable and about not realizing it´s a trap when Dave offers to buy you the 3rd beer. Why should you even want to know?
  3. In the end, there´s different levels of commenting so don´t assign my comments on your comments too much of importance. Two important criteria for chosing frequency and style of comments are: - For whom are they supposed to be? Is it just for you so that you don´t get lost in the code? Is it for you in case you want to have a quick reference in case you are looking into the code again months/years later? Is it for others who work on the same project and possibly even the same files and methods as you? Is it for others who might have to look into the code later (for debugging or extensions)? Or is it even a tutorial for absolute beginners? - What level of knowledge about programming and the topic that you´re programming for can you expect of the target audience? If you´re just commenting fro yourself and are new to the language, even commenting an else-statement with "otherwise" can be ok. In my experience, the more advanced the target level, the more "abstract" the comments can be. E.g. I wouldn´t comment all lines in a subroutine that orders some fields alphabetically, I´d just comment the routine with "sorts the fields alphabetically" and possibly state restrictions on what the entries of the fields may be or what other restrictions there might be. In other words: Just ignore any of my statemetns about your commenting if you think they are irrelevant for you... Glad I could help you. You are in fact the first SFN person I ever saw to start some project and actually finish it (looks at the staff awards and the letter to the authors of some creationist-video, the proposal to create a section for scientific experiments, ...). The idea about loading, editing and saving was meant in the sense that you give the menu a method "save(filename)" which ... big surprise ... saves the menu structure to a file. If you want to use the menu in another programm, you could just load it with another method "load(filename)" instead of adding mainMenu = Menu('main menu', ['menu1', 'menu2', 'menu9', 'menu4', 'menu5', 'menu15', 'menu20'], 'Choose a feature to test', 'see source (up the top) for what stuff like "discription override" means') menu1 = Menu('test discription override', ['menu6', ['menu6', 'a banana. not a menu, and if it was, it wouldnt be the same menu as above. honestly.']], 'the below menus are the same, but the second has its default discription overriden', 'press m or b to go back to the main menu once youve gotten bored') menu2 = Menu('test help entries', ['menu7', 'menu8'], 'menus with and without help. whooooo!', '') menu4 = Menu('test menu linkings', ['menu12'], '', '') menu5 = Menu('test linking to functions', ['menu14'], 'test linking to functions', '') menu15 = Menu('test empty perameters', [['menu16', '(this menu has no discription, and a discription override. the next item is the same menu with no override)'], 'menu16', 'menu17', 'menu18', 'menu19'], 'menu items that have blank perameters', 'i.e., self.discription, self.hellp, self.submenu, or self.text = ""') menu20 = Menu('test the back feature', ['menu21'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu6 = Menu('an empty menu to help test discription overrides', [], 'press b to return to the last screen', '') menu7 = Menu('a menu with some help', ['menu8'], 'press h. marvel at the helpfull information. go on, you know you want to.', 'press some buttons and then press return ;)') menu8 = Menu('a menu with no help', ['menu7'], 'press h. witness the wondorously useful default help message.', '') menu9 = Menu('conditional menu', [['menu10', '', 'condition == 0'], ['menu11', '', 'condition == 1'], ['swapcon()', "change the global variable \'condition\'"], ['print "the value of the variable \'condition\' is", condition', "check the value of the variable \'condition\'"]], 'test the conditional display feature', "change the variable \'condition\', and the menu should display differently") menu10 = Menu('conditional test 1', ['menu9'], 'you should only be able to reach here if "condition" is 0', 'dont forget, b = back') menu11 = Menu('conditonal test 2', ['menu9'], 'you should only be able to reach here if condition = 1', 'b is back.') menu12 = Menu('menu12', ['menu13'], 'this is menu 12, and should link to menu 13', '') menu13 = Menu('menu13', ['menu12'], 'this is menu13, and should link to menu 12', '') menu14 = Menu('a menu with a function', [['domath()', 'add a number to two']], 'the entry below points to a function, not anothe menu', '') menu16 = Menu('', ['menu15'], 'this menu has no discription', 'hello') menu17 = Menu('a menu with no submenu', [], 'this menu has no submenu', 'hiya') menu18 = Menu('a menu with no intro text', ['menu15'], '', 'hi') menu19 = Menu('a menu with no help', ['menu15'], 'this menu has no help', '') menu21 = Menu('1 screen from the start', ['menu22'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu22 = Menu('2 screens from the start', ['menu23'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu23 = Menu('3 screens from the start', ['menu24'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu24 = Menu('4 screens from the start', ['menu25'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu25 = Menu('5 screens from the start', ['menu26'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu26 = Menu('6 screens from the start', ['menu27'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu27 = Menu('7 screens from the start', ['menu28'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu28 = Menu('8 screens from the start', ['menu29'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu29 = Menu('9 screens from the start', ['menu30'], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') menu30 = Menu('10 screens from the start', [], 'keep following the submenus, then see if you can return using the b button', 'you can only go back 10 screens, so you wont be able to make it ALL the way back') to the code. Plus, I think it is a good exercise on how to save and store tree structures to a file.
  4. Why ?
  5. I didn´t read the code but from a brief look at the appearance: - A four-digit version counter and a licence for a stupid first attempt to learn Python ?!? - Update history, roadmap, glossary, bugs is complete overkill. - Usage part is nice, especially because iirc the parts inbetween """ and """ are displayed as class-documentation within Python. Put all relevant parts there and screw the irrelevant stuff I mentioned in the previous two points. - Don´t comment methods and classes with the #, use the """ because it´s then also displayed within the Python class documentation. - commenting an else-statement with "# otherwise" is pointless. Either skip it or (preferrably) explicitely write what cases this "otherwise" covers. - Make the comments more visible as such and try to format them better. Example: class Menu: def __init__(self, description, submenu, text, hellp): self.description = description #for use in other menus (submenu description) self.submenu2 = submenu # list of other menus/actions self.submenu = [] # this will be the submenu used. generated on the fly. self.text = text #introductory blurb to menu self.hellp = hellp # help item would better read class Menu: def __init__(self, description, submenu, text, hellp): self.description = description # for use in other menus (submenu description) self.submenu2 = submenu # list of other menus/actions self.submenu = [] # this will be the submenu used. generated on the fly. self.text = text # introductory blurb to menu self.hellp = hellp # help item - In contrast to what many beginners seem to believe, adding a lot of lines like #####... or -------... or similar does not improve the readability of the code unless it is used extremely sparsely (in which case one can as well split the stuff up in several files which has a much better readability). I don´t know the reason for it but somehow these "I make clear that something new comes here"-lines have worsened the readability of a code or text in almost all cases I´ve seen. EDIT: Not related to your original question but as a possible follow-up idea: The menu-construction code looks long and boring which is practically unavoidable. How about improving the functionality to loading, editing and saving the menu strucuture ?
  6. If it is what you are talking about, then maybe start from the links given there: http://en.wikipedia.org/wiki/Smart_antenna
  7. The 1.21 meters is wrong. Hotcommodity already sent me a PM with the correct result (or was it only the calculation and not the result? dunno) but I am not sure if I am supposed to tell it so I´ll leave it to him. Let´s say we were beaten by a quantization effect .
  8. Ok, that is exactly what you posted in your first post. I have no idea of why the 1.21 meters should be wrong, so unless someone else in here has a good idea, you´ll probably have to ask your teacher.
  9. Can you perhaps post the original wording of the questions in case it wasn´t the same as in your first post?
  10. The way I understood the question your answer should be correct, so sorry if I misunderstood the question and led you on the wrong track. Are you sure that 1.21 meters is wrong?
  11. Do you know that you need a good calculator, do you think it or are you even afraid of that it might be like that? I can almost assure you that any calculator that is one level above an advertising gift is fully sufficient for studying physics or mathematics at a university. I would still use my good old TI-30 if the pi and the 3 button were still working. That having said, I should note that I naturally cannot judge on the advantages a better calculator might have - but it's probably nothing you really need.
  12. What is the horizontal extent of the old staircase? Try to answer that (maybe draw a diagram). Then, the answer to the question should become easy. "Farther into the room" supposedly means the difference between the old horizontal extent and the new one (in case that was your problem).
  13. For future posts like that please give at least some small summary (two or three sentences should suffice) of what the article is about so that people might get an idea of whether they´d like reading the article or not. A well-chosen thread topic (which already is a good start) and the statement that you found the article interesting for me is too little information to decide that. Don´t get the dry formulation in above wrong, this is not supposed to be a rant but rather a hint.
  14. Thanks for the suggestions. The matter (of drawing the diagram I was thinking about) is currently set back due to more important issues at hand but I will check back to your suggestions in case I decide to add the diagram.
  15. I want to add a sketch on a binary tree-structure to a scientific publication. I´d like to draw the sketch more or less directly in postscript of pdf format so that I don´t have to worry about how it looks when it is rescaled later. The functions I´d need are - Drawing a circle - Draving lines connecting them - A few dots would be nice but are not nessecary - Rectangles would be nice, too - Text and greek letters Does anyone by chance know a good freeware WYSIWYG editor that I can use to do that? Freeware is important, easy installation also is (so preferrably a windows prog), WYSIWYG is also nessecary because otherwise I could as well use the TeX drawmode.
  16. As I understood it they simply let a beam of light and a beam of electrons collide/cross. I am not really getting your question. Are you asking how to create an electron beam? There´s probably a lot of possibilities doing so. One that comes to my mind is heating a cathode, accelerating the emitted electrons in a constant electric field and focus the mess with magnetic lenses. That´s done in electron microscopes, for example. If you really want to produce high-energetic gamma rays out of a laser<->electron collision you´ll probably need a very high-energetic electron beam. The threshold value for a gamma to undergo pair production is in the order of 1 MeV. Let´s assume the electrons in your beam would need roughly the same energy as kinetic energy (you can perform the calculation I sketched in above to get a better value), then I´d think you can forget any hope to get that energy form a constant electric field: The voltage needed is 1 million volt. There are other ways to get high-energy electron beams but I´d have to read up on that, too.
  17. I might be missing the point but for me it seems that from the point of view of physics, there is nothing spectacular going on. Photons are scattered on electrons. A little cooking-recipe: If one is only interested in the possible energies and momenta of the scattered photon, calculating this is not too hard: 0) Given is an initial photon and an initial electron with four-momenta p1 and p2, respectively. They scatter. What one is interested in is the momenta of the scattered particles as a function of some parameters. I´ll denote the momenta of the scattered particles by k1 and k2. Quick note on my notation: [math] p_1 = (E_1, \vec p_1) [/math]. 1) Do a Lorentz Transformation T to a system in whcih p1+p2 = (Ecms, 0, 0, 0). Ecms is the energy in that system. Its value doesn´t matter here. 2) In that frame of reference (the so-called center of mass system), [math] \vec p_1 = -\vec p_2 [/math] and due to conservation of momentum and energy also [math] \vec k_1 = -\vec k_2, |\vec k_1| = |\vec p_1| [/math]. 3) All possible k1 and k2 can be obtained by rotating [math] \vec p_1, \ \vec p_2 [/math] by an arbitrary degree around an arbitrary axis. The energy entries are fixed by [math] \vec k_1, \ \vec k_2[/math] and the particle masses. The degrees of freedom for a rotation in 3D is two, so I´ll assume the rotation is described by two angles A and B for the following. 4) Determine k1 and k2 as a fucntion of A and B. 5) Apply the inverse Lorentz transformation T^-1 on k1 and k2 to get back to the original frame of reference (lab system). 6) The back-transformed k1(A,B) and k2(A,B) are all possible energies and momenta for the scattered particles. Investigate them for whatever property you´re interested in. Note: Above is rather generic and can be substantially simplified for the given case. The key point only is that you do a Lorentz Transformation to a system where the scattering process looks simple. @YT: In theory, the properties of the laser do not matter. You just need photons. Practical applications in which you might want to have a controlled and measurable flux of high-energetic photons are a different issue, of course. Charge used is the elementary charge, of course (electrons). @[Thyco?]: It´s a normal scattering process. @insane_alien: The explanations seems ok but the increased energy of the photons imho is not really a relativistic effect. You can also increase the energy of an incoming tennis ball by hitting it hard with your racket.
  18. Iirc, you cannot arbitrarily put memory sticks in the slots but have some restrictions. I think that for example the sticks have to be pair-wise identical. What I´m slightly wondering is that 2.5 GB are recognized. Getting 2 GB would make sense since you said yourself that 3 sticks are not supported. I´d assume that you´ll have 2 GB and that the 2.5 GB is buggy. I´d also think about taking out the 3rd memory stick if your mainboard manual states that it´s not supported (or alternatively get a 4th stick). But the last time i put a computer together has been ~5 years ago, so I´m not really up to date on modern technology.
  19. The article on the solar system only states "there were proposal for new mnemonics like ...". At least there is a reference to the old version of the mnemoric and it wasn´t the Nachthimmel-version. But it seems that I was too fast in judging that "Nachthimmel" will be it because it´s written on Wikipedia - there seem to be discussions going on. Chances are that a discussion about it might even make it to the yellow press or "yellow tv". I like the "Mein Vater Erklärt Mir Jeden Sonntag Unsere Neudefinition"-version (= "... our new definition") but it probably has little potential to become a classic. EDIT: It´s funny to see that a rather irrelevant thing such as whether to call Pluto a planet, a dwarf planet or a gremlin leads to such a noise - just because for one time in science, everyone has the feeling to know what´s being talked about (I personally don´t feel like I knew what´s being talked about, btw). http://www.spiegel.de, a very frequently visited news page already calls for people to send them proposals for new mnemonics. I suppose the same thing happens in english-speaking countries, too.
  20. I tend to agree. From my understanding of the original method, stem cells were harvested from material that would have been thrown away otherwise. I feel more uncomfortable by removing parts of an embryo that will later grow up to a human being than to remove parts from something that would end up in the trash can, anyways. However, due to my limited knowledge of what it´s all about, I do not really have a fixed stance here. For example, I cannot judge wether removing one of the cells is better compared to donating blood or to cutting off a leg. There seem to be claims that there´s no impact on the later baby, but the tone sounds slightly reserved. Not sure if that´s due to doubts or due to professionality.
  21. In combination with that link that´s a funny statement. You are right, that mnemonic is widely used and it´s also how I remember the order of the planets. However, Wikipedia seems to be very fast at adopting to changes that make some publicity. The article you linked to has already changed and the new mnemonic is now "Mein Vater Erklärt Mir Jeden Sonntag Unseren Nachthimmel". It might be the form it had before the discovery of Pluto. But it might also be that the change was made simply by some creative person. In that case, given the high number of visitors Wikipedia gets, we might have witnessed the birth of a new mnemonic. Not that this will have much historical consequences, but given that social/cultural scientists sometimes do a lot of research to figure out where a saying comes from, I find it interesting to see the birth of one. EDIT: I wanted to ask the person who changed the Wikipedia article about how he came up with the new sentence. Sadly, the change was made by an IP which does not seem like a permanent IP. I had really liked to know how he/she came up with it, but now it seems I´ll never know.
  22. timo

    Relocating Israel

  23. Yes. And Woelen got that result before, also. I was not saying that you´re wrong by saying that gravitational force weakens when you come closer to the center. In fact, I explicitely said it did by stating F~r (r=0 should be the center of earth, r=6000 km the surface). However, what your statement I replied to implied (or at least how I read it) was that at half the radius you´d have a quarter the force as on the surface. It´s half the force, not a quarter. Your argumentation about when you are at 1000 km depth you are only pulled by a sphere of a radius of 5000 km is absolutely correct. That is exactly what goes into my m®. What is incorrect is your claim about the force not dropping linearly. I have an idea of why you think so (namely because the amount of mass effectively pulling does not go linearly) but you seem to forget that gravitational acceleration is not only a function of mass but also of distance. The two effects combined give you a linear dependency. I´d normally say "do the math to see it yourself" but in this case I have already done the math, so perhaps take another look at my calculation sketch in my previous post to see why the force drops linearly.
  24. Gravitational force is proportional to the distance from the center, not ~r² as you seem to imply. Reason: Assuming a homogeneous mass-distribution for earth and m® being the mass that effectively pulls (the mass being in a sphere around the center of earth with a radius equal the object´s distance to the center), then F ~ m®/r², m® ~ r³ => F ~ r. Ok, that already was my point, but since I´m at it I´ll take the fun provide just another guess of the velocity at the center: Knowing the dependence of the force on the distance from the center and ignoring friction, you can easily compute the difference in potential energy between the center and the surface: [math]E= \int_0^R m r g / R \ dr = 0.5 mgR [/math]. Equating this with the kinetic energy (potential energy difference is converted to kinetic energy), you end up with [math] 0.5 mv^2 = 0.5 mgR \Rightarrow v = \sqrt{gR} \sim \sqrt{10 \cdot 6\cdot10^6 \frac{m^2}{s^2}} \sim 8000 m/s [/math] One thing: Please use SI units. Not everyone wants to look up the definition of feet and miles and SI is common knowledge.
  25. timo

    OpenSci?

    Ha Ha ... suppose I have an idea for the suggestions thread now.
×
×
  • 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.