Posts

Featured post

ios - Not getting any movement from sprite in Sprite Kit -

ios - Not getting any movement from sprite in Sprite Kit - i trying move sprite node downwards every time touch in area. code have , log showing touches register. doing wrong , there easier way accomplish this? -(void)update:(cftimeinterval)currenttime { cgpoint currentlocation = [currenttouch locationinview:currenttouch.view]; if (currentlocation.y > 500) { cgfloat newy = _bg.position.y - 25; _bg.position = cgpointmake(_bg.position.x, newy); nslog(@"touchtouch"); } try this: -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { (uitouch *touch in touches) { cgpoint currentlocation = [touch locationinnode:self]; if (currentlocation.y > 500) { cgfloat newy = _bg.position.y - 25; _bg.position = cgpointmake(_bg.position.x, newy); nslog(@"touchtouch"); } } } you can utilize skaction have motion animated: skaction *movedown = [skaction movetoy:newy duration:1]; [_bg runac

model view controller - MVC Rails Planning -

model view controller - MVC Rails Planning - i'm starting rails , i'm building app stores films info, user can watch film , give grade on web application. i have coded cinema model, controller , views. now, have 2 questions: should need create model , controller grading? in case, should create or should wait , create first users model , controller? yes, on model , controller grades. that'd feasible way maintain track of who's graded what. it's create first, i'd start users, since grades depend on both films , users. ruby-on-rails model-view-controller

c++ - How to decouple SDL_Texture from SDL_Renderer? -

c++ - How to decouple SDL_Texture from SDL_Renderer? - i have sprite class uses sdl_texture on sdl_surface in lieu of perfomance. class looks this: class sprite { public: ... private: sdl_texture *m_texture; sdl_rect m_blitrect; int m_x; int m_y; }; now problem when creating sdl_texture need sdl_renderer object sdl_surface create it. this: sdl_texture *texture = sdl_createtexturefromsurface(renderer, surface); the sdl surface can created , disposed of while creating texture however, problem is, want able have rendering object isn't global. want decoupled framework , don't know how accomplish in instance. first thought create renderer class , have constructor argument cannot happen complicate things downwards road , cannot option. there other ways decouple two? if want decouple texture renderer , surface parameter, think best best delay phone call sdl_createtexturefromsurface until these argum

php - Wordpress Define Variable Plugin -

php - Wordpress Define Variable Plugin - i'm attempting create plugin site in wordpress both practice , execution. in plugin variety of files. want define plugin directory constant use: define('custom_editing__url', plugin_dir_url(__file__)); when include: //folders define('widgets', custom_editing__url . 'widgets/'); require_once(widgets . 'widgets.php'); i'm able file widgets.php , when phone call within of file: echo custom_editing__url; i custom_editing__url. want http://www.example.com/widgets/widget.php can explain i'm missing? edit: more info problem @ hand. right have figured out widgets.php not accepting defined variables. example... calling file able create widget using format of: class foo_widget extends wp_widget { // content } but widgets.php file cannot resolve find wp_widget. so answer. don't have actual documentation explain it. copied of elements akismet plugin work way ne

java - After Generating webdriver code ,how and where to modify code -

java - After Generating webdriver code ,how and where to modify code - i newbie selenium test cases, uncertainty roam between generated web driver code(java ;j-unit) , how run code changes in code , found errors in project before may know want made alter in code ,what generated already. for eaxmple : i recorded login form page, generated java/junit 4/webdriver code verify link button selenium ide , import bundle eclipse... i add together features or changes in login form , purpously forget maintain link button using selenium test generated before java/junit 4/webdriver code , want print o/p as"link button not found" bundle web; //import java.util.regex.pattern; import java.util.concurrent.timeunit; import org.junit.*; import static org.junit.assert.*; //import static org.hamcrest.corematchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.firefoxdriver; //import org.openqa.selenium.support.ui.select; public class webdriver {

objective c - AFHTTPRequestOperationManager with HTTP and HTTPS base url -

objective c - AFHTTPRequestOperationManager with HTTP and HTTPS base url - i wondering best alternative (architecture) situation have same api on http , https. there way back upwards http , https requests in same afhttprequestoperationmanager or should have 2 subclasses, 1 http requests , sec https requests? i sense changing baseurl dynamically not best solution you can hold 2 afhttpclient* objects. 1 http , other secure https. here illustration based on requester class. -- requester.h --- #import "foundation/foundation.h" #import "afnetworking.h" typedef enum { multiparttypeimagejpeg, multiparttypeimagepng, multiparttypevideoquicktime } multiparttype; typedef enum { httpmethodget, httpmethodpost, httpmethodput, httpmethoddelete } httpmethod; typedef void (^requestcallback)(nserror *error, nsinteger statuscode, id json); @interface requester : nsobject /** * singleton */ + (instancetype)sharedinstance;

java - How to improve Jaxb unmarshaller performance -

java - How to improve Jaxb unmarshaller performance - i want marshal , unmarshal below: want unmarshal xml <keyname>value</keyname> hashmap class a{ private string name; private list<b> list; } class b{ private map <string, string> map; } xml: <a> <name>name</name> <blist> <b> <key>value</key> <key>value</key> </b> </blist> </a> i want unmarshal xml class a. using @xmlanyelement . when unmarshal @ big size xml blist.size=100000 , performance not ideal. should improve performance? this xml snippet according description: <doc> <data> <somekey>somevalue</somekey> <otherkey>othervalue</otherkey> </data> </doc> this class data's type: import java.util.arraylist; import java.util.list; import javax.xml.bind.annotation.xmlaccesstype; import ja