Posts

Showing posts from April, 2011

java - Android - Execution failed for task ':app:compileDebugJava' with ';' expected -

im fresher in android app dev... using android studio 1.3, jdk 8 event log : 12:44:13 gradle build finished in 13s 724ms 12:59:50 executing tasks: [:app:assembledebug] 12:59:55 gradle build finished 2 error(s) in 5s 804ms gradle build: error:(41, 31) error: ';' expected error:execution failed task ':app:compiledebugjava'. compilation failed; see compiler error output details. information:build failed information:total time: 5.088 secs information:2 errors information:0 warnings information:see complete output in console java class code: package in.co.doordie.shankar.doordie; import android.app.activity; import android.content.intent; import android.media.mediaplayer; import android.os.bundle; public class splash extends activity { mediaplayer oursong; @override protected void oncreate(bundle doordiesplash) { super.oncreate(doordiesplash); setcontentview(r.layout.splash); oursong = mediaplayer.create(splash.this, r.raw.kaly...

Download blur image before actual image gets downloaded in android -

i want image downloading whatsapp blur images appear , when click on image clear image gets downloaded.i want same kind of work in android app.can suggest how achieve this? you can use image loading liabrary(picasso,glide or uil) firstly load image of low quality if using picasso picasso.with(this).load("....").resize(100,100).into(imageviews); than on click load full image.

ios - Audio and video pts is not sync ffmpeg -

i'm trying write sort of rtsp ios streamer based on ffmpeg project. basically, i've got project https://github.com/durfu/dfurtspplayer . big creator of project, unfortunately has problems playing of streams decided write streaming player myself using author's developments. of course, correctly stream playing need sync audio video , can comparing pts of frames. problem in huge gap between audio , video pts. have thoughts i'm getting pts audio , video wrong, couldn't find actual problem own. here's function: - (void) decodeframe { int framefinished = 0; avpacket newpacket; while (framefinished == 0 && av_read_frame(formatctx, &newpacket) >= 0) { if (newpacket.stream_index == videostream) { avcodec_decode_video2(videocodecctx, videoframe, &framefinished, &newpacket); [self convertframetorgb]; uiimage *newimage = [self currentimage]; if (newpacket.pts != ...

asp.net mvc 4 - mvc4 areas multiple route -

i have web site in mvc4 area "admin" inside controller named "homecontroller" ,also in project folder controller controller named "homecontroller" : when call public actionresult logoff() { formsauthentication.signout(); return redirecttoaction("index", "home"); } i error : multiple types found match controller named 'home'. can happen if route services request ('{controller}/{action}/{id}') not specify namespaces search controller matches request. if case, register route calling overload of 'maproute' method takes 'namespaces' parameter. the request 'home' has found following matching controllers: site1.co.il.controllers.homecontroller site1.co.il.areas.admin.controllers.homecontroller if have same controller , action in different areas, mvc4 has no way choose 1 of them, unless specify desired route. you can specify this: return redirecttoaction("action", ...

javascript - How to convert svg element height/width size into pixels -

i have svg elements , want height , width in terms of pixels. how this? <rect height="200" width="400" fill="red" stroke="1"> measurements in vector formats relative size 'window' or 'viewer' going rendered in. without knowing viewports size in pixels, infinitely large or small. if have viweports size , element isnt being transformed anything, you'd need see element in relation viewport, ensure displayed, , calculate rendered size. however, beware if being clipped out of diplay being partially or 'off screen'.

c# - Prevent WNetAddConnection2 class which allows prohibited user to access shared folder -

i had developed c# windows application. os windows 7 requirement: access network shared folder ‘test’ using code credentials using wnetaddconnection2 class. restriction: users has access of shared folder ‘test’, other user,‘deny’ sharing permission set. in code wnetaddconnection2 validates wrong username/password, give me error. for example ‘user a’ lan trying access shared folder ‘test’ using run command , not able access ‘access denied’ because has not permission. but issue wnetaddconnection2 class allows ‘user a’ establish network connection successfully. infect “wnetaddconnection2 allows users domain”. class validating access rights. code is private void btnvalidate_click(object sender, eventargs e) { bool valid = false; try { networkcredential nc = new networkcredential(txtusername.text.trim(), txtpassword.text.trim()); } catch (exception ex) { message...

What's the meaning of this line of CoffeeScript? -

i reading through journo's source code , stumbled upon line of code: markdown = _.template(source.tostring()) variables what variables doing here? _.template(source.tostring()) variables valid stntax @ all? here's function wrapping line of code: journo.render = (post, source) -> catcherrors -> loadlayout source or= fs.readfilesync postpath post variables = rendervariables post markdown = _.template(source.tostring()) variables title = detecttitle markdown content = marked.parser marked.lexer markdown shared.layout _.extend variables, {title, content} yes, valid. parenthesis optional (sometimes) in coffeescript when invoking function, taking result of template , invoking arguments. compiles javascript: _.template(source.tostring())(variables); from coffeescript documentation : you don't need use parentheses invoke function if you're passing arguments. implicit ca...

android - Trigger swipe animations without calling a new Activity/Fragment -

i want trigger default swipe animations on android when swipe gesture occurs, without changing displayed activity. the point of want simulate activity has changed when important event occurs in activity. the questions i've seen on internet relly on changing activity, fragment, view ,etc. i wonder if possible. in advance this not possible far know. google against allowing such behavior through purely libraries not follow android ui patterns.

php - find string in file on server and replace it -

i made script in .php find appearances of code( in case javascript code <script> tags), , replace else, on live server. something grep -rnw '/path/to/somewhere/' -e "pattern" . my question : how run .php script on server search files on server string , replace other string. on desktop i've coded , worked : ` <?php $what = <<<eod <script>bla bla string</script> eod; $with=" "; $path_to_file = '/users/michael/desktop/results-prod.txt'; $file_contents = file_get_contents($path_to_file); $file_contents = str_replace($what,$with,$file_contents); file_put_contents($path_to_file,$file_contents); ?> and need live server , files(more 1 , using different paths). thanks, michael! $find = "your mom"; $replace = "your dad"; $dir= "/path/to/dir"; $files = scandir($dir); foreach($files $file){ if($file == "." || $file == "..") continue; $pat...

html - PHP: Bootstrap Radio button value not showing -

i have bootstrap form 3 radio buttons. saving value variable can use save database , email. html: <form class="form-horizontal form-validate" id="signup-form" method="post"> <input type="hidden" name="signupform" /> <div class="control-group"> <label class="control-label">seed program</label> <div class="controls"> <input type="radio" name="signup" value="seed program" checked="checked"/> </div> </div> <div class="control-group"> <label class="control-label">gift wrap program</label> <div class="controls"> <input type="radio" name="signup" value="gift wrap" /> </div> </div> <div class="control-group"> <label class="control-label">sign both</label...

android - Parse a nested json with retrofit 2.0 -

i have json's , want use retrofit parsing them. { "status": "true", "data": [ { "id": "1", "title": "hi :)", "text": "<p>121212</p>", "cat_id": "1", "username": "admin", "coin": "0", "datetime": "1451508880", "isshow": "1" }, { "id": "3", "title": " hi :)", "text": "hi :)", "cat_id": "2", "username": "hi :)", "coin": "20", "datetime": "1451508880", "isshow": "1" }, { "id": "4", "title": "a", "text": "sometext", "cat_id": "1", "username": "admin", "coin": "10...

android - How to add threshold to interstitial? -

Image
i have problem interstitial. how can add threshold interstitial ? private void setupinterstitial() { minterstitialad = new interstitialad(this); minterstitialad.setadunitid("ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxx"); requestnewinterstitial(); } private void requestnewinterstitial() { adrequest adrequest = new adrequest.builder() .addtestdevice("see_your_logcat_to_get_your_device_id") .build(); minterstitialad.loadad(adrequest); } protected void bindviews() { butterknife.bind(this); setuptoolbar(); } protected void setuptoolbar() { if (mtoolbar != null) { setsupportactionbar(mtoolbar); } mnavigationview.setnavigationitemselectedlistener(mnavigationlistener); mdrawertoggle = new actionbardrawertoggle(this, mdrawerlayout, r.string.hello_world, r.string.hello_world); mdrawerlayout.setdrawerlistener(mdrawertoggle); } public toolbar gettoolbar() { return mtoolbar; } protected vo...

asp.net mvc - mvc4 upload file I can not invoking MY action -

i made action , using html.beginform upload image file controller name imagestaple , that: using system; using system.io; using system.collections.generic; using system.data; using system.data.entity; using system.linq; using system.web; using system.web.mvc; using bootstrab1.models; namespace bootstrab1.controllers { public class imagestablecontroller : controller { private spadbentities db = new spadbentities(); // // get: /images/ public actionresult index() { return view(db.c_images.tolist()); } [httppost] public actionresult uploadimg(httppostedfilebase image) { if (image.contentlength > 0) { var filefame = path.getfilename(image.filename); var path = path.combine(server.mappath("~/images/"), filefame); image.saveas(path); } return redirecttoaction("create...

cuda - using std::bind2nd with thrust -

i'm trying use std::bind2nd thrust. have code compiles host pointer, not device pointer. think identical , should work in both cases. // compiles fine thrust::host_vector<unsigned int> h_vec(nwords); thrust::host_vector<unsigned int> h_map(nwords); thrust::host_vector<unsigned int> h_out1(nwords); thrust::copy_if(h_vec.begin(), h_vec.end(), h_map.begin(), h_out1.begin(), std::bind2nd(thrust::equal_to<int>(),1)); // compilation fails error below thrust::device_vector<unsigned int> d_map(nwords); thrust::device_vector<unsigned int> d_vec(nwords); thrust::device_vector<unsigned int> d_out1(nwords); thrust::copy_if(d_vec.begin(), d_vec.end(), d_map.begin(), d_out1.begin(), std::bind2nd(thrust::equal_to<int>(),1)); when try call second copy_if bind2nd error below: /opt/cuda/include/thrust/detail/internal_functional.h(99): warning: calling __host__ function __host__ __device__ function not allo...

knockout 2.0 - Re-using a knockoutJS 2 component within an Angular 2 TS component -

i'm in process of migrating project on angular2 w/ typescript written in knockoutjs. turning out quite cumbersome do, i'd re-use of components have written ko inside of angular2 ones trouble finding example of if possible. my code follows: mykocomponent.js returns {viewmodel: myviewmodel, template:mytemplate} myangularcomponent.ts //here want import mykocomponent there 2 things unsure how import component , reference object returns. the pattern i've been using parent (ie myangularcomponent) append template element , call ko.applybinding(new myviewmodel, mytemplate), possible? thank-you time! this not i've tried, perhaps work import {component, oninit} 'angular/core'; import {myviewmodel} './some-location'; declare var ko:any; @component{...} export class mycomponent implements oninit { ngoninit() { ko.applybindings(new myviewmodel()); } }

css - Send HTML Email that contains stylesheet -

i send email gmail don't read html head. need use @font-face. send html: <!doctype html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>title</title> <link href="http://myaddress.com/style.css" rel="stylesheet" /> </head> <body> <h1 class="style1">hello</h1> </body> </html> i want see this: image here see this: image here gmail's css support very... limited say: the ultimate guide css . out of luck here , need rewrite code. also see understanding gmail , css: part 1 more details on how solve this. need inline css, there tools available.

amazon web services - Deploy Ruby on Rails to Elastic Bean-Stalk route errors -

i deployed ruby on rails application on elastic bean-stalk (aws). when try visit url of app, following lines in log file. cause of issue ? gemlist ? gems need production ?! ------------------------------------- /var/app/support/logs/production.log ------------------------------------- ... i, [2016-01-05t21:12:14.107404 #22655] info -- : started head "/" 127.0.0.1 @ 2016-01-05 21:12:14 +0000 f, [2016-01-05t21:12:14.179737 #22655] fatal -- : actioncontroller::routingerror (no route matches [head] "/"): actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:i...

c++ - Calling an explicit constructor with a braced-init list: ambiguous or not? -

consider following: struct { a(int, int) { } }; struct b { b(a ) { } // (1) explicit b(int, int ) { } // (2) }; int main() { b paren({1, 2}); // (3) b brace{1, 2}; // (4) } the construction of brace in (4) , unambiguously calls (2) . on clang, construction of paren in (3) unambiguously calls (1) on gcc 5.2, fails compile with: main.cpp: in function 'int main()': main.cpp:11:19: error: call of overloaded 'b(<brace-enclosed initializer list>)' ambiguous b paren({1, 2}); ^ main.cpp:6:5: note: candidate: b::b(a) b(a ) { } ^ main.cpp:5:8: note: candidate: constexpr b::b(const b&) struct b { ^ main.cpp:5:8: note: candidate: constexpr b::b(b&&) which compiler right? suspect clang correct here, ambiguity in gcc can arise through path involves implicitly constructing b{1,2} , passing copy/move constructor - yet constructor marked explicit , such implic...

debugging - Eclipse: why is ant build launched for one project when I start debug cfg for another? -

i have 2 java projects loaded in eclipse both of include build.xml files. created debug configuration projecta when launch ( right click -> debug -> debug configurations -> etc ) before starts, ant build projectb runs. in environment out of whack, , sure it's fault, can't figure out how stop this. please help! by way, in case matters, build.xml projecta incomplete, i.e. can't use run meaningful build of project.

java - Time lag between date send in object from client side [GWT] to server side [Spring ] -

i have celleditor want edit date : public interface driver extends simplebeaneditordriver<editvo, classeditor> { } @uifield datebox date; private final driver driver; @inject classeditor(binder uibinder, driver driver) { this.driver = driver; initwidget(uibinder.createandbindui(this)); driver.initialize(this); datetimeformat dateformat = datetimeformat.getformat("dd/mm/yyyy); date.setformat(new datebox.defaultformat(dateformat)); } @override public void edit(dossiereditvo object) { driver.edit(object); } @override public editvo get() { editvo object = driver.flush(); if (!driver.haserrors()) { return object; } return null; } i have date in class editvo, in controller have : @requestmapping(method = requestmethod.put) getresult<boolean> updatedossier(@requestbody editvo dossiereditvo) { //call service } the problem have when select date want edit example : 11/10/2015, in client side...

time - High-precision timer in iOS -

what precise way measure time intervals in ios? far have been using nsdate "mark" events , timeintervalsincedate method calculate interval, there more precise approach? e.g. windows has called qpc kind of thing. there similar in ios (or macosx) world? you can down nanoseconds using mach_absolute_time() . here article on using it: https://developer.apple.com/library/mac/qa/qa1398/_index.html it exists on ios.

Run a python script in virtual environment from windows task scheduler -

Image
i'm trying set recurring python task through windows task scheduler. i have had success when input path 'python.exe' , provide script's path parameter windows task scheduler (see screenshot below) however, want able choose particular virtual environment in run script. don't have knowledge of venv, , typically use opening cmd , running scripts\activate.bat in desired virtual environment directory. how can accomplish 'run task x in venvxxx every 24 hours' using windows task scheduler? create batch file these commands: c:\__full_path_to_virtualenv__\scripts\activate.bat && python __full_path_to_python_script__.py && means run command2 if command1 completed successfully. then set batch file script run. don't need set additional arguments in task scheduler (or can set them in batch file anyway) , can set start in if script has read/write specific directory , uses relative paths.

cakephp - How to add jquery UI spinner on jqgrid table column -

is possible add jquery ui spinner on jqgrid table column ? i have jqgrid table more 7000+ records, want apply spinner on 1 column. jqgrid allow this? thanks in advance! yes, there number of ways. you can either pass html cell data, instead of number pass (not best way): <input class="spinner" name="value"> after grid has loaded use: your_jqgrid.gridcomplete(function(){$(".spinner")..spinner(); better yet, set formatter column , in 1 go there.

html - Change Jquery AJAX post URL based on radio button -

i have product search box; can search via cartridge name or printer name. different sql queries, have made appropriate php files queries, having trouble getting jquery check value of radio button , modify post file based on radio button. it needs check radio button update anytime user form of course. any appreciated greatly! here jquery: $("#faq_search_input").watermark("begin typing search"); $("#faq_search_input").keyup(function() { var faq_search_input = $(this).val(); var datastring = 'keyword='+ faq_search_input; if(faq_search_input.length>1) { var search_method = $("#search_method").val(); if(search_method == 'cartridge'){ $.ajax({ type: "get", url: "<?php echo $site_config_url; ?>/resources/ajax-search.php", ...

virtuoso - Property Path equivalent to OPTION(TRANSITIVE) statement in SPARQL -

i'm naive user trying replicate query results in following type of string: derives_from (epithelial cell , (part_of (uterine cervix , (part_of (homo sapiens , (has disease adenocarcinoma))))) i'm @ hackathon, have no ontology/sparql expert, , we're trying these related fields out of ontology , solr. we're desperate! the webpage http://www.ontobee.org/ontology/clo?iri=http://purl.obolibrary.org/obo/clo_000368 ) helpfully provides sparql queries used on page. think relevant query: prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix owl: <http://www.w3.org/2002/07/owl#> select distinct ?ref ?refp ?label ?o <http://purl.obolibrary.org/obo/merged/clo> { ?ref ?refp ?o . filter ( ?refp in ( owl:equivalentclass, rdfs:subclassof ) ) . optional { ?ref rdfs:label ?label } . { { select ?s ?o <http://purl.obolibrary.org/obo/merged/clo> { ...

How to add storage-level caching between DynamoDB and Titan? -

Image
i using titan/dynamodb library use aws dynamodb backend titan db graphs. app read-heavy , noticed titan executing query requests against dynamodb. using transaction- , instance-local caches , indexes reduce dynamodb read units , overall latency. introduce cache layer consistent ec2 instances: read/write-through cache between dynamodb , application store query results, vertices, , edges. i see 2 solutions this: implicit caching done directly titan/dynamodb library. classes parallelscanner could changed read aws elasticache first. change have applied read & write operations ensure consistency. explicit caching done application before invoking titan/ gremlin api. the first option seems more fine-grained, cross-cutting, , generic. does exist? maybe other storage backends? is there reason why not exist already? graph db applications seem read-intensive cross-instance caching seems pretty significant feature speedup queries. first, parallelscanner...

constraints - R: from a vector, list all subsets of elements so their sum just passes a value -

sorry in advance if answer (1) trivial; or (2) out there haven't been able solve issue or find , answer online. pointers appreciated! i in need of piece of code can run through vector , return possible subsets of elements cumulative sum passes threshold value. note not want subsets give me threshold. cumulative sum can above threshold, long algorithm stops adding element if value has been achieved already. # tiny example of kind of input data. # however, note efficiency issue # (i need replicate example in large dataset) v <- seq(1, 3) # vector threshold <- 3 # threshold value # list combinations # 1 2 # 1 3 # 2 3 # 3 this piece of code works clunkiest solution on earth... for (i in 1: length(v)){ thisvalue <- v[i] if (thisvalue >=threshold) { cat (v[i], "\n",sep="\t") } else { (j in (i+1): length(v)){ thisvalue <- v[i]+v[j] if (thisvalue >=threshold) { cat (c(v[i], v[j]), "\n",s...

python - Is there an Object Cache library available for SQLAlchemy? -

i'm working on new project written in python flask & sqlalchemy. latter seems decent orm doesn't seem consider caching responsibility. it provides examples on how leverage dogpile.cache @ http://docs.sqlalchemy.org/en/latest/orm/examples.html#module-examples.dogpile_caching seems offer no more basic query results caching valuable read-only models. what looking real level 2 object cache integrated orm store each object via pk , ensures identity in concurrently shared cache. have experience multiple caching libraries working java orms i'm not able find sqlalchemy. no such thing exist python yet?

css - Transparent menu/navigation bar -

Image
i cannot solve css problem. i have nav bar should transparent. links on transparent due opacity attribute , because child elements of transparent navigation bar. can u me solve this? if dont want link text affected should modify rule .container selector this .container { width: 100%; height: 90px; margin: 0 auto; background-color: rgba(255,255,255,0.5); } it keep background color design without affecting text opacity , said here several times , affect element , children using opacity . text affected using rgba(255,255,255,0.5), children not affected take care of other rules can take action due javascript , hover situations fiddle here bis spater

javascript - How can I make a bootstrap slide modal? -

as in modals arrows on each side. i need 5 modals go in circle. i use html/css, javascript, , bootstrap. i'm not familiar on how use js file , call in html file i'm assuming similar calling css file. i've been using jquery dialog , part of jquery ui library. provides modal dialog support can implement on client side. there jsfiddle.net examples if search. use arrow buttons on each side navigate forward , backward.

sql - Reprocess SSAS tabular cube after failure -

so process ssas tabular cubes every night , other night processing of cube failed. want implement system trigger automatic reprocess after failure. is there way in ssas tabular? nothing built ssas automatically restart processing on error. in sql agent, job step properties dialog has advanced tab retry attempts property. if change 1, automatically retry step (the ssis package) if fails.

python - How to use the __subclasscheck__ magic method? -

how can make class lies has subclassed? after reading doc i've attempted this: >>> class allyourbase(type): ... @classmethod ... def __subclasscheck__(cls, other): ... return true ... >>> class allyour(object): ... __metaclass__ = allyourbase now, class should report base belong him. but didn't work: >>> issubclass(allyour, int) false why not? if want allyour claim subclass of every class, isn't possible. __subclasscheck__ works in other direction. if want allyour claim every class subclasses it, remove @classmethod decorator, , switch arguments in issubclass call. special methods define on metaclass don't need special decoration.

sublimetext2 - Create Key Binging in Sublime Text 2 that tags highlighted text with snippet -

i have built snippet. works fine. better understand problem, lets snippet creates anchor tag inline styling: <a style="color:red;font-weight:30px;"></a> my problem when attempt add key binding such as: { "keys": ["ctrl+a"], "command": "insert_snippet", "args": {"name": "packages/user/red-anchor.sublime-snippet"} } if select highlighted text, click ctrl+a, deletes text , adds snippet. rather wrap text inside snippet. such as: <a style="color:red;font-weight:30px;">helloworld</a> any ideas? in advance!! if @ documentation on snippets , you'll see there number of variables can accessed, including $selection . so, snippet should be: <snippet> <content><![cdata[<a style="color:red;font-weight:30px;">$selection</a>]]></content> <scope>text.html</scope> </snippet>

haskell - GPipe VSync & FPS -

i'm starting learn gpipe library , , wondering how accomplish vsync , fps control it. initially, thinking separate thread block every 1 * 1000000 / fps microseconds , run swapcontextbuffers , mean separate thread need build own contextt , , it's own window. the docs on function itself mentions briefly block if vsync enabled in system - mean? how enable it? setting swap interval specific window manager in opengl. in case of glfw, need call glfwswapinterval . unfortunately, cannot in gpipe since thread contextt running on doesn't have gl context current. should implemented in gpipe-glfw's context creation instead, i.e. inside newcontext' . and no, cannot asynchronously swap buffers in gpipe (but wouldn't want if possible).

android - How to invalidate view after it changed? -

please see example img below first. sorry, reputation not enough, click below see gif please example img just see, using horizontalscrollview in bottom area. can not scroll border when become bigger. can not figure out why, hope can me solve problem. public class rebound extends horizontalscrollview implements view.onclicklistener { private linearlayout container; private horizontalscrollviewadapter adapter; private int childwidth, childheight; private currentimagechangelistener listener; private onitemclicklistener onclicklistener; public rebound(context context, attributeset attrs) { super(context); } @override protected void onmeasure(int widthmeasurespec, int heightmeasurespec) { super.onmeasure(widthmeasurespec, heightmeasurespec); container = (linearlayout) getchildat(0); } @override public void invalidate() { super.invalidate(); } public void initdatas(horizontalscrollviewa...

android - Unable to click on Share button -

i trying unable click share button while button works fine. i have following code in class extends appcompatactivity : @override public boolean oncreateoptionsmenu( menu menu ) { menuinflater inflater = getmenuinflater(); inflater.inflate( r.menu.log_display, menu ); return super.oncreateoptionsmenu( menu ); } and @override public boolean onoptionsitemselected( menuitem item ) { logger.debug( item.getitemid()+" ==========" ); switch ( item.getitemid() ) { case android.r.id.home: super.onbackpressed(); break; case r.id.menu_item_share: logger.debug( "menu share item" ); break; default: logger.debug( "default in menu" ); } } i tried onclicklistener method oncreateoptionsmenu did not work well. ideas ? edit : xml file <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://s...

css resizeable banner -

okay found tutorial " stretchy image header banner css " problem (as listed in tutorial is) height. height gets real big browser enlarge. there way resolve this? since banner expand in proportion, height have bigger wonder if there better way this. there way start cropping banner top percentages banner getting bigger? suggestion appreciated. set max-height on image prevent getting large vertically. http://jsfiddle.net/8c9ms/

javascript - Trying to perform a click function when an element appears -

basically i'm working on site has submit button appear after form completed. want create function automatically click submit button whenever appears (there's no choice go backwards , review work don't know why it's there). i'm using userscript tampermonkey on chrome , want add final piece speed things little. so code particular submit button in html on site is: <form style="width:auto;" id="siteform" action="https://www.example.com" method="post"> <!-- <input type="hidden" id="numtags" name="numtags" value="< %= numtags %>" /> <input type="hidden" id="nummaps" name="nummaps" value="< %= current_map_count %>" /> <input type="hidden" id="numquestions" name="numquestions" value="< %= current_question_count %>" /> <inp...

javascript - Issues with external links in ionic app on IOS -

i have ionic app displays user entered text. in text html allowed. example, allowed: <a href="http://www.google.com">go google</a> i using wysiwyg editor users enter text. https://github.com/fraywing/textangular when displayed, want link opened in mobile's default browser (safari on ios). to display text, using text-angular's ta-bind directive: <div ta-bind ng-model="article.contents"></div> where article.contents has html text (user entered). while works fine in android, in ios link opens within webview , breaks app. there other posts menation in-app-browser plugin , changing links window.open('url', '_blank') not able this. note text entered in different 'admin' app, web app (also angualr app). how resolve issue ? i got resolved using inapp browser , creating custom directive instead of using ta-bind. .directive('customcompile', ['$compile', function ($comp...

How to transform (transpose) a dataset in SAS, so that variables names become class identifiers? -

this question has answer here: transpose wide long dynamic variables 1 answer how transform, of sas code, following table: id t u 1 1253 1349 2 1139 1382 3 1633 1663 4 1372 1541 5 1502 1335 into table? classid t 1253 t 1139 t 1633 t 1372 t 1502 u 1349 u 1382 u 1663 u 1541 u 1335 ps: did try using sas sql (join all), not convert t , u variables class identifiers) to avoid hard coding values, create array loops through each record , uses vname function read current variable name. variable name assigned classid , variable value assigned all. code works if variables numeric, you'll need tweak if have mixture of numeric , character variables (just create array character variables if that's case). /* create initial dat...

.net - Where can I get ADOMD library (DLL) to connect to Microsoft cubes using C# -

i need connect micrsoft ssas (2012 server) cubes using c#. want know can libraries (dll's) connect cube? is there nuget package latest libraries or can download latest dll microsoft site? you can find library file in c:\program files\microsoft.net\adomd.net\100.you can install same nuget package manager microsoft.analysisservices.adomdclient

java - JBoss Developer Studio IDE not refreshing files -

i have jboss developer studio 7 part of jboss eap 6.4. have svn project opened in jboss developer studio. externally updating svn files using tortoise svn client. although after f5 (refresh) jboss ide (jboss developer studio), sometime not reflecting files properly. please advise. not practice shouldn't update svn files using tortoise svn client. or should follow basic practice while work jboss developer studio ide. cannot afford going jboss svn client in ide due project constraints. thanks suggestions.

asp.net - Accessing Windows Authentication Web Page from Raspberry pi Browser -

we have web page want access raspberry pi, webpage in question protected windows authentication. there way pass authentication across raspberry pi? iceweasel port of firefox supports ntlm authentication on raspberry pi. far know, that's actively updated browser retains authentication throughout session.

vba - '1004': ZOrder method of OLEObject class failed - Change OLEObjects zOrder -

just want know if can change zorder of oleobject in excel vba have tried following lines of code set ws = activesheet ... ws.oleobjects("toebox").zorder msobringtofront and following error message: run-time error '1004': zorder method of oleobject class failed any great! thanks dan

eclipse kepler - Java compiler level does not match the version of the installed Java -

i have created new dynamic project under eclipse kepler version, jre version set 1.8. java compiler set 1.8 after setting jre version 1.8 got below exception. java compiler level not match version of installed java project facet. i have checked project facet set 1.7. changed 1.8 changing in file org.eclipse.wst.common.project.facet.core.xml . after changing version of java in above file got warning : implementation of version 1.8 of project facet java not found i found 1 link has same issue not able solved issue : java compiler level not match version of installed java project facet how solved issue? there official bug report/patch kepler sr2. works spring tool suite 3.5.0.rc4 (which based on kepler). should work luna too. bug report : https://bugs.eclipse.org/bugs/show_bug.cgi?id=430637 (see comment #12) update site java 8 facet : http://download.eclipse.org/webtools/patches/drops/r3.5.2/p-3.5.2-20140329045715/repository look i...

Laravel 5.2 / Socialite FatalErrorException in AbstractProvider.php line 134: -

getting following error when using socialite authenticate facebook. using laravel 5.2 , first time trying implement socialite. ideas ? fatalerrorexception in abstractprovider.php line 134: call member function set() on non-object route :- route::get('/login', 'authcontroller@login'); authcontroller.php :- <?php namespace app\http\controllers; use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; class authcontroller extends controller { public function login() { return \socialite::with('facebook')->redirect(); } } services.php setup follows details in .env file :- 'facebook' => [ 'client_id' => env('facebook_client_id'), 'client_secret' => env('facebook_client_secret'), 'redirect' => env('facebook_redirect'), ], the same error reported here no response :- https://laracasts.com/discuss/channels/laravel/laravel-...

django - raise ImportError("Settings cannot be imported, because environment variable %s is undefined -

there several questions here on stack regarding error, no answer has helped me , strange thing error raised while has worked fine before. what did restart server, , turned up: how come error can turn while haven't changed , how can fix it? traceback (most recent call last): file "/library/frameworks/python.framework/versions/2.7/bin/django-admin.py", line 5, in <module> management.execute_from_command_line() file "/library/python/2.7/site-packages/django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() file "/library/python/2.7/site-packages/django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/library/python/2.7/site-packages/django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 261, in fetch_command klass = load_command_class(app_name, subcom...

xslt - <xsl:variable> which is an xml file on intranet -

i using xslt process config file (which in xml format). the processing requires inputs xml file hosted on intranet. when copy file d:, can use <xsl:variable> read xml file below: <xsl:variable name="vprods" select="document('file:///d:/packages.xml')" /> however, when specify intranet location http://abc.xyz/api/xyz.xml , below: <xsl:variable name="vprods" select="document('http://abc.xyz/api/xyz.xml')" /> i exception "data @ root level invalid. line 1, position 1." what correct way read file intranet? thanks

angularjs - How return `$resource` promise response? -

i require user details multiple areas. tried return details using generic function. getting result undefined . understand that, require use $differed reuslt. don't have idea current scenario. anyone me here please? here function: $scope.currentuserinfo = function () { var userdetails; server.getprofile.get().$promise.then(function ( response ) { if( response.message.touppercase().indexof('success') != -1) { return userdetails = response; } return "not able user details time" }) return userdetails; } $scope.currentuser = $scope.currentuserinfo(); console.log( $scope.currentuser ) //undefined. var function1 = function () { $scope.currentuserinfo(); //once user details available further $scope.age = $scope.currentuser.age; } var function2 = function () { $scope.currentuserinfo(); //once user details available further $scope.name = $...

Clojure Cassandra Driver Performance -

i'm testing performance of alia in clojure on 6 node cassandra cluster. when multi-threading can 400 writes/sec. firebrand cassandra driver , manually handling threading in java able 5000 writes/sec 96 threads. am doing wrong in utilization of agents here? cpu usage ~25% on machine running on seems low. update: @ author of alia's suggestion, utilizing prepared statements instead of raw statements realized gains of 2500/sec in synchronous, single-threaded fashion. still need test multi-threading clojure , separately utilizing async function built alia/the underlying java driver see faster. update 2: seeing similar results mpenet below additionally utilizing async functionality built driver. (ns alia-perf-test.core (:gen-class) (:require [qbits.alia :as alia] [qbits.hayt :as hayt])) (defn exec-query [session query] (alia/execute session (hayt/->raw query))) (defmacro time-query [expr] `(let [start# (. system (nanotime)) ret# ~expr] ...