Posts

Make a login into dbo for a database in SQL Server -

i attempting migrate sql server 2005 sql server 2008. both of these database instances hosted on 3rd party shared servers not have full permissions to. using mixed mode authentication. i running trouble setting new database same way old 1 set up. specifically, new web-based control panel doesn't allow dbo specified when creating new database , when using red gate sql compare sync schemas having problems because objects (that don't explicitly specify dbo in script) being created prefix of user account rather dbo. i have poured on documentation trying find way force login "user1" dbo "db1" database. came conclusion script should this: alter authorization on database::db1 user1 before running script, login "user1" exists, not user database "db1". note had submit script support of hosting company in order run it. according hosting company statement executes, when compare databases using sql compare user "user1" has not b...

xcode - custom background in uinavigationbar non application-wide, different for each view -

i found lot of solutions make custom background in uinavigationbar, application-wide, how same things in each view (each view have different background? this quite hard correctly, can make subclass has configurable background image first effort. switch background image navigate from/to other views. you must set tintcolor of bar when change background, bar buttons colored correctly.

java code corresponding to Newtonsoft.Json.JsonConvert.SerializeObject(Object source,Newtonsoft.Json.JsonSerializerSettings()) in .net? -

i have code in .net serializes request json format ... code this. var ops = new newtonsoft.json.jsonserializersettings(); ops.nullvaluehandling = newtonsoft.json.nullvaluehandling.ignore; ops.missingmemberhandling = newtonsoft.json.missingmemberhandling.ignore; ops.defaultvaluehandling = newtonsoft.json.defaultvaluehandling.ignore; ops.converters.add(new newtonsoft.json.converters.javascriptdatetimeconverter()); string strso = newtonsoft.json.jsonconvert.serializeobject(source, bindent ? newtonsoft.json.formatting.indented : newtonsoft.json.formatting.none, ops); i tried java code corresponding portion doesn't work. from understanding, newtonsoft serializer takes object member variables , outputs json string represents object. so can like: product product = new product(); product.name = "apple"; product.expiry = new datetime(2008, 12, 28); product.price = 3.99m; product.sizes = new string[] { "small", "medium", ...

html - FileUploader accept="image/*" validation problem -

i added accept="image/*" attribute file uploader <input type="file" name="imageuploader"> . i select image file in uploader. , try send data server. imageuploader set error , add class="input-validation-error" . why happens? you should try specifying type in php imageuploader , if still have problems, add each image type seperately e.g. == "image/jpeg" or "image/png" or "image/gif"

ruby - How to beautify xml code in rails application -

is there simple way print unformated xml string screen in ruby on rails application? xml beautifier? ruby core rexml::document has pretty printing: rexml::document#write( output=$stdout, indent=-1, transitive=false, ie_hack=false ) indent: integer. if -1, no indenting used; otherwise, indentation twice number of spaces, , children indented additional amount. value of 3, every item indented 3 more levels, or 6 more spaces (2 * 3). defaults -1 an example: require "rexml/document" doc = rexml::document.new "<a><b><c>text</c><d /></b><b><d/></b></a>" out = "" doc.write(out, 1) puts out produces: <a> <b> <c> text </c> <d/> </b> <b> <d/> </b> </a> edit: rails has rexml loaded, have produce new document , write pretty printed xml string can embedded in <pre> tag.

c++ - Terminate application AND call the destructors of local objects -

i have objects on stack in main function: int main(...) { cfoo foo; cbar bar; } also, have function, keeps track of errors in application: void err(std::string msg) { somehowlogerrormessage(msg); exit(1); } err function useful when have report fatal error. log error , terminate application - cannot recover after such errors. however, terminating "exit()" not invoke foo , bar destructors - behavior, expected (but wrong). "abort()" doesn't either. also, i cannot use exceptions catch them in main(). there other way implement err function so, terminates app , correctly cleans stack objects? or should somehow redesign error handling? thanks! p.s. way, can't send wm_quit message main window? not winapi, app pure win32 , err() function can handle main window. work? not without exceptions or returning err way callstack. need unwind stack.

html - PHP CodeIgniter echo svg graph (SVGGraph) -

so i've begun working svggraph http://www.goat1000.com/svggraph.php .. i'm quite happy it's not playing nice inside codeigniter app. i have function create graph. @ end can call either $graph->render('piegraph') or $graph->fetch('piegraph') ideally i'd able call function return graph echo graph wherever needed. currently, can header/content type set "image/svg+xml" problem can't print out else in document then. any ideas on how can svg's work inline html can insert them regular graphic. thanks. p.s. post code here don't have near correct. :) thanks. i haven't tested should work you, class test extends ci_controller { // here in method define svg graphics function get_svg() { header('content-type: image/svg+xml'); $graph = new svggraph(640, 480); $graph->colours = array('red','green','blue'); $graph->values...