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)
-
https://gist.github.com/049488b7584d47bf7ace
Sometime ago, @omz gave me some code as a starting point for making a virtual view. I basically tried to rework it into something more simpler for me to understand and use. I might have gone backwards on that point. Anyway, from time to time I have been going back to it.
I can use it as it is, for my purposes now, but really would like to make something robust enough that others could also use it. Conceptionally I personally think it's a great idea to have a VirtualView.
It's not finished, although it works.
I find myself going around in circles now. It's time to see if I can get some hard cold feedback.
If you do give some feedback, please don't sugar coat it. If you think the whole thing is crap and should be rewitten from scratch, please say that. I am not looking for any pats on the back, just looking for honest comments/suggestions. Is the only way I am going to get to a point were I can contribute something of any value.
I have put a gist link here. It's long, only because of comments :( I have not done a repo, just because I can't manage one yet. -
I'd change to a random color when tapping a color (color_demo)
-
https://gist.github.com/0bc198563ff4374ba864
Thanks, I added the random color. But hilights a glaring problem. I should be calculating the click rather than relying on a button object to do the work.
I am not sure how difficult it is. Not about determine the rect and item, more about using touch along with a scrollview.
Will look at it though. Thanks -
A suggestion: use the same gist and make a revision, its easier to upgrade to the new version
-
@filippocld , thanks for the suggestion. It makes total sense!
But I am just not sure how to do it. Well, maybe can do it at the gisthub site. I have the codehub app on my iPad, I can view my gists and create new gists with that app, also add new files to the gist. But I do t see a way to modify or replace a file in the gist.
I have been using the export -> gist function in Pythonistia, which just seems to create a new gist every time. As far as I know, that's all you can do with a gist
But do you use a app or code that can overwrite a gist?
That would be great, especially for posting here when just responding to suggestionsThanks
-
Guys who drink Black Label use repos instead of gists. ;-)
-
@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.