Posts

Showing posts from March, 2011

spring - org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'helper' . No unique bean of type [java.lang.String] -

i want autowire string constructor. i have in spring config xml: <bean id="helper" class="test.helper"> <constructor-arg index="3" type="java.lang.string" value="http://test.com" /> </bean> helper.java @component public class helper { private final clientfactory clientfactory; private final modelmanager modelmanager; private final securityservice securityservice; private final string url; @autowired public helper(clientfactory clientfactory, modelmanager modelmanager, securityservice securityservice, string url) { this.clientfactory = clientfactory; this.modelmanager = modelmanager; this.securityservice = securityservice; this.url = url; } } i getting error: org.springframework.beans.factory.nosuchbeandefinitionexception: no unique bean of type [java.lang.string] defined: expected single matching bean found 19: any apprecia

ember.js - Returning an array from the model -

i new ember , trying data model array. currently doing: var playerlist = app.player.find().toarray(); but it's not returning me array of players it's returning array of objects? ex: <app.player:ember311:1>,<app.player:ember332:2>,<app.player:ember338:3>,<app.player:ember344:4>,<app.player:ember350:5>,<app.player:ember356:6>,<app.player:ember362:7>,<app.player:ember368:8> any appreciated. thanks! app.player.find() returns promise, , therefore should wait until records loaded before doing operations on them. question it's not entirely clear how player objects like. players, , player's properties, like: var playerlist = app.player.find().then(function (result) { // callback fire when array loaded // , correct way records result.objectat(0).get('name'); // assuming "name" property of model // here can loop on obejcts result.foreach(function(item) { console.log(item.get

python - Matching all Full Quotes with Regex -

so matching quotes when don't know if single or double easy: >>> s ="""this "test" "testing" today""" >>> re.findall('[\'"].*?[\'"]',s) ['"test"', '"testing"'] that search string either single or double quotes , inbetween. here issue: it close strings if contain other type of quote! here 2 examples illustrate mean: >>> s ="""this "test" , "won't work right" @ all""" >>> re.findall('[\'"].*?[\'"]',s) ['"test"', '"won\''] >>> s ="""something "test" , "an 'inner' string" too""" >>> re.findall('[\'"].*?[\'"]',s) ['"test"', '"an \'', '\' string"'] the regular expr

java - HttpMediaTypeNotAcceptableException when specifying applicaiton/xml in Accept header -

apologies, didn't see tag java-noob. i working existing restful api in spring. tasked adding new api couple utility methods, each of return string. far good. working well. i added simple wrapper return string object , i'm able build/deploy/test , response looks like { id: "12345" } if specify accept header = application/xml following exception: org.springframework.web.httpmediatypenotacceptableexception: not find acceptable representation other methods in package seem serialize in both xml , json fine. don't see custom serialization code being used in controller base , don't know handled (or if related serialization). can me figure out start looking? here [simplified] controller: @controller public class utilcontroller extends controllerbase { @xmlrootelement(name="util_response") public static class utilresponse extends apiresponsebase { private string id; @xmlelement(name="id")

opentok - Not getting streamCreated event, page goes to 100% CPU usage -

whenever allow webcam access in chrome part of setup multi-party or p2p conference, expecting streamcreated notification not coming through. camera turns on , "google chrome renderer" page goes 100% cpu usage. when pause execution of stream find execution somewhere deep inside tb.min.js. here's relevant parts of code like: void meetinginprogress(info) { var session = tb.initsession(info.sessionid); session.connect(info.apikey, info.token); session.addeventlistener("sessionconnected", function(e) { console.log("connected session"); subscribetostreams(session, e.streams); session.publish("selfview", { name: name }); }); session.addeventlistener("streamcreated", function(e) { console.log("new stream"); subscribetostreams(session, e.streams); }); } var subscribetostreams = function(session, streams) { var selfid = session.connection.connectionid; console.log('

Storing and Retrieving Image Path From android application folder On Pre Created SQLite Database & Setting the image to Image View -

i'm trying make simple application quiz, have image attached each question 4 answers, have 100++ images store in database so far can figure out how make questions without image on each question trough tutorial here : chuck application part 1 i've found out way store image path hardcoding path textfields in sqlite database links below saving resources path in sqlite according link above, stated saves reference of image typing "r.drawable.picture1" text field inside sqlite database, if it's true, correct way (by saving image in drawable folders , writing path text field)? if it's not what's correct way so, how construct image path (setting setter , getter methods) getting field database?, and how set path imageview? any appreciated, thankyou in advance update so learned link how use string reference , edited string below, imagei.getimage1(); refers row database contains image name private void showimage() { string image

javascript - Allow only numbers or decimal point in form field -

i've limited input field numbers through js not sure how allow decimals... function isnumberkey(evt) { var charcode = (evt.which) ? evt.which : event.keycode if (charcode > 31 && (charcode < 48 || charcode > 57)) return false; return true; } thank in advance! answer: function isnumberkey(evt) { var charcode = (evt.which) ? evt.which : event.keycode if (charcode > 31 && (charcode < 48 || charcode > 57) && charcode != 46) return false; return true; } adding charcode 46 worked (keypress value). 190 , 110 did nothing. thanks all! codes depend on event you're listening to, easy way find want using javascript event keycode test page here test input, e.g. full stop (the . left of right shift) have onkeydown onkeypress onkeyup event.keycode 190 46 190 event.charcode 0 46 0 event.wh

ruby - Refactoring Rails controller code using the same string as a symbol, instance variable, and attribute -

i have following code in controller, , i'd know best way refactor 1 piece. if @country if s.address s.address.country = @country else s.address = address.create(:country => @country) end end if @state if s.address s.address.state = @state else s.address = address.create(:state => @state) end end if @zip if s.address s.address.zip = @zip else s.address = address.create(:zip => @zip) end end if there 1 variation here i'd like [:country, :state, :zip].each |location| ... end but in case i'm using :country, .country, , @country; what's better way take advantage of them having same 'root' string? thanks! i recommend: following thin controller, fat model best practice , remove business logic controller. use meaningful variable names. s in example? if student - why not call student ? assuming county , state text values , not ass

perl - Get substring after specific pattern, split or look behind? -

how can dates after sp^ in: 89564;02/03/2005;;mt;m^08/17/75^f^12/28/2004^sp^07/22/57 89565;02/03/2005;duo;mg;m^07/24/50^f^05/11/82^f^03/01/92^f^04/20/1986^sp^09/03/51 not sure if can use lookbehind since don't want delimiter, dates. can split , dates after sp^ ? sp^ in different positions in dataset, not last substring. this enough examples: print "$1\n" if $s =~ /sp\^(.*)$/; but if want specific date format: print "$1\n" if $s =~ m!sp\^(\d\d/\d\d/\d\d)!;

java - How to use more than one language for a project? -

we see huge projects written in more 1 language example facebook written in php , c++, , android operating system written in c,c++ , java. in following links on right side more 1 languages written in front of "written in" android= http://en.wikipedia.org/wiki/android_(operating_system) facebook= http://en.wikipedia.org/wiki/facebook are there compilers doing this? sometimes (facebook) have system of many different interacting programs, each of can written in different language, , running on different machines. sure complex website facebook involves many pieces written in many different mainstream , homespun "languages". other times (android) have single entity in pieces written in different languages combined. i'm on simplifying bit, if think it, compilers compile down machine code, , linker can combine pieces. in reality, it's more complex, , many languages interpreted rather compiled. combine languages have complex runtime systems

Matching in perl -

i new perl. trying text in between 2 dots of line, program returns entire line. for example: have text looks sampledata 1,2 perl .version 1_1. i used following match statement $x =~ m/(\.)(.*)(\.)/; my output $x should version 1_1 getting entire line match. i appreciate help. thanks. in code, value of $x not change after match. when $x matched m/(.)(.*)(.)/, 3 capture groups contain '.', 'version 1_1' , '.' respectively (in order given). $2 give 'version 1_1'. considering might want part 'version 1_1', need not capture 2 dots. code give same result: $x =~ m/\.(.*)\./; print $1;

ruby - Why can't I receive an ICMP Message? -

i want make simple traceroute without library. in wireshark see incoming response, can't receive message. port receive_socket same port send_socket , , protocols specified should correct. def traceroute local_host = '0.0.0.0' remote_host = '8.8.8.8' traceroute_port = 33434 random_port = rand(10000..20000) # create udp-socket udp_socket = udpsocket::new udp_socket.bind(local_host, random_port) udp_socket.setsockopt( 0, socket::ip_ttl, 3) # send data udp_socket.connect(remote_host, traceroute_port) udp_socket.send('traceroute', 0) # create receive-socket receive_socket = socket.open(socket::pf_inet, socket::sock_raw, socket::ipproto_icmp) receive_socket.bind(socket.pack_sockaddr_in(random_port, local_host)) # receive data begin p receive_socket.recvfrom(1024) rescue socketerror => exception puts exception.message end end it great if somone can me out.

how to convert date and time to timestamp in php? -

i have date '07/23/2009' , time '18:11' , want timestamp out of : here example: date_default_timezone_set('utc'); $d = str_replace('/', ', ', '07/23/2009'); $t = str_replace(':', ', ', '18:11'); $date = $t.', 0, '.$d; echo $date; echo '<br>'; echo $x = mktime("$date"); the issue $x gives me current timestamp. any ideas? it gives error because mktime function require values of numbers , function gives date . if try like $h = 18; $i = 11; $s = 00; $m = 07; $d =23; $y = 2009; echo date("h-i-s-m-d-y",mktime($h,$i,$s,$m,$d,$y)); then work. so complete code be date_default_timezone_set('utc'); $d = str_replace('/', ',', '07/23/2009'); $t = str_replace(':', ',', '18:11'); $date = $t.',0,'.$d; $fulldate = explode(',',$date); echo '<br>'; $h = $fulldate[0]; $i = $ful

iphone - User defaults not saving -

i built first app , there 1 thing left do. getting data url. if url fails or nil data user defaults. i have function saves user defaults data off url - (void)savetouserdefaults { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:data forkey:@"data"]; [defaults synchronize]; } and here more of code. nsurl *url = [nsurl urlwithstring:@"http://jamessuske.com/isthedomeopen/isthedomeopengetdata.php"]; data = [nsdata datawithcontentsofurl:url options:0 error:nil]; [self savetouserdefaults]; if(url == nil){ nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; data = [defaults dataforkey:@"data"]; } nsarray *array = [nsjsonserialization jsonobjectwithdata:data options:0 error:nil]; i disconnected internet , ran app in simulator , app returned empty values. what can fix this? try scenario // method used check networ

Visual Studio 2010 stopped displaying IntelliSense suggestions -

Image
i having issue visual studio 2010 intellisense, stopped working recently. had worked earlier. had gone through following steps visual studio c# intellisense not automatically displaying not worked on system. here attaching screenshot reference, thanking in advance this known feature/bug (feature bug?), can resolved restarting visual studio. it appears, behaviour shown visual studio if press ctrl + alt + space. i'd recommend resetting setting dai suggestested, if vs-retart not work. additional information: vs2010 bug: intellisense shows empty text field , stops working correctly

How to change an image tag url in multiple html files using batch script? -

there more 10 html files image tags. every time deploy our build onto test site need change img source. eg <img src=/live/content/xyz.png /> <img src=/test/content/xyz.png /> . after looking around , reading sometime, have come following batch script, cant figure out how go further here : for /r %%i in (*.html) echo %%i %%f in (*.html) ( /f %%l in (%%f) ( set "line=%%l" setlocal enabledelayedexpansion set "x= <--------------------what set here? echo %x% endlocal )) pause this first batch script, please guide me in right direction? @echo off setlocal enabledelayedexpansion /r u:\ %%i in (*.html) ( echo found %%i set outfile="%%~dpni.lmth" ( setlocal disabledelayedexpansion /f "usebackq delims=" %%l in ("%%i") ( set "line=%%l" setlocal enabledelayedexpansion set "line=!line:/live/=/test/! echo !line! endlocal ) endlocal )>!outfile!

javascript - Declare variable in php file that will access in JS/jQuery -

how can declare global variable in php file , access directly in jquery ? html <script type="text/javascript"> var date_selected = <?php echo $from; ?>; </script> js $(function() { alert("dsdsadasdas" + date_selected); var date = date_selected; var startdate; var enddate; }); because on test not working. you missing quotes var date_selected = '<?php echo $a; ?>';

php - Unable to access array inside geocoder -

i have array outside geocoder, when want use array inside geocoder values of array undefined var titles = new array(<?php echo implode(",",$titles); ?>); var length = postcode.length; (var = 0; < length; i++) { geocoder.geocode({'address': postcode[i]}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { lat2 = results[0].geometry.location.lat(); lng2 = results[0].geometry.location.lng(); var latlng = new google.maps.latlng(lat2, lng2); var marker = new google.maps.marker({ position: latlng, map: map, title: titles[i], icon: icon}); // alert(titles[i]) - undefined } } } you var titles = <?php echo json_encode($titles); ?>;

php - should i use LEFT JOIN all the time when obtaining the data from more than two tables? -

here below example of mysql select a.hospital_id, a.name, a.distance, b.name, a.near_gate hospital a, station b a.campus='".$campus."' , a.category='".$category."' , a.station = b.id this example works though, okay use example right away, or should add word left join ? thanks in advance ~ :) your query equivalent following: select a.hospital_id, a.name, a.distance, b.name, a.near_gate hospital join station b on a.station = b.id a.campus='".$campus."' , a.category='".$category."' it's inner join , not left join update actually, from table1, table2 should result in cross join . database engines smart enought figure out condition where part should used determine join condition , change inner join .

cassandra - Count always return 1 for non existent key -

i'm trying select count query key not existing i'm getting count value 1. query select count(*) test_table key = 'test' . but there no key called test. query returning 1. idea why happening? the single row value 0 count. in mysql return single row such as: count(*) 0

In HighStock, linking secondary yAxis to master yAxis can cause secondary values to be cropped outside the chart -

simplifying story, consider 2 series link yaxes. in other words on second yaxis there property linkedto: 0 so first yaxis master, hence sets extremes both series. however second series has high values high plotted in visible area , cropped. to make matters worse, when yaxes linked each other, legend doesn't play ball: clicking on master series name in legend hide both series. clicking on secondary series name hide none. check out this jsfiddle - values on right cropped, legend functionality broken. what missing? how can both series scale , visible? how legend work expected? (click on series name should toggle it) thanks! edit : turns out, if remove yaxis.id ( jsfiddle here ) chart , legend work expected. linking series yaxis based on position in array (i think?) instead of id (string) sounds less ideal. ideas? why trying assigning second series axis copy of proper one? advice set both series master yaxis, , second yaxis use info on right side of char

wordpress - WooCommerce - Shipping plugin ignored -

i've written plugin adds custom shipping method woocoomerce. it seems intermittently not returning shipping prices. on cart page, shipping estimator works fine; then, when click through checkout, display results (from cheapest fastest) on refresh, correct guest billing address, returns nothing; debugging shows not call plugins' shipping calculator or 'enabled' function check. says there no shipping options australia (if shipping option activated) have tried contacting woo guys, nada. edit: lessons learned. firstly, big one: woocommerce uses transients - caches shipping results. can reset these in woocoomerce settings, system status->tools extra edit: lastest woocommerce version lets turn off! .. if shopping administrator .. secondly: once above out of way, turned out reading in posted address details incorrectly, , plugin returning 'false' , knocking out of running. big xdebug , php storm .. thirdly: aside, have hooked plugin's in

android - Unlocks app even after payment decline -

i develop app in app version 2 , publish on developers google 1 download app , try purchase it. on purchasing message showed him "your card decline" after message app got "unlock" . difficult situation payment not made while app got unlock. issue in app billing method(logic) in app or google. if in app there method check person card "declined card" in method can restrict app not unlock app. any app appreciated. i have code in billingreceviver: @override public void onreceive(context context, intent intent) { string action = intent.getaction(); if (consts.action_purchase_state_changed.equals(action)) { string signeddata = intent.getstringextra(consts.inapp_signed_data); string signature = intent.getstringextra(consts.inapp_signature); purchasestatechanged(context, signeddata, signature); } else if (consts.action_notify.equals(action)) { string notifyid = intent.getstrin

shell - What is the difference between "$a" and $a in unix -

this question has answer here: when wrap quotes around shell variable? 3 answers for example: #!/bin/sh a=0 while [ "$a" -lt 10 ] b="$a" while [ "$b" -ge 0 ] echo -n "$b " b=`expr $b - 1` done echo a=`expr $a + 1` done* the above mentioned script gives answer in triangle while out double quotes, falls 1 after other on diff lines. after variable expanded value, word splitting (i.e. separating value tokens @ whitespace) , filename wildcard expansion takes place unless variable inside double quotes. example: var='foo bar' echo no quotes: $var echo quotes: "$var" will output: no quotes: foo bar quotes: foo bar

regex - how to create regular expression in php for all input tags in a webpage? -

plz me in making regular expressions explaination of each components.i want parse input tags , text areatags given below- <input id="t_15_k_5" type="text" value="xxychf" name="t_15_k_5" style="display: none;"></input> <input type="hidden" value="sn2sms" name="i_m" style="display: none;"></input> <input id="kriya" type="hidden" value="sa65sdf656fdfd" name="kriya"></input> <textarea id="m_15_b" name="m_15_b" style="display: none;">mwlcqrzp</textarea> also 1 - <input id="mwlcqrzp" class="wickenabled input" type="text" onblur="if(this.value=='') this.value='mobile number';" onfocus="if(this.value=='mobile number') this.value='';" value="mobile number" onchange="javascript:displ

ios - what's the different between refreshObject:mergeChanges: and set object to nil? -

if use method [moc refreshobject:employee mergechanges:no]; , employee turned fault , pending changes lost. think can setting employee nil, don't know what's difference between them. employee = nil sets pointer managed object nil , not reset object in managed object context @ all.

java - How to interdict to close an ExpandableList? -

is there way avoid expandablelist close when click on ? tried: @override public void onclick(view v) { if (v == expandablelist){ expandablelist.expandgroup(0); //let's imagine there's 1 parent , 1 child } } but doesn't work.

php - Multiple File Upload With ProgressBar in Flash Action script with preview of image and individual progress bar for each file -

i trying develop multiple file upload script in flash action script 3.0 on adobe flash cs3 and here code :- flash action script : import flash.net.filereferencelist; import flash.events.event; import flash.net.urlrequest; import flash.net.filereference; var fileref:filereferencelist = new filereferencelist(); var uploadurl:urlrequest = new urlrequest(); var uploadphotoscript:string = "http://localhost/as3/1.php"; uploadurl.url = uploadphotoscript; var totalfiles:int = 0; btn_browse.addeventlistener(mouseevent.click, onuploadclicked); function onuploadclicked(e:mouseevent):void { fileref = new filereferencelist(); fileref.browse(new array( new filefilter( "images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg;*.jpeg;*.gif;*.png" ))); fileref.addeventlistener(event.select, fileselecthandler); } function fileselecthandler(event:event):void { each(var filetoupload:filereference in fileref.filelist){ ++totalfiles; uploadsinglefile(file

garbage collection - In c#,can we use finalize to dispose the managed source? -

according pattern of how use idisposable, microsoft suggests use finalize release unmanaged source. http://msdn.microsoft.com/en-us/library/system.idisposable%28v=vs.80%29.aspx but happen if write codes release managed source in finalize? when gc call finalize release managed source, happen? it's bad practice in general . in finalizer code can't rely on state of object , managed resources - can collected or disposed/finalized already. also, can't rely on order, in clr calls finalize .

image - Pixel-wise like assignment In Matlab -

is there way assignment masked pixels same color except for-loop ? %% pick color cl = uisetcolor; %1-by-3 vector im = ones(3, 3, 3) / 2; % gray image mask = rand(3, 3); mask_idx = mask > 0.5; % create mask %% im(mask_idx, :) = cl'; % assignment pixels color `cl` you making use of repmat() : %% pick color cl = uisetcolor; %1-by-3 vector im = ones(3, 3, 3)/2; % gray image mask = rand(3, 3); mask_idx = mask > 0.5; % create mask cl_rep = repmat(cl,[sum(mask_idx(:)) 1]); im(repmat(mask_idx,[1 1 3])) = cl_rep(:); what have done repeat mask 3 times 3 layers of image. able match colour-vector cl has repeated. number of times repeated same amount of pixels changed, sum(mask_idx(:)) .

HTML ignoring php tags and print plain text issue -

hi in html document i'm including some inside 1 of divs, prints php code plain text , kind of ignores php tags. here how code it. </form> //just html tags right before php tags <br/> <br/> <p id="hint"></p> <?php // begining of php tags form(); function form(){ print "<form method='post' action='$_server[php_self]'>"; print"<input type='text' name='species'/>"; print"<input type='submit' name='submit'/>"; print"</form>"; } echo '<div id='language_information'>'; ?> </div> <div style ="display:none;"id="about" title="how works">' here inspect element in chrome gives me, commented , plain text <p id="hint"></p> <!--?php form(); function form(){ print &

c# - Docking guide when control added to another form -

i have windows form application , pass control of additional form main form's tabpage: form2 frm2 = new form2(); frm2.toplevel = false; tppage1.controls.add(frm2); my question be: how can docking guide work? don't want use user control, because keep opportunity release control tabpage. thank you, daniel update : i use docking guide when move inner form, when it's control added main form. after startup app looks like: default layout then add control of smaller form tabpage of main form: control added i have docking guide when smaller form got docked, in case of picture above. docking guide: (sorry, due lack of reputation) [https://]picasaweb[dot]google[dot]com/lh/photo/pgk8vqacihwk292th8mzjerqtyanis0mvioxq6axe9c?feat=directlink docking guide example popup block when move solution explorer in visual studio. i realized docking guide works if use user control instead of forms, keep ability release control main form. thank in advance, daniel

Why in Android Async task not working as it supposed to Do -

i have activity, splash activity , want load 2 music in , when loading finish want start welcome page, unfortunately made wrong. even though got log made when load complete , got log when 2 music not loaded.. log loaded 1 true loaded 2 true 1 not 2 two not 2 code package com.syriatel.eattel; import android.app.activity; import android.content.intent; import android.media.audiomanager; import android.media.soundpool; import android.media.soundpool.onloadcompletelistener; import android.os.asynctask; import android.os.bundle; import android.util.log; public class splash extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.splash); new load1().execute(1); new load2().execute(2); } public int soundid, soundid2; private soundpool soundpool1, soundpool2; boolean isload1, isload2; class load2 extends asynctask<integer, in

asp.net mvc 4 - ServiceRoute overriding Existing routes -

a newbee in mvc patterns, please bear me. i have defined serviceroute in global.asax file routetable.routes.add(new serviceroute("rest", new webservicehostfactory(), typeof(servicename))); this route overriding existing routes. better explain this, setting "/rest/controller/action" . has "/controller/action" routeengine appending serviceroute in actions calls . how can set exact mapping . you have use constraints, , register routes in right order. you can full explanation of what's happening here . when reading remember mapserviceroute method has dissapeared, , way register services have chosen. you don't need implement irouteconstraint. can use regex.

filesystems - node.js how to insert string to beginning of file but not replace the original text? -

the code below inserted somestring file replace text inside file. how can fix this? fd = fs.opensync('file', 'r+') buf = new buffer('somestring') fs.writesync(fd, buf, 0, buf.length, 0) fs.close(fd) open file in append mode using a+ flag var fd = fs.opensync('file', 'a+'); or use positional write . able append end of file, use fs.appendfile : fs.appendfile(fd, buf, err => { // }); write beginning of file: fs.write(fd, buf, 0, buf.length, 0); edit: i guess there isn't single method call that. can copy contents of file, write new data, , append copied data. var data = fs.readfilesync(file); //read existing contents data var fd = fs.opensync(file, 'w+'); var buffer = new buffer('new text'); fs.writesync(fd, buffer, 0, buffer.length, 0); //write new data fs.writesync(fd, data, 0, data.length, buffer.length); //append old data // or fs.appendfile(fd, data); fs.close(fd); please note must use

xsd - XML Restriction number between range with exceptions -

let's i've like: <xs:simpletype name="aye"> <xs:restriction base="xs:unsignedshort"> <xs:mininclusive value="32768"/> <xs:maxinclusive value="65535"/> <!-- or, instances, 5, 15, 20 or 245 --> </xs:restriction> </xs:simpletype> is possible define simpletype restricts number between range [a,b] allows pre-defined numbers less a? try following <xs:simpletype name="exceptions"> <xs:restriction base="xs:unsignedshort"> <xs:enumeration value="5" /> <xs:enumeration value="15" /> <xs:enumeration value="20" /> <xs:enumeration value="245" /> </xs:restriction> </xs:simpletype> <xs:simpletype name="range"> <xs:restriction

How to keep state of RadioButton in Android? -

hi i'm trying develop application runs every interval time, lets every 1 minute display toast message . but problem i'm using radiobutton functionality perfect when tap on 1 radio button green, when close , re-open activity i'll none of radio buttons selected. here mainactivity.java public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } public void onradiobuttonclicked(view view) { // button checked? boolean checked = ((radiobutton) view).ischecked(); // check radio button clicked switch(view.getid()) { case r.id.radio_one_min: if (checked) { //some code } break; case r.id.radio_ten_min: if (checked) { //some code } break; case r.id.radio_disable:

html - Auto scroll overflow text with CSS3 -

i have limited area show long text. should wrapped ellipsis. when mouse on it, should scrolled until end of came this have problems. it doesn't work on opera browser. it uses static width property. div.content:hover { width:742px; } even text shorter; scrolls in static duration. how can solve this? edit: solved these problems javascript pure css3 solution still great because hate injecting css rules inside of javascript code. http://fiddle.jshell.net/tu43f/18/ test : (u can modify right attributes in animation same u want) div.content:hover { -webkit-animation: slide 5.0s linear; -moz-animation: slide 5.0s linear; -o-animation: slide 5.0s linear; animation: slide 5.0s linear; width:742px; right:0px; text-overflow: clip; } @-webkit-keyframes slide { 0% { right:-665px;} 50% { right:-340px;} 100% { right:-0px; } } @-moz-keyframes slide { 0% { right:-665px;} 50% { right:-340px;} 100% { right:-0px; }

xml - C# - Displaying files in DataGridView after selecting it from FolderBrowserDialog -

i trying code windows form application visual studio uses xml file read linq. far, managed browse folders using folderbrowserdialog , display path in textbox. now want read path of folders xml file using linq in program, after selecting folder in folderbrowserdialog, show subfiles , subfolders of folder in datagridview (only name,size , path). my xml code is: <?xml version="1.0" encoding="utf-8"?> <info> <hour>10</hour> <folder>c:\test</folder> </info> i managed read hour value not reach , use folder because don't know how reach path in xml file using linq. tried not manage how continue: var _query2 = p in document.descendants("folder") select p; after this, want show name, size , type of subfiles in datagridview, wrote class not manage begin. public class info { public string name; public char type; public float size; public list<string&

html - IE 7 & 8 drop down issue -

i new building sites go easy on me :) having issue ie 7 , 8 css dropdown menu. works fine in others browsers. here css struggling with: .nav-item { display: inline-block; padding: 25px 10px 25px 20px; top: 0px; font-size: 14px; position: relative; /* ie7 fix*/ zoom: 1; *display: inline; } .nav-item .dropdown { display: none;position: absolute; top: 62px; text-align: left; left: 27px; padding: 5px 10px 8px 5px; background: #343434; border-radius: 0px 0px 4px 4px; z-index: 11; } #header-wrapper {width: 990px; margin: 0 auto; text-align: left; position: relative; z-index: 9; overflow: visible;} the drop down seems stay within header , not overhang though it's position absolute, if header-wrapper has overflow: hidden; any ideas or suggestions great, thanks! adam please remove .gradient class menuitem . one small issues <div class="dropdown gradient"> , should <div class="dropdown>

Spring + MVC + Hibernate: Can't read my requestBody -

and again question converning sring, mvc , hibernate. tried every possible solution given here. nothing fixed problem. what want do: add new entry sql database sending put-request server json object. what works: server working, request supposed to. database recognizes , adds new entry, attributes null my setup: database: sql (generated xampp) server: spring, mvc, hibernate here files (please note inluded jacksonmapper) applicationcontext-servlet.xml <context:component-scan base-package="ma" /> <mvc:annotation-driven /> <tx:annotation-driven /> <!-- hibernate integration --> <bean id="datasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close"> <property name="driverclassname" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/travelpal" /> <property name="user

Objective-C >> Capturing an Object Address in Memory -

how capture address of object @ point in code? example: nsstring * astring = @"bla bla"; //what current address of astring. i.e address in memory point astring = @"la la la"; //what current address of astring. example: nsstring *temp = @"123"; uintptr_t ptraddress = (uintptr_t) temp; nslog(@"%@ %p %lu", temp, temp, ptraddress); console: 2013-07-11 11:51:20.796 asd[6474:907] 123 0x17985c 1546332 it may useful - nspointerarray (ios 6+)

testing - How to arrange testlists as we needed order in telerik test studio -

Image
my test list vendor employee customer initial navigation i want display like initial navigation first customer vendor employee. how can arrange in order.am not asking tests in test list.test list need re arrange the grid displaying list of test lists, many other grids, can sorted column clicking on column header. give items alphabetical names sort name column. i not know of way otherwise specify particular order of display. if feature you'd request, http://feedback.telerik.com/project/117/ place so. please sure include information on how , why you'd use feature can prioritized.

Difference between RDF Containers and Collections? -

i have read book the difference between containers , collections lies in fact containers open (i.e., new members may added through additional rdf statements) , collections may closed. i don't understand difference clearly. says no new members can added collection. if change value of last rdf:rest property rdf:nil _:xyz , add _:xyz rdf:first <ex:aaa> . _:xyz rdf:rest rdf:nil . i able add new member _:xyz . why collections closed? the key difference in container, can continue add new items, asserting new rdf triples. in collection, first have remove statement before can add new items. this important difference in particular rdf reasoning. it's important because rdf reasoning employs open world assumption (owa), which, put simply, states because fact not known, not mean can assume fact untrue. if apply principle container, , ask question "how many items container have", answer must "i don't know", because there no way

java - Android Sudio - Errors after adding Google Play Services / Android Support -

first copied , placed google-play-services.jar in "src/main/libs/" folder android-support-v4.jar in "src/main/libs/" folder i both did this: right clicked on top root item (project) selected "module settings" navigated "dependencies" clicked "+" , "file dependency" chose "google-play-services.jar" , "android-support-v4.jar" however, error: execution failed task ':standard:dexdebug'. com.android.ide.common.internal.loggederrorexception: failed run command: d:\devtools\android-studio-intellij\sdk\build-tools\android-4.4.2\dx.bat --dex --output w:\intellij-android-projects\example\standard\build\libs\standard-debug.dex w:\intellij-android-projects\example\standard\build\classes\debug w:\intellij-android-projects\example\standard\build\dependency-cache\debug w:\intellij-android-projects\example\standard\build\pre-dexed\debug\android-support-

c++ - Qt: resize a QGraphicsItem (boundingRect()) into a QGraphicsScene with the mouse -

i resize boundingrect() of qgraphicsitem using mouse. to build found topic . managed make work right, bottomright , bottom of boundingrect() following idea of topic. but since position of item defined top left of boundingrect() more complicated modify size of item moving edges linked position. i tried top left bottom right moving. have bottom right fixed change size , not whole position. here part of code: void myclass::mousemoveevent(qgraphicsscenemouseevent *event) { if(_resizemode) //if bottom selected { preparegeometrychange(); _h = event->pos().y(); } if(_resizemode2) //if bottom right selected { preparegeometrychange(); _h = event->pos().y(); _w = event->pos().x(); } if(_resizemode3) //if right selected { preparegeometrychange(); _w = event->pos().x(); } if(_resizemode4) //if top left selected here issue { preparegeom

java - how to speed up the uploading of files -

here trying make uploader in java spring user going upload large files (around 200 mb) can 1 advise here speed writing process of file on server. following code using write file on server. if (!file.isempty()) { byte[] bytes = file.getbytes() ; bufferedoutputstream bufferedoutputstream = new bufferedoutputstream( new fileoutputstream(new file("/home/" + file.originalname()))); bufferedoutputstream.write(bytes); bufferedoutputstream.close() ; } else { system.out.println("file empty"); }

How do I run a Ruby on Rails app? -

forget form of server configuration (e.g. sites-enabled / apache / nginx). imagine files publicly accessible in web server. i have these folders available: /app/assets /app/controllers /app/helpers /app/mailers /app/models /app/observers /app/uploaders /app/views /public/ i don't have more folders this. if go domain.com/public/htmlpage.html can see html render fine. if go domain.com/public/ "index file doesn't exists" message. how run rails app? file supposed run in web browser? cd project root directory, directory 1 above app directory , run command bundle install and later rails s this command run webrick server on port 3000, since running application on localhost can use url check application in browser http://localhost:3000/ you can append name of file have in public directory run as http://localhost:3000/htmlpage.html

c# - LINQ query works in LINQPad, but not in VS -

i'm using entity framework, getting when hits last line : the methods 'single' , 'singleordefault' can used final query operation. consider using method 'firstordefault' in instance instead. my query is: var orderitems = orderitem in db.order_productitem join style in db.products_styles on orderitem.style equals style.index orderitem.salesorderid == salesorderid && (orderitem.isdeleted==null || orderitem.isdeleted.value == false) group new { orderitem, style } orderitem.frameno grp select new orderitemmodel { frameno = grp.key, //count = grp.select(x => x.orderitem.frameno).count(), totalcost = grp.sum(x => x.orderitem.costprice), overallwidth = grp.single(x => x.orderitem.hardwaretype == 3).orderitem.overallwidth, overallheight = grp.single(x => x.orderitem.hardwaretype == 3).orderitem.overallheight, name = grp.select(x => x.style.name).first(),

How to render a simple HTML page in Playframework -

i have added simple login page in directory c:\play-2.2.2\samples\java\forms\app\views\ecal_login\login.html the same page when moved directory works fine c:\play-2.2.2\samples\java\forms\app\views i want render same page views\ecal_login directory. how can that? i using function public static result login() { return ok(login.render()); } note:i have page login.html , not login.scala.html record! as estmatic commented should ok(views.html.ecal_login.login.render()) here you'll find several other samples working views in subpackages: https://stackoverflow.com/a/14625097/1066240