« first day (277 days earlier)      last day (2124 days later) » 
12:00 - 18:0018:00 - 00:00

12:06
4
A: matplotlib - extracting data from contour lines

zephyrFor a given path, you can get the points like this: p = cs.collections[0].get_paths()[0] v = p.vertices x = v[:,0] y = v[:,1]

oeh I'm going to see if I can use this to align my paws
get the counter between 0 and the rest
possibly set all nonzero values to 1, then calculate a contour
and perhaps spread out the image, so there aren't as many 'holes'
this would give you the paw's outline?
that way the resulting vectors shouldn't be overly complicated
I hope so
that could be handy
then I need to figure something out where I translate the paws to get a least squared difference
I would make it start by calculating the center of pressure and align those, to have a pretty good starting point
then move it in all directions and see when they overlap the best
over something like that
perhaps I can even calculate what translation I'd most likely need
I was also considering making my own colormap, to make the colors match the original software more
and/or make it adjustable in the settings
it seems to be really simple
but I can't make sense of the RGB values
so I thought, perhaps I should make a simple plot where you get sliders to adjust the values of each interval
just to get the right values
2
Q: Set Colorbar Range in matplotlib

PaulI have the following code: import matplotlib.pyplot as plt cdict = { 'red' : ( (0.0, 0.25, .25), (0.02, .59, .59), (1., 1., 1.)), 'green': ( (0.0, 0.0, 0.0), (0.02, .45, .45), (1., .97, .97)), 'blue' : ( (0.0, 1.0, 1.0), (0.02, .75, .75), (1., 0.45, 0.45)) } cm = m.colors.LinearSegme...

I'm sure what all that messing about is in that question :S
12:22
LinearSegmentedColormap I think this just tells to linearly scale between the rgb values you pick
so I assume the tuple for R G and B you provide is for min - mean - max (sort of)
so the first color is cdict['red'][0] + cdict['green'][0] + cdict['blue'][0]
@IvoFlipse I guess that makes sense, cept there's 9 entries for each colour (or 3 entries which are each a 3-tuple)...?
hmm I see what you mean
though I guess this produces one tuple, not 3
exactly... I'd expect three values for each colour for a min/ave/max not nine
would it matter if its RGBA?
that'd still only add one more value
(per colour)
I guess maybe the docs for whatever they're doing might help
12:27
I guess I mistook each tuple to define the color intensity for each RGB value at the end of the colormap
which doesn't really make sense
RGB and RGBA are sequences of, respectively, 3 or 4 floats in the range 0-1.
> segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of x, y0, y1 tuples, forming rows in a table.
it shows how it should be interpolated?
that's what it looks like
` 'red' : ( (0.0, 0.25, .25), (0.02, .59, .59), (1., 1., 1.)),` implies red is 0.25 at the bottom, scalling to .59 at x=0.02 then scaling to 1 at the top
ah right like that
how strange in their example green has 4 intervals :\
oh right it goes in 4 steps from 0-1
yeah, you could have as many steps as you like I suppose
12:32
because it jumps from 0 to 1 from 0.25-0.75 rather than 0.0-0.5
@DMA57361 interesting
@IvoFlipse lol, I suppose so... but what for?
I tried retrieving this for my current colormap, but I didn't know how to convert it
@DMA57361 well because I want the background color to be black, not blue
so 0.0 = 1 for all (or 0?) while at 0.01 it may already start getting color
@IvoFlipse ah oic, is there a simpler way to just provide a single fill colour?
@IvoFlipse black everywhere would probably be 'red' : ( (0., 0., 0.), (1., 0., 0.) for each of the three colours
well everything I found so far points to the colormap
12:38
@DMA57361 wouldn't it be something like 0., 0., 0.; 0.25, 0.1, 0.1 that its 0 at y=0, but just to 'something' a little higher?
though their color bar already should have black at the bottom, all three colors start off at 0
unless x is not the rgb value, but its location on the colorbar
@IvoFlipse that was my interpretation
the other two are the colour's value and also y adjustment for diagonals (see the images, but don't ask me how it works :P), so best keep them the same
you need to use 0 for the colour else it isn't black, just merely grey
that means if I want green to be anything very low but non-zero, it should be like green going to 1 at 0.25
oic, possibly, getting confused now I'm trying to think to hard about it
same here and getting nowhere :P
6
Q: How to tweak my tooltips in wxpython?

