Posts

Showing posts from August, 2011

java - ObjectInputStream$BlockDataInputStream.peekByte when using program on internet -

i created application tcp, works nice when used on local network 127.0.0.1 server refused works when client try connect him network. i don't know error means , how resolve , can't anderstand application works on lan. public class reception { inputstream inobjet = null; bufferedreader instring = null; objectinputstream recvec2i = null; public reception(socket socket) { try { this.inobjet = socket.getinputstream(); this.instring = new bufferedreader(new inputstreamreader(socket.getinputstream())); this.recvec2i = new objectinputstream(inobjet); } catch (ioexception ex) { logger.getlogger(reception.class.getname()).log(level.severe, null, ex); } } public vecteur2i recevoir() { vecteur2i = new vecteur2i(); try { = (vecteur2i) recvec2i.readobject(); } catch (ioexception | classnotfoundexception ex) { logger.getlogger(reception.class.getname()).log(level.severe, null, ex); = new vecteur2i(10

javascript - Stretching hover background to full height -

i trying adapt use of jscript make links in text change full bleed background on single web page, hacked attempt here: http://testarama.webege.com/ my problem smaller screens... if resize window notice hover backgrounds fill area size of initial window before scrolling down... if scrolled down , using bottom link displays cutoff original background poking out (the test explain better i!). i've tried various containers , background-attach rules , can't seem around this... i'd use trick site if can shed light on going wrong that'd great. index.htm = <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>tester</title> <meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=1"> <link rel="stylesheet" href="style.css"> <script src="http://code.jquery.com/jquery

java - How to close current JFrame? -

i have read similar topics did find answer there. i created jframe close button. after click want close current window. try setdefaultcloseoperation(jframe.hide_on_close) , or setvisible(false) . public class windows { jframe frame; jframe frame1; public windows(){ } public jframe getcreateframe(){ frame1 = new jframe("create user"); frame1.setsize(500,500); frame1.setvisible(true); frame1.getcontentpane().add(new panels().getwelcomtxtlabelpanel1(), borderlayout.north); frame1.getcontentpane().add(new panels().getcreateuser(), borderlayout.south); frame1.getcontentpane().add(new panels().getuserlabel(), borderlayout.west); frame1.getcontentpane().add(new panels().getuserfield(), borderlayout.center); return frame1; } } here button. public jbutton getcancelbutton(){ cancel = new jbutton("cancel"); cancel.addactionlistener(new actionlistener() { public void actionperformed(actionevent e){ new windows().getc

javascript - How to handle multiple inputs of the same type in a html form? -

let's i've got form in can describe family: <input type="text" name="mother"> <input type="text" name="father"> <input type="text" name="child"> but want people able add infinite number of children form. can use javascript continue adding new inputs more children, wonder how should name these. child1 , child2 , child3 , etc.? , on backend loop on children? and if children need "age" input field. continue adding fields such child1_age , child2_age , child3_age ? i guess work, have feeling there's smarter way of this. know of better way handle this? tips welcome! html forms can use arrays input names. example: <input type="text" name="child[]">

android - LIBGDX: Audio PCM stutter on play (W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client) -

i'm developing casual game using libgdx few pcm sounds (i.e. 01.wav: riff (little-endian) data, wave audio, microsoft pcm, 16 bit, stereo 44100 hz), dev device motorola moto g (2 gen. aka 2014) android 5.0.2, , every time play 1 of wav sounds stutter (casually play fine) i've tested in 1.5.6 gdxversion , 1.5.7-snapshot hint flag in issue title, reading around seems related low level client/server audio protocol mismatching in communication (i.e. wrong sampling rate, checked sdk preferences tool, nothing wrong) i've followed path due known issue nuplayer, without luck last thought deprecated use of soundpool constructor vs builder way any gold thanks p.s. i've tested behaviour on motorola moto g (2° gen), 1° gen 1 , nexus 7 (all lollipop, 1 5.0.1 too) p.p.s. posted github issue on libgdx project, i'm posting here receive wider audience

wpf - PropertyChangedTrigger For Multiple Properties? -

is there way create propertychangedtrigger multiple properties share same conditions, sake of redundancy, without specifying conditions repeatedly each propertychangedtrigger? for example, when propertya, propertyb , propertyc change, want command execute in viewmodel. i thinking of extending propertychangedclass , adding dependency property of observable collection of bindings. turned out i'm not knowledgeable in how bindings monitored. then saw of old code , saw multibinding. thought work. , did multivalueconverter increments static field. i'm not sure if best solution worked. first multivalueconverter: public class incrementonpropertychangedmulticonverter:imultivalueconverter { static uint _counter=0; #region imultivalueconverter members public object convert(object[] values, type targettype, object parameter, system.globalization.cultureinfo culture) { _counter = _counter < uint.maxvalue ? _counter + 1 : 0; return _counter; } public object[] co

sql - How to get the current free disk space in Postgres? -

i need sure have @ least 1gb of free disk space before start doing work in database. i'm looking this: select pg_get_free_disk_space(); is possible? (i found nothing in docs). pg: 9.3 & os: linux/windows postgresql not have features directly expose disk space. for 1 thing, disk? production postgresql instance looks this: /pg/pg94/ : raid6 of fast reliable storage on bbu raid controller in wb mode, catalogs , important data /pg/pg94/pg_xlog : fast reliable raid1, transaction logs /pg/tablespace-lowredundancy : raid10 of fast cheap storage things indexes , unlogged tables don't care losing can use lower-redundancy storage /pg/tablespace-bulkdata : raid6 or similar of slow near-line magnetic storage used old audit logs, historical data, write-mostly data, , other things can slower access. the postgresql logs somewhere else again, if fills up, system may still stop. depends on number of configuration settings, of can't see postgresql @ all, sys

android - How to setup Listview to strikethrough item after click? -

Image
i have list of strings setup on listview in on create: //set adapter lvadapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, chosenarray); //add listview lw.setadapter(lvadapter); my question: i want setup list once item clicked, gets strike through. however, new android , haven't done before. what i've tried unsuccessfully: based on answer tried method, cross off items not visible in list well. lw.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { //cross off textview text = (textview) view; text.setpaintflags(text.getpaintflags() | paint.strike_thru_text_flag); } }); i've read there maybe way extend arrayadapter, have never done before. ideas? update: since we're running issues, here's whole code. it's within oncreate: public arrayadapter<string> lvadapter; publi

javascript - Put a button in front of all rows in jQuery DataTables -

i using jquery datatables. being populated json data database. can't figure out how display button or link in front of each record. want make when user clicks on button particular record gets added in database, button or link should contain id. please sort out problem. below code i'm using: var otable = $('#jsontable').datatable(); $.ajax({ url: 'process.php?method=fetchdata', datatype: 'json', success: function(s) { console.log(s); otable.fncleartable(); (var = 0; < s.length; i++) { otable.fnadddata([ s[i][3], s[i][4], s[i][0], // contains id ]); } }, error: function(e) { console.log(e.responsetext); } }); <table id="jsontable" class="display table table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>class number</th> <th>subject</th> <th>add</th>

html - php: how to split up a really long string -

this question has answer here: php: split long string without breaking words 5 answers i new php , have question. i've made chat-like application, working can't seem find want in searching previous threads. the user can input form field $message. so... $message = $_post['message']; the input box allows maximum of 600 characters. if user posts nothing 1 long entire string doesn't contain white space, or spaces between of string characters.. short example.. ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff if goes length, causes page break creating horizontal scroll frame. how can take $message , filter break up? taking account users posting real $message, , not accidentally split valid words etc. maybe checks see if 1 of $message array elements longer xxx amount of characters long , if break up? or what's easiest way go

xaml - How to get decimal value from Slider? -

want able value of 25.4, example. <slider x:name="slider" maximum="100.0" minimum="0.0" value="25.0" tickfrequency="2.0" tickplacement="inline"> </slider> looks needed add stepfrequency: stepfrequency="0.1"

signal processing - DSP32C doesn't have a timer but need a timer implementation -

i have old dsp32c me , wanted implement timer based control. when started reading datasheet, found out there no timer register in dsp32c. is there possible way implement function similar timer.. 'after 3seconds, this...'? thanks, since cannot solve "internally", you'll need find suitable real-time clock (rtc) component can interface dsp32c. 1 , how connect question electrical engineering stackexchange site . depending on want do, busy loop might solution: loop number of times. if don't have precise timing information , can calculate number of loops, you'll have try out stop watch , tweak loop(s) until it's taking long enough.

javascript - Two $.getJSON calls for one Google Maps api info window. Scope issue -

i trying call $.getjson twice , use data both in 1 info window. mashup display articles google news "fortune" (from rss feed) in google maps api infowindow. put click event listener , info window blocks inside $.getjson("articles.php") call code below works in far display articles can't figure out right structure display fortune since it's in separate $.getjson it's own scope. there way make work? function addmarker(place) { var image = 'http://maps.google.com/mapfiles/kml/pal2/icon31.png'; var mylatlng = new google.maps.latlng(parsefloat(place.latitude), parsefloat(place.longitude)); //make markers , push array. var marker = new markerwithlabel({ position: mylatlng, map: map, icon: image, labelclass: "labels", labelcontent: place.place_name, labelanchor: new google.maps.point(20,0), }); markers.push(marker); // getjson fortune rss feed. var fortune = []; $.ge

Grails, Spring Security core Plugin, Role Management -

i setup new project spring security core plugin. goal simple login/logout, usermanagement (crud) including roles (admin, user). admin should able create users, registration not necessary. i followed tutorial (docu): http://grails-plugins.github.io/grails-spring-security-core/guide/tutorials.html#usingcontrollerannotations now have user, role , userrole domain class , crud functionality. unfortunately role management missing. in best case role should specified admin in "create user process". another thing noticed cant add other fields generated user class. adding "string lastname" results in following error (run-app): 2015-04-22 19:50:57,749 [localhost-startstop-1] error context.grailscontextloaderlistener - error initializing application: no signature of method: test.userrole.exists() applicable argument types: (null, java.lang.long) values: [null, 1] possible solutions: exists(long, long), exists(java.io.serializable), list(), first(), wait(), last()

ios - xcode 6.3 hangs when opening organizer -

i archived project adhoc deployment , got stuck after said archive completed. now whenever click window->organizer xcode freezes up. need save archive adhoc deployment won't let me. i've tried restarting xcode , macbook. any thoughts? i don't know causing xcode (6.3.1) organiser freeze, manually cleared out archives folder , organiser returned. rm -rfd ~/library/developer/xcode/archives/* if, me, have archives want keep, remove individual archive folders date order needed , try open organiser. rm -rfd ~/library/developer/xcode/archives/2015-xx-xx

active directory - Running powershell script as multiple users -

i have different accounts server admin , workstation admin roles. want run powershell script query ad list of computers , query each computer returned check service. first part needs run server admin , second workstation admin. use 2 separate scripts. possible integrate 1 script? here 2 scripts both run on 1 computer. first script run on workstation run server admin account 1 access active directory. script creates xml file used second script. run script workstation admin account. runas.exe /user:domain\srvadmin "powershell.exe -executionpolicy bypass -command c:\output\script1.ps1" runas.exe /user:domain\wsadmin "powershell.exe -executionpolicy bypass -command c:\output\script2.ps1" script1 import-module -name activedirectory -cmdlet get-adcomputer, get-adorganizationalunit; $orgunit = @("ou=computers,dc=domain,dc=com") $computerlist = get-adcomputer -filter * -searchscope subtree -searchbase (get-adorganizationalunit $orgunit).distinguishedna

c++ - invalid conversion from `const char*' to `char*' -

#include <stdio.h> #include <string.h> #include <conio.h> #define size 20 int main( void ) { int n; //number of characters compared char s1[ size ], s2[ size ]; char *results_word; printf( "enter 2 strings: " ); gets( s1 ); gets( s2 ); printf( "\nenter number of characters compared: " ); scanf( "%d", &n ); the problem starts here results_word = strncmp( s1, s2, n ) > 0 ? " greater " : strncmp( s1, s2, n ) == 0 ? " equal " : " smaller " ; printf( "\n%sis%s%s", s1, results_word, s2 ); getche(); return 0; }//end function main so why doesn't result_word corresponding string ? the c++ error message getting says all: invalid conversion `const char*' `char*' you trying assign constant "<literal>" non constant results_word . change char *results_word; t

c# - Using Route Attributes In ASP.NET MVC 5 With Areas -

this question pertains asp.net mvc 5. i'm trying use hyphens in urls using route attributes, i'm not having luck getting work. i'm using question , this msdn blog reference. urls want have are: /my-test/ /my-test/do-something when build project , bring page i'm testing in browser, i'm getting 404 error. here code have far: // routeconfig.cs public class routeconfig { public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.mapmvcattributeroutes(); arearegistration.registerallareas(); ... } } // mytestcontroller.cs - note: file in area [routearea("mytest")] [routeprefix("my-test")] [route("{action=index}")] public class mytestcontroller : controller { [route("~/do-something")] public jsonresult dosomething(string output) { return json(new { output = output

javascript - Scale Background CSS with Slider -

i working css backgrounds ( http://css3pie.com/demos/gradient-patterns/ ) in application , want able scale design slider. here's jsfiddle . able scale x & y separately on stripes , picnic designs had play background-size:50px 50px; this: //setup variables based off css set using dropdown griditems = $(document.activeelement).val().split("; "); (i = 0; < griditems.length -1; i++) { gridsettings = griditems[i].split(":"); if (gridsettings[0]=="background-size"){ gridsize = gridsettings[1].split(" "); gridx = gridsize[0]; gridy = gridsize[1] } //on action of slide - update value $('#gridxy-'+key).on("slide", function(slideevt) { gridxy = slideevt.value; $('.draggable-' + currentlayer).css("background-size", "calc("+ gridx +" * "+ gridxy +") calc("+ gridy +" * "+ gridxy +")"); });

php - Inline "required" asterisk in Laravel form label -

Image
i'm trying add red asterisk required fields in laravel, i'm not sure how add them inline label. what i'm doing is {{ form::label('took_act_or_sat' , 'did or take sat or act?' ) }} <span style="color: red">*</span> but when label wraps second line, reason asterisk being bumped line down. so guess first part of question is: can add inline styling form label in laravel? and second part is: there way should going adding asterisk (or other marker) wouldn't issue? if it's relevant, i'm using bootstrap majority of styling if affects anything. add class label third parameter {{ form::label('took_act_or_sat' , 'did or take sat or act?', array('class' => 'required') ) }} and add asterisk css <style> .required:after{ content:'*'; color:red; padding-left:5px; } </style>

asp.net - DevExpress MVC GridView Set Cell Image -

in devexpress mvc gridview, have defined column "status". example: status | id | name | isvalid depending on boolean value of "isvalid", want show 2 different icons in "status" column each record. how can this? , best way this? i not use devexpress i'm not sure how apply, since specified gridview... typically handle in gridview rowdatabound event. status templatefield has <itemtemplate> <asp:placeholder> control , add appropriate img controls hold icons based on isvalid field each row.

wordpress - What is this type of popover ad called? -

i hate linking site describe this. on page after believe 10 seconds or so, ad popup ipage. webhostingreviewboards.com/wordpress-plugins/10-free-wordpress-plugins-for-landing-pages-to-capture-leads/ what type of popup / popover ad called? trying find plugin use on wordpress site client of mine, it's hard search when don't have specific name type of object. thank you! it's called 'modal' or call 'lightbox'. search 'wordpress timed modal plugin' , should results need.

rotation - OpenGL glMatrixMode(GL_PROJECTION) vs glMatrixMode(GL_MODELVIEW) -

what difference between placing glrotatef() after glmatrixmode(gl_projection); glmatrixmode(gl_projection); glloadidentity(); glrotatef(red, green, blue); and placing glrotatef() after glmatrixmode(gl_modelview); glmatrixmode(gl_modelview); glloadidentity(); glrotatef(red, green, blue); from documentation : glmatrixmode() specifies matrix current matrix. gl_modelview - applies subsequent matrix operations modelview matrix stack. gl_projection - applies subsequent matrix operations projection matrix stack. what means? if set current matrix mode projection (e.g glmatrixmode(gl_projection) ), expected change projection matrix. naturally, 1 of them expected next line : for orthographic projection: glortho(gldouble left, gldouble right, gldouble bottom, gldouble top, gldouble near, gldouble far); gluortho2d(gldouble left, gldouble right, gldouble bottom, gldouble top); for perspective projection: void glfrustum(gldouble left, gldouble right, gldoub

ruby on rails - Work Off ActiveJob Queue Programatically -

with delayedjob , it's possible instantiate worker complete jobs programatically: delayed::worker.new.work_off # => [num_succesess, num_failures] does activejob provide interface doing same? currently not if planned future? don't know. activejob provide interface creating new job , perform on background in limited way. activejob provide only: create new job , perform in background process specify name of queue have used ability retry job (but have specify conditions , calculate how time should wait before processed again) nice interface sending emails via queue it doesn't provide: any nice api eg. calculate number of iteration , work in way (it planed next version probably, still quite manual https://github.com/rails/rails/blob/master/activejob/lib/active_job/core.rb#l70 ) you cannot use of hook methods in delayed_job https://github.com/collectiveidea/delayed_job#hooks or specify of delayed_job parameters in job https://github.com/collect

xaml - Windows store app and TextBox stretch issue, responsive design -

i'm developing windows store application , have big issue textbox stretching. i'd have responsive design means i'm using lot of grids , verticalalignment="stretch" , horizontalalignment="stretch" problem happens fontsize in textboxes same , not aligned center. reason why i'm using viewbox . but viewbox not allowed stretch , fill space in grid cell. <viewbox grid.row="1" grid.column="1" horizontalalignment="stretch" verticalalignment="stretch" > <textbox horizontalcontentalignment="stretch" verticalcontentalignment="stretch" text="{binding name, mode=twoway}" horizontalalignment="stretch" verticalalignment="stretch"/> </viewbox> i use hardcoded sizes in various types of resolution makes me desperate make ui fitable types of devices. i try count sizes according actual screen size approa

Alfresco 5.0.d windows - NoClassDefFoundError: Main -

does know how alfresco 5.0.d running on windows? each version of alfresco seems have nuance run on windows, can't seem find nuance 5.0.d. tomcat error: commons daemon procrun stderr initialized java.lang.noclassdeffounderror: main tried: -default basic install built-in java -uninstalled, installed again using jdk8 java_home instead of supplied version. -changed java_home jdk7 -tried running tomcat commandline all above error. it's old issue, in case encounters it... can check if have java_opts environment variable? if do, can try deleting variable , re-installing alfresco? we encountered problem, , fixed in next releases. here reference in alfresco issue tracker: https://issues.alfresco.com/jira/browse/ace-4709

java - placing functions executed by multiple threads into a Queue -

i creating library simulator within java. library has multiple borrowers threads. each borrower thread performs list of functions e.g.(create borrow list,borrow books library, return books library). array of borrowers created within model class,and each thread started within loop. having issue regards having functions run borrowers put in type of output queue, whereby first function entered first borrower run etc. my question is, there way to, instead of executing each function when each borrower thread gets it, put functions threads output queue work through? i fixed similar problem using blockingdeque ( link , first in, first out). consumer thread pops first task deque , processes it. once finished reports , takes next task , on. other threads - in case borrowers - put task deque in last position. hope helps!

php - Passing JSON data from Controller to Model -

i have following codeigniter application, in trying read external json file in controller, , pass model function getkey() , , finally, pass data returned function view. keep getting error message "php parse error: syntax error, unexpected '$this' (t_variable), expecting function (t_function)" , unsure of causing it. new using codeigniter, appreciated. my controller: class test extends ci_controller{ public function __construct(){ parent::__construct(); } var $test_id = 1; var $json_key; $this->load->model('test_model'); $json_key = $this->test_model->getkey($test_id); $json_key = json_decode($json_key); $data['test_key'] = $json_key; $this->load->view('test_view', $data); } my model: class test_model extends ci_model{ var $image_array = array(); var $test_key = array(); var $test_name = ''; public function __construct(){ parent::__co

layout - Place buttons into multiple columns android -

as in picture: http://es.tinypic.com/r/mug8b8/8 in month of having single column, have several botons genre buttons dynamically query function generates buttons: private void createempresas() { button b; jsonobject json = null; int count = 0; linearlayout lm = (linearlayout) findviewbyid(r.id.linearmain); jsonobject jobj = obj_sqlite.get_descripcion_empresas(); try { count = integer.parseint(jobj.getstring("cont")); json = new jsonobject(jobj.getstring("json")); } catch (exception e) { log.e("getparams", e.getmessage()); } (int x = 1; x <= count; x++) { try { jsonobject json_row = new jsonobject(json.getstring("row" + x)); b = new button(this); b.settext(json_row.getstring("descripcion")); b.setid(json_row.getint("empresa")); b.settextsize(10); b.setpadding(8, 3, 8, 3);

java - CoAP Example for android Use Californium -

i'm trying build coap server in android, , i's using californium's example. https://github.com/curioustechizen/californium/tree/4ace5b85974a0646aaaa6ab43c9314d1c5a438e1 but got error http.java in package ch.ethz.inf.vs.californium.layers it shows the type org.apache.http.entity.contenttype cannot resolved. indirectly referenced required .class files i'm thinking problem wrong .jar file library imported this: apache-mimne4j.core-0.7.2.jar californium-0.18.7-final.jar commons-codec-1.6.jar commons-io-2.4.jar commons-logging-1.1.1.jar google-http-client-1.10.3-beta.jar google-oauth-client-1.10.1-beta.jar gson-2.1.jar guava-11.0.1.jar httpclient-4.2.1.jar httpclient-4.3.2.jar httpcore-nio-4.2.1.jar jsr305-1.3.9.jar junit-3.8.1.jar junit-4.8.1.jar mockito-core-1.8.5.jar hope can tell me whats problem or how fix it, , ask open source coap's android example. i think missing http-components jar there. use maven? please note: fo

Android with Kotlin - How to use HttpUrlConnection -

i´m trying data url inside asynctask error when creating new instance of httpurlconnection . something on java url url = new url("http://www.android.com/"); httpurlconnection urlconnection = (httpurlconnection) url.openconnection(); try { inputstream in = new bufferedinputstream(urlconnection.getinputstream()); readstream(in); { urlconnection.disconnect(); } but keep getting error shown below. class getweathertask : asynctast<void, void, void>() { override fun doinbackground(vararg params: void?): void? { val httpclient = httpurlconnection(); return null } override fun onpreexecute() { super.onpreexecute() } override fun onpostexecute(result: void?) { super.onpostexecute(result) } } cannot access '': 'protected/ protected , package /' in 'httpurlconnection' cannot create instance of abstract class am missing something? tryied create class object extending ht

Python - Remove entire Line in file using specific data -

i'm here because exhausted resources built program... i want delete line of file using specific data this code \t name \t colum2 \t colum3 \t colum4 \t colum5 \n i want delete entire line based on code if type code, *.py search line thats contains string , delete it. can soul me? assuming following input (generated on generatedata.com ) , saved input.txt: 1 jennifer o. ingram p.o. box 724, 4252 arcu. st. 2 lacy n. fields 5998 scelerisque road 3 blythe p. abbott ap #251-2931 magna. rd. 4 alyssa y. cobb 438-8110 enim. rd. 5 peter z. may ap #271-8340 eget avenue 6 mackenzie a. santos 8366 nunc. st. 7 kevyn c. willis ap #583-9635 erat avenue 8 nissim e. ward 7606 duis rd. 9 duncan j. armstrong ap #164-282 id, st. 10 jesse b. barnett p.o. box 742, 5758 sagittis street the following code remove line code 5: # declare code want delete. # can further improved being parameter # or read outside script. c

Popen.communicate\stdin.write stuck -

i'm using python version 2.7.9 , when try reading line popen process it's stuck until process ends. how can read stdin before ends? if input '8200' (correct password) prints output. if password changed '8200' there no output, why? subprocess source code: #include <stdio.h> #include <stdlib.h> int main(void) { char password[10]; int num; { printf("enter password:"); scanf("%s", &password); num = atoi(password); if (num == 8200) printf("yes!\n"); else printf("nope!\n"); } while (num != 8200); return 0; } python source: from subprocess import popen, pipe proc = popen("project2", shell=true, stdin=pipe,stdout=pipe,stderr=pipe) #stdout_data = proc.communicate(input='8200\r\n')[0] proc.stdin.write('123\r\n') print proc.stdout.readline() if change printf printf("enter

javascript - Missing price fields in Magento Bundle products -

Image
i getting following js error on bundled product pricing me reason why please. looks conflict or result of missing fields. appears causing pricing display incorrectly typeerror: $(...) null $('price_type').observe('change', changepricetypemap); this supposed appear i don't know if you, had similar issue attributes not appearing in bundle , grouped products. turned out when upgraded magento 1.5 1.9, attributes did not apply new product types. i.e. if check price attribute under catalog->attributes->manage attributes, check see if bundle products selected under 'apply to' section. same other missing attributes. kam

C# Windows Form Chart control - binding multiple y values from csv file -

this first exposure data-binding, have little knowledge of of properties , methods involved. want bind multiple series csv file column 1 datetime, , columns 2 through n doubles. started example in winformschartsamples binding single y value csv; however, not believe understanding way bind multiple y values. the original code: string myselectquery = "select * " + file; string constr = "provider=microsoft.jet.oledb.4.0;data source=" + path + ";extended properties=\"text;hdr=no;fmt=delimited\""; oledbconnection myconnection = new oledbconnection(constr); // create database command on connection using query oledbcommand mycommand = new oledbcommand(myselectquery, myconnection); // open connection mycommand.connection.open(); // create database reader oledbdatareader myreader = mycommand.executereader(commandbehavior.closeconnection); // column 1 time value, column 2 double // databind reader chart using databindxy method chart1.series[0]

jquery - Updating Selected Values of Dynamic Multiselectors in Pentaho-CDE -

Image
short version: how, using javascript or jquery, dynamically reassign selected value of dynamically generated multiselector box default value given conditions met on change (user select) in another? long version: i have 3 levels of multiselectors (state, metro area (aka msa), county) dynamically dependent on each other, counties , metro areas intersecting chosen states displayed in respective selectors. my problem if select msa within, say, maryland , click on texas, table multiselectors filter (a parameterized mdx query) crashes. going error logs in pentaho's catalina.out, appears msa (metro area) selector parameter becomes undefined when state not contain selected msa chosen. i make when new state or group of states selected not include selected msa or county, selectors revert default ("all") value. i'm jquery , javascript newby, need detail possible, while still being considerate of time. additional details, if needed: the values in msa (metr

How to trigger the onClick event of a marker on a Google Maps V2 for Android? -

is there way of calling onclick event of specific marker manually (without physically tapping marker)? no, but can simulate onclick event . 2 things happen when click marker: the info window corresponding clicked marker shown. the camera pans marker. the above can achieved 2 lines of code: marker.showinfowindow(); map.animatecamera(cameraupdatefactory.newlatlng(marker.getposition()), 250, null);

php - Sage pay Form Protocol update from 2.23 to 3.00 -

i trying make update sage pay form protocol 2.23 3.00. from documentation can read change protocol value 2.23 3.00 when i've changed after login on sagepay website still using old 2.23 protocol , needs upgrade 3.0. payments working ok, protocol value 3.00 still asking upgrade 3.00. we not going use of new features. we use aes. can help?

c# - EF loading virtual navigation property without accessing -

i have following models: public class category { public virtual icollection<product> products{get;set;} public product() { products = new hashset<product>(); } } public class product { public guid categoryid{get;set;} public virtual category {get;set;} } now if execute following statement: var list = await uow.categories.query.where(x=>x.name.contains("mob")).tolistasync(); and return list json mvc controller action. throws following exception: a circular reference detected while serializing object of type 'system.data.entity.dynamicproxies.category_7c2191cfexxxxxxx'. it happening because products collection not null , each product in turn contains category . what reason virtual properties getting uploaded automatically? edit:- turns out json serializer accessing properties , causing ef load them. have turned lazyloading off suggested haim770. the reason entity framework proxy intercept

swift - Prevent MapView MKPolygon tapped on Annotations? -

Image
i have mkmapview mkpolygons , few custom annotations. when ill try tap on annotation inside mkpolygon, trigger polygon gets fired. can prevent this? ill check on polygon tap: func handlemaptap(tap: uitapgesturerecognizer!) { var tappoint = tap.locationinview(self.mapview) var tapcoord: cllocationcoordinate2d = self.mapview.convertpoint(tappoint, tocoordinatefromview: self.mapview) var mappoint: mkmappoint = mkmappointforcoordinate(tapcoord) var mappointascgp: cgpoint = cgpointmake(cgfloat(mappoint.x),cgfloat(mappoint.y)) overlay in self.mapview.overlays { if(overlay.iskindofclass(mkpolygon)) { this how looks like: any ideas? can make "larger" area annotion, not fire both events, annotation , mkpolygon? edit: anna, ill tried that, brings me "found nil while unwrapping optional value" error when ill try with: var v:uiview = mapview.hittest(mappointascgp, withevent: nil)! // error if(v.iskindofclass(custompointannotation) == true) {

Rails reorder isn't working? -

i have feedback model 2 other models (comment , review) inherit from. i have default scope in feedback model orders id asc i've added scope feedback model: class feedback < activerecord::base include paginatable belongs_to :video default_scope order(:id => :asc) end scope :newest, -> { reorder(:created_at => :desc) } end i have video model has: has_many :feedback has_many :latest_feedback, -> { newest }, class_name: 'feedback' the problem i'm having when call video.includes(:latest_feedback).find(1) it still orders feedback id first , created_at not want. want latest_feedback ordered created_at here's does: video load (0.3ms) select `videos`.* `videos` `videos`.`id` = 85 order `videos`.`id` desc limit 1 feedback load (0.6ms) select `feedback`.* `feedback` `feedback`.`video_id` in (1) order `feedback`.`id` asc, `feedback`.`created_at` desc here's need do: video load (0.3ms) select `videos`.

python - constant movement in pygame -

this first pygame code not much, pretty straight forward. when want move player works love have movement steadily. when press left want move left. @ moment have press every time left button player moves left. have suggestions how that? import pygame, sys pygame.init() window_size = ( 400, 400 ) white = ( 255, 255, 255 ) class player(): image = pygame.image.load( 'foo.png') rect = image.get_rect() player = player() screen = pygame.display.set_mode( window_size ) done = false while not done: event in pygame.event.get(): if event.type == pygame.quit: sys.exit() if event.type == pygame.keydown: if event.key == pygame.k_left: move = (-10, 0 ) player.rect = player.rect.move(move) if event.key == pygame.k_right: move = ( 10, 0 ) player.rect = player.rect.move(move) if event.key == pygame.k_up: move = ( 0,-10 ) player.rect = player.rect.move(move) if event.key == pygame.k_down:

javascript - Saving CSV file using blob in Safari -

i have codes below generate download link users download .csv file on site. var link = document.createelement("a"); link.id = "csvdwnlink"; window.url = window.url || window.webkiturl; var csv = "\ufeff" + csv, blob = new window.blob([csv], {type: 'text/csv, charset=utf-8'}), csvurl = window.url.createobjecturl(blob), filename = 'export.csv'; $("#csvdwnlink").attr({'download': filename, 'href': csvurl}); $('#csvdwnlink')[0].click(); document.body.removechild(link); i hope user click download link csvurl download cvs file. works on chrome. however, when click same link using safari, directly show me content of csv file in tab. how solve problem safari show saving file window user select path want save file instead of showing content of cvs file directly when click download link? hope me recommendations or alternative methods. in advance! == updated == find out solutions here

r - rstudio/shinyapps - Error in set(new) : cannot change working directory -

i removed shinyapps , tried install again, error. remove.packages("shinyapps", "c:/users/xxx/documents/r/win-library/3.1") to install back, > devtools::install_github('rstudio/shinyapps') downloading github repo rstudio/shinyapps@master installing shinyapps error in set(new) : cannot change working directory any ideas?

AngularJs scope variables in console -

i know can access scope variables using batarang (chrome extension), , angular.element(document.queryselector('selector')).scope() i able access scope, controllers, in angular.io , angularjs.org but came across angularjs website ( www.paytm.com ) able block me accessing scope variables in console, controller, etc. how can block users accessing scope variables? even if block, there way users may access scope variables? will have security if block users accessing scope data? the site uses $compileprovider.debuginfoenabled(false) which primary task to improve app performance . though can (loosely) considered part of counter-measures against re, doubt problem programmer capable of reverse-engineering obfuscated app. if aren't keen on compromising codebase, don't use on client side. even if block, there way users may access scope variables? sure. var scope; angular.element(document.body).injector().invoke(function ($rootscope) { sc

elasticsearch - Is it possible to compare two fields from different types on a Query DSL? -

i'm new elasticsearch , i'm struggling question. want sort of (sql example): select a.id tablea a, tableb b a.id = b.id; i want query returns of info tablea, if id tablea equal id tableb. i've read lot of query filter fields , think might use term field i'm not sure how. thanks in advance! this answer given adrien grand on elasticsearch group: this sql query join , in general elasticsearch not support joins. if id field pk, might able indexing b child of (using parent/child) , searching documents in have child in b.

How to Capture Google Analytics User ID & Insert into SQL DataBase for Backend Lead Qualifying -

i want capture google analytics user ids our company's sql database following information: utm_source / utm_campaign / utm_keyword / goal completion. i know analytis services may better equipped believe there way hack this. thanks! you write user ids custom dimension (session or user scope, need). each user id , utms set see number of goal completions. using core reporting api can import these reports db: https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3a89723405&start-date=yesterday&end-date=today&metrics=ga%3agoalcompletionsall&dimensions=ga%3adimension1%2cga%3asource%2cga%3acampaign%2cga%3akeyword

ruby - Passenger and Nginx unable to run rails application in production mode -

i have ubuntu ec2 instance configured rvm , psql after cloned rails application on ec2 instance via bitbucket. following digital ocean's link installed passenger , nginx on instance , set passenger_app_env development; inside server configurations. use application in production mode, removed line config , server configs follows: server { #listen 80 default_server; listen 443 ssl; ssl on; server_name **.**.**.**; passenger_enabled on; rails_env production; root /home/ubuntu/my_app/public; ssl_certificate /home/ubuntu/my_app/my_app.pem; ssl_certificate_key /home/ubuntu/my_app/my_app.key; } server { listen 80; server_name **.***.**.**; return 301 https://$server_name$request_uri; } the app still running in development environment when execute rails.env.production? in console false result, shouldn't passenger implicitly assume application in produ