Posts

Showing posts from April, 2011

How plot a messy random-size circles in MATLAB? -

Image
i going draw figure such below picture in matlab r2014b: . this figure consists of many circles different (random) colors , random sizes. how possible plot such figure in matlab r2014b? without spelling out code: pick initial circle, e.g. position [0,0] , radius 1. initialise list positions , radii. pick random position , radius r . if circle not in big 1 (i.e. sqrt(pos(1)^2+pos(2)^2) + r > 1 ) continue 3. if overlap other circles (distance between positions > sum of radii), continue 3 add circle list, continue 3 update: example alright, wanted try this. i'm sure not best implementation, but: % set number of circles plot n = 200; radii = zeros(n, 1); pos = zeros(n, 2); allcolours = lines(n); % main loop idx = 1:n is_good = false; % generate random positions , radii until have hit while ~is_good pos(idx, :) = rand(1, 2)*2 - 1; radii(idx) = rand * (1 - max(radii)); if ((sqrt(sum(pos(idx, :).^2)) + radii(idx) )...

javascript - Cordova FileTransfer not sending custom headers -

i try send custom header cordova filetransfert when check in php function getallheader(), 'i not find custom header. var options = new fileuploadoptions(); options.filekey = "picture"; options.filename = imagedata.substr(imagedata.lastindexof('/')+1); options.mimetype = "image/jpeg"; var headers={'headerparam':'headervalue'}; options.headers = headers; var ft = new filetransfer(); ft.upload(imagedata, url, succesfiletransfer, errorfiletransfer, options); in php check headers : getallheaders(); , not find header sended previously. thank help php doesn't show headers posted via cordova filetransfert. think header sent protected. the header can captured in php via portion of code : $this->header = getallheaders(); $this->uid = (isset($this->header['uid']) && !empty($this->header['uid'])?$this->header['uid']:null); echo $this->uid; //return user id sent via post ...

jquery - VF page for line items in related list of opportunity.! -

i had created vf page related list of line items,i trying replace related list vf page. struck these things.please me. 1.i having 2 record types has different fields display on page layout. how can this? 2.i want give show more option user on standard layout.so when clicked on it,it should show products/line items. 3.i want give sorting ability on 1 field.its custom sorting. how can this?using jquery ??i not aware of jquery.please guide me. 4.i created action header edit , del links.but del link doesnt work.it takes me url no longer exists. ​please me. this vf page: <apex:page standardcontroller="opportunity"> <apex:form > <apex:pageblock title="products (standard price book)"> <apex:pageblockbuttons location="top" > <apex:commandbutton action="{!urlfor($action.opportunitylineitem.addproduct, id)}" value="add product" /> <apex:commandbutton action=...

java - HttpTransportSE .call() method has no action -

i'm trying make android app gets weather based off zipcode enter, , displays time in est , gmt format. using webservices (wsdls) , have code written access it, code below: public void sendmessage(view view) { soap_action = "http://ws.cdyne.com/weatherws/getcityweatherbyzip"; namespace = "http://ws.cdyne.com/weatherws/"; method_name = "getcityweatherbyzip"; url = "http://wsf.cdyne.com/weatherws/weather.asmx?wsdl"; txtzip = (edittext) findviewbyid(r.id.zipcode); temp = (textview) findviewbyid(r.id.displaytemp); soapobject request = new soapobject(namespace, method_name); propertyinfo property = new propertyinfo(); { property.name = "zipcode"; property.setnamespace(namespace); property.type = propertyinfo.string_class; property.setvalue(txtzip.gettext().tostring()); } request.addproperty(property); //request.addproperty("zipcode", txtzip...

HTML/CSS wrapping problems -

can me wrapping stuff... when resized browser window starts move around. managed fix one: #wrapper { margin-left:auto; margin-right:auto; width:960px; } but website tiny. want full screen, not 960px width.. when make width , height auto, starts move again. do? there problem styling, use percentage every measure, means adapt position based on parent side, parent window size here. so it's normal everthings moving if don't limit wrapper width. you can use min-width handle this. #wrapper { margin: 0 auto; min-width:960px; }

windows - Win 7, 64 bit, dll problems -