Ivo FlipseI was trying to add a tooltip to show the full content of a truncated ObjectListView, until it turned out it had such a feature built-in: I tried making my own tool tips using wx.TipWindow, wx.PopupWindow and SuperToolTip, but none of them looked as 'native' as this one. While I'm aware of...

just as with this one
13:31
finally! ._segmentdata was what I needed
{'blue': ((0.0, 0.5, 0.5),
(0.11, 1, 1),
(0.34000000000000002, 1, 1),
(0.65000000000000002, 0, 0),
(1, 0, 0)),
'green': ((0.0, 0, 0),
(0.125, 0, 0),
(0.375, 1, 1),
(0.64000000000000001, 1, 1),
(0.91000000000000003, 0, 0),
(1, 0, 0)),
'red': ((0.0, 0, 0),
(0.34999999999999998, 0, 0),
(0.66000000000000003, 1, 1),
(0.89000000000000001, 1, 1),
(1, 0.5, 0.5))}
this is the 'default' blue-yellow-red one
interesting it turns colors on and off
I need to tweak this to make x=0 black, x=~0.25 green and somewhere around x=0.7 yellow
so green needs to be darker and have a 'wider' range
almost like this, only less dull
14:15
hey @IvoFlipse turns out I did have a late night, just not programming :) between working on my car and working on the apt I didn't get much more done :(
@KronoS awh, well today is a new day
yep! and I'm ready to get some done! (except when I have to take my wife to work, and when I head in myself.)
so I've completed coding the queries and have changed the structure a little
I think it's a little better now, less duplication of data
great, well its not the end of the world
just in your case it was A LOT of duplication
@IvoFlipse ya I realized that as I was putting it togther
Oh one question I had, was what fields do I put in UNIQUE() ?
14:31
you want to prevent dupes
so for instance every observation can only have one task
so observationid + taskid need to be unique
so basically it prevents dupes from happening?
so if I were to put observationid and sessionid in the UNIQUE command there would NEVER be a duplicate entry for either of those?
yes, that's the idea
14:47
ok push coming your way. I've got the initdatabase.py file setup I believe
ok
after that, you need to create an instance of that module in mainmodel
so wrap it in a class and just create an instance
so I just tacked on class DataBaseInit at the top and indented everything... that's all I need to do in creating a class right?
and then typed this into the mainmodel:
self.databaseinit = initdatabase.DataBaseInit()
ok pushed that to you
yeah thats it
Hmmm....I've done something wrong... app does't work...
it's something with my self.databaseinit... line
brb gotta take the misses to work
15:14
ok I'm back
Ah figured out the prob... just needed to import the file :P
yeah, that's why I keep most files that are similar in the same folder
all models, views etc
ok @IvoFlipse now that I've created an instance of the databaseinit how do I start using it?
the class you made
it needs an init()
there you just call the function
and that should execute it
15:28
ok did that... how do I know if it worked?
either download a sqlite gui manager
or try to insert something
15:46
Ok downloaded the firefox sqllite plugin... but what file do I open?
oh and upvote this guys
40
A: What are good open source GUI SQLite database managers?

TheGeoffI've been on a search for a really good Sqlite Admin tool since I started iPhone programming a year ago. I've been mainly using the Firefox Plugin 80-90% or the time and Sqlite Administrator the rest of the time. I decided to do some more searching over the last couple of days and here's my repor...

