« first day (1717 days earlier)      last day (3222 days later) » 

12:00 AM
Doing it with pure Python is suboptimal according to this answer: stackoverflow.com/a/1160227/541136
Do you know why subprocess.call returned 0?
 
no timestamp?
 
No that means the process successfully completed.
it's the exit signal
$ false
$ echo $?
1
$ true
$ echo $?
0
 
Ah
 
$? is the last exit signal
in shell, true is 0
false is 1
Python inverts this.
But this is useful in shell because there are lots of exit codes that indicate different issues. Google them.
anyways, gotta go to the park with my wife, I already gave the expectation that we were leaving. Cheers!
 
cheers man!thanks for the tips
 
12:23 AM
"Woah, there are refactoring *tools*??"
-- Augusta, on Things That Obviously Exist. -_-
 
1:13 AM
@Augusta what do you find them useful for?
Hi Streppel
Hi Martijn!
 
1:52 AM
I haven't actually used one yet. I've just been mashing my way through it and hoping I don't make as many mistakes as I know I will. =_=;
 
2:08 AM
I could see them being useful, but I hope I'm not in a position to need them.
 
2:38 AM
A peek inside the head of Martijn Pieters: codementor.io/python-experts/…
 
I love that he named something off of Calvin & Hobbes
 
2:56 AM
Yeah, that was pretty relateable to me too.
According to SO, I've reached almost as many people as he has.
Of course the accounting is all wrong.
 
Also we learned to code in the same manner, my dad also brought those high-speed mainframe print-offs, the green and white ones, home....though that was '88/89 or so
 
My dad brought home a Kaypro, then a 286/386 then bought us a Commodore 64 when I was begging for a Nintendo, then we got a 486 with a funky motherboard, and that lasted us a good long while.
Functional programming paper, not sure which is the better to store/cite: cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf or ftp.fixme.ch/free_for_all/books/Programation%20fonctionnelle/…
 
3:14 AM
The first by academic rules (it is associated with the actual university kent)....also the second doesn't load for me
 
yeah, the only difference I've seen so far, aside from annotations, is the first paragraph, and the kent version seems a bit better there too.
 
or just loads quite slowly...though that could be my client
he has it hosted at another university too: cse.chalmers.se/~rjmh/Papers/whyfp.pdf
a diff of those too shows mostly font and emphasis differences; more than any changes in actual wording
I like yours (the one from Kent) better; easier for me to read
 
3:40 AM
yeah, don't drink the kool-aid, though, it's just a paper.
 
yep, and I have about 4 essays to write for classes this semester and it might be a reference ;)
 
oh, you need papers?
I'll keep an eye out for you.
what topics for the papers?
 
3:56 AM
Thanks, its alright I have tons of references for my papers (one is a 10 article summary paper related to IT Policy and Management, one is a paper on Bandwidth allocation with resource usage and software considerations, and one is a paper on the various programming styles and......haven't quite hammered that out)
 
I've got a hard-copy book on object strategy (OOP) that would probably be of interest.
 
oh, and the last is a concept piece (with code) on the use of NN vs. Decision Trees to perform handwriting analysis with an explanation of the the base technologies - but I already finished that one
oh, that would be neat for the second one (first one was requires "articles" not books for some reason)
 
k, bedtime! night!
 
4:22 AM
night @AaronHall
 
 
1 hour later…
5:33 AM
cbg
 
cbg @JonClements
 
Looks like it's going to be a hot day sighs
 
@JonClements were are you from
 
Good ol' England :p
 
and what is the temperature there
 
5:42 AM
Not sure - too warm too early though :p But then - I just don't like warm anyway...
I hope they're wrong about Wednesday :(
 
So who should be the one complaining
@JonClements it is already 35c here wednesday it is expected to be 39c
and it is also expected to rain today :p
 
But I imagine you're use to hotter weather? I'm not :)
 
yeah likewise 22c is like winter for us
 
6:00 AM
Cbg
 
6:11 AM
Heya Bobby G
 
:)
Starting my final week of my spark course
 
Hi
Anyone here?
 
heya Rohit
 
Hey
Can you help me out with this question - stackoverflow.com/questions/31096405/…
That haven't got much views :(
 
