omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. njm

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 8
    • Best 0
    • Controversial 0
    • Groups 0

    njm

    @njm

    0
    Reputation
    575
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    njm Unfollow Follow

    Latest posts made by njm

    • RE: Release project to the App Store

      Search for Xcode in the forum.
      I used the @Romspy post successfully to publish an app. Check this thread:
      https://forum.omz-software.com/topic/5310/when-will-omz-release-an-xcode-template-for-python3

      posted in Pythonista
      njm
      njm
    • RE: Odd Crash Report

      @stephen said:

      for brush in self.fishingNodes:
      from random import choice
      x, y = choice(self.fishingSpots)
      brush.run_action(Action.move_to(x, y, 5))

      self.Animate()
              def Animate(self):
          scale = move = alpha=[]
          r = rx = ry = 0
          for x in range(100):
      

      @stephen, I'm confused by the indentation and code sequence in this region of class Pond. Maybe the problem is here?

      posted in Pythonista
      njm
      njm
    • RE: Look at func

      @stephen, I replied and then realized I hadn't read your post fully. I then deleted and purged it. Sorry for the confusion. I would code it the some way you did. I do like @mikael 's method, very pythonic. Many thanks to both of you for supporting this wonderful app.

      posted in Pythonista
      njm
      njm
    • RE: More accurate gps data?

      @Drizzel, I think the issue is that after starting location updates, it takes some time for it to stabilize. I found that usually after 8 seconds the lat/long readings were no longer jumping around. I initially thought that it might be that your law of cosines equation was not well conditioned so I tried the haversine form and found little difference. Here is my mangle of your code:
      gps_logger.py
      To show what is going on, change the initial sleep interval to something small like 0.1sec and see just how much it bounces around.

      posted in Pythonista
      njm
      njm
    • RE: Motion broken on iOS 12.2?

      Thanks @cvp
      I gave it a try. Here is a simple comparison of UIDevice.orientation to motion.get_attitude:
      facedown.py

      The 6 only comes up when completely upside down. The transition from flat to "vertical" happens near a pitch or roll of 30deg. Still not as reliable as the gravity term and ui.WebView

      posted in Pythonista
      njm
      njm
    • RE: Motion broken on iOS 12.2?

      repository now public

      posted in Pythonista
      njm
      njm
    • RE: Motion broken on iOS 12.2?

      As a work around, using the yaw component from motion.get_attitude works. Apple calibrates it with the magnetometer some how. Acceleration, attitude and gravity all seem to be unchanged. The attached code works in both 12.1 and 12.2.

      mag_test.py

      Screenshots in the gist show the magnetometer results for 12.1 at N,E,S and W.
      For 12.2 the magnetometer results appear to be random.

      The device orientation comes from ui.WebView (Thanks @JonB https://forum.omz-software.com/topic/997/get-current-screen-or-orientation-width).

      In portrait mode when the screen is held high (or low) enough to be face down, yaw and roll flip 180deg. This can be detected by the sign of a gravity component. The original Swift example (https://medium.com/swiftly-swift/how-to-build-a-compass-app-in-swift-2b6647ae25e8) uses a CoreMotion component not easily obtained by Pythonista to flag a face down orientation.

      edit: By face down I mean past vertical. The pitch component must be in the range [+90,-90]

      posted in Pythonista
      njm
      njm
    • Motion broken on iOS 12.2?

      Hello everyone. I’m a long time lurker and thanks for all your posts. I’m developing a gps app and it appears motion on iOS 12.2 gives random results. My testflight and Pythonista versions work fine at 12.1. Google helped me find chatter on other sites saying that the privacy settings for motion are now being enforced the way location settings are.
      Is anyone else having a problem? Workarounds?

      posted in Pythonista
      njm
      njm