Posts

Showing posts from January, 2015

php - Need help for Mysql selected query -

i have field on database, name time_message , , set default date w, d-m-y h:i:s , , wanna create search using between , value show "d-m-y" how can show query?? i bring code below.. $date1 = "21-08-2015"; $date2 = "d-m-y"; $query = mysql_fetch_array(mysql_query("select count(*) jumlahdata message_complaint (status_message='".$data['status_message']."') , (time_message between $date1 , $date2)")); you conflicting mysql , mysqli . use mysqli $date1 = "21-08-2015"; $date2 = "d-m-y"; $message = $data['status_message']; $query = mysqli_query($con, "select count(*) jumlahdata message_complaint (status_message='$message') , (time_message between '$date1' , '$date2')"); $row = mysqli_fetch_array($query, mysqli_assoc); $con equal mysqli connection

c++ - Play Scala - Native access -

i developing web application using play framework in scala language. in application have access native methods written in c++ , converted .so using swig. my aim call native method in .so file controller class. have searched in internet, didn't documentation this. i have seen links used scala language. https://code.google.com/p/scala-native-access/ https://code.google.com/p/bridj/wiki/download#specialized_subsets_(smaller_jars_!) https://github.com/xudongyang/scala-native-access but didn't mention how use in play framework. can have documentation play scala native access? can have sample applcation same? like in jvm language, jna/jni gives native access. aware because of play's use of class loaders, you'll need make sure access same class. see fail load native library using activator (play framework)

ios - warning : will never be excuted -

i updated old swift 1 app swift 2 using xcode 7 , i'm getting few warnings not there before updated. required init(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented") // swift 2 update state = .optionsvisible super.init(coder: adecoder)! } that function giving me 2 warnings both state , super lines not executed, i'm not sure why? figured changed between swift 1 , 2, i'm not sure what. thanks! fatalerror flagged @noreturn , compiler can tell nothing after executed.

c# - Variables more local than the rest of local variables ( is it really "more local" or just "isolated" from the rest that are "as local as" it's?) -

i've got quite small , straight forward question, i'll sure answer for, , thank guys in advance: inside method ( main instance ), can add curly braces {} section of code scope lines locals. here's example: public static void main (string[] args) { int = 1; { int b = 2; console.writeline(b); } console.writeline(a); } the variable "int b" non-accessible in out side of curly braces, question variable's memory position, going in same stack frame main method in same stack of memory, or it's going held in yet newer stack frame on top of main method's stack (like called method's parameters , local variables inside method)? no, braces not act stack frame . b automatic variable main method & treated same a additional scoping so,it going in same stack frame main method in same stack of memory.

Find regex in next line in perl -

my content this form: <tr> <td width="50%" align="right" valign="middle">email </td> <td width="50%" align="center" valign="middle"> unique@gmail.com </td> </tr> <tr> <td width="50%" align="right" valign="middle">code </td> <td width="50%" align="center" valign="middle">twenty</td> </tr> <tr> <td width="50%" align="right" valign="middle">code12 </td> <td width="50%" align="center" valign="middle">forty</td> </tr> what regex should use if want extract "twenty" ie data accociated "code" i tried extract whole line, empty response $c=$m->content(); ($a) = $c =~ /code(.*?)tr>/; print "$a\n"; do not try parse html re...

excel - If a cell contains any of these values, then label as this -

i want set formula in excel if column b (which contains dates) contains of dates in list of 7 dates, labeled "week 1", if not, it'll labeled "week 2". formula listed below returning #name error. thoughts? ie: =if((b1,containsany=j1:j7), "week 1", "week 2") pic: http://i57.tinypic.com/2vlk4g5.png as per screenshot, can date's week using weeknum function. example, assuming dates start @ row 10, place formula in cell i10 , copy cells below, , week number. =weeknum(b10,15)-36 the second parameter defines when week starts (15 = friday in case), , week 37th of year, subtract 36. :) with approach, don't need hardcode dates in cells j1:k7, , it's future-proof. ;)

string - python convention lstrip(s[, chars]). What does "[, chars]" signifies? -

this question has answer here: what square brackets, “[]”, mean in function/class documentation? 4 answers i'm newbie in programming. reading python documentation , not understand "s[, chars]" in lstrip(s[, chars]) . i'll appreciate if can enlighten me. chars specifies set of characters should stripped left end of string. the square brackets denote argument optional. if not specified, there default set of characters strip. examples: lstrip(' abc ') == 'abc ' lstrip('12345', '41') == '2345' lstrip('1112212345111', '12') == '345111' note: function string.lstrip() exists in python 2, not 3.

Are too Many native queries in Spring MVC with JPA project a normal deal? -

