Re: I need help for multidimensional loop
Growth Hacking Formation on Sun, 26 Jan 2020 12:36:05 -0800 (PST) typed in comp.lang.python the following: >Hi guys, > >I need your help please to sold a complicate problem. > >It is difficult for me to find the solution but in fact, I am sure it is just >a few lines of code. > >The problem is about some kind of multidimensional loop with some test IF. > >I worked hours on it, but I am a newbie and it is too difficult. > >I was wondering if a super expert in python could give me a hand. > >In order to give a maximum of info (explanations + code + screenshot), I >prepared a google doc for better understanding. Here in a Facebook post would >be too hard to read. > >https://docs.google.com/document/d/1UQ1-PdU00kQnJCaLJDYHveWyEXLX_5MTv56fwvECb1w/edit?usp=sharing > >Thanks for help. > >Have a great evening. I realize that if you could explain it well enough for someone else to realize what your problem is, you should be able to see the solution yourself. It would be better if you could provide a short "elevator itch" on what you're trying to do. Cause "multidimensional arrays" can get hairy really fast. I mean, try building a sieve of erostothenses using arrays in integers [0..maxint] in size. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: question about making an App for Android
Dennis Lee Bieber on Sat, 12 Oct 2019 12:26:43 -0400 typed in comp.lang.python the following: >On Fri, 11 Oct 2019 20:41:47 -0700, pyotr filipivich >declaimed the following: > > >> I've been hacking around with what needs to be computed. As in >>"okay,the orbits have different speed at different points on said >>ellipse, and so ummm, what does that do to sidereal time?" And so >>forth. >> >> And as I've said, "How did they do this without a mechanical >>clock?" I really need to look that part up _first._ >>> > > Water clocks go back centuries >https://en.wikipedia.org/wiki/Water_clock and sundials were used for >daylight (since noon is when the shadow is shortest it is an easily >determined point, and one could then calibrate a 24+hour water clock by >comparing noon to noon). > > But that said, those ancients also believed in a geocentric universe, >and started adding epicycles to the cycles of the planets to account for >the apparent retrograde motions -- their idea of the planet orbits begin to >look like things created with spirographs. > > For more advanced (heliocentric orbits)... Like comets, say... One did >angular measurements against the "fixed stars" and sidereal time (what star >is overhead "now" measured from some declared 0 point -- first point of >Aries, say, which is overhead at night in September [in April the /sun/ is >overhead when it is in Aries]) cf: Angles-Only Orbit Determination (vs >range-only, or range&angle, both of which need either radar or multiple >observations from different locations on the earth [parallax computation to >determine range]) > > The star XYZ is at zenith and the wanderer is x-deg west and y-deg >south of it. Next night star XYZ is at zenith and wanderer is x2-deg west >and y2-deg south. Though one may not need to wait for zenith, if one also >measures the east/west angle for star XYZ relative to the observer zenith >[to determine time relative to the zenith passing]. Thanks, that clarifies things a bit. I'd figured that was some thing on how it would go. -- pyotr filipivich The question was asked: "Is Hindsight overrated?" In retrospect, it appears to be. -- https://mail.python.org/mailman/listinfo/python-list
Re: question about making an App for Android
Dennis Lee Bieber on Fri, 11 Oct 2019 20:05:03 -0400 typed in comp.lang.python the following: > >* To support my practically unused 8" SCT {especially in cloudy Michigan}{I >also need to find some sort of battery holders that will fit the fork arms >-- the originals have cracked at the ends and don't make contact} > ># Started with an interest producing ephemerides for comets -- back when >Sky&Telescope used to produce element sets for comets [and when it was >thought comets might be elliptical, parabolic, or hyperbolic -- I think >modern thought is that they are all elliptical, but may be of such a long >period that no one would ever prove it]; now they just provide finder >charts. Also, in a former life I was a programmer at a firm that did >satellite work -- even if I couldn't follow all the math [one book had >equations that lost me on page three!] it helped to have some understanding >of things like perturbations and gravitational models of the earth. I've been hacking around with what needs to be computed. As in "okay,the orbits have different speed at different points on said ellipse, and so ummm, what does that do to sidereal time?" And so forth. And as I've said, "How did they do this without a mechanical clock?" I really need to look that part up _first._ > -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: question about making an App for Android
Chris Angelico on Fri, 11 Oct 2019 10:43:53 +1100 typed in comp.lang.python the following: >On Fri, Oct 11, 2019 at 10:40 AM pyotr filipivich wrote: >> Chris Angelico on Fri, 11 Oct 2019 09:49:03 +1100 >> typed in comp.lang.python the following: >> >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber >> >wrote: >> >> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich >> >> >> >> declaimed the following: >> >> >"A simple program" to divide the amount of "today's" daylight into 12 >> >> >even '"hours", so that Dawn begins the First hour, the third hour is >> >> >mid-morning, noon is the middle of the day, the ninth hour mid after >> >> >noon, and the twelfth hour ends at sunset. Is simple, no? {no.} >> >> Even ignoring "phone" this is anything but simple. It relies upon >> >> knowing one's latitude and date to allow computing the angle of the sun. >> >> And you'll need to handle the fact that above/below arctic/antarctic >> >> circles you will run into "zeros" where there is either 24 hours of >> >> daylight or 24 hours of night. >> >Or maybe it's really simple, because there's an HTTP API that >> >gives you the information. There's an API for everything these days. A >> >quick web search showed up this: >> >https://sunrise-sunset.org/api >> Thanks. >> >Which means the project is a matter of taking the data and formatting >> >it. (Also probably getting lat/long from the phone's location API.) >> >I'd say this is a good-fun project - a one-week project for a student, >> >a weekend project for an expert. And yes, there WILL be edge cases to >> >deal with, but for the most part, it shouldn't be too hard. >> A one week project for a student. or Longer for a non-student. >> Oh well, as I say a lot: this wild be easy if I was doing it forty >> hours a week. And this part is a spin off of a larger mess, trying to >> understand how astronomy was done before the invention of mechanical >> clocks. I get some off the wall inspirations. > >Sure, you can gauge your own skill level to get some idea of an actual >timeframe. The programming skills have grown rusty. > >I'd recommend starting with a simple non-phone version of the idea, >and then think about porting it to a phone. That should reduce the >problem's complexity significantly. Or I could just "cheat" and make a mechanical clock which does the same thing. Maybe not as elaborate as the Japanese Myriad Year clock. Something along the lines of what Masahiro Kikuno did with his wristwatch. (18 million Yen, custom fitted to your latitude.) but adapted for "western" hours. The making is "easy", it is the engineering which is hard. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: question about making an App for Android
Chris Angelico on Fri, 11 Oct 2019 09:49:03 +1100 typed in comp.lang.python the following: >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber >wrote: >> >> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich >> declaimed the following: >> >"A simple program" to divide the amount of "today's" daylight into 12 >> >even '"hours", so that Dawn begins the First hour, the third hour is >> >mid-morning, noon is the middle of the day, the ninth hour mid after >> >noon, and the twelfth hour ends at sunset. Is simple, no? {no.} >> > >> Even ignoring "phone" this is anything but simple. It relies upon >> knowing one's latitude and date to allow computing the angle of the sun. >> And you'll need to handle the fact that above/below arctic/antarctic >> circles you will run into "zeros" where there is either 24 hours of >> daylight or 24 hours of night. >> > >Or maybe it's really simple, because there's an HTTP API that >gives you the information. There's an API for everything these days. A >quick web search showed up this: > >https://sunrise-sunset.org/api Thanks. > >Which means the project is a matter of taking the data and formatting >it. (Also probably getting lat/long from the phone's location API.) >I'd say this is a good-fun project - a one-week project for a student, >a weekend project for an expert. And yes, there WILL be edge cases to >deal with, but for the most part, it shouldn't be too hard. A one week project for a student. or Longer for a non-student. Oh well, as I say a lot: this wild be easy if I was doing it forty hours a week. And this part is a spin off of a larger mess, trying to understand how astronomy was done before the invention of mechanical clocks. I get some off the wall inspirations. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: question about making an App for Android
Dennis Lee Bieber on Thu, 10 Oct 2019 18:39:55 -0400 typed in comp.lang.python the following: >On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich >declaimed the following: > > >>"A simple program" to divide the amount of "today's" daylight into 12 >>even '"hours", so that Dawn begins the First hour, the third hour is >>mid-morning, noon is the middle of the day, the ninth hour mid after >>noon, and the twelfth hour ends at sunset. Is simple, no? {no.} >> > Even ignoring "phone" this is anything but simple. Which is why it was in quote marks. Yes, it is a simple concept, it is the bloody implementation which gets complex. > It relies upon >knowing one's latitude and date to allow computing the angle of the sun. >And you'll need to handle the fact that above/below arctic/antarctic >circles you will run into "zeros" where there is either 24 hours of >daylight or 24 hours of night. I figure to initially set it for 48 degrees north, which will be close enough for my purposes. > > Properly speaking, "transit" (noon) may NOT be midway between rising >and setting. > >Astronomical Formulae for Calculators (4th Ed, Jean Meeus, 1988 >Willmann-Bell) > Chapter 21 Equation of Time > Chapter 41 Ephemeris for Physical Observations of the Sun > Chapter 42 Rising, Transit, and Setting > >Astronomy With Your Personal Computer (2nd Ed, Petter Duffett-Smith, 1990 >Cambridge University Press) (Chapters are named by BASIC subroutine) > RISET for rising and setting time > SUN (maybe of use) > SUNRS for civil time sunrise/sunset, along with beginning/end of >civil, nautical, and astronomical twilight. > >Practical Astronomy with your Calculator or Spreadsheet (4th Ed, P. >Duffett-Smith & J. Zwart, 1989 Cambridge University Press) > Chapter 49 Sunrise and Sunset > Chapter 50 Twilight > Chapter 41 The Equation of Time > > > The phone GPS services, if available, may provide the local latitude to >the application. > >>But getting from the development environment (the desktop) to the >>phone is something I am clueless about. >> > > Getting anything that is not written in Java onto an Android phone is >likely going to be a pain. You will most likely need an environment that >runs on ARM architecture. And I have no idea what iOS requires. Thanks. Not necessarily what I wanted to hear, but what I did need to hear. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
question about making an App for Android
What I want is a "simple" program to calculate and display the "natural time", and do so on my phone. "A simple program" to divide the amount of "today's" daylight into 12 even '"hours", so that Dawn begins the First hour, the third hour is mid-morning, noon is the middle of the day, the ninth hour mid after noon, and the twelfth hour ends at sunset. Is simple, no? {no.} But getting from the development environment (the desktop) to the phone is something I am clueless about. Any clues on the matter? tschus pyotr -- APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums. -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -- https://mail.python.org/mailman/listinfo/python-list
Re: Filters
T Berger on Tue, 12 Jun 2018 07:45:58 -0700 (PDT) typed in comp.lang.python the following: >Why doesn't the system allow me to set filters for my own posts? I was able to >do it once, but when I returned to the forum, I was back among the unfiltered >posts. When I tried to reapply the filter, the option was grayed out. Message-ID: <57e2e5cf-3d17-4127-ba0b-16eaea1ab...@googlegroups.com> That says it all. "It is not a bug, it is a feature." Google has totally screwed up their archiving of Usenet, and doesn't care bugger all for those who use it. You must conform to the new Method of Web based Fora. >Also, I've selected the option to get email updates to my posts, but the >option seems to work only selectively. It is Google. They will decide what is evil. and not do that. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: Filtering computer.lang.python
Mark Lawrence on Wed, 11 Apr 2018 20:07:47 +0100 typed in comp.lang.python the following: > >> for totals of 2168 fetched and 4384 killed; that is, the group >> is now 2/3 spam and the volume doesn't seem to be decreasing. >> I don't understand why other groups gatewayed to Google Groups >> aren't spammed, but from a limited sample they don't seem to be. >> >> Will >> > >I have recently given up killing all the crap directly on gg as I can't >be bothered any more. That is I would go onto gg and directly mark all >the spam as spam. Is this coincidence? There's your problem "Google Groups". Whatever it is, Google Groups doesn't seem to be "Usenet". -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups
breamore...@gmail.com on Sat, 3 Feb 2018 04:33:36 -0800 (PST) typed in comp.lang.python the following: >On Thursday, February 1, 2018 at 5:01:58 PM UTC, superchromix wrote: >> Our own programming discussion newsgroup, located at comp.lang.idl-pvwave, >> started receiving spam messages several months ago. >> >> Two weeks ago, access to comp.lang.idl-pvwave was blocked by Google Groups. >> >> When trying to access comp.lang.idl-pvwave, a message is now displayed, >> stating that the group owner needs to remove the spam, and can then apply to >> Google in order to have access reinstated. >> >> However, old public Usenet groups like this have no owner. The >> comp.lang.idl-pvwave group is more than 20 years old. Hence, there is no >> way to unblock the group. >> >> This is a serious problem, since the entire collection of postings going >> back many years has been blocked, no just the spam. This resource is >> frequently used by IDL programmers. >> >> Seeing the spam postings in this newsgroup, I expect something similar may >> happen to comp.lang.python, soon. > >That's no big deal as this list used to have a wonderful signal to noise >ratio, now it would be better to report the noise to signal ratio. I've just >finished flagging up 45 consecutive messages on the group as spam, all of them >from today and all of them from the "Case Solutions" crew. So you just indicated that of N postings, 45 different ones were spam? Rather than indicate that one poster of N is a spammer? I know, Google doesn't let you filter posts on author, and make specific authors or subjects to be ignored. And their search engine is a joke. >The downside of this list being blocked is that you'd all no doubt miss my >wonderful contributions :) Unless of course a new list is opened, properly >moderated, with a really original name like python-users. Those of us who do not use google-groups may not notice the loss of the google groupies. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: What's with all of the Case Solution and Test Bank nonsense posts?
timetowal...@gmail.com on Sun, 9 Jul 2017 16:39:44 -0700 (PDT) typed in comp.lang.python the following: >I use https://groups.google.com/forum/#!forum/comp.lang.python to look over >message posts. > >What's with all of the Case Solution and Test Bank nonsense posts? >Is is possible to have these posts filtered out? Kill files are your friend. marking all from author: allcasesoluti...@gmail.com "Read" works for me. you could delete them. Unfortunately, how to get Google Groups to behave properly is another story entire. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: Can we please dump google groups completely?
breamore...@gmail.com on Sat, 1 Jul 2017 14:19:22 -0700 (PDT) typed in comp.lang.python the following: >Yes I know it's daft that it's where I'm posting from, but I'm still banned >from using the main mailing list. I've reported over 80 posts today alone, >meaning that it's less than useless for anybody who is seriously interested in >Python. wxpython did the same years ago, why can't we? > >Kindest regards. > >Mark Lawrence. Um, on Usenet, you don't get that option (to ban a source). OTOH, you could take it up with your ISP admin. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])
Ian Kelly on Sun, 10 Apr 2016 07:43:13 -0600 typed in comp.lang.python the following: >On Sat, Apr 9, 2016 at 9:09 PM, pyotr filipivich wrote: >> ASINTOER are the top eight English letters (not in any order, it >> is just that "A Sin To Err" is easy to remember. > >What's so hard to remember about ETA OIN SHRDLU? Plus that even gives >you the top twelve. :-) Depends on what you're looking for, I suppose. In this case, those eight get encoded differently than the other 20 characters. -- pyotr filipivich The fears of one class of men are not the measure of the rights of another. -- George Bancroft -- https://mail.python.org/mailman/listinfo/python-list
Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])
Dennis Lee Bieber on Sat, 09 Apr 2016 14:52:50 -0400 typed in comp.lang.python the following: >On Sat, 09 Apr 2016 11:44:48 -0400, Random832 >declaimed the following: > >>I don't understand where this idea that alternating hands makes you >>slows you down came from in the first place... I suspect it's people who > > It's not (to my mind) the alternation that slows one down. It's the >combination of putting common letters under weak fingers and some >combinationS that require the same hand/finger to slow one down. > >aspect a is on the weakest left finger, with the s on a finger that >many people have trouble moving independently from the middle finger (hmm, >I seem to be okay moving the ring finger, but moving the middle finger >tends to drag the ring with it). p is the weakest finger of the right hand. >e&c use the same finger of the left hand, t is the strongest finger but one >is coming off the lower-row reach of middle-finger c. > >deaf is all left hand, and the de is the same finger... earth except >for the h is also all left hand, and rt are the same finger. > > I suspect for any argument for one side, a corresponding counter can be >made for the other side. There are only 5.5 vowels (the .5 is Y) in >English, so they are likely more prevalent than the 20-odd consonants when >taking singly. Yet A is on the weakest finger on the weakest (for most of >the populace) hand. IOU OTOH are in a fast three-finger roll -- and worse, >IO is fairly common (all the ***ion endings). ASINTOER are the top eight English letters (not in any order, it is just that "A Sin To Err" is easy to remember. -- pyotr filipivich The fears of one class of men are not the measure of the rights of another. -- George Bancroft -- https://mail.python.org/mailman/listinfo/python-list
Re: extending PATH on Windows?
Ulli Horlacher on Fri, 19 Feb 2016 10:42:52 + (UTC) typed in comp.lang.python the following: >pyotr filipivich wrote: > >> > Windows (especially 7) search function is highly crippled. There is >> >some command sequence that will open it up to looking at other file types >> >and locations. >> > >> >http://answers.microsoft.com/en-us/windows/forum/windows_7-files/windows-7-search-does-not-find-files-that-it/61b88d5e-7df7-4427-8a2e-82b801a4a746?auth=1 >> >> >> Thanks. I've found it "simpler" to just open a command prompt, and >> use DOS. > >How can one search for files with DOS? cd %searchPathStart% dir /s *.php or variants. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: extending PATH on Windows?
Dennis Lee Bieber on Thu, 18 Feb 2016 21:57:13 -0500 typed in comp.lang.python the following: >On Thu, 18 Feb 2016 16:24:00 + (UTC), Ulli Horlacher > declaimed the following: > >>Dennis Lee Bieber wrote: >> >>> >I have >>> >"Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC >>> >v.1500 32 bit (Intel)] on win32" >>> >and there is no "win_add2path.py" >>> > >>> C:\Python_x64\Python27\Tools\scripts\win_add2path.py >> >>Ok, It is here in C:\Python27\Tools\scripts\win_add2path.py >>but windows "Search programs and files" was not able to find it. > > Windows (especially 7) search function is highly crippled. There is >some command sequence that will open it up to looking at other file types >and locations. > >http://answers.microsoft.com/en-us/windows/forum/windows_7-files/windows-7-search-does-not-find-files-that-it/61b88d5e-7df7-4427-8a2e-82b801a4a746?auth=1 Thanks. I've found it "simpler" to just open a command prompt, and use DOS. -- pyotr filipivich Next month's Panel: Graft - Boon or blessing? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
Steve Hayes on Sun, 01 Jun 2014 05:05:05 +0200 typed in comp.lang.python the following: >On Sat, 31 May 2014 15:44:46 +0300, Marko Rauhamaa wrote: > >>Steve Hayes : >> >>> I'll leave Python 3.2 on my computer, but 2.7.5 will be the one I'm >>> installing now. Even if I could *find* a book that deals with Python >>> 3.x, couldn't afford to but yet another Python book. >> >>Unfortunately, in the computer field, if there's a book written on a >>topic, it will most likely be out of date. >> >>In the 1990's, I used to buy computer books on various topics. I don't >>think I have bought one for ten years. Either it is online or it doesn't >>exist. >> >>There's enough Python material online to become a pro in it: > >I hate reading stuff online, and find it diffucult to learn anything with that >method. I use MS Word 97 in preference to Libre Office wor Word 2010 (both of >which I have) because I have a book on the first, but not on the others. I >can't read online books in the bath or in bed. Hear, hear! -- pyotr filipivich The fears of one class of men are not the measure of the rights of another. -- George Bancroft -- https://mail.python.org/mailman/listinfo/python-list
Re: Lumberjack Song
Tom Zych on Mon, 28 Feb 2011 05:26:35 -0500 typed in comp.lang.python the following: >We all like computers here. No doubt many of us like computer games. >And most of us will be at least somewhat familiar with Monty Python. >Therefore, I present (drum roll)... > >http://www.youtube.com/watch?v=Zh-zL-rhUuU > >(For the Runescape fans out there, this should be quite hilarious. >Possibly not as much for those unfamiliar with Runescape...) Look for the version in German. Viel Spass. tschus pyotr -- APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums. -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -- http://mail.python.org/mailman/listinfo/python-list