Page 10 of 21 FirstFirst ... 5678910111213141520 ... LastLast
Results 136 to 150 of 307

Thread: Coder's Hang-out

  1. #136
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by kohlrak
    One should worrry, it also goes through the processor like everything else. What if there is a faster way? Plus, i'm curious how they introduce forign things into it. The information could make things possible in the long run. Like calling VB functions from VB's OCX or whatever they are (their dlls i think they are) and using some of those functions. You don't see the point now, but think of it in other ways, such as, calling assembly code or doing things with C++ that directly mess with the hardware? Perhaps you want to make a program in C++ that overclocks or somthing like that. Or how about hardware drivers in C++! I thought that's what the << and >> was for anyway.
    Learn to code drivers, then. Some people do that, too, I can't help it that I'm not interested.
    Quote Originally Posted by kohlrak
    Well, there are alot of things that are... Plus, i keep trying to get it but i can never find the thing.
    The easiest thing would probably be for you to get Dev-C++, a graphical developer interface + minimal unix shell + gcc as compiler.
    Quote Originally Posted by kohlrak
    Processor processes the program, that means everything in it, therefor it reads what the OS says, therefor, assembly should have the last word even over the OS if the assembly code says so because it's send directly to the processor over the OS. We forget here, the processor is the computer itself and makes all the choices, the OS is just another program the processor calculates.
    Hey. I only said that you don't need to go down to assembly level to redefine some constanst. Or make any other working program, for that matter. There are many more optimalizations that could be made on higher levels, like replacing certain algorithms.
    Quote Originally Posted by kohlrak
    Yea you do... Unless you know of a program that could convert some other things back to C or C++ so we can optimise it.
    What I said above. Assembler is not the ultimate cure for slow speed. A crappy algorithm won't be any faster, even when it's written in ASM.


    Quote Originally Posted by kohlrak
    Exactly, therefor C is also object oriented.... Actually, with a little intellegence (and alot of hard to read code) you could actually use namespaces to as classes to do the same thing as objects. Only, you'd have to copy and paste the namespaces and rename them to make new objects. lol
    That also means, you could emulate object orientation in structured language... What scares me is those languages that don't use functions or objects. o.o i think VB's one of them. lol
    The thing is that by removing the extended functionality that C++ provides, you'd be having to make a lot of complex code syntaxes, making it hard to read. For example, due to lack of operator overloading, you'd always have to use certain functions, getting real ugly. That would kinda kick the concept of 'OOP being friendlier to use' in the nuts.

  2. #137
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pkt-zer0
    Learn to code drivers, then. Some people do that, too, I can't help it that I'm not interested.
    True..

    The easiest thing would probably be for you to get Dev-C++, a graphical developer interface + minimal unix shell + gcc as compiler.
    I have that... No offence, it sucks for practical use, i'd only use it to learn. Alot of code dosn't even work with it. Like wchar_t... Talk about unsupported...

    Hey. I only said that you don't need to go down to assembly level to redefine some constanst. Or make any other working program, for that matter. There are many more optimalizations that could be made on higher levels, like replacing certain algorithms.
    Be much easier... lol

    What I said above. Assembler is not the ultimate cure for slow speed. A crappy algorithm won't be any faster, even when it's written in ASM.
    Aye, but the perfect aligorithm can only be made in assembly.

    The thing is that by removing the extended functionality that C++ provides, you'd be having to make a lot of complex code syntaxes, making it hard to read. For example, due to lack of operator overloading, you'd always have to use certain functions, getting real ugly. That would kinda kick the concept of 'OOP being friendlier to use' in the nuts.
    Right, but still... C is OOP. That's the point i'm trying to make. lol Yes, it's not super good looking OOP like C++ but it's still OOP.

  3. #138
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by kohlrak
    Aye, but the perfect aligorithm can only be made in assembly.
    No. Algorithms are still just maths. I mean, that's a proper application for mathemathical knowledge, algorithm construction. It has nothing to do with coding.
    Implementing an algorithm, however, is another matter. And you wouldn't need to code that in assembler, either, if said C code would convert to the fastest possible ASM code.
    Quote Originally Posted by kohlrak
    Right, but still... C is OOP. That's the point i'm trying to make. lol Yes, it's not super good looking OOP like C++ but it's still OOP.
    Nope. C is a programming language, OOP is a programming method. It's like comparing apples and oranges. You could just as well say that ASM is OOP, since any code gets turned into machine code in the end.
    The methods provided by the C language were not meant to make object oriented programming easy, whereas those in C++ were. That's the difference.

  4. #139
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pkt-zer0
    No. Algorithms are still just maths. I mean, that's a proper application for mathemathical knowledge, algorithm construction. It has nothing to do with coding.
    Implementing an algorithm, however, is another matter. And you wouldn't need to code that in assembler, either, if said C code would convert to the fastest possible ASM code.
    Then C is the next best thing... Still not the best. The fastest algorithm really shouldn't be auto generated, which comes with compilers.

    Nope. C is a programming language, OOP is a programming method. It's like comparing apples and oranges. You could just as well say that ASM is OOP, since any code gets turned into machine code in the end.
    The methods provided by the C language were not meant to make object oriented programming easy, whereas those in C++ were. That's the difference.
    That'd be saying the only OOP one out there would be C++, while java is also on that list. I don't recall operator overloading and such in java. Then again never completed the tutorial... Anyway, C has objects, C has your functions, C has everything C++ has except maybe exceptions (not sure or not) and operator overloading. Other than that, you could easily convert C++ back to C.

  5. #140
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by kohlrak
    Then C is the next best thing... Still not the best. The fastest algorithm really shouldn't be auto generated, which comes with compilers.
    I was trying to point out that you can add the first n integer numbers either by

    a) a for loop that goes from 1 to n, and adds the current value to a variable, which then holds the correct sum by the end of the process.
    b) compute n*(n+1)/2.

    Both can be written in C and ASM, version b) is obviously faster, even if you write version a) is assembler.

    Quote Originally Posted by kohlrak
    That'd be saying the only OOP one out there would be C++, while java is also on that list. I don't recall operator overloading and such in java. Then again never completed the tutorial... Anyway, C has objects, C has your functions, C has everything C++ has except maybe exceptions (not sure or not) and operator overloading. Other than that, you could easily convert C++ back to C.
    I never said C++ was the only OOP language, I just said that C wasn't. Also, you don't have member functions in C (I think), but you can assign function pointers to member fields, and access functions indirectly that way. Also, as I said, no private fields in C, thereby screwing the data-safety concept of OOP.
    About Java... I pretty sure you could code your own objects there, as well. And that would mean that you wouldn't even need to use objects there, either. Not that you wouldn't want to use them, but still.

    So, you're still saying ASM is an OOP language as well? Since all code is machine code, in the end?

    Anyway, to illustrate my point further. Let's say you write a book about a given topic. You might still choose different styles to write it (prose or verse, etc.), but it would still be about the same topic. (Coding methods, OOP and SP, for example.)
    And on top of that, you might even write it in different languages (English, Spanish, etc.), but it would still mean the same thing, still use the same style. (Programming languages, like C, C++, Java, for example.)
    What you're saying is basically that Spanish is prose, and English is prose as well, whereas Spanish might be verse, too. See how absurd it is?

    On the other hand, one language might be better suited for some styles, rather than others.

  6. #141
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pkt-zer0
    I was trying to point out that you can add the first n integer numbers either by

    a) a for loop that goes from 1 to n, and adds the current value to a variable, which then holds the correct sum by the end of the process.
    b) compute n*(n+1)/2.

    Both can be written in C and ASM, version b) is obviously faster, even if you write version a) is assembler.
    But, b in assembly is faster than B in C.


    I never said C++ was the only OOP language, I just said that C wasn't. Also, you don't have member functions in C (I think), but you can assign function pointers to member fields, and access functions indirectly that way. Also, as I said, no private fields in C, thereby screwing the data-safety concept of OOP.
    About Java... I pretty sure you could code your own objects there, as well. And that would mean that you wouldn't even need to use objects there, either. Not that you wouldn't want to use them, but still.
    Yea, but it's just like C. (i think you can put member functions in structs, not sure... and actually... i think you can also make things private.

    So, you're still saying ASM is an OOP language as well? Since all code is machine code, in the end?
    If the code is built with OOP in mind yes. If you make classes and such (scary thought of doing that in asm) it would be. But... yea... It'd take quite a bit of coding for that. Just like C++ would be structered programming if you didn't use classes or structs.

    Anyway, to illustrate my point further. Let's say you write a book about a given topic. You might still choose different styles to write it (prose or verse, etc.), but it would still be about the same topic. (Coding methods, OOP and SP, for example.)
    And on top of that, you might even write it in different languages (English, Spanish, etc.), but it would still mean the same thing, still use the same style. (Programming languages, like C, C++, Java, for example.)
    What you're saying is basically that Spanish is prose, and English is prose as well, whereas Spanish might be verse, too. See how absurd it is?
    Prose? Well, not sure what you mean here. If you mean "better" then yes. It'd be easier to explain things in one language than another. But, ultimately, since these languages of programming were invented in english, English would be the ultimate choice to teach in.

    On the other hand, one language might be better suited for some styles, rather than others.
    Indeed...

  7. #142
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by kohlrak
    Yea, but it's just like C. (i think you can put member functions in structs, not sure... and actually... i think you can also make things private.
    Nope, no private fields. Here's the corresponding part of the C Standard. And also, no function declaration in structs, therefore no member functions. Just try compiling this both in C and C++:
    Download Links:
    Links are hidden from guests. Please register to be able to view these links. It shouldn't compile under C, at least standard C.

  8. #143
    Join Date
    Jan 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Why would anyone want to program in assembly anymore? Any speed losses from C/C++ (if there are any...) are negligible considering the portability, readability, and reusability of higher level code.

  9. #144
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    meh, of all things, i realized Microsoft word uses both OCX and DLLs. lol

  10. #145
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    hmm, I think I'm going to have to ask a question, at the moment, my morse code program has a menu that work from number presses, (unfortunatly it cuts out of the program if you do not select a correct program) also I have 3 sets of chars arrays in place (alphabet, numeric, and morse) The morse is set in sets of 4 (with spaces if the code is less then 4 characters long) I am curious how to get it so that it selects 4 charecters of morse from one letter? I'll try not to post my code as I don't Want an answer, just a few pointers

  11. #146
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    You mean, how to identify each letter with it's corresponding morse code?
    You could write a function (if you've learnt about them, that is), that does the conversion.
    Or, and I'd say this is simpler, have the character's ASCII codes identify the correct block of the morse code array. So that the code['o'] would store the "---" string, and code['s'] would store "...", and so on.
    Then you could simply just read the next character, and you'd immediately know the position of the corresponding morse code in the array.

  12. #147
    crusher's Avatar
    crusher is offline ↑ ↑ ↓ ↓ ← → ← → B A START
    Join Date
    Jun 2002
    Posts
    15,697
    Thanks
    3
    Thanked 22 Times in 17 Posts
    EP Points
    35

    Default

    Ok people, show some good inverse kinematics tutorials. I've looked at this one for a while now and I partly understand how it's done. But my math skills are almost completely gone so I kinda need some help here...

    The concept shown in the link above seems pretty easy, but I can't figure out for life how to calculate the angles in the triangle and how what to do after that... -___-

    Please help me!

  13. #148
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    c� = a�+b�-2ab*cos γ
    And you also have
    a/b = sin α / sin β

    A, B, C are vertices of a triangle, a, b, c are the edges opposite them, α, β, γ are the angles at the corresponding vertex.
    I do not know much about IK, but doesn't that mean something like that you have a few fixed joints, some moveable ones, the distance of the joints are set, and then you start moving a joint, and the rest move according to preset rules (joint's angle must not exceed certain limits, and so on)

  14. #149
    crusher's Avatar
    crusher is offline ↑ ↑ ↓ ↓ ← → ← → B A START
    Join Date
    Jun 2002
    Posts
    15,697
    Thanks
    3
    Thanked 22 Times in 17 Posts
    EP Points
    35

    Default

    Yeah you are pretty correct. This is a pretty darn good idea of what IK is and exactly what I'm trying to achive here:
    http://www.enedahl.com/index.asp?page=shockwave_ik

    Quite awesome if you ask me. Oh and thanks for the formulas. I'm sure they will help me when I try to decipher the "tutorial" I posted in my last post.

  15. #150
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Yep, I got it. Pretty neat. But, that it's being done in Shockwave shows that it's not too complex, thankfully. If free joints weren't connected to fixed ones, however, you'd have a bit more trouble than calculating triangles on your hand.

Similar Threads

  1. Visit The Hang Out!
    By Georgyw5k in forum Free 4 All
    Replies: 5
    Last Post: 28th-November-2003, 05:18
  2. Do You Hang Up On Advertisement Callers?
    By ((KvN)) in forum Free 4 All
    Replies: 52
    Last Post: 21st-July-2003, 11:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About Us

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social