Posts

Showing posts from June, 2013

C++ Link multiple Classes together. Create an Array of objects to access sequentially -

directly bellow partially completed function should when completed allow me place each of 5 battleships down on board. issue i'm having i want access shipname stored in ship.cpp , want associate shipname player . example can have player1 , player2 each have 5 ships associated them , run placement loop each of them.i believe that's called instantiating object. admit i'll have have read on that! secondly have have sort of array stores each of ships , loops through each time? first pass cruiser, second pass destroyer etc. more string array have pointer reference, player.shipname pointer array or that? i've included game.h, player.h , ships.h @ bottom reference. thanks in advance , help! void game::manualplaceship() { // start loop int currentshipsdeployed = 0; int z = 0; int = 0; while (currentshipsdeployed < 5){ cout << "please enter co-ordinates place your" << /**player.shipname**/ "shipname"<< /**player

javascript - Different date values -

why happen when convert date json ? var = new date(); // returns wed apr 29 2015 18:15:33 gmt+0100 (gmt daylight time) var nowjson = now.tojson(); // returns "2015-04-29t17:15:33.863z" notice hour of each variable different... when new date() printed console, operating system defines locale , format printing. wed apr 29 2015 18:15:33 gmt+0100 (gmt daylight time) browser has deemed default. when print .tojson , happens: http://es5.github.io/#x15.9.5.44 this function provides string representation of date object use json.stringify (15.12.3). when tojson method called argument key, following steps taken: let o result of calling toobject, giving value argument. let tv toprimitive(o, hint number). if tv number , not finite, return null. let toiso result of calling [[get]] internal method of o argument "toisostring". 5.if iscallable(toiso) false, throw typeerror exception. return result of calling [[call]] internal

windows server 2012 r2 - Error Installing ADFS 3.0 -

i'm trying install adfs on new installation of win server 2012r2 , error in post-deployment configuration. domain controller win server 2008r2. please me, i've been trying solve 3 days. the error says: schema verification failed database 'adfsconfiguration'. alter database statement failed. failed restart current database. current database switched master. this error log after installation: 2015-04-29 12:46:55.93 server microsoft sql server 2012 - 11.0.2100.60 (x64) feb 10 2012 19:39:15 copyright (c) microsoft corporation windows internal database (64-bit) on windows nt 6.2 (build 9200: ) (hypervisor) 2015-04-29 12:46:55.97 server (c) microsoft corporation. 2015-04-29 12:46:55.97 server rights reserved. 2015-04-29 12:46:55.97 server server process id 1532. 2015-04-29 12:46:55.97 server system manufacturer: 'vmware, inc.', system model: 'vmware virtual platform'. 2015-04-29 12:46:55.98

How to reduce a Mobilefirst apk size -

im working in mobilefirst hybrid app , our apk has 13mb file size, there , our common folder has 2mb (with jquery mobile not minimize). im seeing lot of .so in our apk aprox. 1mb: assets/icudt46l.zip assets/featurelibs/armeabi/libcrypto.so.1.0.0.so assets/featurelibs/armeabi-v7a/libcrypto.so.1.0.0.so assets/featurelibs/x86/libcrypto.so.1.0.0.so , twenty .so in /lib folder is there way reduce mobilefirst apks size, because our customers working on remote locations , dont have lot of bandwidth. see answer here: lose weight mobilefirst platform exported apps starting mfp 7.0 can minify , concatenate mobile environments. means in addition added security, reducing amount of files , contents of files, can - degree - filesize of application. read more application build settings mfpf 7 supports default many more hardware architectures. support required if intend on using features such jsonstore , others. files adding support located @ your-app\androi

qtp - vbscript sendkeys works only once after system restart -

i have weird situation here , not able find out reason , fix. i have written script using hp uft 11.52 testing .net web application on ie8 here code: if browser(x).page(x).frame(x).webedit(abc).exist(0) browser(x).page(x).frame(x).webedit(abc).click set objssn=createobject("wscript.shell") objssn.sendkeys" " set objssn=nothing browser(x).page(x).frame(x).webedit(abc).object.focus() browser(x).page(x).frame(x).webedit(abc).set 100-10-1000 end if this code runs fine when run script after starting windows laptop. if run same code second time, code not enter space , not enter ssn. entering space required since clicking webedit result in blank selection, if enter script gives incorrect data. my teammate works on virtual machine running these scripts had no issues running script on machine. suspect there setting either in ie or windows somewhere needs modified. can me identifying issue. to enter ssn in textbox using qtp, h

ios - Why does this code cause an error? (Use of undeclared ideatifier '_maxConcurrentRequestCount') in Xcode -

why code cause error in xcode? (use of undeclared ideatifier '_maxconcurrentrequestcount') @interface httpkit : nsobject @property (nonatomic) nsinteger maxconcurrentrequestcount; @end @implementation httpkit - (void)setmaxconcurrentrequestcount (nsinteger)maxconcurrentrequestcount { } - (nsinteger)maxconcurrentrequestcount { if (!_maxconcurrentrequestcount) { _maxconcurrentrequestcount = 1; } return _maxconcurrentrequestcount; } @end please me resolve problem. why must use code below fixed it? @synthesize maxconcurrentrequestcount = _maxconcurrentrequestcount; if override default getter , setter of property property won't automatically synthesized , no ivar created property. you can either manually synthesize property said or create own ivar: @interface httpkit : nsobject { nsinteger _maxconcurrentrequestcount; } ... @end

c++ - rendering of fractal flame images -

i stumbled upon iterated system fractals , got interested in how implement code can render these ifs plots. inspiration comes here im not quite sure if right thing, , i'm wondering if might able clarify how 1 should intepret algorithm. what far is: make set f of size n linear transforms in form of constants a_i, b_i, ..., f_i and set v of size k called 'variations' variation takes point , returns point in 2d. then each function in f each gets color associated. then choose random point p , random color c make histogram h 1 bucket per pixel repeat many times: = random int in [0;n-1] p_new = (0, 0) c = (c + colorof i'th function) / 2 v in variations: p_new = p_new + v(a_i * p.x + b_i * p.y + c_i, d_i * p.x + e_i * p.y + f_i) p = p_new histogram @ p gets +1 color @ p = c finally, draw recorded colors i images, yet seem quite dull compared see other being capable of producing. examples of have managed create can seen here . so i&

