Posts

kindle - How interoperable are the EPUB and MOBI formats? -

i have bunch of epub books have convert mobi if kindle. know whether there loss of detail (e.g. meta-data, layout info) during conversion epub mobi , vice versa, analogous conversion between mp3 , wma? happens when multiple conversions applied consecutively, e.g. epub->mobi->epub->mobi->epub. how bad information loss get? yes, lossy. it's not possible express lossiness exactly, depends on input source. epub allows use of of xhtml1.1/css 2.1, whereas mobipocket "html 3" existed many years ago, plus proprietary tagging. if epub text, conversion acceptable. if highly designed, still readable, pretty terrible.

ios - Strange Crash on iPhone 3G/iPod 2G -

i banging head on strange issue. users of app reported app not start, crashes after showing startup screen 2 sec. occurs on older ipod 2g/iphone 3g. after getting hands on device occurs tried track down. the crash not occur debug code, release build. not of code executed @ until crash occurs. uiviewcontrollers initialized in appdelegate, , whatever sequence choose here, first of them fails after running through initwithnibname, same controllers , handles loading of correct xib universal app: - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { nsstring *ipadxib = [nsstring stringwithformat:@"%@-ipad", [[self class] description]]; return [super initwithnibname:ipadxib bundle:nibbundleornil]; } else { return [super initwithnibname:nibnameornil bundle:nibbundleornil]; } } this code runs through well, when returning here, end sigbus error somewhere in uikit (not c...

pipe - Different output with php client and with a browser -

maybe question simple, i'm not able answer it. i have little php code: <?php $line="echo 'hello' | lpr -pmyprinter"; $out=system($line,$output); ?> when execute code using command line (i use linux php 5.3.6 , apache 2.2.17) it's printed 'hello' in myprinter. if execute code using browser looks pipe ignored! i have tried exec(), passthru(), etc. , results same. thanks help. p.s: ran code php 5.1.¿¿?? try using following: echo `echo hello | lpr -pmyprinter`

c++ - Why does this private template function compile? -> Compiler Bug VS 2009 -

this compiles out problems in vs 2009? stupid? gcc gives warning, template private....? missing? #include <iostream> using namespace std; class { private: template<typename t> a& operator<<(const t & v) { cout << v << endl; return *this; } }; int main() { a; << 4; system("pause"); } microsoft acknowledges bug , claims fixed in next major release compiler (which read vc11/vs-whatever-is-after-2010 - not service pack vc10/vs2010): http://connect.microsoft.com/visualstudio/feedback/details/649496/visual-c-doesnt-respect-the-access-modifier-for-operator-member-function-templates from comments, fix appears made internal compiler build.

database - How would I design this schema in MongoDB? -

let's take example of chat room. should create 2 collections: room , messages , , store room details (title, description) separately messages (body/date/author)? messages collection have field called "room" links objectid of room. or should create 1 collection, called room. , inside room, there array of messages? what best practice? do? i lean toward first choice. aside fact 16mb may small (i've seen pretty busy chat rooms in days), storing messages separately allows greater flexibility on part. room doesn't need know messages associated - create once , query messages room id needed.

ruby - Nokogiri and finding element by name -

i parsing xml file using nokogiri following snippet: doc.xpath('//root').each |root| puts "# root found" root.xpath('//page').each |page| puts "## page found / #{page['id']} / #{page['name']} / #{page['width']} / #{page['height']}" page.children.each |content| ... end end end how can parse through elements in page element? there 3 different elements: image, text , video. how can make case statement each element? honestly, pretty close me.. doc.xpath('//root').each |root| puts "# root found" root.xpath('//page').each |page| puts "## page found / #{page['id']} / #{page['name']} / #{page['width']} / #{page['height']}" page.children.each |child| case child.name when 'image' do_image_stuff when 'text' do_text_stuff when 'video' ...

jQuery: Checking to see if list contains text, then redirect, else redirect here -

i'm complete novice when comes jquery, please bear me... i have html <ul class="zonesubscriptions"> <li> <ul> <li class="zonename"><a href="/default.aspx?pageid=8267303">my account</a></li> <li>never</li> </ul> </li> <li> <ul> <li class="zonename"><a href="/default.aspx?pageid=8269026">practitioners area</a></li> <li>never</li> </ul> </li> </ul> if link practitioners area present, redirect browser href, else, redirect account section. this jquery have... jquery.noconflict(); jquery(document).ready(function() { if(jquery(".zonename a").text() == 'practitioners area'){ document.location.href = $(this).attr('href'); }else{ document.location.href = jquery('.zonename:first a').attr('h...