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.
VirtualView (for displaying large amount of items)
-
@Phuket2 Didn't try it but it should work https://gist.github.com/jsbain/1c95b3491d65d9e24456#
-
@ccc, one reason why pythonista is so cheap, besides the many other reasons, it saves me money. I am only only 18 black labels now. I was thinking too much today, so was drinking slower. Just getting to 21:00 here now. Normally would have had at least 26 by now. And still at least another 4 hours drinking for me. I am probably not going to win any coding or spelling challenges here. But I would be a front runner on the drinking side, even against the crazy Europeans. I give all my Danish friends a good run for their money, and those guys know how to drink :)
-
@filippocld Thanks for the code.I tried it a little and it seems to work great. I am with visitors the next few days, but will get back to it. The code is simple enough to use (especially commit). Just want to test more doing various things like pulls etc, to make sure I understand it and don't stamp out my code accidentally :)
Thanks again. -
https://gist.github.com/0d09675f699cff516b30
Sorry, it's a new gist Id again. I thought I had gistcheck.py working correctly, but another dream I was having I guess. I would like to say a lot about gist and repos now, but I will contain myself!Anyway, this version has a major upgrade in my opinion. No need to add button to get a click event. A lot more efficient I think. It had some side effects which I fixed and noted.
I changed the number of cells (var) to display at the top of the file to be 100 million and one , This is the point. Should only be limited by the largest number you can represent.
-
import sys ; print(sys.maxint) # 2147483647 the largest int you can represent.
-
coding: utf-8
import sys
print 'max int = {:,}'.format(sys.maxint)
#> max int = 9,223,372,036,854,775,807 -
I am guessing that's 2^64 :)
-
Oops, 2^63.
It's ok, it's the largest number but other things break when I set the number of cells to sys.maxint -
I am on a 32 bit box ;-) and you are on a 64 bit box... You forgot to save one bit for the sign...
import math ; mata.pow(2, 63)
. -
Yes, but it's still good python is reporting the correct maxint. Well I am sure you are not surprised working with python on desktops, 99% of my python has been in pythonista.
I am not sure when I was 64bit all of a sudden. Maybe one of the last 2 minor iOS updates I guess. I know I wasn't before. -
Oh, and check out https://github.com/studioimaginaire/phue for your hue lights. I know someone got it working but I can't find their post.
Search seems broken in the NodeBB? If I search 'phue', I get hits that do not contain 'phue' but I do not get the posts that I want. Is there a way to get literal hits like "
hue lights
" that ONLY give me results that contain that exact combination of letters? -
@ccc , thanks. The link to phue lights is https://github.com/studioimaginaire/phue Is on the pythonista_tools site.
But I haven't tried to play with the hue lights for a reason up to now. I can imagine I would get caught up with them and limit my learning of my general python. I still have so far to go. So I am resisting the gadgets for the moment. I will look at the 64bit article. A bit strange, it's not like 64bit is a new idea.i had always thought apple were well placed for 64bit. But I will read and learn :)
-
Sorry @ccc. I didn't read your post correctly. You had the same link as me. But if I go through the pythonista_tools site, and look at the category 'the internet of things' the same link is there and it works. Strange.
-
@Phuket2 that might be because they changed the link in the HTML but not the display text? Try looking at the page source.
-
in python, the largest integer is not limited by maxint... try maxint**2 to confirm! it may be a good idea to stay below that number for speed though
-
Sys.maxint in an int but 2*sys.maxint is a long.
import sys # on a 32-bit machine... print(type(sys.maxint), sys.getsizeof(sys.maxint)) # (<type 'int'>, 12) print(type(sys.maxint*2), sys.getsizeof(sys.maxint*2)) # (<type 'long'>, 18) print(type(sys.maxint**2), sys.getsizeof(sys.maxint**2)) # (<type 'long'>, 22) print(type(float(0)), sys.getsizeof(float(0))) # (<type 'float'>, 16)
-
ahh, the largest integer, not largest int :). a
long
is an integer. since he was not instantiating an array that size, or passing the number to ctypes, etc, my point was he doesnt have to be limited to maxint. then again, it will take an awfullylong
time to scroll to the bottom of a few billion entries. -
I am going back to a 16 bit system, life is easier :)
-
I'm sticking with 24 um I mean 31 er 64. :-)