Posts

xcode - When I rotate a imageView, size shrinks -

Image
above image view before executing following code. @interface viewcontroller () @property (nonatomic, weak) iboutlet uiview *layerview; @end @implementation viewcontroller @synthesize layerview; - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. cgaffinetransform transform = cgaffinetransformmakerotation(m_pi_4); self.layerview.layer.affinetransform = transform; } ... // more code and, above image view after executing code. want snowman rotated same size. but, reason it's giving me small snowman... can notice bug? layers use catransform3d, not cgaffinetransform. 2 not interchangeable. you should getting compiler warning code. there equivalent functions manipulating catransform3d. in case want catransform3dmakerotation. method rotates around 3d vector. want pass in 0 x , y, , 1 z of vector. make layer perform flat 2d rotation code cgaffinetransform applied view.

php - Where does `recipe` hash come from in chef? -

to use php-fpm use code. $ knife cookbook create ppa $ vi site-cookbooks/ppa/recipes/default.rb apt_repository "nginx-php" uri "http://ppa.launchpad.net/nginx/php5/ubuntu" distribution node['lsb']['codename'] components ["main"] keyserver "keyserver.ubuntu.com" key "c300ee8c" end http://community.opscode.com/cookbooks/apt and added recipe[apt] runlist . i want know come recipe hash. keys same directories of cookbooks ? i don't know when these directories created. the pattern follows recipe[cookbook_name::recipe_name] a short hand recipe[cookbook_name::default] is recipe[cookbook_name] the cookbook_name name defined in each cookbook's metadata.rb file. cannot assume directory name same cookbook name. the recipe_name the name of file in recipes directory sans .rb extension.

java - How to redirect on login page after logout -

i want when click on log out tab redirect on login page after logout. not go on login page. home.jsp <ul><li><a href="http://pushkalit.in/logout.jsp"> logout</a></li></ul> logout.jsp <% try { if(session.getattribute("username") != null) { response.setheader("cache-control","no-cache"); response.setheader("cache-control","no-store"); response.setheader("pragma","no-cache"); response.setdateheader ("expires", 0); session.invalidate(); response.sendredirect("http://pushkalit.in/hrlogin.jsp"); } else {} } catch(exception ex) { out.print(ex); } %> url mapping in anchor tag seems wrong. it linked logout.jsp have redirect code in hrlogout.jsp . change : <a href="http://pushkalit.in/logout.jsp"> logout</a> to : <a href="ht...

Error while creating a Redis object and executing commands when calling methods -

this output of rails console after include rubygems , redis. 2.0.0-p353 :024 > r = redis.new => #<redis client v3.0.7 redis://127.0.0.1:6379/0> 2.0.0-p353 :025 > r.set('foo','bar') => "ok" 2.0.0-p353 :026 > r.get('foo') => "bar" 2.0.0-p353 :033 > r.lpush('foo','bar') redis::commanderror: err operation against key holding wrong kind of value /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis/client.rb:97:in `call' /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:949:in `block in lpush' /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:37:in `block in synchronize' /home/poorva/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize' /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize' /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:948:in `lpus...

php - 'error' tag replacing with some 'meta refresh' tag -

i'm making https request in android, , response this: {"responsecode":52145,"errors":{"error":"some error","description":"some description"}} now iphone client or postman client on browser, coming expected. in android, getting: {"responsecode":52145,"errors":{"<meta http-equiv="refresh" content="5; url=mydomain">":"some error","description":"some description"}} difference: "error" getting replaced "<meta http-equiv="refresh" content="5; url=mydomain">" my https headers are: accept = application/json user-agent = android if use http instead of https fine. makes me believe there on server side related security thing. main thing curios " error " tag getting replaced, using " errors " ok. while not replacing @ end, server guy make sure sending corr...

android - Can't receive APDU data with Arduino NFC module -

i'm trying use hce on lg g2 , send data arduino uno elechouse nfc module 2.0. the problem nfc.indataexchange(selectapdu, sizeof(selectapdu), response, &responselength) returns false . what's going wrong? on arduino forums , misterfrench got working , i'm doing things using same principle. took following android hce examples , send rubbish data: @override public byte[] processcommandapdu(byte[] commandapdu, bundle extras) { log.i(tag, "received apdu: " + bytearraytohexstring(commandapdu)); // if apdu matches select aid command service, // send loyalty card account number, followed select_ok status trailer (0x9000). if (arrays.equals(select_apdu, commandapdu)) { stringbuilder stringbuilder = new stringbuilder(); stringbuilder.append(build.manufacturer); stringbuilder.append("#"); stringbuilder.append(build.model); stringbuilder.append(((telephonymanager)getsystemservice(context.telepho...

How to add onclick to a html element dynamically using javascript -

i able create button element , add onclick event shown below. elem.onclick=function() { alert("qweqweqwe"); } how go using predefined function instead of defining function inside of event? like: elem.onclick=func(); add eventlistener element has defined function call : elem.addeventlistener("click", func, false); //where func function name