@RohitJain looks a bit odd... looks like self.num_fields is wrong...
 
6:22 AM
I tried printing that..
It's 11
 
Which is what I'd expect... well never used that library... but focus on
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/ubuntu/Envs/rj-venv/local/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py", line 153, in field_types
    for i in range(self.num_fields)]
KeyError: 12
See what's going on there that'd raise a keyerror...
 
Yes.. that is exactly bugging me.. Why 12? Because num_fields is 11
[u'FIPS', u'ISO2', u'ISO3', u'UN', u'NAME', u'AREA', u'POP2005', u'REGION', u'SUBREGION', u'LON', u'LAT']
these are the fields
strange that is :(
 
Wait, that probably makes no sense
 
yes.. so it will access 0 to 10
exatly
I don't know whether that might happen because of some conflicts between libraries
 
And self.num_fields is definitely 11 ?
 
6:28 AM
But for all of the needed one - PostGIS, GDAL, GEOS, PROJ, I've installed the latest version
Yes
 
Do field_widths and field_precisions fail the same way?
 
Hey cool, there's a geoalchemy
 
let me check those
 
Except the new version only supports postgis
 
I'e postgis only
What's that btw?
 
6:30 AM
SQLAlchemy is the top ORM in Python
(According to people cleverer than me)
 
no they give some result
>>> layer.field_widths
[2, 2, 3, 3, 50, 7, 10, 3, 3, 8, 7]
>>> layer.field_precisions
[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3]
 
And geoalchemy appears to be geo extensions to it, though I've only just found it so I'm not sure :)
(Postgis is the geo extension to postgres, but you probably weren't asking that!)
 
@RobertGrant Thanks Robert.. Will check onto that
Yeah, I've some other issue :(
@JonClements So, it seems like the issue is with ds.get_field_type
As I see from the source code
 
But if you're using Django it's best to stick with the Django ORM, as without it lots of stuff doesn't really work so well, I've heard
 
@RobertGrant Oh.. Ok. Well, I've just began with Django :)
Just few days
 
6:35 AM
Yeah stick with it for now; I did a full Django project as my first Python project and it definitely helped me start to get up to speed :)
 
CBG!
 
@RobertGrant Cool :) same here.. My first python project in Django
 
Congrats :)
 
Thanks :)
I'm loving it.
 
cbg @d-coder
 
6:38 AM
What's CBG @d-co
@d-coder
 
Yeah compared to any PHP framework I've used, Django is better, and it's just much simpler than writing a Java webapp
 
has anyone tried flask as an alternative to django? so much easier
 
@user2707299 most people here use flask
 
really? huh
 
6:39 AM
@user2707299 I have been using Django and it's easy too :)
 
@user2707299 Tried that once for writing REST API..
Hell, it was quicker than writing Hello World in Java
:)
 
Some people say Django is easier though, just because it's more batteries-included
Glad I did one project in it
 
Hey, now that there are more of Django devs here.. Can you please look into this question: stackoverflow.com/questions/31096405/…
With the help of @JonClements we figured out that, there is some issue in accessing layer.field_types
 
Hmm, a keyerror from that line looks wierd. Keyerror 12. You haven't named a global dictionary range, by any chance?
 
@Rober
 
6:41 AM
While I'm able to access other properties.. field_types is giving key error
@JRichardSnape No I haven't
It's even coming in a fresh python shell
 
@RobertGrant That might be true, but I think flask resonates better with python's philosophy of readability*
 
Morning @Martijn
 
Oh well, worth a punt.
 
So, I think it mostly can be an issue with ds.get_field_type here - github.com/django/django/blob/master/django/contrib/gis/gdal/…
 
I haven't really used this chatroom before, is it just for open ended discussion or whatever?
 
6:43 AM
@MartijnPieters : CBG!
 
Also, to me, the trailing ] on that trace back line looks potentially suspicious
 
Yeah, that is also strange.. Going by that, it seems to be error in the for loop part..
 
I know that's not your code btw
 
I'm blocked again from asking questions!
 
@d-coder congrats? :p
 
6:48 AM
I didn't even ask stupid questions lately like from past six months.
Not fair!
forget about stupid questions I didn't even ask any questions from past six months.
 
