Posts

Showing posts from July, 2011

amazon iam - DynamoDb access for unauthenticated users -

i want store analytical information use of mobile apps amazon dynamodb. have following requirements: exactly 1 dynamodb table per 1 mobile app an app can putitem method all users of apps unauthenticated (guests) to provide mobile apps way access table in dynamodb see 2 options: hardcode credentials limited permissions apps (permissions putitem specific table); use amazon cognito temporary credentials unauthenticated users in runtime. the second option amazon recommends more secure. in case malicious user can either access hardcoded credentials or hardcoded identity pool id same result: getting access aws resource. question: use of cognito in case give security improvements , if yes, how? cognito identity totally free - wouldn't have pay anything. your point using cognito doesn't add security unauthenticated requests isn't correct. cognito faqs: q: how cognito identity me access aws services securely? cognito identity assigns users set

ios - Firebase Swift: queryEqualToValue by childKey is not working -

has have luck using function: .queryequaltovalue(value: anyobject?, childkey: string?) two things: 1) childkey not seem allow deep paths, direct children 2) can't work @ all! given structure: "post": { "groupname": "hello world" } if simple: postref.queryequaltovalue("hello world", childkey: "groupname").observesingleevent( ... ) it not return posts @ all. instead have roundabout way of: postref.queryorderedbychild("groupname").queryequaltovalue("hello world").observesingleevent( ... ) to work! am using above function incorrectly? xcode 7.2.1 swift 2.1.1 ios 9.2 osx 10.10.5 2) can't work @ all! given structure: "post": { "groupname": "hello world" } if simple: postref.queryequaltovalue("hello world", childkey: "groupname") postref.queryequaltovalue("hello world", childkey: "groupname"

r - How to nest multiple pipes magrittr -

Image
this starts aestethic question turns functional one, magrittr. i want add data_frame manually input 1 there so: cars_0 <- mtcars %>% mutate(brand = row.names(.)) %>% select(brand, mpg, cyl) new_cars <- matrix(ncol = 3, byrow = t, c( "vw beetle", 25, 4, "peugeot 406", 42, 6)) # coercing types not issue here. cars_1 <- rbind(cars_0, set_colnames(new_cars, names(cars_0))) i'm writing new cars in matrix "increased legibility", , therefore need set column names bound cars_0 . if likes magrittr as do, might want present new_cars first , pipe set_colnames cars_1 <- rbind(cars_0, new_cars %>% set_colnames(names(cars_0))) or avoid repetition they'll want indicate cars_0 , pipe rbind cars_1 <- cars_0 %>% rbind(., set_colnames(new_cars, names(.))) however 1 cannot both there confusion whom being piped cars_1 <- cars_0 %>% rbind(., new_cars %>% set_colnames(names(.

tsql - How to rename primary key constraint in SQL Server -

i have pk constraint on table notes named pk_dbo.notes , want rename pk_notes using sql server ddl, i.e. not using ssms rename menu option. mentioned in another question 's answers queries don't work me. that thread 's answers helpful, don't work too. sometimes need explicitly wrap names in square brackets, this: sp_rename @objname = n'[notes].[pk_dbo.notes]', @newname = n'pk_notes' i think it's because of dot in pk name. also, see, pk constraints don't need @objtype = 'object' specified.

php - Nginx/OwnCloud requests being sent to wrong directory -

i have server running nginx instance of owncloud. root of webserver @ /data/domain.com/www/ , root of owncloud files /data/domain.com/www/cloud/ . the owncloud pages load fine, can browse , upload files. have z-push working, cannot share files. when go share, request sent wrong directory per errors: 2016/06/01 20:47:31 [error] 7758#0: *117 "/data/domain.com/www/ocs-provider/index.php" not found (2: no such file or directory), client: 10.1.1.1, server: domain.com, request: "get /ocs-provider/ http/1.1", host: "domain.com" 2016/06/01 20:47:31 [error] 7758#0: *121 open() "/data/domain.com/www/ocs/v1.php/cloud/shares/36/unshare" failed (2: no such file or directory), client: 10.1.1.1, server: domain.com, request: "get /ocs/v1.php/cloud/shares/36/unshare?format=json http/1.1", host: "domain.com" the folders, ocs , ocs-provider both located in cloud directory, inside of www directory. essentially, requests folders being p

php - Delete file after download with response in Cakephp -

my system creates temporary files , send them download. part works well. problem want delete files file system after user download file or after in point in time, seems afterfilter() function last controller method run, executes before file downloaded, not posibility or i'm missing something. i have these functions in dowloadercontroller public function download() { $filename = $this->session->read('namefile'); if (!is_file(storagepath . $filename)) { return; } $this->response->file( storagepath . $filename ); $this->response->download($filename); return $this->response; } and public function afterfilter() { if ($this->session->check('namefile')) { if (is_file(storagepath . $this->session->read('namefile'))) { @unlink(storagepath . $this->session->read('namefile')); } $this->session->delete('namefile'); } } in previ

ios - iPhone 6 Plus UISplitViewController crash with recursive _canBecomeDeepestUnambiguousResponder -

i have existing iphone app i'm adding uisplitviewcontroller to. ipad part works charm, i'm having guaranteed crash iphone 6(s) plus. setup - master uitabbarcontroller . initial detail view placeholder logo view. once object selected, detail replaced uitabbarcontroller . whenever select item , open detail in iphone 6 plus , rotate portrait (detail visible) landscape (where master visible), crashes. not occur on rotation placeholder detail view. before crash, call delegate methods primaryviewcontrollerforexpandingsplitviewcontroller , splitviewcontroller(splitviewcontroller: uisplitviewcontroller, separatesecondaryviewcontrollerfromprimaryviewcontroller . however, works fine on ipad. i've done ton of searching , seen couple twitter mentions of type of crash. things setting or not setting displaymodebuttonitem don't help. i recreated crash in fresh project - can downloaded here: https://github.com/sschale/splitviewcrash/ crash log: crashed thread:

python - Loading lines with Selenium -

in python 2.7, using selenium, want script open 'masters.txt' file. then, go twitter (while logged in beforehand), , post line so: driver.get("https://twitter.com") elem = driver.find_element_by_name('tweet') elem.send_keys(line1 + " #worked") elem = driver.find_element_by_xpath('//*[@id="timeline"]/div[2]/div/form/div[2]/div[2]/button') elem.send_keys(keys.return) then, same, except: elem.send_keys(line2 + " #worked") then, same, except: elem.send_keys(line3 + " #worked") etc... so, load every single line & tweet + "with text i've added". how possible? thanks in advance! :) edit: example of 'master.txt' (text file) contents: test blablabla awesome awesome tweet line etc... what i've tried: f = open("masters.txt") lines = f.readlines() line in lines: elem.send_keys(line + " #worked") however doesn't work , messes etc... if com

symfony - Add scopes to authentified oAuth2 user -

i'm using hwioauthbundle authenticate users google account. i know how add scopes after user's logged in. eg: according parameters, manage user's google calendar. should ask new authorization google me access scope. so question is, how can ask new authorizations logged in user ? hwioauthbundle requests " https://www.googleapis.com/auth/userinfo.profile " scope default. in order manage user's google calendar, want request " https://www.googleapis.com/auth/calendar " scope too. check out on how customize scope request: https://github.com/hwi/hwioauthbundle/blob/master/resources/doc/resource_owners/google.md

c++ - SystemC MAC : Undefined symbols for architecture x86_64 -

i'm trying run systemc programs on mac, base programs compiling , running fine. following errors: undefined symbols architecture x86_64: "pkttrans::pkttrans()", referenced from: producer::processgen() in producer-110ef6.o ld: symbol(s) not found architecture x86_64 functions: void producer::processgen() { int x; x = rand() % 50 + 1; cout<<clk<<":gen random x="<<x<<endl; pkttrans* intrans=new pkttrans; intrans->setaddr(rand() %50 +1); intrans->setid(transid); intrans->setopc(1); incoming.push_back(intrans); transid++; } pkttrans::pkttrans() { id = -1; addr = 0; opc=0; } i added systemc header file , changed int main() int sc_main(). programs compile , run fine without systemc. ideas on why these errors occurring? thanks

javascript - Check to see if Array of Objects have >1 property values that !== undefined -

i have array of objects this: var array = [ {"name": "one", "value": .33}, {"name": "one", "value": .54}, {"name": "one", "value": undefined}, {"name": "two", "value": .3}, {"name": "two", "value": undefined}, {"name": "two", "value": undefined}, {"name": "three", "value": undefined}, {"name": "three", "value": undefined}, {"name": "three", "value": undefined}, ]; and need able see if unique name (one/two/three) has 1 number among it's "value" properties. so, in example answer yes because value properties of "two" are: .3, undefined, undefined. i have way unique "name" fields array: function names(a) { var temp = {}; (var = 0; < a.length; i++) t

c++ - byte representation of ASCII symbols in std::wstring with different locales -

windows c++ app. have string contain ascii symbols: std::wstring(l"abcdeabcde ... other ascii symbol") . note std::wstring uses wchar_t . question - byte representation of string depends on localization settings, or else? can assume if receive such string (for example, windowsapi) while app running bytes same on pc? in general, characters (not escape sequence) wchar_t , wstring have use same codes ascii (just extended 2 bytes). not sure codes less 32 , of course codes greater 128 can has different meaning (as in ascii) in moment of output, avoid problem on output set particular locale explicitly, e.g.: locale("en_us.utf-8") for standard output wcout.imbue(locale("en_us.utf-8")); update: i found 1 more suggestion adding std::ios_base::sync_with_stdio(false); before setting localization imbue see details on how can use std::imbue set locale std::wcout?

custom google search increase number of results -

Image
i wandering if had figured out way increase number of results more 10, when using custom google search engine? know can reset starting point 11, 21, , on, isn't option since have 1,620 results go through , 100 searches per day. not technically programming question - changed in cse console. the hard limit can per page 20 results. higher , you'll need use google's advanced search. you'll find setting here:

c# - Filehelpers - Export with double quotes around each field EXCEPT when field is blank/null -

i may have missed answer when searching have file needs fields double quoted except when field blank, missing or null comma entered. i'm using [fieldquoted('"', quotemode.alwaysquoted)] sample following output: "mary","smith","555-555-5555","","1234","","3141 pi cr." but need output this: "mary","smith","555-555-5555",,"1234",,"3141 pi cr." any suggestions using filehelpers? you can use inotifywrite event modify output before writing file. for instance [delimitedrecord(",")] class product : inotifywrite // <-- implement events { [fieldquoted(quotemode.alwaysquoted)] public string name; [fieldquoted(quotemode.alwaysquoted)] public string description; [fieldquoted(quotemode.alwaysquoted)] public string size; public void beforewrite(beforewriteeventargs e) { } public void

ios - Parse Returns Unauthorized Error -

i downloaded parse starter project swift, filled out parse.setapplicationid() method contained app id , master key app deployed through heroku, , when ran it, got following errors: 2016-06-01 18:19:02.063 parsestarterproject[66355:25475020] [error]: unauthorized (code: 100, version: 1.7.5) 2016-06-01 18:19:02.064 parsestarterproject[66355:25475023] [error]: failed run command error: error domain=parse code=100 "unauthorized" userinfo={code=100, originalerror=error domain=nsurlerrordomain code=-1011 "(null)", temporary=0, error=unauthorized, nslocalizeddescription=unauthorized} you should use code : let configuration = parseclientconfiguration { $0.applicationid = kparseapplicationid $0.clientkey = kparseclientkey $0.server = kparseserverurl $0.localdatastoreenabled = true } parse.initializewithconfiguration(configuration)

performance - android tesseract too much slow -

i have serious issue tesseract in android, takes long time process simple text 10 short lines, 1 or 2 minutes, , of time returns wrong results, more 50% of error. i've tried reduce image size, binarize it, turn flash on while taking photo, none of reduced time spent or improved quality of results. know can do? thank you.

Unable to connect to MySQL with PHP - Android Studio -

i having difficulties trying set connection database php... have tried many things, double-checked sql queries, , don't see why not working... i'm still newbie, guess i'm missing out of range yet. trying create app take user registration. this error i'm getting in android studio: org.json.jsonexception: value <!doctype of type java.lang.string cannot converted jsonobject my php code is: <?php $servername = "my server here"; $username = "my username here"; $password = "my password here"; $dbname = "my db here"; // create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // check connection if (!$conn) { die("connection failed: " . mysqli_connect_error()); } $sql = "insert user (username, email, passcode) values (?, ?, ?)"; if (mysqli_query($conn, $sql)) { $last_id = mysqli_insert_id($conn); echo "new record created successfully. last inserted id is: " .

java - How to set conditional WebView resizes on a Cordova/Phonegap project? -

i'm using plugin creates webview (appodeal banners) overlaps main apps webview. theres not way fix manipulating html tags because elements mess default banner settings 32px : device screen height <= 400 50px : 400 < device screen height <= 720 90px = device screen height > 720 so webview must resize height according appodeal banner height. example: if (device.screen.height <= 400) { webview.height = webview.height - "32px" } ps: i'm not java programmer web developer only i'm not sure have resize root webview on admob banner show (i'm not sure possible @ all). need re-layout content of main webview when banner shown. if understood post right, use appodeal phonegap plugin uses 1 more webview component show ads. in case know about: banner placement (top or bottom), b/c request explicitly ( appodeal.banner_top | appodeal.banner_bottom ); banner size (you described in question); a fact banner appeared (

JavaScript/jQuery - Convert from 24 Hr Datetime String to 12Hr Date format? -

var timezone ="cdt" var startdatetime = "2016-06-15 22:30:00.0"; this.outdate = function() { return getjusttime(startdatetime,timezone); } function getjusttime(startdatetime,timezone) { outdt = new date(startdatetime.replace(/ /g,'t')); return outdt; } **expected output** this.outdate = "10.30 pm cdt"; i have 2 variables above 24 hour datetime string , want convert 12 hour format date string. missing in missing? p.s : can't use datetime librarires. just write own. date object helpful. function am_or_pm (date) { var date_obj = new date(date); var hours = date_obj.gethours(); var morn_or_night; // wouldn't in production, make logic clear - use conditional operator here. // handling midnight if (hours === 0) { hours = 12; morn_or_night = 'am'; // handling noon } else if (

java - How to ensure uniqueness in Labeled index in neo4j -

how can ensure put if absent /create unique functionality while creating nodes using labeled indexes in core java api? earlier index index manager , fire putifabsent. after create label , index it, lets user label userid indexed property, cannot index used to. method graphdb.index().existsfornodes("user") returns false. this looks merge in cypher not exposed in java api, afaik http://docs.neo4j.org/chunked/snapshot/query-merge.html#merge-merge-single-node-with-properties if need 1 please open issue on github https://github.com/neo4j/neo4j/issues

php - Using fgetcsv and fopen issue with looping never exiting -

there's issue piece of code never gets "done" echo. for($current_day=1;$current_day<=10;$current_day++){ echo("lists/day ".$current_day.".csv </br>"); $person_data = ""; if ( ( $handle = fopen( "lists/day ".$current_day.".csv", "r" ) ) !== false ) { while ( ( $data = fgetcsv( $handle, 1000, ",", "//" ) ) !== false ) { if ( $data[2]!="grade" ) { $collection = $db->students; $person_data['last_name'] = trim( $data[0] ); $person_data['first_name'] = trim( $data[1] ); $person_data['fullname'] = $person_data['first_name'].' '.$person_data['last_name']; //var_dump($person_data); $cursor = $collection->findone(array('fullname'=>$person_data['first_name'].' '.$pers

php - How to set default value of a select dynamically from database using smarty? -

i have select this: <select class="fruitsselect" name="fruits"> <option value="apples">apples</option> <option value="bananas">bananas</option> <option value="oranges">oranges</option> </select> and know can set default value if use selected attribute. <select class="fruitsselect" name="fruits"> <option value="apples">apples</option> <option value="bananas" selected>bananas</option> <option value="oranges">oranges</option> </select> but trying that, value retrieve database (i send html via php ) option retrieve database selected option (the default option). i have value on html not know how make selected option because can change. using smarty , trying make ifs statements cannot out. how can compare value retrieve database value of select , make

ruby on rails - Cropping then resizing with paperclip not working -

i trying crop square section out of larger rectangular image, , resize smaller standard size, every time comes out resized , not cropped @ all. tried doing said on how crop , resize paperclip still seems not work... tried same options command line manually , worked expected. how make want? has_attached_file :image, styles: { small: { convert_options: "-gravity northwest -crop 608x608+300+27 +repage -resize 200x200^" } }

html - <a href="www.example.com">example</a> redirects to mysite.com/www.example.com? -

this question has answer here: replace www.example.com w/ <a href=“http://www.example.com”>www.example.com</a> 4 answers example: <a href="www.example.com"> click here go www.example.com!</a> and <a href="http://www.example.com"> click here go www.example.com!</a> the first 1 redirects following url: http://www.currentsite.com/www.example.com while second 1 works fine. here's code i'm using: (ruby on rails) <%=h link_to @user.details.website, @user.details.website, :class => 'link'%> the solution have checking http:// , add if it's not there. why, yes. uris not starting / or ...:// relative uris , resolved against current uri. browser has no idea mean "www.example.com" domain name, because it's valid path name , looks relative uri. you h

r - Creating lavaan and mirt models permuations of varying size and length -

hoping can offer guidance here. i'm creating multivariate simulation using simdesign package, varying number of factors items load on each factor. write command identifies number of factors present in factornumbers , assigns appropriate items them (no cross loading). testing combinations of conditions below , more, , have model command acknowledge iterations of differing models, don't have write multiple model statements. factornumbers<-c(1,2,3,5) itemsperfactor<-c(5,10,30) what lavaan , mirt looking below: mirtmodel<-mirt.model(' f1=1-15 f2=16-30 mean=f1,f2 cov=f1*f2') lavmodel <- ' f1=~ item_1 + item_2 + item_3 + item_4 + item_5 + item_6 + item_7 + item_8 + item_9 + item_10 + item_11 + item_12 + item_13 + item_14 + item_15 f2=~ item_16 + item_17 + item_18 + item_19 + item_20 + item_21 + item_22 + item_23 + item_24 + item_25 + item_26 + item_27 +

cocoa - NSResponder and multiple NSTableView - who sent message? -

i've got 2 nstableview in single nsviewcontroller, , each has own nsarraycontroller handle exists. i'm trying wire edit->delete button. how know, when delete method called, 'who' sent message? specifically want know whether clicked first table view or second 1 when chose delete menu item. 'sender' delete method nsmenuitem can't back-track table. get firstresponder of window , follow nextresponder until find table view.

ios - Is there any dump() like function returns a string? -

i swift's dump() function this, class myclass { let = "hello" let b = "bye!" init() {} } let myclass = myclass() dump(myclass) // printed out these lines xcode's console /* ▿ myclass #0 - a: hello - b: bye! */ but dump() doesn't return string. prints out console, , returns 1st parameter itself. public func dump<t>(x: t, name: string? = default, indent: int = default, maxdepth: int = default, maxitems: int = default) -> t is there dump() function returns string? from: https://github.com/apple/swift/blob/master/stdlib/public/core/outputstream.swift /// can send output of standard library's `print(_:to:)` , /// `dump(_:to:)` functions instance of type conforms /// `textoutputstream` protocol instead of standard output. swift's /// `string` type conforms `textoutputstream` already, can capture /// output `print(_:to:)` , `dump(_:to:)` in string instead of /// logging standard output. example: let

javascript - How to compute the difference between 2 time in jquery datetimepicker? -

i'm using jquery datetimepicker, want difference between start time , end time. how can calculate using javascript/jquery code? i set start , end time in html like . <div class='input-group date' id='time_starts_at'> <input class="form-control" placeholder="time start's @ *" autocomplete="off" type="text" name="" id="calendar_starts_at_time"> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span> </span> </div> <div class='input-group date' id='time_ends_at'> <input class="form-control" placeholder="time end's @ *" autocomplete="off" type="text" name="" id="calendar_ends_at_time"> <span class="input-group-addon"> <span class="glyphicon glyphicon-time"></span>

linked list - How to have your own Node structure in a forward_list in C++? -

how combine own typical typedef node { int data; int data1; node* next} make forward_list ? think can throw away node* next (i.e. typedef node { int data, int data1} ) , make stl manage pointers through forward_list, how delete pointer particular node ? standard iterator on forward_list long int , not node ; if use node create linkedlist, how delete node list ? i think can throw away node* next , make stl manage pointers yes should do how delete pointer particular node ? std::forward_list::remove std::forward_list::erase_after std::forward_list::remove_if std::forward_list::pop_front std::remove std::remove_if give different algorithms delete nodes list how delete node list ? follow example in link

python - How do I modify the DB from Flask without posting? -

i have small flask application displays number of items held in sqlite 3 database. have cron job runs every day , (should) insert new entries database. i have created following function modify database: def add_entry(name): statement = 'insert ....' g.db.execute(statement, [name]) g.db.commit() however, when run receive: runtimeerror: working outside of application context how modify database without posting url? you'll need create application context explained in flask documentation on subject . like with app.app_context(): add_entry() should trick.

javascript - Highcharts with ajax / json -

this isn't problem highcharts rather more javascript function passes data. first off , java skills pretty basic .. , pretty damn bad honest. laughing @ code equivalent of laughing @ handy capped people :) anyway, idea pretty simple , i'm feeding highcharts graphs network traffic gathered php script via snnp call. the data encoded json_encode , output looks this: [1464786728000,13850896] first value current time , second value traffic measured in octets. i've included php script below. now of works pretty , data gets collected , graphs plots in real time no issues. problem comes in have pass current value javascript function can deduct previous value current value i'm left difference between intervals. need multiply value 8 ... since i'm converting octets bits , divide poll interval. should rather simple reason i'm unable read previous variable when pass it. i hope i'm making sense here ;) function requestdata(previous) { var poll = 1000; $

plugins - How to correctly deal with spans in procedural macros? -

i want procedural macro replace binaryops methods. how set spans if errors occur users not confused? after looking rustc 's source, came conclusion following "expansion" model produces best results. keep original span expn_id , can calling extctxt::backtrace() . it appears idea set in both cases outlined in question. operator can seen expanded (function call) path, , original binary operation expression expanded function call. in code: match expr.unwrap() { .. expr { node: exprkind::binary( spanned { node: add, span: op }, l, r), span, .. } => { let bt = self.cx.backtrace(); // expansion id let path = self.cx.path(span { expn_id: bt, ..op }, vec![crate_name, trait_name, fn_name]); let epath = self.cx.expr_path(path); // path expression let args_expanded = self.fold_exprs(args); self.cx.expr_call(span { expn_id: bt, ..span }, epath, args_expanded) // ^ outer expression } .. }

"Setup SDK" error display in new android studio 2.1.1 -

Image
i download newest android studio developer site. after installation installed android studio, created new project , after project build completed, opened mainactivity.java file find error. please refer screenshot below: i downloaded android sdk component built-in in android studio. rebuild project. try clean build. should do. faced similar problem. tools -> android -> sync project gradle files build -> rebuild incorrect installation of jdk might cause problems. please tell error in detail. you can try jdk installation:- on windows systems, launcher script not find jdk installed. if encounter problem, need set environment variable indicating correct location. select start menu > computer > system properties > advanced system properties. open advanced tab > environment variables , add new system variable java_home points jdk folder, example c:\program files\java\jdk1.8.0_77.

c# - Is it Possible to upload a ASP.Net WebService into WordPress Site? -

this question answered in this there no explanation on how did it? there step step method on how can upload webservice wordpress site? is possible upload asp.net webservice yes possible webservice can hosted. question should how can rather this. simple answer contact host . 1 needs iis server host stuff build in .net framework if webservice api or thing requires http protocol . after hosting webservice question will/should how access it, totally different question , can find related here , here i hope helps in way , don't worry vote down you'll used

node.js - Express js - Error handling in middleware -

i have route app.get("/some/url/", function(req, res){ res.sendstatus(404) }) i trying handle or catch 404 in express error handling middleware , not working app.use(function(err, req, res, next){do here}) any how capture error thrown route in middleware. app.get("/some/url/", function(req, res) { // generate error yourself. throw new error("generated error."); }); // global error handler app.use(function(err, req, res, next) { console.dir(err); // error status code , message here. res.status(500).send('something broke!'); });

gestures - Determining a fling from a pan in libgdx -

i'm developing game libgdx , i'm having trouble determining fling pan . my gesturelistener : @override public boolean fling(float velocityx, float velocityy, int button) { //if (velocityx > 1000f) { // can use exclude slow pans executing fling system.out.println("flinged - velocityx: " + velocityx + ", button: " + button); //} return false; } @override public boolean pan(float x, float y, float deltax, float deltay) { // there doesn't seem way have not fire on fling system.out.println("panned - deltax: " + deltax); return false; } @override public boolean panstop(float x, float y, int pointer, int button) { system.out.println("pan stop - pointer: " + pointer + ", button: " + button); return false; } the problem if both pan , fling fire. understand fling fast pan , need able determine between 2 gestures can handle each 1 separately. a succinct way of asking is,

git tag - How can I create a git alias to delete a tag remotely? -

i'm having trouble creating git alias delete tag remotely. i have following in .gitconfig : [alias] deltag = push origin :refs/tags/$1 running deltag alias after deleting tag locally (with git tag -d testtag ) results in error: $ git deltag testtag error: src refspec testtag not match any. error: failed push refs 'ssh://........' attempting run alias before deleting locally results in instead: $ git deltag testtag remote: warning: deleting non-existent ref. ssh://........ - [deleted] $1 what correct syntax use alias? i solved hunting around on stackoverflow , putting other answers together. there may other solutions too, turning alias shell command passes tag argument through: [alias] deltag = !sh -c 'git push origin :refs/tags/$1' - or better, combining both local , remote delete 1 alias: [alias] deltag = !sh -c 'git tag -d $1 && git push origin :refs/tags/$1' - the output: $ git deltag testtag

javascript - AmCharts default axis values -

Image
i building demographic chart, age ranges, getting age ranges json, problem when values empty chart displays nothing, or when there's 1 or 2 values blocks huge , doesn't show other ages want show empty still visible.... my chart now: as can see it's displaying fine, want show other age ranges don't have values, possible option in amcharts? my json [{"age":"45 - 64","male":-100,"female":50},{"age":"31 - 45","female":50}] my amcharts javascript $.getjson('<?php echo site_url; ?>analytic/jobs_demographic_json', function(chartdata) { amcharts.makechart("container2", { "type": "serial", "theme": "light", "rotate": true, "marginbottom": 50, "dataprovider": chartdata, "startduration": 1, "graphs": [{ "f

ios - In App Purchase - Help on Last stage - downloading content -

i have implemented iap app having problem figuring out user supposed find purchased content after pay. using test account, when click buy button, marks iap tick if show bought there can't find content... can assist me need add code , storyboard user able access purchased content.... (the content several short videos available user through iap) from have read through tutorials, think code im missing this: -(void)paymentqueueskpaymentqueue *)queue updateddownloadsnsarray *)downloads { (skdownload *download in downloads) { switch (download.downloadstate) { case skdownloadstateactive: nslog(@"download progress = %f", download.progress); nslog(@"download time = %f", download.timeremaining); break; case skdownloadstatefinished: // download complete. content file url @ // path referenced download.contenturl.

html - "AutoComplete=Off" not working on Google Chrome Browser -

this question has answer here: chrome browser ignoring autocomplete=off 35 answers i know there 1 similar question on stackoverflow, none of solution there worked me. <form autocomplete="off" id="search_form" method="post" action=""> <input autocomplete="off" type="text" /> </form> as can see, put autocomplete=off on both form , input field, google chrome still displays autocompletion list. doesn't happen in other browsers firefox , safari. any other solution other putting autocomplete=off on form tag?? it may bug on google chrome, can't cheat create hidden input over. auto complete feature first input text fill data. <form autocomplete="off" id="search_form" method="post" action=""> <input type="text&q

onclicklistener - how to set on click listener of recyclerview where list items are heterogenous -

i have recyclerview 2 types of viewholders showing 2 types of items want implement on click listener on sub itmes in items existing solutions shows viewholder class should implemented static inside adapter ,but have declared them in sepearte file(a tutorial suggested), cant implement onlick listener on viewholders viewholder1 class public class viewholder1 extends recyclerview.viewholder { private textview label1, label2; public imageview postimage; public viewholder1(view v) { super(v); label1 = (textview) v.findviewbyid(r.id.text11); label2 = (textview) v.findviewbyid(r.id.text22); postimage = (imageview) v.findviewbyid(r.id.dummyimage); } public textview getlabel1() { return label1; } public void setlabel1(textview label1) { this.label1 = label1; } public textview getlabel2() { return label2; } public void setlabel2(textview label2) { this.label2 = label2;

Sending argument in reverse_lazy django - Python -

i using reverse_lazy following def index: if firsttimelogin == 0: response = httpresponseredirect(reverse_lazy('abc', args={'cid': 0})) else: response = httpresponseredirect(reverse_lazy('abc', args={'cid': 1})) abc view def abc(request, userid = none, cid =1 ): return httpresponse(cid) urls.py url(r'^abc/$', views.abc, name='abc'), url(r'^abc/(?p<userid>.*)/$', views.abc, name='abc'), url(r'^abc/(?p<cid>.*)/$', views.abc, name='abc'), now when redirected def abc through reverse_lazy url like: baseurl/appname/abc/cid , here dont know how can fetch value of cid. please correct if other approach required. need pass argument reverse_lazy want fetch in def abc update refering romaan saying: have updated: urls.py as: url(r'^abc/(?p<cid>.*)/$', views.abc, name='abcfirst') and redirect as: response = httpresponseredirect(r

android - App hangs with screen blackout on back press from external app -

i have share option in navigation drawer of app. on click, working fine go respective intent i.e. "share intent". issue on pressing button whatsapp , app hangs showing black screen. pressing again nothing , app has killed eventually.i using coordinator layout. below code snippets: mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); sidemenu = (listview) findviewbyid(r.id.left_drawer); msidemenulistadapter = new sidemenulistadapter(this, mdrawerlayout); sidemenu.setadapter(msidemenulistadapter); adapter code: holder.share.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { mdrawerlayout.closedrawer(gravitycompat.start); intent share = new intent(); share.setaction(intent.action_send); share.settype("text/plain"); share.putextra(intent.extra_subject, "xxx"); share.putextra(intent.extra_text, "****")); share.addflags(intent.flag_activity_new_task | intent.

c# - MVC Repository Pattern - disposing multiple repositories? -

in application i'm trying apply repository pattern using this asp.net guide , without using generic repository , unit of work. the thing concerns me disposing. @ moment, application disposes dbcontext using standard dispose() controller method: librarycontext db = new librarycontext(); // ... // protected override void dispose(bool disposing) { if (disposing) { db.dispose(); } base.dispose(disposing); } but how dispose multiple repositories? example, i've got 3 of them: bookrepository , userrepository , collectionrepository . should dispose them in method, like: protected override void dispose(bool disposing) { if (disposing) { bookrepository.dispose(); userrepository.dispose(); collectionrepository.dispose(); } base.dispose(disposing); } is correct approach? thank answers. you can create base repository extended others. in ctor of base repository can initialize dbcontext class , when want