Posts

Showing posts from January, 2010

parallel processing - MPI_TEST: invalid mpi_request -

i want test if mpi_isend , mpi_irecv have run fine. i have 2 request(argument) vectors: 1 vector mpi_isend, other mpi_irecv. the point program runs fine until started run cycle mpi_test. have tried 2 numbers (do i=1,2), still same error. fatal error in pmpi_test: invalid mpi_request, error stack: pmpi_test(166): mpi_test(request=0x7fff93fd2220, flag=0x7fff93fd1ffc, status=0x7fff93fd2890) failed pmpi_test(121): invalid mpi_request integer :: ierr, myid, istatus(mpi_status_size), num, i, n integer,parameter :: seed = 86456, numbers=200 integer :: req1(numbers), req2(numbers) logical :: flag call mpi_comm_rank(mpi_comm_world, myid, ierr) if (myid==0) n=1, numbers req1(n)=0 req2(n)=0 num=irand() call mpi_isend(num,1,mpi_integer,1,1,mpi_comm_world,req1(n),ierr) call mpi_irecv(best_prime,1,mpi_integer,1,0,mpi_comm_world,req2(n),ierr) end else if (myid==1) i=1, numbers call mpi_test(req2(i),flag,istatus,ie

Breeze - not return changes introduced in BeforeSaveEntities to client? -

i struggling find solution conceptual problem re beforesaveentities. in short, want avoid server informing client entity deletions introduce in savemap in beforesaveentities. the longer story follows below :-) data structure: have entity called primarydata, has parallel loosely coupled entities called secondarydata. each primarydata, there exists number of secondarydata's. business logic: whenever user deletes primarydata on client, server should delete related secondarydata. security requirement: client should not informed secondarydata's have been deleted. implementation: have implemented beforesaveentities function, catch deletion of primarydata, , add additional entityinfo's secondarydata's want delete savemap. things work expected. both primarydata , secondarydata's deleted. problem: unfortunately, xhr shows return package client includes secondarydata's have been deleted. violates security requirement above, client should not told

javascript - Send request on unload and/or beforeunload doesn't work on mobile? -

i know issue has been answered on cannot make work on mobile browsers. i need send request server when web page closed (tab or window closed). here do: window.addeventlistener("unload",function(e) { var pl = "bla=blabla"; var req = new xmlhttprequest(); req.open("post","http://myapi/myendpoint",false); req.setrequestheader("content-type","application/x-www-form-urlencoded"); req.send(pl); },false); window.addeventlistener("beforeunload",function(e) { var pl = "bla=blabla"; var req = new xmlhttprequest(); req.open("post","http://myapi/myendpoint",false); req.setrequestheader("content-type","application/x-www-form-urlencoded"); req.send(pl); },false); this works fine on desktop (chrome , firefox) if page either refreshed or tab/window closed. on mobile, works w

maven - Artifactory: Deploying Snapshots with Ant -

Image
i deploying artifacts ant build artifactory using these targets: <project name="myapp" default="main" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> . . . <path id="maven-ant-tasks.classpath"> <fileset refid="maven-ant-tasks.fileset" /> </path> <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> <target name="define-artifact-properties"> <property name="artifact.group" value="my.org" /> <property name="artifact.name" value="myapp" /> <property name="artifact.version" value="1.9.0-devel.snapshot" /> <property name="artifact.type" value="jar" /> <property name="artifact.dir" value="${build.

android - Dynamically put values to a text view in a Layout and put that layout inside another layout. -

