Posts

c# how to add and remove a Point to a Queue -

can tell me how can add , remove point queue. because dequeue returns implicit error. f.e. queue q = new queue(); point = new point(0,0); point j = new point(0,0); q.enqueue(j); j = q.dequeue(); queue.dequeue returns object, need cast correct type: queue q = new queue(); point j = new point(0, 0); q.enqueue(j); while (q != null) //loop problem--see below { j = (point)q.dequeue(); } alternatively, can use generic version of queue , queue<t> . since queue of type declare, dequeue returns objects of type, there's no need cast: point j2 = new point(0, 0); queue<point> q2 = new queue<point>(); q2.enqueue(j2); j2 = q2.dequeue(); finally, while loop throw invalidoperationexception when execute, because after first dequeue, attempt dequeue again when queue empty.

android - CardView background color states not being respected -

in brief: how can define color states of cardview's cardbackgroundcolor property (in listview layout, in case)? (i using rc1 of android l developer preview, on phone 4.4 installed, , "com.android.support:cardview-v7:21.0.0-rc1" in build.gradle) longer: in cardview layout, set corner radius , background color of cardview via cardcornerradius , cardbackgroundcolor. however, background color doesn't repect selected states, i.e. if list item pressed, example. if, in inner view of cardview, set background colour, , associated states, respected, however, display on corners defined in cardview. so, how can ensure states in cardview's cardbackgroundcolor respected? here's color used cardbackgroundcolor, colour_with_states.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" andro...

php - .htaccess Internal Server Error: ErrorDocument not working (RewriteEngine on) -

whenever have rewriteengine on errordocument - part not working. current .htacces file: errordocument 404 404.php options -multiviews rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ /$1.php [qsa,l] so when open not existing file in browser, 500 internal server error , not getting redirected 404.php - file. please me ;) this because you're blindly rewriting .php end of uri. let's take see happens when go 404 url: you request: http://example.com/blahblah the uri not file (passes !-f ) the uri not directory (passes !-d ) the uri matches (.*) . the uri gets rewritten include .php the uri /blahblah.php the uri not file (passes !-f ) the uri not directory (passes !-d ) the uri matches (.*) . the uri gets rewritten include .php the uri /blahblah.php.php the uri not file (passes !-f ) the uri not directory (passes !-d ) the uri matches (.*) . the uri gets rewritten include ...

css - drop down menu disappears on hover (blogger) -

i'll honest right off bat, not coder. got original code tutorial , tweaked colors , fonts, when hover on main menu item , try click sub-menu, vanishes. see other threads common problem, can't seem find asked question code mine. /**mbw mybloggersworld.com navgation bar **/ #mbwnavbar { background: #ffffff; width: 960px; color: #fff; margin: 0px; padding: 0; position: relative; border-top:0px solid #ffffff; height:35px; } #mbwnav { margin: 0; padding: 0; } #mbwnav ul { float: left; list-style: none; margin: 0; padding: 0; } #mbwnav li { list-style: none; margin: 0; padding: 0; border-left:1px solid #ffffff; border-right:1px solid #ffffff; height:35px; } #mbwnav li a, #mbwnav li a:link, #mbwnav li a:visited { color: #000000; display: block; font:bold 16px coming soon; margin: 0; padding: 9px 12px 10px 12px; text-decoration: none; } #mbwnav li a:hover, #mbwnav li a:active { background: #ffffff; color: #000000; display: block; text-decoration: none; margin: 0; padding: 9px...

Clear phpcodesniffer markings in eclipse -

Image
phpcodesniffer has added lot of markings source file based in psr1, psr2 standards. many of them related code formatting tags , spaces. i want clear current markings , run codesniffer later on in development, not @ current stage. my searches did not yield results. i posted example of editor screen below. how can clear markings. i managed solve in following way. open 'problems' tab @ bottom of screen. if not available, can access window -> show view -> other -> problem menu option. choose problems want delete (in case, all) chose delete

ios - GCD and progressHUDs -

using form of progresshud (sv, mb, etc) run problem hud either hidden right after displayed or stays there permanently. in below example, hud stays permanently, regardless of if twitter feed (or page other view controllers) has finished loading. how can make hud disappear after task in separate thread completes? [mbprogresshud showhudaddedto:self.view animated:yes]; dispatch_async(dispatch_get_global_queue( dispatch_queue_priority_low, 0), ^{ //sets auth key (user or app) rmacc twitter feed sttwitterapi *twitter = [sttwitterapi twitterapioswithfirstaccount]; [twitter verifycredentialswithsuccessblock:^(nsstring *username) { [twitter getusertimelinewithscreenname:@"rmaccnewsnotes" count:10 successblock:^(nsarray *statuses) { dispatch_async(dispatch_get_main_queue(), ^{ [mbprogresshud hidehudforview:self.view animated:yes]; }); self.twitterfeed =[nsmutablearray arraywithar...

MiniMagick Ruby cropping external images returns the image too small -

Image
i running following code , getting unexpected output external images. require "mini_magick" image = minimagick::image.open('https://s3.amazonaws.com/dropsitecms/32a0f5e44c6ab32db614e1dbe6e773900708de5f.demo.cloudvent.net/raw/uploads/versions/404-circle-cf2d9a11b44d04de64d68843dd278140---%280-76-266-114-350-150%29---.png') image.crop "260x112!+0+0" image.write 'image.jpg' system("open image.jpg") starting base image: it returns result far small: i expected result when start local copy of base image: your parameter settings wrong, change width/height this,then work, have try : require "mini_magick" image = minimagick::image.open('aa.png') image.crop "100x200!+0+0" image.write 'image.png'