Posts

Showing posts from June, 2015

c# - Why does '+' + a short convert to 44 -

Image
i have line of code looks this: myobject.phonenumber = '+' + thephoneprefix + thebiznumber; basically, i'm creating phone number in e164 format , assign string string property of object. thephoneprefix short holds international phone prefix , thebiznumber string holds phone number digits. why didn't compiler bug when concatenating short in string in first place? , why '+' + 1 equal 44?? pretty hard bug track because there no compile error , 44 phone prefix uk "looked" working because client-side code saw uk number. why 44? thanks. why didn't compiler bug when concatenating short in string in first place? string concatenation using + sign internally calls string.concat , internally calls tostring on each parameter. hence no error. why '+' + 1 you doing character/numeric arithmetic. 43 being value of + , short/int 1 44. because of operator + associativity left right first character/numeric additio...

python - How do I draw a colourbar for basemap etopo? -

Image
basemap has etopo method draws etopo1 global relief image , suitable use background. uses blue tones bathymetry, greens , browns dry land areas, , white ice caps. poster produced noaa ( 290 mib pdf ) includes colourbar illustrating those. there builtin or otherwise simple way include colourbar within basemap? low-resolution sample obtained noaa

How do i build namespaces xmlns, xmlns:xsi, and schema xsi:schemalocaton in my XML via VB.net? -

i need replicate xml header: <xdatafeed xmlns="http://foo.com/namespace" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" . xsi:schemalocation="http://foo.com/namespace c:\fooxsd.xml"> with code: 'export object xml dim writer new xmlserializer(datafeed.gettype) dim ns new xmlserializernamespaces() ns.add("xmlns", "http://foo.com/namespace") ns.add("xsi", "http://www.w3.org/2001/xmlschema-instance") dim file new system.io.streamwriter("c:\foo.xml") writer.serialize(file, datafeed, ns) file.close() and i'm hitting 2 issues: when try add namespace without prefix foo.com, removes namespaces. code above adds foo.com's namespace as: xmlns:xmlns="http://foo.com/namespace" which not correct. how add in namespace without prefix? i have searched hou...

regex - Oracle: Is There a Variant of REGEX_REPLACE that supports inline code? -

note : question has been asked in context of c++ regexp_replace (see here ). however, occurred me might of interest in oracle universe, too. wording of question has been adopted kind permission of original author. perl has e regex modifier allows perl code rather string formulate replacement: http://perldoc.perl.org/perlretut.html#search-and-replace though example not greatest there switches accomplish this. of understand perl here's example makes more sense: $string = "stackoverflow user: old faithful"; $string =~ s/:\s*(.*)$/$1 == "old faithful" ? ": ".$1." awesome!" : ": ".$1." ???"/e; print $string; #will print "stackoverflow user: old faithful awesome!" is there regex_replace variant in (pl)sql allow me similar? in code inline replacement. unfortunately, regex_replace doesn't cater dynamically generated replacement strings. however, can come close. answer contains 3 variations...

c++ - Unhandled exception within my menu -

i getting unhandled exception in code , have no idea why. first time using more 1 class together. at moment trying put user input string class. trying input user input string called name in class below #ifndef ship_h #define ship_h #include "applicationmenu.h" #include <string> class ship { public: ship(void); ~ship(void); std::string _size; std::string _shipname; std::string name; }; #endif into following function ran in main #include "applicationmenu.h" #include "ship.h" #include <string> #include <sstream> class ship; #include <iostream> using namespace std; applicationmenu::applicationmenu(void) { userchoice = 0; } applicationmenu::~applicationmenu(void) { } void applicationmenu::displaymenu() { cout << "welcome port." << endl << "please select 1 of following options : " << endl << "1: dock ship" << ...

HTML Form Button CSS -

i have following code (there other stuff in form not relevant): <fieldset> <form> <div><input type="submit" value="sign register"></input></div> </form> <form method="link" action="viewcurrent.php"> <input type="submit" value="view register"></input></br> </fieldset> </div> both buttons work fine. on web page appear underneath each other. correct way have these buttons next each other instead of underneath eachother? the proper way use display: inline-block .

java - Reading 4 bytes from InputStreamReader -