project technology stack :i working project using spring mvc. using jpa orm. sql database mysql. issue : business logic has become lot complex in application. fetch data application, code using lot of native sql queries multiple joins. this creates lot of problem while creating integration test cases. happens due fact when entity persisted using jpa's entity manager entity in first level cache. when next fetch query(which written in native sql) tries fetch data, cannot. happens because native sql queries goto database whereas 1st level cache synchronises database after whole test case has executed. i wanted know if there workaround this?

ruby - How to use CSV.open and CSV.foreach methods to convert specific data in a csv file? -

the old.csv file contains these headers, "article_category_id", "articleid", "timestamp", "udid" , of values in columns strings. so, trying convert them integers , store in csv file, new.csv . code: require 'csv' require 'time' csv.foreach('new.csv', "wb", :write_headers=> true, :headers =>["article_category_id", "articleid", "timestamp", "udid"]) |csv| csv.open('old.csv', :headers=>true) |row| csv['article_category_id']=row['article_category_id'].to_i csv['articleid']=row['articleid'].to_i csv['timestamp'] = row['timestamp'].to_time.to_i unless row['timestamp'].nil? unless udids.include?(row['udid']) udids << row['udid'] end csv['udid'] = udids.index(row['udid']) + 1 csv<<row ...

c# - hosting WCF Application in IIS -

i creating wcf project. project contains 2 applications: 1 console based, containing few classes support database operations 'insert', 'update', 'encryption' etc. , 1 wcf service application contains operation contracts. now, wcf service application using console application database operations. want know process of hosting project in iis. have steps in mind, please guide me whether right or wrong: step - @ first, build console application , add reference in wcf application. step ii - after finishing wcf tasks, host wcf application in iis. is process correct? please guide me right , efficient way. thanks. you should split console application. both console application , wcf application should use dll logic in it. once split solution wcf wont have problems interact console application.

box2dweb - Implementing box2d debug draw with pixijs? -

i have used box2d in flash. trying implement html5 game. intend use pixijs rendering engine game. know how debug draw working pixijs. while googling topic cam across https://gist.github.com/cbranch/260224a7e4699552d2dc how every unable working.

php - Validate Paypal Live Account -

i validating email address using following code : $url = trim("https://svcs.sandbox.paypal.com/adaptiveaccounts/getverifiedstatus"); $api_username = ""; $api_password = ""; $api_signature = ""; $api_appid = ""; $api_requestformat = "nv"; $api_responseformat = "nv"; //create request payload $bodyparams = array ( "requestenvelope.errorlanguage" => "en_us", "emailaddress" => $email, // email validate "matchcriteria" => "none" ); // convert payload array url encoded query string $body_data = http_build_query($bodyparams, "", chr(38)); //create request , add headers $params = array("http" => array( "method" => "post", "content...

swift - How to enumerate a slice using the original indices? -

if want enumerate array (say map() function need use index of element value), use enumerate() function. e.g.: import foundation let array: [double] = [1, 2, 3, 4] let powersarray = array.enumerate().map() { pow($0.element, double($0.index)) } print("array == \(array)") print("powersarray == \(powersarray)") // array == [1.0, 2.0, 3.0, 4.0] // powersarray == [1.0, 2.0, 9.0, 64.0] <- expected now, if want use sub-sequence array, use slice , , allow me use same indices use in original array (which want in case if use subscript accessor in for loop). e.g.: let range = 1..<(array.count - 1) let slice = array[range] var powersslice = [double]() index in slice.indices { powersslice.append(pow(slice[index], double(index))) } print("powersslice == \(powersslice)") // powersslice == [2.0, 9.0] <- expected however, should try use enumerate().map() approach did original array, totally different behaviour. instead of slice...

How to align the text field items by 2 columns in a row in oracle apex5.0, i have attached sample picture -

Image
how align text field items 2 columns in row in oracle apex5.0. did try use page designer in 5.0 can using drag , drop https://www.youtube.com/watch?v=t3udgbj4ucy

matlab - Remove first 2 letters from workspace variables -

let's have .mat file , know each of variables in has xy in front of (e.g. xyjanuary , xyfebruary , xymarch , on...) , want remove xy . i have looked @ this , tried copy adds xy variable ( xyxyjanuary , xyxyfebruay ,...) want ( january , februay ,...). x= load('file.mat'); % load structure x names=fieldnames(x); % names of variables iname=1:length(names) % start loop x.(['xy', names{iname}]) = x.(names{iname}); % problem x = rmfield(x, names{iname}); end save ('newfile.mat', '-struct', 'x'); %save x= load('file.mat'); % load structure x names=fieldnames(x); % names of variables iname=1:length(names) % start loop x.([names{iname}(3:end)]) = x.(names{iname}); % no more problem x = rmfield(x, names{iname}); end save ('newfi...