i tried , getting java:null pointer exception @ line try put 1 layout another. this mainactivity.java: import java.util.arraylist; import java.util.set; import android.os.bundle; import android.app.activity; import android.content.context; import android.content.sharedpreferences; import android.content.sharedpreferences.editor; import android.view.layoutinflater; import android.view.menu; import android.view.view; import android.widget.spinner; import android.widget.tablelayout; import android.widget.textview; public class mainactivity extends activity { private sharedpreferences sp; private tablelayout enterstocktablelayout; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); arraylist<itemdata> list= new arraylist<itemdata>(); list.add(new itemdata("indian rupee",r.drawable.india)); list.add(new itemdata("us dollar",r.drawable

Spring integration DSL creating Sftp OutBound Adapter in java 1.7 -

i have created sftp outbound flow in spring dsl have created 1 more file inbound flow on top of sftp outbound flow files local directory , send message channel responsible copying file remote directory when running code no file getting copied in remote directory. getting stuck in point, can 1 please provide pointer not able proceed. this session factory... @autowired private defaultsftpsessionfactory sftpsessionfactory; @bean public defaultsftpsessionfactory sftpsessionfactory() { defaultsftpsessionfactory factory = new defaultsftpsessionfactory( true); factory.sethost("111.11.12.143"); factory.setport(22); factory.setuser("sftp"); factory.setpassword("*******"); return factory; } this sftp outbound flow.. @bean public integrationflow sftpoutboundflow() { return integrationflows .from("tosftpchannel")

javascript - d3 - drag node groups in radial tree layout without jumping to new position on click -

following on this question , i'm trying drag nodes (containing groups of circles , text) combined units without them first jumping new position when click. i've tried implementing suggested technique radial tree layout ( jsfiddle ) hitting wall. suspect because radial layout using different x,y system usual x,y system. i've been trying work rotate var drag can't quite seem crack it. should focusing? thanks. var drag = d3.behavior.drag() .on("drag", function(d,i) { d.x += d3.event.dx d.y += d3.event.dy d3.select(this) .attr("transform", function(d,i){ return "translate(" + d.x + "," + d.y + ")" }) }); it because of different x,y transforms used in radial view. changed drag function normal x,y coordinates var drag = d3.behavior.drag() .on("drag", function(d,i) { var translatecoords = d3.transform(d3.select(this)

c++ - How to give a member function as a parameter? -

i struggling c++ templates, functions , bind. let's class a : class { void set_enabled_for_item(int item_index, bool enabled); void set_name_for_item(int item_index, std::string name); int item_count(); } i create method in a : template <typename t> void set_for_all_items(t value, ??? func) { auto count = trackcount(); (auto = 0; < count; ++i) { func(i, value); } } so call member function of in parameter, (or this) : auto = new a; a->set_for_all_items("foo bar", &a::set_name_for_item); the 3 ??? type of second paramter. since i'm pretty new std::function, std::bind , templates, tried knew use got compilation errors. so how ? the syntax standard member function ret (class::*) (args...) . in case, might (untested): template <typename t, typename arg> void set_for_all_items(t value, void (a::* func) (int, arg)) { auto count = trackcount(); (auto

c# - Migration failed for upgrading data solution to VS2013 -

when try open datasolution in vs2013, tries migrate because error these projects either not supported or need project behavior imacting modifications open in version of visual studio. i can one-way upgrade unfortunately fails error message the application project type based on not found. visual studio needs make non-functional changes project in order enable project open in visual studio 2013, visual studio 2012, , visual studio 2010 sp1 without impacting project behavior. has encountered error before , knows how fix it?

asp.net c# website form actions after 24 hrs -

i have asp.net c# website members complete form stored in sql server. after 24 hrs, send notification specific group of users if form status has not changed. achievable within asp.net?? appreciated i have done several times , there many ways it. 1 simple way check every x minutes if need send notifications. if so, send them. for example: every 60 minutes check if there forms have been on same status 24hs. if so, send notification. if have full control of server, recommend create windows service perform job. asp.net not built long running tasks that's why i'm suggesting create windows service. one more thing, create log table task every time send notification, add row on table. that's gonna debug issues might have. also, remember mark rows have notified customer avoid sending notification twice. add double check before sending notification.

android - ShowCaseView Target from another Layout -

my main activity inflate activity_main.xml setcontentview(r.layout.activity_main); in activity main have recyclerview view: <android.support.v7.widget.recyclerview android:id="@+id/readlist" android:scrollbars="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/layoutlistarspiner" android:layout_alignparentstart="true" /> for recyclerview items have layout, recycleritemlist inflated adapter: public mycustomholder oncreateviewholder(viewgroup viewgroup, int i) { view itemview = layoutinflater. from(viewgroup.getcontext()). inflate(r.layout.recycleritemlist, viewgroup, false); return new mycustomholder(itemview); } and inside recyclerviewlist have imagebutton want set showcaseview point: <imagebutton android:id="@+id/status" android:layout_width=&qu

php - Non existent pages to error page htaccess file -

i trying write rewrite rule return 404 on urls spam parameters. used following rewrite tool return error 404 query string voxter.pdf&gpvoq , parameters gpvoq not producing 404 error. rewritecond %{voxter.pdf&gpvoq} (^|&)parm1=gpvoq [nc] rewriterule (.*)/error-404.php? [r=404,l] can u please me mistake doing? %{voxter.pdf&gpvoq} isn't apache variable. match literal. need using %{query_string} variable instead: rewritecond %{query_string} (voxter.pdf|gpvoq) [nc] rewriterule ^ /error-404.php? [r=404,l] or similar regex.

jsf - Previous pagination not working - Extended Data Table component -

i have following code: <h:body> <h:form> <h:panelgrid columns="1" styleclass="er"> <h:panelgrid columns="2" styleclass="benutzer"> angemeldet als <h:outputlabel value="#{logincontroller.email}" /> </h:panelgrid> <f:facet name="header"> <h:outputtext value="Ãœbersicht"/> </f:facet> <rich:extendeddatatable value="#{maincontroller.bishererfasst}" var="erfasst" style="table-layout:fixed;" rows="5" id="table" styleclass="table" rowclasses="odd, even"> <f:facet name="header">bisher erfasst</f:facet> <rich:column> <f:facet name="header"> <h:outputtext value="id" /> </f:facet>

powershell - Reading the output of a variable -

alright, i'm writing code mass user creation in active directory. code has automatically create user names well. import-csv c:\users\myname\desktop\test\test.csv | % { $firstname = $_.firstname $middleintial = $_.middleintial $lastname = $_.lastname $username = $firstname.substring(0,1).tolower()+$middleintial.tolower()+$lastname.tolower() $testname = (get-aduser $username) if($testname - $error){ write-host $username } } what i'm trying verify user name unique before code continues actual creation part. after running get-aduser , can test value of $? see if last statement executed successfully: $testname = get-aduser -filter "samaccountname -eq '$username'" if(-not $?){ # no users samaccountname $username found, go ahead }

spring - Change locale (language) but retain form data -

i'm using spring , thymeleaf present form on web-page. user can change language clicking button on page. send get request same page again, requested locale appended parameter, e.g. <a href="?locale=en_gb">british english</a> . i have requirement if user changes languages after filling in of form fields, entered values should maintained. i guess i'll have post form server, can repopulate form when re-renders page in new language. there standard spring/thymeleaf way this? i think i've got working using cookielocaleresolver localeresolver bean. then, when user clicks on button, set cookie , post form. <a onclick="document.cookie='mylocalecookie=en_gb'; $('#the-form').submit();>british english</a> i'd still interested know if there's better or more standard way of doing though.

Error in implementing Inheritance in javascript -

var old = {name:'abc',id:'3'}; new = object.create(old); alert(new.name); i trying run simple example not working. can wrong? edit : made mistake taking reserved keyword variable name, please dont kill me that. happens. the following makes sense : var parent = {name:'abc',id:'3'}; child= object.create(parent ); child(new.name); for other user landing here searching inheritance in javascript in javascript inheritance achieved linking object other shown above. when use variable, javascript engine search variable in current object , if not find it, linked object , value there. thanks. cheers!! new keyword. you need update from new = object.create(old); alert(new.name); to var x = object.create(old); alert(x.name);

SharePoint Images not rendered in custom email -

i sending out html e-mail event receiver hooked pages library. publishingpagecontent field filled html values doesn't render images when email sent outlook. this code below mailmessage message = new mailmessage(); message.to.add(new mailaddress("xxx@sharepoint.local", "recipient")); message.from = new mailaddress("xxx@sharepoint.local", "sharepoint test emailer"); message.isbodyhtml = true; message.subject = properties.listitem.title; message.body = properties.listitem["publishingpagecontent"].tostring(); smtpclient client = new smtpclient("192.168.10.0"); client.send(message); the code looks fine there's 2 areas check here: is there potentially rule on exchange server that's removing these? maybe client based settings blocking images? have checked value of listitem[&

hashmap - java Lock using MAP causing a deadlock -

i have written code 3 threads involved:- 1. thread1 -> decrements map created in main thread 2. thread2 -> responsible checking size of map, once 0, exit 3. thread3 -> starts work once size 0, waits till size 0. thread1 easy implement, thread2 , thread3 using reentrantlock. problem is, thread2 not breaking once size of map reaches 0 , therefore thread3 blocked forever. not sure, problem. appreciated. import java.util.hashmap; import java.util.map; import java.util.concurrent.locks.lock; import java.util.concurrent.locks.reentrantlock; public class mainclass { static map<string, string> map = new hashmap<string, string>(); public static void main(string[] args) { // todo auto-generated method stub map.put("key1", "valu1"); map.put("key2", "valu1"); map.put("key3", "valu1"); map.put("key4", "valu1"); ma

apache - HTTP Error when uploading pictures in Wordpress -

i 500 errors when uploading pictures in wordpress 4.2.2. on box running ubuntu 15.04 apache 2.4 , ispconfig3. server set according to: https://www.howtoforge.com/tutorial/perfect-server-ubuntu-15.04-with-apache-php-myqsl-pureftpd-bind-postfix-doveot-and-ispconfig/ everything working fine except when uploading pictures on size (~150 kb). server has both imagick , gd addons installed. php -v: php 5.6.4-4ubuntu6.2 (cli) (built: jul 2 2015 15:29:28) php -m: http://pastebin.com/ym4efv6b i have upped limits in php.ini upload size , post size, that's not problem. thanks in advance i added line maxrequestlen 15728640 to etc/apache2/mods-available/fcgid.conf in case others looking same. seems common problem, , lot of tricks solve using htaccess , plugins, 1 did me.

java - Selenium div attributes keep changing, how can I find this element? -

i trying find element selenium , java, problem element's id, class, , name increment not able find selenium. below trying: webelement field = driver.findelement(by.xpath("//input[contains(@linktext, 'broadcast copy')]")); in html file these attributes keeps changing: id="files[%2fopt%240%2frules%2f%2f000102%2.xml][%2fcluster%2fname]" name="files[%2fopt%240%2frules%2f%2f000102%2.xml][%2fcluster%2fname]" value="copy (cluster 102)" entire html <tbody> <tr class='rowodd'> <td><b>name</b></td> <td> <input type='text' data-validation='required validate-name-unique validate-name-not-empty' size='65' id='files[%2fopt%240%2frules%2f%2f000102%2fcluster.xml][%2fcluster%2fname]' name='files[%2fopt%240%2frules%2f%2f000102%2fcluster.xml][%2fcluster%2fname]' value='copy (cluster 102)' /> </td> these incremen

c# - Not able to display image and text side by side using float -

i want display image , text side side (image on left , text on right(which ordered using ). i achieved in .html page in visual studio for image div gave float: left , text div gave float:right i want achieve same passing html page code string variable , displaying ouput in webbrowser. eg: string html= @"<div style=""float:left""> <img src=""smiley.jpg"" alt=""smiley"" /> <div style=""float:right;font-family:calibri""> <h2>dispalying image , text</h2> </div> </div>" webbrowser1.documenttext = html; but here, image , text not displayed side side instead text displayed in next line. float:right not working expected here. how resolve this? you may this: <div style="float:left"> <img style="display:inline-block;vertical-align:middle" src="htt

Autocomplete in Solr is case sensitive -

i have implemented autocomplete component in auto complete becomes case sensitive.i have added following piece of code , works case sensitive.how make case insensitive. <searchcomponent name="suggest" class="solr.suggestcomponent"> <lst name="suggester"> <str name="name">mysuggester</str> <str name="lookupimpl">fuzzylookupfactory</str> <str name="dictionaryimpl">documentdictionaryfactory</str> <str name="field">name_s</str> <str name="weightfield">price</str> <str name="suggestanalyzerfieldtype">text_general</str> <str name="buildonstartup">false</str> </lst> </searchcomponent> <requesthandler name="/suggest" class="solr.searchhandler" startup="

Configuration by Exception vs Convention over Configuration -

does know difference between 2 terms? in opinion both refer same thing: framework or api, unconventional behavior must specified. if there difference, share example, in 1 term acceptable, , second 1 not? imho both refers same. nice examples maven , jpa.

how to reset the gps in android -

is there way reset gps in android ? please help. test below code not sure work or not. for reset locationmanager.sendextracommand(locationmanager.gps_provider,"delete_aiding_data", null); for download gps data public static void downloadgpsxtra(context context){ locationmanager locationmanager1 = (locationmanager)context.getsystemservice("location"); bundle bundle = new bundle(); locationmanager1.sendextracommand("gps", "force_xtra_injection", bundle); locationmanager1.sendextracommand("gps", "force_time_injection", bundle); } and add permission statements in android menifest. "access_location_extra_commands" android location manger uses multiple sources location data network (coarse location upto city level using ip geolocation) network provider (coarse location upto 100 meters using cell towers) gnss(fine upto 3 meters using gps / glonass / galileo on gnss chip) location

c# - BitmapFrame.Create cannot access this object -

i'm trying export several bitmapsource images png files. here's code: thread call: var exportimagesthread = new thread(exportrangeofimages); exportimagesthread.start(); function: private void exportrangeofimages() { (var currentframe = exportfromframe; currentframe <= exporttoframe; currentframe++) { var currentimage = application.current.dispatcher.invoke(() => (currentstream.children[0] image).source); var pngbitmapencoder = new pngbitmapencoder(); var bitmapframe = bitmapframe.create((bitmapsource) currentimage); application.current.dispatcher.invoke(() => pngbitmapencoder.frames.add(bitmapframe)); var = new filestream(updateddir + sequencefile + "_" + framenumber + ".png", filemode.create); pngbitmapencoder.save(a); } } when doing i'm receiving additional information: calling thread cannot access object because different thread owns it. on

How to perform a search operation on Combobox in windows phone 8.1? -

in windows application having 1 combobox. in combobox showing many number of items (strings) user. want perform search operation on combobox filter data. please 1 hep me how this. please me. thank in advance. usw linq search through list of strings: mycombobox.items = mydata.where(s => s.contains(mykeywordtextbox.text)).tolist(); execute in search buttons click handler.

Codeigniter 3.0 security by methods -

my doubt is: there way in codeigniter <?php defined('basepath') or exit('no direct script access allowed'); class users extends ci_controller { public function __construct() { parent::__construct(); } //this method user admin permission can access public function onlyadmin(){ } //this method user can access public function alluser(){ } } something or more dynamic. thanx time. the easiest way use authentication library since you'll need authentication @ point in app. there large number available codeigniter each own merits , weaknesses in different situations. have @ this post overview of few , see if there's 1 that'll suit needs. you'll want 1 supports different user groups. way when user lands on page can check group (admin / user / not-logged-in) , direct them or render page accordingly. use case statement runs different function each group. these functions should render page need specific

javascript - Nested text links in HTML -

Image
in html nested links not permitted. however, purpose (text notes refer whole sentences , 1 single word within anotated sentences) need them. have find way solve problem. however, have basic idea on how should , behave. following mock shows 2 links: 1 target a, 1 b. "outer" link is, lower line under it. outer link, thus, line lower of b. clicking on lines of link should lead target of link - if text above line text of inner link. i've tried show intended behaviour hover colors: blue a, pink b. any ideas how realize in html of css (and maybe svg?). i'd prefer solutions without scripting, suggestions welcomed. use javascript best results i know: i'd prefer solutions without scripting, but… any suggestions welcomed . you can add inline onclick handler child span : <a href="#a">aaaa <span onclick="event.preventdefault(); window.location.assign('#b'); return false;">bbbb</span> aaaa&

html - Submit button doesn't work on enter -

i have several "submit" inputs on form (this caused framework i'm using), control button activated on "enter" (as "go" button of android keyboard), have added markup: <input type="submit" style="position:absolute;top:0;left:-100px;" onclick="$('#defaultbutton').click();return false;" /> i'm placing in beginning, it's first in order, still inside of form. works great in 1 of applications, not working @ in other! even more suprising in other application, there case when there 1 single submit, should working default without additional work, never worked. when add hidden submit - doesn't work neither. have checked via javascript count of submits on page - , have shown me 2: 1 one visible user, other 1 i'm adding. ok, did javascript handle keypress, it's working, don't aproach - prefer natural way, when first submit acts default button. also, have checked on mobile - thought t

Set Calendar.DAY_OF_WEEK using java.time.DayOfWeek -

currently i've got code sets day_of_week on calendar based on java8 java.time.dayofweek object. since integer values these types misaligned, i.e. calendar.sunday == 1 where dayofweek.sunday == 7 i wondering if there recommended way convert 1 other. i'm doing this. calendar.set(calendar.day_of_week, dayofweek.getvalue() == 7 ? 1 : dayofweek.getvalue() + 1); dayofweek enum representing 7 days of week - monday, tuesday, wednesday, thursday, friday, saturday , sunday, followed iso-8601 standard, 1 (monday) 7 (sunday). more info click here but in calender class given in different way i.e., sunday(1) saturday(7). see here . the approach following guess.

stream - Reading txt file in C++ to strings and floats -

Image
i need read *.txt file. contains words , numbers, , looks this: firstword:12,13.0secondword18.7thirdword2,3,89 i need extract words strings, , numbers floats. main problem cannot solve there no delimiters before "words" (otherwise i'd use getline). thank you! note: words not contain numbers, example, word 'num1' impossible. with sstream , more requires delimiter, there none in file. by using functions found in standard c library, can character character without delimiter. , not elegant. this 1 way of extracting words , doubles text file text.txt contaning firstword:12,13.0secondword18.7thirdword2,3,89 . this solution uses funtion isalpha() extract alphabet related , stores in array extractedwords[] . for doubles, uses isdigit() , atof() extract number related , stores in array extracteddoubles[] . #include<string> #include<fstream> #include<iostream> #include <stdlib.h> using namespace std; char mainbu

How can compare values of two arrays in php -

this question has answer here: php check if array contains array values array 4 answers i want compare 1 array values in another. following 2 different arrays. $a = array (9,39,40,41); $b = array ( [0] => 38 [1] => 1 [2] => 36 [3] => 37 [4] => 9 [5] => 2 ); i want check if $a values in $b . condition should true when $a values exist in $b . if($a in $b ){ echo 'true'; } you can use array_intersect so $intersection = array_intersect($a, $b); $ok = (count(($intersection) === count($a));

javascript - Appending spans to li -

Image
i've html <div> <ul id="one"></ul> </div> and code appending li element ul $("#one").append("<li id='libtn2630275chat'><img id='imgbtn2630275chat' width='10' height='10' title='in queue' alt='' src='/content/themes/images/queue.png'/><input type='button' class='btnsend' id='btn2630275chat' value='jordan' onclick='fnbtnchatuserclick()' /><span id='spnpendingmessagebtn2630275chat' class='display_none'>(<span='spnpendingmessagecountbtn2630275chat' class='display_none'>0</span>)</span></li>"); now problem last ) not added inside span spnpendingmessagebtn2630275chat . see attached image why not being included in span, , how can resolved? fiddle: fiddle replace line code: $("#one").append("<li id='libt

iphone - unit test case for a asynchronous method ios -

i new in ios line. have task crete test case method. + (void)mymethod:(nsstring *)parama callback:(void(^)(nsstring *result, bool success))callback; // ... code runs async (for example, fetches data internet)... // call callback function in background thread dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ callback(@"success", yes); }); } as through rnd kno related xctestexpectation used create unit test cases.... just call fulfill in compeletion block. example: assume functionobj holds function @interface functionobj : nsobject + (void)mymethod:(nsstring *)parama callback:(void(^)(nsstring *result, bool success))callback; @end @implementation functionobj + (void)mymethod:(nsstring *)parama callback:(void(^)(nsstring *result, bool success))callback { dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ callback(@"success", yes); }); } @end then test case should b

ruby - Regular expression to fetch the value within all the " " -

a='fdkfjsdflksdj lfkjdflksdjf["fdkljfdfl"]fkjdfldjkf["fdfdf"]dfdfsdfsdfsdfddfdfkdfj["fdfds"]fdfasdfds' i need fetch values inside "" means out put should fdkljfdfl fdfdf fdfds i have written below coding puts a[/\["(.*)"\]/m] but returns ["fdkljfdfl"]fkjdfldjkf["fdfdf"]dfdfsdfsdfsdfddfdfkdfj["fdfds"] can me take particular string within "" puts a.scan(/\["(.*?)"\]/m) ^^ make regex non greedy.or use negation based regex. puts a.scan(/\["([^"]*)"\]/m)

How to edit javascript runtime in browser? -

i want edit javascript web page on fly while loading. how should achieve that? suppose have web page , want edit particular script file in firebug or want edit particular function value, how achieve using dev tools? thanks in advance :)

c# - SSIS - Move Excel File with OLEDB Connection to Archive -

i've created connection using microsoft office 12.0 access database engine ole db provider excel schema loop through sheets in excel file demonstrated in question how loop through excel files , load them database using ssis package? and using foreach ado.net schema rowset enumerator loop through excel files. everything working fine now, after importing data excel, wanted move file archive folder. , tried using file system task , error as [file system task] error: error occurred following error message: "the process cannot access file because being used process.". and tried script task link . getting error , couldn't solve error i've got 0 knowledge on c#. below error i've got when tried move files using script task. at system.runtimemethodhandle.invokemethod(object target, object[] arguments, signature sig, boolean constructor) @ system.reflection.runtimemethodinfo.unsafeinvokeinternal(object obj, object[] parameters, object[] arg

How to block javascript alert box in Gecko C# -

i trying block javascript alert box in gecko browser engine. i have tried code doesn't work @ all.. internal class filteredpromptservice : nsipromptservice2, nsiprompt { private static promptservice _promptservice = new promptservice(); public void alert(nsidomwindow aparent, string adialogtitle, string atext) { // nothing } } having difficulties while trying disable javascript alert box.

javascript - How to access json array resides in function and loop with ng-repeat? -

my html code below reviewans page :- <div class="all_ques_back col-md-12" ng-init="result()" ng-repeat="ans in correctans"> <div class="col-xs-1 col-md-1"><i class="fa fa-check-square fa-2x col_padd right_ans_font"></i></div> <div class="col-xs-9 col-md-10 col_padd"> <div class="all_ques">hello ans {{ans}}</div> </div> <div class="col-xs-1 col-md-1 col_padd"><i class="fa fa-angle-right right_arrow "></i></div> and controller code :- var data = angular.module('app', ['ngroute']); data.controller('smartlearnercontroller', function($scope, $location) { $scope.result = function() { $scope.correctans = [{ "questionid": "1", "questionlabel": "why mirrors curved (convex) ?", "im

html - Bootstrap 3: Tooltip image just after the input field? -

Image
i question sign image after email address input field , align right center of input field? <div class="form-group form-group-lg"> <label class="col-md-2 control-label">{{translation.telephone}}:</label> <div class="col-md-4"> <input type="text" class="form-control" ng-model="jderetailer.phone" placeholder="telephone"> </div> <label class="col-md-2 control-label">{{translation.email}}:</label> <div class="col-md-4"> <input type="text" class="form-control" ng-model="jderetailer.email" placeholder="email address"> <span style="font-size:1.3em;" class="glyphicon glyphicon-question-sign" data-toggle="popover" data-content="info tooltip text here" data-trigger="hover"></span> </div

Insert query in yii2.0 framework -

i using yii 2.0 framework , can me write insert query in controller please, writing query this, proper query $userid = \yii::$app->user->identity->id; $restid = \app\models\restaurantbusiness::find()->select('restaurentid')->where(['userid' => $userid ])->one(); $restdetailid = $restid->restaurentid; $restomenuid = restomenu::find()->insert('restaurantbusiness_restaurentid')->where(['restaurantbusiness_restaurentid' => $restdetailid])->one(); please me write correct insert query. in advance ok assume no 1 knows :-/ i found solution there no need write insert query @ all, in controller before saving wrote this $model->restaurantbusiness_restaurentid= $restdetailid; thats all.

Asp.net Identity v2 with custom authentication service -

i'm building mvc website (with episerver) set custom membership , role provider call rest service user validation , permissions. however, seems benefit changing microsoft's asp.net identity v2 claims based auth. i'm having trouble figuring out how arrange asp.net identity 2 use same rest service user validation , generating claims. examples on web specific using owin , entity framework don't seem relevant need. could point me in right direction figure out how utilise asp.net identity v2 integrating our rest service user validation , permissions/claims? feel should need https://www.nuget.org/packages/microsoft.aspnet.identity.core , make custom userstore talks rest service, i'm not confident due lack of clear examples or documents (or maybe it's me) implement it. hope clear question - let me know if there's other info improve discussion.

Set Gemfire entry-ttl in Java Beans -

i create gemfire region in spring boot application. following sample , works wihout adding database support. if add database, shows error " error creating bean name 'datasource'". however, default gemfire cache bean works datasource integration. @enableautoconfiguration // sprint boot auto configuration @componentscan(basepackages = "napo.demo") @enablecaching @suppresswarnings("unused") public class application extends springbootservletinitializer { private static final class<application> applicationclass = application.class; private static final logger log = loggerfactory.getlogger(applicationclass); public static void main(string[] args) { springapplication.run(applicationclass, args); } /* **the commented code works database.** @bean cachefactorybean cachefactorybean() { return new cachefactorybean(); } @bean replicatedregionfactorybean<integer, integer> replicatedregionfactorybean(final cache cache) { replica

javascript - Timeout while testing with mocha -

this question has answer here: how can remove documents collection mongoose? 3 answers i trying write test case using mocha , mongoose. following snippet of code have written gives me error "todo "before each" hook: error: timeout of 2000ms exceeded. ensure done() callback being called in test." unable fing issue. beginner in node. can please me out on issue. in advance. var todo = require('../models/todo'), should = require('should'); describe('todo', function(){ beforeeach(function(done){ faketodo = { name : 'xyz', completed : true, note : "this test note" } todo.remove(done); }); describe('#save()', function(){ var todo; beforeeach(function(done){ console.log('before eac

c# - WPF Button does not show ToolTip when TapAndHold consecutively -

i'm implementing .net 4.5 wpf application on touchscreen desktop. when testing application, realised tooltips buttons not appear when tap , hold same button twice consecutively. 1) tap , hold on button once, tooltip button appears expected. 2) tap , hold on button again (after initial tooltip has disappeared), tooltip not appear again. 3) tap , hold on button b, tooltip button b appears. 4) tap , hold on button now, tooltip button able appear. i not sure whether default behavior or it's did somewhere in code caused happen. there can ensure tooltip appears everytime? thanks help. </stackpanel.resources> <contentcontrol horizontalalignment="center" verticalalignment="center" > <i:interaction.triggers> <i:eventtrigger eventname="mouseleftbuttondown"> <mvvmlight:eventtocommand command="{binding messageinfovm.showinfomessagecommand}" comma

How to load a vector from memory with up-sample in Neon with C API -

i'm new neon . try find instructions following operation: int a[8] = {1,2,3,4,5,6,7,8}; int b[4] = {1,2,3,4}; int c[8] = {0}; (int =0; i<8; i++) c[i] = a[i] - b[i/2]; how can arm neon , how can load array upsample neon {b[0],b[0],b[1],b[1],b[2],b[2],b[3],b[3]} you can extending b[] vector: vld1.32 {q10, q11}, [ptrb]! vld1.32 {q12, q13}, [ptra]! vld1.32 {q14, q15}, [ptra]! vshll.s32 q8, d20, #32 vshll.s32 q9, d21, #32 vshll.s32 q10, d22, #32 vshll.s32 q11, d23, #32 vsra.u64 q8, q8, #32 vsra.u64 q9, q9, #32 vsra.u64 q10, q10, #32 vsra.u64 q11, q11, #32 vsub.s32 q12, q12, q8 vsub.s32 q13, q13, q9 vsub.s32 q14, q14, q10 vsub.s32 q15, q15, q11 vst1.32 {q12, q13}, [ptrc]! vst1.32 {q14, q15}, [ptrc]! however, it's efficient when done vld2 , vst2 when loading/storing a[] vector: vld1.32 {q10, q11}, [ptrb]! vld2.32 {q12, q13}, [ptra]! vld2.32 {q14, q15}, [ptra]! vsub.s32 q12, q12, q10 v

javascript - How to switch error Messages in Parsley.js -

i have written specific validator parsley.js determine if selected date matches criteria: date between , b years in past. if min-date given, there should message i have solved writing 1 function , assign 2 validators able translate messages differently. is there better way dynamically switch message based on parameters given validator? // translationkeys: // timerange: "muss zwischen %s und %s jahren in der vergangenheit liegen" // mintimerage: "muss mindestens %s jahr(e) in der vergangenheit liegen" var timevalidator = function (value, req) { if(req.min){ var mindate = moment().subtract(req.min, 'y'); } if(req.max){ var maxdate = moment().subtract(req.max, 'y'); } var date = moment(value, 'dd.mm.yyyy'); if( req.max ){ return ( date.isafter(maxdate)&& date.isbefore(mindate) ); } else { return ( date.isbefore(mindate) ); } } window.parsleyvalidator.addvalidator('timerange', timevalidator,

c# - How can i update header table Status as Closed comparing with detail table Status in SQL -

header table: headeid status ---------------- 1 open detail table: detailid headerid status ------------------------- 1 1 close 2 1 close sql server allows use of triggers. in simple terms, trigger stored procedure executes on update of table. typically use triggers enforce business rules/logic. therefore apply situation place trigger on details table, check if rows current headerid have been set closed update header table. create trigger detail_update_header on detail after insert, update begin set nocount on; declare @currentheaderid int; select @currentheaderid = i.headeid inserted i; if((select count(*) detail headerid = @currentheaderid) > (select count(*) detail headerid = @currentheaderid , status = 'closed')) begin update header set status = 'closed'; end end go

javascript - Enable :focus only on keyboard use (or tab press) -

i want disable :focus when it's not needed because don't how navigation looks when focus on it. uses same style .active , it's confusing. don't want rid of people use keyboard. i thinking add class enabled-focus on body on tab press , have body.enabled-focus a:focus{...} add lot of css every element has focus. remove class body on first mouse down. how go it? there better solution? this excellent article roman komarov poses viable solution achieving keyboard-only focus styles buttons , links , other container elements such spans or divs (which artificially made focusable tabindex attribute) the solution: button { -moz-appearance: none; -webkit-appearance: none; background: none; border: none; outline: none; font-size: inherit; } .btn { all: initial; margin: 1em; display: inline-block; } .btn__content { background: orange; padding: 1em; cursor: pointer; display: inline-block; } /* fi