« first day (1664 days earlier)      last day (1962 days later) » 

4:33 AM
@Kamiccolo I've written a USB sniffing program that tries to understand HID reports without having the descriptors :D
 
 
12 hours later…
4:41 PM
Hello. I'm trying to learn to solve competitive programming problems and I've started from an easy one but the answer on my own compiler is different from the compiler of the HackerEarth website, could anyone please help me? Here's my code: pastebin.com/GQHuwrL7 And Here's the website page of the problem: hackerearth.com/practice/basic-programming/input-output/…
 
@Moytaba Soooo... what's exactly the issue?
 
@Kamiccolo Input LLRDDR prints 0 -2 for me(on my computer) which is correct but the website compiler says my code prints -1 -2 and so the test fails.
I copy and paste the exact same thing there and choose C as the language. IDK what's wrong with it.
 
Well, sample output on the page clearly states 0 -2
 
4:57 PM
I swear it says -1 -2 for me :|
 
@Moytaba You said vice versa :P
soooo... have You tried debugging Your stuff? What exactly compiler are You using? Architecture?
 
@Kamiccolo I don't know what I said vice versa sorry my native language isn't English. I'm using WSL and my gcc is: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
 
what's WSL?
$ ./a.out
LLRDDR
0 -2
 
It's a linux distribution of Ubuntu made by Microsoft. It's exactly an Ubuntu. It's not a virtual machine. I'm on Windows 10. Disk drives are mounted on this system in /mnt directory. It's weird for me but It's nice. :)
@Kamiccolo Ok that's exactly what I get. But when I click the blue button "Compile & Test" on the website it says my code printed -1 -2 which is wrong!
 
mhm
Somehow it skips first L
 
5:12 PM
I don't know how everyone else has passed it :D
 
5:44 PM
@Moytaba aaaaa, strlen() does not include \0!
so, You're counting chars from 0 and excluding the last character.
 
6:13 PM
112
Q: How exactly does tail recursion work?

Alan CoromanoI almost understand how tail recursion works and the difference between it and a normal recursion. I only don't understand why it doesn't require stack to remember its return address. // tail recursion int fac_times (int n, int acc) { if (n == 0) return acc; else return fac_times(n - 1, ...

 
 
3 hours later…
8:57 PM
I'm thinking of using this summer to go deeper and learn C/C++, which should I start with first If I already know Java/C# (and higher level languages like JS, PHP and Swift, etc).
 
Hey,

I am building on my understanding of systems stuff in general. I know what when I compile in a shared library, the ELF table contains entries to the shared library. My question is:

Is it the operating system's ELF support that actually mmaps in the shared library, or is code added to my compiled binary by the linker to do this? If so, does this happen before _start()?
 

« first day (1664 days earlier)      last day (1962 days later) »