c# - Like methods for integer field in LINQ query -

the following code statement throws error can help? var results = c in dt.asenumerable() sqlmethods.like(c.field<int>("design_no").tostring(), "%" + auto_txt_desi.text.tostring() + "%,") select c; dataview view = results.asdataview(); dt = view.totable(); sqlmethods.like method linq-to-sql query database not linq-to-dataset subset of linq-to-objects . can use pure .net methods instead: var rows = row in dt.asenumerable() let design_no = row.field<int>("design_no").tostring() design_no.contains(auto_txt_desi.text) select row; msdn : the sql server like functionality cannot exposed through translation of existing common language runtime (clr) , .net framework constructs, , unsupported outside of linq sql context. use of method outside of linq sql will throw exception o...

html - Div and Button element collision when floating -

i have following code <div class="site-branding"> <h1 class="site-title"><a href="http://localhost/test/" rel="home">test</a></h1> </div> <button class="menu-toggle" aria-controls="primary-navigation" aria-expanded="false">navigation</button> on css, put site-branding float left , menu-toggle float right. on normal resolutions, display good. brand @ left side of header , menu-toggle @ right when screen gets smaller, want menu toggle button below site-branding div behavior got menu-toggle colliding site-branding div. ideas how resolve this? thank you. float ignore element's collision box. have use media queries apply new css header when screen small. for example, if branding 300px wide , toggle 60px wide, should use media query of max-width: 360px , target css file place toggle below branding image.

php - Integrate from JSON file and return value to it -

in linux box running following php code <?php //get response server , append timestamp data function get_server_response() { $curl_post_data = null; $service_url = 'http://serverip/source.php'; $curl = curl_init($service_url); curl_setopt($curl, curlopt_httpauth, curlauth_basic); curl_setopt($curl, curlopt_userpwd, "user:pass"); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_post, true); curl_setopt($curl, curlopt_postfields, $curl_post_data); curl_setopt($curl, curlopt_ssl_verifypeer, false); $curl_response = curl_exec($curl); $response = json_decode($curl_response, true); curl_close($curl); $time = time(); $check = $time+date("z",$time); $data['timestamp'] = ...

android - on Scrolling ListView , My activity gets stopped -

i have arrayadapter follows : public class smsarrayadapter extends arrayadapter<string> { list<string> smsbody; list<boolean> status; list<string> time; list<string> smsmessageid; context context; private static layoutinflater inflater = null; string fromnumber; public smsarrayadapter(context context, int resource, list<string> smsbody, list<boolean> status, list<string> time, list<string> smsmessageid, string fromnumber) { super(context, resource, smsbody); this.smsbody = smsbody; this.status = status; this.context = context; inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); this.fromnumber = fromnumber; this.time = time; this.smsmessageid=smsmessageid; } public string getstr(int position) { return smsbody.get(position); } publ...

xml - How to set working directory in XSLT -

i need transform xml using xslt(transform.xsl). in transform.xsl, need import supporting xml , xsl files. have set working directory access supporting files. please suggest how set working directory before xsl:import if use relative uri resolved against base uri can set , change anywhere in xml using xml:base attribute e.g. <xsl:stylesheet xml:base="http://example.com/xslt" ...> or <xsl:stylesheet xml:base="file:///c:/dir/subdir" ...> .

c++ - VS2012 "Generating Code" slow with large hardcoded arrays -

we have tool generates class in header file generated hardcoded arrays. autogenerated inherited real implementation uses autogenerated values. autogenerated example: class mytestautogen { std::vector<int> m_my_parameter1; std::vector<int> m_my_parameter2; ... public: mytestautogen() { setdefaultvaluefor_my_parameter1(); setdefaultvaluefor_my_parameter2(); ... } void setdefaultvaluefor_my_parameter1() { int tmp[] = {121,221,333,411,225,556,227,.......}; m_my_parameter1.assign(tmp, tmp + 65025); } void setdefaultvaluefor_my_parameter2() { int tmp[] = {333,444,333,987,327,16728,227,.......}; m_my_parameter2.assign(tmp, tmp + 65025); } ... }; compiling takes lot of time , in output windows of vs can see hangs on "generating code" phase of compilation, finish compile after 15-30min unless compiler crashes stack overflow. i have tried enable ...

css - Centering a couple of divs together horizontal -

hello wondered how able center divs horizontal, far i've used margin: 0 auto; put them in middle, divs go right under each other instead of next each other. ideas on how fix that? here's codepen: http://codepen.io/anon/pen/kdmmpo html: <section id="rating-box"> <div class="rating"></div> <div class="rating"></div> <div class="rating"></div> <div class="rating"></div> <div class="rating"></div> <div class="rating"></div> </section> css: #rating-box { width: 100%; margin: 20px 0 20px 0; } #rating-box .rating { width: 35px; height: 35px; background-color: #7a7a7a; margin: 0 auto; } as see on top of each other, know how make them stand next each other. you can use display: inline-block child elements , text-align: center parent: #rating-box { width: 1...