sorry reached my limit
I actually don't even know how to use addons in Firefox anymore :\
> I have installed SQLite Manager, but I cannot find how to start it. What should I do?
you should open your .db file
you can name it sqlite if you prefer
Hmmm... doesn't look like it wrote anything
delete the old one
btw you don't execute the code do you
lol, my bad
there's 2 things you can do
add self.* to each query
then have a list with all the query names, without the self part
then we create a loop
that loops through each name in the list
and does: query = getattr(self, namefromlist)
then execute the query
hi @WarriorBob :)
hey @WarriorBob
Hey @Ivoflipse and @Kronos
15:55
@IvoFlipse ok I was wondering about that... It didn't feel like there was anything being created... but I wasn't sure
How you guys doing?
I'm wondering why Python locks up when a file is locked :\
@WarriorBob doing good... working hard on my app :P
@IvoFlipse what do you mean?
Sounds like a fine thing to be doing. What kind of app are you making?
@IvoFlipse what's the second thing?
15:57
I have the code to built my database in a textfile
if another instance of my application is running
this file remains opened for some reason :\
(I'm planning on going with the first unless the second yeilds a better solution...)
oh wait
you can just make a list with the query names within the function
loop over it
and run it
@WarriorBob it's for a research proj at my university... a time motion study
we'll make it more fancy some other time
@IvoFlipse so I don't need to add the self.*
16:00
@KronoS naah leave it be for now
the reason you would want to do that
is to separate the code that holds the query and the code that executes it
but that's not important right now I guess
you can copy paste all the execute stuff from tasktrackermodel
16:15
@IvoFlipse I'm kinda cunfuzzled
is it working @KronoS?
hehe
push your latest version, I'll fix it :P
with the syntax of the self.cursor.execute
@IvoFlipse ok...
self.databaselocation = os.path.join(os.getcwd(),'database\\tasktracker.db')
this creates the filepath of the database
then sqlitedb connects to the db on that location
then we create a cursor
@IvoFlipse i got that
@IvoFlipse but what's a cursor?
that cursor.execute( """QUERY BLABLA""") performs the executes the query on the database
I don't know
16:17
Oh :P
its something that controls the database I believe
**Creating a cursor object**
After the connection object is created, you cannot interact with the database until you create a cursor object. The name cursor belies the purpose of this object. Cursors exist in any productivity application and have been a part of computing since the beginning.
oh ok... I'll make the changes then
The point of a cursor is to mark your place and to allow you to issue commands to the computer. A cursor in MySQL for Python serves as a Python-based proxy for the cursor in a MySQL shell session, where MySQL would create the real cursor for us if we logged into a MySQL database. We must here create the proxy ourselves.
so it's like the 'mouse' of the PC... it points to the place of action
pretty much
The second group of functions deals with processing table scans. These functions
operate on a table cursor, which holds all of the state information required to perform
a table scan. As the database engine scans a table and steps through each individual
row, the cursor is responsible for keeping track of which row is being processed.
16:20
ok push coming you way... made some changes
@IvoFlipse ok that makes a little bit of sense
thank god :)
@IvoFlipse you said that the self.tables does nothing right?
so I don't need that in the databasemodel?
no you don't
I probably intended that to contain the built code
and I don't need the print('database_init.builtusernamedb') either right?
cuz all that does is print
@KronoS well let's keep that for now
16:24
hey @DMA57361
because it prints :)
we can keep track of all the crazy stuff your doing ;)
@KronoS hey
an alternative is using pubsub
@IvoFlipse I'm really liking this kiln... it's saved my butt a few times
pub.sendMessage("print statement", "database_init.builtusernamedb")
you only need one function which you can easily turn on or off
which subscribes to every "print statement"
and then just does: print message.data
I'm going to use that in my own app :P
16:27
ok so what am i doing wrong? why doesn't the app run?
lol
lesson: app = MyApp(redirect=True), creates a stdout popup
so you don't see errors in Eclipse
VERY annoying
turn it to false
AttributeError: DataBaseModel instance has no attribute 'builtdatabase'
buil**d**database
@IvoFlipse duely noted
huzzah for my spelling errors messing with your hdead
16:31
waha!!!! I was wondering why it didn't ever give me errors
@IvoFlipse Grrrr... and my head is already messed to begin with
but it works!!!!
hey look tables!!!!
this firefox plugin is pretty nice
post a screenshot :)
great, the plugin even has an export function
that means you can make tables in the plugin
and push the built script out
yeah actually its quite useful looking at it like this
almost makes me want to switch ;P
what you now have to do is remove the code from tasktrackermodel that builds the database
and tweak the insert code obviously
ok so now to get down and dirty... how do we work this database thingy?
well you've got 5 tables, that need to get filled
16:37
yes I do...
we could also make it easier and just have 1 or 2 model 'modules'
rather than how I had it, one for each
@IvoFlipse Hmmmm... I think I might like it being 5 dif for debugging and kronos understanding
@KronoS well the downside is, when you have info that 'spans' tables, you need to pass them along
it can become quite the juggling
actually I change my mind... can we have all the operations in the databasemodel?
@IvoFlipse oh that makes sense
so perhaps make one model for general things
like the clinic, user/subject whatnot
then one that bundles the session + observations
16:42
and another for the stats and observations and things that will be added/changed often
the tasks are part of the built script, because they're static mostly
@KronoS yeah, in that case you won't have to move things as much
I'm running out of easy bugs to fix, soon I'll have to bite the bullet and actually fix something hard
@IvoFlipse with mine or yours?
oh fun...
what are you running into?
btw I'm goign to have to head to work in a few and work on this there :P
I don't know, that's the problem
16:46
lol
too many known unknowns
brb
hmm @DMA57361 JOINS do look handy :P
huh, sorry, was away from my desk
JOINS as in SQL are very handy
why? what'd ya need? :)
oh nothing, but in all those cases I was looping through measurements to get to contacts to get to results
basically those are all joins
17:01
yeah
they're not particularly complicated
no, its just that I don't have any experience with them
and obviously that I need to do everything 6 times :P
for every kind of result that is
if there's anything I want to refactor, then its making everything a bit more flexible :P
SELECT <whatever>
FROM Subject AS S
JOIN Measurement AS M ON (Subject.subjectID = Measurement.subjectID)
etc
you just "join" them on whatever ID's you have linked then both are available for output
and you can chain as many joins as you like
yeah, I might look into it some more
I just solved a nasty problem
if you created a new session, it didn't reset anything
which made the processing part crap out
so I added a reset message
but I had to duplicate this message everywhere
I just realized, instead of making a new message, use the old one but sent along who's sending it
then the ones that shouldn't reset could just check who sent it and skip if its the wrong one
sigh
heh, fun fun
ah well, at least the problem is solved :)
17:09
indeed
I finally got round to installing the Android SDK and bits; with no real purpose yet, but just having a play
well you have a decent phone now, so you can make your own apps :)
indeed
have to learn Java first D:
still, got my phone to say hello :P
and turns out the light sensor hasn't got a very good resolution
@KronoS how are you coming along?
17:20
@IvoFlipse well both jobs just called... one was figuring out where to go from here (this proj I'm working on) and the other the entire EMR system just shut down...
again
@KronoS did you show your compandre your progress?
not yet... was going to but now that the system is down I'm not going in...
@KronoS is that a bad thing?
He seems a bit... apprehensive about it...
but we'll see
@KronoS because the Access thing worked?
17:24
Ya... but I'm trying to tell him that the way that we have ACCESS setup isn't really efficient at all and is going to cause probs down the road... so I have to finish this app before thurs so that I can show the doctors
and him... that it's worth migrating to something that can handle databases better
so ya... but first I have to go into work now and do another persons job in fixing the EMR
@KronoS better yet, technically it should be possible to move it to a webserver at some point
ah I though you didn't have to go
@IvoFlipse using sqllite? or Access?
sqlite
not that I know how
but its possible
@Kronos What are you guys using Access for? I use it at my work frequently and I haven't had much luck with it.
@IvoFlipse i do... and it stinks... but I'll be back on in a few (like 30 min)
17:27
@WarriorBob we're working to replace it with a simple Python app
Oh awesome. Carry on then :)
@WarriorBob we're conducting a study following doctors and seeing how efficient they are... and we thought (i even pushed for it) that access would be the best... but as well delved into it... it's not a great idea
just take a look at my questions that I've posted on SU... they're really not answered the greatest and not because of lack of talent on SU but rather lack of talent within Access
anyways l8rs @IvoFlipse I'll be back ASAP
Oh, sure enough.... I'd add to those answers but I don't have anything better to say than anybody else did.
17:52
and Kronos is back @IvoFlipse
is pulling up eclipse as we speak
12:00 - 18:0018:00 - 00:00

« first day (277 days earlier)      last day (2124 days later) »