i have problem our executable. i'm running c++ 32-bit executable on win-7 64-bit development box has ms applications (visual studio 2008 + 2010, tfs, sdk, ms office)... , still running fine. now got client installation of same program , wwas asked test clean win-7 installation. got win-7 64-bit vm ware , updated win-7 sp 1 (the same version developer box tunning). while on developer box fine program not work vw ware (30 days trial) box. the x86 dependency walker telling me following dlls missing: api-ms-win-core-com-l1-1-0.dll api-ms-win-core-winrt-error-l1-1-0.dll api-ms-win-core-winrt-l1-1-0.dll api-ms-win-core-winrt-robuffer-l1-1-0.dll api-ms-win-core-winrt-string-l1-1-0.dll api-ms-win-shcore-scaling-l1-1-0.dll dcomp.dll gpsvc.dll ieshims.dll i googled api-ms-win-... dlls , found should part of win-7 (some sites claiming belong win-8 , win 2012 server though). i tried suggested fixes found, are: running 'sfc /scannow' installing vi...

c# - How do I scale the graphics of a game? -

Image
i'm making game in c# , xna 4.0. it's pretty finished, want add settings players can change window size if want to. current setup goes this: void initialize() { //the window size initally 800x480 graphics.preferredbackbufferwidth = 800; graphics.preferredbackbufferheight = 480; graphics.applychanges(); } void update() { //if player completes action, window size changed if (windowsizechanged) { graphics.preferredbackbufferwidth = 1024; graphics.preferredbackbufferheight = 720; graphics.applychanges(); } } using code, game looks @ specific resolutions: 800x480 1024x720 as can see, when window size changed not affect actual graphics of game. sprites , hitboxes of of objects stay same size, instead fill small box in corner of screen rather entire window. can tell me how can scale sprites fill window? assume need use matrix of sort, can point me in right direction? edit: here's draw code. void draw(game...

javascript - Is Node.js native Promise.all processing in parallel or sequentially? -

i clarify point, documentation not clear it; q1: promise.all(iterable) processing promises sequentially or in parallel? or, more specifically, equivalent of running chained promises p1.then(p2).then(p3).then(p4).then(p5).... or other kind of algorithm p1 , p2 , p3 , p4 , p5 , etc. being called @ same time (in parallel) , results returned resolve (or 1 rejects)? q2: if promise.all runs in parallel, there convenient way run iterable sequencially? note : don't want use q, or bluebird, native es6 specs. is promise.all(iterable) executing promises? no, promises cannot "be executed". start task when being created - represent results - , you executing in parallel before passing them promise.all . promise.all await multiple promises. doesn't care in order resolve, or whether computations running in parallel. is there convenient way run iterable sequencially? if have promises, can't promise.all([p1, p2, p3, …]) (which not h...

jsf - Primefaces commandButton actionListener not working inside notificationBar -

i using pf 5.2 web app. wanted use notificationbar reside data inputs , commandbutton trigger these inputs data backing bean. therefore put commandbutton inside notificationbar actionlistener not calling backing bean method. commandbutton defined id of "filterbtn". the .xhtml page code in below: <h:form> <p:notificationbar position="top" effect="slide" styleclass="top" widgetvar="bar" style="height:200px;"> <h:panelgrid columns="1"> <h:panelgrid id="filtergrid1" columns="4" > <h:outputlabel id="vhclidlbl" value="#{general.vehicleid}"/> <p:inputtext id="fmtsid" value="#{notifybean.fmtsid}" style="width:200px"/> <h:outputlabel id="serialnolabel" value="#{general.serialno}"/> <p:inputtext id="fserialno" value=...

mysql - SQL Longest Stay -

hi ask problem got.i got database of hotel , find costumer longest stay. i got 3 tables: costumer (code_costumer,name,surname), stay (code_stay,date_start,date_end), costumer_stay (code_stay,code_costumer) the script created: select datediff(date_end,date_start) dd, stay.code_stay,costumer_stay.code_costumer stay inner join costumer_stay on stay.code_stay=costumer_stay.code_stay; but cant 1 person longest stay,i that: id|code_stay|code_costumer| --------------------------- 25|xa21 |1001 | 8 |xb24 |1005 | 7 |xb30 |1003 | select datediff(date_end,date_start) dd, stay.code_stay,costumer_stay.code_costumer stay inner join costumer_stay on stay.code_stay = costumer_stay.code_stay order dd desc limit 1

.htaccess - redirecting in htaccess with advanced method -

how can redirect urls in .htaccess? for example, want send login url user's email this: http://any.com/login.php?id=eurydmd315&amp;=yeyss31541-refid=0004599538803325339 when user using mobile device, user redirected to: http://mobile.any.com/login.php?id=eurydmd315&amp;=yeyss31541-refid=0004599538803325339 this can accomplished redirecting detecting mobile browsers (via user-agents), example android , iphone , , blackberry . the below can used: rewriteengine on rewritebase / rewritecond %{http_user_agent} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [nc,or] rewritecond %{http_user_agent} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\...

c# - ListBox SelectionChanged only once? -

i have listbox add items to. each time select item object of person person properties should showed in textboxes. person have person properties age, name, sex , on. my listbox selection changed event triggers 1 time or on new added items. doesn't trigger when click , not added. mainwindow.xaml.cs namespace gui_wpf_eksamen { /// <summary> /// interaction logic mainwindow.xaml /// </summary> public partial class mainwindow : window { backlog bl = new backlog(); public mainwindow() { initializecomponent(); datacontext = bl; this.prioritycombobox.items.add("high"); this.prioritycombobox.items.add("medium"); this.prioritycombobox.items.add("low"); } private void addtoproductbacklogbtn_click(object sender, routedeventargs e) { this.productbackloglist.items.add(bl); this.nametextbox.text = string.empty; } private void productbackloglist_selecti...

c# - How to split Environment.NewLine? -

i want count number of lines in text. below works fine: int numlines = copytext.split('\n').length - 1; however, i've been using system.environment.newline in whole of code , when try: int numlines = copytext.split(system.environment.newline).length - 1; it keeps bringing red wriggly line underneath stating cannot convert string char. been trying rectify no luck. have ideas? to split on newline, can use following: copytext.split(new string[] { system.environment.newline }, stringsplitoptions.none).length - 1; here reference overload uses string array. note system.environment.newline of type system.string . on windows 2 character string: \r\n , on unix systems 1 character string: \n . why cannot use char. wikipedia has article on newlines: https://en.wikipedia.org/wiki/newline i recommend reading it.

I am using the VBA DateSerial function to separate dates in a string, but Excel Ends Sub when year in string is '1000'. What am I doing wrong? -

i using vba dateserial function separate dates in string, , populate them on worksheet excel ends sub when year in string '1000'. here example: string data: 2012-01-012012-03-01 2013-01-012013-03-01 1000-01-011000-01-01 vba code: private sub worksheet_change(byval target range) if not intersect(target, columns(1)) nothing on error goto safe_exit application.enableevents = false dim rng range, str string, rw long each rng in intersect(target, columns(1)) str = rng.value if len(str) >= 8 sheet2 rw = .cells(rows.count, 1).end(xlup).offset(1, 0).row .cells(rw, 1) = dateserial(left(str,4), mid(str, 6, 2), mid(str, 9, 2)) .cells(rw, 2) = dateserial(mid(str, 11, 4), mid(str, 16, 2), mid(str, 19, 2)) end end if next rng end if safe_exit: application.enableevents = true end sub no matter how many...

android - Virtualbox on Genymotion show an Error when i tried to install it -

hi had problem installing genymotion virtualbox . when have finished downloading genymotion virtualbox genymotion website run setup it's show me installation window . clicked next until warning window came http://im60.gulfup.com/hgkptf.png clicked yes install progressive bar has rolling , when clicked finish it's show me small window message says "installation failed ..." http://im60.gulfup.com/ryshxe.png that's , hope me. i have windows 8.1 64 bit , version of virtualbox 4.3.28 . there isn't enough detail here troubleshoot. try following virtual boxes logging steps here , reviewing logs see if can more detail: https://www.virtualbox.org/wiki/msi_logging note installing part of genymotion install can choose manual option or download , install virtual box separately virtual box website. genymotion indicates pre-existing virtual box installation should fine https://www.genymotion.com/#!/developers/user-guide#installing-genymotion . ...

html - Strange Output from Python urllib2 -

i read source code of webpage using urllib2; however, i'm seeing strange output i've not seen before. here's code (python 2.7, linux): import urllib2 open_url = urllib2.urlopen("http://www.elegantthemes.com/gallery/") site_html = open_url.read() site_html[50:] which gives output: '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xe5\\ms\xdb\xb6\xb2\xfel\xcf\xe4?\xc0<s[\x9a\x8a\xa4^\xe28u,\xa5\x8e\x93\xf4\xa4\x93&\x99:9\xbdw\x9a\x8e\x07"' does know why it's showing output , not correct html? the http response being sent site gzipped content , hence strange output. urllib not automatically decode gzip cntent. there 2 ways solve - 1) decode zipped content before printing - import urllib2 import io import gzip open_url = urllib2.urlopen("http://www.elegantthemes.com/gallery/") site_html = open_url.read() bi = io.bytesio(site_html) gf = gzip.gzipfile(fileobj=bi, mode="rb") s = gf.read() print s[50:] 2) use...

css - Javascript Mobile sites -

i using following javascript detect whether site viewed on mobile device works redirect (see example 1); however, possible amend amends font size of element or class (the original font-size contained within external style sheet) when same condition satisfied, being idevice detected. //original code: (javascript) // idevice var idevice = { // android android: function() { return navigator.useragent.match(/android/i); }, // blackberry blackberry: function() { return navigator.useragent.match(/blackberry/i); }, // apple ios: function() { return navigator.useragent.match(/iphone|ipad|ipod/i); }, // opera browser opera: function() { return navigator.useragent.match(/opera mini/i); }, // windows mobile windows: function() { return navigator.useragent.match(/iemobile/i); }, // function: (idevice) any: function(){ return (idevice.android() || idevice.blackberry() || idevice.ios() || idevice.opera() || idevice.windows()); } }; <!-- working html --> { if( idevice.an...

AutoHotkey SendInput Problems -

[key mappings of new media remote] http://i.stack.imgur.com/ivmsk.png using autohotkey want interrupt keyboard keys sent appskey , browser_home , send key instead. unfortanately best can manage send key key function. f3::sendinput {a} browser_home::sendinput {a} browser_home::sendinput browser_home:: a the first line 'f3 a' works intended; f3 key outputs letter a. 2nd , 3rd line browser_home launches browser home. 4rd line launches browser_home outputting letter a. anyone know i'm doing wrong / know how fix script output without launching browser home? according documentation under hotkey: $ necessary if script uses send command send keys comprise hotkey itself, might otherwise cause trigger itself. $ prefix forces keyboard hook used implement hotkey, side-effect prevents send command triggering it. $ prefix equivalent having specified #usehook somewhere above definition of hotkey try , report back: $browser_home::...

asp.net core - How to run xUnit 2.1.0-beta-* for DNX projects with ReSharper -

how run xunit 2.1.0-beta-* dnx projects resharper? when resharper find tests, fails on running them system.io.filenotfoundexception indicates unit test assembly not found. due understanding, dnx projects not generate assemblies in \bin folder when compiled visualstudio 2015. there way force dnx projects generate assemblies tranditional class libraries projects? any ideas? dnx tests aren't supported resharper or xunit plugin. it's whole new execution model, , hasn't yet been implemented resharper. i'd expect see support dnx , asp.net stabilise , near release.

arrays - What is this trying to tell me? -

i reading book "how solve computer" rg dromey. stuck on sentence trying explain termination of loops. here goes problem: suppose wish establish array of n elements in strictly ascending order (i.e. a[1] < a[2] < ... < a[n] ) . can use following instructions: a[n+1] := a[n]; := 1; while a[i] < a[i+1] := i+1 (now if n number of elements, i stand in case? stand values?) if n assigned value 5 , data set 2, 3, 5, 11, 14, first assignment prior loop result in array configuration below: (this confused.) a[1] a[2] a[3] a[4] a[5] a[6] 2 3 5 11 14 14 the 2 14's guarantee test a[i] < a[i+1] false when i = n , loop terminate correctly when i = n if not before. (this confusing.) i index := 1; means equal 1 := i+1 means add 1 n = 5 a[5] = 14 a[5+1] = a[6] = 14 14 < 14 false - loop terminates

c# - javascript not working when updating the panel -

there several tabs in page , in 1 tab trying change other drop down when selecting first drop down. using updatepanel , script manager that. problem wrote datepicker javascript function , works fine first time if not select drop down box when select drop down box javacript not work. helpful if can identify doing wrong. <asp:scriptmanager id="scriptmanager1" runat ="server"></asp:scriptmanager> <div id="requesthistory" class="tab-pane"> <asp:updatepanel id="updatepanelcrhistory" runat="server" cssclass="row" defaultbutton="btnsearch" updatemode="conditional"> <contenttemplate> <div class="colmd-3 col-sm-3 col-xs-3 responsive-filterbar"> <asp:dropdownlist runat="server" id="drpcrhistoryframework" clientidmode="autoid" datatextfield="title" datavaluefield="frameworkid" cssclass="for...

c - I cannot run a ELF-format program .The shell tells me no such file or directory -

my environment ubuntu 14 32bits. write 3 c files called main.c,foo.c,and bar.c respectively. codes simple. first source code main.c #include<stdio.h> extern void foo(); int main(){ foo(); return 0; } the second source code foo.c #include<stdio.h> void foo(){ printf("hi,i foo."); bar(); } the last 1 bar.c #include<stdio.h> void bar(){ printf("hi,i bar."); } all files above put same folder called test. (its absolute path /home/jack/desktop/test) issue commands : $ gcc -fpic -shared -wl,-soname,libbar.so.1 -o libbar.so.1.0.0 bar.c $ ln -s libbar.so.1.0.0 libbar.so $ gcc -fpic -shared -wl,-soname,libfoo.so.1 -o libfoo.so.1.0.0 foo.c -lbar -l. $ ln -s libfoo.so.1.0.0 libfoo.so $ gcc -c main.c $ ld -rpath /home/jack/desktop/test -e main -o main main.o -l. -lfoo -lbar then run executable file called main. $./main but shell return string below bash: ./main: no such file or directory. but main file exists in curren...

VB.Net add count for each -

i have function search count of multiple words in text file. dim textlog = file.readalltext("d:\1.txt") dim count = regex.matches(textlog, "test1").count dim count1 = regex.matches(textlog, "test2").count label1.text = (count) label4.text = (count1) it's working fine, want pass words parameter function. , have done this: dim values string values = words dim wordlist string() = nothing wordlist = values.split(",") dim w string each w in wordlist ''''''' ' search function here ''''''' next w now want count them, knowing words dynamic, meaning put many words want. in words, how can know how many words being input , find count of them, don't know how return them via function. not sure regex effective way such thing, here solution based on own code: function countwords(filename string, wordlist string()) string(,) dim returnvalue string(,)...

How to check and create dynamic email aliases with flurdy and php? -

i having sns allows public users register , create own profiles. want create email alias when new user registers. for example when "joe" registers, want offer him email address "joe@mydomain.com". i have setup mail server using instructions given @ http://flurdy.com/docs/postfix/#install i have gone through flurdy documentation , done lot of research create email alias via php. couldn't find useful one. ideas? if want display offers above text box, place in <div> above text box email or right side of text box. if want input offer right inside text box, try value="<?php echo $email" ?> set $email variable $email = $_post['first_name']."_".$_post['last_name']."@yourdomain.com"; add event jquery onkeyup= event last_name text box.

java - What does activemq broker mean? -

i'm new activemq , jms , started exploring how hello world program works. i've installed activemq server , run it. now, created desctop application , copy-and-paste apache_activemq_official_hello_world it. when tried run it, got following exception: caught: javax.jms.jmsexception: not create transport. reason: javax.management.instancealreadyexistsexception: org.apache.activemq:brokername=localhost,type=broker javax.jms.jmsexception: not create transport. reason: javax.management.instancealreadyexistsexception: org.apache.activemq:brokername=localhost,type=broker @ org.apache.activemq.util.jmsexceptionsupport.create(jmsexceptionsupport.java:35) @ org.apache.activemq.activemqconnectionfactory.createtransport(activemqconnectionfactory.java:252) @ org.apache.activemq.activemqconnectionfactory.createactivemqconnection(activemqconnectionfactory.java:265) @ org.apache.activemq.activemqconnectionfactory.createactivemqconnection(activemqconnectionfactory.jav...

cygwin - Calling jam from Makefile does not work -

in makefile trying go different directory , invoke jam like: jam-build: cd <somedirectory> && jam <target> this did not work, caused "unknown target. please edit 'jamrules'." though exact same command on command line works perfectly. know jam can find target. i tried jam-build: sh -c "cd <somedirectory> && jam <target>" and variations same results. works command line. any other command instead of "jam " works expected (ls, ps, cat, pwd). update: creating makefile in <somedirectory> , running make there gives same result. any ideas why happens appreciated. and, of course, things try. i'm running cygwin latest gnu make, ft-jam 2.5.2.

java - How to programmatically set the SSL context of a Axis client? -

in old project using client developed axis 1.4 call soap web service. web service use mutual authentication mechanism, have private certificate installed inside keystore , public key installed inside truststore. the soap client used inside task of bpm process. can't , don't want use jvm global truststore , keystore. can't configure programmatically jvm global trustore , keystore: // keystore system.setproperty("javax.net.ssl.keystore", filekeystore); system.setproperty("javax.net.ssl.keystorepassword", pwdkeystore); system.setproperty("javax.net.ssl.keystoretype", "pkcs12"); // truststore system.setproperty("javax.net.ssl.truststore", filetruststore); system.setproperty("javax.net.ssl.truststorepassword", pwdtruststore); system.setproperty("javax.net.ssl.truststoretype", "jks"); an approach force synchronize process on jvm properties , don't want that. moreover, there other java pr...

jquery - Extract Latitude and Longitude by Javascript from String -

how extract latitude , longitude below url using javascript/regex . https://www.google.co.in/maps/search/wipro+technologies/@ 12.974267 , 80.2238546 ,13z/data=!3m1!4b1?hl=en i want 12.974267 assigned variable , 80.2238546 longitude variable thanks in advance without regex: fiddle var url = 'https://www.google.co.in/maps/search/wipro+technologies/@12.974267,80.2238546,13z/data=!3m1!4b1?hl=en'; var spliturl = url.split('@'); var coords = spliturl[1].split(','); console.log(coords[0]); // 12.974267 console.log(coords[1]); // 80.2238546 regex: /@\d+\.\d+,\d+\.\d+/

c# - How to split a regex and not display text in text file in one line -

i have 2 little question struggling with. both dealing lines really. 1: how can place following regex code split()? regex(@"\r\n|\n|\r", regexoptions.singleline) int num = copytext.split().length - 1; //copytext string 2: when write text file rich text box, text in text file displayed on 1 line. how can text displayed looks in rich text box? private void write(string file, string text) { //check see if _parsed file exists if (file.exists(file)) { //write _parsed text file using(streamwriter objwriter = new streamwriter(file)) { objwriter.write(text); objwriter.close(); } } else { messagebox.show("no file named " + file); } } private void btnreplace_click(object sender, eventargs e) { // replace -ing ending words xxxxxx code goes here... //write richtextbox2 wholetext = richtextbox1.text + oldsummary + copytext + newsummary; write(second_file, wholetext); ric...

python - ipython use "%run" to execute a subset of a file -

is there way can use %run execute subset of file? something this: $ ipython in [1]: %run my_code.py -l 20 100 # executes lines 20-100 in ipython interpereter %run doesn't have option this. can see options takes doing %run? inside ipython. however, can bring specific range of lines file interactive prompt, , run there. syntax looks like: %load -r 20-100 my_code.py

javascript - Execute controller function in Grails via Ajax -

i novice ajax in grails. want try execute controller method gsp-code ajax. this part of gsp-code: <g:select optionkey="id" name="region.id" id="region" from="${region}" noselection="[null:' ']" onchange="categorychanged(this.value);" ></g:select> <div> <b>sub-category: </b> <span id="subcontainer"></span> </div> <script> function categorychanged(regionid) { $.ajax({type:'post',data:'regionid='+regionid, url:'restorator/region/categorychanged',success:function(data,textstatus){jquery('#subcontainer').html(data);},error:function(xmlhttprequest,textstatus,errorthrown){}}); } </script> in url parameter of $ajax call: restorator package, region controller in , categorychanged action. this controller: class r...

api - PHP cURL not sending POST Data -

i trying send data php rest service. seems make call correctly api doesnt send post data. the code : <?php $name="abcd"; $id="xyz"; $service_url = 'service/url'; $curl = curl_init($service_url); $curl_post_data = array( $name,$id); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_post, true); curl_setopt($curl, curlopt_postfields, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); ?> i manipulate response provided.can tell doing wrong here. there server side validation, code : private string validateandgetclientname(httpservletrequest request) throws invalidrequestexception { string clientname = request.getparameter("name"); if (isempty(clientname)) { throw new invalidrequestexception("client name cannot empty."); } return clientname.trim(); } paramters in http queries make sense in associativ...

angularjs - Passing a model to a custom directive - clearing a text input -

what i'm trying achieve relatively simple, i've been going round in circles long, , it's time seek help. basically, have created directive comprised of text input , link clear it. i pass in id via attribute works in fine, cannot seem work out how pass model in clear when reset link clicked. here have far: in view: <text-input-with-reset input-id="the-relevant-id" input-model="the.relevant.model"/> my directive: app.directive('textinputwithreset', function() { return { restrict: 'ae', replace: 'true', template: '<div class="text-input-with-reset">' + '<input ng-model="inputmodel" id="input-id" type="text" class="form-control">' + '<a href class="btn-reset"><span aria-hidden="true">&times;</span></a>' + ...

load balancing - Activex doesn't work with apache balancer -

i'm having problem run , exe browser using activex. i have apache balancer , 4 managedserver on weblogic. the problem is: browser---> servera works open exe browser---> apache-balancer---> server(a,b,c,d) random server doesn't work exe doens,t run. any help? carlo are using proxy balancer load balancing? there might possibility session stickiness not working .try configure apache , weblogic using wls web server proxy plugin apache designed weblogic load balancing , default having session stickiness enabled. check below link http://middlewaresnippets.blogspot.in/2015/05/working-with-apache-http-server.html

java - Generic argument 'extends' multiple classes -

i have question generic arguments, code have: public <t extends renderable, box> void setbackbox(t bb) { ... } as see can give parameter bb object extends box & renderable. eclipse gives following waring: 'the type parameter box hiding type box'. how can fix this/work around it? here, you're defining 2 type-parameters: t extends renderable box box alias of second method-scoped type-parameter , if have 1 same name (class-scoped), method-scoped 1 hide it. that's why eclipse throws warning. if want t extend both renderable , box , have do: public <t extends renderable & box> void setbackbox(t bb) also note when type-parameter(s) extend multiple types, you're allowed use one class , has first in list. example, if box class, correct definition be: public <t extends box & renderable> void setbackbox(t bb)

wordpress - Buddypress: Why upload avatars not work -

i install buddypress in site, , when user register in site , try change avatars, cannot show button i see link not work ... how can solve error buddypress codex link please select checkbox form dashboard -> settings -> buddypress-> setting -> profile settings. select profile photo uploads: allow registered members upload avatars.

css - HTML Footer on Bottom under all content -

Image
im trying footer on bottom of page, got part on bottom of page, overlapping content area called"portfolio list" looks now: as can see footer overlapping bottom part of portfolio list. css part: .container { position: relative; width: 1000px; margin: 0 auto; -webkit-transition: 1s ease; -moz-transition: 1s ease; -o-transition: 1s ease; transition: 1s ease; } #portfoliolist .portfolio { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; width:31%; margin:1%; display:none; float:left; overflow:hidden; } .portfolio-wrapper { overflow:hidden; position: relative !important; background: #666; cursor:pointer; } .portfolio img { max-width:100%; position: relative; } .portfolio .label { position: absolute; width: 100%; height:40px; bottom:-40px; } .portfolio .label-bg...

mysql - SQL query for run-length, or consecutive identical value encoding -

my goal take set of data ordered id , return resultset indicates number of consecutive rows val column identical. e.g. given data: | id | val | | 1 | 33 | | 2 | 33 | | 3 | 44 | | 4 | 28 | | 5 | 44 | | 6 | 44 | i see result: | id | val | run_length | | 1 | 33 | 2 | | 3 | 44 | 1 | | 4 | 28 | 1 | | 5 | 44 | 2 | the id column in resultset optional. in fact, if makes harder, leave column out of result. sort of having because "pins" resultset particular location in table. i interested in result in free database engines. order of preference solution is: sqlite postgres mysql oracle sql server sybase i'll choose #2 on list, because incredibly painful in sqlite single query. following standard sql: select min(id), val, count(*) runlength (select t.*, (row_number() on (order id) - row_number() on (partition val order id ) grp data t ) t...

sql - Apex. Calling proc within htp.prn? -

i'd know, how call proc under button in apex. here steps perform me: -adding blank page in application -adding button exp. bellow region -adding dynamic action pl/sql button -choosing action execute pl/sql -adding pl/sql code below pl/sql code: begin wycen_pojazd('audi', 'a4', 2013, 'diesel', 2000) end; pl/sql procedure i'm talking about: create or replace procedure wycen_pojazd ( p_marka in baza_eurotax.marka%type, p_model in baza_eurotax.model%type, p_rok_prod in baza_eurotax.rok_produkcji%type, p_paliwo in baza_eurotax.rodzaj_paliwa%type, p_pojemnosc in baza_eurotax.pojemnosc%type ) ex_wycena baza_eurotax.wycena%type; begin select wycena ex_wycena baza_eurotax marka = p_marka , model = p_model , rok_produkcji = p_rok_prod , rodzaj_paliwa = p_paliwo , pojemnosc = p_pojemnosc; if ex_wycena > 0 htp.prn('wycena katalogu eurotax' || <br > || 'twój pojazd...

jquery - remove and replace item from object in array javascript -

i have read , tried of posts of on subject, reason none of answers providing desired effect. i have written shopping basket program , once user clicks the'buy now' button wish make post request containing object users order. problem the user has option purchase 3 different items. each time user clicks on item, html input box, increase amount wish purchase want update object contain latest amount chosen. in simplest format basket, when initiated, looks : var basket = {items:[ {item:"trousers", quantity:1, cost:"10"}, {item:"trainers", quantity:1, cost:"5"}, {item:"jacket", quantity:1, cost:"30"} ]} each time user clicks input button wish basket updated if user clicked increase jacket quantity of 3, , trousers 4 want object this: var basket = {items:[ {item:"trousers", quantity:4, cost:"4...

Freeradius V3 meta-attributes. Check item attributes -

i trying migrate version 2 version 3. the same unlang code worked in version 2. in version 3 same code not work. this error: /etc/freeradius/sites-enabled/default[406]: failed parsing expanded string: /etc/freeradius/sites-enabled/default[406]: %{sql:set @reset_date = '%{check:reset-date}'; select ifnull((sum(acctinputoctets)+sum(acctoutp... /etc/freeradius/sites-enabled/default[406]: ^ unknown module if remove check parser not throw errors. change '%{check:reset-date}' '%{reset-date}' . break code, because reset-date radcheck attribute, stored in radcheck table. any ideas? it's control:reset-date . we've never had check list qualifier. check items specific users file , sql modules.

Local site testing with BrowserStack and self-signed certificates -

i have started looking testing our site browserstack. however, i'm having issues live-testing (as opposed automated testing selenium, works fine) site we're developing we're serving self-signed certificate. manually approving certificate doesn't bother me as fact ajax request failing (at least on ie10) due security issues , makes impossible manually test site. an acceptable solution somehow add our self-signed cert. list of trusted root cas. however, haven't found out how upload files browserstack test environment (not sure if that's possible, really). any ideas ? i contacted browserstack issue, , formal response is: "we not support installing client certificates on remote machines. however, on our list, , we’ll keep posted." hopefully issues resolved , i'll post different answer here.

Facebook Authentication Token -

i'm building app requires facebook authentication token. google'ing end on https://developers.facebook.com/docs/facebook-login/access-tokens this names following tokens: user access token app access token page access token client token are of these facebook authentication token? if not, how one? i ended using tool here: https://smashballoon.com/custom-facebook-feed/access-token/

c++ - QT OpenCV multi threading to fetch images and display in GUI Main thread -

the basic idea i developing application 4 usb cameras, frames must fetched these cameras , displayed in qlabel @ best possible fps. fetching frames cameras sequentially results in low frame rate, though processor has 20% utilization. how think frame rate can improved? with use of multiple threads cpu utilization can increased, , there 4 threads each fetching images individual cameras, signaling , sending images gui thread(main thread) in turn display images appropriate label. current design: based on https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/ the thread class inherits qobject methods: class fetchcam1 : public qobject { q_object public: fetchcam1(cv::videocapture cap); ~fetchcam1(); public slots: void process(); cv::mat returncamframe(); signals: void finished(); }; its implementation: fetchcam1::fetchcam1(cv::videocapture cap) { this->cap = cap; } cv::mat fetchcam1::returnc...