Posts

python - App as foreign key -

so , have django project 2 apps ├───blog post comment └───user profile user (basic authentification , profile dashboards) blog (having basic blog models : post,comment) i need give users possbility create 1 or more blogs within same project, don't see how can treat app model. the solution figured out , add foreign key user id every model withn blog app.but there better way ? i think should that: # blog/models.py class blog(model): owner = foreignkey(user, related_name="blogs") name = charfield() class post(model): blog = foreignkey(blog, related_name="posts") #other fields ... class comment(model): post = foreignkey(post, related_name="comments") #other fields ...

objective c - How to retrieve proxy password stored in iOS -

in os x can retrieve username , password proxy using keychain function seckeychainfindinternetpassword . in ios there cfnetworkcopysystemproxysettings , cfnetworkcopyproxiesforurl return proxy hostname , username, not password. how can retrieve proxy password stored in user settings in ios?

authentication - How to configure Jenkins login with google apps -

i had installed jenkins in ubuntu machine , making build successfully. want have authentication of google apps. feel better, searched plugin respective this, can't find it. whether can attained means of plugin or otherways? please let me know ways do. in advance you can achieve single sign on google apps using openid plugin . it's easy set up, install plugin, select "google apps sso (with openid)" , enter domain. note users will have have google apps account login after that. tip: might consider using in combination role strategy plugin

android - ListView "coming back" when scrolling -

i'm getting strange behavior in listview, , 1 listview, have lot of listviews in app, in happening. i try explain, when scroll bottom, right, scrolls go , stop in end. when scroll top, it's scroll splash in top , come bottom. i have this video showing problem. this xml of listview: <listview android:id="@+id/lv_resultado_produtos" android:layout_width="fill_parent" android:layout_height="fill_parent" android:divider="@color/black" android:dividerheight="1dip" android:fastscrollenabled="true" android:scrollx="0dip" android:scrolly="0dip" android:scrollbarsize="22dip" android:scrollbarstyle="outsideoverlay" /> and programmatically set adapter customadapter, nothing more. i tested in others listviews , didn't behavior. i glad if me on this. [edit] here adapter, it's little complex, sorry, tried keep have li...

configuration - Rails 4, reload lib/ directory in developer mode -

what add configuration in rails 4 reload lib/ directory if file changed in developer mode? the best way extend classes coding gem. if dont want code gem because effort oversized can monkeypatch classes placing code in initializers folder. both wont solve problem because gems , initializers loaded once. when want code reloaded after every change have place in app directory. place code in helper includes in classes want extend.

Git: what exactly causes remote branches to update? -

according pro git (3.5): [remote branches are] local branches can’t move; they’re moved automatically whenever network communication. however, doesn't seem correct in practise. i've arrived @ situation branch ahead of 'origin/branch-x' 23 commits. but haven't done commits, fetched /pulled modifications other people have pushed origin. if statement of pro git correct expect remote branch same local one, since every fetch or pull communication origin. what exact operations update remote branches? i suspect issue might rooted in special twist git pull has in semantics — let's cite git pull manual: some short-cut notations supported. ... parameter <ref> without colon equivalent <ref>: when pulling/fetching, merges <ref> current branch without storing remote branch anywhere locally this means when do git pull or git pull origin (which rely on branch.<name>.remote , branch.<name>.merge...

regex - Creating a keyword based search in python -

i have giant csv file close 6k entries , file looks this: pdb id ndb id structure title citation title abstract 1et4 1et4 structure of solution structure research performed , haemoglobin mrna of mrna aptamer structure of mrna obtained aptamer. my end goal display output given keyword so: keyword: mrna pdb id ndb id structure title citation title abstract location of first hit struc/citation/abstract what starting point me? also, have use called regex this? disclaimer: part of research project, not school homework. a pseudocode or template great me. you parse csv file , create 2 data structures. both dictionaries. one dictionary contain each line, keyed on pdb id . other dictionary store sets of pdb id s , keyed on keywords. below example code because i'm ignoring headers. want parse csv properly... from collections import defa...