Two CSS absolute positioned items in one page -

Image
i have design requires absolute positioned object on top of page. (menu inside of circle) then 5 row later (using foundation) have second absolute positioned element. position based on previous element because once apply position: absolute 1 element, you’ll find applying else. if rows positioned relative default, doesn't reset absolute position, element floating beginning of page. i can position if add element have touch css not good. so how reset absolute position, tried have elements before second element static , other absolute not work. the first element based on this gist , later code is: .or { position: absolute; background-image: url(../assets/img/or.svg); top: 50%; left: 50%; margin: -42px; width: 84px; height: 84px; background-size: 84px 84px; z-index: 50; } that's html <div class="small-6 columns text-center " > <div class="panel " data-equalizer-watch> con

MATLAB's drawnow doesn't flush -

is there reason matlab's drawnow wouldn't flush? this code: j=1; k = 1:length(p) = 1:n plot(p(k,j),p(k,j+1),'.'); j = j+2; end axis equal axis([-l l -l l]); j=1; drawnow end ( rungekutta4 own function wrote, , works ok, problem isn't there.) the particles stay drawn on plot , don't overwritten every time loop executes. how fix problem? the proper , efficient way handle graphics . should vectorize plot commands. % example data make runnable l = 1; n = 10; % number of points p = 2*rand(1e2,n+1)-1; % initialize plot, first iteration h = plot(p(1,1:n),p(1,2:n+1),'.'); % plot first set of points , return handle axis equal; axis([-l l -l l]); hold on; % ensure axis properties fixed drawnow; % animate k = 2:size(p,1) % size safer in case % use handle update positions of plotted points set(h,{'xdata','ydata'},{p(k,1:n),p(k,2:n+1)}); drawnow; pause(0.1); % slow do

java - Distributing apps via eclips -

can launch executable double click in eclipse after exporting ? import java.util.scanner; public class s { public static void main(string[] args) { scanner scan = new scanner(system.in); system.out.println("enter a: "); int = scan.nextint(); system.out.println("enter b: "); int b = scan.nextint(); int result = (a + b) / 2; system.out.println("(a+b)/2 is: " + result); } } the answer can access command line or create batch file starts jar file.

javascript - dynamic img-src with placeholder image -

i have following predicament. unfortunately can't share plunkr image coming protected site , not aware of open url serves changing images. can't switch local animated image needs on external server demonstrate problem. concept pretty straight forward. i have following url using display image. server sending image changing image @ approximately 3 frames per second. <img ng-src="{{logindata.url}}/cgi-bin/nph-zms?mode=jpeg&amp;monitor={{monitorid}}&maxfps=3&buffer=1000&user={{logindata.username}}&pass{{logindata.password}}&rand={{rand}}" width="100%" style="backgroundimage:url('http://placeholder.com/placeholder.jpg');"/> now here problem: -- want show place holder text or image following instances: a) sometimes, takes time server render first frame b) server not seem send images what want avoid screen not remaining blank - confuses user the problem facing moment img-src start, screen turns white , i