@JRichardSnape :( I wish it was.. I could have done something about it
lol @d-coder :) :)
 
@JonClements Seriously something wrong with SO moderators /algorithms
Not able to ask questions being on SO with rep 704 hurts! :(
Any moderators here in this group ? *looking at @MartijnPieters *
 
>>> [capi.get_field_type(fdef) for fdef in [capi.get_field_defn(lyr._ldefn, i) for i in range(lyr.num_fields)]]
[4, 4, 4, 0, 4, 0, 12, 0, 0, 2, 2]
This is what I got by executing inner part of that code
 
Not much can be done @d-coder - it's an automatic question ban... can't see why though...
 
Not on a computer, so can't go diving in the source right now, but if I could, I'd start from that for line and work back...
 
6:54 AM
So, the issue is: OGRFieldTypes[12] is the issue
That's the field type for definition - c_void_p(2657100
c_void_p(2657100)
 
@JonClements : They hate my questions for no reason!
 
c_void_p(26571008) - missed the 8 at the end
Yes.. OGRFieldTypes[12] is the KeyError
:(
`OGRFieldTypes = {
0: OFTInteger,
1: OFTIntegerList,
2: OFTReal,
3: OFTRealList,
4: OFTString,
5: OFTStringList,
6: OFTWideString,
7: OFTWideStringList,
8: OFTBinary,
9: OFTDate,
10: OFTTime,
11: OFTDateTime,
# New 64-bit integer types in GDAL 2
12: OFTInteger64,
13: OFTInteger64List,
}`
Damn.. Now I've to see what version of GDAL I've..
Definitely it's not 2
I've installed gdal-2.0.0.tar.gz :(
 
Haha, you're onto something now :)
 
Who knew Django needed this? :)
 
Something is wrong here :(
@RobertGrant hehe :)
What should I do now??
 
7:01 AM
Keyerror 12 suggests rather that that dict doesn't contain 12 in the running code, rather than its value it's incompatible with your other libraries. Where's the dict code you posted from?
 
Which dict? I've no dict with numeric keys in my code
Umm..
From this page:
 
You posted two our threw messages up 0: OFTInteger etc. anyway. gotta get kids to school...
 
@JRichardSnape I didn't get you.
Shall I post here, what all versions of libraries I installed?
 
Maybe. I will be away for an hour now. Maybe put versions in main site question. Looking like incompatibility somewhere
Rbrb
 
@JRichardSnape Sure :)
 
7:07 AM
cbg : -)
 
@MartijnPieters CBG again! :P
 
@JRichardSnape Updated the question with all libraries versions.
 
How to merge date column and time column and put it new column say dateTime in database ?
 
7:29 AM
Mornin' folks
nursing energy drink
 
Please tell me everyone's Monday is going to be better than mine?
I want to know the happy things you guys are doing - to know that all Mondays don't have to be like this
 
HeuHey up
 
Cbg :)
 
Lol @IntrepidBrit.. Go through the chat history for last 15 minutes.. You'll know mine is not a happy start
 
7:34 AM
@IntrepidBrit it's 8:30!
 
@IanClark Means it's gonna dragggggggg more than RuPaul
@RohitJain I saw Django pop up during the conversation when I skimmed back. What TZ you on?
 
+5:30
India
 
Hm - by the time I finish up, it might be a bit late for you.
 
Depends.. Finish up what?
It's 13:07 here now.. It won't be late for the next 6 hours at least :)
Even 10 hours
 
Got presentations, meetings, and a hellishly full docket ahead of me
And there's no guarantee I'll be able to help you either :P
 
7:39 AM
hehe :D No problem..
You can get back to it, once you get some time.
 
cbg('#python')
 
@Intrepid I believe in you
 
8:15 AM
My observations also lead me to believe you exist @IntrepidBrit
 
8:25 AM
I'm @IntrepidBrit-agnostic
 
user559633
@wonderb0lt oh good point, is cbg a built-in or a function?
 
@tristan built-in of course
 
user559633
:) cbg
 
cbg all
 
8:43 AM
cbg @PaoloCasciello
 
Why the following query is returning None paymentDetails.objects.filter(amount__gte = 25).count()
 
