Posts

Showing posts from August, 2013

java - How to display the ProgressDialog when do network operations using volley -

i woking on android application interested use volley library perform network http calls. but question found library operations in different background thread how can show progressdialog when http request start execute later dismiss once has executed. requestqueue rq = volley.newrequestqueue(this); stringrequest postreq = new stringrequest(request.method.post, "http://httpbin.org/post", new response.listener<string>() { @override public void onresponse(string response) { tv.settext(response); // set response data in textview } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { system.out.println("error ["+error+"]"); } }); thanks in advance. it's pretty straight forward. start progress dialog once add request object in queue. //add request queue rq.add(request); //initialize progress dialog , show progressdialog = new progressdialog(getactiv

javascript - D3,js dialog modal not working any more -

i have google map popup alerts used work reason isn't now. supposed modal , have x close it. ought expand include text. worked before not more. it has close button instead of x. text overflows size of window. i copied code working map did not help. here code: function prettyalert(p_message, p_title) { p_title = p_title || ""; $(p_message).dialog({ title: p_title, width:400, height:200, resizable: true, modal : true, close: function(ev, ui) { $(this).remove(); } }).css("background", "lightgrey"); } what have broken code. (it embedded in drupal 7 page.) i resolved removing various jquery libraries had added drupal configuration , using explicit definitions in code. must have introduced conflicted behaviour of alerts.

scala - Where is List("String") described in API? -

Image
when create new list of strings : val lines = list("this test" , "a new test") calls method apply : override def apply[a](xs: a*): list[a] = xs.tolist in case returns list[string] reading scala doc list : http://www.scala-lang.org/api/current/#scala.collection.immutable.list def apply(n: int): selects element index in sequence. why different ? there section in api can view description of apply creating new list ? you're messing list object 's apply list class ' apply. first 1 creates list (note big o @ top, stands object): returned instance of class list has it's own apply method: you can switch between class , object scaladoc clicking huge letter.

java - if there are 3 classes A,B,C a and b are in same package c is in different package, to access fields of A why C must be child of A but not b? -

there class , class b, class c. if class , b in same package not c; access fields of class ; c must child of a.this rule not class b may or may not child of access fields .why? declare fields of class a , class b public . default visibility when don't put public , private etc. fields visible classes within same package. from java docs: if class has no modifier (the default, known package-private), visible within own package (packages named groups of related classes — learn them in later lesson.) http://docs.oracle.com/javase/tutorial/java/javaoo/accesscontrol.html

c++ - Will different math CPUs yield the same floating point results? -

i'm developing on os portable software has unit tests must work on linux, unix, , windows. imagine unit test asserts ieee single-precision floating point value 1.26743237e+015f converted string: void datatypeconvertion_test::testtofloatwide() { cdatatypeconversion<wchar_t> datatypeconvertion; float val = 1.26743237e+015f; wchar_t *valstr = (wchar_t*)datatypeconvertion.tofloat(val); std::wcout << valstr << std::endl; int result = wcscmp(l"1.26743e+015", valstr); cppunit_assert_equal(0, result); delete [] valstr; } my question is: all os , processors convert float string "1.26743e+015" long float ieee? i'm asking since know math cpus may not return accurate results, , wondering if yield different results on different processors may have different hardware implementations of ieee floating point operations internally inside processor architecture. the answer, sadly, no. conversion of floating poin

sass - How to add susy to thorax without using compass? -

i've started using thorax, , have used thorax generator yeoman setting webapp: $ npm install -g yo generator-thorax $ yo thorax desired-application $ cd desired-application $ grunt i've selected sass css preprocessor, , can run webapp after building grunt command. now problem i'm not sure how can add susy gruntfile.js. documentation states should add require: 'susy' sass options parameter. but don't have sass options in gruntfile.js, i've tried adding in - doesn't work when add @import "susy"; css/base.scss file. has added susy thorax application? edit i've tried adding susy through bower. bower install susy --save and i'm able @import "../bower_components/susy/sass/susy"; nice have susy added sass options in gruntfile.js, , able @import "susy"; instead. hum, if you've done gruntfile correctly, suppose that's there problem way installed susy . have correct (and up-to-dat

c# - wpf DataGrid of UserControls -

Image
i trying have datagrid shows user controls in each cell of it's rows. highliting datagrid have dynamic because columns count dynamic each case of use. in xaml code (xaml) have declaration of datagrid : <grid grid.column="1" margin="0,10,0,0"> <datagrid autogeneratecolumns="false" x:name="planningtable" frozencolumncount="1"/> </grid> my user controle (the usercontrol done , works perfectly): as result of datagrid want have usercontrol in each cell of datagrid means datagrid rows have show usercontrol in each cell. i've searched lot trick seems datagrid can't host usercontrol in cells. i want have c# code this, please no xaml code because dynamic !! like mentioned in comment, can dynamically xaml only. doing in code behind, you might end writing lot of code , loose upon important features of wpf . importantly ui virtualization if create rows manually yourself. in case don&#

linux - Bash script to run programs with parameters not working -

hello , reading. beginner when comes using linux question might seem dull of you, couldn't find answer anywhere it. i'm trying run 6 programs using bash script, , each require config file specified parameter. this i've tried far: #!/bin/bash ./shout/sc_serv "sc_serv.conf" & ./rshout/sc_serv "sc_serv.conf" & ./dshout/sc_serv "sc_serv.conf" & ./trans/sc_trans "sc_trans_dj.conf" & ./rtrans/sc_trans "sc_trans_dj.conf" & ./dtrans/sc_trans "sc_trans_dj.conf" & these give following error: msg:[config] not find `sc_trans_dj.conf' - prompt config file load warn [config] not find `sc_serv.conf' - looking config file load... also tried adding same path configs, #!/bin/bash ./shout/sc_serv "/shout/sc_serv.conf" & ./rshout/sc_serv "/rshout/sc_serv.conf" & ./dshout/sc_serv "/dshout/sc_serv.conf" & ./trans/sc_trans "/trans/sc_trans_dj.c

LongItemClickListener on Listview android -

i have question, can apply onitemclicklisyener , onlongitemclicklistener on same listview? want delete items of listview on long item click, listview handling itemclicklistener view files. what should now? can explain how this? here example listview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { //do stuff }); listview.setonitemlongclicklistener(new onitemlongclicklistener() { @override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { //do stuff }});

java - Why does != 0 work but == 1 doesn't work when using bitwise &? -

private void displaybinary() { int value = 123; (int = 128; > 0; = / 2) { if ((value & i) != 0) system.out.print("1 "); else system.out.print("0 "); } } the method above writes out 123 in binary form, program outputs 0111101. however, if change !=0 ==1 in if statement, outputs 0000001. since binary 0s , 1s, why doesn't latter work? you're not working base-2 number; you're still working base-10 int . from this, numbers iteration, except last, fail if condition, since not equal 1.

multithreading - Interrupt HttpURLConnection request Android -

i creating simple class sends requests using httpurlconnection server , receive responses. want add interrupt() method interrupt current request (imagine request running in asynctask , interrupt() called main thread). there 2 processes takes lot of time , don't know how interrupt them: writing output stream reading input stream so let's want example interrupt reading input stream read this: downloadthread = new thread(new runnable() { @override public void run() { try { buffer = readfully(connection.getinputstream()); } catch( exception e ) { e.printstacktrace(); } } }); downloadthread.start(); and readfully() method is: public byte[] readfully(inputstream input) throws ioexception { byte[] buffer = new byte[8192]; int bytesread; bytearrayoutputstream output = new bytearrayoutputstream(); while ((bytesread = input.read(buffer)) != -1) { output.write(buffer, 0, bytesread); }

c# - Is there any way to use NUnit TestCaseAttribute with ValuesAttribute together? -

i using intensively nunit testcase attribute. of tests annotated 20+ testcase attributes defining 20+ test cases. test 20 test cases value 1 or 0. means me different test cases. implemented valuesattribute: my current state: [testcase(10, "hello", false)] // 1 [testcase(33, "bye", true)] // 2 // imagine 20+ testcase here)] [testcase(55, "cul8r", true)] // 20+ public void mytest(int number, string text, bool result) i similar (what can not:) [testcase(10, "hello", false)] // 1 [testcase(33, "bye", true)] // 2 // imagine 20+ testcase here)] [testcase(55, "cul8r", true)] // 20+ public void mytest([values(0,1)] int anyname, int number, string text, bool result) why this? because these 40+ combination means different test cases. unfortunatelly nunit not allow using [testcase] , [values] attributes together, test runner expects exactly same number of parameters listed in testcaseattribute. (i can underst

c# - Strange location of panels -

Image
i have program kind of tests. in test, have function addquestion adds 1 panel question. place these panels 1 one, have variable loc saves location of next panel. first 2 panel 's questions adds correct, next ones located wrong(far away @ bottom). can be? public void addquestion(int number, question quest) { panel p = new panel(); p.name = "panel" + (number); p.size = new size(550, 400); p.location = new point(40, loc); p.backcolor = system.drawing.color.bisque; p.autoscroll = true; panel pict_block = new panel(); pict_block.size = new size(480, 200); pict_block.location = new point(10, 10); picturebox pict = new picturebox(); pict.image = quest.image; pict.size = new size(240, 180); pict.sizemode = pictureboxsizemode.stretchimage; pict.location = new point(130, 1); pict_block.con

javascript - "this" within prototype is undefined -

this question has answer here: how access correct `this` inside callback? 5 answers i have spent more hour on that. what wrong code?! studentcontroller.js: function studentcontroller() { this.studentservice = {}; }; studentcontroller.prototype.findall = function(req, res){ this.studentservice.something(); }; module.exports = studentcontroller; app.js var studentcontroller = require('./application/studentcontroller'); var studentcontroller = new studentcontroller(); app.get('/students', studentcontroller.findall); i getting: typeerror: cannot call method 'something' of undefined why "studentservice" undefined ?? thanks lot! your function isn't called in right context. instead, try : app.get('/students', studentcontroller.findall.bind(studentcontroller));

swing - Java JFrame Item Positions/Sizes -

i aware of methods , coding required set jframe item's position , size, need bit of knowing how correctly size , position items. there way use jframe api/method separate window sections make positioning items easier? maximum values height , width? how set button average size? if have experience jframes, please give me info me understand how position , size jframe items. you shouldn't worrying pixel perfect positioning of components. swing wasn't meant used such. being language meant run on many different platforms, gui library should flexible such. maintain flexibility, layout managers introduced. should using these layout managers sizing , positioning for you. you can see visualization of how each work @ a visual guide layout managers . these layout managers, you'll want learn (at least) which ones respect preferred size , ones don't. how each ones represented visually. how create white space, using gaps, empty borders, struts how use use nest

How to remove and set from List<String> in java? -

in java have function: public list<string> seperatekeys(string text) { string[] keys = text.split("and"); list<string> words = arrays.aslist(keys); listiterator<string> iter = words.listiterator(); while (iter.hasnext()) { string currentword = iter.next().trim(); if (currentword.equals("")) { iter.remove(); } else { iter.set(currentword); } } return words; } but when remove(), crashes saying unsupportedoperationerror. anyone know how fix it? thanks the issue arrays#aslist() returns arraylist implementation inherits remove() abstractlist . implementation of remove() in abstractlist this: public e remove(int index) { throw new unsupportedoperationexception(); } and because iterator uses list's iterator perform remove() method, end exception. you have few solutions here. can either pass result of arrays#aslist() arraylist constr

python - Why does theano conv2d add empty dimension? -

i playing around simple theano code, , ran following: import numpy import theano theano import tensor theano.tensor.signal.conv import conv2d m = tensor.fmatrix() w = numpy.ones([10,1], dtype=numpy.float32) c = conv2d(m,w) f = theano.function([m], c) print f(numpy.ones([100,100], dtype=numpy.float32)).shape result: (1, 91, 100) the result of 2d convolution of 2d inputs expected 2d, 3d. why? the docstring of conv2d says signal.conv.conv2d performs basic 2d convolution of input given filters . (note plural) you pass several filters , return convolutions of those. try e.g. c = conv2d(m,np.array([w, w, w])) f = theano.function([m], c) print f(numpy.ones([100,100], dtype=numpy.float32)).shape # outputs (3, 91, 100) so seems default add degenerate axis if pass 1 filter (probably because adds axis internally filter if didn't pass in way yourself. in other words, doesn't keep track of input shape in order return corresponds. looks design choice more else.

Custom namespace vs. null namespace: Android best practice -

when developing android user interfaces, should define custom namespaces or use null namespaces? , why? as concrete example. consider following: custom namespaces layout/main.xml: <com.example.myexample xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/apk/res/com.example" android:layout_width="fill_parent" android:layout_height="wrap_content" custom:customstring="test string"/> res/attrs.xml: <declare-styleable name="myexample"> <attr name="customstring" format="string" /> </declare-styleable> src/com/example/myexample.java: layoutinflater.from(context).inflate(r.layout.my_example, this, true); ((textview)findviewbyid(r.id.textview)).settext( attrs.getattributevalue("http://schemas.android.com/apk/res/com.example", "customstring") ); null namespaces layout/ma

javascript - Cross Origin Request Only Supported With HTTP with PreloadJS (CreateJS) -

i making game on createjs , while adding loadqueue load images, error: xmlhttprequest cannot load file:///home/me/programming/assets/background.png. cross origin requests supported http. createjs-2013.12.12.min.js:15 i searched problem, , know happens because it's supposed on server work. however, right i'm in testing want able test when offline (and don't have server). i've looked @ proposed solutions this. i've tried running google chrome with --allow-file-access-from-files and --disable-web-security but neither work. is there way run preloadjs without putting images on server? if not, think make createjs suite , html5 whole unattractive tool making games compared allow loading of local files. hope i'm wrong , that's not true. as lanny proposed in comment, easier in long run "bite bullet" , use local http server, force things in way not intended (like chrome command-line arguments). there many ways in browser behaves

Graphviz Dot - Strange edge routing and node placement -

Image
i'm new graphviz/dot , tried create first dot-diagram. basics went quick fixing layout took me time , think i'm lost enough time , better ask more experienced people... it's routing of edge tried fix telling locate edge @ nodes describe here: strange edge placement in graphviz dot worked routing same strange thing (should bi right instead of left through content). the second 1 node placement of 3 bottom nodes left. placed better diagram fit perfect on portrait a4 page... digraph { "passslave1" [label="pass command slave (2nd tier)"] "passslave2" [label="pass command slave (2nd tier)"] "success1" [label="cmd_signal_success", shape=box] "success2" [label="cmd_signal_success", shape=box] "powerup" [label="power / system reset", peripheries=2, color="red", fontcolor="red"] "acknowledge1" [label="cmd_signal_acknowledge", shape=b

javascript - validation script losing characters -

the script below should validate user input each typed character @ once, it's losing characters, , it's character after symbol (ex.: if type 14121982 date field, 14/_2/_9822 in textfield, , 14/_2/_982 internally). also, difference between content of textfield , content intenal variable issue. jsfiddle http://jsfiddle.net/klebermo/f8u4c/41/ code var counter; var tam; var str; var regex; $('.valida').each(function(){ $(this).on('focus', function(e){ regex = $(this).attr('pattern'); counter = 0; tam = size_of(regex); str = generate_string(regex, tam); $(this).val(str); }); $(this).on('keypress', function(e){ var tecla = e.which; var tecla2 = string.fromcharcode(tecla); var t = type_of(regex, counter); if(typeof tecla == t) { str = replaceat(str, counter, tecla2); //counter++; } else { if(t != 'numbe

XNA model with bones -

i created model in blender , used armature create pose. how can display pose in xna/monogame? can't find solution. use model exported fbx file. code here , draws model without armature effect: protected override void draw(gametime gametime) { graphics.graphicsdevice.clear(color.cornflowerblue); // copy parent transforms. matrix[] transforms = new matrix[mymodel.bones.count]; mymodel.copyabsolutebonetransformsto(transforms); // draw model. model can have multiple meshes, loop. foreach (modelmesh mesh in mymodel.meshes) { // mesh orientation set, our camera , projection. foreach (basiceffect effect in mesh.effects) { effect.enabledefaultlighting(); effect.world = transforms[mesh.parentbone.index] * matrix.createrotationy(modelrotation) * matrix.createtranslation(modelposition); effect.view = matrix.createlookat(cam

javascript - How can I center a group of objects together in HTML with CSS? -

i have group of objects ( divs ) small squares can move anywhere (there's javascript function move then). squares , form figure. have figure centered css: " left: 600px " i'm trying make more responsive design page , started percents encountered 2 problems. if add percentage objects individually, when zoom in or zoom out or when resize page become more closer of far away each other. if create div including objects , add " left:50% " when click move them go instantanially 50% left. mouse -> () [spacespacescpace] / \ <- , object, i'm still selecting object. that's weird... this html: <div id="container"> <div class="vepart" id="me2"></div> <script type="text/javascript"> jcl.loadbehaviour("me2", moverbehaviour); </script> <div class="vepart" id="me3"></div> <script type="text/javascript"> jcl.load

Bullet in own opengl framework (iOS) -

we made opengl game ipad , wrote need except collision detection. have renderer, shaders etc. my question is: how integrate bullet? wrote bullet collision code in class physicsmanager. our game set in cave , first person perspective. what did is: -set dynamicsworld. -read in cave model , store vertices/indices in indexed mesh , add mesh triangleindexvertexarray. generating trimesh shape , rigid body it. -for player take sphere dynamic rigidbody. -then stepsimulation. now how can integrate our existing framework (no bulletcode except in physicsmanager). when/where call (hence creating phisycsmanager object in main file). btw: followed pretty tutorial/the instructions written in hello world "demo". trimesh solved same way did in benchmarkdemo.

ajax - Java POST Connection Timeout Using HttpsUrlConnection -

i have question making post request java, , since first attempt @ of magnitude, please bear me. working on third party application in java connect website , make post requests. doing correctly? here have far: website code: (this code website has "bumping trade" sends 2 pieces of data php file. url http://cdn.dota2lounge.com/script/trades.js ) function bumptrade(trade, code) { $.ajax({ type: "post", url: "ajax/bumptrade.php", data: "trade=" + trade + "&code=" + code }); } my java code: private void sendpost() throws exception { //string url = "https://www.cdn.dota2lounge.com/script/ajax/bumptrade.php"; string url = "https://www.cdn.dota2lounge.com/script/ajax/bumptrade.php"; url obj = new url(url); httpsurlconnection con = (httpsurlconnection) obj.openconnection(); //add request header con.setrequestmethod("post"); con.setrequestpr

java - Have my own Listener Richfaces on Cells Table -

i have xhtml page 2 paintings (boards) , b. in first table, there inputtext fields. changes of value should automatically reflected in other cells , other table. my current solution using beans performs badly because calculations made @ level of beans. there way perform in presentation level, bypassing beans principle of fomula? yes, perform calculations on clientside (eg. using javascript) , update backing bean once complete

How to send xml file for asp.net webservice using php soap -

i have send xml file asp.net based webservice. using php soap client. here code: $request = file_get_contents('myfile.xml'); $result = $soap->__dorequest($request, 'location_url', 'action_url', soap_1_2); and xml file looks like: <ns1:header xmlns:ns1="http://something.com"> <ns1:timestamp>2014-01-01t13:20:00.000-05:00</ns1:timestamp> but, every time return blank response. didn't clue side. any welcome.

c# - Adding Tooltip for Variable in IDE -

this question has answer here: how write comments / documentation variables / fields / lists in vs 2010? 6 answers is there syntax in visual studio 2008 that, in c# development, if 1 of colleagues hovers on variable, tooltip brings more information, comments? displays it's local int, , while running displays value, wondering if there way make display personal description. sorry newbie question, research kept bringing different things looking for. this has duplicate question, answer here as stated earlier 1 should use appropriate naming, , avoid using hungarian notation.

php - Sylius: adding a new Payum Gateway (Rabobank Omnikassa) -

i've been looking @ lot of posts have found solution question. there doesn't same single place on internet explains how add new payment gateway sylius payum bundle. i'm using latest sylius 0.10.* version , i'd add new payment gateway (rabobank omnikassa, dutch payment endpoint). there's info on how add paymentfactory payumpayumbundle , folder structure of bundle nothing syliuspayumbundle . i've created own acme\bundle\payumbundle overrides syliuspayumbundle . i set in similar fashion paypalexpresscheckoutpaymentfactory . config/payum.yml here i'm testing few things sylius find stuff. payum: contexts: rabobank: storages: sylius\component\core\model\order: doctrine: driver: orm sylius\component\core\model\payment: doctrine: driver: orm custom: actions:

Velocity: "Lexical error" with JavaScript -

i'm developing web application using apache velocity , encountered lexical error said "lexical error, encountered: "(" (40), after : "". the error brought codes included "javascript" following. <script> function gethelloworld() { return "hello world!"; } $var = window; $var.alert(gethelloworld()); </script> avoiding error, tried code below , got result expected. <script> $var = window; helloworld = "hello world!"; $var.alert(helloworld); </script> i wondered if tell me reason in detail possible. thank you. takahiro,

objective c - Switching between 3 pages with segmentend button requires 2 taps? -

here setup : home page, profile page, friends page. in each page, there exact same segmentend button : [home | profile | friends] when tap on segment, segue called , page changed. so, when i'm in profile, profile selected, , can tap on either home or friends ; when do, new page loaded, new segment selected , can again if want to. in storyboard, have 3 pages " ton " of custom segue (i used custom animation purposes). in code, have : (void)movetopage { if ([self.pageswitch selectedsegmentindex] == 1) { [self performseguewithidentifier:@"fromhometoprofile" sender:self];; } if ([self.pageswitch selectedsegmentindex] == 2) { [self performseguewithidentifier:@"fromhometofriends" sender:self];; } } - (ibaction)pageswitchbutton:(id)sender { [self.pageswitch addtarget:self action:@selector(movetopage) forcontrolevents:uicontroleventvaluechanged]; }

html - Bootstrap 3.1 input-group inline with auto width? -

i not understand following thing. in first left floating div have few buttons, , in secound left floating div input-group. input-group moves 1 line down should use free space. http://www.bootply.com/f1mbcrf1w5 the secound method used fixed width, should use free space, first div should make "wrap content". possible , how can solve it? thanks! sorry bad english. bootply you need use display: inline btn-group class , disable float: left if want display buttons in 1 lane input element. i assume want work 1 element , not affecting other elements btn-group class, created exception class select 1 btn-group if no , want select btn-group items, delete exception class. got no idea what's architecture going , global display: inline btn-group can lead unpredictable display. anyways, last 2 paragraphs not related issue selectors structure , system.

python - Pandas max() and min() work but mean() gives "No numeric types" errror -

i'm having difficulties following pandas code: groupby_obj = features.groupby('feature') print groupby_obj["value"].max() # works print groupby_obj["value"].min() # works print groupby_obj["value"].mean() #this doesn't work the third line gives following error: dataerror: no numeric types aggregate this looks same error this answer isn't easy follow. using frame.astype(float) won't work me because of columns strings. features[['value']] = features[['value']].astype(float) seems messy (and involves unnecessary copy operation). is there way specify types columns when dataframe instantiated? or different way achieve i'm trying do? as min/max issue, think strings . can have min/max string (in lowercase alphabet, 'a' , 'z' respectively), mean string makes no sense. also, try casting particular column ( value ) float , math.

mysql - Join and have child table go into new columns on the parent table -

i wondering if possible; able have 2 tables join them, have names (or field choose) on child table, go parent table, in new columns so have table 1 'site'. designates sites of programs. table 2 attendees, records people @ site @ day. +--------+--------------------------+-------------+-------+-------+------------+ | p2p_id | address | city | state | zip | date | +--------+--------------------------+-------------+-------+-------+------------+ | 44 | 435 s | los angeles | ca | 90048 | 2014-05-13 | | 45 | 1641 whatever ave | santa ana | ca | 92704 | 2014-05-16 | | 46 | 1710 reterrr st | denver | co | 80202 | 2014-07-10 | | 47 | 6401 fdgdfdffffave | raleigh | nc | 27617 | 2014-07-16 | | 48 | east dfgdfgdf street | san antonio | tx | 76107 | 2014-05-13 | | 126 | 3100 fgdfgffgf | fort worth | tx | 76107 | 2014-05-14 | | 127 | 1001 dfg

order - OpenGL culling with indices or vertices? -

i've read sentence "we specify vertices in counterclockwise order" on http://www.videotutorialsrock.com/opengl_tutorial/backface_culling/text.php , wondering meant specifying vertices. mean declare vertices in ccw order in vertex buffer or use vertices in ccw order in index buffer?

c# - dynamically hide textbox based on radio button checked state -

i have set of radio buttons corresponding textboxes on aspx page. want textboxes either show or hide depending on relative radio button checked state. during page load, i'm pulling of controls on panel, looping through each 1 , if it's typeof radiobutton add javascript function radio button run onchange. based on radio checked state, function show or hide textbox. wasn't sure how tell function textbox hide based on radio button other make own attribute radio button , use in page_load. this, me, best solution i've come short of in-lining js function calls. but isn't working. regardless of functionality of code, isn't how want it. want list or array of radio buttons panel (instead of grabbing of controls), , add function it. , adding attribute radio button doesn't seem cleanest way nor in-lining calls. regardless of solution path chosen, still need know textbox i'm hiding or showing goes along radio button. , help, ideas, , wisdom appreciated.

python - Django select_related does not work -

my django select_related works weirdly models: class publisher(models.model): name = models.charfield(max_length=100) class meta: app_label = 'models' db_table = 'publisher' class book(models.model): name = models.charfield(max_length=100) publisher = models.onetoonefield(publisher) class meta: app_label = 'models' db_table = 'book' output: books = book.objects.select_related('publisher').all() print books.query select "book"."id", "book"."name", "book"."publisher_id", "publisher"."id", "publisher"."name" "book" inner join "publisher" on ( "book"."publisher_id" = "publisher"."id" ) print books.values() [{'publisher_id': 1, u'id': 1, 'name': u'rest framework'}] django generates correct query , data retrieved when execut

javascript - 2 divs offset because of scrollbar -

issue #1 trying make 2 divs align eachother, the fist div doesnt have scrollbar, second has one. scrollbar cause second div offset first one. is there way align 2 divs? issue #2 why second div not scrolling when has overflow-y:scroll; ? body, html { margin: 0; padding: 0; border: 0; outline: 0; overflow:hidden; } .fixed-top-container { text-align:center; top:0px; height:100px; min-height:100px; max-height:100px; width:100%; display:inline-block; margin:0 auto; padding:0; background-color:rgba(0, 0, 0, 0.5); } .container { width:100%; height:100%; background-color:#f0f0f0; overflow-y:scroll; } .content { width: 800px; height:100%; margin:0 auto; background-color:#ffffff; } view jsfiddle issue: http://jsfiddle.net/aaeijh/qah9g/1/ how can bottom div scroll? use user friendly <textarea> instead of old <div> technique <textarea rows="10&quo

database - Why are added tables from Java not visible when I open the H2 console? -

Image
i use h2 embedded database in java, , after creating database , adding tables , data, gets saved file in directorey of computer. but whenever open file h2 console, shows no tables @ all? why tables not there? i using url in java code: jdbc:h2:file://c:/temp/h2/ourdb and log console following information: after logging in, can't see tables created in java? you have used different database url in h2 console (not jdbc:h2:file://c:/temp/h2/ourdb ). need use same one, otherwise it's different database.

windows - ghostscript convert pdf to pcl with wrong orientation -

i have issue trying convert pdf document pcl document using ghostscript. the original pdf document landscape , pcl should well. nevertheless in windows using ghostscript 9.14 following command functions: gswin32 -dnopause -dbatch -sdevice=ljet4 -dsafer -dautorotatepages=/none -spapersize=a4 -soutputfile=./convert_windows.pcl ./duplicate_windows.pdf the same command in ubuntu linux kernal version 3.2.0-40-generic 64 bit - ghostscript 9.05 - results in wrong orienteated pcl file of size a3 instead of a4 original. the original pdf file contains windows font "arial", should available in linux well. package "msttorcefonts" installed on linux. short extract of fontmap of ghostscript: cat /usr/share/ghostscript/9.05/resource/init/fontmap.gs gives: % font, , font among hershey fonts, uses % symbolencoding. /hershey-symbol (hrsyr.gsf) ; % 5066567 /arial /arialmt ; /arial,bol

ios - UIPageViewController with Images in iPad3 caches all viewcontrollers in memory -

in arc, have customised uipageviewcontroller mypageviewcontroller . adding mypageviewcontroller childviewcontroller rootviewcontroller . transition type set curl. imageviewcontrollers added viewcontrollers of mypageviewcontroller this: imageviewcontroller *startingviewcontroller1 = [self.storyboard instantiateviewcontrollerwithidentifier:@"imageviewcontroller"]; imageviewcontroller *startingviewcontroller2 = [self.storyboard instantiateviewcontrollerwithidentifier:@"imageviewcontroller"]; nsarray *viewcontrollers = @[startingviewcontroller1, startingviewcontroller2]; [self.mypageviewcontroller setviewcontrollers:viewcontrollers direction:uipageviewcontrollernavigationdirectionforward animated:no completion:null]; self.mypageviewcontroller.delegate = self; self.mypageviewcontroller.datasource = self.pagemodelcontroller; [self addchildviewcontroller: self.mypageviewcontroller]; [self.view addsubview: self.mypageviewcontroller.view]; [self.mypageviewcontr

"cancel" variable in groovy script not working in Jenkins Email-ext plugin -

i'm having issue want cancel sending email when job gets fixed state unstable state. if job failing got fixed, want send message. if job unstable (tests not passing) , gets fixed, don't send email. might job marked unstable after has been in failure state. when goes success (i.e. fixed) want email in case. can see cases in code below. my problem when set variable cancel true definition[1] should cancel email, doesn't. email gets sent every time. of course i'm using triggers "failure", "still failing" , "fixed". jenkins version: 1.533. email-ext version: 2.37.2.2 // goal of script block sending 'fixed' message // when status goes 'unstable' 'success' // // these cases (where f=failure, u=unstable, s=success) // s - s : no msg (previous state: s, current state: s) // f - s : msg // s - u ... u - s : no msg <-- 1 need avoid sending email // f - u ... u - s : msg logger.println("entering pre-send s

c# - Check if File Exists on Remote Machine via Console Application -

first - still relatively new .net development. now, since that's out of way. making reporting console application go , access remote machines , check see if .png exists on every machine , report if image there or if there error, , error's message. reading in csv of ip addresses. currently, application read csv list. then, iterate on list appending ip address beginning of file path(i.e \\10.155.191.239\c$\programstuff\blahblah\storepcmenu\data\myassets\app_icons.png ). @ beginning of console app, elicit user credentials. using .\desktop user credentials should sufficient trying do. my problem > application reporting false negatives. also, if remote machine denies credentials, shows me generic error message , not message pertaining credentials denied. we using pinvokewindowsnetworking class validate credentials. however, couldn't figure out how class report whether or not credentials actual problem. so, included managementscope class, able show me whether or not cr