lua - Objects keep colliding even though I set the groupIndex -/+ -

i have 4 objects of same kind, mines, , 1 don't want collide of other objects. i've set groupindex of 4 objects positive , other object negative. 2 of mines works other 2 collides. here objects: mine=display.newimage("mine.png") mine:setreferencepoint(display.bottomleftreferencepoint) mine.y=-200 mine.x=math.random(0,280) physics.addbody(mine, "static", {density=0, bounce=0, friction=0, radius=12}) mine.isvisible=true local minecollisionfilter = { groupindex = 2 } mine2=display.newimage("mine.png") mine2:setreferencepoint(display.bottomleftreferencepoint) mine2.y=-400 mine2.x=math.random(0,280) physics.addbody(mine2, "static", {density=0, bounce=0, friction=0, radius=12}) mine2.isvisible=true local mine2collisionfilter = { groupindex = 3 } mine3=display.newimage("mine.png") mine3:setreferencepoint(display.bottomleftreferencepoint) mine3.y=-50 mine3.x=math.random(0,280) physics.addbody(mine3, "static", {densi...

PHP calculate between two time with H:i:s format -

i'm trying find , calculate between startime , finish time as: starttime + 1 hour , current time. if current time between start , finish must print message such please try after 1 hour : $current_date_time = new datetime("now", new datetimezone("asia/tehran")); $user_current_time = $current_date_time->format("h:i:s"); $start_limit_time = date("h:i:s",strtotime('2015-09-15 14:57:31')); $finish_limit_time = date('h:i:s', strtotime($start_limit_time) + (60 * 60 * 1)); $date1 = datetime::createfromformat('h:i:s', $user_current_time); $date2 = datetime::createfromformat('h:i:s', $start_limit_time); $date3 = datetime::createfromformat('h:i:s', $finish_limit_time); if ($date1 > $date2 && $date1 < $date3) { echo 'here'; } this code not correct , can not fix that, you can try this, shows difference in minutes: $current_date_time = new datetime("now", n...

ios - Unknown exception when exporting video asset -

i have following code export video data photos: if (asset.mediatype == phassetmediatypevideo) { [[phimagemanager defaultmanager] requestavassetforvideo:asset options:nil resulthandler:^(avasset *asset, avaudiomix *audiomix, nsdictionary *info) { avassetexportsession *exportsession = [[avassetexportsession alloc] initwithasset:asset presetname:avassetexportpresetpassthrough]; exportsession.outputfiletype = avfiletypequicktimemovie; [exportsession exportasynchronouslywithcompletionhandler:^{ [[sharedmanager sharedinstance] insertattachment:exportsession.outputurl forevent:event]; }]; }]; } this code rises unidentified exception (with breakpoints disabled) on line [exportsession export...] thing. exportsession valid, shows outputfiletype = (null) in log, had set manually. i can see url of video, file://private.mobile....mov, captured camera , stored in assets catalog (i can watch photos). has 2 seconds length. please, me out...

swift - iOS: Unit Testing UIViewController Components with XCTest -

i implementing unit test on functionality of ios uibutton in view controller in swift. expected functionality of button followed: the button has title of "start" after button pressed, title changes "pause" in short, test button's title changed "start" "pause" after button has been clicked. because system needs bit of time before change takes place , rendered on screen, need poll short amount of time check current title of button until either button title changes or allotted time runs out. normally, use quick/nimble framework unit testing , use expect(...).toeventually(...) function test kind of polling. however, team insists use xctest framework sake of consistency, have find elegant way implement test xctest. do have suggestions implementation xctest framework? a solution can come using nstimer triggers condition check every small interval until designated time runs out, , use xctestexpectation , waitforexpectati...

Using Spring Batch with clustered environment -

i have posted 2 questions ( clone table database database , how should use .tasklet() / .chunk() finish job succesfully? ) working solution implemented using spring batch. now next problem - use weblogic adjusted several-nodes cluster. so, how use batch job in case? saw meta-data schema in documentation - should implement things besides these tables? maybe can use adjusted quartz jobs purpose?

java - debugging in intellij (Reloading changed classes) -

i switched on intellij eclipse . while in eclipse when using debug launcher application reloads changed classes instantly after saving . while in intellij found takes >10 secs time after reloading changed classes, might not lot annoying cause use , there otherway achieve to reload changed classes 1.do 1 of following: -on main menu, choose run | reload changed classes. -on main menu, choose build | compile "class_name" recompile altered class during debug. 2.in reload changed classes dialog box, confirm reloading. results displayed in messages tool window. refer link detailed explanation.

javascript - AngularJS ng-change whenever input changes -

i have input of type email : <input type="email" ng-model="user.email" name="email" required> now need execute code whenever input changed. adding ng-change="emailinputchanged()" executes method, in case entered string valid e-mail address, need callback executed every keystroke , though input not validate. (same issue of course when watching model à la $scope.$watch('user.email', emailinputchanged) . any angular way so? i suggest use oninput event: http://www.w3schools.com/jsref/event_oninput.asp create custom directive , listen "input" event on text field element. example of directive implementation: function oninput() { return { restrict: 'a', template: '', scope: { wheninputchanged: '&' }, link: function($scope, $element, $attrs) { $element.on('input', $scope.wheninputchanged); } }; } angular.module('app') ....

java - Tomcat SEVERE: Exception starting filter CorsFilter, ClassNotFoundException -

i'm trying enable cors java servlet following class: package com.prosperity.mobile.core; import java.io.ioexception; import javax.servlet.filter; import javax.servlet.filterchain; import javax.servlet.filterconfig; import javax.servlet.servletexception; import javax.servlet.servletrequest; import javax.servlet.servletresponse; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class corsfilter implements filter { @override public void init(filterconfig filterconfig) throws servletexception { } public void dofilter(servletrequest servletrequest, servletresponse servletresponse, filterchain chain) throws ioexception, servletexception { httpservletrequest request = (httpservletrequest) servletrequest; // system.out.println("request: " + request.getmethod()); httpservletresponse resp = (httpservletresponse) servletresponse; resp.addheader("...

Preventing Excel prompt from Word VBA -

i'm working vba on word , excel. have word running userform automatically open excel file. user should fill data in excel file , go word userform. when user finish filling fields in word userform, run vba code on word copy data excel word. after finished, excel file closed automatically. therefore, need prevent user closing excel app manually. in order that, use these code in excel vba in sub workbook_beforeclose . if user close excel application window, show message box ask whether user still working word userform. code follows: private sub workbook_beforeclose(cancel boolean) answer = msgbox("are still working word userform?", vbyesno) if answer = vbyes cancel = true msgbox "this workbook should not closed. automatically closed when finish working ms. word template userform." else application.thisworkbook.saved = true end if end sub in word vba, have code close excel file: sub closeexcelapp() if not excelapp nothing excelapp.displ...

.net - Can't access WCF websocket service from WPF application -

i'm trying use simple wcf service via websockets (nethttpbinding transportusage="always" ). it works fine when consuming service console application, throws timeout error, when consuming wpf application: this request operation sent http://localhost:8733/design_time_addresses/wcfservicelibrary1/service1/ did not receive reply within configured timeout (00:01:00). there not timeout when switching transportusage="always" transportusage="never" . how can access websocket wcf service wpf application? service contract: [servicecontract] public interface iservice1 { [operationcontract] string getdata(int value); } the service: public class service1 : iservice1 { public string getdata(int value) { return string.format("you entered: {0}", value); } } the configuration: <system.servicemodel> <services> <service name="wcfservicelibrary1.service1"> <...

Nginx replace // with / in URL -

we getting web requests www.domain.com//index.php resolving, causing issues google. how can rewrite request catch these , redirect www.domain.com/index.php thanks by default ngingx merges double-slashes , urls www.domain.com//index.php works well. you can turn off merging , make rewrite rule redirection: merge_slashes off; rewrite (.*)//(.*) $1/$2 permanent;

angularjs - angular formly read-only mode for radio , multiCheckbox and checkbox -

i need display form in read-only mode , creating form based on json using angular-formly . checked link http://angular-formly.com/#/example/other/read-only-form works text input , please suggest how set read-only radio , multicheckbox , checkbox we via jquery: $(document).ready(function () { $('input').click(function (e) { e.preventdefault(); }); }); or if want "pretend" using "angular" this, though using jquery, , want type out whole lot more code write exact same thing(literally, run above code in jquery angular.element "alias" jquery---straight out of angular docs: https://docs.angularjs.org/api/ng/function/angular.element ), can do: angular.element(function() { angular.element('input').trigger('click')(function(e) { e.preventdefault(); }; }); this way can cool , spout off nonsense "it's bad practice run angular , j...

php - Laravel 5.1 ignores any values inside env() -

i uisn glravel 5.1 , setting mail service mailgun. i've found services file contains lines following: 'mailgun' => [ 'domain' => env('<domain>'), 'secret' => env('<key>'), ], now reason, these values ignored as-is. however, if remove env() method above, works. have this: 'mailgun' => [ 'domain' => '<domain>', 'secret' => '<key>', ], can explain why is? because env('foo'); you asking content of "foo" constant defined in .env file. have constant in .env file named 'foo'?

How to play Gbox video in android? -

{ string videourl="http://gbox.video/embad/bgb5edzgr?fs=1&autoplay=1"; mediacontroller mediacontroller = new mediacontroller( home.this); mediacontroller.setanchorview(videoview); // url string videourl uri video = uri.parse(videourl); videoview.setmediacontroller(mediacontroller); videoview.setvideouri(video); videoview.setonpreparedlistener(new onpreparedlistener() { public void onprepared(mediaplayer mp) { videoview.start(); } }); }

Long time unacknowledged message in RabbitMQ -

i have business process receives order rabbitmq queue. thinking not acknowledging (meaning, leave in queue) potentially long time (>10 minutes) , either removing (acknowledging) or not (not acknowledging). make sense? best way deal long running processing on top of rabbitmq tasks? in general ok do. i've done number of time, , has few advantages such if process crashes, unack'd message go in queue , picked again later there potential downsides this, though. for one, possible overload server unack'd messages. sure set consumer prefetch limit prevent happening it's possible have processes should not restarted once running. have lot of processes this... things kick off external server processes, long-running database database oracle. in situations this, best ack message right away , use status update queue of kind know when process done. over-all, there no "best way" handle long running tasks... there no best practices @ all. every practic...

javascript - Getting jquery.js Error: No such template '_resetPasswordDialog' error when I try to use bootstrap modal in my meteor app -

i'm trying load content of internal url bootstrap modal when user clicks button. however, when click button error mentioned on title of question. here code : <template name="flowchart"> <div class='container-fluid'> {{#if currentuser}} <div class="row-fluid"> <div class="span8"> <h3>flowchart editor</h3> <div id="flowchart"> <a href="#mymodal" role="button" class="btn" data-toggle="modal" data-remote="http://localhost:3000/">launch demo modal</a> <!-- <button type="button" class="btn" data-toggle="modal" data-target="#mymodal" data-remote="http://localhost:3000/">launch modal</button> --> </div> </div> ...

Plot a generic surface and contour in R -

i have following data var.asym <- function(alpha1, alpha2, xi, beta, n){ term11 <- alpha1*(1-alpha1)^(2*xi-1) term12 <- alpha1*(1-alpha1)^(xi-1)*(1-alpha2)^xi term22 <- alpha2*(1-alpha2)^(2*xi-1) sigma <- matrix(c(term11, term12, term12, term22), nrow=2, byrow=true) sigma*beta^2/n } mop.jacob.inv <- function(alpha1, alpha2, xi, beta){ term11 <- -qgpd(alpha1, xi, 0, beta)/xi - beta*(1-alpha1)^xi*log(1-alpha1)/xi term12 <- qgpd(alpha1, xi, 0, beta)/beta term21 <- -qgpd(alpha2, xi, 0, beta)/xi - beta*(1-alpha2)^xi*log(1-alpha2)/xi term22 <- qgpd(alpha2, xi, 0, beta)/beta jacob <- matrix(c(term11, term12, term21, term22), nrow=2, byrow=true) jacob.inv <- solve(jacob) jacob.inv } var.asym2 <- function(alpha1, alpha2) var.asym(alpha1, alpha2, 0.2, 1, 1000) mop.jacob.inv2 <- function(alpha1, alpha2) mop.jacob.inv(alpha1, alpha2, 0.2, 1) object <- function(alpha1, alpha2){ term1 <- mop.jacob.inv2(alpha1, alpha2)%...

javascript - Click link in CasperJS with extra spacing in the label -

Image
i'm attempting click download 'button' in following image: as can see in inspector, there spacing in label, doing: this.clicklabel("download", "a"); doesn't work. i've tried cutting , pasting text html, nature of return character producing parsing error. any ideas? update: @artom b.'s duplicate link have potential solution problem, question being asked user not same , difficult find otherwise. with of @artjom b. came use: var x = require('casper').selectxpath; casper.click(x("//a[contains(text(), 'download')]")); essentially, problem of having trailing characters after "download" overcome searching link contains "download". when utilizing this, weary cause problems if link contains "download" in page. note: similar duplicate link artjom commented on question, think problem unique , title better related problem.

populate in mongodb with meteor -

i using meteor.js. having 3 collections boards,categories,users. boards : { "_id": objectid("su873u498i0900909sd"), "locked": numberint(0), "board_name": "legends", "description": "legends of world", "cat_id": objectid("su873u498i0900909sd"), "cost": numberint(1), "image": "1389249002691_indexhj.jpeg", "creator": objectid("52ce317994acdcee0fadc90c") } categories: { "_id": objectid("su873u498i0900909sd"), "user_id": objectid("su873u498i0900909sd"), catname:"hjjj" } users: { "_id":objectid(55acec2687fe55f12ded5b4a), "username" :"mariya" } from want username in users collection referred in categories collection user_id field categories collection referred in boards collection cat_id. how trying it. boards.find({_id:"objectid(55acec2687f...

javascript - Permanently hide column of Ext JS grid -

extjs 5 i using extjs 5 grid. have button, when click on it, age column hidden using below line. ext.getcmp('grdsample').columnmanager.columns[2].setvisible(false); i using listener - beforecellclick index of clicked column. when click on last column (last column = next hidden column) still show original index of column. hidden column still getting position in grid. in css - if use visibility: hidden hides component or tag still take space in web page if use display: none, hides doesn't take space in web page. i want hidden column should not take space while getting indexing of current clicked column. (without using css). can me sort out. ext.onready(function () { var studentstore = new ext.data.jsonstore({ autoload: true, pagesize: 10, fields: ['name', 'age', 'fee'], data: { items: [ { "name": 'puneet', "age": '25', "fee"...

php - AJAX overwritting -

i'm using ajax live submit post appended list. problem having when submit post more once, ajax overwrites previous posts submitted. var data = $("#form_write_post").serialize(); $.ajax({ type: "post", url: $("#form_write_post").attr("action"), data: data, beforesend: function() { $("ul.timeline").prepend("<img class='textarea_ajax_loading' src='img/ajax-loader.gif' style='margin: 0 auto; display: block;' />"); }, complete: function() { $('.textarea_ajax_loading').remove(); }, success: function () { //var successcount = successcount++; $("ul.timeline").prepend('<li class=ajax_post></li>').fadein(); $("ul.timeline .ajax_post").load("ajax_post.php").fadein(); //$('ul.timeline').prepend(wall_post); //console.log("success"); ...

Porting PHP Curl request to C# -

repeat php curl request on c# i'm trying send request server whois, using curl on c#. i have php function, works perfectly! function sendrequest() { $ch = curl_init(); curl_setopt($ch, curlopt_url, "http://whois.ripn.net"); curl_setopt($ch, curlopt_port, 43); curl_setopt($ch, curlopt_timeout, 5); curl_setopt($ch, curlopt_customrequest, "ya.ru\r\n"); $data = curl_exec($ch); curl_close($ch); return $data; } i try repeat in c #, nothing works. class curl { private static easy easy; private static string sockbuff; public void curlinit() { curl.globalinit((int)curlinitflag.curl_global_all); } public void req() { easy = new easy(); sockbuff = ""; try { easy.writefunction wf = new easy.writefunction(onwritedata); easy.setopt(curloption.curlopt_url, "http://whois.ripn.net"); easy.setopt(curlopti...

postgresql - psql won't login, while pgAdmin logs me in successfully? Wrong command? -

i have remote machine , trying log-in postgres database following command (run linux root user via ssh , i.e. locally on machine): # psql -d mydatabase -u postgres -w password user postgres: <here goes password> psql: fatal: peer authentication failed user "postgres" for reason fails (tried ~5 times). but when login same database using pgadmin (i.e. remotely) same role (postgres) , same password, logs in every time. what's wrong psql command use? if correct, can suggest troubleshooting steps? edit: problem in pg_hba.conf remote , local connections treated differently. remote ones configured properly. question why locals don't work. for locals, have in pg_hba.conf : # "local" unix domain socket connections local peer # ipv4 local connections: host 127.0.0.1/32 md5 do understand correctly localhost connections first tries peer authentication, ...

ios - CocoaPods Duplicate issue -

i reinstalled cocoapods because having strange issue installing latest podfile (apparently issue had xcode 7.0). anyway, project not build , seems there bunch of duplicates symbols everywhere of sudden , trying hard not freak out lol. there 400 lines copy first little bit, pattern same throughout , different libraries used in project here have tried far: cleaning project reinstalling , installing cocoapods again remove libpods.a can please me? here error below: thank you! duplicate symbol _objc_ivar_$_fmstatement._query in: /users/tedmac/library/developer/xcode/deriveddata/testproject-bgdrygtyrbfgjfancdtafrzibzkq/build/products/debug-iphoneos/libfmdb.a(fmdatabase.o) /users/tedmac/library/developer/xcode/deriveddata/testproject-bgdrygtyrbfgjfancdtafrzibzkq/build/products/debug-iphoneos/libpods-fmdb.a(fmdatabase.o) duplicate symbol _objc_ivar_$_fmdatabase._checkedout in: /users/tedmac/library/developer/xcode/deriveddata/testproject-bgdrygtyrbfgjfancdtafrzibzkq/build/p...

asp.net - Visual Studio 2015 SQL Server Data Tools missing “Add Table” option -

i have added localdb project in visual studio 2015 , trying add tables it. not see 'add table' item on menu, options see 'refresh' , 'properties'. according microsoft, ssdt comes preloaded vs2015, there no option add new table. missing something? i tried repairing vs , rebooting vs not working.. make sure using correct view, also, here tutorial local db. if have trouble following it, please let me know step having trouble at. https://msdn.microsoft.com/en-us/library/ms233763.aspx i don't giving link answers, there there me sum up... if work you, please post step having trouble before, future people.

Pseudo inverse (SVD) of a singular complex square matrix in C/C++ -

singular complex matrix 2 n x 2 n n 3; 4 or 5. how calculate singular value decomposition in c/c++? input matrix r in form y*y' ()' transjugate. eigenvectors in u main output. consider following matlab code: [u,d,v]=svd(r); en=u(:,n+1:m); % first few eigenvectors out enen = en*en'; most of c/c++ libraries (e.g. opencv) support matrix inversion , svd real matrices. in non-singular case r = re(r) + j*im(r) resolution helps. upper half of inverted [re(r) -im(r); im(r) re(r)] gives r -1 when complex. numerical method key here, many suggested armadillo , eigen instead of implementing custom error prone solution. what think? choice , why? let a matrix , a* conjugate transpose. matrix a.a* hermitian. positive semi-definite https://en.wikipedia.org/wiki/conjugate_transpose in case, there no fundamental difference between svd , eigenvalue decomposition. http://cims.nyu.edu/~donev/teaching/nmi-fall2010/lecture5.handout.pdf hence, routines of l...

database - Aerospike Error: (9) Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0 -

im new aerospike...! when im trying insert record database show timeout error like... aql> insert test.student (pk, emp_id, name, age) values ('k003', 'bp003', 'sai', 25) error: (9) client timeout: timeout=1000 iterations=1 failednodes=0 failedconns=0 and 1 more thing.... i turn off wifi , run same command @ time didn't show error , command runs. aql> insert test.student (pk, emp_id, name, age) values ('k003', 'bp003', 'sai', 25) ok, 1 record affected. so means...? can me out of this.....! it means should increase timeout parameter. depending how far database, 1 sec may not enough.

html5 - Validate fields on html page with php -

please find code of index.html , submit.php file. of loopo , both working perfect. struggling excatly put validation code (in index.html file or submit.php file). using html5 input types in html file , dont know validation has happen in submit.php file. have multiple forms , made validations.php suggested. not understanding error messages been shown? can suggest location in submit.php file should add these validations editing submit.php file? regexp email ( '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/' ) regexp phone ( ^(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?[789]\d{9}$ ) index.html file <form method="post" action="submit.php"> <div class="box"> <div class="cl"><input type="text" name="name" placeholder="name" /></div> <div class="cl"><input type="text" name="city" placeholder="c...

regex - How to match a field in the middle or the end of a line with separators? -

sorry title, don't know how explain problem in 1 sentence. i'm trying match field in log don't know if it's in middle of line or @ end of it. example 3 lines: b=this short sentence c=see a=hello world c=see b=this short sentence a=hello world a=hello world b=this short sentence c=see i'd value of "c" field (see soon). problem last line, there no separator @ end of string. this tried. this 1 doesn't match last line it's last field: c=([^=]+) \w+= this 1 works looks over-complicated: c=([^=]+)(?: \w+=|$) how this? you regex fine, have simplified beginning: c=.*?($|\n|(\w=)) you can try out here: https://regex101.com/r/on8cs2/1

How do i do a left join of two tables and exclude out the row with max count -

create view servicepopularityview select dog.petid, dog.petname [name], dog.petbreed [breed], dog.petdateofbirth [date of birth], dog.petgender [gender], dog.ownerid, count(groominghistory.serviceid) [count] dog left join groominghistory on dog.petid= groominghistory.petid group dog.petid, dog.petname, dog.petbreed, dog.petdateofbirth, dog.petgender, dog.ownerid; i have tried multiple ways found online has given me aggregate errors or cannot use clause. i wish find way left join tables leaving me without row has common serviceid used. there multiple "dogs" share each service. i beginner @ this. create view servicepopularityview select dog.petid, dog.petname [name], dog.petbreed [breed], dog.petdateofbirth [date of birth], dog.petgender [gender], dog.ownerid, count(groominghistory.serviceid) [count] dog left join groominghist...

c# - How to use newrelic custom metrics with azure web job? -

i have web job using c# add custom metrics this newrelic.api.agent.newrelic.incrementcounter("incrementcounter"); from can tell though need non iis agent can't find information on implementing web job. does know of way set up?