What is the newest installment of 'Random Thoughts' on Physics Forums?

In summary, the conversation consists of various discussions about documentaries, the acquisition of National Geographic by Fox, a funny manual translation, cutting sandwiches, a question about the proof of the infinitude of primes, and a realization about the similarity between PF and PDG symbols. The conversation also touches on multitasking and the uniqueness of the number two as a prime number.
  • #10,186
Screenshot 2022-12-22 at 12.28.14 PM.png
 
  • Like
  • Haha
Likes Ibix, collinsmark, pinball1970 and 1 other person
Physics news on Phys.org
  • #10,187
Dang. Wind chill is -25 degrees F here right now. :oldcry:
 
  • Wow
Likes pinball1970 and berkeman
  • #10,188
Ibix said:
I wouldn't call that recursion, but yes it should work.
( This was re Python code that a positive integer n and ouputs the string 123..n )

I ended up using:
Python:
n=int(input)
for i in range(1,n+1):
     print(i, end = "")
Code from last line is pretty handy. Prints everything (here in the range (1,n+1)) and adjoins/appends that which is at the 'end' part = (Here the empty string ), therefore output is 1234..n (not sure why we're using n+1 rather than n)

There was another way of adjoining through ("".join(i,j) ), which does output the string 'ij' , but I would have had to iterate with a base case. Will try it some other time.

Though nots ure why I was told to include:

if __name__ == '__main__':
 
  • #10,189
dlgoff said:
Dang. Wind chill is -25 degrees F here right now. :oldcry:
The wind is not letting up. Here is what a Google search shows:
Dangerously cold wind chills from 25 below zero to 40
below zero.
 
  • Wow
Likes pinball1970 and Ibix
  • #10,190
dlgoff said:
The wind is not letting up. Here is what a Google search shows:
Dangerously cold wind chills from 25 below zero to 40
below zero.
Sorry to hear. Are you required to go out? Do you have enough provisions to last you through it?
 
  • Like
Likes pinball1970
  • #10,191
WWGD said:
(not sure why we're using n+1 rather than n)
Because range(a,b) gives a, a+1,..., b-1, consistent with range(b) giving 0, 1,..., b-1.
WWGD said:
There was another way of adjoining through ("".join(i,j) ), which does output the string 'ij' , but I would have had to iterate with a base case. Will try it some other time.
This lets you do it as a one-liner, assuming you've read in n already:
Python:
print("".join([str(i+1) for i in range(n)]))
(You may be able to omit the square brackets - not 100% sure off the top of my head.)
WWGD said:
Though nots ure why I was told to include:

if __name__ == '__main__':
__name__ stores the name of the python module, and if it is __main__ then it's the entry file - i.e., the user ran python thismodule.py, rather than the module being brought in via an import statement. If you put any "script" style code (rather than class/variable/function definitions) in that if statement then you can include the module via import in another program, and all your classes etc are available to that program without whatever script you wrote getting executed. The primary use I've made of this is to write some working demo code inside a library:
Python:
class MyClass:
    def whatever(self):
        return "whatever"
if __name__ == "__main__":
    print("Demo of MyClass' whatever() method:")
    c = MyClass()
    print(c.whatever())
Then if a user runs this module they get a little demo, but if they import it they just get the class and no random output from my little demo script. It's a bit pointless if your python file doesn't define anything you could ever possibly reuse, but using it anyway is probably not a bad habit to get into.
 
  • Like
Likes WWGD
  • #10,192
WWGD said:
Sorry to hear. Are you required to go out? Do you have enough provisions to last you through it?
I'm retired, so will be staying inside. I will only go out to drive to my mailbox. I've got enough to eat for a while. Thanks.
 
  • Like
Likes pinball1970, WWGD, Ibix and 1 other person
  • #10,193
dlgoff said:
I'm retired, so will be staying inside. I will only go out to drive to my mailbox. I've got enough to eat for a while. Thanks.
Just in case, the US Soccer team may be flying over , something may happen to the flight. In case you get too hungry. ;).
 
  • Haha
Likes dlgoff
  • #10,194
Still unclear why/how Quic/Http3 with UDP is preferred to Https with TCP/IP . Of the two, only Https with Tcp/Ip has ways of verifying whether packets arrived.

 
  • #10,195
WWGD said:
Still unclear why/how Quic/Http3 with UDP is preferred to Https with TCP/IP . Of the two, only Https with Tcp/Ip has ways of verifying whether packets arrived.

 
  • Like
Likes WWGD
  • #10,196
dlgoff said:
Dang. Wind chill is -25 degrees F here right now. :oldcry:
It's 17 degrees F and the wind chill is still -25 degrees F and every thing is ice covered. I hate winter.
 
  • #10,197
dlgoff said:
It's 17 degrees F and the wind chill is still -25 degrees F and every thing is ice covered. I hate winter.
I think of it this way: it's the season to eat rich, heavy foods that would knock you out if you ate them in winter.
 
  • Like
Likes dlgoff
  • #10,198
  • Like
Likes Borg
  • #10,199
Merry Christmas Physics Forums.
 
  • Like
Likes WWGD, BillTre, OmCheeto and 3 others
  • #10,200
Merry Christmas! 🍻
 
  • Like
Likes WWGD, pinball1970, BillTre and 2 others
  • #10,201
Astronuc said:
I expected that EVs don't perform well in weather below freezing.
"Ya think?"
 
  • #10,202
Merry Christmas all!
 
  • Like
Likes WWGD, BillTre, OCR and 1 other person
  • #10,203
Dang. More cold weather and snow See red arrow for about where I live:
snow.jpg
 
  • Sad
Likes pinball1970
  • #10,204
starting to get a little sleet now. :oldcry:
 
  • #10,205
dlgoff said:
starting to get a little sleet now. :oldcry:
Every thing is covered with a layer of ice now.
 
  • #10,206
dlgoff said:
...every thing is ice covered. I hate winter.
You would be welcome in my neighborhood, it's known as "Shake-'N'-Bake" land. :eek: (AKA Southern California)

Cheers,
Tom
 
  • Love
Likes dlgoff
  • #10,207
Some free time. Fallout Tale of Two Wastelands (mod that combines FO3 and New Vegas) here I come. Real world problems - bye bye!
 
  • Like
Likes collinsmark
  • #10,208
I ran into a former student of mine, from my days as an adjunct . He said he had been trying to reach me for a recommendation. I told him , in a nice way, that I believed my ob ligations expired after I stopped traching. Now Im not so sure.
On a related note, I found out I had missed one day of the week during two of my classes. I thought back then they were MWF classes, but they actually were MTWTh classes.
 
  • #10,209
In another thread on Pyroclastic Flows (Volcanoes), there is a post about the White Island (Whakaari) eruption of December 2019.

https://www.physicsforums.com/threads/pyroclastic-flows-200-700-c.1048467/post-6835565

There have been numerous videos of the eruption. The following videos provide interviews with some of the 25 survivors, some of whom lost friends and family members; there were 22 fatalities.
https://en.wikipedia.org/wiki/Whakaari_/_White_Island
Whakaari is an active andesite stratovolcano located about 48 km (30 mi) from the east coast of the North Island of New Zealand, in the Bay of Plenty.
 
  • Informative
Likes pinball1970
  • #10,210
Still looking for an example of someone who's hips do lie.
 
  • #10,211
WWGD said:
Still looking for an example of someone who's hips do lie.
Mine are lying in bed, along with the rest of me, if that helps.
 
  • #10,212
The dad jokes are strong with you :DD
 
  • Like
Likes Ibix
  • #10,213
WWGD said:
I found out I had missed one day of the week during two of my classes. I thought back then they were MWF classes, but they actually were MTWTh classes.
Um...
 
  • #10,214
berkeman said:
Um...
Ah, yes, MTF vs MTThF.
 
  • Like
Likes berkeman
  • #10,215
WWGD said:
On a related note, I found out I had missed one day of the week during two of my classes. I thought back then they were MWF classes, but they actually were MTWTh classes.

berkeman said:
Um.

WWGD said:
Ah, yes, MTF vs MTThF.
And I see the reason remains. :cry:
 
  • #10,216
Tom.G said:
And I see the reason remains. :cry:
I don't see it. I know it may be unusual , but we did have some MTF classes, rather than MWF , if that's what you mean.
 
  • #10,217
WWGD said:
if that's what you mean.
IMHO he's QQ about your AA :wink:

Ps.: I too wonder what MTF, MWF, MTWTh, MTThF might be...
 
Last edited:
  • #10,218
Rive said:
IMHO he's QQ about your AA :wink:

Ps.: I too wonder what MTF, MWF, MTWTh, MTThF might be...
Something about the World Wrestling Federation. Great school! But, no, its about the days of the week ;).
 
  • Informative
Likes Rive
  • #10,219
What's next? Now my water district is having a water outage.
 
  • Sad
  • Wow
Likes nuuskur, pinball1970 and BillTre
  • #10,220
dlgoff said:
What's next? Now my water district is having a water outage.
Just to let you guys know, the district just got my water going again.
 
  • Like
Likes pinball1970, nuuskur, Rive and 3 others

Similar threads

  • General Discussion
17
Replies
560
Views
11K
  • General Discussion
77
Replies
3K
Views
127K
Replies
21
Views
757
  • General Discussion
115
Replies
4K
Views
192K
  • General Discussion
65
Replies
2K
Views
142K
Replies
14
Views
1K
Replies
5
Views
431
  • General Discussion
Replies
8
Views
885
  • General Discussion
Replies
4
Views
1K
Replies
3K
Views
327K
Back
Top