Posts

refactoring - Tool for 'Flattening' (simplifying) C# Source -

refactoring - Tool for 'Flattening' (simplifying) C# Source - i need provide re-create of source code 3rd party, given it's nifty extensible framework repurposed, i'd rather provide less oo version (a 'procedural' version want of improve term) allow minor tweaks values etc not reimplementation using total flexibility of how structured. the code makes utilize of usual stuff: classes, constructors, etc. there tool or method 'simplifying' still 'source' using plain variables etc. for example, if had class instance 'myclass' initialised this.blah in constructor, same done variable called myclass_blah manipulated in more 'flat' way. realise things polymorphism not possible in such situation. perhaps obfuscator, set 'super mild' setting accomplish it? thanks my experience nifty extensible frameworks has been shops have own nifty extensible frameworks (usually more one) , not steal them vendor-provide...

osx - non-digit file error -

osx - non-digit file error - i trying update head revision using smartsvn v6 professional version. getting error update head: first line of '/folders/.svn/entries' contains non-digit file '/folders/.svn/format' not exist how prepare above error? i got error of times. solved need create new folder , checkout whole project there works. thats not preferred way... do utilize command line version of subversion client? or client besides smartsvn? i think happen when mix different workcopy version. to check workcopy version, see question: how determine svn working re-create layout version? osx svn smartsvn

testing - Sinon JS "Attempted to wrap ajax which is already wrapped" -

testing - Sinon JS "Attempted to wrap ajax which is already wrapped" - i got above error message when ran test. below code (i'm using backbone js , jasmine testing). know why happens? $(function() { describe("category", function() { beforeeach(function() { category = new category; sinon.spy(jquery, "ajax"); } it("should fetch notes", function() { category.set({code: 123}); category.fetchnotes(); expect(category.trigger).tohavebeencalled(); } }) } you have remove spy after every test. take @ illustration sinon docs: { setup: function () { sinon.spy(jquery, "ajax"); }, teardown: function () { jquery.ajax.restore(); // unwraps spy }, "test should inspect jquery.getjson's usage of jquery.ajax": function () { jquery.getjson("/some/resource"); assert(jquery.ajax.calledonce); asse...

python - How to use scripts to excecute django commands -

python - How to use scripts to excecute django commands - hi created website in django. , have used web hosting provider has django, python , sql installed. not have ssh alternative or command prompt in file manager. how can utilize script excecute commands after uploading site server . i want file created updatedb.sh or updatedb.py . can tell me how utilize scripts lone host django site live. it possible have django views execute lines like: import os os.system("python manage.py syncdb") in theory site working that. however, this poor strategy deployment. aside hassle of having os.system lines every time want anything, if entire site breaks? you'd using convoluted hacks basic maintenance. if web hosting provider doesn't back upwards kind of command line or give other options setting django, it's time find new web hosting provider. might recommend heroku, supports django , lets deploy using git. (it free amount of use). python d...

iphone - Returning a BOOL value from alertview delegate method: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex -

iphone - Returning a BOOL value from alertview delegate method: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex - i added tabbar controller on mainwindow.xib displaying 5 tabs , have tab bar controller's delegate method: shouldselectviewcontroller in app delegate returns boolean value (yes or no). in delegate method, showing alert user (if user going tab 1 other tab). alert contains 2 buttons: ok , cancel. if user clicks on ok, want delegate method homecoming yes (so user can go other tabs) , if user has selected cancel (in case wants remain on tab 1 only), want method homecoming no. so, want shouldselectviewcontroller method stop executing till time alert nowadays on screen. there way can homecoming bool alert view's delegate method may, in turn, returned shouldselectviewcontroller or threading solution may of utilize situation?? try this in .h uiviewcontroller *tmpcontroller; in .m -(bool)tabbarcontrol...

android - WebView ignore Javascript that invokes PUT/DELETE Http method -

android - WebView ignore Javascript that invokes PUT/DELETE Http method - i have web view in it's html/javascript makes http phone call put/delete methods. calls seems ignored (i test them on chrome , work fine). any idea? here's js code within webview: var req = new backbone.model(auth); $.ajax({ type: put, url: 'some_url', data: json.stringify(req) }); note ajax phone call jquery. the reason webview ignored phone call because of caching. seems put/delete calls cached. here's did solve this: $.ajax({ type: methode, url: 'some_url?d' + new date().gettime(), data: json.stringify(req), }); as can see added new date() object creation in order overcome caching mechanism. thanks guy helping out. should check out blog @ http://blog.guya.net/ javascript android http webview http-put

css3 - css background transition in opera goes through black -

css3 - css background transition in opera goes through black - i'm getting css3 transitions (about time!) , witness unusual behavior in opera 11.60. i utilize transition alter element background:none background:#fff . however, transition goes through black/dark gray before reaching target. now, can understand why happens - opacity , color animated @ same time, , since color used none , opera regards #000 . looks bug me. is there way prepare this, save turning off transitions in opera elements background:none ? how trying transition background: rgba(255,255,255,0) background: rgba(255,255,255,1) ? (that’s white 0 opacity white total opacity.) see e.g. http://jsfiddle.net/tajmg/ css3 opera css-transitions