Posts

sql order by - Need a help for sort in mysql -

hi want sort table .the field contains numbers,alphabets , numbers alphabets ie, 1 2 1a 11a 6a b i want sort to, 1 1a 2 6a 11a b my code is, select * t order cast(st signed), st result is, b 1 1a 2 6a 11a i found code in url " http://www.mpopp.net/2006/06/sorting-of-numeric-values-mixed-with-alphanumeric-values/ " please me this required sort order, in presence of 0 in table; select * t order st regexp '^[[:alpha:]].*', st+0, st an sqlfiddle test with . as first sort criteria, sorts anything starts letter after doesn't. that's regexp does. as second sort criteria sorts numerical value string starts ( st+0 adds 0 numerical part string starts , returns int) as last resort, sorts string alphabetical ones in order.

iphone - Dismiss MBProgressHUD when delegate method fires -

first time working hud , i'm confused. i setup hud in viewdidload: [mbprogresshud showhudaddedto:self.view animated:yes]; dispatch_async(dispatch_get_global_queue( dispatch_queue_priority_low, 0), ^{ [[[wsxmppusermanager shared] xmppstreammanager] connect]; dispatch_async(dispatch_get_main_queue(), ^{ [mbprogresshud hidehudforview:self.view animated:yes]; }); }); the hud doesn't show. think reason follows. xmpp connect method fires off connection request xmpp server , it's done. there no activity wait is. however, connection isn't established until server responds , following delegate method fired: - (void)xmppstreamdidauthenticate:(xmppstream *)sender i want wait , dismiss hud, i'm @ loss how that. i'm missing simple. you need move code dispatch_async(dispatch_get_main_queue(), ^{ [mbprogresshud hidehudforview:self.view animated:yes]; }); after long running method has finished... is, if code indeed returnin...

audiotoolbox - How to play raw pcm 16 bit data using audio toolbox in iphone -

i trying play raw pcm data in iphone using audio toolbox framework. have tried manage callback system final output not correct. so, looking sample or example play raw pcm 16 bit audio chunks. first decode audio chunks , raw 16 bit (short*) pcm data. greatful. thanks.

css - How to wrap the text in the DisplayFor in MVC view? -

Image
developing mvc app. have commenting feature in app. my problem is, when user posts comments without pressing enter key, comment comes out 1 single line , crosses screen , user has scroll horizontally see entire comment. i want wrap comment , show @ specific width. ex. admin 04 may 13 12:43 pm zxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxca i use below code show comments in view <div class="commentp" style="width:550px;" > @html.displayfor(modelitem => item.commenttext, new {style = "width:550px;" }) </div> use <div style="word-wrap:break-word;"> or <div style="overflow:auto;">

mysql - SELECT * FROM table while condition=true? -

i want select table while 1 condition true, select * (select * from`table1` `t1` order t1.date) `t2` while t2.id!=5 when while condition comes false stop selecting next rows. please me, have search lot , many similars in stackoverflow can't it. please don't tell me where , want solution in sql not in php or other ok real problem here select *,(select sum(t2.amount) (select * transaction t1 order t1.date) `t2`) total_per_transition transaction here want calculate total balance on each transaction first find first date condition fails, id=5 : select date table1 id = 5 order date limit 1 then make above derived table (we call lim ) , join original table rows previous dates: t.date < lim.date select t.* table1 t join ( select date table1 id = 5 order date limit 1 ) lim on t.date < coalesce(lim.date, '9999-12-31') ; the coalesce() case when there no rows @ id=5 - , in case want rows table. ...

c# - json Array posting to mvc controller -

i want post json array mvc controller through ajax post as: $.ajax({ type: 'post', data: json.stringify(totaldata), traditional:true, url: '/builder/save', success: function () { alert("playlist saved successfully!!"); } }) and controller code have made array of 1 viewmodel & want update values as. [httppost] public actionresult save(ilist<itemeditviewmodel> data,long playlistid=0, string title="") { (int = 0; < data.count; i++) { var pc = db.playlistcontents.firstordefault(x => x.playlistcontentid == data[i].id); if (pc == null) { pc = new playlistcontent(); db.playlistcontents.add(pc); } pc.contentmetadataid = data[i].metaid; pc.playli...

magento - mysql4-install-1.0.0.php file not working for Mageno 1.5 -

recently have created on custom magento extension , release found installtion file not install. the installation file not creating tables. i have following code in config.xml <?xml version="1.0" ?> <config> <modules> <tricore_contactus> <version>1.0.0</version> </tricore_contactus> </modules> . . . </config> i have created mysql4-install-1.0.0.php file in sql\contactus_setup folder inside extension below code. $installer = $this; $installer->startsetup(); $installer->run(" insert ".mage::getconfig()->gettableprefix()."core_email_template values (null, 'tricore contact us', 'name: {{var data.name}}\r\ne-mail: {{var data.email}}\r\ntelephone: {{var data.mobilenumber}}\r\n\r\ncomment: {{var data.message}}', null, 1, 'contact form', null, null, null, '2013-04-23 11:04:45', 'contacts_email_email_template',...