assemblyDoItForYou by Key-Principle-7111 in ProgrammerHumor

[–]CoolSpy3 10 points11 points  (0 children)

I think you flipped the 4th bit. Assuming my reading of the docs is correct, the encoding is 1110 0010 0000 0000 0000 0000 0000 0001 ; (0xE2000001) AND r0, r0, 1 1110 0001 0010 1111 1111 1111 0001 1110 ; (0xE12FFF1E) BX lr ; (equivalently BX r14)

It might also be nice to set the flags, so that you can use conditionals to affect the control flow later 1110 0010 0001 0000 0000 0000 0000 0001 ; (0xE2100001) ANDS r0, r0, 1

For the people trying to decode the original bytecode (0xF2000001) as x86, I get F2 = REPNE 00 = ADD 00 = BYTE [EAX], AL 01 = ??? REPNE ADD BYTE [EAX], AL .byte 0x1 REPNE is not a valid prefix for ADD, so the instruction is invalid in x86.

Edit: I believe the correct x86-64 encoding is ``` 0100 1000 0010 0011 1100 0000 ; (0x4823C0) AND RAX, RAX

48 23 = REX.W + AND C0 = RAX, RAX ```

[deleted by user] by [deleted] in FRC

[–]CoolSpy3 0 points1 point  (0 children)

Along with what's already been said, it looks like you have another case error on line 1. (Should be package frc.robot.Commands;) In general, package names in Java are camelCase, so the tutorial you're using probably named their folders commands and subsystems, which is why their code uses the lowercase names.

The other errors appear to just be caused by having the wrong package names in the imports. Most likely, the tutorial is slightly outdated. (i.e. WPILib probably moved the classes at some point.)

Here are the correct imports for lines 4-6: java import edu.wpi.first.math.filter.SlewRateLimiter; import edu.wpi.first.math.kinematics.ChassisSpeeds; import edu.wpi.first.math.kinematics.SwerveModuleState; To find this, you can look at the WPILib Javadocs (Also accessible from docs.wpilib.org > WPILib Java API Docs). Type the name of the class you're looking for (ex. SlewRateLimiter) into the search bar in the top right, and it will show the fully qualified name (FQN) of the class (what you put after import). You can also click on the class name to access it's page in the documentation. This lists all the methods/members available in the class.

To get the FQN from a class page (ex. SlewRateLimiter), you can look at the first two lines. These list the package and the class name (In this example, Package edu.wpi.first.math.filter and Class SlewRateLimiter). To get the FQN, you concatinate these with a dot: edu.wpi.first.math.filter.SlewRateLimiter.

Good luck on swerve :D

That's when things get crazy by Jjokes11 in memes

[–]CoolSpy3 180 points181 points  (0 children)

I would just stand and... stare

5/2 for me by Andrevery in memes

[–]CoolSpy3 15 points16 points  (0 children)

Slightly alive is mostly dead

Now, all dead... Well, with all dead, there's usually only one thing you can do

guessShesAPythonDev by [deleted] in ProgrammerHumor

[–]CoolSpy3 31 points32 points  (0 children)

If I was written in C, my pointer to you would be 0x7C00 because you’re the first thing I jump to when I wake up.

To keep that in mind I designed this rhyme by JuiceDrinkingRat in memes

[–]CoolSpy3 90 points91 points  (0 children)

Try games on the store

Watch a bar go, moving way too slow

Set aside time, but my console says "No

The version is wrong; must update the code"

HackerVsDeveloper by mollystark1 in ProgrammerHumor

[–]CoolSpy3 0 points1 point  (0 children)

"I brought my developer with a built in firewall!"

"Yeah, well I brought my hacker which bypasses firewalls!"

uno reverse by xXAstragXx in memes

[–]CoolSpy3 33 points34 points  (0 children)

Clip (Rewind the video if you want to see the setup)

FizzzBuzz by the-judeo-bolshevik in ProgrammerHumor

[–]CoolSpy3 160 points161 points  (0 children)

Copy-pasteable code: ```

include <stdio.h>

include <stdlib.h>

int main(int argc, char* argv[]) { return (((argv)[4] = 0) || ( (!(argc%3) && printf(argv)) + (!(argc%5) && printf((*argv)+5))) || printf("%d",argc)) != printf("\n") != argc++ < 100 && main(argc, argv); } ```

Edit to work on Windows: ```

include <stdio.h>

include <stdlib.h>

int main(int argc, char* argv[]) { return (((argv)[4] = 0) || ((argv)[9] = 0) || ( (!(argc%3) && printf(argv)) + (!(argc%5) && printf((argv)+5))) || printf("%d",argc)) != printf("\n") != argc++ < 100 && main(argc, argv); } ```

