Posts

Showing posts from March, 2013

python - Partial read from Socket.File.Read -

im coding python script connects remote server, , parses returned response. odd reason, 9 out of 10 times, once header read, script continues , returns before getting body of response. im no expert @ python, im code correct on python side of things. here code: class miniclient: "client support class simple internet protocols." def __init__(self, host, port): "connect internet server." self.sock = socket.socket(socket.af_inet, socket.sock_stream) self.sock.settimeout(30) try: self.sock.connect((host, port)) self.file = self.sock.makefile("rb") except socket.error, e: #if e[0] == 111: # print "connection refused server %s on port %d" % (host,port) raise def writeline(self, line): "send line server." try: # updated sendall resolve partial data transfer errors self.sock.sendall(line + crlf) # unbuffered write except socket.error, ...

Html5 scrollbar using images -

i going create html5 javascript app , in want floating scroll of images. want scroll images of a,b,c , want mouse dragging , no scroll bar used. can 1 shed light on this? <link rel="stylesheet" type="text/css" href="jquery.horizontal.scroll.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="jquery.horizontal.scroll.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('#horiz_container_outer').horizontalscroll(); }); </script> /* add necessary html*/ <ul id="horiz_container_outer"> <li id="horiz_container_inner"> <ul id="horiz_container"> <li>image 1</li> <li>image 2</li> <li...

if statement - C# int.TryParse Maybe? -

Image
so error i've been trying figure out can not seem fix. . in 1 function. file.copy(item.filename, mcad [versiontext.tag], true); private void version_2_0_click(object sender, eventargs e) { string version_2_0_selected = versiontext.text = "version 2.0"; versiontext.tag = 2; } but versiontext.tag in first part gives me error. i heard int.tryparse , can not figure out how implement code. i hope explained enough. my assumption of problem on line file.copy(item.filename, mcad [versiontext.tag], true); specifically mcad [versiontext.tag] . .tag returns type object , array indexer expects int . if cast it, should rid of compile error @ least. file.copy(item.filename, mcad [(int)versiontext.tag], true); if versiontext.tag doesn't contain integer, you'll runtime error, however.

android - How to validate a view or layout in robotium -

i have showing different view in android application how validate weather view or whole layout present or not using robotium in android. you can check using assertequals . there can compare : asserequals("desired view not visible", yourview.getvisiblity(),view.visible); here, view yourview = findviewbyid(r.id.yourviewid);

php - Redis Pub/Sub with Python backend and Socket.io -