Android - HttpDelete with JSON -

i'm trying implement httpdelete , i've used httpget , httppost , , worked well. first think, saw on httpdelete , can not put del.setentity(entity); entity stringentity entity = new stringentity(usuari.tostring()); , usuari json . since can't put entity on httpdelete , tried this: boolean resul = true; httpclient httpclient = new defaulthttpclient(); httpdelete del = new httpdelete(getresources().getstring(r.string.ipapi) + "produsuaris/produsuari"); del.setheader("content-type", "application/json"); try { jsonobject usuari = new jsonobject(); try { usuari.put("idproducte", params[0]); usuari.put("idusuari", params[1]); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace(); } httpresponse resp = httpclient.execute(del); string respstr = entityutils.tostring(resp.getentity()); if (!respstr.equals("true")) ;

Domain-drive-design vs. Command pattern — mutually exclusive? -

tl;dr: command-pattern's small, focussed classes such setprojectasactivecommand ddd's approach of making models responsible own core business functions, such calling project::setasactive() . can 2 ideas work together, or mutually exclusive architectures? / tl;dr i've been working on project last few months in we've been using command pattern, has classes proposenewprojectcommand , setprojectasactivecommand , , addcommenttoprojectcommand , of handled command bus. these classes tend small , focussed, doing 1 thing. recently i've been reading domain-driven-design (ddd) , gather that approach relies more heavily on models doing work themselves, commands above might replaced organisation::proposenewproject() , project::setasactive() , , project::addcomment() . having these methods on models means can act 'aggregate roots' (eg. in examples above, project responsible creating own comments) . whilst idea of making entities have more responsibility

Wordpress widget - backend button online/offline -

hi developers — hope there clever brain in here can help. i have simple feature want implement site without wp backend experience. it "live chat on / off" widget/button must visible operators in dashboard. it’s purpose change line in header.php / or change stylesheet changing picture in frontend of website “offline" "online”. don’t have experience in backend wp, doing website templates changes css. i’ve made simple “widget” in backend - it’s wysiwyg editor button. http://pasteboard.co/2anhvpca.png thanks in advance. therefore implement plugin , brings along widget showing offline or online status on website's frontend. as plugins can have settings page , options offline/online functionality saved, shouldn't problem access option field in widget. have @ wp-live-chat-support , it's screenshots, 1 caption settings page of wp live chat support .

lotus notes - How to use an InputBox with a table - Domino Designer -

i create button opens inputbox, user inputs message, , create table there name & message in, on same form. is possible in domino designer? formula? lotusscripts? not knowing proper use case, , expecting more 1 user able click button single document, let me recommend different solution: i tend solve these using simple multi value text field, make computed when composed. if user enters message append (or prepend) new line list field in [lothar mueller, 2015-05-01 15:00:01]: message

regex - Subset all 3 digit numbers and collapse them with a separator in a data frame. R -

