pouët.net

V2m file duration

category: code [glöplog]
@ Saga Musix: And you think I understand it better with a debugger? And yes, I read almost the complete article.
added on the 2013-03-17 17:42:55 by Freefall Freefall
Hint:

Dim usecsVal As Double = usecs(0) * 256 + usecs(1) * 256 + usecs(2) * 256 * 256 + usecs(3) * 256 * 256 * 256

Wrong.
added on the 2013-03-17 17:43:27 by kb_ kb_
The other way round?

Dim usecsVal As Double = usecs(0) * 256 * 256 * 256 + usecs(1) * 256 * 256 + usecs(2) * 256 + usecs(3)
added on the 2013-03-17 17:47:02 by Freefall Freefall
:D
added on the 2013-03-17 17:48:35 by Freefall Freefall
No, it's the right way around. Just take step back, look at the line and then look stlightly to the side so it's in the corner of your eye. You can really make out the mistake quaite easily if you don't stare too hard. :)
added on the 2013-03-17 17:48:46 by kb_ kb_
Also remember what you said: Sometimes the result is a little off. Knowing your symptoms is important.
added on the 2013-03-17 17:50:02 by kb_ kb_
perhaps the "*256" vals are wrong :D Dunno ... ^^
added on the 2013-03-17 17:52:07 by Freefall Freefall
Please stop throwing breadcrumbs :D
added on the 2013-03-17 17:53:14 by Freefall Freefall
That's the only way you learn it. Compare your code to Gargaj's. And more importantly, understand your code. You should know why the *256 is wrong.
And yes, a debugger would help you because you can quickly just step through the program and check all variable contents and compare them to expected values. Some people consider MessageBoxes to be just as good as real debugger, so make your choice.
No, this is called "teaching". Seeing a very obvious error in something you've written youself is much more valuable than correctly estimating the lenght of songs in an obsolete-since-10-years format. :P

But here's another idea: Delete the line and type it again WITHOUT copying. Chances are it'll work then. And if it does, compare the old and new line.
added on the 2013-03-17 17:55:45 by kb_ kb_
Another useless breadcrumb: Funny, when you reversed the order above you didn't make the mistake that was in the original line. Also, you get maxtVal and fractVal right. Again, compare. Seriously.

added on the 2013-03-17 17:57:25 by kb_ kb_
usecs(0) * 256
added on the 2013-03-17 18:01:29 by yumeji yumeji
take it as a lil sunday afternoon gift. ;)
added on the 2013-03-17 18:03:19 by yumeji yumeji
OMG :D usecs(0) doesn´t need the factor^^ shit :D yumeji this was more helpful as the others together :P big thanks, you save my time :)
added on the 2013-03-17 18:07:47 by Freefall Freefall
Quote:
big thanks, you save my time


And this is why he wasn't helpful at all. Seriously, YOU should have seen this.
added on the 2013-03-17 18:09:42 by kb_ kb_
And you never have overseen something? :) This has nothing to do with learning.
added on the 2013-03-17 18:12:34 by Freefall Freefall
You still don't understand what kb trying to teach you.
That's why I told you to simply rewrite that line - that's eg. one of the things I've learned when you keep staring at something very simple that wouldn't work.

Also, a debugger would have shown you that the last 8 bits of usecsVal are always 0 despite usecs(0) being non-zero.

And the "corner of the eye" thing is another simple technique - the whole line follows a pattern. Which the *256 at the beginning broke. It kind of stares you into the face.

OR you could have simply compared the line to the other lines with the other values, like I said. Or when I said that your reverse line was correct apart form being reversed - hey, reverse it again!

But no, you just sat there, unwilling to let the least bit of knowledge enter your think skull, Mr. "I don't know bit shift operators yet and that's ok with me", and in effect wasted everyone else's time. Which you'll probably do again and again and again as soon as something doesn't work because you're so reluctant to grasp what the heck it is that you're doing. Well, thank you but no thanks.

added on the 2013-03-17 18:19:46 by kb_ kb_
to redeem myself from the << thing previously!

IMO this is a very confusing way to tackle it.

this might work better http://www.dotnetperls.com/binaryreader-vbnet

it allows you to read direct into the right variable types and should will get rid of the endian issues caused by reading into a byte array and parsing it yourself.
added on the 2013-03-17 18:24:44 by Canopy Canopy
thank you @kb. i like not to be "helpful". but in terms of prove reading and marking mistakes it's the same behaviour of a teacher. i did post the solution. so what?!? ;)
added on the 2013-03-17 18:34:10 by yumeji yumeji
*didn't post
added on the 2013-03-17 18:34:44 by yumeji yumeji
@kb_: Just stop with your path of Anger and listen to me. You told me to use a Debugger, well I did and you know what happened?? I had no idea where to read the informations because of lack of Debugger knowledge! Great. Very helpful. This has nothing to do with the will to learn! You just think everybody on this planet has the SAME KNOWLEDGE as you, and you will soon recognize that this is not the case! THINK about that when you are cooled down.
added on the 2013-03-17 18:59:57 by Freefall Freefall
BB Image
added on the 2013-03-17 19:17:40 by kbi kbi
Dude, we all have to start somewhere. Obviously most people don't have a clue the first time they use a debugger. But if you don't start using a debugger just because you don't know how to use it, how will you ever be able to use one when you need it? Noone gets better at programming and debugging by doing nothing. Your own initiative at finding solutions to your problems is always important.

login