|
Use ansible next time
|
# ? Dec 20, 2017 14:46 |
|
|
# ? Jun 9, 2024 03:16 |
Sapozhnik posted:Use ansible next time won't it be overkill if i need to launch like 2 system services, open a port or two, and fetch some dependencies for all that jazz? also hopefully i won't have to do much of this any time soon since we're rolly with an external vendor tools to run my models as a rest service
|
|
# ? Dec 20, 2017 14:51 |
|
any shreds of imposter syndrome I had are mostly gone now that ive actually been working with many people over the last 2 years, and compare myself to them, I have swung in the opposite direction and now im pretty cocky and think im hot poo poo however whenever i read this thread i always remember that this isnt really the case
|
# ? Dec 20, 2017 15:23 |
|
cinci zoo sniper posted:won't it be overkill if i need to launch like 2 system services, open a port or two, and fetch some dependencies for all that jazz? also hopefully i won't have to do much of this any time soon since we're rolly with an external vendor tools to run my models as a rest service alternative: fabric
|
# ? Dec 20, 2017 19:07 |
|
I used the openxml sdk to gently caress with a word document today and I'm glad I could just copy and paste poo poo off the internet to make it work because god drat what the gently caress is the actual structure of this xml supposed to mean?
|
# ? Dec 20, 2017 19:37 |
|
the openxml docs are pretty good at describing the schema
|
# ? Dec 20, 2017 19:38 |
|
Shaggar posted:the openxml docs are pretty good at describing the schema lol if you think I read those and didn't just start banging away at doing stuff edit: if I'm really lucky I won't have to either because I can get away with just doing a basic find>replace. if I have to style things too then Powerful Two-Hander fucked around with this message at 19:52 on Dec 20, 2017 |
# ? Dec 20, 2017 19:40 |
|
keep in mind formatting can come at any time including in the middle of a word so your find and replace needs to take that into account.
|
# ? Dec 20, 2017 19:57 |
|
Shaggar posted:keep in mind formatting can come at any time including in the middle of a word so your find and replace needs to take that into account. yeah I've seen this and am hoping to avoid it no joke today a company said they had a "special mark up language" for describing documents and templating them it was just tokenised strings with javascript blobbed on the end in brackets
|
# ? Dec 20, 2017 20:17 |
|
for templating I like velocity (java) and razor (c#).
|
# ? Dec 20, 2017 20:20 |
|
Shaggar posted:for templating I like velocity (java) and razor (c#). wait wait wait you can use razor to template office documents?? or just in general for templating because yes razor is good (except when it gets confused about whether you're using code or markup and you have to fiddle around with the @: prefix)
|
# ? Dec 20, 2017 20:25 |
|
you can use it to template text documents so I've used it for generating sections in word docs. ive used it for placing content in an existing word doc at placeholder locations but you could just create a razor document.xml and then pack it into a word doc instead.
|
# ? Dec 20, 2017 20:28 |
|
like XML code:
|
# ? Dec 20, 2017 20:30 |
|
Shaggar posted:like o gently caress I am totally going to use this I never would have thought of using razor like that but I'm already using razor to template elements in the Web ui so creating a parallel set of templates for the models that generates doc chunks should be an easy extension as i can call razor templates in code and inject the render output into the doc
|
# ? Dec 20, 2017 21:08 |
|
Today I am writing a generic abstract class in java. Like 10 classes will extend it. I feel dirty.
|
# ? Dec 20, 2017 22:18 |
|
Powerful Two-Hander posted:o gently caress I am totally going to use this grab RazorGenerator which provides both a simple library for doing the actual template merge and a VS extension for template handling.
|
# ? Dec 20, 2017 22:37 |
|
Valeyard posted:any shreds of imposter syndrome I had are mostly gone I got Virtual Jaguar building in a VM cross-compiled for Win32 so I can add debug output from the running program (logging bytes written to a specific address out to a file that mimics a debug console) but I still suck rear end at ruby, my day job. ayy lmao
|
# ? Dec 20, 2017 22:39 |
|
ask (don't actually ask) me about writing a WPF to convert word templates to velocity. Also a WPF app that allows live editing of velocity templates with live previews created by razor generator as the user types.
|
# ? Dec 20, 2017 22:41 |
|
late to recruiter chat but ive had a guy from CME bugging me about joining them for a while now through linkedin (been working on a fork of their product for a while so i guess that’s how he found me ) maybe i’ll go there in a year or so idk
|
# ? Dec 20, 2017 23:39 |
|
Shaggar posted:like does razor actually escape that poo poo correctly, or does it just do html entity encoding?
|
# ? Dec 21, 2017 04:57 |
|
gently caress all computers gently caress all the web gently caress all documentation
|
# ? Dec 21, 2017 04:58 |
|
Powerful Two-Hander posted:born to merge please make this shirt
|
# ? Dec 21, 2017 07:09 |
|
Notorious b.s.d. posted:it would be funny to re-implement hg on top of git, sell it as a new improved git cli, and see how many people bite do this but using libgit2 a great many people will use it
|
# ? Dec 21, 2017 07:10 |
|
last time I had to implement a mail-merge type thing, I just used textual tokens and RTF I could get away with that because OpenStep/Cocoa lets you read an RTF document as an NSAttributedString, and any changes you make to the string contents will adjust the formatting attributes appropriately so our customers could design any layout they wanted as RTF, use some documented {token} strings where they wanted generated information to go, and then point our PoS software at it and we would print pretty receipts
|
# ? Dec 21, 2017 07:24 |
|
cis autodrag posted:Today I am writing a generic abstract class in java. Like 10 classes will extend it. I feel dirty. this is fine you baby
|
# ? Dec 21, 2017 14:16 |
|
cis autodrag posted:Today I am writing a generic abstract class in java. Like 10 classes will extend it. I feel dirty. pretend it's an interface. all is good.
|
# ? Dec 21, 2017 14:50 |
|
cis autodrag posted:Today I am writing a generic abstract class in java. Like 10 classes will extend it. I feel dirty. i did this for a wizard i made. i think if i could do java 8 it would have just been an interface with default methods tho also what is this SwingUtilities2 and SwingUtilities3 horseshit, oracle?
|
# ? Dec 21, 2017 15:53 |
|
redleader posted:does razor actually escape that poo poo correctly, or does it just do html entity encoding? it will probably do html encoding since that's what razor's designed for. it will work in most cases but if you have some wonky characters you'll probably need to write your own encoder. You may also be able to tell it not to do any encoding at all so everything is merged into the template as raw strings
|
# ? Dec 21, 2017 16:08 |
|
gonadic io posted:pretend it's an interface. all is good. Basically what I'm doing except there's two functions that are identical for all inheriting classes so they're implemented on the super along with the backing data store. It's got two functions, one abstract function, and one field. It's humming along now and it's actually pretty slick. It's a wrapper to make it easier to mock the really complicated objects we work with.
|
# ? Dec 21, 2017 18:21 |
|
cis autodrag posted:Basically what I'm doing except there's two functions that are identical for all inheriting classes so they're implemented on the super along with the backing data store. It's got two functions, one abstract function, and one field. this is acceptable inheritance is a tool like any other: sometimes bad, sometimes good. so long as you’re thinking about alternatives instead of blindly using the tool you’re most familiar with, you’re probably an ok programmer writing code that’s no worse than anybody else’s
|
# ? Dec 21, 2017 18:45 |
|
Soricidus posted:this is acceptable Sweet. The environment I came from is vb6 and there anytime a class had a separate interface defined it was pure pain because the debugger sucked and inheritance is weird on vb6
|
# ? Dec 21, 2017 20:40 |
|
data access layer repository design question say i've got a pod class of some 20 fields that one to one represents a database table , but a developer wants to be able to pull down only three or four relevant fields should they get the same pod class as everyone else with default values otherwise, a different pod class using the same repo, or a different repo entirely boss argues should at least get a different pod for performance and memory reasons but i dunno about that
|
# ? Dec 21, 2017 21:11 |
|
idk what a pod class is but if you do this it should be a separate model object that represents the same subset that is returned by the existing repository representation. you should also only do this if theres an actual performance benefit. if the 16 or 17 filtered columns are large and you are returning a lot of rows it could be worth doing.
|
# ? Dec 21, 2017 21:27 |
|
pod - plain old data none of them are large columns, just a bunch of numbers and varchar(20)s mapped to c# decimals and strings respectively Ciaphas fucked around with this message at 21:38 on Dec 21, 2017 |
# ? Dec 21, 2017 21:36 |
|
Ciaphas posted:pod - plain old data btw for future reference don't ever use varchar. use text. on postgres at least the two are stored identically but varchar has effectively a check constraint on the length of your input. so you're not optimizing the actual on-disk storage any. i suspect mssql is similar. at either rate, data validation of this sort does not belong in the database.
|
# ? Dec 21, 2017 21:49 |
|
Sapozhnik posted:btw for future reference don't ever use varchar. use text. on postgres at least the two are stored identically but varchar has effectively a check constraint on the length of your input. so you're not optimizing the actual on-disk storage any. i have 0 control over the db
|
# ? Dec 21, 2017 21:55 |
|
Shaggar posted:idk what a pod class is but if you do this it should be a separate model object Agree with this. Best to make sure everybody understands you're not returning a complete object by making it a different class. Otherwise, somebody's inevitably gonna pass a half-complete object to something that expects a complete object and things will be sad. Shaggar posted:you should also only do this if theres an actual performance benefit. Definitely this. Once you add the extra class, you're now asking developers on your team to think twice every time they need to use this table, because they have to pick which class to use. And when developing some function that uses data from the table, it needs to take an instance of the class that has all the data, the class that has some of the data, or an interface that contains the stuff common to both (and now you have three things to choose from). And God help you if somebody adds a function to the half-complete class that grabs the complete data from the database, because you know somebody's going to do that, instead of just loading all the data to begin with!
|
# ? Dec 21, 2017 22:10 |
|
Sapozhnik posted:i suspect mssql is similar. it's not
|
# ? Dec 21, 2017 22:21 |
|
Yeah, seconding that this is premature optimization. Wait until there's a bottleneck, then identify the bottleneck. It might not be what you think. Assuming there is a performance hit, then there's a few factors to balance: - is it causing memory pressure? Then a single full-fat object with empty fields might not help that much (unless the empty fields are just pointers). Consider having BaseClass with the essential fields, and FullFatClass extends BaseClass for the full version. Using FullFatClass for the Light version with empty fields is dangerous, because the client needs to be aware at all times that some data is incomplete. (You can also flip this around: Have a FullFatClass as the base and LightClass extends it, overriding the getter methods to throw exceptions if empty fields are accessed. But that won't save you any memory.) - API cleanliness. Ideally devs just want a single "getInfo" method to instantiate the class, and not "getLightweightInfo vs getFullFatInfo" or some parameter that specifies light vs full-fat. They don't want to be exposed to the difference. You can achieve this by returning a Proxy or Lazy-loading class, where a single class is returned containing the Light data but it transparently retrieves Full-Fat data if it's ever accessed. The client is unaware of this so the API is cleaner to use, at the expense of a more complex object. Consider this approach if your dev's ideas about what's essential may change, because you're effectively hiding the definition of Light vs Heavy from them so you can modify the performance without devs modifying their call-sites. - Also consider that your Dev may really want an aggregate of multiple tables, not just this one. So provide a custom class that gives them exactly what they want and your retrieval API encapsulates the messy work of assembling it efficiently. This gives Devs the API they want while again hiding the concepts of Light vs Heavy from them.
|
# ? Dec 21, 2017 22:21 |
|
|
# ? Jun 9, 2024 03:16 |
|
Sapozhnik posted:btw for future reference don't ever use varchar. use text. on postgres at least the two are stored identically but varchar has effectively a check constraint on the length of your input. so you're not optimizing the actual on-disk storage any. if you have a natural limit on the length of your string, there's nothing wrong with varchar. you're right that in postgres it doesn't give any storage benefit, but data validation of this sort absolutely does belong in the database
|
# ? Dec 21, 2017 22:28 |