Posts

applescript - Javascript to fill a formatted text field on a web site -

i know virtually nothing javascript. monkey-see, monkey-do approach i’ve managed use javascript within applescript/safari fill text fields on web-site using following command: do javascript "document.getelementbyid('elementid').value ='texttoenter';" in document 1 i’ve been able enter text fields except one. fields work labeled input type="text” . field doesn’t work complex in entered text can formatted (bold, italics, underline, alignment, etc.) after entry. assuming i’ve identified correct source code element looks follows prior text entry: <body id="tinymce" class="mce-content-body " onload="window.parent.tinymce.get('fax_text').fire('load');" contenteditable="true" spellcheck="false"><p><br data-mce-bogus="1"></p></body> depending on how viewed, p , br tags appear on separate lines otherwise identical. after manual entry of tex...

excel vba add hyperlink to shape in group -

i have absolutely no idea why cannot add hyperlink shape if trigged in-cell function. when run manually immediate window, working well. don't have troubles doing manually. i have no idea how write error handling in vba this sample code. function testcase(xllabelname string) dim sht worksheet each sht in activeworkbook.sheets if shapeexist(sht, xllabelname) sht.hyperlinks.add anchor:=sht.shapes(xllabelname), address:="", subaddress:="a1" testcase = "bingo" end if next sht end function from immediate window bingo answer , in cell #arg! error , line not executed. tried ungroup shapes first using dim gshp shape dim shrng shaperange dim tmp string set gshp = sht.shapes(getparentshape(xllabelname)) tmp = gshp.name set shrng = gshp.ungroup sht.hyperlinks.add anchor:=sht.shapes(xllabelname), address:="", subaddress:="a1" shrng.regroup shrng.name = tmp but failed. , still im...

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

