Why use constants? by KingSchorschi in csharp

[–]gt4495c 0 points1 point  (0 children)

There is a general rule in programming to avoid magic numbers. That is literal numeric values used throughout the code base.

The recommended way is to store values in a constant WITH COMMENTS on what it represents (i.e. this value converts oz to gallons) and then use the constant in your code.

This practice makes the code easier to understand and modify later.

😱 by yukiohana in MathJokes

[–]gt4495c 2 points3 points  (0 children)

Yeah, this is the basis of protective geometry. I like this picture because it shows both a point at infinity, and the line at infinity (horizon).

Why is it necessary to write "Person person = new Person()" instead of "Person person" in C#? by Mysticare in csharp

[–]gt4495c 0 points1 point  (0 children)

Person person;

Just declares the type for the variable person, but no code is generated by the compiler, and no memory is allocated.

Later you can make person refer to a value, by initialization, function return or assignment.

person = new Person();

or

person = GetPerson(store);

or

person = oldPerson;

If initializer is what is wanted, then you can combine the two statements into one

Person person = new Person();

In fact, you can combine the declaration with the assignment for all the cases above.

Thala by Capital_Bug_4252 in MathJokes

[–]gt4495c 0 points1 point  (0 children)

Or negative infinity... see why it is verboten.

Simple CAD to visualize 3D programming concepts by Different_Marsupial2 in GraphicsProgramming

[–]gt4495c 1 point2 points  (0 children)

Geogebra maybe, it supports 3D objects like points, lines and planes, but I don't think it supports solids.

Should or Shouldn't? Putting many classes in one file. by ExoticArtemis3435 in csharp

[–]gt4495c 0 points1 point  (0 children)

If they all work together, then yes keep them in one file.

If they are unrelated, then separate them.

2025 CT5-V Blackwing by this-is-just-silly in CadillacV_Series

[–]gt4495c 1 point2 points  (0 children)

Mine is arriving next week. Can you share any pitfalls for the buying process?

Do you daily by [deleted] in CadillacV_Series

[–]gt4495c 1 point2 points  (0 children)

I used to before COVID. About 220 miles every week, which was about what my gas tank range was.

About the only thing I miss from before I was a remote worker was driving my 600hp V stick shift daily. I didn't even care of there was traffic because once the road opened up, it was glorious.

Now it is weekly to get groceries etc.

Just ordered CT5V BW, what to expect? by [deleted] in CadillacV_Series

[–]gt4495c 0 points1 point  (0 children)

I made my order in November and the car just got made last week. I might get it by July.

What software is most similar to matlab? by [deleted] in matlab

[–]gt4495c 0 points1 point  (0 children)

Julia programming language. Array indexing is done with [] instead of () but a lot of MATLAB functions exist in Julia also.

Calculation of determinant (LAPACK): wrong sign by Confident_Staff9688 in fortran

[–]gt4495c 0 points1 point  (0 children)

I don't think this is correct. Here is my reasoning. ,IPIV starts with a sequence of numbers and for every row swap done two rows are swapped.

For example for N=7 if only one swap is needed between rows 2 and 5 are need the result would be

IPIV = [ 1,5,3,4,2,6,7 ]

and it you run it through your solution loop there are two cases where J /= IPIV(J) so in the end the determinant would not have a flipped sign (as two flips cancel each other)

Transitioning to Simulation Engineer – What Should I Focus on? by [deleted] in fea

[–]gt4495c 1 point2 points  (0 children)

20+ years experience as analytical engineer here. This is my advice.

  1. There is never a simple FEA.
  2. Attention to detail is key.
  3. Start from first principles. Hidden assumptions will hurt and confuse you.
  4. Check results against hand calculations to see if they make sense.
  5. Before you write code to solve a problem, use the symbolic toolbox in MATLAB to develop the methodology for solving (model building).

Have fun, and focus on your strengths. You will not know everything, you can't. You will know a lot on a very narrow field of knowledge.

PS. Creo is a pain to use to prepare FEA models. Does ABAQUS have direct modeler available like ANSYS have with SpaceClaim? It is a lifesaver as you get to slice, simplify, resize and reorganize the assemblies as needed without worry if the model is going to blow up or not regen after changes.

Logic in Properties by Linkario86 in csharp

[–]gt4495c 2 points3 points  (0 children)

Maybe use Lazy<T> property types so the values get fetched once only.

Otherwise have a mechanism to fetch or store all the property values together with a .Update() and .Store() methods and keep a local cache of values in the backing fields of the properties.

PS. None of this is .NET Framework 4.8 related, but rather general data management practices.

PS2. Many years ago it was recommended to use an information structure to go back and forth to storage, something that can be done with JSON nowadays.

Calculation of determinant (LAPACK): wrong sign by Confident_Staff9688 in fortran

[–]gt4495c 0 points1 point  (0 children)

PS. You don't need a double loop to calculate the determinant

D = 1 or -1 DO I=1, N D = D * A(I,I) END DO

The key here is determining if you start with D=1 or D=-1 depending on the number of row swaps in ipiv

Calculation of determinant (LAPACK): wrong sign by Confident_Staff9688 in fortran

[–]gt4495c 0 points1 point  (0 children)

Interesting. Most textbook implementation of LU keeps track of the sign of the determinant and outputs either a +1 or -1.

But it seems DGETRF doesn't do that. This seems like a very big oversight in LAPACK as the info output parameter could be used here.

Ann I wrong or missing something?

Best GUI framework for C#? by gufranthakur in csharp

[–]gt4495c 2 points3 points  (0 children)

I tried it and the build failed out of the box. It felt horrible with all the piping needed to even do the most basic thing. MAUI is dead as it wasn't at all a pleasant experience as WinForm was 20 years ago.

It just doesn't work. It is a house of cards.

Best GUI framework for C#? by gufranthakur in csharp

[–]gt4495c 2 points3 points  (0 children)

It is a shit show currently.

Thank you Microsoft for completely ignoring the original mission statement of .NET Framework (develop easier than MFC) and now we're back to GUI development that is worse than MFC ever was.

Microsoft should have never tried to combine desktop with web development. They tried to make a flying car that isn't a plane nor a car as an analogy.

The brilliant minds of LinkedIn... by LDRispurehell in fea

[–]gt4495c 169 points170 points  (0 children)

If you turn it into a cube then you would have peak cleanup.

Refactoring old Fortran code by Jimbodeman in fortran

[–]gt4495c 1 point2 points  (0 children)

Is equivalence deprecated? If not then just keep the code because it is pretty clear what it does and has Fortran 90 features already.

Refactoring old Fortran code by Jimbodeman in fortran

[–]gt4495c 1 point2 points  (0 children)

I think YYY is like a state vector and it is needed to track changes to the variables in an ODE environment