Search:

Type: Posts; User: sci4me

Page 1 of 4 1 2 3 4

Search: Search took 0.19 seconds.

  1. Replies
    0
    Views
    257

    Mutex implementation

    Hey guys! So first of all, yes: I know about ReentrantLock as well as how to use Objects as "mutexes"... that is not the point. So anyway, I have implemented a mutex and it seems to work, but I'm...
  2. Thread: Get JVM Flags?

    by sci4me
    Replies
    2
    Views
    218

    [SOLVED] Re: Get JVM Flags?

    I did get this:


    ManagementFactory.getRuntimeMXBean()

    I got that after posting this however.

    You can consider my question answered.
  3. Thread: Get JVM Flags?

    by sci4me
    Replies
    2
    Views
    218

    [SOLVED] Get JVM Flags?

    Is there any way to get all the command-line flags for the JVM in my code? I.e. the -XX: flags as well as -server/-client ?
    If so, how?
  4. Replies
    2
    Views
    269

    VM Instruction Pipelining

    I apologize if this is not a great place to post this.

    So, I am doing a bit of learning about Virtual Machines. I am wondering about Instruction Pipelining in the context of a Virtual Machine.
    ...
  5. Replies
    1
    Views
    276

    Simple Bitwise Encoding and Reversing

    Sorry if wrong section / crap name.

    I have an index that is encoded as such:


    int idx = x << 11 | z << 7 | y;


    my question is: can i go from idx back to x, z, y?
    If so, how?
  6. Replies
    1
    Views
    179

    Replace unless inside quotes?

    Hey guys, sorry if this isn't the correct area for this.

    Basically, I am trying to write a method that will take a string, a target, and a replacement (a replacement function like...
  7. Replies
    1
    Views
    267

    Password hashing & Salts

    Hey guys! So, after a longer time than it should have taken, something clicked in my tiny little brain and I understood salts. Now, my question: are LARGE salts a bad idea? I don't see much...
  8. Replies
    18
    Views
    167

    Re: Numbers & Binary

    Oh I see... then.. how do you know which two bits are on... I mean, yes the 6 tells that but.. eh..
  9. Replies
    18
    Views
    167

    Re: Numbers & Binary

    This is what I have:


    boolean[] array = new boolean[3];
    for(int i=0; i<3; i++)
    {
    array[i] = (a & (1 << i)) != 0;
    }

    works beautifully. I figured this out by printing the result of the...
  10. Replies
    18
    Views
    167

    Re: Numbers & Binary

    This is what it's giving me now:



    0 [false, false, false]
    1 [true, false, false]
    2 [false, false, false]
    3 [true, false, false]
    4 [false, false, false]
    5 [true, false, false]
  11. Replies
    18
    Views
    167

    Re: Numbers & Binary

    Oh, derp. So, loop 3 times... right? That's giving me the same results.
  12. Replies
    18
    Views
    167

    Re: Numbers & Binary

    I think something just clicked in my brain :P
    I was forgetting that the pattern I need is binary... so .. essentially I just create a int to binary (in the form of a boolean array, only 3 bits)...
  13. Replies
    18
    Views
    167

    Re: Numbers & Binary

    Ok, that makes it a little clearer... but I still don't understand how it gives me my 3 booleans from the one int...
    I don't want to ask for code and wont (not that I expect it would be given...
  14. Replies
    18
    Views
    167

    Re: Numbers & Binary

    Hmm... I'm fairly new to this kind of logic... I haven't worked with this kind of thing very much. I kind of understood the pseudocode but really don't know how to write it... could you go more into...
  15. Replies
    18
    Views
    167

    Re: Numbers & Binary

    It takes an int, 0-7. Outputs a 3 long boolean array. The switch case pretty much explains what it does... If I rewrite the output for each input, you'll get essentially the switch case. I'll do it...
  16. Replies
    18
    Views
    167

    Numbers & Binary

    Hey guys. So, I have a piece of code that works:



    public static boolean[] sub(int a) {
    assert (a >= 0 && a <= 7);
    boolean uread = false, uwrite = false, uexecute = false;

    switch (a)...
  17. [SOLVED] Calculate milliseconds between two dates not counting weekends?

    I think the title says it all. I have two Date objects and I need to calculate the time between them in milliseconds not counting saturday and sunday.

    EDIT: nevermind, i got it
  18. Thread: FASTEST List

    by sci4me
    Replies
    10
    Views
    245

    Re: FASTEST List

    Ok, I have since realized that the LIFO is broken. I do want it to return and remove like an ArrayList.
    I forgot to mention, I do need duplicate entries...

    Looking into it a tish more, it seems...
  19. Thread: FASTEST List

    by sci4me
    Replies
    10
    Views
    245

    Re: FASTEST List

    Ah bloody hell, I have to stop deleting things. (oh yeah its on git.. oh well) Deleted the profiling code. Lets start from a different spot.

    First of all, my requirements:
    A collection that will...
  20. Thread: FASTEST List

    by sci4me
    Replies
    10
    Views
    245

    Re: FASTEST List

    Why worry about it.. well.. as much as I want to argue a point, I know that I cannot. :P

    Okay, when I say fast.. I dont care about indexes or where elements go... it doesn't matter whatsoever to...
  21. Thread: FASTEST List

    by sci4me
    Replies
    10
    Views
    245

    Re: FASTEST List

    I'm not really noticing issues (yet). I will be adding/removing a LOT. I don't care about indexes or ordering.

    I wrote an implementation of exactly what I need which, with a bit of testing, seems...
  22. Thread: FASTEST List

    by sci4me
    Replies
    10
    Views
    245

    FASTEST List

    I need a collection that I can add/remove to. Order doesnt matter at all. The only thing that matters is SPEED. Honestly, push/pop or even add/pop.. doesnt matter. Just different names for the "same"...
  23. Thread: API Hell

    by sci4me
    Replies
    4
    Views
    237

    Re: API Hell

    Perhaps I should word this better... My code will work with or without the interface, the interface is simply a way to add an "extra feature" to the class. It is not required for the class to...
  24. Thread: API Hell

    by sci4me
    Replies
    4
    Views
    237

    API Hell

    Hey guys. So, I am working in an environment where certain API's may or may not exist depending on the scenario. I have classes that implement certain interfaces from API's which might not always...
  25. Replies
    1
    Views
    358

    Re: value change listener dident call

    not sure about the code, but use [ code ] and [/ code ]
Results 1 to 25 of 79
Page 1 of 4 1 2 3 4