Posts

download - Content-Disposition in dropbox -

is there way rename file while downloading dropbox without changing filename : for example : dropbox link : https://www.dropbox.com/s/uex431ou02h2m2b/300x50.gif?dl=1 and file downloaded : newnameimage.gif instead of 300x50.gif content-disposition header didn't work me . any ideas how ? if you're downloading file locally should either able control name given local file, or able rename after fact. example, using curl, -jo downloads file using remote name specified in content-disposition header, while -o lets specify name: $ curl -l -jo "https://www.dropbox.com/s/uex431ou02h2m2b/300x50.gif?dl=1" ... curl: saved filename '300x50.gif' $ ls 300x50.gif $ rm 300x50.gif $ curl -l -o "newnameimage.gif" "https://www.dropbox.com/s/uex431ou02h2m2b/300x50.gif?dl=1" ... $ ls newnameimage.gif alternatively, renaming after fact: $ curl -l -jo "https://www.dropbox.com/s/uex431ou02h2m2b/300x50.gif?dl=1" ... curl: saved fil...

android - CoordinatorLayout with RecyclerView: onScroll -

i have recyclerview have added different actions can performed on list items. particularly, dragdrop , swipedismiss . dragdrop initiated long-press, , swipedismiss initiated swiping. have watch scroll events block actions happening. annoying scrolling switched dragging. before add onscrolllistener handle this. this did before: @override public void onscrollstatechanged(recyclerview recyclerview, int newstate) { super.onscrollstatechanged(recyclerview, newstate); if(newstate == recyclerview.scroll_state_idle){ drag.setcurrentaction(idle); } else { drag.setcurrentaction(scroll); } } no longer work i added coordinatorlayout collapsable toolbars . when scrolling up, drag wont set scroll until toolbar has been collapsed. tried create own behavior, replace current behavior using; @string/appbar_scrolling_view_behavior . removed behaviors wanted toolbar , didn't work notify drag state. what have tried: @override public boolean ons...

sas - How to scan a numeric variable -

i have table this: lista_id 1 4 7 10 ... in total there 100 numbers. i want call each 1 of these numbers macro created. trying use 'scan' read it's character variables. error when runned following code there's code: proc sql; select id into: lista_id separated '*' work.amostra; run; proc sql; select count(*) into: nr separated '*' work.amostra; run; %macro ciclo_teste(); %let lim_msisdn = %eval(nr); %let = %eval(1); %do %while (&i<= &lim_msisdn); %let ref = %scan(lista_id,&i,,'*'); data work.up&ref; set work.base&ref; format perc_acum 9.3; if first.id_cliente perc_acum=0; perc_acum+perc; run; %let = %eval(&i+1); %end; %mend; %ciclo_teste; the error that: variable perc unitialized and variable first.id_cliente unitialized. what want run macro each 1 of id's in list showed before, ,...

c++ - Enum or array with structs inside -

i have (constant) data this: (index) width height scale name 0 640 360 1 "sd" 1 1080 720 2 "hd" 2 1920 1080 3 "fhd" so far - have created structure this: struct resolution { int width; int height; int scale; std::string name; }; now need object let me this: int index = 0; int width = resolutions[index].width; // 360 i need enum or array constant, , accessible without initialization (static?). for start constant data not use std::string . but following: struct resolution { int width; int height; int scale; const char * name; }; struct resolution resolutions[] = { {640, 360, 1, "sd"}, { 1080, 720, 2, "hd"}, { 1920, 1080, 3, "fhd"} }; but on note use lowercase variation variable.

vba - Excel Autofilter all but variable value -

so need filter values in row except one. got work, using part of code, filter on everything, "belgium", need there variable. dim myvalue variant myvalue = inputbox("which country exclude? ") range("ab1").select activesheet.range("$b$1:$by$319696").autofilter field:=27, criteria1:="<>belgium" for version of filter filter on particular country variable works fine: dim myvalue variant myvalue = inputbox("which country filter on: ") range("ab1").select activesheet.range("$b$1:$by$319696").autofilter field:=27, criteria1:= _ myvalue activewindow.smallscroll down:=-30 so why not work: activesheet.range("$b$1:$by$319696").autofilter field:=27, criteria1:= <>myvalue also not know why structured this, generated record macro, _ criteria1:= _ myvalue the "<>" isn't operator (which how tried use in "not working...

python - Django multiple inheritance E005 -

in django docs stated in order use multiple inheritance 1 either has to use explicit autofield in base models or use common ancestor hold autofield in case have common ancestor in following setup (as taken docs): class piece(models.model): piece_id = models.autofield(primary_key=true) class article(piece): pass class book(piece): pass class bookreview(book, article): pass unfortunately results in following error: $ python manage.py check systemcheckerror: system check identified issues: errors: testapp.bookreview: (models.e005) field 'piece_ptr' parent model 'testapp.book' clashes field 'piece_ptr' parent model 'testapp.article'. system check identified 1 issue (0 silenced). any way around this? edit: django version 1.8.2 i found out can name link parent: class piece(models.model): pass class article(piece): article_to_piece = models.onetoonefield(piece, parent_link=true) class bo...

facebook - allow lifetime checking of users inbox in our web app in fb php sdk -

i doing web app , should run in cron , checks if facebook user (who authorized app) has new unread message in inbox. updates in our database. i using php script: if ( isset( $session ) ) { $request = new facebookrequest( $session, 'get', '/123456/inbox' ); $response = $request->execute(); $graphobject = $response->getgraphobject(); echo print_r( $graphobject, 1 ); } else { $params = array( 'read_mailbox' ); $weburl = "http://example.com/cron.php"; $helper = new facebookredirectloginhelper( $weburl ); $loginurl = $helper->getloginurl( $params ); header("location: $loginurl"); } it works when (user) visit page in browser not working in cron job. how should write php instructions graph api able check of our users' inbox script? (without need of prior login via our page)