Because there's nothing in the table
(Total guess, because there's no info)
 
cbg @paolo!
 
@RohitJain Probably a silly question, given the depth of debugging you've already gone into - but have you checked that your /home/ubuntu/Envs/rj-venv/local/lib/python2.7/site-packages/django/contrib/gis/‌​gdal/field.py has the same definition of OGRFieldTypes as github.com/django/django/blob/master/django/contrib/gis/gdal/… ? I just can't see how you get the KeyError if OGRFieldTypes has a member with key==12
and re-cbg to all and sundry
 
@JRichardSnape Actually I just installed gdal 1.9.2 to see if it works wit that
But again with that too, it shows the same KeyError 12
 
8:56 AM
OK
 
And OGRFieldTypes for that version certainly doesn't contains keys 12 and 13
I saw the source in my machine
How do I revert back to version 2.0 again? So I can check the key in that
I tried re-installing that
But it didn't overwrite the 1.9.2 version
 
So - it's definitely the case that the GDAL extra within django is too old
 
gdal-config --version still gives 1.9.2
Hmm
 
Sorry if terminology wrong, but you get what I mean, I hope
 
How do I check that..
 
8:59 AM
@JRichardSnape worth introducing venv?
 
Basically - the getFieldType function in layer.py is returning a key value that isn't valid for the version of Django you've got. Could be bug, could be version conflicy
I'm not a Django expert, BTW, but I do love tracking hard to follow bugs through code. I'm weird like that :)
@RobertGrant Given the path, I'd say we're already in a venv
 
Hmm
I'm using Django 1.8
Yeah, we're in virtual-env
 
Oh sorry yeah
 
@JRichardSnape Same here.. Have to dig in the source, when I get nothing outside :(
@JRichardSnape Do you mean, it might be the issue with ctypes from where we're getting the field types?
 
So. Basically, I think your GDAL is too new for your Django. This line in libgdal github.com/django/django/blob/master/django/contrib/gis/gdal/… is giving a number that isn't mapped
@RohitJain Yes - which you kind of hinted at before
 
9:05 AM
It's giving me these values for the 11 fields: [4, 4, 4, 0, 4, 0, 12, 0, 0, 2, 2]
 
Basically the 12 value comes straight from the GDAL native library
 
Yeah
That would mean, gdal native is newer than the one I installed?
 
But the version of django you've got can't cope with it.
So, either downgrade GDAL, or upgrade Django
 
1.8 is latest Django though
 
I'm on Django 1.8.2
And I tried downgrading gdal to 1.9.2
Which is what I'm on currently
 
user559633
9:07 AM
"This book can be read in just a few hours but, obviously, there is much more to writing good C++ than can be learned in a day." that's convenient, because it will take me way more than a day to read the book :)
 
Maybe latest supported, but look at this line under 1.8.2 tag github.com/django/django/blob/1.8/django/contrib/gis/gdal/…
You need bleeding edge to get the fix for GDAL 2, it would seem
Somehow - either GDAL 1.9.2 has the key 12 for field type in it, or your downgrade was incomplete
I think these are the only remaining options
Tempted to head to the GDAL source code
 
I tried going through that source
But it's all alien for me :(
And gdal doesn't even provide a make uninstall
So, I tried downloading gdal 1.9.2, and built it from source, same way I did for gdal 2.0
I guess it's all mess now :(
Is django.contrib gdal different from what I've installed?
Are those two different things?
 
Yeah - I think so. django.contrib.gdal is the python wrapper for GDAL that django uses (I think! massive caveat I don't know django add-in architecture)
What you're installing (I think) is the actual GDAL natives - built from the C++ code that I linked. I'll have a look - see if I can work out the exact version where field type 12 came into being.
 
@JRichardSnape Oh, I see..
Yeah sure.. It'll be great help. I'll also try to get my brain in there :)
 
So - this is the culprit line github.com/OSGeo/gdal/blob/…
 
9:17 AM
Cool
that was quick :)
 
And it is not there on the 1.9 tag - github.com/OSGeo/gdal/blob/1.9/gdal/ogr/ogr_core.h#L365
So - if you truly do manage to uninstall GDAL 2.0 and get 1.9 in there - you should be there.
 
