Jump to content

FragmentedCurve

Senior Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by FragmentedCurve

  1. It wasn't latched. And no... I don't smoke anything... I'm not here for ethics (despite my avatar).
  2. Why would it be animal cruelty? Are you saying it's like dangling a treat in front of a dog but never giving it to him?
  3. While browsing around "Amateur Science" topics, I was reminded of an experiment I did a while ago. Whenever I'd go hiking with friends, especially one particular friend, I'd come out of the woods and he'd never have a single tick on him. I often wondered if ticks somehow choose a preferred host. So, one day after hiking, we took the tick that was on me and did a small experiment. We sat between two to three feet apart on a wood floor and placed the tick in the center of us. We would then wait to see who the tick would walk to. After he within a couple inches of our body, we would change our positions and orientation and put the tick in the center again. The result was 10 out of 11 times the tick walked to me.
  4. fun_list3 = [lambda e: e + i for i in range(5)] The variable i is outside the scope of the lambda function. Let's rewrite the above to make this clearer. fun_list3 = [] for i in range(5): fun_list3.append(lambda e: e + i) This will produce the same list you wrote but is more explicit about what's going on. The variable i in your lambda function is referencing the i variable from the for loop. It's not doing what you think, which is inserting the value of i over each iteration. The i in your lambda function and the i in the for loop are pointing to the same place in memory. You can see this by doing the following: Python 3.8.5 (default, Sep 5 2020, 10:50:12) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> fun_list3 = [] >>> for i in range(5): ... fun_list3.append(lambda e: e + i) ... >>> print([f(10) for f in fun_list3]) [14, 14, 14, 14, 14] >>> i = 555 >>> print([f(10) for f in fun_list3]) [565, 565, 565, 565, 565] >>> You can do what Sensei said above, but that will introduce an optional argument for each of the lambda functions in the list. For example, Python 3.8.5 (default, Sep 5 2020, 10:50:12) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> fun_list3 = [lambda e,f=i: e+f for i in range(5)] >>> print([f(10) for f in fun_list3]) [10, 11, 12, 13, 14] >>> print([f(10, 555) for f in fun_list3]) [565, 565, 565, 565, 565] >>> I personally would do the following which is have a lambda function that takes i as its argument and returns another lambda function. fun_list3 = [(lambda f: lambda e: e + f)(i) for i in range(5)] Python 3.8.5 (default, Sep 5 2020, 10:50:12) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> fun_list3 = [(lambda f: lambda e: e + f)(i) for i in range(5)] >>> print([f(10) for f in fun_list3]) [10, 11, 12, 13, 14] >>> print([f(10, 555) for f in fun_list3]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 1, in <listcomp> TypeError: <lambda>() takes 1 positional argument but 2 were given >>>
  5. As Strange pointed out, understanding the concepts of algorithms, data structures, and design patterns is far more important than learning a specific language. However, I'd like to append the following to that. I'm assuming you want to learn how to program because of some curiosity drive deep down and not purely for filling out a job application. Whatever kind of software has caught your passion at the moment, look at what the developers use to build it. For example, if you're daydreaming about building kernels and bootloaders, look at what languages and tools the developers of Linux, FreeBSD, or Windows use. Are you dreaming up websites? Look at what the developers of stackoverflow or reddit use. Whatever it is, you can use that as a starting point.
  6. I never did this so why not now. You can just call me by my username. Back in the day (before stack overflow), I was very active on technical forums; mostly about programming. I kinda miss engaging on lively forums.
  7. No apologies are needed. These are exactly the kind of discussions I was hoping to stimulate. Given that I am more rusty than Carrock, I feel like I don't have a lot to contribute. I'm reviewing material and trying to answer my own questions before coming back here and naively pushing them onto you. I know it wouldn't produce a lot of electrical energy. Also, electrical energy isn't a requirement either. The reason I mentioned electrical energy is because its probably the most useful form of energy for practical purposes. But the end result doesn't matter much as long as its somewhat more useful than the input (the hot air). The point behind my post was about structuring a material that would be able to excite an electron on a chlorophyll-like molecule by only the kinetic energy of gaseous particles alone. I just realized why I'm having trouble communicating my response. There's really two parts to my inquiry. The first part is about constructing such a material. The second part is what are the effects of such a material on the temperature of a gaseous body. The thoughts about air conditioning were just the catalyst for thinking about the chemistry and physics of this situation. I attached a poorly drawn conceptual diagram. So the green particles hit A at the same time causing enough energy to be transferred to B and excite B's electron. Which laws of nature stop A from successfully exciting B's electron? I hope I did not come across a someone looking to convert heat with 100% efficiency or worse (someone looking for free energy).
  8. Can you narrow down which part is a violation for me or go into more detail?
  9. I am not a chemist nor a chemistry major. My background is in mathematics and CS. However, when I was majoring in mathematics, I enjoyed chemistry very much and spent a lot of time studying it on the side. Years later I find economics pulling me far away from anything that gave me meaning. Because of this, I've recently been returning to things that gave me a reason to wake up in the morning. The point of me saying all this is to warn you my rhetoric and understanding may be crude when it comes to chemistry. Back in college, when I was taking an inorganic chemistry course, I was daydreaming about gases and air conditioners and wondered why we spend energy to remove energy from the air. Couldn't we convert the kinetic energy in the air to cool down a room? I discussed this with the professor but she didn't have a lot to say about it. Then, I was thinking about chlorophyll and how specific parts of the light spectrum will hit it causing the electron (from the Mg atom I think) to become excited, converting that energy into chemical energy. Why can't a molecule do this for the kinetic energy in the air? From a user point of view, there would be a material on the wall, and the more material that is uncovered and exposed to the air, the more heat in the air would be converted into electrical energy. So the temperature of a room would be controlled by how much of the material is exposed. Extending the crux of the idea a little, maybe the material would consist of layers. So the top layer would be an amplifier, to hit the chlorophyll-like molecule with enough force to excite the electrical energy. So, if 3 gaseous particles hit an amplifying molecule on the top layer, it redirects the impact from all three into a single point. The end goal of the material is to convert the heat in the air to electrical energy and store it somewhere else. Besides the material not existing, is this absurd? Is there any merit in this line of thought? What are your thoughts?
  10. Testing [math]\sum_{i=1}^{n} i = \frac{n(n + 1)}{2}[/math] This is inline [math]f(x) = x^{2}[/math]. The LaTex isn't rendered when previewing a post.
  11. I need to make my first post somewhere, so why not here. I think it would help if you showed your attempt. Before I attempt to explain part B, let me ask you: is 0 in the interval (0, inf) and what's the closest real number to 0?
×
×
  • 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.