Posts

c# - Using WebImage() with .gif images -

i trying use webimage uploaded .gif image. webimage file = new webimage(fullfilepath + ".gif"); file.save(newimage); i error stating: system.exception: graphics object cannot created image has indexed pixel format. how can use .gif webimage class?

xml - Counting only specific element -

edit: sorry question bit unclear, i'm trying return text in p nodes , children while counting individual p nodes. <1> refers first p node, <2> second , on. i'm trying count occurrence of individual element regardless of appears in structure of xml document. i've tried variations of position() , count() both , without for-each loops , can't seem find work. have idea on how this? an example document be: <text> <body> <div1> <p>abc</p> <div2> <p>def</p> </div2> </div1> <div1> <p>ghi</p> <div2> <p>jkl <name>adam</name></p> <div3> <p>mno</p> </div3> </div2> <p>qrs</p> </div1> </body> </text> with return: <1>abc <2>def <3>ghi <4...

ruby - Rake dependency not executing but invoke works -

i've been trying run rake db:test:clone_structure , keeps failing rebuild database. looked @ task itself: task :clone_structure => [ "db:structure:dump", "db:test:load_structure" ] when run trace, i've noticed db:test:load_structure isn't getting executed: $ rake db:test:clone_structure --trace ** invoke db:test:clone_structure (first_time) ** invoke db:structure:dump (first_time) ** invoke environment (first_time) ** execute environment ** execute db:structure:dump ** invoke db:test:purge (first_time) ** invoke environment ** execute db:test:purge ** execute db:test:clone_structure now, when change clone_structure task invoke load_structure ... task :clone_structure => [ "db:structure:dump", "db:test:load_structure" ] db_namespace["test:load_structure"].invoke end ...everything works! $ rake db:test:prepare --trace ** invoke db:test:clone_structure (first_time) ** invoke db:structure:dump (...

ios - Can I get by by without ever using KVO? -

strange grammar, want ask if there cases if don't kvo (key value observation), app can't things/features? thanks key value observing offers functionality , behaviors unique , useful developer, in same cases offering glimpse @ values otherwise opaque. for example, if want know precise duration of animation in cocoa otherwise black-box (for example, keyboard disclosure animation duration), kvo way know of establish that. beyond that, it's useful pattern programming applications involve data (go figure). such, yet tool in developer's toolkit. can without it? sure. there many tools can without, , 1 takes little bit of effort wrap head around initially. should make point of avoiding it? no, don't think - why you?

xamarin.ios - No devices attached in xamarin VisualStudio for ios -

Image
i'm having real trouble when try use ios emulator visual studio. created hello world app in vs using xamarin (latest stable version), set project main project, , when refresh connexion mac, can't select device should shown in selectlist. message "no device attached" : and if try use xamarin studio on host mac, okay, sample app builds on iphone emulator: thanks me ! are sure device connected mac , not windows machine? have tried debugging same device xamarin studio on mac?

How to indent a multi-line paragraph being written to the console in java -

can suggest method writing mutli-line string system console , having text block indented? i'm looking relatively lightweight because it's being used displaying command line program. note: approach described below not meet updated requirements described @billman in question's comments. will not automatically wrap lines longer console line length - use approach if wrapping isn't issue. simple option, use string.replaceall() follows: string output = <your string here> string indented = output.replaceall("(?m)^", "\t"); if you're unfamiliar java regular expressions, works follows: (?m) enables multiline mode. means each line in output considered individually, instead of treating output single line (which default). ^ regex matching start of each line. \t causes each match of preceding regex (i.e. start of each line) replaced tab character. as example, following code: string output = "foo\nbar\nbaz\n...

html - Play Flac files on website -

is there way play flac files on website, preferably using html5 and/or jquery? i don't know in-browser flac player. but, if after loseless file format, can consider mp3hd , loseless, flac, backwards compatible mp3, means mp3 player can play it.