Posts

android - How to set onclick listener for animated image view -

i developing application has animated image view moving right center.when click on image onclick() called. when click on screen in image moving path(near image view) onclick() fired. please tell me how set on click listener image view. code is: ll = new linearlayout(this); ll.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); ll.setorientation(linearlayout.vertical); ll.setgravity(gravity.center); imageview=new imageview(getapplicationcontext()); imageview.setimageresource(r.drawable.moveimage1); int width=getwindowmanager().getdefaultdisplay().getwidth()/2; system.out.println("width==="+width); movelefttoright = new translateanimation(width, 0, 0, 0); movelefttoright.setduration(3000); movelefttoright.setrepeatcount(translateanimation.infinite); // animation repeat count movelefttoright.setrepeatmode(2); ...

ruby - How to get domain from URL without using URI Parser. I want to done it using regex -

i'm trying write regular expression returns domain url. example:- "http://github.com" # => 'github' i'd go @arup rakshit's solution. if want regexp, why not using /^http:\/\/(.+)\.[a-z]{2,3}/

ruby on rails - Heroku open gives a 404 -

i'm deploying rails on heroku first time, accept i'm bit of newbie on turf. i installed tool heroku tool belt. created simple rails application. logged heroku. did.. heroku create and pushed master git push heroku master once deployment complete tried heroku open i end getting 404. app though runs fine on local environment. heroku not provide standard welcome page rails 4. if did not create 1 404 page. problem should not arise if root set. you can test creating home controller index action, create index. html.erb page , define root to: 'home#index'. heroku knows page and not receive 404 error. getting started heroku guide: https://devcenter.heroku.com/articles/getting-started-with-rails4

javascript - Retrieve text from page with jQuery -

i'm trying retrieve text remote url , put in div on current page. first i'm trying text local file first, doesn't seem pull text. suggestions? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>html5 jquery</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> </head> <body> <div id="replace"> placeholder </div> <script type="text/javascript"> $(document).ready(function(){ $.get("test.txt", function(data) { $("#replace").html(data); } ); }); </script> </body> </html> same origin policy prevents page reading in javascript page coming origin (roughly domain+port). a special case 1 of file:// protocol : files opened in protoco...

Mavericks XAMPP install PHP GD2 extension -

i using xampp php development on mavericks. using phpexcel excel manipulations. problem phpexcel requires php gd2 extension. please guide me how install extension on mac osx. this link should out. https://community.apachefriends.org/f/viewtopic.php?p=136656

asp.net - How to use ASPX page into MVC -

as per requirement, need use existing/provided ascx user controls mvc application. understnad, use these controls, have create aspx traditional page mvc , use these user controls inside aspx page. i can add webform mvc application. how can incorporate url added webform ?? appear different url browser other pages of mvc please suggest me if have take other thing incorporate traditional aspx mvc application.? thanks actually asp.net project can host web forms, mvc , web api. it's adding right references whole project. thus, can create traditional .aspx pages in project. about "difference in urls" when using web forms or mvc, isn't longer true. since asp.net 4.0, web forms supports url routing (follow link) .

java - Error in getting data from excel: Invalid header signature -

i trying read .xlsx excel file getting exception: error in getting data excel invalid header signature; read 1688935826934608, expected -2226271756974174256 what thing missing? my code fileinputstream fileinputstream; try { fileinputstream = new fileinputstream(filepath + "\\" + "uploadareaexcel.xlsx"); hssfworkbook workbook; workbook = new hssfworkbook(fileinputstream); hssfsheet worksheet = workbook.getsheet("sheet1"); system.out.println("total count :" + integer.tostring(worksheet.getlastrownum())); for(int i=1;i<worksheet.getlastrownum();i++){ hssfrow row1 = worksheet.getrow(i); hssfcell cella1 = row1.getcell((short) 0); system.out.println(cella1.getstringcellvalue()); hssfcell cellb1 = row1.getcell((short) 1); ...