i have php code publishes data channel called "message_from_mars". snippet follows : function send_data_to_check_spam($feedback) { $d_id=$this->redis_connect(11); //echo $feedback; //die(); echo "<b style='color:red'>message sent spam swatter</b>"."<br>"; $d_id->publish("message_from_mars",$feedback); } there server side python listener receives published data , snippet follows : r = redis.strictredis(host='localhost', port=6379, db=11) def sum(a,b): print a+b def main(): sub = r.pubsub() sub.subscribe('message_from_mars') the python code processing , publishes result back. snippet follows : r.publish('spam_status',spam) i trying result using socket.io websocket , snippet follows. : <script> var socket = io.connect('127.0.0.1:6379'); console.log(socket); socket.on('spam_status...

c# - XMLWorker class using iTextSharp to convert HTML text into PDF document -

its been told htmlworker deprecated in favor of xmlworker. when googled around & cannot find around class. struggling find dll contains implementation class. i have looked @ following links: http://demo.itextsupport.com/xmlworker/itextdoc/flatsite.html http://sourceforge.net/projects/itextsharp/?source=dlp while still searching example show me how convert html text pdf document using xmlworker class while utilizing css class, great if can please me on this.

java - FATAL exception Thread -12 -

app crashing after timer finishes time... have move activity lvl_2 after timeout . its game 5 levels namely game,lvl2_game,lvl3_game,lvl4_game,lvl5_game 8 layout lvl_1,lvl_2,lvl_3,lvl_4,lvl_5 ,menu , home,score have move game.java lvl2_game after timeout returning fatal exception : thread -12 java.lang.illigalstateexception public class game extends activity implements sensoreventlistener{ mediaplayer coinsong; float fx1,fx2,fx3,fx4,fy1,fy2,fy3,fy4; float xb1,xb2,xb3,xb4,yb1,yb2,yb3,yb4; int result=0; float xc1_1,xc1_2,xc1_3,xc1_4,yc1_1,yc1_2,yc1_3,yc1_4; int chk=1,delay,chkc1=0,chkc2=0,chkc3=0,chkc4=0,chkc5=0,chkc6=0,chkc7=0,chkc8=0,chkc9=0,chkc10=0,chkc11=0,chkc12=0; float xc2_1,xc2_2,xc2_3,xc2_4,yc2_1,yc2_2,yc2_3,yc2_4; float xc3_1,xc3_2,xc3_3,xc3_4,yc3_1,yc3_2,yc3_3,yc3_4; float xc4_1,xc4_2,xc4_3,xc4_4,yc4_1,yc4_2,yc4_3,yc4_4; float xc5_1,xc5_2,xc5_3,xc5_4,yc5_1,yc5_2,yc5_3,yc5_4; float xc6_1,xc6_2,xc6_3,xc6_4,yc6_1,yc6_2,yc6_3,...

php - Jquery Ajax Post type not working with zend framework IE 7/8 -

i facing weird problem in ie8/7 (as always), time has came up-with zend framework.. below have explained .. problem, when using jquery ajax method in zend framework 1.x below , if use 'type: 'post' zend controller not detect parameter values is, instead of displaying blank.. for example in zend controller `echo $this->_request->getparam('adata');` //echo nothing but if use type : 'get' parameters display fine in zend controller. echo $this->_request->getparam('adata'); //echoing parameter values $.ajax({ type: 'get', datatype: 'json', url: "/xhr_process/commentsave/", data: adata, success:function(aresponse){ console.log(aresponse); } }); this coming in ie 8/7 other browsers working fine appreciate thoughts !! update i have set cache false not success console.log(adata); object { scommen...

android - TextView won't center vertically in parent -

my activity has single textview , trying text center vertically ends aligning bottom. tried changing several properties no luck. here have (android 2.3): <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/llflash" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" > <textview android:id="@+id/tvflash" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="#ff0000" android:padding="0dp" android:textstyle="bold" android:includefontpadding="false" android:gravity="center_vertical" android:layout_centerinparent="true" /> </relativelayout> edit: setting...

jquery - MVC4 Knockout data-bind click event not firing -

i getting started knockout , having issue click event not firing. the above not firing getwaiters function. not sure doing wrong or missing. tia i have following html: <h2>create</h2> <table> <thead> <tr> <th>waiterid</th> <th>restid</th> <th>name</th> </tr> </thead> <tbody data-bind="foreach: waiters"> <tr> <td data-bind="text: waiter_id"></td> <td data-bind="text: rest_id"></td> <td data-bind="text: name"></td> </tr> </tbody> </table> <br /> @scripts.render("~/bundles/mybundle") <input type="button" id="btngetwaiters" value="get waiters" data-bind="click: getwaiters" /> , following in js file: var waitervi...

listview - How to bind the data to the list item of list view in cascades -

i'm developing blackberry 10 application cascades framework. want display categories in list view when user clicks on button . i've created 1 qml page list view. categories.qml import bb.cascades 1.0 page { container { background: backgroundpaint.imagepaint //preferredwidth: 768 //preferredheight: 1280 attachedobjects: [ imagepaintdefinition { id: backgroundpaint imagesource: "asset:///images/list_bg.png" } ] //start of row 1 container { preferredwidth: 748 preferredheight: 145 //background: color.blue; /*layout: stacklayout { orientation: layoutorientation.lefttoright }*/ // page header label { objectname: "categoriesheaderlabel" text: "categories" translationx: 0 translationy: 40 horizontalalignment: horizontalalignment.center...

oracle value 0.1 become .1 cannot use in java playframework models -

i try save value 0.1 database, became .1. , when try use java double type became error. need use format method in java able use it? sorry sounding nagging teacher need learn basics of computing: when stored number (either float or variable-length decimal) there no difference between 0.1 , .1 - it's matter of display format, not underlying value. e.g. go , read http://en.wikipedia.org/wiki/ieee_floating_point see how floats typically encoded as. also, see oracle floats vs number understand how oracle floats numeric, not ieee floats. secondly, post source code possible - no information there's no way can make educated guess of problem.

oracle - Concatinating entire column without any condition -

this question has answer here: is there oracle sql query aggregates multiple rows 1 row? [duplicate] 7 answers transpose select results oracle 2 answers i have column values 3,8,11 . want concatenate separator. the output should 3-8-11 . don't have condition or group parameter. how can write oracle query this?

real time data - How to get Acknowledgement from Kafka -

how acknowledgement kafka once message consumed or processed. might sound stupid there way know start , end offset of message ack has been received ? what found far in 0.8 have introduced following way choose offset reading .. kafka.api.offsetrequest.earliesttime() finds beginning of data in logs , starts streaming there, kafka.api.offsetrequest.latesttime() stream new messages. example code https://cwiki.apache.org/confluence/display/kafka/0.8.0+simpleconsumer+example still not sure acknowledgement part

.htaccess - htaccess similar file names goes to same page -

most of rewriterules working fine there couple have same word in them , aren't going correct page. here full htaccess options +followsymlinks rewriteengine on rewritecond %{script_filename} !-f rewritecond %{script_filename} !-d # rewrites main pages rewriterule home index.php rewriterule about-us about-us.php rewriterule business-advice business-advice.php rewriterule associates associates.php rewriterule become-an-associate associates-sign-up.php rewriterule blog blog.php rewriterule contact-us contact-us.php rewriterule log-in log-in.php rewriterule sign-up sign-up.php the problem resides within 2 associated links. when go [myurl]/associates works fine if go [myurl]/become-an-associate takes me correct url shows content [myurl]/associates anybody got ideas? thanks, the pattern rewriterule 's regular expressions , rules loop until uri stops changing. means first time around, when request /become-an-associate , matches , rewritten /associates-sign-up....

android - Titanium appcelerator studio Installation issue -

i facing problem installation of titanium studio. i have set required environment variable's this java_home variable c:\program files (x86)\java\jdk1.7.0_25; this mt path variable c:\development\android-sdk-windows;c:\development\android-sdk-windows\platform-tools;c:\development\android-sdk-windows\tools;c:\program files (x86)\java\jdk1.7.0_25;c:\program files (x86)\winant\bin;d:\android sdk\android-sdk_r16-windows\android-sdk-windows\tools;c:\development\phonegap-2.9.0\lib\android; i have installed jdk1.7.0_25 , jre 7 . also have given path of android sdk d:\adt-bundle-windows-x86_64-20130219\sdk , @ android sdk home variable. but when try connect android sdk titanium studio showing me installing android , nothing happening. when try run application gives me error it appears not have android sdk installed in system please follow instructions @ dashboard configure sdk i have followed same not finding solution, please me. thanks in advance. from d...

sharepoint 2010 - calculate days excluding weekends in sharepoint2010 -

how exclude weekends(sat , sun) when counting number of days between start , end time in sharepoint 2010 calculate column. 1.i have calender added sharepint 2010 , there 2 columns start time , end time , requirement calculate number of days between star time , end time excluding weekends(sat , sun) means calculate working days only. tried =if(and((weekday(enddate,2))<(weekday(startdate,2)),((weekday(startdate,2))-(weekday(enddate,2)))>1),(((datedif(startdate,enddate,"d")+1))-(floor((datedif(startdate,enddate,"d")+1)/7,1)*2)-2),(((datedif(startdate,enddate,"d")+1))-(floor((datedif(startdate,enddate,"d")+1)/7,1)*2))) also, =(datedif([startdate],[enddate],"d"))-int(datedif([startdate],[enddate],"d")/7)*2-if((weekday([enddate])-weekday([startdate]))>0,2,0)+1 but not getting correct out put. thanks =if(and((weekday(enddate,2))<(weekday(startdate,2)),((weekday(startdate,2))-(weekday(enddate,2)))...

javascript - How do i allow my rates to be refreshable? -

the bid , offer being defined $bid,$bid1,$bid2. need refreshed every 1 second , located in text field predefined. able put rates in upon selection how them refreshing? heres code: start.php <?php session_start(); $timestamp=time();set_time_limit (0); echo 'welcome trade page <br>'; $_session['u'] = 'seyant'; $_session['p'] = 'se5an123'; $_session['q'] = 'eurates'; $url = "http://webrates.truefx.com/rates/connect.html?c=eur/usd&f=csv&s=n"; $url1 = "http://webrates.truefx.com/rates/connect.html?c=usd/jpy&f=csv&s=n"; $url2 = "http://webrates.truefx.com/rates/connect.html?c=usd/cad&f=csv&s=n"; $url3 = "http://webrates.truefx.com/rates/connect.html?c=eur/jpy&f=csv&s=n"; $url4 = "http://webrates.truefx.com/rates/connect.html?c=eur/chf&f=csv&s=n"; $url5 = "http://webrates.truefx.com/rates/connect.html?c=gbp/usd&f=c...

ruby - How to verify if colour of element changed on mouse hovering? -

if mouse hovered on 'ask question' button of https://stackoverflow.com/ website, colour of button changes yellow. if want make sure, if colour changes on mouse hover, how can achieve using selenium webdriver? couldn't find helpful in html dom. i can hover mouse on element using move_to method don't know how check whether colour of button changes? think, i'll have check css style not sure how that. use css_value , see documentation here . note background color property on <li> , not <a> in particular case. btn_ask_question = driver.find_element(:css, '.nav.askquestion li') puts btn_ask_question.css_value('background-color') driver.action.move_to(btn_ask_question).perform puts btn_ask_question.css_value('background-color') my output (rgba(255, 153, 0, 1) #ff9900, orange color): rgba(119, 119, 119, 1) rgba(255, 153, 0, 1)

compilation - Build automation for AutoCAD Lisp files -

i have huge lisp project, i've made prv file permits vlide compile project single vlx file (it compiles fas file). problem is not possible compile project outside autocad or command prompt cannot automate vlx building using script. the question is: there way this? can compile fas-vlx outside autocad? or can launch autocad giving script compiles prv , closes autocad? you have launch autocad, gets tricky requires use of undocumented functions .

ios - sorting a nested NSMutableArray -

the nsmutablearray want sort looks this: ( { "title" = "bags"; "price" = "$200"; }, { "title" = "watches"; "price" = "$40"; }, { "title" = "earrings"; "price" = "$1000"; } ) it's nsmutablearray contain collection of nsmutablearray s. want sort price first title . nssortdescriptor *sortbyprices = [[nssortdescriptor alloc] initwithkey:@"price" ascending:yes]; nssortdescriptor *sortbytitle = [[nssortdescriptor alloc] initwithkey:@"title" ascending:yes]; [arrayproduct sortedarrayusingdescriptors:[nsarray arraywithobjects:sortbyprices,sortbytitle,nil]]; however, didn't seems work, how sort nested nsmutablearray ? try nsmutablearray *arrayproducts = [@[@{@"price":@"$200",@...

algorithm - Quick and Merge sort for multiple CPUs -

both merge sort , quick sort can work in parallel. each time split problem in 2 sub-problems can run sub-problems in parallel. looks sub-optimal . suppose have 4 cpus. on 1st iteration split problem in 2 sub-problems , 2 cpus idle. on 2nd iteration cpus busy on 3d iteration not have enough cpus. so, should adapt algorithm case when cpus << log(n) . does make sense? how adapt sorting algorithms these cases? first off, best parallel implementation depend highly on environment. factors consider: shared memory (a 4-core computer) vs. not shared (4 single-core computers) size of data sort speed of comparing 2 elements speed of swapping/moving 2 elements memory available is each computer/core identical or there differences in speeds, network latency communicate between parts, cache effects, etc. fault tolerance: if 1 computer/core broke down in middle of operation. etc. now moving theoretical: suppose have 1024 cards, , 7 other people me sort them. ...

android - Table not found issue in SQLite -

i have written code information json file related specific youtube video , stores information need in database. the parsing json file has no problem. when trying insert values in database error message appears telling me no such table exists. here stack-trace: 07-31 08:42:22.451: i/database(365): sqlite returned: error code = 1, msg = no such table: youtube_videos 07-31 08:42:22.471: e/database(365): error inserting video_commentcount=70 video_countview=50 video_name=badly drawn boy - disillusion (directed garth jennings) video_url=https://www.youtube.com/watch?v=b11msns6wpu&feature=youtube_gdata_player video_likes=60 video_img=https://i1.ytimg.com/vi/b11msns6wpu/default.jpg video_descrption=my new playlist description 07-31 08:42:22.471: e/database(365): android.database.sqlite.sqliteexception: no such table: youtube_videos: , while compiling: insert youtube_videos(video_commentcount, video_countview, video_name, video_url,video_like...

iphone - Convert landscape image to portrait mode when select from UIImagePickerController in iOS6 -

i want convert landscape image portrait mode when select uiimagepickercontroller in ios6. please tell suggestions thanks you need add autoresizing mask image view. try this:- yourimageview.autoresizingmask = uiviewautoresizingflexibletopmargin | uiviewautoresizingflexiblebottommargin | uiviewautoresizingflexibleleftmargin | uiviewautoresizingflexiblerightmargin;

java - Method to create a cube in OpenGL -

how should x, y, z, sizex, sizey, sizez values put vertices make cube? public static void cube(float x, float y, float z, float sx, float sy, float sz){ glpushmatrix(); { gltranslatef(x, y, z); //just 1 side of cube given due unnecessary code. glbegin(gl_quads); glvertex3f(-1, -1, 1); glvertex3f(1, -1, 1); glvertex3f(1, 1, 1); glvertex3f(-1, 1, 1); glend(); } glpopmatrix(); } thanks. wherever in code have e.g. glvertex3f(-1, -1, 1); mulitply them corresponding value of sx, sy, sz divided 2 e.g. glvertex3f(-sx/2, -sy/2, sz/2); for position can issue gltranslatef(x, y, z) before drawing cube. if insist on hardcoding vertices should write above statement glvertex3f(x - sx/2, y - sy/2, z + sz/2);

css - Ipad/iPhone fonts not rendering properly -

i have issue fonts on ipad (4) / ios 7.0b4. i have css: p span { font-family: 'arial black', sans-serif; font-size: 22px; } renders fine in browsers not on iphone or ipad. displays serif font , not arial black. if write "sans-serif" displays serif font. changing arialmt, arial or helvetiva doesn't work either. i use foundation 4 framework own stylesheet. do miss something? ios not support arial black. source: http://iosfonts.com/ edit: seems problem css rule wasn't overwriting foundation css. adding !important fixed issue if write more specific css rule work.

testing - How do I test a relationship in Rails using Factory Girl that doesn't hit the database? -

the problem i want able perform following test, fails because using build event instead of create; event_parent = build(:event_parent) event = build(:event, event_parent: event_parent) event_parent.events.size.should == 1 i don't want use create because a) slower , b) factory build events has associations , things don't want have worry being in test database. what have tried i (wrongly) assumed if created method on event_parent model returned events might @ model layer , not database layer. i have changed build create event , works, has undesirable side effects rest of test suite. related code eventparent model class eventparent < activerecord::base has_many :events end event model class event < activerecord::base belongs_to :event_parent end if want spec relationships using activerecord, @ shoulda-matchers gem describe event let(instance) { event.new } { expect(instance).to belong_to(:event_parent) } end describe eventpare...

ios - Objective C / Drawing and resolution questions -

i need create calendar of image (they size 640 x 960 or 960 x 640). 1 approach tried create view, add image view it, present image, "draw" on subviews, save view file. now works planned, testing in simulator, resolution of saved image 306 x 462 (size of view i'm saving). lost half original resolution... is there way work around this? code saved view: uigraphicsbeginimagecontext(self.backgroundimageview.bounds.size); [self.backgroundimageview.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); nsarray * paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring * basepath = ([paths count] > 0) ? [paths objectatindex:0] : nil; nsstring *fullpath = [nsstring stringwithformat:@"%@/calendar.png",basepath]; nsdata * binaryimagedata = uiimagepngrepresentation(image); [binaryimagedata writetofile:fullpath atomically:yes]; ...

javascript - How to construct Raster and resize it? -

i'm using paper.js canvas drawings. i'm trying resize , position raster depending on canvas size code doesn't works properly. var canvas = document.getelementbyid('canvas'); paper.setup(canvas); var pitch = new paper.raster('{{ static_url }}images/pitch.png'); var width = paper.view.size.width; var height = paper.view.size.height; console.log("screen dimensions: " + width + " " + height); var midpoint = [width/2,height/2]; var paddingleft = width/40; var scale = (height/pitch.height)*(90/100); console.log("scale: " + scale); pitch.scale(scale); console.log("pitch dimensions: " + pitch.height + " " + pitch.width); pitch.position = [midpoint[0] + paddingleft - (width-pitch.width*scale)/2 , midpoint[1]]; console.log("pitch position: " + pitch.position); when load page first time, logs: screen dimensions: 472.5 340 scale: infinity pitch dimensions: 0 0 pitch position: { x: nan, y: nan } ...

javascript - Using instantiated object reference within the controller -

i'm trying figure out how use 1 javascript object instantiation across multiple controllers in angularjs. try envisage following scenario: var objtemplate = new templateobject(); objtemplate.init(); app.controller('homecontroller', function($scope) { objtemplate.slidepage(); }); obviously objtemplate.initialise(); doesn't work within controller , i'm not quite sure how it. edit: thanks answer @atrix - looks way forward create new service , move of functionality javascript object - use service perform these operations. you can try using factory in order instantiate object once , access controllers. for more details factory , service , examples check @matys84pl & @justgoscha answers about services & factory

Door log report datediff SQL Server 2008 -

Image
i'm trying produce data when employees swipe in , out of various doors in building. data saved in table - ideally id datediff minutes struggling work! have thoughts best way forward? you can try way, select uid, serialno, datediff(m, max(time), min(time) ) tablename group uid, serialno

fill - gnuplot: filling the whole space when plotting sampled data -

Image
i have problem gnuplot. i've searched , don't find correct solution. i'm plotting data arranged in 3 columns command splot , , steps in x , y different. plot with: set view map splot 'data.dat' using 1:2:3 points palette is: and white space filled, making each tile size adapt, avoiding interpolation. some ideas given here reduce distance between points in splot . i've tryed http://gnuplot.sourceforge.net/demo/heatmaps.html too, with image doesn't seem work :( i should avoid pointsize grid changes time time. you can try set pm3d map interpolate 1,1 corners2color c1 splot 'data.dat' using 1:($2-5e-5):3 this uses no interpolation, , color of each polygon depends on value of corner 'c1'. may need test if correct one, or if need 'c2', 'c3', or 'c4'.

domain driven design - DDD - Enforce invariants with small aggregate roots -

i'm having first attempt @ ddd , i'm running problem aggregate design. my application contains 3 entities; graph, node, link. each of these entities has name property can modified user (which believe makes 'name' unsuitable entity id). graph contains collection of nodes , node has collection of outgoing links (for purpose of problem safe ignore incoming links). each node can associated 1 graph @ time (but can moved between graphs) , similarly, each link can associated 1 node @ given time (but can moved). the invariant(s) attempting enforce entity names unique within parent collection. architecture described above, invariant on actual collections, decided collection owners (graph , node) should both aggregate roots. the problem have how enforce name invariant on node? on link easy since hidden away inside node ar , such node can confirm link renames/moves not break invariant. far can see, there nothing prevent direct rename of node break invariant. even...

c# - Error: Port 1033 in use? -

i has last executed asp.net program yesterday. when today again opened run it, showed me microsoft visual studio error port 1033 in use. how can solve error? should change make port available? my web.config file is: <?xml version="1.0"?> <!-- more information on how configure asp.net application, please visit http://go.microsoft.com/fwlink/?linkid=169433 --> <configuration> <connectionstrings> <add name="constr" connectionstring="data source=.;integrated security=sspi;initial catalog=sshopping"/> </connectionstrings> <system.web> <compilation debug="true" targetframework="4.5"> <assemblies> <add assembly="system.web.extensions.design, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"/> <add assembly="system.design, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"/> ...

c# - Is it possible to restrict generic overload to property type? -

the question can somehow restrict generic overload strictly property type.. not clear now, here example: i have class public class obj { public double width { get; set; } public float widthf { get; set; } } and extension it public static class testgenericoverride { public static void do<tobj, tprop>(this tobj src, expression<func<tobj, tprop>> expr, tprop val) { console.writeline("do: typeof(tprop) = {0}", typeof(tprop).name); } } and main static void main(string[] args) { var o = new obj(); o.do(p => p.width, 100); //1: typeof(tprop) = double o.do(p => p.width, 100.0); //2: typeof(tprop) = double o.do(p => p.widthf, 100); //3: typeof(tprop) = single o.do(p => p.widthf, 100.9); //4: typeof(tprop) = double console.readline(); } what want make last call (#4) unavailable. possible? in other words: if type of property in expression float, want float-overload ava...

javascript - creates a line break before and after drop down menu in css -

when created drop down menu using css, generates line break before , after drop down menu here html code <body> <!--nav class="navi"--> <div class="navi" id="navi"> <ul> <li><a href="#">home</a></li> <li><a href="#">about us</a> <ul> <li><a href="#">history</a></li> <li><a href="#">company profile</a></li> <li><a href="#">core values , mission</a></li> <li><a href="#">strategy</a></li> </ul> </li> <li><a href="#">our brands</a> <ul> <li><a href="#">hamara glucose d</a></li> <li><a href="#">hamara health care patent p...

Epplus - Cannot change cell value or cell header -

i have problem when change value of cell. here code: fileinfo newfile = new fileinfo(file); excelpackage pck = new excelpackage(newfile); var wsdata = pck.workbook.worksheets.add("absent employee list"); var datarange = wsdata.cells["a1"].loadfromcollection( s in emps orderby s.employeecode select s, true, officeopenxml.table.tablestyles.medium2 ); wsdata.cells[2, 4, datarange.end.row, 4].style.numberformat.format = "dd-mm-yyyy" wsdata.cells[2, 5, datarange.end.row, 5].style.numberformat.format = "dd-mm-yyyy"; wsdata.cells["a1"].value = "employee code"; // [1, 1] wsdata.cells["b1"].value = "full name"; // [1, 2] wsdata.cells["c1"].value = "department"; // [1, 3] datarange.autofitcolumns(); pck.saveas(newfile); when open file a...

web services - Axis2 convert xs:boolean to java Boolean -

i have axis2 web service want allow null values on xs:boolean field. have tried change boolean attribute in pojo boolean object makes possible send in null values instead never able convert true boolean false. idea if can solved? to make clear have services.xml specify service class generates web service , wsdl java classes. regards i solved on own. problem had getter called boolean getxxx , method called boolean isxxx seems have caused problem. nillable in wsdl.