Posts

database - Storing Date with timezone -

i have been working oracle db long time , have been storing dates without bothering timezone. have issue client , server in different timezones , need perform date/time conversion according timezone. has opened lots of questions now: should store date/time along timezone or not? asking because if servertimezone changes data corrupted. if oracle db server located in particular region should run on local timezone? there standard this? my second point in relation dr database servers located in different regions have same data prod db. if timezones not same both db in trouble. to able show clients date in timezone need offset. example, server runs in edt , saved time years. data saved way. so, need create field, store offset each user. need apply offset each date/time field on select. how this, have no idea - because have no idea how use data. select statement, report, or website? if application, client load user info including offset. example, user in edt have offset ...

dependency injection - Adding Ninject to Legacy Project C# -

i have inherited legacy c# & vb.net project have maintain , augment how. there no interfaces , no dependency injection. the first thing thinking of doing creating interfaces , adding ninject, make possible unit test project eventually. is idea or should leave alone ? what best practices implementing di when comes legacy projects. thanks i don't think there's set best practice, other use common sense - it's kind of case case scenario. few important questions ask yourself: how effort going required create interfaces current classes? how additional effort going required write proper unit tests? these unit tests add more value time spent? how long legacy system going maintained? there's nothing worse doing huge upgrade (requiring testing not development staff, product user) replace in 18 months. also, how long has legacy system been in place without issue? there's no reason invent work if appears stable , has low maintenance.

c# - Is it possible to deserialize and serialize json object in different propety names? -

let have class: public class resource { [jsonproperty(propertyname: "address")] public domain.dto.address addresses { get; set; } } the json string value looks like: { . . . "resourcesets":[ { "estimatedtotal":1, "resources":[ { . . . "address":{ "userlocation":null, "admindistrict":"national capital region", "admindistrict2":"third district ncr", "locality":"caloocan city", "postalcode":null, "addressline":"yellow bell ext", "formattedaddress":"yellow bell ext, caloocan city, philippines", "neighborhood":"barangay 161", "landma...

Adding HTML code into powershell array -

i running several different types of validations on deployment process. each validation i'd add html code array. @ end of script i'd take entire array of code , email out. the code have send email following $sendmessage = @{ subject = "problem: web config blanks" body = " <p>the deployment validation script has found @ least 1 problem</p> <ul> <li> there " + $errorwcblanksct + " web config values blank </ul>" = "from@company.com" = "to@company.com" smtpserver = "0.0.0.0" } send-mailmessage @sendmessagewcblanksct -bodyashtml write-host "web config has been parsed , emailed" obviously 1 validation checks blank values in web.configs. if add in validation total file count example, how have additional <li> line, if file count script defines "wrong"?

ssms - Option in SQL Server Management Studio to expand columns in results grid for large text display -

i have column contains bunch of text. way can view in standard tiny cell. is there way automatically expand cell size of text? is possible in 'edit' mode well? this has got nothing sql or t-sql, per se. function of whatever user interface using display query results. assume in case using sql server management studio (ssms). don't believe there way automatically expand columns fit largest value width. might want try sql server development tools (ssdt). although don't think either. option might send results text file (which option) , viewing file in editor. you write own user interface want do.

numpy - Long error in contour plot python -

Image
i trying create contour plot x coordinates being label ef , y being labeled eb , z being function labeled a. returns long error posted below. appreciated. error is file "contour.py", line 19, in <module> c = plt.contour(ef,eb,a) file "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2016, in contour ret = ax.contour(*args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 7326, in contour return mcontour.quadcontourset(self, *args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1088, in __init__ contourset.__init__(self, ax, *args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 686, in __init__ self._process_args(*args, **kwargs) file "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1101, in _process_args x, y, z = self._contour_args(args, kwargs) file "/usr/lib/pymodules/python2.7/matpl...

web - Which EOL should I use in general? -

i wondered if there eol (end of line) privileged between \n , \r\n , \r (if enumeration right). the question in general and, webserver should serve? bonus: if can tell me python specificity if such exist. ps: question is, in hand generic , in other specific, didn't know if should have tagged question python tag or not. let me know. edit: , matter of operating system related prob or there programs (or specifications) requiring or advising use 1 more others? found surprisingly not lot of information them. doing wrong? for web, \n doesn't anything, need a <br> for python, \n should fine, if want safe, use import os os.linesep #this newline character on os code running on edit: formatting