i'm having issue. i'm working on simple multithread tcp server in java, , have problem: client can send me input string, such as [identifier] text\r\n which okay , have done. every input query needs ended \r\n , except 1 case. this case when client send image binary data. message has following structure: photo[space][length of data][space][data][4 bytes of checksum in big endian] and whole point either return a 202 okay\r\n message when checksum matches sum of bits in data, or ... 302 bad checksum\r\n ... otherwise. however, i'm having serious issues reading 4 bytes. input source instance of inputstreamreader, acquired from: in = new inputstreamreader(this.clientsocket.getinputstream()); and function inputstreamreader.read() return int of char has been read. now, tried to correctchecksumbytes = new byte[4]; for( int = 0 ; < 4 ; ++i ) { correctchecksumbytes[i] = (byte) in.read(); } ...

ios - MPMoviePlayerController not staying within bounds of UIView -

Image
i trying add video uiview container within modal window. when add video not stay within bounds of uiview bounded to. here picture of looks like: the grey container can see right edge of container , here view controller adds video. import foundation import mediaplayer class evalinstructionsvc: uiviewcontroller { private var movieplayer : mpmovieplayercontroller? @iboutlet weak var video: uiview! func playvideo() { let path = nsbundle.mainbundle().pathforresource("time rotate demo", oftype:"mp4") let url = nsurl.fileurlwithpath(path!) movieplayer = mpmovieplayercontroller(contenturl: url) if let player = movieplayer { player.view.frame = video.bounds player.view.center = cgpointmake(cgrectgetmidx(video.bounds), cgrectgetmidy(video.bounds)) player.preparetoplay() player.scalingmode = mpmoviescalingmode.aspectfill video.addsubview(player.view) } ...

php - Parsing date error -

i have strange error dont understand. reason, dates not parsed. the code: $day = strtotime($_get['d']."-".$_get['m']."-".$_get['y']); $datetimezone = new datetimezone("europe/prague"); $datetime = new datetime($day, $datetimezone); $offset = ($datetimezone->getoffset($datetime))/3600; now weird thing is.... if pass in numbers, works, doesnt others... for example url work: d=15&m=12&y=2014 but this: d=12&m=12&y=2014 shows fatal error: uncaught exception 'exception' message 'datetime::__construct(): failed parse time string (1418252400) @ position 7 (4): unexpected character' in i have tried experimenting it, changing format of strtotime, no luck , seems randomly working.... when sending timestamp parameter of datetime object, have use @ symbol prefix. see manual (unix timestamp): http://php.net/manual/en/datetime.formats.compound.php so, correct way is: $da...

F#, MailboxProcessor and Async running slow? -

background. i trying figure out mailboxprocessor. idea use kind of state machine , pass arguments around between states , quit. parts going have async communication made sleep there. it's console application, making post nothing because main thread quits , kills behind it. making postandreply in main. also, have tried without let sleepworkflow = async , doesn't make difference. questions. (i doing wrong) go24 not async. changing runsynchronously startimmediate makes no visible difference. end should somewhere below getme instead. @ same time done printed after fetch. isn't control supposed t returned main thread on sleep? go24, wait go24 1, end fetch 1 done getme ... run time terrible slow. without delay in fetch it's 10s (stopwatch). thought f# threads lightweight , should use threadpool. according debugger takes appr 1s create every , looks real threads. also, changing [1..100] "pause" program 100s, according processexplorer 100 thre...

Cannot type into text input on jqModal dialog when modal set to true -

having upgraded jqmodal r13 r22, find dialogs contain text inputs not possible type them. removing modal:true settings fixes it, don't want users able dismiss dialog clicking on overlay. behaviour design, or bug? this not design. have released fix (+r23). please open github issue if require further assistance. related: if you're nesting modals, sure have higher z-index value on child modals. you may override $.jqm.focusfunc() provide custom behaviour events occurring outside active modal.

angularjs - ng-class not working in ng-repeat -

i have ng-class doesn't seem adding class on initial load. looks function working perfectly, , outputting proper boolean, class doesn't add. if toggle value, updates expected. <ul class="gb-talents-tiers"> <li class="clearfix" ng-repeat="tier in guide.tiers()"> <span>{{tier}}</span> <ul class="gb-talents-icons clearfix"> <li ng-repeat="talent in guide.talentsbytier(hero.hero, tier) | orderby: talent.ordernum"> <a href="#" class="talents-icon {{hero.hero.classname}} {{talent.classname}}" ng-class="{ 'tier-selected': guide.hasanytalent(hero, talent), 'active': guide.hastalent(hero, talent) }" ng-click="guide.toggletalent(hero, talent)" hots-talent>{{talent.name}}</a> </li> </ul> </li> </ul> the problem lies with: ng-class="{ 'tier-selected': guide...

javascript - Loading state as a modal overlay in AngularJS -

i want load state modal can overlay state without effecting other states in application. example if have link like: <a ui-sref="notes.add" modal>add note</a> i want interrupt state change using directive: .directive('modal', ['$rootscope', '$state', '$http', '$compile', function($rootscope, $state, $http, $compile){ return { priority: 0, restrict: 'a', link: function(scope, el, attrs) { $rootscope.$on('$statechangestart', function (event, tostate, toparams) { event.preventdefault(); }); el.click(function(e){ $http .get('url here') .then(function(resp){ $('<div class="modal">' + resp.data + '</div>').appendto('[ui-view=app]'); ...

selenium - How to extract xpath from element name using Appium on iOS -

i'd find way extract full element's xpath using name. instance got this: name: moses type: uiastatictext xpath: "//uiaapplication[1]/uiawindow[1]/uiascrollview[1]/uiastatictext[3]" now i'd find full xpath using "moses" name tag. seleniumhelper.getelement("//uiastatictext[(@name='moses')]"); but doesn't seem work. cheers, pavel try this: mobileelement obj1 = (mobileelement)driver.findelementbyclassname("uiastatictext"); or: mobileelement obj1 = (mobileelement)driver.findelementbyclassname("uiawindow"); once object, then: obj1.getattribute("name"); if still see issue, please attach screen shot xml.

CSS Selector "combine" Elements -

i'm new css , try parse html via jsoup parser java. example html: <p>however beautiful s6 edge looks, doubt [...] <a title="samsung unveils galaxy note 4 , curved screen note edge" href="http://www.example.com/">note edge</a>, dual gently curved screen [...] or accidental palm taps.</p> i text inside <p> element follows: elements text = doc.select("p"); (element element : text) { system.out.println(element.owntext() + "\n"); } output: however beautiful s6 edge looks, doubt [...] , dual gently curved screen [...] or accidental palm taps.   1 can see, text note edge insde <a> element not showing up. so wanted ask if there possiblity show entire text, including text inside <a> element follows: however beautiful s6 edge looks, doubt [...] note edge , dual gently curved screen [...] or accidental palm taps. i'm greatful every suggestio...

python - SpooledTemporaryFile: units of maximum (in-memory) size? -

the parameter max_size of tempfile.spooledtemporaryfile() maximum size of temporary file can fit in memory (before spilled disk). units of parameter (bytes? kilobytes?)? documentation (both python 2.7 , python 3.4 ) not indicate this. the size in bytes. spooledtemporaryfile() source code : def _check(self, file): if self._rolled: return max_size = self._max_size if max_size , file.tell() > max_size: self.rollover() and file.tell() gives position in bytes. i'd use of term size in connection python file objects not expressed in bytes warrants explicit mention. other file methods deal in terms of size work in bytes well.

python - How to increase the size of a thumbnail in QListWidget -

problem => create qlistwidgetitem object containing list of images thumbnails @ relatively larger size current 1 have (sorta "medium icons" or "large icons" option in windows explorer) progress far => have managed find out how create list , icons far small. what have tried => i've tried changing font size of list items assuming tht cld make font grow bigger proportionally. didn't work. i've tried setting size of thumbnail using (pil's image) according online blogger didnt work well. code snippet => #imported image , imageqt pil , imported qtgui , qtcore testimages = glob.glob(dirname + "/*.jpg") # create list item each image file, # setting text , icon appropriately image in testimages: picture = image.open(image) picture.thumbnail((128,128), image.antialias) icon = qicon(qpixmap.fromimage(imageqt.imageqt(picture))) item = qlistwidgetitem(image, self) ...

Jquery load function behavior on reload -

in index.php load page content jquery load function. access elements loaded use load callback function. this scenario index.php <html>.. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/script.js"></script> <div id="load-page"></div> <button type="button" class="btn btn-primary" id="reload"> <span class="glyphicon glyphicon-refresh"></span> reload </button> <button type="button" class="btn btn-default" id="selectall"> <span class="glyphicon glyphicon-check"></span> select </button> <button type="button" class="btn btn-default" id="add"> <span class="glyphicon glyphicon-plus"></span> add </button> loaded-page.php <inpu...

Ruby regex syntax for "not matching one of the following" -

nice simple regex syntax question you. i have block of text , want find instances of href=" or href=' not followed either [ or http:// i can "not followed [ " with record.body =~ /href=['"](?!\[)/ and can "not followed http:// " record.body =~ /href=['"](?!http\:\/\/)/ but can't quite work out how combine two. just clear: want find bad strings this `href="www.foo.com"` but i'm ok (ie don't want find) strings this `href="http://www.foo.com"` `href="[registration_url]"` combine both using alternation operator. href=['"](?!http\:\/\/|\[) for more specific, be. href=(['"])(?!http\:\/\/|\[)(?:(?!\1).)*\1 this handle both single quoted or double quoted string in href part. , won't match strings href='foo.com" or href="foo.com' ( unmatched quotes ) (['"]) capture double quote or single quote. (?!http\:\/\/...

datetime - process the files in S3 based on their timestamp using python and boto -

i trying process files in s3 based on timestamp these files have. have code provides me date modified attribute of files , parse convert appropriate format using boto.utils.parse_ts . want sort files , if possible put key name in list in sorted order oldest files comes first processing. how can this? con = s3connection('', '') bucket = conn.get_bucket('bucket') keys = bucket.list('folder1/folder2/') key in keys: date_modified = parse_ts(key.last_modified) there lots of ways here's 1 way should work: import boto.s3 conn = boto.s3.connect_to_region('us-east-1') bucket = conn.get_bucket('mybucket') keys = list(bucket.list(prefix='folder1/folder2/')) keys.sort(key=lambda k: k.last_modified) the variable keys should list of key objects sorted last_modified attribute oldest first , newest last.

ios - UITableView Programmatically inside UIScrollView not calling delegate methods -

i trying load several uitableviews in uiscrollview using following code int x = 0; (int = 0; < 14; i++) { uitableview *testtableview = [[uitableview alloc] initwithframe:cgrectmake(x, 0, 150, scrollview.bounds.size.height)]; testtableview.datasource = self; testtableview.delegate = self; [testtableview settag:i]; [testtableview reloaddata]; [scrollview addsubview:testtableview]; x+=155; } [scrollview setcontentsize:cgsizemake(x, scrollview.bounds.size.height)]; the problem this, uitableview not responding of delegate methods.. ideas?? since tableview is (inherits from) scrollview, problem or scrollview delegate methods being called table views, parent scrollview. if case, should perform check in delegate method. example - (void)scrollviewdidscroll: (uiscrollview *)scrollview { if ([scrollview isequal:tableview1]){ }else if ([scrollview isequal:tableview2]){ }else if ([scrollview ise...

excel - Delete cell content after enter key? -

excel need delete type right after press enter possible? might easy don't know how to. yes using data need send data , delete results data in. have far: "=countif(b2;c8)" if b2 matches c8 adds 1 , need delete b2 automatically enter new value. place following event macro in worksheet code area: private sub worksheet_change(byval target range) application.enableevents = false target.clearcontents application.enableevents = true end sub because worksheet code, easy install , automatic use: right-click tab name near bottom of excel window select view code - brings vbe window paste stuff in , close vbe window if have concerns, first try on trial worksheet. if save workbook, macro saved it. if using version of excel later 2003, must save file .xlsm rather .xlsx to remove macro: bring vbe windows above clear code out close vbe window to learn more macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm ...

php - Make permanent changes to a webpage, through the webpage -

right has been asked before in similar context answer not given.. need know how change contents of "homepage.php" (example) permanently filling out form on webpage itself, know have store data in mysql database how should go doing (which way). know how store , retrieve data particular problem has me baffled. do save single css values database (e.g. blue, green, margin-left, margin-right) or can store whole css block of code variable save in database || body { //content of body } .navbar{ //navbar content here }? || end result need edit page without altering code can see not using cookies. (please not tell me needing server etc know..) i using procedural method of php programming no framework seeking give example. thanks in advance =d! i post comment don't have enough points comment. able utilize jquery webpage? have had exact same thing php/mysql, , using jquery .css() , .html() provides working solution.

error handling - How to get parent component's name in React? -

i provide nice error messages of components, react does, example: warning: each child in array should have unique “key” prop. check render method of mycomponent. see fb.me/react-warning-keys more information. this message provides info context of error. know can find in debugger, want make debugging easier me , fellow programmers. while it's not clear how you'd use promise component mentioned in comment, try this: var componentname = this.constructor.displayname || constructor.name || undefined; it's inspired this function in reactjs code looks @ constructor build name during react element validation. but, if want parent's name, isn't possible through documented means , fragile if built code depending on specific internal implementation. it's 1 way flow of information child doesn't need link parent way of normal architecture. if need parent name, you'd need value , pass through children i'm sure isn't desireable. ...

c++ segmentation fault for dynamic arrays -

i want add theater object boxoffice object in c++ code. when try add in main code, first 1 added successfully. segmentation fault occurs second , obvioulsy other theater objects. here add function; #include <iostream> #include <string> #include "boxoffice.h" using namespace std; boxoffice::boxoffice() { sizereserv = 0; sizetheater = 0; theaters = new theater[sizetheater]; reserv = new reservation[sizereserv]; } boxoffice::~boxoffice(){} void boxoffice::addtheater(int theaterid, string moviename, int numrows, int numseatsperrow){ bool theaterexist = false; for(int i=0; i<sizetheater; i++) { if(theaters[i].id == theaterid) { theaterexist=true; } } if(theaterexist) cout<<"theater "<<theaterid<<"("<<moviename<<") exists"<< endl; else { ++sizetheater; theater *temptheater = new theate...

timeout - Close pop up and refresh parent page javascript -

i want close pop , refresh parent after few seconds delay make sure data received. have following function closeandrefresh(){ settimeout(function() { window.open('/{!currsubid}','_top'); window.location = window.location.href; return true; },5000)} this code refreshes parent inside popup, pop not close, rather parent shows refreshed - in pop up so move pop outside of timeout, give name, call close, , reload. function closeandrefresh(){ var winpop = window.open('/{!currsubid}','_top'); //load pop give name window.settimeout(function(){ winpop.close(); //close pop window.location.reload(true); //refresh current page },5000); } you use ajax call server , not have deal pop , wondering if pop blocker block or not knowing if call completetd. when call comes call, can reload page.

Frontend Editing in Joomla 3.4 is not working -

i have enabled: global configuration –> mouse-over edit icons for: -> module&menus global configuration –> articles -> editing layout -> show publishing options -> yes ----- , show article options , enable versions set yes. i'm logged in in front-end , back-end super user. in every acl super user frontend editing set allowed. joomla 3.4 k2 v2.6.9 purity_iii 1.1.2 ........... i still can’t edit in frontend. how enable frontend editing? articles, k2 items, menus, modules. what missing? thanks help. this functionality depending on template. have ask joomlart if manage function.

vb.net - Choice of analyzer for lucene.net full text search in books -

i using lucene vb.net. want make full text search of books includes arabic , english books. not sure choice of analyzer should use. great if suggest me right analyzer his/her experience. thanks if want include stemming , other language-specific analysis rules, , can identify language document or query in, can use arabicanalyzer arabic documents , queries, , snowballanalyzer english documents , queries (like: new snowballanalyzer(myversion, "english") ). if want use non-language-specific analysis of them, should stick standardanalyzer .

Convert JSON object to simple variables in Java -

i have heavy json lots of parameters want convert java object containing few of them. direct conversion such this dataobject obj = gson.fromjson(br, dataobject.class); is not option. how can access individual fields within objects (just value under date , type under attributes under completion_date )? json example: {"results":[ {"date":{ "attributes":{ "type":null}, "value":"december 13, 2010"}, "is_structured":"no", "completion_date":{ "attributes":{ "type":"anticipated"}, "value":"march 2016"}, .... if don't want directly convert input expected object create jsonobject input like jsonobject root = new jsonobject(input); and navigate there attribute need e.g.: root.getjsonarray("results").getjsonobject(0).getstring("is_structur...

Fluent NHibernate subclass reference -

so have following entities: timelinerecord: id: pk from: datetime to: datetime servicerecord extends timelinerecord: id: pk timelinerecord_id: fk somespecificproperties... demand: id: pk from: datetime to: datetime ... servicedemandconnection: id: pk service: servicerecord demand: demand timelinerecord, demand , servicedemandconnection mapped using classmap id(x => x.id). servicerecord mapped using subclassmap (table-per-class). references in servicedemandconnection mapped using references(x => x.service).cascade.none() , same .demand. the problem inserting servicedemandconnection set servicerecord , demand. error: detail=key (servicerecord_id)=(8) not present in table "servicerecord". error states true. 8 id of timelinerecord, not servicerecord. however, id of servicerecord (timelinerecord_id, not mapped/not accessible in code) should used instead. current mapping hides servicerecord.id. how should tell...

C: Passing array to pointer function -

i'm not sure if question has asked before, couldn't find similar topics. i'm struggeling following piece of code. idea extend r time later on without writing lots of if-else statements. functions ( func1 , func2 ...) either take 0 or 1 arguments. void func1() { puts("func1"); } void func2(char *arg){ puts("func2"); printf("with arg %s\n", arg); } struct fcall { char name[16]; void (*pfunc)(); }; int main() { const struct fcall r[] = { {"f1", func1}, {"f2", func2} }; char param[] = "someval"; size_t nfunc = rsize(r); /* array size */ for(;nfunc-->0;) { r[nfunc].pfunc(param); } return 0; } the code above assumes functions take string argument, not case. prototype pointer function declared without datatype prevent incompatible pointer type warning. passing arguments functions not take parameters results in too few arguments ....

java - Unable to POST large html content to server on Chrome -

i'm trying send html content through post request not getting delivered on server side using chrome. while request data in jsp when using mozilla. works in both browsers when html content small. i'm generating pdf html content using apache fop. var iframe = document.createelement('iframe'); iframe.setattribute('name','eyeframe'); document.body.appendchild(iframe); var myform = document.createelement('form'); document.body.appendchild(myform); myform.setattribute('action','myjsptorenderhtmlaspdf.jsp'); myform.setattribute('method','post'); myform.setattribute('target','eyeframe'); var hiddenfield = document.createelement("input"); hiddenfield.setattribute("type", "hidden"); hiddenfield.setattribute("name", "htmlcontent"); hiddenfield.setattribute("value", strhtml); myform.appendchild(hiddenfield); myform.submit(); i dividing html c...

ruby on rails - Get data in batch using ActiveRecord -

i create rails app , fetch data batch starting specific point. use ar , table structure looks following: create_table(:types) |t| t.string :name, null: false t.string :type, null: false t.string :type_id, null: false t.text :metadata t.timestamps end to data use type_id in following format (guid): "b2d506fd-409d-4ec7-b02f-c6d2295c7edd" i fetch specific count of data, ascending or descending ,starting specific type_id. more specific want do this: model.get_batch(type_id: type, count: 20).desc can in activerecord? you can use activerecord::batches find records in batches example model.where('your condition').find_in_batches(start: 2000, batch_size: 2000) |group| # batch end check activerecord::batches.find_in_batch

c++ - SPOJ: What is the difference between these two answers for KURUK14 -

i have solved this problem , got ac. problem related equivalence of following 2 approaches. first code got accepted, while second didn't. far can discern, both equivalent (valid) test cases human can think of. wrong? if so, test case can differentiate them? code#1 (accepted one): #include <cstdio> bool* m; bool proc(int n){ for(int j=0;j<=n;j++){ m[j]=false; } for(int i=0;i<n;i++){ int a=0; scanf("%d",&a); if(a>=n) return false; else if(!m[a]) m[a]=true; else if(!m[n-1-a]) m[n-1-a]=true; } bool f = true; for(int k=0;k<n;k++) { f = f && m[k]; } return f; } int main() { m=new bool[1002]; int num=0; scanf("%d",&num); while(num){ int n=0; scanf("%d",&n); if(proc(n)) printf("yes\n"); else printf("...

excel - Call 'Large' ref, grab value from column in referenced row -

let's have few columns, 5 example. multiple rows. each individual row, on column , b, have 2 strings reference. columns c , d add column e, totals 2 values. what i'm looking reference largest values in chart, pull number, , return 2 strings in columns , b. i know can pull largest number in range x,y in col e =large(ex:ey,1), how 1 reference row number represents? let's reference 2 strings in sixth row alpha , bravo , , sixth row contains largest value ( 26 example) want pull. i'm looking way output 26 alpha bravo , if that's possible. i'm making list going largest smallest, i'm looking way incorporate large in there - looking pick 10 largest values , respective strings. any thoughts? i'm looking way output 26 alpha bravo, if that's possible. please try: =max(e:e)&" "&index(a:a,match(max(e:e),e:e,0))&" "&index(b:b,match(max(e:e),e:e,0))

c# - how to create binding for an extern declaration -

i'm trying create binding ios library. when creating native app library, requires include .h header file declares global applicationkey variable this: extern const unsigned char applicationkey[]; and supposed implement const unsigned char applicationkey[] = {0x11, ... }; now, when creating xamarin binding library, header file mapped objective sharpie to partial interface constants { // extern const unsigned char [] applicationkey; [field ("applicationkey")] byte[] applicationkey { get; } } how change able set applicationkey c# code? your apidefination.cs file should [basetype (typeof(nsobject))] public partial interface constants { [export ("applicationkey")] typeofproperyinnativecode applicationkey { get; set; } } in order access property create instance of constant class of binding project , access binding.constant cons= new binding.constant(); cons.applicationkey =value; for better u...

content management system - What does Typo3 CMS offer (or can do) that WordPress 4 doesn't? -

this not opinion based question rather technical limits comparison one. from various comparison charts 2 cms couldn't find technical difference between 2 platforms. being long time wordpress developer find supplied arguments typo3 technical pros exist somehow in wordpress; achieve in 1 can achieved in other (plugins & extensions). let's take example latest versions of both 2 cms's, typo3 can wordpress can't plugins/extensions? update please instead of down voting question, provide @ least 1 reason vote. as write, technical pros exist somehow in wordpress. i think major advantage of typo3 extension framework extbase , template rendering engine fluid . developing (and maintaining) larger extensions becomes lot easier since introduction overall cleaner, object oriented code base. 3rd party extension written in technology easier adapt/customize extensions in wordpress mix procedural object oriented style. webpages multiple languages easie...

How do I move 1 object in an array to another array in javascript and then show both in a listview ( jquery ) -

so school assignment need write basic mobile web application, using jquery , javascript. need make page can add title , author of book , add list using local storage. far want make 2 lists, 1 books read , 1 read books. made listview split icon when it's clicked book should move other list. listview contains split icon should remove book in it's whole. the adding part working , added books displayed in listview can't seem button working change list book in. please me i'm loosing mind. here html , javascript code: <!-- overview --> <section id="overview" data-role="page" data-theme="b"> <!-- content --> <div class="ui-content"> <div> <a href="#add" data-role="button" data-theme="b">add new book</a> <h1>books read</h1> </div> <ul id="bookstoread...

html - What exactly changes in the css rendering, when desktop browsers zoom in or out on a website? -

in way design scaled or down? i'm trying figure out happens @ css level, , consequences different sizing methods ( px , em , rem , etc). by way, concerned zooming behaviour modern desktop browsers. (i suspect mobile browser straight enlargement of whole page after rendering normally, , know old fashioned browsers increment base font-size). isn't clear however, modern browsers (say latest versions of chrome or ff) when user presses ctrl + or ctrl - . do render page (i.e. @ 100%) , enlarge rendered image? because ff still seems respect % widths example, doesn't seem straight enlargement. zooming implemented in modern browsers consists of nothing more “stretching up” pixels. is, width of element not changed 128 256 pixels; instead actual pixels doubled in size. formally, element still has width of 128 css pixels, though happens take space of 256 device pixels. in other words, zooming 200% makes 1 css pixel grow 4 times size of 1 device pixels. (two times ...

java - Design pattern for interface that determines order of method invocation -

i want create java interface number methods. want user of interface able invoke methods in sequence or order define. instance buyticket() should not called before reserveticket() . q: there design pattern or tips on how go this? i considered: a) interface wrapped, showing next possible method. each invocation of method returns new operation can called after it, , on. so reserveticketoperation has public buyticketoperation execute(); then buyticketoperation has public renderticketoperation execute(); b) use kind of context state machine records position of execution using enums , has factory obtaining next operation. any thoughts or suggestions appreciated. thanks my immediate feeling: don't @ all pattern. if inner logic of methods requires them always call them in order; exposing implementation detail make easy use interface wrong. meaning: instead of trying somehow force "client code" adhere specific order should design interf...

How to upload short videos (10-15 secs) from an Android App to AWS using Node.js? -

once application gives me get request file along video, should use in our node.js file correctly optimize video, compress/encode video in format , minimize uploading time end user? i understand file needs asynchronously uploaded. should backend systems designed like? we'll using aws , , mongo db . videos uploaded s3 bucket . best practice? basic requirement trying make uploading video scalable , concurrent multiple users upload video. are there kind of best practices or tutorial kind of video formatting , uploading in node.js looking for?

How to search a document and remove field from it in mongodb using java? -

i have device collection. { "_id" : "10-100-5675234", "_type" : "device", "alias" : "new alias name", "claimcode" : "fg755df8n", "hardwareid" : "serail02", "isclaimed" : "true", "model" : "vmb3010", "userid" : "5514f428c7b93d48007ac6fd" } i want search document _id , update after removing field userid result document. trying different ways none of them working. please me. you can remove field using $unset mongo-java driver in way: mongoclient mongo = new mongoclient("localhost", 27017); db db = (db) mongo.getdb("testdb"); dbcollection collection = db.getcollection("collection"); dbobject query = new basicdbobject("_id", "10-100-5675234"); dbobject update = new basicdbobject(); update.put("$unset...

php - Insert string into specific part of another string -

i've got url string, example: http://example.com/sub/sub2/hello/ i'd add subfolder php, before hello , should this: http://example.com/sub/sub2/sub3/hello/ i thought using explode separate url slashes, , adding 1 before last one, i'm pretty sure on complicate it. there easier way? this should work you: (here put folder between basename() , dirname() of string right before last part of url) <?php $str = "http://example.com/sub/sub2/hello/"; $folder = "sub3"; echo dirname($str) . "/$folder/" . basename($str); ?> output: http://example.com/sub/sub2/sub3/hello

Twitter Typeahead with Local Dataset -

i can't understand why tutorial example not work me: i have external js libraries: " https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js " " http://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.js " and code on load document: <script type="text/javascript"> $(document).ready(function () { $('input.typeahead').typeahead({ name: 'cars', local: ['audi', 'bmw', 'bugatti', 'ferrari', 'ford', 'lamborghini', 'mercedes benz', 'porsche', 'rolls-royce', 'volkswagen'] }); }); </script> i have css: <style type="text/css"> .bs-example { font-family: sans-serif; position: relative; margin: 100px; } .typeahead, .tt-query, .tt-hint { border: 2px solid #cccccc; border-radius: 8px; ...

c# - Checkchanged not firing when inside a gridview in asp.net -

i have gridview , inside checkbox status of items, checkbox has checkchanged event when i'm trying check or uncheck it, checkchanged not firing. here code gridview checkbox inside <asp:gridview id="dgvitems" runat="server" onrowcreated="dgvitems_rowcreated" onrowdatabound="dgvitems_rowdatabound" onselectedindexchanged="dgvitems_selectedindexchanged" onrowdeleting="dgvitems_rowdeleting"> <columns> <asp:templatefield headertext ="status"> <itemtemplate> <asp:checkbox id="chkstatus" runat="server" checked = <%# (string)eval("item_status") == "active" ? true : false %> oncheckedchanged="chkstatus_checkedchanged" autopostback="true" /> </itemtemplate> </asp:templatefield> </columns> </asp:gridview> protected void chkstatus_checkedchan...

c# - ship my software with a secure mongodb -

so have bundled software client can download , install (using msi on win machines). part of software mongodb database, stores client info, configurations, etc.. when software first installed, creates empty folder mongodb, , whenever software starts, starts mongod process (using c#'s process.start() ): mongod.exe --dbpath <path> --port <port> --quiet . my goal secure mongodb database username / password known application. this prevent tampering client's data outside, make harder (but not impossible, see below) client tamper application's data. general idea, guess, on installation (or on startup), create user read / write privileges software use communicate database. so questions are: 1. how programmatically this? guess this right direction, couldn't find info on c# driver docs 2. how deal upgrades? i.e clients installed previous version of software, database not secure @ all; create user password in case well. 3. how store application us...

tomcat - when I build application to war SLO (single logout) stops working -

i trying implement cas in spring based application. have configured cas , connection cas application , working when run application jar. when try build application war package slo (single logout) stops working. when click log out logged out application , cas i'm still logged in other application. enviroment: both war , cas deployed on local running tomcat 7, recommended in documentation change localhost computer name. i'm using cas-server-webapp-3.5.2.1 , spring-boot-1.1.8.release i disabled https communication run on http this first attempt integrate cas have doubts: can problem: 2015-04-01 11:21:37,807 warn [org.jasig.cas.util.httpclient] - <error sending me ssage url endpoint [http://mycomputername:8080/app1/j_spring_cas_securi ty_check]. error [server returned http response code: 403 url: http://my computername:8080/app1/j_spring_cas_security_check]> i've got same message when running jars , there i'm log out both applications full log: h...

commonjs - Titanium Importing a widget inside another widget controller -

in appcelerator titanium application building, there 2 widgets an imported widget vectorimage a custom widget staticboard, should rely on vectorimage widget. but don't find right way import vectorimage module in staticboard widget controller (widget.js). i've tried : var vectorimage = require('com.capnajax.vectorimage/widget'); var vectorimage = require(wpath('../../com.capnajax.vectorimage/widget')); and directly during widget creation : var image = alloy.createcontroller('com.capnajax.vectorimage', { svg: wpath('chess_pieces/'+pieceimage+'.svg'), top: parseint(y+inset+cellssize*(7-rank)), left: parseint(x+inset+cellssize*file), width: cellssize, height: cellssize }); $.widget.add(image); please, notice managed integrate in hard-coded way, in widget view (index.xml), e.g : ... <widget src="...