|
|
Don't see what XAML has to do with it. I write C# to interface with hardware, do a lot of bit manipulation, and I've never used XAML in my life.
|
|
|
|
|
Who tests the testers?
There are two really easy ways to find out whether or not someone can code - either look at their code and/or talk to them about code.
Tests like this are really silly as you might do stuff like this all the time (unlikely as it is that you'd do it in C#) or it's going to be totally alien to you.
Slogans aren't solutions.
|
|
|
|
|
This is basic programming stuff. They want to see if you can do the math.
Do you know what the answer is?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I could see at a glance that it wasn't 42, so I lost interest.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
There are probably about 1,431,677,610 things I can think of that are more basic than that!
Slogans aren't solutions.
|
|
|
|
|
I know it is shifting value and what the flags are but in a limited time test I am not going to do a math on paper just to answer one correct answer and leave the rest of questions which has higher penalty if not completed.
After coming home I did it first just to make sure what I selected was OK.
Home | .NET Fiddle[^]
I am happy that I passed the test but hard to tell if one really know all the concepts just by looking at score.
Zen and the art of software maintenance : rm -rf *
Maths is like love : a simple idea but it can get complicated.
|
|
|
|
|
John Simmons / outlaw programmer wrote: Do you know what the answer is? Yes.
How did that code pass our code-review?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Indeed. Lines 2-4 are obsolete. How inefficient!
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
John Simmons / outlaw programmer wrote: This is basic programming stuff. Only for those who have a notion what the processor actually does.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Which is basic knowledge for us old guys.
I haven't personally seen any (production) .Net code that uses shift left/right, but its use was somewhat frequent in some unmanaged C++ code I've been involved with.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Just read and convert the input from some binary file format and then press it into .Net structs/object. As soon as you leave the beaten path of serializing/deserializing from and to XML, you will have to do a good share of bit twisting.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
I had to use bit shifts when I built an email processor to manually decode Base64 to regular binary. The non-programmers gave me puzzled looks when I described it as bit-twiddeling.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
I've seen lots of bitshifting in c#. Very common in image processing.
|
|
|
|
|
For what it's worth, I've got some production C# code that handles TCP/IP communications that uses << and >> on occasion for endian-ness conversions, bit field extraction, and so on.
Software Zen: delete this;
|
|
|
|
|
I'd have to rack my brain to do this.
Not that I don't know how, it's just been over 10 years since I last had to do bit shifting.
No doubt someone fresh from college would do it off the top of their head because it's only been 6 months for them and would give them an advantage in test conditions.
|
|
|
|
|
What is this supposed to be testing? Programming ability or knowledge of C# / C++ / whatever other language share this syntax?
It looks like this is trying to testing the latter and is not hugely usefull. If you can get the correct answer then that is great, if not then that does not mean anything.
If this is testing for programming language knowledge then this is potentially usefull.
(and yes, I can work this out - assuming the correct answer is 0x5555AAAA.)
|
|
|
|
|
Knowing how to code C# syntactically, doesn't mean sh*t in the real world, in and of itself.
I am more interested that my fellow engineers know how to solve complex problems, and you can't really take a f***ing test for that, now can you.
I am strongly against organized testing, as I have seen it prove nothing really, time and time again.
We have fired more Engineers from our shop because they could not design, let alone implement, basic problem solving solutions, versus their ability to do basic C# fundamental tasks (you can learn this sh*t, duh).
I don't think you can learn problem solving, I think you are born with that - true problem solving.
In summary, syntax and code fundamentals you can learn (if they are not retarded), but problem solving is hereditary. I am more interested in one's ability to problem solve, then the proper way to concatenate a bloody string
|
|
|
|
|
Slacker007 wrote: I am strongly against organized testing Says the person who identifies themselves as a slacker.
It was broke, so I fixed it.
|
|
|
|
|
This misnomer is by design, because I am anything but a slacker, thus, the reason I chose this to be my online name. I also like James Bond films, and I am not bad-ass enough to be a super spy, so I threw in the "007" for good measure.
|
|
|
|
|
No insult intended, just found the irony between the statement and your online ID was humorous.
It was broke, so I fixed it.
|
|
|
|
|
S Houghtelin wrote: No insult intended
Did not take it as such.
Cheers.
|
|
|
|
|
Specifically:
Well, you get to look at it with a bit of perspective : Rshift followed by Lshift of the same amount simply introduces as much zeroes as in the the shift on the right of your initial number. This means the first three operations neutralize in this case. So you simply XOR the last four 5 with F, which gives A (A5 pattern is commonly used to test memory, since both are made up of alternating 0 and 1's, that are swapped when XORed with F, so result of F-XORed A5 is always 5A).
More generally:
This is testing your logic, and how you can use your brain to solve something. You will probably never use it if you do not do low level, but sometimes it helps to solve complex situations to have a analytic mind.
|
|
|
|
|
virang_21 wrote: Where in real world application am I going to use this ? Your question, young Padawan, tells me that close to the hardware you programmed have not yet. Look at a processor's instruction set you must and such logical instructions find you will. Learn to use them and address calculations and bit masking you fear must not.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
I once was asked in an interview to write a simple function, and later the interviewer asked me about two features he said he hadn't previously seen at all: one was 'Yoda conditions' and the other was designing the loop in such a way that the end condition was a comparison to 0.
The latter was based on the knowledge that in assembler, comparisons to 0 are typically slightly faster than comparisons to a constant. The former was to make the compiler shout out in case of an accidental typo (writing '=' rather than '==').
After a couple of days, I was told to be overqualified for the job
Nowadays, I'd do neither: the first is sufficiently covered by compiler warnings, the second is a kind of optimzation that a good compiler can usually do just as well, and often better. Moreover, not having to care about either makes it easier to write clean, readable code, and that is the most important thing in the long run.
I'm telling this because these kind of optimizations I used are just as obsolete nowadays as bit-twiddling, unless you really, really need to optimze your performance, and know for a fact (i. e. you have actually measured) that the compiler doesn't already optimize the code sufficiently. In C++ you can use bitfields; I am not sufficiently familar with C# to know what can be used here to provide a reasonably high-level API.
But, even if you do need bit manipulations, within a given project those should be encapsulated in just a handful of functions that take at most an hour or two to implement and test - so it's still entirely senseless to test a candidate on that kind of know-how
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|