i'm formating data set each entry has adegenet format codominant markers, such as: loci1 ###/### 208/210 200/204 198/208 where # represents digit (the number allele size in basepairs). data has homozygous entries (all 3 digit integers no separator) have the form of: loci1 ### 208 198 i intend paste 3 digit string sep='/' produce first format. i've tried use grep subset these homozygous entries finding non ###/### , negating match using table matching such as: a <- grep('\\b\\d{3}?[/]\\d{3}', score$loci1, value =t ) # subset ###/###/ score[!(a %in% 1:nrow(score$loci1)), ] # works on vectors... after subset paste . problem arises when apply data frame. grep seems treat data frame list (which in part is) , returns columns have match. so in short how can go ### ###/### in data frame self contained example of data: score2 <- null set.seed(9) loci1 <- null loci2 <- null loci3 <- null (i in 1:5) loci1 <- append(loci1, pas

javascript - how to change stylesheets using 'onmouseover' and 'onclick' events? -

i want change style sheets permanently when function 'onclick' event called.. , 'onmouseover' event change style sheet long cursor stays on button.. in code, functions first 2 events work fine..but 'onclick' event's function doesn't work @ all.. can tell i'm doing wrong? n how can make work? here's code: <html> <head> <link id="theme" rel="stylesheet" type="text/css" href="css//main.css" > <script> function m1() { document.getelementbyid("theme").href= "style1.css"; } function o1(){ document.getelementbyid("theme").href= "css//main.css"; } function c1() { document.getelementbyid("theme").href="style1.css"; } </script> </head> <body> <div id="menu"> <ul id="br"> <li> select theme

android - Google Maps Cluster Item Marker Icon with Picasso -

Image
i'm using google map sdk 7.3.0 android-maps-utils 0.3.4 because need clusters markers on map. ok, here problem is, shouldn't have red marker. green+blue markers. subclassed defaultclusterrenderer create custom marker view doesn't work. i'm using picasso green icon because it's coming api. problem is, when picasso has loaded bitmap it's late, icon has been set default 1 (red). here's onbeforeclusteritemrenderer : picasso.with(getapplicationcontext()).load(item.url).into(new target() { @override public void onbitmaploaded(bitmap bitmap, picasso.loadedfrom from) { framelayout icon = (framelayout) layoutinflater.from(getapplicationcontext()).inflate(r.layout.marker, null); if (build.version.sdk_int >= build.version_codes.jelly_bean) { icon.findviewbyid(r.id.bg).setbackground(new bitmapdrawable(getresources(), bitmap)); } else {

javascript - Reload page js after database query in MVC -