Ok.. That's great.
Let me try to see where the downgrading went wrong
 
A codebase a day helps you work rest and play Whistles tunelessly
In fact - it's not even in 1.11, so you should be totally safe using 1.9.2
 
@JRichardSnape That was awesome :) hehe
Thanks so much for your help :)
 
Let me know how it goes - if it works, I'll stick an answer up on the site
Oh - does that mean it works?
 
9:21 AM
Yeah sure will tell you
No, not yet
 
Prepares an answer
 
Use a virtual env ;)
The suspense was too much - I need to get on with some work ;). I've stuck the answer with the code references up - let me know if you get in a situation where you're 100% sure you've got GDAL <2.0 and it still fails with the same error.
 
9:43 AM
Awesome man!! It worked smoothly
Thank you so much :) :)
I added GDAL_LIBRARY_PATH in django settings fle
*file
 
@RohitJain @JRichardSnape looks like a good Q&A that's going to save someone else's time at some point - nice work guys :)
 
to point to the lower version libgdal.so
And it worked
@JonClements Thanks man.. At the end, it's all worth it :) Now I can happily go for lunch
Can we link this chat in the answer? I would be great then
 
Bah - misread - sure... look to the first transcript entry if you want...
Or create a bookmark of the relevant range in the transcript - then link to that
 
Yeah I'd do a bookmark; just click on the room dropdown near the top right of your screen and hit create bookmark. Then you can select the first and last message and it'll link to that range of messages.
 
9:52 AM
cool.. done :)

gdal-django-compatibility issue fix

4 hours ago, 3 hours 30 minutes total – 238 messages, 13 users, 0 stars

Bookmarked 25 secs ago by Rohit Jain

@JRichardSnape You might want to add the bookmark to your answer :)
 
Wow - long discussion :)
 
hehe :D
Indeed
Thanks everyone for the help here :) Will go off for lunch now.. Have a good day :)
 
take care :)
 
10:21 AM
@RohitJain Done - glad to have helped :) These are my favourite type of questions!
@JonClements Thanks :)
 
10:38 AM
@RohitJain Hey, it's all working.
re-cabbage
 
re-cbg
 
re-cbg @IntrepidBrit - hope Monday is picking up somewhat.
 
@IntrepidBrit Yay :)
 
One of the best presentations I've given. The group were great, nobody fell asleep, might have gotten some business out of it, and all the people looked serious about taking the workshop I'm thinking of doing (what is wrong with me?)
I'd call that a win
 
Nice :)
 
10:46 AM
Now to fit 12+ hours of work into 5
 
I knew my belief in you was correct.
 
How's Monday for everyone else?
 
Good :) just downloading Vivaldi
The browser, not the music
 
Not the composer?
 
Also not the composer :)
 
10:53 AM
That's good. Would have been a little terrifying...
Let me know how you find the browser
 
@IntrepidBrit Win
 
Looking at re-evaluating my OS/browser/environment set-up
 
Mmm, I was just thinking the same. Considering Arch
 
I will
As a tech snob, I think Vivaldi+DDG is about a million times better than Chrome+Google, regardless of how good the products are
 
for my laptop. I get little choice at work. Also - I have realised I have gone too long without using virtual environments - I either play in the default python environment or have virtual boxes for more hardcore stuff. It is time
 
10:56 AM
Yeah venv is a nice middleground
 
@JRichardSnape Yeah, fizzy was prodding me this weekend. Ubuntu is doing my nut.
 
And I use the most left-field OS possible for a techie: Windows.
 
I've been on Ubuntu, too. I like it in general - haven't bothered with the last two or three updates, though. Not keen on the Unity thing.
 
Unity's optional I thought
 
I use Windows all the time at work, which means more or less all the time I code
 
10:58 AM
I only have a work laptop :)
 
@JRichardSnape I prefer Mint w/ Cinnamon... Nice simple (but not too simple) UI with an Ubuntu base
 
I'm a box-hog. Two desktops at work, often use a mini-cluster, Windows laptop, Linux notebook, chromebook.
Which is to say, I struggle to throw things away
 
@JonClements I've heard good things about that, too
 
I do have a raspberry pi with linux on, obviously
 

« first day (1717 days earlier)      last day (3222 days later) »