Posts

Ruby: Ways to prevent cucumber reduncancies? -

does have idea how make shorter , less redundant: feature: nosql scenario: flatfile user wants have flatfile storage classic jekyll cms. when case should make sure adhere classic folder , file structure, , store generated content in _site unless user decides want generation stored inside of memcached, should go ahead , use that. given have chosen flatfile storage site when request page, "the_page" , have chosen flatfile generation should pull page "_site" given have chosen flatfile storage site when request page, "the_page" , have chosen memcached generation should pull page memcached i see repeated text , though cucumber meant people communicate seems it's made things perhaps "too dumb" because of repetition in types of scenarios? unless missing something. there other small problem, how make 1 feature have dependency of feature? example memcached feature how require feat...

android - How to play, pause and stop a song with only one button? -

i have tried make application in android play, pause , stop song 1 button only. can show me how can make application? final button bplay = (button)findviewbyid(r.id.bplay); mediaplayer song1 = mediaplayer.create(tutorialfour.this, r.raw.fluet); button bstop = (button)findviewbyid(r.id.bstop); bplay.setwidth(10); song1.setoncompletionlistener(new oncompletionlistener() { public void oncompletion(mediaplayer mp) { bplay.settext("play"); } }); bplay.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { // todo auto-generated method stub b=true; if(bplay.gettext().equals("play") && b==true) { song1.start(); bplay.settext("pause"); b=false; } else if(...

php - Any better way to save dates in db than time()? -

i used save dates in db int(11) time() . considering limitation of time() there better way save that? i not use database own date type (and db own date functions). thanks ok, comments, understand problem using time() we're looking represent dates outside 01/01/1970 whenever/2038 range. in case, think it's best format dates db ymdhis , stored in bigint (or ymd in int if time isn't needed). can use date_create("now")->format($fmt) instead of time() , , $fmt either 'ymd' date-only or 'ymdhis' date+time this gives latest date somewhere in 922,337,203ad , earliest in -922,337,203bc time, or 214,748ad -214,748bc in int no time.

php - CodeIgniter authentication concept issue -

i've made ci authentication controller allowing user log site, , after login i'm redirecting him visited url keep using: $this->session->set_flashdata( 'return_url', current_url() ); unfortunately causes problem. every time when user opens more 1 tab in browser variable being overwritten , after successful login user redirected same url in tabs. so question is: is possible load custom controller inside my_controller? ( my_controller class extends ci_controller ) i tried using (inside constructor of my_controller ) didn't worked out: $ci =& get_instance(); $ci->router->set_class('authentication'); $ci->router->set_method('login'); edit: appreciate other ideas of solving problem. a solution not save return url in session var, pass around in get/post parameter (in case of get, encoded, base64 ie.). addition have standard return url if no (valid) return url set --- edit why talking base64 when php has fu...

tsql - How do I insert a row in T-SQL where there are only auto-generated columns? -

i have table this: create table [dbo].[traceable]( [traceable_id] [uniqueidentifier] not null constraint [df_traceable_traceable_id] default (newsequentialid()), constraint [pk_traceable] primary key clustered ( [traceable_id] asc )with (ignore_dup_key = off) on [primary] ) on [primary] how insert row table? doesn't work: insert traceable() values() it errors on values() clause (incorrect syntax near ')'). taking out brackets doesn't work either. insert traceable default values; or insert traceable values (default);

Calling ASMX Service from jQuery Client Side Code -

i have vs 2010 project locally have asmx service running locally. created vs 2010 project has consume local asmx service. reason whenever trigger service gives me 500 internal service error. both applications running on separate ports. $.ajax( { type: "post", url: "http://localhost:22059/mobile/hocwebservice.asmx/getcategories", data: "{}", datatype: "json", contenttype:"application/json", success: function (response) { alert(response); } } ); both applications running on separate ports. that's problem. violating same origin policy restriction . cannot send ajax requests services not hosted on same origin page containing script (different ports => different domains).

iphone - UI ScrollView Hiding in iPad Landscape mode -

i have added 1 uiscrollview , 2 uiimageview it. shows fine in potrait mode. hides in landscape mode. running xcode n simulator , implemented method - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation. i new ipad programming , lil stuck. appreciate help. - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { if(uiinterfaceorientationislandscape(interfaceorientation)) { [self.view insertsubview:scrollview abovesubview:imageview]; } else { [self.view insertsubview:imageview abovesubview:scrollview]; } return yes; }