|
Got some third party code to integrate into the build temporarily this morning. Aside from being a "singleton" where there's no guarantee multiple things aren't created (you'll just leak resources), multiple of them could be useful, and doing in a thousand lines what you could do in a hundred, they intersperse field declarations, function declarations and internally defined classes without any structure. Oh and everything is public because of course it is. How do people live with themselves like that. Fake e: Just found that one of the things (no accessor so it's internal) declared randomly though the code is only ever used in one function that will always allocate a new one and return it.
|
# ? Apr 24, 2017 15:16 |
|
|
# ? Apr 25, 2024 02:28 |
|
nielsm posted:The user account the process was running as did not have write access to C:\ so user Windows account virtualization kicked in and redirected the write to the user's personal VirtualStore directory instead. That's a feature of UAC that lets software access files in locations like C:\Program Files\ and C:\Windows\ and write to them without actually touching system-global stuff and requiring local administration permission. That's a "feature", silently putting files somewhere other than where I asked for them to be put rather than throwing a big noisy error about it so I know something is wrong? Windows can gently caress off too.
|
# ? Apr 24, 2017 15:29 |
|
Hammerite posted:That's a "feature", silently putting files somewhere other than where I asked for them to be put rather than throwing a big noisy error about it so I know something is wrong? Windows can gently caress off too. I want this from my programming languages and APIs etc, but for an OS I play films and games and print poo poo with I just want it to work. Windows would be worse without this feature, even if it does make devs lives harder sometimes.
|
# ? Apr 24, 2017 16:04 |
It's a feature to make horrible old software that wants to write its configuration files in dumb places still work.
|
|
# ? Apr 24, 2017 16:09 |
|
Hammerite posted:That's a "feature", silently putting files somewhere other than where I asked for them to be put rather than throwing a big noisy error about it so I know something is wrong? Windows can gently caress off too. For reference, the illusion is intended for the software, not the user. If a non-admin application writes to "C:\butts", and then later goes on to read from "C:\butts", it still works, even though there was never actually anything in "C:\butts". But it's the developer's job to specifically opt out of this behavior and handle file permission errors, which of course they don't.
|
# ? Apr 24, 2017 16:28 |
|
I'm trying to have a good old self-indulgent whine here because I resent dealing with Oracle stuff all morning, and none of you are helping!
|
# ? Apr 24, 2017 16:40 |
|
Hammerite posted:I'm trying to have a good old self-indulgent whine here because I resent dealing with Oracle stuff all morning, and none of you are helping! haha, sorry bud. I'm entirely on the gently caress Oracle train though.
|
# ? Apr 24, 2017 16:41 |
|
Hammerite posted:I'm trying to have a good old self-indulgent whine here because I resent dealing with Oracle stuff all morning, and none of you are helping!
|
# ? Apr 24, 2017 16:43 |
|
nielsm posted:The actual hard part is keeping validation at both ends in sync, or ideally making a solution to use a single code base for both. Just use WebForms
|
# ? Apr 24, 2017 16:59 |
|
nielsm posted:The actual hard part is keeping validation at both ends in sync, or ideally making a solution to use a single code base for both. This is one of the arguments in favor of having javascript on the server. Sorry, that's just insane. Is just an object validation. Even if you have 1000 of them, their business rules don't change that often (or shouldn't) to actually be a burden to keep in them sync in different languages/platforms. And like someone pointed out earlier, validation on the client is optional (if it's wrong ... meh, the QA will let you know, not big deal either way). The server is what matters.
|
# ? Apr 24, 2017 17:29 |
Volguus posted:This is one of the arguments in favor of having javascript on the server. Sorry, that's just insane. Is just an object validation. Even if you have 1000 of them, their business rules don't change that often (or shouldn't) to actually be a burden to keep in them sync in different languages/platforms. And like someone pointed out earlier, validation on the client is optional (if it's wrong ... meh, the QA will let you know, not big deal either way). The server is what matters. The biggest failure client-side validation can do is reject inputs that should be valid (and the server would accept), making it difficult to submit those particular values.
|
|
# ? Apr 24, 2017 18:03 |
|
I guess a third option is to pre-submit the input through AJAX every N seconds, for validation only? A wasteful use of traffic, to be sure, but there's plenty of use cases where that isn't a concern. e: less wastefully, make the "Submit" button do an AJAX call, and only refresh the page if the validation returns OK. Not as nice as real-time or semi-real-time validation, but almost as good.
|
# ? Apr 24, 2017 19:18 |
|
NihilCredo posted:I guess a third option is to pre-submit the input through AJAX every N seconds, for validation only? A wasteful use of traffic, to be sure, but there's plenty of use cases where that isn't a concern. Or just code the validation twice and use the same set of core unit tests to verify both paths. Validation isn't complicated and there are tons of JS libraries to cover the basics.
|
# ? Apr 24, 2017 19:20 |
|
NihilCredo posted:I guess a third option is to pre-submit the input through AJAX every N seconds, for validation only? A wasteful use of traffic, to be sure, but there's plenty of use cases where that isn't a concern.
|
# ? Apr 24, 2017 20:11 |
|
boo_radley posted:Or just validate when a field's value changes. Yes, that's what you do with client-side validation. I was suggesting a way to be lazy and write validation code only once (server-side) without inconveniencing the user too much. Calling server-side validation every time a field's value changes would spam a lot of requests.
|
# ? Apr 24, 2017 21:17 |
|
SupSuper posted:Well it is Oracle's fault for leaving it to Windows to pick up its mess.
|
# ? Apr 25, 2017 01:05 |
|
Bonfire Lit posted:Not just that; file system virtualization is disabled by default for any software that was compiled with Visual C++ 2008 or later. Oracle was either using an ancient compiler, or they actively enabled virt. I'd give even odds on either. Toolchain upgrades for a company as venerable as Oracle can be seen as a massive cost with minimal benefit, but even assuming they did upgrade their compiler, there's still little reason, from their perspective, to get with the times on a feature that works "perfectly fine" as-is.
|
# ? Apr 25, 2017 01:07 |
|
Hammerite posted:I'm trying to have a good old self-indulgent whine here because I resent dealing with Oracle stuff all morning, and none of you are helping! http://bad.solutions
|
# ? Apr 25, 2017 02:13 |
|
Today I learned that HTML attributes are case sensitive by React breaking a major piece of functionality due to a lowercase L.
|
# ? Apr 25, 2017 15:48 |
|
Pollyanna posted:Today I learned that HTML attributes are case sensitive by React breaking a major piece of functionality due to a lowercase L. I'm not sure how people use React without realizing that JSX != HTML, but there you have it. EDIT: One of the first things in the React docs posted:Caveat: Lumpy fucked around with this message at 15:56 on Apr 25, 2017 |
# ? Apr 25, 2017 15:52 |
|
I wonder why they rely on object attributes rather than accessing the properties via getAttribute
|
# ? Apr 25, 2017 16:04 |
|
Yeah the horror is me in this case for forgetting about it, really.
|
# ? Apr 25, 2017 16:19 |
|
The horror is actually that you're not using TypeScript which would have given you the correct attribute name instantly in auto-complete.
|
# ? Apr 25, 2017 16:27 |
|
QuarkJets posted:So I've noticed that a lot of problematic code that gets brought up tends to be in javascript, is it because javascript is bad or is it just because a lot of unprofessional "developers" know and code in javascript? Yes
|
# ? Apr 25, 2017 20:15 |
|
QuarkJets posted:So I've noticed that a lot of problematic code that gets brought up tends to be in javascript, is it because javascript is bad or is it just because a lot of unprofessional "developers" know and code in javascript? JavaScript is nice because when I'm looking at some horrible steaming pile of poo poo PHP code that barely functions and does poo poo like execute 300 loving queries for a single page or pull all the DB into PHP just to do aggregation or count poo poo I can think: "Well, at least it's not loving JavaScript."
|
# ? Apr 25, 2017 20:52 |
|
Volguus posted:This is one of the arguments in favor of having javascript on the server. Sorry, that's just insane. Is just an object validation. Even if you have 1000 of them, their business rules don't change that often (or shouldn't) to actually be a burden to keep in them sync in different languages/platforms. And like someone pointed out earlier, validation on the client is optional (if it's wrong ... meh, the QA will let you know, not big deal either way). The server is what matters. You use something like a predicate object to specify your validation rules, so that you can generate client-side JS from it on the server, and the code generator can do its best to guarantee the client-side JS and the business logic and the generated SQL all behave the same.
|
# ? Apr 25, 2017 23:47 |
|
eschaton posted:You use something like a predicate object to specify your validation rules, so that you can generate client-side JS from it on the server, and the code generator can do its best to guarantee the client-side JS and the business logic and the generated SQL all behave the same. That's one way for sure. It will add an additional "compilation" (transpilation, shittyzation) step, but it would certainly be worth it if it's such a big pain to manually keep them in sync. In my book, this is at most a "meh, whatever" problem.
|
# ? Apr 25, 2017 23:51 |
|
You can also still have the validation on the server, but trigger it via AJAX when a user enters something in the form. That gives you the best of both worlds: you can have responsive client-side UI updates, and you can have a single source of truth for validation rules.
|
# ? Apr 25, 2017 23:53 |
|
My employer's product reads and reports (among other things) local time zone offsets from mobile devices. Implementations are available in JavaScript (the original), Objective-C and Android Java. In JavaScript, a "time zone offset" is rear end-backwards from most written representations of time zone offsets. It is the number of minutes that must be added to a local time to convert it to UTC. This duplicates the behavior of a legacy Java method with the same name. Fair enough, as long as the semantics are understood. Long ago, when the Objective-C and Android implementations were created, each one ended up calculating the local offset differently from the JavaScript one (ObjC by necessity, and Android by choice/accident/malice). And the signs came out wrong! So naturally, those implementations report the absolute value of the offset. We do sell into the eastern hemisphere, in case you were wondering. The product does lots of other dumb things with time, and the downstream team that develops on top of it never says anything to us about this, but regularly tries to stop us from fixing anything. Gazpacho fucked around with this message at 05:59 on Apr 27, 2017 |
# ? Apr 27, 2017 03:39 |
|
Gazpacho posted:The product does lots of other dumb things with time, and the downstream team that develops on top of it never says anything to us about this, but regularly tries to stop us from fixing anything. Every programming everything everywhere does dumb things with time. I've been working on a data pipeline so I've had to consolidate datetimes as represented by Ruby, PostgreSQL, Avro, and Java. Ask each one for a number representing the current day of the week and you'll get a different answer every time.
|
# ? Apr 27, 2017 14:42 |
|
Today, I had to add a quick fix to a legacy WebForms project. But to give it a test and ensure the quick fix worked properly, I needed to configure the very simple cfg.ini file. Hmm, there's some odd syntax in this file. How does it load... code:
|
# ? Apr 27, 2017 16:43 |
|
NihilCredo posted:Today, I had to add a quick fix to a legacy WebForms project. But to give it a test and ensure the quick fix worked properly, I needed to configure the very simple cfg.ini file. I like how this cargo-cults the sz Hungarian notation (I have a lesser form in the beyond-legacy VB6 -> VB.NET codebase I have to deal with too). Are strings in IL even null-terminated, or are they Pascal-style? edit: Apparently they're both. The length is stored at the head so that .Length is fast, and they're null terminated, probably for fast interop. http://stackoverflow.com/questions/6293457/why-are-c-net-strings-length-prefixed-and-null-terminated Seat Safety Switch fucked around with this message at 17:33 on Apr 27, 2017 |
# ? Apr 27, 2017 17:28 |
|
Fortunately that website is legacy in the true meaning of the word - it's been 99% replaced by a new website made by other people that calls our (relatively) shiny new API, and it's only still online for one specific functionality that they haven't implemented yet for some reason. Hopefully they'll do it within a few months and we'll be able to delete all this poo poo. The new website is in Angular 1.0 with a PHP backend, but hey, it's their horror now EDIT: in totally unrelated news, is this attribute normal for Angular? NihilCredo fucked around with this message at 18:32 on Apr 27, 2017 |
# ? Apr 27, 2017 18:26 |
|
canis minor posted:I wonder why they rely on object attributes rather than accessing the properties via getAttribute Plain JS objects don't have getAttribute and information isn't supposed to flow from back from the DOM.
|
# ? Apr 27, 2017 20:41 |
|
NihilCredo posted:EDIT: in totally unrelated news, is this attribute normal for Angular? My (admittedly outdated) recollection is that ng-init is an override for initializing values that for some reason can't be done inside a controller. Using it to provide configuration at the root of the application smells of a poor application architecture.
|
# ? Apr 27, 2017 20:59 |
|
A fun lunch read: https://scotthelme.co.uk/nomx-the-worlds-most-secure-communications-protocol/ The response in mere hours: https://www.nomx.com/
|
# ? Apr 27, 2017 21:09 |
|
Looks like the nomx site is hammered right now. What did the response say? That's loving amazing. Like... I couldn't even creatively come up with something that terrible as an April fools joke. And these guys are trying to ship it as an actual product. And of course they're involved in bitcoins. Jesus christ. Gotta admit I laughed hard at the part where will@nomx claimed to be sending emails but they weren't getting though. It's entirely possible he was just using the product.
|
# ? Apr 27, 2017 21:55 |
|
NtotheTC posted:Looks like the nomx site is hammered right now. What did the response say? quote:nomx Passes Security Tests After Blogger Claims to Have Penetrated nomx
|
# ? Apr 27, 2017 21:57 |
|
"Our users could just check the logs regularly to see if they'd been hacked anyway so it's not like it would even be secret. CHECK MATE BLOGGER"
|
# ? Apr 27, 2017 22:28 |
|
|
# ? Apr 25, 2024 02:28 |
|
NihilCredo posted:Fortunately that website is legacy in the true meaning of the word - it's been 99% replaced by a new website made by other people that calls our (relatively) shiny new API, and it's only still online for one specific functionality that they haven't implemented yet for some reason. Hopefully they'll do it within a few months and we'll be able to delete all this poo poo. If angular isn't the routing architecture and is just being used for two-way binding (fairly common because the alternative has been Knockout - PUKE), then they are passing initial page load data in this way. A better way if the software isn't using angular routing is to just pass an ID or something to the init, then have the controller make a request and fetch data that way.
|
# ? Apr 27, 2017 22:32 |