|
I already use Spring on Java 8.
|
# ? Jul 12, 2021 23:32 |
|
|
# ? May 24, 2024 23:37 |
|
Ola posted:What if I told you you could gather all your technical debt into one easy framework? Thread title potential
|
# ? Jul 13, 2021 02:16 |
|
Biowarfare posted:I already use Spring on Java 8. why you gotta call me out like this
|
# ? Jul 13, 2021 06:00 |
|
Soricidus posted:Thread title potential
|
# ? Jul 13, 2021 06:56 |
|
Soricidus posted:Thread title potential The current one is getting old
|
# ? Jul 13, 2021 16:44 |
|
Technical debt consolidation
|
# ? Jul 13, 2021 16:44 |
|
Doom Mathematic posted:Yes, this is called a ground-up rewrite. Should only be considered if you're feeling pretty ground-up already.
|
# ? Jul 13, 2021 16:51 |
|
Just been given a spec where a 3rd part wants an api endpoint that accepts a xml body as the post, which is 'fine' I suppose. Its a standard all element based request, easy enough to parse. But they want the response to be a single element with all the results as a list of attributes and no sub elements within it...
|
# ? Jul 15, 2021 15:13 |
|
Mega Comrade posted:Just been given a spec where a 3rd part wants an api endpoint that accepts a xml body as the post, which is 'fine' I suppose. Its a standard all element based request, easy enough to parse.
|
# ? Jul 15, 2021 22:32 |
|
My guess is they concatenate it into a larger document and then parse it. Stick an opening cdata at the end of the response and see what happens.
|
# ? Jul 16, 2021 00:25 |
|
they are parsing it with regex
|
# ? Jul 16, 2021 00:33 |
|
Biowarfare posted:they are parsing it with regex The <center> cannot hold it is too late.
|
# ? Jul 16, 2021 04:31 |
|
I wrote this yesterdayC++ code:
(Yeah, later I changed it to be clearer)
|
# ? Jul 25, 2021 14:35 |
|
Xarn posted:I wrote this yesterday I'm afraid to ask, what made this code different from a noop? (I mean in your specific real case, I know that theoretically those operators can be overloaded etc.)
|
# ? Jul 25, 2021 14:47 |
|
As a hint, here is the second version (without comments, and the final version does some further trickery, because it is wrapped in a template)C++ code:
|
# ? Jul 25, 2021 15:29 |
|
Xarn posted:As a hint, here is the second version (without comments, and the final version does some further trickery, because it is wrapped in a template) Replacing negative 0 with regular 0?
|
# ? Jul 25, 2021 15:36 |
|
== 0. could result on floating point errors, I guess.. it may also creating visual errors like z-fighting on 3d engines, I guess. double vs single precission could result on round errors. "Everybody" expect the result on a calculation match their excel page, and if not, is a error.
|
# ? Jul 25, 2021 17:16 |
|
Van Kraken posted:Replacing negative 0 with regular 0? Yup. It's followed by some terrible bitwise fuckery that relies on IEEE floats and zeros having positive zero representation.
|
# ? Jul 25, 2021 18:00 |
|
Floating point is of the devil.
|
# ? Jul 25, 2021 18:52 |
|
Is there no way to explicitly test for negative zero?
|
# ? Jul 25, 2021 22:34 |
|
Xarn posted:Yup. It's followed by some terrible bitwise fuckery that relies on IEEE floats and zeros having positive zero representation. I think you posted the wrong horror.
|
# ? Jul 25, 2021 22:47 |
|
There’s a negative zero?
|
# ? Jul 25, 2021 22:56 |
|
Xarn posted:Yup. It's followed by some terrible bitwise fuckery that relies on IEEE floats and zeros having positive zero representation. Is your compiler obligated to replace it? I wouldn't be surprised if a compiler (rightly or wrongly) deletes that in high optimization levels. I would blow Dane Cook posted:There’s a negative zero?
|
# ? Jul 25, 2021 23:22 |
|
Doom Mathematic posted:Is there no way to explicitly test for negative zero? Looks like C++ code:
Less portably, you can always memcpy (or Double.doubleToLongBits or whatever your local language equivalent is) and test the bits against the bits of -0.0 -- presumably 0x1<<63. This seems to be somewhat faster but, on the other hand, bits are smelly and dirty. I would blow Dane Cook posted:There’s a negative zero? IEEE 754 is a gift that keeps on giving. Wait until you find out about subnormals and quiet vs signaling NaNs! E: Foxfire_ posted:Is your compiler obligated to replace it? I wouldn't be surprised if a compiler (rightly or wrongly) deletes that in high optimization levels. It's definitely obligated by IEEE 754, the two different zeros should explicitly compare as equal. You can of course set -fno-signed-zeros or your local equivalent, which does a lot of fun things that the IEEE would frown at but should not, I think, change the basic comparison behavior for zeros. Setting it just means the compiler doesn't try to correctly preserve the sign. Code that in strict compliance should have produced negative zero can instead produce positive zero, or vice versa. For instance no-signed-zeros allows the compiler to assume that 0.0 - x == -x when simplifying expressions, even though this is not strictly correct for x = 0.0 and would in that case produce an incorrect -0.0. All the -ffast-math flags are mostly about relaxing IEEE strictness to allow for more arithmetic transforms. A compiler unilaterally assuming that zero has a single bit representation in IEEE floating point would probably break a lot of things since neither the underlying instructions or typical calling code will behave like that. Still, I'm sure someone somewhere has hosed it up at some point. It's how these things go. Xerophyte fucked around with this message at 00:13 on Jul 26, 2021 |
# ? Jul 25, 2021 23:27 |
|
Xerophyte posted:Looks like My concern is less what the compiler emits and more someone coming along later and removing a piece of code they perceive to be a no-op. In JavaScript we have Object.is(x, -0). Before we had that, we used 1 / x === -Infinity. Failing something like that, I guess I would settle for an explanatory comment...
|
# ? Jul 26, 2021 01:14 |
|
Doom Mathematic posted:My concern is less what the compiler emits and more someone coming along later and removing a piece of code they perceive to be a no-op. In JavaScript we have Object.is(x, -0). Before we had that, we used 1 / x === -Infinity. Failing something like that, I guess I would settle for an explanatory comment... Use a unit test for this.
|
# ? Jul 26, 2021 10:22 |
|
I would blow Dane Cook posted:There’s a negative zero? Yup. It's useful in some situations (e.g., for representing branch cuts of various complex functions), but IIRC no language in the C family makes use of that.
|
# ? Jul 26, 2021 10:48 |
|
Van Kraken posted:Replacing negative 0 with regular 0?
|
# ? Jul 26, 2021 16:32 |
|
Beef posted:I think you posted the wrong horror. Nah, that's actually beautiful code C++ code:
|
# ? Jul 26, 2021 17:09 |
|
Xarn posted:Nah, that's actually beautiful code if you think this is beautiful, you got a serious case of c++ brain
|
# ? Jul 27, 2021 04:27 |
|
It seems cool to me, clean for what it is
|
# ? Jul 27, 2021 07:37 |
|
- Defining that whateveristhis as FP. I don't know what F.P. is, it mean something but is imposible to say from the name. This is caused by the need to use the FP name often, so the programmer tried to make it short. He had to choice between making the code obscure or verbose, and choosed obscure. - Prefix like "ulp". Again, is imposible to know what "ulp" means. A name is like ulpDistance is obscure. It could be again the choice between obscure or verbose was made to obscure. - if ( ( lhs < 0 ) != ( rhs < 0 ) ) {. you don't need all these "(" and ")" guy. - uint64_t is ugly, but compact. it result on code like this: uint64_t lc = Detail::convertToBits( lhs ); this could have been looker better like this: unsigned int64 lc; ... lc = Detail::convertToBits( lhs ); I guess you are forced to use uint64_t to make sure is a 64 bits integer and not any other word size. At not point is declared the return type. I would be better with doxygen type comments /** * ... * @return uint64_t delta * / or by having the language define the return type unsigned int64 Distance( floatingpoint lhs, floatingpoint rhs ): unsigned int64 { I guess this would look better for people that hate verbose code: uint64 Distance( floatingpoint lhs, floatingpoint rhs ): uint64 { I would have another function with the same name if neccesary uint64 Distance( int l, int r ): uint64 { let the compiler choose the right one based on the type of the input ---- std::abs( lhs ) A language with namesspaces can do this: use std::abs as abs; then use abs withouth specifing abs( lhs ) ---- About this: return ulpDistance( std::abs( lhs ), positive_zero ) + ulpDistance( std::abs( rhs ), positive_zero ); I would have a alias "self" that would always point to the current function or method. return self( abs( lhs ), positive_zero ) + self( abs( rhs ), positive_zero ); why? so is easy to refactor and because not everything that can have a name need to have a name. C++ code:
Tei fucked around with this message at 08:01 on Jul 27, 2021 |
# ? Jul 27, 2021 07:45 |
|
I don't think that function benefits from either being made incorrect or from using a language feature that doesn't exist. YMMV I suppose.
|
# ? Jul 27, 2021 08:53 |
|
Tei posted:"advice"
|
# ? Jul 27, 2021 09:04 |
|
Tei posted:- Prefix like "ulp". Again, is imposible to know what "ulp" means. A name is like ulpDistance is obscure. It could be again the choice between obscure or verbose was made to obscure. Why would someone who doesn't know what a ulp is care about this function at all? They certainly should not modify it. It's definitely OK that domain code uses domain terms, and this code is fine (except for superficial but unavoidable C++ syntax stuff). I hope I got trolled.
|
# ? Jul 27, 2021 09:47 |
|
Qwertycoatl posted:I don't think that function benefits from either being made incorrect or from using a language feature that doesn't exist. YMMV I suppose. C++ was created by people that trough C syntax was kind of lacking My comment was in the line "if this is the best looking C++ code you can make, C++ is lacking".
|
# ? Jul 27, 2021 10:56 |
|
Athas posted:Why would someone who doesn't know what a ulp is care about this function at all? They certainly should not modify it. It's definitely OK that domain code uses domain terms, and this code is fine (except for superficial but unavoidable C++ syntax stuff). 'new junior dev takes team lead down a notch or two with scathing PR feedback'
|
# ? Jul 27, 2021 10:59 |
At least put some effort into learning C++ if you're going to troll about it. uint64 is not a standard type name in C or C++, uint64_t is. If you wanted to use a keywords-only type that in most implementations end up as a 64 bit unsigned integer then unsigned long long would be the way to go. (Reference: https://en.cppreference.com/w/cpp/types/integer) Convention is to CamelCase template parameter names, if you don't just shorten them to one or two letters. When it's obviously just the type of the parameter the function/class works on, a one or two letter name is accepted, with T being common. You're technically right on the operator precedence of (lhs < 0 != rhs < 0) but I'd say it's one of those cases where you can't expect programmers to remember the exact rules. Personally I'd prefer this written as (std::signbit(lhs) != std::signbit(rhs)), to make the expression explicitly read as "the left and right hand sides have different sign". The syntax for renaming types/importing from a namespace is using abs = std::abs; (Reference: https://en.cppreference.com/w/cpp/language/type_alias)
|
|
# ? Jul 27, 2021 11:12 |
|
Can we list the crimes of Eich? - Said masks and lockdowns don't work and that Fauci "lies a lot" - Invented a cryptocurrency - Is against same-sex marriage - Invented Javascript I'm not sure which of these is the worst.
|
# ? Jul 27, 2021 11:47 |
|
|
# ? May 24, 2024 23:37 |
|
This is so terrible, it's like human clippy giving C++ advice
|
# ? Jul 27, 2021 11:48 |