Posts

How do I build from the trunk of the jsoup github project? -

i've realised java project i'm working on affected bug: jsoup google groups i don't think sort of question suitable posting in group discussion , don't want sit , wait next release kind enough explain implementing fix asap entail? how 1 build trunk of project? just clear, looking end patched version of jsoup .jar inclusion in project. thanks always! the reply got on #git irc : jsoup github download link you can either use git archive repository, or use github's download functionality. after need compile jar source there. if choose use github, when click download pick either of .tar.gz or .zip buttons next "branch: master" lesson learnt: try irc first!

PostgreSQL foreign key not existing, issue of inheritance? -

i struggling foreign keys in db, possibly has inheritance? here's basic setup: -- table address create table address ( pk_address serial not null, fk_gadmid_0 integer not null, -- table exists, no problem here street character varying(100), zip character varying(10), city character varying(50), public boolean, constraint address_primarykey primary key (pk_address), constraint gadmid_0_primarykey foreign key (fk_gadmid_0) references adm0 (gadmid_0) match simple on update cascade on delete no action ) ( oids=false ); alter table address owner postgres; -- table stakeholder (parent) create table stakeholder ( pk_stakeholder integer default nextval('common_stakeholder_seq') not null, fk_stakeholder_type integer not null, -- table exists, no problem here name character varying(255) not null, constraint stakeholder_primarykey primary key (pk_stakeholder), constraint stakeholder_fk_stakeholder_type foreign key (fk_stakeho...

android - "Token expired" Obtaining Google Auth Token -

i'm getting following error when trying google auth token using accountmanagerfuture<bundle> amf = am.getauthtoken( accounts[0], "finance", null, activity[0], null, null ); try { auth_token = amf.getresult().getstring("authtoken"); log.v("portfolio", "getting token...: "+auth_token); } catch (exception e) { e.printstacktrace(); } i valid-looking token, when try , use it, "token expired" error back: v/portfolio(11970): <html> v/portfolio(11970): <head> v/portfolio(11970): <title>token expired</title> v/portfolio(11970): </head> v/portfolio(11970): <body bgcolor="#ffffff" text="#000000"> v/portfolio(11970): <h1>token expired</h1> v/portfolio(11970): <h2>error 401</h2> v/portfolio(11970): </body> v/portfolio(11970): </html> along with: w/defaultrequestdirector(11970): authentication error: unable respond of t...

python - django how to use AUTH_PROFILE_MODULE with multiple profiles? -

assuming have different profiles different user types - staff, teacher,students: how specify auth_profile_module in order appropriate profile get_profile ? there no way use generic key. from django.contrib.contenttypes import generic django.contrib.contenttypes.models import contenttype class userprofileone(models.model): pass class userprofiletwo(models.model): pass class userprofile(models.model): content_type = models.foreignkey(contenttype) object_id = models.positiveintegerfield(db_index=true) content_object = generic.genericforeignkey('content_type', 'object_id') example: userprofile.objects.create(content_object=any_profile_instance) user(pk=1).get_profile().content_object.some_special_field if provide more infos, when might possible find better solution :)

jQuery Multiple Draggable Object Creation -

this complicated problem me. here want: i have designed div draggable , 1 instance on page ready dragging. when user drags it, want dynamically create new instance of it. should able remove click of button should accessable. can point me out right path this? here have far: $(document).ready(function() { $('#dragthis').resizable({ stop: function(event, ui) { var w = $(this).width(); var h = $(this).height(); var tr = $('#contentdiv'); tr.each(function() { //alert( fields[$(this).index()] ) $(this).height(h - 45); }); console.log('stopevent fired') console.log('width:' + w); console.log('height:' + h) } }).draggable( { containment: $('body...

python - Checking if x>y without if statement -

in python, possible check whether x>y without using if statement? there variety of ways go this: print "yes" if x > y else "no" or: print ["no", "yes"][x > y] or: print x > y , "yes" or "no" (at least, mind-reading powers think you're doing)

c++ - When a boost::shared_ptr might not be freed? -

afer reading topic c++ interview preparation (matt's answer) i've got question boost::shared_ptr. possible shared_ptr leak memory? how? shared_ptr uses reference counts, , means circular references can cause leaks. concretely: struct { shared_ptr<a> other; }; shared_ptr<a> foo() { shared_ptr<a> one(new a); shared_ptr<a> two(new a); one->other = two; two->other = one; return one; } the data structure returned foo never deallocated without manual intervention (set either of other pointers null). now fact every programmer should know; more interesting interview conversation it. options include: redesigning data structure pointer cycles not necessary; demoting @ least 1 pointer in every cycle non-owning reference (a bare pointer or weak_ptr ); a dedicated cycle collector ; as last resort, manually nulling out pointers @ appropriate points (this breaks exception safety).