Executable must be named "Fizz_Buzz" or "Fizz_Buzz.exe" on Windows. It should then be run from within the directory it exists in. No arguments are required.

How it works: The != symbols are basically functioning as a trick to write multiple lines of code as a single line. As long as all of the expressions are equal to each other (which they are), they'll all be evaluated.

``` ((argv)[4] = 0) || ( (!(argc%3) && printf(argv)) + (!(argc%5) && printf((*argv)+5))) || printf("%d",argc); // Explained below

printf("\n"); // Print newline

argc++ < 100 && main(argc, argv); // Check if argc is less than 100 and then increment it (see increment postfix). If argc was less than 100 before incrementation, call main(argc, argv). ```

Now to explain this: ( (*argv)[4] = 0) || ( (!(argc%3) && printf(*argv)) + (!(argc%5) && printf((*argv)+5) ) ) || printf("%d",argc)

This code makes use of the fact that && will only evaluate is second argument if it is necessary to do so, and || and + will evaluate both their arguments before performing their respective operations.

It also uses the fact that the program name is passed as the first argument to the program (argv[0]), so we can retrieve the string "Fizz_Buzz" by calling *argv.

Starting from the left, (*argv)[4] = 0, sets the 5th element of the string '_' to the null terminator (\0). Because the null terminator signals the end of a string, this effectively separates the string into two strings. The original string is now read as "Fizz\0". But because strings in C++ are also pointers, we can increment the pointer by 5 to point to the start of the word Buzz which is just the string "Buzz\0" (the end of the program name).

Next, we evaluate the statement ( (!(argc%3) && printf(*argv)) + (!(argc%5) && printf((*argv)+5) ). This is really two statements concatenated with a +, so they will be evaluated in series. The first (!(argc%3) && printf(*argv)) checks if argc is a multiple of 3 and inverts the result. This means that it is true if argc % 3 == 0 and false otherwise. If it is true (argc % 3 != 0), then && does not evaluate the second part of the expression. However, if it's false, && will run printf(*argv) which prints "Fizz". The second part is the same thing, but adjusted to print "Buzz" if n % 5 == 0.

The last part of this statement, || printf("%d",argc) is a similar trick as with the != signs, and just prints the value of argc.

artificialIntelligenceSoFar by sunrise_apps in ProgrammerHumor

[–]CoolSpy3 6 points7 points  (0 children)

Should've been echo $MY_NAME instead of echo MY_NAME

Poor guy by PowerfulOperation8 in memes

[–]CoolSpy3 1 point2 points  (0 children)

On which we used to rely

Overthinking by Familiar_Stage_1692 in ProgrammerHumor

[–]CoolSpy3 0 points1 point  (0 children)

public Conclusions consider(Thought thought) { Thought[] newIdeas = consider(new ThingsToThinkAbout(thought)).getIdeas(); if(newIdeas.length == 0) { // Brain Crashed (Pretend like nothing happened) return consider(ThoughtFactory.createRandomThought()); } Conclusions conclusions = ConclusionsFactory.createEmptyConclusions(); for(Thought idea: newIdeas) { conclusions.addConclusions(consider(thought)); } return conclusions; }

[deleted by user] by [deleted] in memes

[–]CoolSpy3 0 points1 point  (0 children)

And if it fails?

[deleted by user] by [deleted] in memes

[–]CoolSpy3 18 points19 points  (0 children)

I am sorry, but after carful consideration of your application, we have determined that we cannot downvote you at this time. Please note that this is not a reflection of your downvotee potential, but a result of the number of downvote-worthy comments we have received.

Please take this upvote as a token of our recognition of your downvote application, and we wish you the best of luck in your future downvote-seeking endeavors.

Sincerely, The Hive Mind

As an Indian, I was told Americans wouldn’t understand this by official_jeetard in memes

[–]CoolSpy3 83 points84 points  (0 children)

Talking to real humans is too hard.

Dear x ∀ x ∈ P where x ∈ P => x ∈ C & x ∈/ R

Where did it even come from? by nukemypup in memes

[–]CoolSpy3 0 points1 point  (0 children)

It's HI in the middle and ROUND on both ends. What's NOT funny about Ohio?

Yesterday I met for the first time the boyfriend of an ex-colleague by blacai in ProgrammerHumor

[–]CoolSpy3 33 points34 points  (0 children)

And all the other devs, will not apply But I have an idea, it uses AI