Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. rotovegasBoy

    Counting Bits

    ...that bit set. with control statements my code becomes unsigned int foo; int mask = 0x00000001; int bit; int bitcount = 0; for(bit = 0; bit < 32; bit++) { bitcount += foo & mask >> bit; mask = mask * 2; } &quot;There are no stupid questions, just lots of inquisitive idiots&quot; - anon
  2. rotovegasBoy

    Counting Bits

    no control? my solution would be something like unsigned int foo = ???; int bits = 0; bits = (foo & 0x00000001) + ((foo & 0x00000002) >> 1) + ((foo & 0x00000004) >> 2) + ((foo & 0x00000008) >> 3) + ((foo & 0x00000010) >> 4) + ((foo & 0x00000020) >> 5) + ... printf(&quot;There are %d 1's in...
  3. rotovegasBoy

    Networking issue.

    yep vnc, we use it at work a lot to remotely access a pc on a hardware bench from our desks. its kindof clunky over a regular 10/100 network with the usual amount of office traffic but if you've got a 1Gbps link it should work like a dream. also there are linux implementations for it, not sure...
  4. rotovegasBoy

    Interesting problem involving binary trees

    Turns out my problem is the same as what happens in a cpus cache where lookups have to be done on code address but entries need to be selected for removal occasionally, anybody got any useful algorithms/implementations for this purpose. &quot;There are no stupid questions, just lots of...
  5. rotovegasBoy

    What is Linux's Answer to Pallidium

    Open source software and security has always been an interesting combination. Microsoft would have us believe that because its open source it gives hackers an oportunity to exploit errors in the code. While this is true it gives maintainers many sources of feedback its almost a question of whats...
  6. rotovegasBoy

    Interesting problem involving binary trees

    Before I start I will point out that rather than some programming problem from a course this is something I've run into at my job and any solution posted might get put into an actual product. Hopefully I'll be sufficiently vague to avoid any intelectual property issues. Here we go. There is a...
  7. rotovegasBoy

    Unsigned types

    basically what i'm trying to do is have output like binary: 11111111111..... hex: FFFFFFFF decimal: 49388222 (whatever it is) not -123445677 but from looking at things i dont think that java does it. also the java.lang.Math class cant be extended because its final (i tried it with java 1.2...
  8. rotovegasBoy

    cursor positioning command

    theres the ncurses package available for most unix/linux distributions and i've seen a port for the cygwin windows based environent might be worth a look but a lot of these are not very portable. &quot;There are no stupid questions, just lots of inquisitive idiots&quot; - anon
  9. rotovegasBoy

    Unsigned types

    Hi Write embedded systems and have a lot of use for bit masks shifting etc. I wrote a java app that acts as a calculator and can take a hexadecimal number and tell me what bits are set i've added masking and shifting etc. What i what to do is get the output in decimal as well as hex but of...
  10. rotovegasBoy

    File systems

    I guess this isn't really the best place for this question but I couldn't find a better one. I work for a company that makes embedded systems one of our new products is going to have removeable compact flash. To facilitate portability between our product and others we wish to implement a FAT...
  11. rotovegasBoy

    a curly one

    looks like it was a compiler optimisation thing that had more to do with registers than it did with shifting. thanks Chris Packham If a tree falls in the woods and it hits Bill Gates does anyone care?
  12. rotovegasBoy

    a curly one

    Bit of clarification all the numbers used are unsigned, and no i cant print out the values because its in a kernel routine so if i printed them out i'd get a whole heap of mess. Chris Packham If a tree falls in the woods and it hits Bill Gates does anyone care?
  13. rotovegasBoy

    a curly one

    ...bits of upper which have been shifted right 28 bits so the resultant number looks like this: 0xULLLLLLL. theres the code wee're using now /*assume upper and lower have been loaded correctly and declared*/ lower = lower >> 4; upper = upper << 28; result = lower + upper; return result; Is...
  14. rotovegasBoy

    something to get back on track

    I agree that Linux (or a descendant of it) will be around for years to come. NT doubtful, will Whistler (MS's new network/internet OS) even make much of a difference or will it be a spectacular failure like web tv. Maybe its time hardware vendors started taking notice. Certainly most vendors...
  15. rotovegasBoy

    Import my class

    if it is in the same directory doing what frag said is fine. things get complicated when you start using packages if you really want to know about using packages have a look at http://java.sun.com Chris Packham kriz@i4free.co.nz A thousand mokeys at a thousand machines, it happened, it got...
  16. rotovegasBoy

    frames and panels

    Java in general is slower than other languages because it runs on a virtual machine. This has a positive side in that the same class you compiled on your windows pc can be run on a linux pc or a mac provided they have the relevant java virtual machine for their platform. The downside is that...
  17. rotovegasBoy

    Help Chess Game

    You had to pick chess. Good luck if you want to implement a computer player. I haven't actually done this but the general design would go something like this: a board would be a 2 dimensional array (8 by 8, unless you want to do something different) of your superclass piece. Free spaces would...
  18. rotovegasBoy

    Destroying Objects

    Um well java is supposed to do garbage collecting automatically so as soon as you no longer use an object it should disappear from memory. What i've found is that java waits until the cpu utilisation goes down below a threshold before it does its garbage collecting, but java uses so much memory...
  19. rotovegasBoy

    JTextArea is Problematic

    i think theres also a JTextPane which provides better functionality than a JTextArea. It is for some more whizzy word processing stuff but it may be better if your text is really huge have a look at http://java.sun.com/j2se/1.3/docs/api/index.html for more details. Also with you JScrollPane...
  20. rotovegasBoy

    UML and C (not C++)

    thanks pete. Has anyone actually done it on a real system? What happened would you do it again? Chris Packham kriz@i4free.co.nz A thousand mokeys at a thousand machines, it happened, it got called the internet.

Part and Inventory Search

Back
Top