Jump to content

WanderingFool

Member
  • Posts

    556
  • Joined

  • Last visited

Awards

This user doesn't have any awards

7 Followers

Profile Information

  • Member title
    Junior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The thing to note is moving from the standard 2d gates to a 3D structure requires more initial investment (R&D and building the factories, as they may require new equipment to be built). So while the initial cost of such products might be higher than consumer grade stuff, the fact the density decreases will have benefits to the consume *down the road*. The way to look at it is like, what is the major cost of making flash? It isn't the lithography, but the purified silicon wafers. So the more you can build out of a single wafer the cheaper things become. Although someone can correct me if I am wrong.
  2. Perhaps it's been too long since my algo classes and graph theory, but is there additional information for the problem? Say each location is a vertex, so you have n vertices. How are they connected? Are the edges (paths/roads) connecting two points a-b defined already/are there one way edges? I could be wrong, but I would imagine there might be a way to set this form of a question up as a flow network. If this could be setup as a flow network (in polynomial time), then it may be a polynomial time (Minimum-cost flow problem). I hope this helps, or at least sparks a bit of insight into the problem. If it is an NP problem, then I would just try thinking of a way to formulate it into a 3-sat...thus making it a np-complete problem
  3. I was hoping there would be some method like grub which would work, but I don't think it can. The issue is the 3 computers use different CPU architectures, so it isn't as simple as just installing it 3 times. My problem is one of the PC's doesn't have boot from network (needs to be esata), and the other doesn't have an internet connection.
  4. Hopefully someone can help me figure this out, as this is a bit of a different situation and I have been having troubles finding out if this would be possible. So to make the overall goal as short as possible the following is what I am trying to do: 1 ssd, 3 different computers with 3 different hardware specs (1 without internet access) The goal is to install ubuntu 14.04 onto 3 different partitions, and have it so each machine has a partition that it can boot from (manually selected by the user). Effectively my use case would be, I bring the SSD to the computer, plug it in via a dock and boot using the SSD and having something similar to GRUB to select the OS which was installed with that computer's hardware. My current setup is I have 4 separate drives, one drive for each computer which I bring along and a second data drive. I just want to consolidate them all into one drive though, so it is easier to carry around (I currently need to carry all 4 drives, as I cannot leave them at the computers where they boot from). (VM's are not an option either) Any help would be appreciated, as I am really at a lose of what to even google. I only really know about setting up dual boots, but nothing about trying to setup 1 harddrive that could be used to boot into multiple computers.
  5. The way I look at it, copyrights should only really belong to the entirety of the work and no API's. Yes you could make the argument that complex API's should be copyrightable, but my argument is it is about the implementation of the API's. Otherwise things like WINE would not exist (if Microsoft wished it)...or even emulators (they are emulating or reimplementing portions of the game hardware's API)
  6. Well in the case of getting trapped in walls, this actually starts getting into how you decide to implement your physics. You could make it so when you detect a collision when traveling right you only block moving right (and not left). With similar concepts for up and down. This actually means you could travel through walls if you are spawned inside of them (ie you don't get trapped). Another option would be to block the movement before you collide with a wall...ie. instead of using x, and y make a tempx and tempy which has the position if you were to move. tmpX = x + cos (angle) * speedtmpY = y + sin (angle) * speedif map (floor (((tmpX + size * 2) / wall) mod wall), floor ((tmpY / wall) mod wall)) = 0 and map (floor (((tmpX - size * 2) / wall) mod wall), floor ((tmpY / wall) mod wall)) = 0 then x = tmpXend ifif map (floor ((tmpX / wall) mod wall), floor (((tmpY + size * 2) / wall)) mod wall) = 0 and map (floor ((tmpX / wall) mod wall), floor (((tmpY - size * 2) / wall)) mod wall) = 0 then y = tmpYend if Something similar to that... Either way it will depend on how you decide you want your physics.
  7. So there are a few things regarding collision to be mindful of. The first is the width of the object, and the second is where the origin of the image is. e.g. is the x,y coordinate of the player actually the bottom left, center left, top left, bottom right, bottom center...etc. I will assume for this purpose the bottom left is the (x, y) coordinate of the player (you could adjust accordingly) So now this becomes a simple collision detection of rectangles. The important thing here is there are 4 points on a rectangle, and you currently are only checking a single point. So here is my pseudo code for it map(floor(x/width), floor(y/width)) == 1 //Wall collision at bottom left side//means you are going leftmap(floor((x+playerwidth), floor(y/width)) == 1 //Wall collision bottom right sidemap(floor(x/width), floor((y+playerwidth)/width)) == 1 //Wall collision at top left sidemap(floor((x+playerwidth), floor((y+playerwidth)/width)) == 1 //Wall collision at top rightside So really you need to check all 4 sides for the collision
  8. The passwords are actually hashed passwords, so the attacker would also need to brute-force to get the password. To be honest, I agree with Microsoft in that it is a bit overblown. The fact is the attacker would have to have to be inside your network in order to really do anything, and I bet there are countless other vulnerabilities you could exploit to do more damage.
  9. Well as SSL said, flood fill is probably the easiest (assuming you use recursion, personally I dislike using recursion on this type of problem because if you get 1000x1000 with all 0's you actually will end up with a stack overflow...but that is beside the point, since you are learning use recursion...and if you come up with a solution and have free time try implementing flood fill without recursion (using stacks)). To address the "color", "color" is just meant as a way to distinguish that you have already processing a point. So if you know the values inputted are always 0 and 1, then you can use the value 2 to tell your program that you have already processed a pixel (and don't have to enter the recursion loop for it). Hope that makes sense. e.g. _abca111b101c101Starting from the (b,b) pixel111121101111121121You would be at (c,c) and looking for the next "0" if we didn't color (b,b) with 2 you would end up going back to (b,b) and end up in an infinite loop. The purpose of coloring is basically to say that you already processed the pixel
  10. It would be very simple to automate the process Yes he only shows deleting his video, but if you notice he shows deleting his video through a browser that isn't logged in as him. He used the identifier from the url as well as the session token from the browser he was not logged into. So it would have been simple to run a script saying delete all videos...or at least automate it so you could delete the videos you want (ie putting the url into a program and having the program delete the video)
  11. ZeferiniX Just a quick note, padX and padY are never used. Why not try (also set padX and padY to equal what the x and y equal at the beginning) int startx = ((int)padX) / 2; int starty = ((int)padY); int endx = ((int)padX) / 2 + 150; int endy = ((int)padY); *Sorry I don't have enough time to figure out if this solution works, just as a note of where to go
  12. The only thing I would add is the work it out by hand method. If your program isn't working find a simple test case where it fails. Then go through each step by hand, and see whether you get the same "wrong" output. If you do, you will learn more about your program, and if you get the right result you can revert to the print statements to figure out where you have gone wrong.
  13. alphabeta Personally I would still try approaching this problem without using regular expressions. The reason I say this by using things like regular expressions to solve these problems is you don't learn necessarily how to program. You can know a language, but to me programming is about how you approach problems and how you build your solutions. While knowing regex is good, and in general this would be an ideal real world solution, you aren't really learning too much by using regex in this case. Here is my ansi c version of a solution (Sorry I am into java right now, so I am not comfortable with the C++ libraries at the moment), but the approach to the problem is the important thing imho. /* containsHelloinputText: the input characters, assumes input is not a null pointer and assumes input is 1+ characters long, null terminated and only lowercaseoutput: 0 failed to find hello 1 hello was foundGeneral approach.The thing to recognize is you only need to find the letters h, e, l, l, o in that orderYou don't have to worry about erasing things from the inputText, but just need to rememberwhich character you have found in the target word and start searching for the next characterafter it like what madknight3 was sayingActually this is probably a lot quicker than regular expressions in the sense of run time,given that regular expressions should have a fair amount of overhead. Although this isn'treally optimized so I guess if someone wants to test by they can (assuming I got this correct)p.s. I haven't even compiled this code, so it could fail miserably*/int containsHello(const char* inputText) { int indexForTargetWord = 0; int indexForInputText = 0; const char* targetWord = "hello"; /* So indexForInputText will be 0, and we will compare the inputText's character against the targetWord's character. If it is a match, we will start searching for the next character in targetWord If it is not a match, we need to keep incrementing indexForInputText until we find one If we reach the end of inputText then we know the targetword's characters never ended up in the inputText's text */ for(indexForTargetWord = 0; targetWord[indexForTargetWord] != 0; indexForTargetWord++) { /* We are comparing here, but */ while(inputText[indexForInputText] != targetWord[indexForTargetWord]) { if(inputText[indexForInputText] == 0) return 0; /* We have reached the end, and have not found the word */ indexForInputText++; } /* Getting here means we found the character, but we still need to look one character in the future for next time, so increment */ indexForInputText++; } /* we have matched the full word if we hit this return */ return 1;}
  14. I disagree, they do not make money off the video being played. They make money off the ad being played, and that creates a problem when channels start disabling ads while doing their own sponsor spots. Remember even though youtube still had ads when google bought it, the ad revenue wasn't enough to make it profitable. All of that said, I am not sure how I feel about this. What should google do then?
  15. Well that is what you get when you try compiling java code as c. It just won't work (System.out.println is java ) To @airfrog19 Clock is an abstract class, which means you can't just create a clock. Try something like LocalTime clock = LocalTime.now();System.out.println(clock.tostring()); //Might have missed a capital or two
×