Posts

python - Django generic views - sending data to project templates -

i try send data generic views app urlpatterns = patterns('', (r'*', listview.as_view( queryset=post.objects.all().order_by("-created")[:2], template_name="/mysite/templates/index.html" )), ) however, data cannot sent c/p query , result returned. what's missing? in mysite/templates/index.html {% post in object_list %} {{ post.title }} {% endfor %} prints nothing you not providing enough information. r'*' not valid regular expression - * needs act on - , django report if tried use in urlconf. need show how including url in main urls.py.

I want to make a spinner in android such that it acts as dropdown instead of poping out -

Image
in image ..the button shows settings spinner dropsdown ...so want make such spinner dropsdown.. thanks in advance.. i guess example wasn't implemented spinner, since there 2 items don't benifit using spinner instead of making own "dropdown" layout, , making visible upon press of button. if have relatively few things want in drop down suggest going route , staying away spinner one. if have long list of data user choosing though , wanting make dropdown (similar combo box etc.) overriding spinner, change way ondraw() works display inline view in parent, rather popping out. though think stock spinner provide better user experience this.

c# - Winforms - Underline part of text to be displayed in textbox -

i have line of text display , want underline heading portion of text in display. how accomplish please? message: message name of client. where "message:" underlined. if want show text using rich text box, this: richtextbox1.selectionfont = new font("times new roman", 10, fontstyle.underline); richtextbox1.selectedtext = "message:"; richtextbox1.selectionfont = new font("times new roman", 10, fontstyle.regular); richtextbox1.selectedtext = " message name of client."; or, if message dynamic , header , text separated colon, this: string message = "message: message name of client"; string[] parts = message.split(':'); richtextbox1.selectionfont = new font("times new roman", 10, fontstyle.underline); richtextbox1.selectedtext = parts[0] + ":"; richtextbox1.selectionfont = new font("times new roman", 10, fontstyle.regular); richtextbox1.selectedtext = parts[1]; or, if wa...

c# - Elegant MVC code for optional surrounding tag -

what more elegant code accomplish following: foreach(var filter in model.filters) { if(filter.selected) { <div class="crumb crumb_selected" id="@filter.id"> @* more html can here *@ @filter.title <span class="counter"> (@filter.count) </span> </div> } else { <div class="crumb" id="@filter.id"> <a href="@model.clickurl(model.selectedfilters, filter)"> @* more html can here similar code above *@ @filter.title <span class="counter"> (@filter.count) </span> </a> </div> } } the repeated html code div / span seems bad code also css-class specification should solved in elegant version @helper myhelper(somedatatype filter) { @* more html can here *@ @filter.title <span class="counter"> (@filter.count) </span...

c# - Crystal Reports Data Not On Same Rows It's Skip The Row -

i have crystal sub reports on main reports' pageheader section below: sub-report1: report header label purchase sales details section field purchase sales display result is: purchase sales purchase account sales account the above result not on same row it's skip same row of sales field want in same row below. purchase sales purchase account sales account what problem it?. why data not show in same rows , how it?. not have running total field on sales amount , purchase amount.

iphone - xcode counting JSON items -

i need count number of items (post) in json response, 2012-06-04 14:09:57.872 horitable[72261:11903] json : { posts = ( { post = { eventdate = "2012-03-31"; eventid = 2; eventimage = "http://hernandoz.local/~hernandoz/kopict/02_31march2012.jpg"; eventinfo = "02 event"; eventname = "xplosion 02"; }; }, { post = { eventdate = "2012-07-07"; eventid = 3; eventimage = "http://hernandoz.local/~hernandoz/kopict/greg_vs_turner.jpg"; eventinfo = "02 event"; eventname = "xplosion 02"; }; }, { post = { eventdate = "2012-04-29"; eventid = 4; eventimage = "http://hernandoz.local/~hernandoz/kopict/ko_itclub_apr_2012.jpg"...

android - Specifying a Single Request To Use Credentials with HttpClient -

i using oauth2 on android project. idea use singleton httpclient used threadsafeclientconnmanager. for normal request server construct authorization header , send that. header constructed values received server. works fine. every 15 minutes must new values server construct header. received these values must set credentials so. client.getcredentialsprovider().setcredentials( new authscope(authscope.any_host, authscope.any_port), new usernamepasswordcredentials(creds.clientid, creds.clientsecret)); in order work must set , new defaulthttpclient. if use original singleton httpclient receive errors. question is.. possible set credentials used on 1 request? i noticed there authscope. host , port not suitable maybe realm would? can't find tells me realm or how use it. 06-05 10:12:55.969: w/system.err(23843): org.apache.http.nohttpresponseexception: target server failed respond 06-05 10:12:55.969: w/system.err(23843): @ org.apache.http.impl.conn.def...