Jump to content

pzt

Member
  • Posts

    179
  • Joined

  • Last visited

Reputation Activity

  1. Like
    pzt got a reaction from RaidenLeeChin in [Home Business] Online Small Business   
    Go for it sorry for the late reply
  2. Like
    pzt got a reaction from McMurderMonkey in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  3. Like
    pzt got a reaction from felixbearpig in ideas that I can "girl-ify" a caselabs S3   
    Just got my Gf a Case-labs Mercury S3 like mine but white, and trying to come up with some ways to to make it girly for her.
    Im pretty sure to my knowledge there are zero things with pink led's in them (like fans) so I was thinking purple would be the next best bet.
     
    lol idk what im doing any tips!? I mean mine is like murdered out but that's guy-ish.
  4. Like
    pzt got a reaction from Vitalius in Any experienced coders that could help with a bit of optimization?   
    Hey thanks for the response! and no worries, I know its a big bite of code, most people may not have time to look over, but thought maybe if i could actually cut it down i might win
  5. Like
    pzt got a reaction from Vitalius in Any experienced coders that could help with a bit of optimization?   
    Hey guys, this may be a bit much to ask, but here goes nothing.

    for one of my final assignments at uni we were asked to write a program to implement a memory management algorithm. Needless to say my program is working perfectly,
    but also part of the assignment (our last chapter was on optimization) was the shortest most optimized code gets the best grade in the class.

    My program as far as i know is pretty streamlined for what it does, but I was wondering if any of you guys could maybe look at it and see if I could cut back somewhere. Like for example I would like to get rid of some of the small methods like bestFit but I can't really figure out a way to so far that passes my test cases.

    any help is greatly appreciated! (if not thats cool to i know it is alot of code to look over, just a little challenge i suppose)
    If you dont wanna help just rage and ill take down the post, just looking for a few tips maybe that could help me shorten it.
    import java.util.*;public class BuddySystem{ public static void execute(Memory memory, String[] processes){ ArrayList<Process> allProcesses = new ArrayList<Process>(); ArrayList<Integer> processMemory = new ArrayList<Integer>(); ArrayList<Integer> memoryTime = new ArrayList<Integer>(); allProcesses.add(new Process(0, 1024, false)); int processCount = 0; //---------------------------------------------------------------------------------------------------------------------- // first split up the strings and add them too the block object //---------------------------------------------------------------------------------------------------------------------- for(int i = 0; i < processes.length; i++){ String [] splitProcess = processes[i].split(","); processMemory.add(Integer.parseInt(splitProcess[0])); memoryTime.add(Integer.parseInt(splitProcess[1])); } //---------------------------------------------------------------------------------------------------------------------- // Execute the main while loop //---------------------------------------------------------------------------------------------------------------------- while(!processMemory.isEmpty() || occupiedBlocksExist(allProcesses)){ //while pending requests / occupied blocks in memory for(int i = 0; i < allProcesses.size(); i++){ if(allProcesses.get(i).getOccupied()){ //if there is an occupied block allProcesses.get(i).reduceTime(); //decrease the time by 1 if(allProcesses.get(i).getTime() == 0){ //if the occupied blocks time is 0 memory.deallocate(allProcesses.get(i).getProcess()); //remove the block allProcesses.get(i).setOccupied(false); //that spot is no longer occupied allProcesses.get(i).setProcess(0); //mark the process as 0 so we know its done allProcesses = reAllocate(allProcesses); //reallocate the memory to recreate larger blocks } } } for(int i = 0; i < processMemory.size(); i++){ int pendingRequest = processMemory.get(i), processTime = memoryTime.get(i); int bestFit = bestFit(pendingRequest), startPosition = 0; boolean canBeAllocated = false; for(int x = 0; x < allProcesses.size(); x++){ if(allProcesses.get(x).getProcessMemory() >= bestFit && !allProcesses.get(x).getOccupied()){ canBeAllocated = true; startPosition = x; break; } } if(canBeAllocated){ boolean availableHole = false; while(!availableHole){ if(allProcesses.get(startPosition).getProcessMemory() == bestFit){ availableHole = true; processCount++; allProcesses.get(startPosition).setProcess(processCount); allProcesses.get(startPosition).setTime(memoryTime.get(0)); allProcesses.get(startPosition).setOccupied(true); int start = findStart(startPosition, allProcesses); memory.allocate(processCount, processTime, start, bestFit); processMemory.remove(0); //remove the process's memory from the beginning of the processMemory array list memoryTime.remove(0); //remove the process's time from beginning of the memoryTime array list i--; } else{ allProcesses.get(startPosition).setSize(allProcesses.get(startPosition).getProcessMemory()/2); allProcesses.add(startPosition + 1, new Process(0, allProcesses.get(startPosition).getProcessMemory(), false)); } } } else{ break; } } } } //---------------------------------------------------------------------------------------------------------------------- // Connect blocks back together not in use //---------------------------------------------------------------------------------------------------------------------- public static ArrayList<Process> reAllocate(ArrayList<Process> allBlocks){ for(int x = 0; x < allBlocks.size()-1; x++){ if(allBlocks.get(x).getProcessMemory() == allBlocks.get(x+1).getProcessMemory()){ if(!allBlocks.get(x).getOccupied() && !allBlocks.get(x+1).getOccupied()){ allBlocks.remove(x+1); allBlocks.get(x).setSize(allBlocks.get(x).getProcessMemory()*2); x = -1; } else{ x++; } } } return allBlocks; } //---------------------------------------------------------------------------------------------------------------------- // Find out if there are occupied blocks //---------------------------------------------------------------------------------------------------------------------- public static boolean occupiedBlocksExist(ArrayList<Process> occBlocks){ for(int x = 0; x < occBlocks.size(); x++){ if(occBlocks.get(x).getOccupied()){ return true; } } return false; } //---------------------------------------------------------------------------------------------------------------------- // Find the best fit //---------------------------------------------------------------------------------------------------------------------- public static int bestFit(int processMemory){ int temp = 1024, minSize = 32; int bestFit = 0; while(temp >= minSize){ if( processMemory > temp/2){ bestFit = temp; break; } else if( processMemory == temp/2){ bestFit = temp/2; break; } else{ temp = temp/2; } } return bestFit; } //---------------------------------------------------------------------------------------------------------------------- // Figure out where to place the new block //---------------------------------------------------------------------------------------------------------------------- public static int findStart(int location, ArrayList<Process> list){ int start = 0; for(int x = 0; x < location; x++){ start += list.get(x).getProcessMemory(); } return start; } } class Process { int trueValue, process, time; boolean occupied; public Process( int currentProcess, int processMemory, boolean isOccupied){ process = currentProcess; trueValue = processMemory; occupied = isOccupied; } void setOccupied(boolean occ){ occupied = occ; } boolean getOccupied(){ return occupied; } int getProcessMemory(){ return trueValue; } void setSize(int processMemory){ trueValue = processMemory; } int getProcess(){ return process; } void setProcess(int incomingProcess){ process = incomingProcess; } void reduceTime(){ time--; } int getTime(){ return time; } void setTime(int memoryTime){ time = memoryTime; } } thanks again for any help!
  6. Like
    pzt got a reaction from hiyayhi in Noctua Caselabs S3 Build   
    Thanks man mee too, Like i said Everything I had was from the bigger original build so when i got my s3 I had to cram everything down into it, and that wasnt much fun! Plus going from that huge switch 810 i was not aware how hard it was going to be to work in such a tiny case.
     
    Soooo much more space now that it is aircooled!
     
     
    do appreciate it Chatzev!
  7. Like
    pzt got a reaction from Chatzev in Noctua Caselabs S3 Build   
    Thanks man mee too, Like i said Everything I had was from the bigger original build so when i got my s3 I had to cram everything down into it, and that wasnt much fun! Plus going from that huge switch 810 i was not aware how hard it was going to be to work in such a tiny case.
     
    Soooo much more space now that it is aircooled!
     
     
    do appreciate it Chatzev!
  8. Like
    pzt got a reaction from Edgecube231 in Noctua Caselabs S3 Build   
    After having my old computer for like 6 months I decided I didnt like it because it was just to big for me, so then I downsized to mini-itx, watercooled it, then after a few more months i decided watercooling just wasnt for me. I had some troubles here and there watercooling, and I think that really spoiled the whole experience for me, plus after a while I just decided the pump and such was just a little on the loud size. Also, I got sick of the theme so here I am now. Completely silent, sexy looking great performing Caselabs S3 Aircooled!
     
    This is my Progression and I couldnt be happier:


     
    To my S3 but same watercooling parts:



     
    To what i Have now which is the real star of the show:





     
    The parts are:
    Evga Stinger Z77
    GTX 680 (Still relavent)
    i7 3770k
    16gb corsair Vengance w/ EK memory module heatsink
    Seasonic 860W Platinum (custom sleeved cables)
    7 Noctua NF-S12A FLX
    Samsung EVO 120gb ssd
    And the heatsink is Prolimatech Genisis
  9. Like
    pzt got a reaction from alpenwasser in Noctua Caselabs S3 Build   
    After having my old computer for like 6 months I decided I didnt like it because it was just to big for me, so then I downsized to mini-itx, watercooled it, then after a few more months i decided watercooling just wasnt for me. I had some troubles here and there watercooling, and I think that really spoiled the whole experience for me, plus after a while I just decided the pump and such was just a little on the loud size. Also, I got sick of the theme so here I am now. Completely silent, sexy looking great performing Caselabs S3 Aircooled!
     
    This is my Progression and I couldnt be happier:


     
    To my S3 but same watercooling parts:



     
    To what i Have now which is the real star of the show:





     
    The parts are:
    Evga Stinger Z77
    GTX 680 (Still relavent)
    i7 3770k
    16gb corsair Vengance w/ EK memory module heatsink
    Seasonic 860W Platinum (custom sleeved cables)
    7 Noctua NF-S12A FLX
    Samsung EVO 120gb ssd
    And the heatsink is Prolimatech Genisis
  10. Like
    pzt got a reaction from hiyayhi in Noctua Caselabs S3 Build   
    After having my old computer for like 6 months I decided I didnt like it because it was just to big for me, so then I downsized to mini-itx, watercooled it, then after a few more months i decided watercooling just wasnt for me. I had some troubles here and there watercooling, and I think that really spoiled the whole experience for me, plus after a while I just decided the pump and such was just a little on the loud size. Also, I got sick of the theme so here I am now. Completely silent, sexy looking great performing Caselabs S3 Aircooled!
     
    This is my Progression and I couldnt be happier:


     
    To my S3 but same watercooling parts:



     
    To what i Have now which is the real star of the show:





     
    The parts are:
    Evga Stinger Z77
    GTX 680 (Still relavent)
    i7 3770k
    16gb corsair Vengance w/ EK memory module heatsink
    Seasonic 860W Platinum (custom sleeved cables)
    7 Noctua NF-S12A FLX
    Samsung EVO 120gb ssd
    And the heatsink is Prolimatech Genisis
  11. Like
    pzt got a reaction from Arclite in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  12. Like
    pzt got a reaction from legobuilder in Yet Another Sw 810 Build [pathogen]   
    Thanks guys I know it's not super over the top or anything but to me it's AWESOME :D
  13. Like
    pzt got a reaction from legobuilder in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  14. Like
    pzt got a reaction from Hunter259 in My Story - How I Became A "professional Unboxer"   
    looks like a vhs :D hahah!
  15. Like
    pzt got a reaction from Adam the Grim in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  16. Like
    pzt got a reaction from bootleggerzero in ** CLOSED ** HUGE Computex Giveaway Sponsored by WD and Steiger Dynamics   
    watched em all a few times, not fb or twitter tho :(
    Good luck all!
  17. Like
    pzt got a reaction from calebp123 in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  18. Like
    pzt got a reaction from Kuzma in My Story - How I Became A "professional Unboxer"   
    looks like a vhs :D hahah!
  19. Like
    pzt got a reaction from chirag.rh in Yet Another Sw 810 Build [pathogen]   
  20. Like
    pzt got a reaction from chirag.rh in Yet Another Sw 810 Build [pathogen]   
  21. Like
    pzt got a reaction from chirag.rh in Yet Another Sw 810 Build [pathogen]   
    Got the case the week it came out. Thought it was sweet, kinda hate it now but i finished my build like 4 months ago or so. Took a year to get all the funds to finish this project as coming by 3 grand plus as a college student is kinda hard! Hope you enjoy, tons of pics through the process!
     
    introducing:
                          Pathogen.
     
     
                                                                               
     
  22. Like
    pzt got a reaction from chirag.rh in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
  23. Like
    pzt got a reaction from joshuamurphy in My Story - How I Became A "professional Unboxer"   
    looks like a vhs :D hahah!
  24. Like
    pzt got a reaction from Galarix in Anyone know when those new bitfenix cases are coming out?   
    About to downsize and making up my mind on what case to get and that computex vid linus posted about the new bitfenix cases was nice.
    I especially like the Phenom M and would like to know if anyone knows when it will come out!?
     
    thx peeps
  25. Like
    pzt got a reaction from bottenfield125 in Yet Another Sw 810 Build [pathogen]   
    As you can see i Swapped parts a few times because I wanted to make sure it was just right!!!
    Also I have yet to use the ram dominators, they dont fit on the platinums -____- Anyways here are some finalized pics!  
     
     

     

     

     

     

     

     

     
     
    And thats pretty much that! Hope you like!
     
×