i have such script: $(document).ready(function () { $('#requesttable').datatable( { aocolumns: [ { mdataprop: "datestart", stitle: "date start" }, { mdataprop: "dateend", stitle: "date end" }, { mdataprop: "approved", stitle: "approved" }, { mdataprop: "data", stitle: "employee" }, { mdataprop: "position", stitle: "position" }, { mdataprop: "", stitle: "" } ], columndefs: [{ targets: 'no-sort', orderable: false }] }); $('button.accept-button').click(function () { var id = $(this).attr('data-id') $.ajax({ type: "post", url: "/tablerequest/acceptrequest", data: { 'id': id

autolayout - Detecting iOS 8 Orientation change in UIView -

i detecting regular , compact size classes traitcollectiondidchange in ios8. i trying fit particular set of data horizontally across screen , not fit in horizontal class regular on portrait ipad mini there plenty of space in landscape. the problem horizontal sizeclass regular in portrait , landscape traitcollectiondidchange not fire , don't told orientation change. i have heard reference viewwilltransitiontosize not available in uiview. are apple saying not want ui layout diffs horizontal class regular - portrait , horizontal class regular - landscape? if it's ok how told, in uiview , orientation change? just add method -(void) layoutsubviews uiview subclass. called time view's dimensions change. don't forget call [super layoutsubviews] inside new method. then can check self.traitcollection.verticalsizeclass , self.traitcollection.horizontalsizeclass see you're looking at. -(void) layoutsubviews { [super layoutsubviews]; // co

Spring option create-session="never" is ignored in some scenarios? -

for web services want disable use of sessions. added create-session="never" config: <beans:bean id="http403entrypoint" class="org.springframework.security.web.authentication.http403forbiddenentrypoint"/> <http use-expressions="true" entry-point-ref="http403entrypoint" create-session="never"> <custom-filter ref="x509filter" position="pre_auth_filter"/> </http> this works cases, except when pre-authenticated user has client certificate not registered in application, our authenticationuserdetailsservice throws usernamenotfoundexception . if user has no certificate or has registered certificate, no session created (no set-cookie header in http response). in described case cookie sent. (the cookie respectively session) evaluated on each following request, if client certificate changed (basically allowing session fixation attack - app uses saved authentication instead

asp.net mvc - How mvc framework parse objects to JavaScript object? -

i pass data(refernce type or value type) in action function using viewbag or viewdata. the passed data(in viewdata or viewbag) assigned javascript variable on client side: var stuff = @viewbag.somedata; my question type of variable stuff be?is javascript object?or string?or maybe string in json format? thank in advance. what type of variable stuff be? javascript has types now? yes does , don't think question want answered. furthermore question lacks lots of detail exactly want do. data come from? want it? why want assign javascript variable? anyway, this: var stuff = @viewbag.somedata; will work if @viewbag.somedata contains number (depending on culture though) or object .tostring() representation valid javascript. razor has no notion of javascript. values print html-encoded. if viewbag.somedata contains number, html go this: var stuff = 42; when it's decimal , culture uses comma that: var stuff = 4,2; if contains string, it'l

How can i write this query in MySql? -

i have table: question_id | user_id | answer | weight 213 | 22 | 25 | 50 213 | 106 | 75 | 50 216 | 22 | 100 | 50 216 | 106 | 0 | 50 i want write mysql query calculate, 2 specified user_id 's: user1's weight * (user1's answer - user2's answer) and sum values question_id 's. so, example above, if user1 's id 22 , user2 's id 106: 50*(25-75)+50*(100-0)=2500 you can self join: select sum(u1.weight * (u1.answer - u2.answer)) total table u1 join table u2 on u2.question_id = u1.question_id u1.user_id = 22 , u2.user_id = 106 make sure column types not "unsigned", otherwise, you'll need cast values signed.

c# - How can I make WPF instantiate a custom control in my view, using another custom control base class in my XAML? -

i have listview 5 columns: <listview x:name="fieldlist" itemssource="{binding monitorfield}" selecteditem="{binding field}" margin="33,22,87,209" grid.column="1" grid.rowspan="2"> <listview.view> <gridview> <gridviewcolumn width="140" header="field name"> <gridviewcolumn.celltemplate> <datatemplate> <textbox width="127" text="{binding id}" height="32" fontsize="16" isreadonly="false" background="transparent" borderthickness="0" textwrapping="wrap"/> </datatemplate> </gridviewcolumn.celltemplate> </gridviewcolumn> <gridviewcolumn width=&qu

regex - SED script not matching single in Multiline pattern after line breaks -

i trying produce sed script converts &&a_x* &&b_x;cx &&d_x* into a_x ax b_x cx d_x dx a * should trigger duplication removed _ , ; simple linebreak. i have sed script first inserts linebreaks (including operation ; ) , executes multiple line pattern duplication without _ . the multiple line pattern works if move seperate script file , pipe output of instructions executing linebreaks. for strange reason single script file won't - want maintenance reasons. here's combined version: #!/bin/sed -f # remove whitespaces s/\ //g # linebreak on && s/\&\&/\ \&\&/g ### linebreak on ; s/\;/\ /g # remove new line s/\n// :extendvars /^..*\*$/ { l //debug switch h s/\(\&\|\*\)\(\&\|\*\)*//g p g s/\(\&\|_\|-\|\*\)\(\&\|_\|-\|\*\)*//g p d bextendvars; } the debug switch 'l' in first line of multiline pattern should match lines endin

xml - continue test after assertion fail using xmlrunner and unittest in python -

i writing simple test using xmlrunner , unittest in python. when using assert test fails , not continue. want test continue end , fail. possible? attach simple code demostrating need do. import xmlrunner import unittest class testexp(unittest.testcase): def setup(self): self.list = range(1,10) def test_example(self): in self.list: self.asserttrue(i == 3, str(i) + "message") if __name__ == '__main__': unittest.main( testrunner=xmlrunner.xmltestrunner(output='test-reports'), failfast=false, buffer=false, catchbreak=false) as output xml generated, containing first failed assertion, need run rest of assertions , generate test-reports them, when using try/except cannot see testcase fail in xml file. <?xml version="1.0" ?> <testsuite errors="1" failures="0" name="testexp-20150429152621" tests="1" time="0.000"> <testcas

shell - Subshell created using (...) behaves differently from bash -c '...' -

i use set -e inside (...) on command line doesn't exit subshell when false command executed. code 1: ( set -e; echo "$bashpid: start"; false; echo "foobar"; date; ) && echo "$bashpid: ok" || echo "$bashpid: nope" 9136: start foobar wed, apr 29, 2015 7:14:24 pm 7292: ok however if use bash -c subshell creation behaves expect. code 2: bash -c 'set -e; echo "$bashpid: start"; false; echo "foobar"; date;' && echo "$bashpid: ok" || echo "$bashpid: nope" 7880: start 7292: nope interestingly if remove && , || part after subshell (...) behaves fine. code 3: ( set -e; echo "$bashpid: start"; false; echo "foobar"; date; ) 5940: start so conclusions getting are: (...) behaves differently bash -c (...) && false behaves differently (...) , changes behavior of subshell well. am making obvious mistake in interpret

sharding - why elasticsearch not allowing to take snapshot without primary shards..? -

my elasticsearch having 1 cluster , 1 node. in have 1 index have shards 2,4. because of unable take snapshot getting primary shards not available. is there way take snapshot out primary shards..? and why elasticsearch index having 2,4 shards..? happened 0,1,3 please me

c - "undefined reference to `_cmocka_run_group_tests'" when running sample CMocka test -

i installed cmocka testing framework , tried sample code : #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmocka.h> /* test case nothing , succeeds. */ static void null_test_success(void **state) { (void) state; /* unused */ } int main(void) { const struct cmunittest tests[] = { cmocka_unit_test(null_test_success), }; return cmocka_run_group_tests(tests, null, null); } but when try compile following error: $ gcc -o tests tests.c /tmp/ccbwaxrr.o: in function `main': tests.c:(.text+0x5e): undefined reference `_cmocka_run_group_tests' collect2: error: ld returned 1 exit status what missing? including header files provides forward declaration of functions. function definitions, need link library. you can use -l option gcc link required libarary. may need use -l option provide path library.

c# - Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to NULL -

here function add row in db: public static void insertnote(string title, string text, int languageid) { var dbo = new userscontext(); models.noteform note = new noteform { text = text, title = title, languageid = languageid, userid = websecurity.currentuserid }; dbo.note.add(note); dbo.savechanges(); } and model used: public class noteform { [required] [stringlength(100, errormessage = "the {0} must @ least {2} characters long.", minimumlength = 6)] [display(name = "title")] public string title { get; set; } [required] [display(name = "text")] public string text { get; set; } [required] [display(name = "language")] public int languageid { get; set; } [foreignkey("id")] public virtual language language { get; set; } [key] public int id { get; set; } public

calendar - How to format date-time for RFC2445 in PHP -

i working on google calendar api using php library , need set recurring event have create rrule string should of following format: rrule:freq=weekly;until=20110701t170000z i unable create date in above format. literally tried methods like: date('ymdhis'); date(date_rfc2822); date('c'); but google doesn't accept of above formats. need make like: 20110701t170000z. can me on this? thanks this date format: date('ymd\this\z') becomes 20150429t154315z look @ examples here: http://php.net/manual/de/function.date.php

tomcat - Which servlet-api jar should I use for my cometd filter -

i using cometd 3.0.1 , trying deploy in tomcat 7.0.50. have filter created, using jetty jar (9.2.2) compile these filter classes, after move jetty jar should include in class path. i want jar don't need regenerate war every time move 1 container other. can include servlet api jar directly jdk (i unable find jar in jdk). using java 8. the documentation home page of tomcat 7 says: apache tomcat version 7.0 implements servlet 3.0 , javaserver pages 2.2 specifications so, need 3.0 version of servlet api. the servlet api not part of java se. it's part of java ee. won't find in jdk. need jar compile code. note whether use jetty or tomcat doesn't change anything: jar provided servlet container, must not inside war file. can find jar tomcat uses in lib directory of tomcat.

function - Is there a way to pass auto as an argument in C++? -

is there way pass auto argument function? int function(auto data) { //does } if want mean can pass type function, make template: template <typename t> int function(t data); there's proposal c++17 allow syntax used (as c++14 generic lambdas), it's not standard yet.

r - Inserting NA after Test -

i have list full of of data.frames 2 columns, time , signal. data.frames results of gc chromatographic analysis process periodically sampled. i want compare gc data i've collected. i've written function convert times , peak areas percentage areas (excluding solvent peak) , relative retention times. due nature of process, different gcs have differing numbers of peaks , therefore comparison isn't straightforward. impurities appear @ different parts of process , hence give peaks. i want go on list , find longest vector of relative retention times (no problem). want use longest vector comparator , place na values @ relative retention times appear @ same time comparator not appear in other data.frames. hence results of following list of relative retention times, prac <- list(a=c(0.203,0.305,0.444,0.780,1.000,1.101,1.403), b=c(0.201,0.306,0.442,0.778,1.000,1.101,1.208,1.401)) where b comparator vector, should like 0.203 0.305 0.444 0.780 1.000

ruby - Replace all colon character that does not occur after specific word pattern -

for given text pack: box five: dozen: liquor: jugs ::: : i want replace : ; occur after words ack , zen. output expect here is pack: box five; dozen: liquor; jugs ;;; ; note : after ack , zen untouched whereas else replaced. please me. able match (ack|zen): . giving me matches ack: , zen: . dont know how negate , construct regex. note: using ruby. you can use negative look-behind here , use gsub : puts "pack: box five: dozen: liquor: jugs ::: :".gsub(/(?<!ack|zen):/, ";") ideone demo results: pack: box five; dozen: liquor; jugs ;;; ; you can use look-behind here because both parts of same size (3 chars).

xml - XSLT Transformation of Dates -

i'm struggling xslt deal columns of dates data mix of dates , blanks. data exported filemaker, know column types, , whilst (with elsewhere) have been able deal currency formatting , applying formatted headings, cannot work data 1 or more date columns present. i've output data xml it's apparent i'm starting with: <?xml version="1.0" encoding="utf-8" ?> <fmpxmlresult xmlns="http://www.filemaker.com/fmpxmlresult"> <errorcode>0</errorcode> <product build="01-09-2015" name="filemaker" version="server 13.0v9"/> <database dateformat="d/m/yyyy" layout="" name="my_app.fmp12" records="528" timeformat="k:mm:ss "/> <metadata> <field emptyok="no" maxrepeat="1" name="d_clientname" type="text"/> <field emptyok="yes" maxrepeat="1" name="d_oraclecode"

c# - System.ObjectDisposedException throwed on WebSocket communication -

i'm trying communicate between web browser client , asp.net server using websockets. i make set of requests, of different sizes , seconds of elapsed time between each of them. 3 first ones pass correctly, precise one, nothing in particular other, close websocket connection, throw exception on server side. the error message , stack trace of exception : fatal error: cannot access disposed object. object name: 'system.web.websockets.aspnetwebsocket'. @ system.web.websockets.aspnetwebsocket.throwifdisposed() @ system.web.websockets.aspnetwebsocket.sendasyncimpl(arraysegment 1 buffer, websocketmessagetype messagetype, boolean endofmessage, cancellationtoken cancellationtoken, boolean performvalidation) @ system.web.websockets.aspnetwebsocket.sendasync(arraysegment 1 buffer, websocketmessagetype messagetype, boolean endofmessage, cancellationtoken cancellationtoken) @ [my code path here...] it may threading problem, because i'm using a

Use DLL with python and ctypes -

i use dll (imagesearch.dll) python project. developped autoit. here au3 file: func _imagesearcharea($findimage,$resultposition,$x1,$y1,$right,$bottom,byref $x, byref $y, $tolerance) ;msgbox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if $tolerance>0 $findimage = "*" & $tolerance & " " & $findimage $result = dllcall("imagesearchdll.dll","str","imagesearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findimage) ; if error exit if $result[0]="0" return 0 ; otherwise x,y location of match , size of image ; compute centre of search $array = stringsplit($result[0],"|") $x=int(number($array[2])) $y=int(number($array[3])) if $resultposition=1 $x=$x + int(number($array[4])/2) $y=$y + int(number($ar