|
spent my morning being outsmarted by the compiler afternoon's not looking any smarter
|
# ? Dec 5, 2016 21:44 |
|
|
# ? May 26, 2024 07:32 |
|
gonadic io posted:
Do tell, I am still thinking about keeping the course running after I leave uni.
|
# ? Dec 5, 2016 21:45 |
|
Bloody posted:HAHA jesus christ i just looked at our main competitor's product and their interface is literally: lol why do people do this HoboMan posted:guess who's got two thumbs and found out that there's an entire class of stored procedures in prod using SELECT *? I go back and forth on using select * vs. list of fields. I think my main motivator is laziness, i.e. if I add a column I only have to update the save procedures and all the read procedures are gtg
|
# ? Dec 5, 2016 21:54 |
|
asked one of the other developers where we store the credentials for a third party service. he handed me a post-it lmao.
|
# ? Dec 5, 2016 21:54 |
|
jony neuemonic posted:asked one of the other developers where we store the credentials for a third party service. *sends you the login & password in a plaintext email*
|
# ? Dec 5, 2016 22:00 |
|
I don't remember if I've asked this in here or not but which is worse: dynamic sql generation in a stored proc dynamic sql generation in c# in my db layer
|
# ? Dec 5, 2016 22:05 |
|
Uncle Enzo posted:*sends you the login & password in a plaintext email* due to some shenanigans, our main customer recently decided to change the admin password for all the shops in their nationwide retail network the above sentence is not missing an "s"
|
# ? Dec 5, 2016 22:07 |
|
Xarn posted:Do tell, I am still thinking about keeping the course running after I leave uni. long story short, british unis are 1) paid per pupil attending and not dropped out, 2) huge amounts of attention is paid to student satisfaction when people choose which uni to go to, and also my uni has pretty big pressure on the lecturers to have high student satisfaction too, and not too many students getting a first or failing. basically we decided on the grade bell curve, and then worked out a mark scheme that would let us hit it with the current crop of courseworks. 5 people marking all marked wildly inconsistently and at one point i was marking at home while getting a hj
|
# ? Dec 5, 2016 22:14 |
|
At work last couple days I'm trying to teach myself server sockets in c/c++ and client sockets in c#, also boost::threads in c++ for said server (main thread listens, spawns new thread for each connection) i'm sort of figuring this poo poo out and playing it by ear but i'm already worried that i don't know enough about what i'm doing to do the project i wanna do at least i went from knowing gently caress all about either subject to successfully setting up an echo server/client over two or three work hours so i guess that's progress?????????? Ciaphas fucked around with this message at 22:29 on Dec 5, 2016 |
# ? Dec 5, 2016 22:27 |
|
NihilCredo posted:due to some shenanigans, our main customer recently decided to change the admin password for all the shops in their nationwide retail network someone pointed out to me once that physical hardcopies can't be hacked into, and if they're in a secure location and kept there they're actually quite safe. secure being a variable term of course, but the person in question was referring to keeping a notebook in a GSA-certified personal records safe in their office in the pentagon kind of an edge case admittedly
|
# ? Dec 5, 2016 22:34 |
|
Finster Dexter posted:I go back and forth on using select * vs. list of fields. I think my main motivator is laziness, i.e. if I add a column I only have to update the save procedures and all the read procedures are gtg one of our developera constantly uses datatables for everything with numeric references to colums so good luck figuring out what will break if you change any returned columns! today i found a case where she had used a dataset and datatables to return what was essentially a bool
|
# ? Dec 5, 2016 22:36 |
|
gonadic io posted:long story short, british unis are 1) paid per pupil attending and not dropped out, 2) huge amounts of attention is paid to student satisfaction when people choose which uni to go to, gonadic io posted:and also my uni has pretty big pressure on the lecturers to have high student satisfaction too, and not too many students getting a first or failing. gonadic io posted:... at one point i was marking at home while getting a hj
|
# ? Dec 5, 2016 22:42 |
|
Finster Dexter posted:I don't remember if I've asked this in here or not but which is worse: ding ding ding
|
# ? Dec 5, 2016 22:53 |
|
gonadic io posted:at one point i was marking at home while getting a hj B+ semen after class
|
# ? Dec 5, 2016 22:55 |
|
Uncle Enzo posted:someone pointed out to me once that physical hardcopies can't be hacked into, and if they're in a secure location and kept there they're actually quite safe. secure being a variable term of course, but the person in question was referring to keeping a notebook in a GSA-certified personal records safe in their office in the pentagon between snowden and the opm hack that's probably more secure than siprnet
|
# ? Dec 5, 2016 23:04 |
|
Finster Dexter posted:I don't remember if I've asked this in here or not but which is worse: its bad either way. you can parameterize it in both places.
|
# ? Dec 5, 2016 23:10 |
|
i couldn't figure out how to stream tiles in and out to wrap the screen around without murdering the frame rate with my meager amiga knowledge, so instead I figured out how to draw a 16-color tilemapped background that's as long as 255 screens and just move the graphics window up and down the length of the level. it's me, i'm the terrible programmer i guess i need to make a level editor tool now so i'm not manually placing these drat tiles everywhere
|
# ? Dec 6, 2016 02:04 |
|
|
# ? Dec 6, 2016 02:22 |
|
|
# ? Dec 6, 2016 02:49 |
|
Hey, I finished a first draft of that article. Does anyone want to review it? I'm going to have my skeleton warrior university student services sociology phd-having friend review it too.
|
# ? Dec 6, 2016 04:43 |
|
We've been pretty lucky it seems. An issue came up and we traced it to a weird case in which we were reading and writing only from the master DB and none of the replicas. We went back and looked at the monitoring logs and found that usage of the replicas was next to nothing. We found the issue pretty quickly. We used to have a developer who's answer to "What is best in life?" was "TDD, writing tests and hearing the lamentations of other developers." Well, in his goal for 100% code coverage he wrote unit tests to some DB connection classes that had bee stable for years. In fact, the only time our main DB connection util was changed in the last 2 years outside of some very minor change, was when he added the following: code:
In the hibernate properties: <property name="only_get_write_session">true</property>
|
# ? Dec 6, 2016 04:46 |
|
Finster Dexter posted:I don't remember if I've asked this in here or not but which is worse: in mssql you can use sp_executesql along with parameters to stop injection don't ever use exec
|
# ? Dec 6, 2016 14:01 |
|
St Evan Echoes posted:dynamic SQL is a code smell imo so theyre both real bad Agreed but as a bad programmer not sure how else to implement this very bad search filtering poo poo they want where they want to search through db rows based on any or all of about 20 different search parameters.
|
# ? Dec 6, 2016 14:43 |
|
Finster Dexter posted:Agreed but as a bad programmer not sure how else to implement this very bad search filtering poo poo they want where they want to search through db rows based on any or all of about 20 different search parameters. Generating a parametrised query in your code probably isn't too terrible, I assume you're not taking things like table names and field names from user supplied data. I'm going to be needing to do a similar thing soon in order to have grouped filtering checkboxes on a product search. When generating dynamic (x and y and (a or b or c)) stuff, this seems like the only approach. Chalks fucked around with this message at 15:11 on Dec 6, 2016 |
# ? Dec 6, 2016 15:08 |
|
Chalks posted:Generating a parametrised query in your code probably isn't too terrible, I assume you're not taking things like table names and field names from user supplied data. Yeah, I'm using parameterized queries. Dapper makes that simple af even with a huge set of parameters. The argument for the search function in the db layer is an object with all the params as properties, and all I have to do then is null check and build the string, then pass in the string and the original search param object into dapper and that's one line of code instead of however many to build the SqlParameter collection. It's about as elegant as I can make it, I think.
|
# ? Dec 6, 2016 15:29 |
|
Finster Dexter posted:Agreed but as a bad programmer not sure how else to implement this very bad search filtering poo poo they want where they want to search through db rows based on any or all of about 20 different search parameters. WHERE (@SearchFooEnabled = 0 OR [Foo]=@SearchFooValue) AND (@SearchBarEnabled = 0 OR [Bar]=@SearchBarValue) etc etc
|
# ? Dec 6, 2016 15:51 |
|
Finster Dexter posted:Agreed but as a bad programmer not sure how else to implement this very bad search filtering poo poo they want where they want to search through db rows based on any or all of about 20 different search parameters. dynamic sql is indeed the "best" way to do that the way we do it is build the query in the sql sproc, but i don't know if i can recommend doing it that way. i would say this probably comes down to personal preference (provided you make a proper c# function to handle making the query in c# instead of just jamming some sql strings in your code somewhere)
|
# ? Dec 6, 2016 15:59 |
|
if ur using java then JPA2 criteria queries are very ftw for this sort of thing the "metamodel" classes get autogenerated from your entity classes in the background in real time, and you can bash together subexpression chunks however you please. it even has type safety! although i was confused as to why it let you like, generate an expression node that compares an integer to a string and then i remembered that sql is garbage and lets you do that. i have to say, JPA2 is extremely needs suiting, but with one major caveat: you should only very rarely actually tell it about entity relationships. most times you want to just map the FK columns and then explicitly construct a join using criteria queries. this gets you basically all of the benefits of an orm and none of the drawbacks.
|
# ? Dec 6, 2016 16:23 |
|
Sapozhnik posted:if ur using java then JPA2 criteria queries are very ftw for this sort of thing I'm in C# land, but what you're describing sounds a lot like Dapper. The worst part of any orm is the relationship mapping and when it gets screwed up (because it always does) the orm will lay a giant runny turd on your database in the form of thousands of queries to build the object-relation trees.
|
# ? Dec 6, 2016 16:36 |
|
NihilCredo posted:WHERE have done this, works great and you will hate your life way less when you have to update it later. you can save yourself the extra variables by doing something like @ButtValue IS NULL OR Butt = @ButtValue too.
|
# ? Dec 6, 2016 18:05 |
|
jony neuemonic posted:have done this, works great and you will hate your life way less when you have to update it later. you can save yourself the extra variables by doing something like @ButtValue IS NULL OR Butt = @ButtValue too. I have learnt through much pain to never use nulls if any other way of representing a missing value is available. If I have a foreign key relationship I am forced to use nulls, and if I'm doing a left join I will always get nulls for missing rows, but other than that a default value is the way to go as it's much less likely to gently caress poo poo up. Basically the null object pattern for sql
|
# ? Dec 6, 2016 18:31 |
|
NihilCredo posted:I have learnt through much pain to never use nulls if any other way of representing a missing value is available. in that case i used null as the default for the stored proc parameters so it should be fine, but that's a good point. nulls bite.
|
# ? Dec 6, 2016 18:38 |
|
NihilCredo posted:I have learnt through much pain to never use nulls if any other way of representing a missing value is available. What sort of issues do you encounter with nulls? Other than .net's stupid DBNull type, I've never been particularly concerned by them. I get rather irritated by code doing things like putting blank strings into fields to indicate that the value has been cleared because it can lead to really subtle bugs.
|
# ? Dec 6, 2016 18:50 |
|
Sapozhnik posted:it's me, i'm the guy writing new and trivial python 2 code in tyool 2016, because centos 7 comes with java 8 but whoa there apparently python 3 is a bit too bleeding edge gently caress this poo poo so very hard
|
# ? Dec 6, 2016 18:52 |
|
c web dev s: this page is not displaying correctly on mobile chrome. normal chrome is fine, just on a tablet it doesn't work. also, looking at the code, come chucklefuck decided that this page's html should get dynamically built using client-side javascript
HoboMan fucked around with this message at 19:52 on Dec 6, 2016 |
# ? Dec 6, 2016 19:49 |
|
HoboMan posted:c web dev s: this page is not displaying correctly on mobile chrome. normal chrome is fine, just on a tablet it doesn't work. also, looking at the code, come chucklefuck decided that this page's html should get dynamically built using client-side javascript yeah I hate that poo poo, my platform is rife with that garbage, especially on stuff built by the guy who puts "created javascript framework" on his linkedin and quit the company to go work on a factory assembly line.
|
# ? Dec 6, 2016 20:11 |
|
Chalks posted:What sort of issues do you encounter with nulls? Other than .net's stupid DBNull type, I've never been particularly concerned by them. I get rather irritated by code doing things like putting blank strings into fields to indicate that the value has been cleared because it can lead to really subtle bugs. Well here's one from less than 48 hours ago: We had a feature that was supposed to be active from StartDate to EndDate, but actually would end on the day before EndDate. Turns out a query was doing GETDATE() <= [EndDate] in its WHERE, thus taking the time of day into account and ending prematurely. I took my time to look for the right fix (because we have to technically support as old as MSSQL2005 where the DATE type doesn't even exist) and settled on some formula involving DATEDIFF. Tested it to make sure every edge case was covered, pushed it onto a few prod environments, everything's ok. Last Sunday it gets pushed to all prod environments, and a bunch of the really old ones break. Turns out when those columns were originally added to the schema, somebody (who may or may not be currently paying my salary) half-assed the migration and left NULLs in the pre-existing rows instead of inserting default dates. This was like seven or eight years ago and I had no idea those columns had ever not existed - the current schema has had them as NOT NULL forever. But as it happens, GETDATE() <= NULL is perfectly legal and returns false, but DATEDIFF (NULL) throws and aborts the entire query. So yeah, if I could know exactly with 100% certainty which columns can and can not be NULL, then I'd have no major issue with NULLs. But having to code against live production dbs that have gone through all sorts of grubby hands over the years, safely dealing with NULLs requires me to wrap literally every single column name in ISNULL() boilerplate, and it's always the one time I don't that I get bit in the rear end.
|
# ? Dec 6, 2016 20:21 |
|
Finster Dexter posted:yeah I hate that poo poo, my platform is rife with that garbage, especially on stuff built by the guy who puts "created javascript framework" on his linkedin and quit the company to go work on a factory assembly line. i really have no idea what to do. not only does it build it dynamically client-side, but it does it using jquery. i don't want to completely redo the page but it seems like the only option since how the gently caress do i debug this?
|
# ? Dec 6, 2016 21:09 |
|
HoboMan posted:i really have no idea what to do. not only does it build it dynamically client-side, but it does it using jquery. i don't want to completely redo the page but it seems like the only option since how the gently caress do i debug this? Well, here's what I've done as I've needed to make changes, and I have to weigh the effort of this vs. the benefit from unfucking it: I took the rendered html and saved it to a file. This file is going to become my handlebars template. Then, I go through the js and rip out all the html and just set properties on a bespoke JSON object. Every time I do that, I update my template with the handlebars calls for the properties, like {{Turd}} or whatever. I've also done this when the html is built up by calls to web services that return html (which also bugs the poo poo out of me... don't infect my service layer with your loving markup fjhdsklafdskla). It can take a long-rear end time based on how much html you're dealing with, but it gets things fairly de-coupled and a lot more sane to deal with when you need to edit/change the markup or the data being returned or whatever. I like handlebars because it's loving simple and not overgrown with a bunch of bullshit you don't need. And if you have to do really wild n wooly markup you can create a custom handler for handlebars pretty quickly/easily. Finster Dexter fucked around with this message at 21:22 on Dec 6, 2016 |
# ? Dec 6, 2016 21:20 |
|
|
# ? May 26, 2024 07:32 |
|
NihilCredo posted:Well here's one from less than 48 hours ago: Wait, the database structure has the columns as "not null" but they contain nulls? Admittedly almost all my database experience has been with Sybase products but with those if you try to set a column to not null where it contains nulls you get an exception when trying to update the structure. Dealing with nulls in .net is the biggest pain I've found - you'd have thought that if a column contains a null then returning null would be a pretty sensible thing rather than some bizarre "DBNull" data type that seems to exist solely to irritate me. You just have to extend the data reader to return actual useful nulls instead though and then it all just works but the main reason it annoys me is because I'm apparently too dumb to ever remember this until my code crashes. Can't cast DBNull to string! Fucks sake. In general though I like nulls. In the example you mention, I guess there's some appropriate "default date" that you can use, but it could well be the case that if no end date is specified then there's some context specific end date that you use instead (like the end of the next working week or something based on other attributes of the record). I'd much rather use a null for that instead of setting the date to 01-01-2999 and then having a special case for that magic date or whatever. With dates that seems really insane but you see people doing magic crap like that with strings and integers all the time. Chalks fucked around with this message at 21:31 on Dec 6, 2016 |
# ? Dec 6, 2016 21:28 |