Posts

Need tips to optimize SQL Server stored procedure -

this stored procedure, it's taking time execute though running local database. please suggest changes in order improve performance begin try declare @country_cd int set @country_cd =(select country_cd country country_desc = ltrim(rtrim(@country_desc))) declare @companny_cd int set @companny_cd =(select company_cd company company_desc = ltrim(rtrim(@company_desc))) begin transaction delete pack country_cd = @country_cd , company_cd = @companny_cd , pack_desc = ltrim(rtrim(@pack_desc)) commit transaction end try begin catch if(@@trancount > 0) rollback transaction declare @errmsg nvarchar(4000), @errseverity int select @errmsg = error_message(),@errseverity = error_severity() raiserror(@errmsg, @errseverity, 1) end catch hard without knowing more database schema. few initial ideas might cleanup *_desc variables right away rather doin...

performance - PL/SQL : Should i use a collection or do multiple querys? -

Image
i'm working on project need create big html table each table row 15 minute interval , every table column day. goal show users want reserve rooms when room available , not. webpages pl/sql packages print out proper html. example of table room : (don't mind different colors) all room definitions stored oracle database containing start date, end date, starting hour, ending hour , days of week. example definition be: (07-31-2013 - 07-31-2014, 00:00 - 23:59, mondays,tuesdays , fridays) my concern build every square of html table, need make query check if specific period defined. (for example if user wants see full week 10:00 14:00 room, 112 querys made build table 15 minute intervals) not mention user can see 4 weeks , time interval (could 00:00 23:59). problem need make check room definitions have make check many times see if interval taken reservation... make 224 querys see week. my solution room definitions , reservations affect period user wants see , put them in...

php - Imagick - Make black background white -

i using following code mask 1 image on image.on output gives me image black backgroung. but need white background or transparent background. following code using mask 1 image on another. <?php $destination_path = getcwd().directory_separator; $im1="image1.png"; $im2="image2.png"; $i1="$destination_path$im1"; $i2="$destination_path$im2"; $base = new imagick($i1); $mask = new imagick($i2); // setting same size images $base->resizeimage(274, 275, imagick::filter_lanczos, 1); // copy opacity mask $base->compositeimage($mask, imagick::composite_dstin, 0, 0, imagick::channel_alpha); $base->writeimage('output.png'); header("content-type: image/png"); echo $base; ?> the trick using: $im = $im->flattenimages(); : <?php $im = new imagick($filename); $im->setimagebackgroundcolor('#ffffff'); $im = $im->flattenimages(); $im->setimageformat("jpeg"); $im->setimagec...

android - Why is it not sleeping for 3 seconds before it starts listening? -

i'm trying do: perform texttospeech speechrecognizer starts listening user repeats texttospeech'd word/phrases but problem that, example, if "example" via texttospeech, when speechrecognizer starts listening, takes in "example" previous , adds onto 1 user says. @ end, ended "example example", didn't want. code: public void onitemclick(adapterview<?> parent, view view, int position, long id) { // todo auto-generated method stub item = (string) parent.getitematposition(position); tts.speak(item, texttospeech.queue_flush, null); thread thread = new thread() { public void run() { try { sleep(3000); } catch (interruptedexception e) { e.printstacktrace(); } } }; thread.start(); sr.startlistening(srintent); } you doing 2 process in 2 thread. creating thread 1 , make sleep 3 seconds , sr.startlistening(s...

3d - Different Axes Positions in MATLAB -

Image
i'm trying shift axes positions in matlab figure. i'd achieve similar (which done in gnuplot): i don't have idea whether possible @ all, or might find answer, appreciated. hmm.... so let's plot: x = zeros(1,21); y = -10:10; z = y/2; figure; plot3(x,y,z); % line (0,-10,-5) (0,10,5) similar example well, 1 problem matlab doesn't automatically plot coordinate axis you've shown there. discussed here: how show x , y axes in matlab graph? to plot (in 3d), cheap solution is: locs = axis; % current axis boundaries hold on; plot3([locs(1) locs(2)], [0 0], [0 0]); %plot xaxis, line between(-x,0,0) , (x,0,0); plot3([0 0], [locs(3) locs(4)], [0 0]); %plot y axis, line (0,-y,0) , (0,y,0); plot3([0 0], [0 0], [locs(5) locs(6)]); % plot z axis hold off just gnu plot, 3d matlab plot "in box." unlike gnu plot, matlab box isn't outlined. if want outline you'll have draw lines too...ugh. % lets plot 12 lines make box in black ...

Excel: Data validation of specific numbers with special cell formatting -

i'm learning data validation of cell values in excel , have discovered problem solve. have cell want allow specific number values. no problem since can use data validation specific cell. can't use "numbers" criteria have numbers 10; 20; 30 example because can specify number ranges (larger than, less than, between etc). instead of using number range use "list" function , write 10; 20; 30 , works. the problem occurs when add special formatting cell. let's want format 1 isn't pre-existing in excel, enter value "10" should display "10 moneys" or grammatically correct. if use custom formatting can add " moneys" after "standard" displayed in cell format menu (ctrl + 1). if either 1 works, if add both list 10; 20; 30, , formatting of standard" moneys" doesn't work when use drop down menu. reason because drop down menu tries add value "10 moneys" , list doesn't recognise because expe...

Can we use GoogleAds/AdMob/AdWhirl in cocos2d-android? -

i want add admob / adwhirl gamelayer scene. i search on everywhere couldn't find way work. don't want switch library. , should do? if have worked on , give way . as there not layout xml file cocos2d android can add progammatically. crate linear layout in onstart method itself. like this linearlayout.layoutparams adparams = new linearlayout.layoutparams( getwindowmanager().getdefaultdisplay().getwidth(), getwindowmanager().getdefaultdisplay().getheight()+getwindowmanager().getdefaultdisplay().getheight()-50); adview = new adview(simplegame.this, adsize.banner, "your ad id"); adview.setadlistener(simplegame.this); adrequest request = new adrequest(); request.addtestdevice(adrequest.test_emulator); adview.loadad(request); ccdirector.shareddirector().getactivity().addcontentview(adview,adparams); this should i...