Posts

Showing posts from April, 2015

gradle - failed to build tool version android -

Image
i tried open old project of mine in freshly installed android studio (today), gave me error : failed find build tools revision 23.0.0 rc2 install build tools 23.0.0 rc2 , sync project i looked in internet , tried add in gradle file : android { compilesdkversion 22 buildtoolsversion "22.0.0" } and gave me error: gradle dsl method not found: 'android()' possible causes: project may using version of gradle not contain method. gradle settings. build file may missing gradle plugin. apply gradle plugin. this gradle file : // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } allprojects { repositories { jcenter() } } android { compilesdkversion 22 buildtoolsversion "22.0.0" } right click on project > open module settings > properties tab, change : compile sdk verion api...

php - how to get second level data from Stripe JSON object -

i have function able retrieve level 1 array data, not level 2 in return json string following charge. else if(!empty($_session['sess_plan_buy_code'])){ $pcharge = \stripe\customer::create(array( "source" => $_post['stripetoken'], "plan" => $_session['sess_plan_buy_code'], "email" => $_session["sess_email"] )); echo "my customer id is: " . $pcharge->id; echo'<br>'; $stuff = json_decode($pcharge->subscriptions); var_dump($stuff); actual json return string: json the output above code is: my customer id is: cus_6cvcqdpdhmqlge null expected output: my customer id is: cus_6cvcqdpdhmqlge 1 i have tried: $stuff = $pcharge->subscriptions[0]; $stuff = $pcharge->subscriptions['total_count']; $stuff = json_decode($pcharge->subscriptions); and few loops either null or other error indicating programmer ...

java - Drawing area with ScrollView -

Image
i´m creating painting , drawing area in activity , move scrollview. if have code don´t have problem: <relativelayout android:id="@+id/framever" android:layout_width="match_parent" android:layout_height="2000dip" android:layout_marginbottom="3dp" android:layout_marginleft="5dp" android:layout_marginright="5dp" android:layout_margintop="3dp" android:layout_weight="1" android:background="@null"> <package.drawingview android:id="@+id/drawing" android:layout_width="fill_parent" android:layout_height="2000dip" android:background="@null" /> </relativelayout> but, if add scrollview, paints in pieces: <package.linkablescrollview android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="2000dip...

ssl - Erlang can't connect to any HTTPS url -

the problem arose when trying build rebar3, couldn't fetch dependencies amazon s3. debugging problem found out erlang runtime couldn't connect https site, although curl or wget work fine. when set httpc:set_options([{verbose,trace}]) , following output: {failed_connect, [{to_address,{"s3.amazonaws.com",443}}, {inet, [inet], {eoptions, {undef, [{ssl,connect, ["s3.amazonaws.com",443, [binary, {active,false}, {ssl_imp,new}, inet], 20000], []}, {http_transport,connect,4, [{file,"http_transport.erl"},{line,135}]}, ...

Convert Word.InlineShape to Excel.Workbook c# -

there excel.workbooks in word document. i can word.inline shapes need convert them excel.application word.inlineshapes shapes=wordapp.activedocument.inlineshapes; those shapes created via wordapp.selection.inlineshapes.addoleobject("msgraph.chart.8", excellapp.activeworkbook.name, false, false, type.missing, type.missing, type.missing, type.missing); how can convert them excel.workbook again? also tried ; word.inlineshapes shapes = wordapp.activedocument.inlineshapes; foreach(word.shape shape in shapes) { word.chart chart = shape.chart; } but throws unimplemented exception. try this: word.oleformat ole = shape.oleformat; ole.activate(); excel.workbook book = (excel.workbook)ole.object;

excel - How do I get the cell address of a table header cell? -

i'm using activesheet.listobjects(1).listcolumns(1) pick table header cell , i'm using activesheet.listobjects(1).listcolumns(1).name value of header. how address? example, i'd know if table header i'm targeting in column c , row 3 . i tried using activesheet.listobjects(1).listcolumns(1).address doesn't seem right. a listcolumn has properties of databodyrange , range . range includes header cell, can find first cell of range. dim col listcolumn set col = activesheet.listobjects(1).listcolumns(1) msgbox col.databodyrange.address 'just data range msgbox col.range.address 'includes header cell msgbox col.range.cells(1).address 'the header cell hint: creating reference col means can make use of intellisense discover members of listcolumn object.

javascript - Make a table cell editable by placing input box over td -

Image
i want make table cell editable on double click can put value in cell : currently placing input box inside td on dblclick on : $('<input type="text" />').val(oldcellval).appendto($this).end().focus().select(); $this td element in want show input box on double click, on blur removing input box , setting new value back. i show input box over td element instead of inside appear input inside td element, because using table library allows text inside td elements, on adding html element( input ) inside td not working properly. appreciated. thanks. for similar result can use contenteditable <table border="3"> <thead> <tr>heading 1</tr> <tr>heading 2</tr> </thead> <tbody> <tr> <td contenteditable='true'></td> <td contenteditable='true'></td> </tr> <tr> <td contenteditable='true'></td> <td contentedita...

php - MySQL limit characters in multi-select query -

sorry if there simple answer i'm new mysql , can't figure out how explain one: i have number of queries select random words , concatenate them together. i'm trying limit query return results if under specific character limit. so, example, here's 1 query: select concat((select word adjectives order rand() limit 1),' ', (select word2 verbs order rand() limit 1),' ', (select word nouns order rand() limit 1)) it returns result "adjective verb noun" what want have query check if full concatenated result 30 characters or less; if is, return it, , if not, try again until 1 30 or fewer characters presented. thanks! update: fantasy football team name generator, pulls "random" words various tables , strings them together. there literally millions of possible combinations.... if user specifies character limit, want sql re-try in background until finds , answer fits, present it. don't want user gettin...

vba - Using a command button to add data to a table -

i have table called manual_ticket_listing , trying create form let users add, edit , delete records table. working on add function , being new vba not sure issue is. current error receiving "syntax error in insert statement." currentdb.execute "insert manual_ticket_listing (ticket_date, ticket_time, pvl_ticket, fl_ticket, customer_name, truck_description, truck_gross_weight, truck_tare_weight, truck_net_weight, tons, m aterial, scale attendent initials) " & _ " values ('" & me.ticket_date & ",'" & me.ticket_time & "','" & _ me.pvl_ticket & "','" & me.fl_ticket & "','" & me.customer_name & "','" & me.truck_description & "','" & me.truck_gross_weight & "','" & _ me.truck_tare_weight & "','" & me.truck_net_wei...

javascript - How to write multiple materialize css cards with jquery.getjson() -

i use meterialize css create card. want create more. i'll use json , jquery.getjson() me write html tag multiple card. isn't working. in card area blank. can me? , sorry skill. var db = { "card" : [ {"group" : ["class1", "class2"], "image-url" : "images/sample-1.jpg", "card_title" : "card title", "card_subtitle" : "card subtitle", "badge" : ["hot", "win"], "modal_selector":"#"}, {"group" : ["class1", "class2"], "image-url" : "images/sample-1.jpg", "card_title" : "card title", "card_subtitle" : "card subtitle", "badge" : ["hot", "win"], "modal_selector":"#"}, {"group" : ["class1", "class2"], "image-url" : "imag...

javascript - JQuery UI Combobox - Allow any valid value apart from the populated ones -

i displaying years 2000,2001,2002 in jquery ui combobox. my requirement allow user input manually valid year. the jquery ui combobox seems reject values out of populated year range. $(document).ready(function(){ $('.combobox').combobox() .addclass('overflow'); }); function checkvalidyearofconstructions() { $(".custom-combobox-input").keydown(function(event) { // allow delete, backspace,left arrow,right arrow, tab , numbers if (!((event.keycode == 46 || event.keycode == 8 || event.keycode == 37 || event.keycode == 39 || event.keycode == 9) || $(this).val().length < 4 && ((event.keycode >= 48 && event.keycode <= 57) || (event.keycode >= 96 && event.keycode <= 105)))) { // stop event event.preventdefault(); return false; } }); } $(document).r...

java - complete a method that swaps the first and second half of an array of integers -

i keep getting out of bounds error whenever try run code. know wrong it? can't seem figure out. public class swapper{ /** method swaps first , second half of given array. @param values array */ public void swapfirstandsecondhalf(int[] values) { // work here int[] first = new int[values.length/2]; int[] second = new int[values.length/2]; for(int = 0; < values.length / 2; i++) { second[i] = values[i]; } (int j = values.length / 2; j < values.length; j++) { first[j] = values[j]; } for(int k = 0; k < values.length / 2; k++) { values[k] = first[k]; } for(int l = values.length / 2; l < values.length; l++) { values[l] = second[l]; } } // method used check work public int[] check(int[] values) { swapfirstandsecondhalf(values); return values; } } int[] first = new int[value...

python - Execute particular file from all user as sudo without password -

my server having python script file user , group root , want file executed user sudo without password. for have added in /etc/sudoers username all=(all) nopasswd: /path/to/file.py but when execute other user accept root still prompt password i execute file this sudo python /path/to/file.py please me in sudoers , command /path/to/file.py specified, not python . execute command follow: sudo /path/to/file.py note: make sure /path/to/file.py executable (have proper permission set, containing shebang line ( #!/usr/bin/python ... ))

actionscript 3 - How to display a notification in adobe air for android -

i want display notifications in adobe air app android using adobe flash , action script 3.0 . i want use notifications reminding people update app when new version gets released, how do this? thank you. as definitelynotaplesiosaur has mentioned, using ane way go. you can find free ane's use here: http://www.riaxe.com/blog/200-adobe-air-anes/ but highly recommend district publish multiple documented ane's example files , offer excellent support. http://airnativeextensions.com it sounds need either notifications or push notifications if message appear when user not using app, or dialog if message appears whilst user using app.

javascript - webdis connection time for second client -

i using webdis ( https://github.com/nicolasff/webdis ) ran webdis directed in website , included following javascript code connect: var previous_response_length = 0 xhr = new xmlhttprequest() xhr.open("get", "http://localhost:7379/subscribe/hello", true); xhr.onreadystatechange = checkdata; xhr.send(null); function checkdata() { if(xhr.readystate == 3) { response = xhr.responsetext; chunk = response.slice(previous_response_length); previous_response_length = response.length; console.log(chunk); } }; when open connection in web page , opens 2 tabs, takes secondly opened tab 10 seconds start subscribing , listening messages published. there anyway reduce wait time second client connect , make instant? add?

How do I compare strings in Java? -

i've been using == operator in program compare strings far. however, ran bug, changed 1 of them .equals() instead, , fixed bug. is == bad? when should , should not used? what's difference? == tests reference equality (whether same object). .equals() tests value equality (whether logically "equal"). objects.equals() checks nulls before calling .equals() don't have (available of jdk7, available in guava ). consequently, if want test whether 2 strings have same value want use objects.equals() . // these 2 have same value new string("test").equals("test") // --> true // ... not same object new string("test") == "test" // --> false // ... neither these new string("test") == new string("test") // --> false // ... these because literals interned // compiler , refer same object "test" == "test" // --> true // ... should call objects.equals() o...

javascript - Disabling sessions in nodejs Passport.js -

i discovered tokens authentication allows session/stateless servers , starting out mean. looks amazing. right now, i'm using passport.js authenticate users (via email, facebook, google,...), stores information server session tutorials say: // required passport app.use(express.session({ secret : 'superscret', expires: new date(+new date + settings.session.sessiontimeout), store: new mongostore({}) })); // session secret app.use(passport.initialize()); app.use(passport.session({})); is possible still use passport.js instead of storing session, sends token monitor if user has access. question : how can disable sessions passport? (i know how send token , listen it). i suggest using satellizer , de-facto standard library token based authentication in angularjs. implements token based authentication , easier working purposes. has server examples, including node.js server example .

c# - FlexCel fails to open simple XLSX files -

Image
a script have works fine xls files, throws errors when same files saved xlsx (very simple test files). using flexcel library, per description: flexcel studio .net framework 3.5 (with xlsx support). the error occurs @ .open() method: flexcelxlsadapterexception : error reading excel records. file invalid : flexcel : @ #c.#tl..ctor(stream , boolean ) @ flexcel.xlsadapter.xlsfile.#4rb(stream , boolean ) @ flexcel.xlsadapter.xlsfile.open(stream astream, tfileformats fileformat, char delimiter, int32 firstrow, int32 firstcol, columnimporttype[] columnformats, string[] dateformats, encoding fileencoding, boolean detectencodingfrombyteordermarks) @ flexcel.core.excelfile.open(stream astream, tfileformats fileformat, char delimiter, int32 firstrow, int32 firstcol, columnimporttype[] columnformats) @ flexcel.core.excelfile.open(stream astream) @ unhideofficecontent.unhideofficecontent.unhideexcelcontent(string filepath) @ unhideofficecontent.unhideofficecontent....

r - Rcpp - Compile a C++ file with multiple functions -

i have quick question how compile .cpp file multiple function in it. let's have c++ file : functions.cpp #include <rcpp.h> #include <math.h> /* pow */ using namespace rcpp; // [[rcpp::export]] int function1 (int n, numericmatrix w){ return .... } // [[rcpp::export]] int function2 (int n, numericmatrix w){ return .... } and compile file , able to call both functions. have done it, happens when try load functions.o gives me this": error in indl(x, as.logical(local), as.logical(now), ...) : unable load shared object 'c:/users/functions.o': loadlibrary failure: %1 not valid win32 application. anybody , idea ? just use sourcecpp("nameofyourfile.cpp") if you have no syntax error preventing compilation both function1 , function2 accessible in r session. literally thousands of such files have been written, , 1 hundred @ disposal on @ the rcpp gallery .

formatting - How to remove negative symbol on values Google Charts? -

Image
i have column chart , work fine, want allways show positive number, force negative number "divide" bars on top , bottom. he example: here code google.load('visualization','1.1',{packages:['corechart']}); google.setonloadcallback(function(){ var googlechart=new google.visualization.columnchart(document.getelementbyid( 'chart' )); var data = google.visualization.arraytodatatable([ ["age","male","female"], ["<15",{"v":0,"f":"0%"},{"v":0,"f":"0%"}], ["15-20",{"v":8.3333333333333,"f":"8,3333333333333%"},{"v":0,"f":"0%"}], ["20-25",{"v":75,"f":"75%"},{"v":-8.3333333333333,"f":"8,3333333333333%"}], ["25-30",{"v":0,"f":"0%"},{"v":...

shell - Can't run Yii 2.0 cmd tool on Linux EC2 AWS -

i've developed application locally using yii 2.0 framework (on windows machine). , since i've installed framewrok able go projects folder , tun .\yii , see list of commands run. use lot of custom commands application have developed. the thing uploaded application ec2 instance on aws, , reaon framework works fine ( can run app) can't run .\yii on script shell. it linux instance i've searched lot answers didn't find anything! i've tried running: yii, .\yii, ./yii none of tem work, seems cmd doesn't recognize shell script, error is: -bash: sudo: command not found so, forgetting configuration should have done thi work? how make work?? update i checking yii.bat file contents: @echo off rem ------------------------------------------------------------- rem yii command line bootstrap script windows. rem rem @author qiang xue <qiang.xue@gmail.com> rem @link http://www.yiiframework.com/ rem @copyright copyright (c) 2008 yii software ...

cloudpebble - Pebble.js app pulling in the wrong image resource -

i trying create simple app in pebble.js using cloud ide i have resources loaded (47 of them) colour , black , white image, correct naming conventions. here snippet appinfo.json { "file": "images/34_unlockables.png", "name": "images_34_unlockables_png", "type": "png" }, { "file": "images/45_leaderboards.png", "name": "images_45_leaderboards_png", "type": "png" } when reference image it's name, app pulls in wrong image totally. same if try url well card.banner('images/45_leaderboards.png'); card.banner('images_45_leaderboards_png'); both result in wrong image (and black , white). has else hit similar issue?

caching - Share secondary cache accross different applications -

we using cms secondary cache enabled: application.cfc <cfset this.ormsettings.secondarycacheenabled = true /> <cfset this.ormsettings.cacheprovider = "ehcache" /> <cfset this.ormsettings.cacheconfig="ehcache.xml" /> ehcache.xml <ehcache> <diskstore path="java.io.tmpdir"/> <defaultcache maxelementsinmemory="10000" eternal="true" overflowtodisk="true" maxelementsondisk="10000000" diskpersistent="true" diskexpirythreadintervalseconds="120" memorystoreevictionpolicy="lru" /> </ehcache> the entities set cacheuse="transactional" <cfcomponent persistent="true" entityname="news" table="mews" cacheuse="transactional"> saving article in cms works great , instantly reflects changes after saving. one of sites mana...

ruby on rails - AssociationTypeMismatch in ItemsController#create -

im creating online retail store. has items belongs_to category. when try submit item category selected wont save i tried many hours fix can't figure out. see problem is? error activerecord::associationtypemismatch in itemscontroller#create category(#70298375791060) expected, got string(#70298372605800) def create @item = current_user.items.build(item_params) if @item.save redirect_to @item flash[:success] = "you have created new item" items form <h1>create new item</h1> <div class="container"> <div class=“row”> <div class="col-md-6 col-md-offset-3"> <div class="panel panel-primary"> <div class="panel-body"> <%= simple_form_for @item, html: { multipart: true } |f| %> <%= f.input :image%> <%= f.collection_select :category, category.order(:name), :id, :name, include_blank: true, :prompt =...

objective c - iOS framework is not able to be updated after the initial archiving -

i creating ios framework used in app. followed this tutorial in order , going. everything worked fine initially. archived project simple following: e.h #import <foundation/foundation.h> #import <uikit/uikit.h> foundation_export double eversionnumber; foundation_export const unsigned char eversionstring[]; @interface e : nsobject + (void)showalert; @end e.m #import "e.h" @implementation e + (void)showalert { uialertview *alert = [[uialertview alloc] initwithtitle:@"hello there!" message:@"" delegate:nil cancelbuttontitle:@"cool" otherbuttontitles:nil]; [alert show]; } @end i included archived output of debug , release directories app, , added reference .framework file via embedded binary section of app's build s...

ios - Swift: Multiple inheritance from classes 'UIViewController' and 'AVPlayer' -

i'm trying add avplayer class view controller so can use addperiodictimeobserverforinterval method when avaudioplayer hits specific second while playing, can call action. when try inherit avplayer class, error: multiple inheritance classes 'uiviewcontroller' , 'avplayer' could me work around this?

random - Is there any guarantee that the algorithm behind java.util.Collections.shuffle() remains unchanged in future Java releases? -

is following program guaranteed produce list same contents , ordering in future java releases? import java.util.arraylist; import java.util.arrays; import java.util.collections; import java.util.list; import java.util.random; public class test { public static void main(string[] args) { list<string> list = new arraylist<>(arrays.aslist("a", "b", "c", "d")); collections.shuffle(list, new random(42)); } } the javadoc of java.util.random class guarantees return same random numbers if intialized same seed in future java releases. but there guarantees regarding algorithm behind java.util.collections.shuffle() utility function? javadoc utility function not this. i need guarantee, because want sure persisted data not useless future java release. there no explicit guarantee, say. on other hand, existence of separate collections.shuffle(list,random) suggest intention method return same order when invoked ...

swift - Creating a subclass of a SCNNode -

i'm loading node .dae file following code: func newnode() -> scnnode { var node = scnnode() let scene = scnscene(named: "circle.dae") var nodearray = scene!.rootnode.childnodes childnode in nodearray { node.addchildnode(childnode as! scnnode) } return node } i add properties , methods specific node when load in scene gets random color can modify whenever want. had done similar subclass of scnsphere (which geometry , not node, though) using: let numberofcolors: uint32 = 4 enum ellipsoidcolor: int, printable { case red = 0, blue, green, white var ellipsoidname: string { switch self { case .red: return "red" case .blue: return "blue" case .green: return "green" case .white: return "white" } } var description: string { return self.ellipsoidname } static func random() -> ellipsoidcolor { return ellipsoidcolor(rawvalue: int(arc4random_uniform(numb...

android - Spinner Intent Activity Change -

i've been trying spinner logic change activities on selection change, code below reason isn't changing. log.d returns correct selection, know itemselect triggering, not sure why intent not changing. public class listownersactivity extends activity implements onitemclicklistener, onclicklistener { spinner spinner; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_list_cars); spinner = (spinner) findviewbyid(r.id.spinner3); arrayadapter adapter= arrayadapter.createfromresource(this,r.array.domain,android.r.layout.simple_spinner_item); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spinner.setadapter(adapter); addlistener(); } public void addlistener() { spinner.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> arg0, view view, ...

Python: using function on 2 elements of different 2d numpy arrays -

i want sum of equivalent indexes of 2 arrays , threshold them. code runs slow , have use function often. there more efficient way in python? sobelx = cv2.sobel(smoothed,cv2.cv_64f,1,0,ksize=-1) sobely = cv2.sobel(smoothed,cv2.cv_64f,0,1,ksize=-1) in range(0,height-1): j in range(0,width-1): xvalue= sobelx[i,j] yvalue= sobely[i,j] tmp = math.sqrt(math.pow(xvalue,2) + math.pow(yvalue,2)) if tmp > 255: tmp = 255 elif tmp <0: tmp =0 self.gradientmap[i,j] = tmp this should trick: sobelx = cv2.sobel(smoothed,cv2.cv_64f,1,0,ksize=-1) sobely = cv2.sobel(smoothed,cv2.cv_64f,0,1,ksize=-1) self.gradientmap = numpy.sqrt (sobelx ** 2 + sobely ** 2) self.gradientmap[self.gradientmap> 255] = 255 i don't know exact type of sobelx , sobely assumed there 2 numpy.array questions. note: removed tmp < 0 case because never have negative square root.

applying CSS in HTML mail with PHP -

i trying create html email template send using php, i have created template below, <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>notification email template</title> <style type="text/css"> .portlet.box.blue-hoki { border: 1px solid #869ab3; border-top: 0; } .portlet.box.blue-hoki > .portlet-title { background-color: #67809f; } .portlet.box.blue-hoki > .portlet-title > .caption { color: #ffffff; } </style> </head> <body> <div class="portlet box blue-hoki"> <div class="portlet-title"> <div class="caption" > report # {report_id} {action} </div> </div> </div> </body> when email sent, unfortunately there no css applied div contents, if plut style tag in div , put style properties in div, correct, i not able find why class css not a...

c++ - Using long double -

the following c++ program. want store long number such pi on variable trying use long double. when run program displays 3.14159 . how store full floating point number variable? #include <iostream> using namespace std; int main() { long double pi; pi = 3.14159265358979323846264338327950288419716939937510; cout << "pi = " << pi << endl; return 0; } using stream manipulators, it's easy: #include <iostream> #include <iomanip> int main() { long double pi; pi = 3.14159265358979323846264338327950288419716939937510l; // l long double literal std::cout << "pi: " << std::setprecision(20) << pi; }

c++ - Are the optimizations done in LTO the same as in normal compilation? -

while compiling translation unit compiler doing lot of optimizations - inlining, constant folding/propagation, alias analysis, loop unrolling, dead code elimination , many others haven't heard of. of them done when using lto/ltcg/wpo between multiple translation units or subset (or variant) of them done (i've heard inlining)? if not optimizations done consider unity builds superior lto (or maybe using them both when there more 1 unity source files). my guess it's not same (unity builds having full set of optimizations) , varies lot across compilers. the documentation on lto of each compiler doesn't precisely answer (or failing @ understanding it). since lto involves saving intermediate representation in object files in theory lto optimizations... right? note not asking build speed - separate issue. edit : interested in gcc/llvm. if have @ gcc documentation find: -flto[=n] this option runs standard link-time optimizer. when invoked sourc...

Testing ios facebook hosted app links before release on app store -

my iphone app has mobile content. using facebook app link hosts ( https://graph.facebook.com/app/app_link_hosts ) create canonical urls shared on facebook. body hosting request is: "access_token=<app_access_token> &ios=[ {\"url\":\"content://content/<content_id>\", \"app_store_id\":<app_store_id>, \"app_name\":\"<app_name>\"} ] &name=link test &web={should_fallback:false}" this works fine , returns id object. test have shared: https://fb.me/<canonical> since app not released yet, whenever open link facebook app not detect app installed. gives 2 action options, "open web link" , "install app_name". both options point blank itunes link app be. how test app link before publishing app on app store? this link returned: https://itunes.apple.com/webob...

Hbase : how to handle NotServingRegionException during region split -

during region splits client call fails exception. exception returned org.apache.hadoop.hbase.client.retriesexhaustedwithdetailsexception: failed 1 action: notservingregionexception: 1 time, @ org.apache.hadoop.hbase.client.asyncprocess$batcherrors.makeexception(asyncprocess.java:187) @ org.apache.hadoop.hbase.client.asyncprocess$batcherrors.access$500(asyncprocess.java:171) @ org.apache.hadoop.hbase.client.asyncprocess.geterrors(asyncprocess.java:897) @ org.apache.hadoop.hbase.client.hconnectionmanager$hconnectionimplementation.processbatchcallback(hconnectionmanager.java:2346) @ org.apache.hadoop.hbase.client.htable.batchcallback(htable.java:814) @ org.apache.hadoop.hbase.client.htable.batch(htable.java:793) in action notservingregionexception. thinking retry in case sleep retriesexhaustedwithdetailsexception can come in case not region split. how can handle case ? should retry if action contains notservingregion exception ? ...

How to refactor the following Rails erb code? -

i need refactor code using link_to method. <a href="post.html"> <h2 class="post-title"> <%= post.title %> </h2> <h3 class="post-subtitle"> <%= post.subheading %> </h3> </a> i want this: <%= link_to ".........",post) %> the "......" refactored code. you need pass block link_to : <%= link_to post_url(@post) %> <h2 class="post-title"> <%= post.title %> </h2> <h3 class="post-subtitle"> <%= post.subheading %> </h3> <% end %>

javascript - what is the use of data-dojo-config in Dojo -

i started learning dojo , came across how include dojo using cdn below code defined in dojo tutorial <script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js" data-dojo-config="async: true"> here why have missed http ? intentional, program not working unless add http in code. also use of data-dojo-config attribute, don't see difference in basic program if remove attribute. when need use attribute? when access other examples , see differently: data-dojo-config="isdebug: 1, async: 1, parseonload: 1" what these properties, when use them? he data-dojo-config configurations paramenter the dojo loader , parser. similar configurations parameters set loading database server instance. what dojo loader , parser ? dojo loader: loads javascript modules ( javascript files ) synchronously or asynchronously. dojo parser: function of dojo parser parse , convert html code dojo widgets wherever necessar...

Database creation in Azure from bacpac -

while creating database in azure bacpac receive following error. have tried number of times different containers/storage accounts badrequest &lt;string xmlns=&#34; http://schemas.microsoft.com/2003/10/serialization/&#34;&gt;error encountered during service operation. ; exception microsoft.sqlserver.management.dac.services.serviceexception: unable authenticate request; &lt;/string&gt; we have used following variations: change of names change of service tiers change of bacpac earlier created dbs able create blank database any help?

java - javax.naming.NameNotFoundException in Jetty but not in Tomcat. How to solve? -

i have sample code this: connectionpool.datasource = (datasource) initialcontext.lookup("java:comp/env/jdbc/murach"); and in webapp/meta-inf/context.xml <?xml version="1.0" encoding="utf-8"?> <context> <resource name="jdbc/murach" auth="container" type="javax.sql.datasource" username="root" --- rest of text ---/> </context> when deploy web app tomcat, db connection fine, when try jetty using jetty plugin in with: jetty:run-war <plugin> <groupid>org.eclipse.jetty</groupid> <artifactid>jetty-maven-plugin</artifactid> <version>9.2.1.v20140609</version> <configuration> <scanintervalseconds>2</scanintervalseconds> <httpconnector> <port>8082</port> </httpconnector> <webapp> <contextpa...

Alfresco Mobile: Kerberos und iOS login: java.io.IOException: ASN.1 type 0x3a decode not supported -

in alfresco installation (5.0.d community), have following authentication chain: authentication.chain=kerberos1:kerberos,ldap1:ldap,alfrescontlm1:alfrescontlm i can login desktop browser alfresco mobile app android fine , both on port 8080 (http) , port 443 (https). but when try login iphone or ipad , getting following error message in log (both http , https): [org.alfresco.web.app.servlet.kerberosauthenticationfilter] [http-bio-443-exec-13] java.io.ioexception: asn.1 type 0x3a decode not supported [org.alfresco.web.app.servlet.kerberosauthenticationfilter] [http-bio-8080-exec-6] java.io.ioexception: asn.1 type 0x3a decode not supported does have idea problem here or how fix it? there several candiates root cause. i assume have enabled sso? alfresco doesn't support fallback basic auth on several protocols (yet) if sso enabled: https://issues.alfresco.com/jira/browse/ace-2678 need set kerberos.authentication.sso.enabled=false ios running. additionall...

python - Where do i put the config file for flake8 on Windows? -

i installed flake8 work home on windows machine, don't know put configuration file. the documentation states, flake8 file has put in ~/.config/flake8 . i tried %userprofile%/.config/flake8 , %userprofile%/flake8 both no avail. perhaps, experience working flake8 on windows can answer this? if open source code flake8 (main.py), see on windows, default config path different on linux: if sys.platform.startswith('win'): default_config = os.path.expanduser(r'~\.flake8') on windows 7 machine, resolves to: c:\users\username\.flake8 so you'll have create file called .flake8 . sure begins period. did opening command line , going home folder , executing following command: nul > .flake8 that created blank file can't create in explorer (or couldn't anyway). once that's created, can open , add whatever it. update - found "documentation" mentions windows here: https://gitlab.com/pycqa/flake8/blob/master/docs/conf...

highcharts - Convert bar bullet chart into column chart -

here example of highchart bullet chart http://jsfiddle.net/jlbriggs/ldhyt/1/ how can convert column bullet chart? //------------------------------------------------------- highcharts.renderer.prototype.symbols.line = function(x, y, width, height) { return ['m',x ,y + width / 2,'l',x+height,y + width / 2]; }; //------------------------------------------------------- highcharts.setoptions({ chart:{ type:'bar', margin:[5,15,10,100], }, credits:{enabled:false}, exporting:{enabled:false}, legend:{enabled:false}, title:{text:''}, xaxis:{ ticklength:0, linecolor:'#999', linewidth:1, labels:{style:{fontweight:'bold'}} }, yaxis:{ min:0, minpadding:0, maxpadding:0, tickcolor:'#ccc', tickwidth:1, ticklength:3, gridlinewidth:0, endontick:true, title:{text: ''}, ...

windows - why in batch script do not working the "do set" function? -

i have following problem in batch scripting. i have code lines for /f "tokens=*" %%d in ('dir /b /s a2lfiles_merger*.txt') set merger_list=%%d echo %merger_list% and result echo off then tried code for /f "tokens=*" %%d in ('dir /b /s a2lfiles_merger*.txt') echo %%d the result c:\users\user\desktop\build\input\job_1\a2lfiles_merger.txt so, question why cannot set variable path? need use in next steps , stuck in situation. can find solution ? thank in advance! revised code: setlocal enabledelayedexpansion /f "tokens=*" %%d in ('dir /b /s a2lfiles_merger*.txt') ( set merger_list=%%d echo !merger_list! ) note setlocal command , parenthesis enclosing commands executed in for-loop. that's how loops work. hope helped!

java - Android game GLSurfaceView time handling -

i trying make small android game java , opengl es 2.0. trying create game loop smooth feeling if example objects moving. tried 4 approaches of them making me not happy. here approaches: approach 1: @override public void ondrawframe(gl10 gl) { game.update(1.0f / 60.0f); game.render(); } result: approximately 2 seconds there little lag/delay. between 2 seconds fells smooth. approach 2: @override public void ondrawframe(gl10 gl) { newtime = system.currenttimemillis(); deltime = newtime - oldtime; oldtime = newtime; game.update(deltime / 1000.0f); game.render(); } result: approximately 2 seconds there little lag/delay, same "approach 1". between 2 seconds fells smooth. approach 3: @override public void ondrawframe(gl10 gl) { newtime = system.currenttimemillis(); deltime = newtime - oldtime; oldtime = newtime; lagtime += deltime; // 18ms ~ 55 frames per second ...

javascript - How to append checkbox value to specific category it belongs -

i have check-boxes values belong different categories (e.g. movies, music, books etc.). when user checks check-box value gets appended want category name appended too, first time. example : the user checks "mad max" under movies category. the <li> checkbox value get's appended , "movies" gets appended on top of it. the user checks "back future", time category name should not appended because there. also, if user unchecks check-box value erased , if last value left, category name removed. i have tried several ways, biggest problem dealing category name. this i've got far.. (function() { $('input:checkbox').on('change', function() { // value of checkbox var value = $(this).parent('label').text(); // value of category name var categoryname = $(this).parents('.modal-body').siblings('.modal-header').children('.modal-title').text(); ...