i using angular ionic. i not want user have login again in case logged in , did not logout last time used application. reason, using local storage check if user logged in. tried putting code in run block. $rootscope.$on('$statechangestart', function (event, tostate, toparams, fromstate, fromparams) { if($localstorage.userinfo){ $state.go('deployment'); //this line 270 of app.js event.preventdefault(); return; } }) but gives error says: rangeerror: maximum call stack size exceeded @ scope.$broadcast (ionic.bundle.js:23414) @ object.transitionto (ionic.bundle.js:40804) @ object.go (ionic.bundle.js:40671) @ app.js:270 @ scope.$broadcast (ionic.bundle.js:23412) @ object.transitionto (ionic.bundle.js:40804) @ object.go (ionic.bundle.js:40671) @ app.js:270 @ scope.$broadcast (ionic.bundle.js:23412) @ object.transitionto (ionic.bundle.js:40804) also, error: [$rootscope...

sql server 2008 - Delete all records from a table except latest N months records (sorted by id) -

Image
can please me in solving this. need keep latest 3 months records in table. table structure: after purge table should try this: delete tablex inner join (select max(insertdt ) lastdate, id tablex group id) lastdates on lastdates.id = tablex.id insertdt < dateadd(m,-3,lastdates.lastdate)

How to make a python source code edit it self -

i writing program countries around world. i want add feature user add own country, modifying source code. this current source code written in python 3.0.1: # -*- coding: utf-8 -*- print "bem vindo um programa educativo sobre os variados paises mundo, creado por tomas simoes, 2015" contry = raw_input("qual e o pais que desejas visitar? - ") if contry == "afeganistao": print "o que desejas saber sobre o/a", contry,"?" print "1 - cultura" print "2 - linguagem" print "3 - historia" print "4 - localizacao" contry_spec = raw_input(" : ") if contry_spec == "1": print "nao sei muito sobre cultura do/a", contry,",desculpa!" elif contry_spec == "2": print "a linguagem do/a", contry,"e pachto e dari." elif contry_spec == "3": print "nao sei muito sobr...

Unable to execute FxCop rules with MSBuild SonarQube Runner -

we facing issues while analyzing .net projects using sonarqube 5.1.1. please note fxcop rules enabled @ quality profile level. we using msbuild sonarqube runner analyze projects. facing error says sonar.cs.fxcop.assembly must set. we have faced similar issue sonar-runner-2.4 @ time parameter can passed sonar-project.properties file. but sonar-runner not support .net projects, using msbuild sonarqube runner now. could kindly confirm how can avoid these issues msbuild sonarqube runner , execute fxcop rules on .net projects? c# plugin version 4.1. please let me know if further information needed our end. we have postponed our production sonar upgrade due issue project teams not ok disabling fxcop rules @ quality profile level. kindly in fixing this. thanks, sri priyanka i thinks should read http://www.sonarqube.org/easy-analysis-of-visual-studio-solutions-with-the-sonarqube-scanner-for-msbuild/ , http://docs.sonarqube.org/display/plug/c%23+plugin . pay...

Copy constructor with different struct in c++ -

how initialize ptype2 copy ptype3 struct (type-conversion)? typedef struct ptype2 { double x, y; ptype2() : x(0), y(0) {} ptype2(const ptype3 & ptype3) : x(ptype3.x), y(ptype3.y) {} //abort ptype3.z create two-dimensional point ptype2(double xy) : x(xy), y(xy) {} ptype2(double x, double y) : x(x), y(y) {} } ptype2; output: error c2065: 'ptype3' : undeclared identifier error c2143: syntax error : missing ',' before '&' error c2228: left of '.a' must have class/struct/union error c2228: left of '.b' must have class/struct/union error c2664: 'ptype2::ptype2(const ptype2 &)' : cannot convert argument 1 'ptype3' 'const int' error c4430: missing type specifier - int assumed. note: c++ not support default-int i have 2 typedef struct , ptype2(double x, double y) , ptype3(double x, double y, double z) . an assignment operator overloading solve problem? the compiler can'...

Windows 8.1 universal app crashes on Windows 10 -

my app published in store, built on windows 8.1 , works on 8.1 (desktop , tablet). crashes on windows 10 after navigate page has webview control (though might not reason). looked @ windows logs (eventvwr.msc) , found out crash has happened in system library. has faced problems windows 8.1 apps running on windows 10? update 1: information system's event log faulting application name: .... faulting module name: twinapi.appcore.dll, version: 10.0.10240.16397, time stamp: 0x55af0938 exception code: 0xc000027b fault offset: : 0x0001cab9 faulting process id: 0xe30 faulting application start time: 0x01d0daabb7ab6d89 faulting application path: c:\program files\windowsapps..... faulting module path: c:\windows\system32\twinapi.appcore.dll faulting package full name: .... faulting package-relative application id: app update 2 of article debugging windows 8.1 store app crash dump i've cracked crash dump , found out problem method in code. method has code captures scree...

php - Online Editor for HTML CSS and Javascript -

i need editor html,css , javascript can integrate php. my project related decorating album, user can select pre defined templates , can change css html , javascript of template. please me out in there many publishers such, particularly netbeans . with can edit projects in php syntax recognition html, javascript , css, among others.

php - Mysql insert in two tables where the first table has foreign key and update the first table -

this have in db if insert in bmw car brands example.how update id_make whith id bmw sql.(i know huge mess in code , no aligment) http://i.stack.imgur.com/gqqg1.png this form: <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">add car:</h4> </div> <div class="modal-body "> <form action="index.php?page=carlist" method="post" autocomplete="off"> <div class="form-group"> <label for="marca">marca:</label> <!-- <input type="text" class="form-control" name="marca" placeholder="marca" data-toggle="modal" data-target="#marca"> --> ...

java - Accessing content of ByteArray without JNI GetByteArrayElements -

i investigating more efficient way of accessing content of bytearray through jni without ugly getbytearrayelements. seeking knowledgeable jni experts explain seeing , possibly solution. my test function jniexport void jnicall java_analyizer(jnienv *env, jclass cls, jbytearray bytes, jint bytes_len, jlong addr,jint limit) { jbyte *elements = (*env)->getbytearrayelements(env, bytes, false); char * e = (void *) elements; char * f = (void *) bytes; char * o = (void *) (uintptr_t) addr; printf("%d %d\n", e,f ); hexdump(e, (int) bytes_len); hexdump(f, (int) 500); hexdump(o, (int) limit); return; } void hexdump(void *addr, int len) { printf("hex address: %d len: %d\n", (uintptr_t) addr, len); int i; unsigned char buff[17]; unsigned char *pc = (unsigned char*) addr; // process every byte in data. (i = 0; < len; i++) { // multiple of 16 means new line (with line offset). if ((...

Add only 10 records using Java in Mysql -

i making application in java using netbeans. want admin can add 10 users record , after 10 users added in database admin not able add more users(my idea buttons disable after 10 users addition). using mysql record saving. fire count query on table. , use resultset restrict(validate, records<=10) before app(client) enters new value. or put constraint in schema design itself.

javascript - using jQuery to switch background position every 250px -

im new jquery , not sure best way change background position, need change background position every 0 -250px, 0 -500px etc... know best way this? cheers js: function startavataranimation() { var avatarheight = 250; var avatartotalheight = 2750; var = 0; var avatarspeed = 1000; setinterval(function(){ i++; if(i > avatararray.length){ = 0; } $(".avatars").css({'background-position' : '0 -' + (i*avatarheight) + 'px' }); }, avatarspeed); } html: <div class="avatars"></div> im getting error @ moment avatararray not defined, first attempt hope ok. guess needs work out height knows when stop well? thanks again fixed following solution: function startavataranimation() { var avatarheight = 250; var avatartotalheight = 2750; var = 0; var avatarspeed = 500; var avatararray = {}; setinterval(function(){ i++;...

sql - NVL faster than is not null condition? -

i asking myself if nvl funtion faster not null condition. searched on google if talk found nothing respond @ question. so here's situation have sql request , want know faster. in example simplify query have it's give idea of want know. here's request nvl function select ta.mnt tablea ta ta.id not in(select nvl(tb.id,-1) tableb tb); here's not null condition select ta.mnt tablea ta ta.id not in(select tb.id tableb tb tb.id not null); so 1 return faster? they're not same logic. consider start null, 0, 1 in tableb . - nvl version changes -1, 0, 1 - where not null changes 0, 1 . this means not in has fewer items check in where not null , that's why can faster. that said, using not in not fastest. 2 standard options left join , not exists . select tablea.* tablea left join tableb on tableb.id = tablea.id tableb.id null select tablea.* tablea not exists (select * tableb tab...

javascript - RxJS bufferWithCount() not pausing for timeout -

i trying control inflow slow subscriber. tried below in nodejs var xmlnodestream = rx.observable.from([1,2,3,4,5,6,7,8,9,10,11]); var commjson = xmlnodestream.bufferwithcount(2).publish(); var fastsubscriber = commjson.subscribe( function (x) { console.log('----------\nfastsub: onnext: %s', x); }, function (e) { console.log('fastsub: onerror: %s', e); }, function () { console.log('fastsub: oncompleted'); }); var slowsubscriber = commjson.subscribe(function (x) { settimeout(function () { console.log("============\nslowsub called: ", x); }, 5000); }); commjson.connect(); when run above code , expect slow subscriber pause 5 seconds everytime before next data-batch received. but not happening. after initial 5 second delay, data flooded slowsubscriber in batches of 2. what right way control inflow slow subscibers can take time (and preferably fast ones can wait slow ones complete) ? it isn't pausing bec...

c# - What events to handle in DataGridView for inline update / add / delete? -

essentially want user experience can go dgv , edit data (ie click cell, type stuff, hit enter), , have go database. can handle sql side, events should handle can figure out if user has done add, delete, or update? thanks. string lastcelltext; textbox textbox; private void datagridview1_editingcontrolshowing(object sender, datagridvieweditingcontrolshowingeventargs e) { if (e.control textbox) { textbox = e.control textbox; textbox.textchanged += textbox_textchanged; } } void textbox_textchanged(object sender, eventargs e) { //your actions } private void datagridview1_cellendedit(object sender, datagridviewcelleventargs e) { if (textbox.text ==string .empty ) { //do delete } if (textbox.text != lastcelltext) { //if textbox.text in database update else add } lastcelltext=textbox.text; textbox.textc...

How to upload thumbnail image for ios rss feed table cell from xml feed -

almost finished rss app need create work. still new xcode , have tried many different open source code's available out there. found 1 more suited needs last thing need thumbnail images work table view cells. articles title , description in cells load fine, when tried re-write code image comes blank. the project made work google news rss : https://news.google.com/?output=rss . rss using : http://www3.westchestergov.com/home/all-press-releases?format=feed&type=rss now, part of code believe deals image downloading table view cells : override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) as! uitableviewcell let newsitem = rssdatalist[indexpath.row] cell.imageview?.image != nil cell.textlabel?.text = newsitem.title cell.detailtextlabel?.text = newsitem.summary // use cached image or do...

python requests module - set key to null -

from requests documentation : remove value dict parameter sometimes you’ll want omit session-level keys dict parameter. this, set key’s value none in method-level parameter. automatically omitted. i need data key's value none take json value null instead of being removed. possible ? edit : seems happen request data keys. while not session-level behaviour of removing still same. there no session-level json parameter, merging rules don't apply. in other words, json keyword argument session.request() method passed through unchanged, none values in structure not result in keys being removed. the same applies data , there no session-level version of parameter, no merging takes place. if data set dictionary, keys value set none ignored. set value '' if need keys included empty value. the rule apply when merging headers , params , hooks , proxies .

c# - ConfigureAwait(true) is working only on 4.6 -

i ran following code on dot net framework 4.5, 4.5.1, 4.5.2 , 4.6 public async task<int> printculturesasync() { thread.currentthread.currentuiculture = new cultureinfo("en-in"); console.writeline(thread.currentthread.managedthreadid); console.writeline(thread.currentthread.currentuiculture); await somemethod().configureawait(true); console.writeline(thread.currentthread.managedthreadid); console.writeline(thread.currentthread.currentuiculture); return 1; } i observed on framework 4.6, c onfigureawait(true) working , showing same culture after await somemethod().configureawait(true) called. not supported on 4.5, 4.5.1 , 4.5.2 ? that new feature in .net framework 4.6 see: task class (system.threading.tasks) starting desktop apps target .net framework 4.6, culture of thread creates , invokes task becomes part of thread's context. is, regardless of current culture of threa...

regex - PHP: Splitting a large string by certain characters in as large chunks as possible -

i implementing google translation api , take 5000 characters @ time, need split larger documents smaller ones , send multiple api requests. i need therefore split content chunks long possible (but less 5000) , has been split, not in middle of sentence make translations difficult process google. i therefore give method array of characters should when splitting. </div> </p> </section> </blockquote> </br> . (dot space) what approach this? regexp greedy default. .{0,4980}(\<\/div\>|\<\/p\>|\<\/section\>|\<\/blockquote\>|\<\/br\>|\.\s) should give longest string ending 1 of delimiters.