Posts

delphi - Get the ascii value for a char, Ord equivalent in C++ -

in delphi exist function called ord returns ordinal value of ordinal-type expression. for example can retrieve ascii value char in way ord('a') return 65 ord('a') return 97 in c++ function must use ascii value char.? a simple int = c; c char should work.

immutability - enum vs immutable in D -

what's difference between enum = 2; enum s = "hello"; and immutable = 2; immutable s = "hello"; in d 2.0? an enum user-defined type, not variable. enum e = 2; short-hand enum : int { e = 2 } (i.e. anonymous enum 1 member e ), see the documentation . definition, members of anonymous enum placed current scope. so, e type member placed current scope, behaves literal . immutable = 2; on other hand creates variable i of type int. this difference has couple of consequences: enum e have no memory location , no address (is no lvalue), since neither type nor members have address. i.e. cannot auto ptr = &e; (just cannot auto ptr = &2; ). immutable i on other hand normal variable (just immutable). as discussed jonathan , immutable variables can initialized @ compile time or @ run-time, whereas type (with members defining type) must known @ compile time. the compiler can replace appearances of e 2 . i has create memory lo...

flex - Loading Swf with bytearray in AIR -

we have requirement air application loads flex generated swf inturn loads flash generated swf using swfloader. not working desired. gives following error: securityerror: error #3226: cannot import swf file when loadercontext.allowcodeimport false. this our air application. <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationcomplete="initapp()"> <mx:script> <![cdata[ import mx.controls.swfloader; [embed(source="flexloadingflash.swf")] public var flexmovie:class; private function initapp():void { // first convert swf movieclip var movieclip:movieclip = new flexmovie(); // bytearray movieclip var bytearray:bytearray = movieclip.movieclipdata; var swfloader:swfloader = new swfloader(); // load bytearray swfloader swfloader.source = bytearray; swfloader.maintainaspectratio = false; ...

cocoa - Adding a login window to a document based application -

i creating small document based application. in need start login page i.e., when application launches, login page should appear first(which should not document based). when running application right now, mydocument.xib loaded. there way can load login window first instead of mydocument.xib? tried change mydocument.xib make login page.but "untitled" @ first login page.. quite stuck @ point..pls help..i relatively new cocoa! make new class, add instance of mainmenu.xib, connect application object’s delegate outlet instance, implement applicationshouldopenuntitledfile: method. return no method , application open untitled document when user asks it. as login window, add new window mainmenu.xib , set visible on launch. place whatever logic need window in app delegate.

Developer documentation is empty after upgrading to lastest iOS sdk -

after upgrading latest ios sdk, developer documentation is empty. when doing search, contents list on left side bar appears main content empty. try right click , load in browser nothing happens too. please help. thanks. i had same problem, , solved downloading documentation in xcode via xcode --> preferences --> documentation. can check answer xcode documentation - offline reading gives general instructions install documentation api in xcode, , useful shortcut key combination check documentation directly source code.

browser automation - How can I ensure YSlow run automatically when firefox is started? -

it seems dumb question: have set extensions.yslow.autorun true , supposed work perfectly. it's not. when run bash script: urls=(http://www.google.com http://www.yahoo.com) link in "${urls[@]}"; firefox -p yslow -no-remote $link & echo $link pid=$! sleep 20 kill $pid done yslow doesn't run unless manually click yslow button. well, how can ensure yslow run everytime firefox started? have idea? why want this: want monitor several urls' performance. , report needs written every week, nice automate task. i did according post: http://tech.groups.yahoo.com/group/exceptional-performance/message/822 it's frustrating doesn't work out when it's supposed do. edit: someone having experience showslow might me out. thank you. tools -> add ons -> yslow -> options -> "automatically run yslow when page finishes loading"

mvvm - getting started with an asp.net webforms UI for c# application which uses nHibernate -

hi i've been building backend of application (using nhibernate data access). far i've had simple web-services manipulating data, i'm required develop web ui on application (using web forms). i've been looking @ different web frameworks ( webformsmvp , spring.net web ), , @ client-side js frameworks ( knockout , angular ), , can't decide best me, , how integrate all. hoping insight guys. i think general workflow this: view created, calls presenter. presenter contacts business layer retrieve information (which in turn contacts dao etc.) presenter returns view-model object, view displays. user manipulates data (maybe using ajax retrieve further needed information) view sends view-model of manipulated data presenter presenter translates view-model model entity , sends business layer here parts find tricky: a. how map between view-model , model entities think should use entitie's id retrieve unchanged entity dao (which stores in nhibernate's...