Search Results

Search found 5192 results on 208 pages for 'random forests'.

Page 79/208 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • What algorithm can I use to detect simple shapes in a 4x4 matrix?

    - by ion
    I'm working on a simple multiplayer game that receives a random 4x4 matrix from a server and extracts a shape from it. For example: XXOO OXOO XXOX XXOO XOOX and XOOO XXXX OXXX So in the first matrix the shape I want to parse is: oo o oo and the 2nd: oo oo ooo I know there must be an algorithm for this because I saw this kind of behavior on some puzzle games but I have no idea how to go about to detecting them or even where to start. So my question is: How do I detect what shape is in the matrix and how do I differentiate between multiple colors? (it doesn't come only in X and O, it comes in a maximum of 4). Additionally, the shape must be a minimum of 4 blocks.

    Read the article

  • Simplified knapsack in PHP

    - by Mikhail
    I have two instances where I'd like to display information in a "justified" alignment - but I don't care if the values are switched in order. One example being displaying the usernames of people online: Anton Brother68 Commissar Dougheater Elflord Foobar Goop Hoo Iee Joo Rearranging them we could get exactly 22 characters long on each line: Anton Brother68 Foobar Commissar Elflord Goop Dougheater Hoo Iee Joo This is kind of a knapsack, except seems like there ought to be a P solution since I don't care about perfection, and I have multiple lines. Second instance is identical, except instead of names and character count I would be displaying random images and use their width.

    Read the article

  • Is case after case in a switch efficient?

    - by RandomGuy
    Just a random question regarding switch case efficiency in case after case; is the following code (assume pseudo code): function bool isValid(String myString){ switch(myString){ case "stringA": case "stringB": case "stringC": return true; default: return false; } more efficient than this: function bool isValid(String myString){ switch(myString){ case "stringA": return true; case "stringB": return true; case "stringC": return true; default: return false; } Or is the performance equal? I'm not thinking in a specific language but if needed let's assume it's Java or C (for this case would be needed to use chars instead of strings).

    Read the article

  • Coordinating team code review sessions

    - by Wade Tandy
    My question has two parts: 1) In your team or organization, do you ever do in-person code reviews with all or part of a team, as opposed to online reviews using some sort of tool? 2) How do you structure these meetings? Do you choose to focus on one person's code in a given meeting? Do you look at everything? Take a random sample? Ask people on the team what they'd like to have looked at of theirs? I'd love to add this practice to my development team, so I'd like to hear how others are doing it.

    Read the article

  • Best practices for implementing collectible virtual item "packs"?

    - by Glenn Barnett
    I'm in the process of building a game in which virtual items can be obtained either by in-game play (defeating enemies, gaining levels), or by purchasing "packs" via microtransactions. Looking at an existing example like Duels.com's item packs, it looks like a lot of thought went into their implementation, including: Setting clear player expectations as to what can be obtained in the pack Limiting pack supply to increase demand and control inflation Are there other considerations that should be taken into account? For example, should the contents of the packs be pre-generated to guarantee the advertised drop rates, or is each drop rate just a random chance, and you could end up with higher or lower supply?

    Read the article

  • Running 32-bit Firefox with sun-jre in 64-bit Ubuntu

    - by rojanu
    I am trying to run juniper networks connect program to vpn into work and it only works on 32bit sun jre. All the things I have found with google failed so far. I can't use any scripts, like madscientists, as part of the authentication I need to provide some random characters from a grid. So to isolate this 32bit app install to a corner, I downloaded firefox and jre and unpack them to /opt. I run firefox with sudo as Juniper asks for root password. Here is Firefox plugins folder /ot/firefox32/plugins# ls -la total 8 drwxr-xr-x 2 root root 4096 Mar 11 00:57 . drwxr-xr-x 11 root root 4096 Mar 10 23:48 .. lrwxrwxrwx 1 root root 49 Mar 11 00:57 libnpjp2.so -> /opt/java/32/jdk1.6.0_31/jre/lib/i386/libnpjp2.so Firefox lists sun jre but when check it with "http://java.com/en/download/installed.jsp" it either can't detect java or Firefox freezes Any Ideas? Thanks

    Read the article

  • Trying to develop a game with android for cracking glasses in different dimensions

    - by user46514
    I am trying to develop a game in android where I will have to punch a hole to get through the glass but not shatter the glass completely. The glass will show up in different forms of polygons and when a hole is created by a projectile, the rest of the polygon will still remain intact.Only a polygonal opening will get created at the point of impact with the projectile. I am new at game design in android but I was thinking that I would create a random polygon shape to show in the path and then at the point where the projectile hits it, I could create a glass polygon to create a splinter effect. The rest of the part of the glass that is randomly created at the point of impact, I could further splinter it into polygons flying at different angle. since I also need to capture the bits of glasses flying off and falling down with gravity. Is my solution the best efficient one at performance of threads or is there a better solution for this glass breaking effect. Thanks Dhiren

    Read the article

  • What are the most common AI systems implemented in Tower Defense Games

    - by the_Dan
    I'm currently in the middle of researching on the various types of AI techniques used in tower defense type games. If someone could be help me in understanding the different types of techniques and their associated advantages. Using Google I already found several techniques. Random Map traversal Path finding e.g. Cost based Traversing Algorithms i.e. A* I have already found a great answer to this type of question with the below link, but I feel that this answer is tailored to FPS. If anyone could add to this and make it specific to tower defense games then I would be truly great-full. How is AI most commonly implemented in popular games? Example of such games would be: Radiant Defense Plant Vs Zombies - Not truly Intelligent, but there must be an AI system used right? Field Runners Edit: After further research I found an interesting book that may be useful: http://www.amazon.com/dp/0123747317/?tag=stackoverfl08-20

    Read the article

  • Mouse buttons and all keyboard buttons except alt and super randomly stops working

    - by bobbaluba
    A couple of times lately, unity appears to not accept button presses from neither the mouse or the keyboard. This happens after a random amount of time, usually a couple of hours, or right after boot. The weird thing is: I can still move the mouse around. I can press alt to get the unity menu thingy (but i can't type anything in it) I can press super to show/hide the unity search. None of the applications seem to get the input Ive tried connecting a second mouse, same issue I can press ctrl+alt+f1 to drop to a shell tty The shell works fine Now, this is definitely a bug, probably in unity(?), but it's hard to search for when I don't know what's causing it. Is there something I can do to debug? I've found some people that appears to be having the same problem with the mouse only, but most of the time, their questions are unanswered or closed for being too specific. What would be a good strategy to fix this? Should I report it as a bug?

    Read the article

  • Is there a variable width font that does not change width when adding effects like bold, italic?

    - by George Bailey
    NetBeans has a word wrap feature now - but if the font changes width when bold then it gets all jumpy and sometimes hard to work with. Edit: It turns out that even with Courier New that NetBeans word wrap still jumps up and down lines at a time at random. I guess that this question no longer cares for an answer. However,, it seems that there is no answer. (at least nobody has brought one up yet) I am currently using Comic Sans MS which gets wider when bold.

    Read the article

  • Force usb to use same device id, instead of new one

    - by m s kumar
    I am having some trouble in automating the task. I am testing some android based mobiles in linux machine. The automation script uses the device id under "/dev/bus/usb/001/"053" it will be always under bus 001 only.. But the dev is will be random like if i insert one mobile then the dev id will be 053, if remove and insert it again then the dev id will be 054.. The problem is, when some tests runs on the device and if device gets rebooted then new dev id is showing for the rebooted one and my scripts failing due to new dev id.. Is there any way to force usb devices to use same dev id instead of new one. So that there will be no issues to my tests even after device reboots. Thanks in advance.

    Read the article

  • HTG Explains: What is the Windows Page File and Should You Disable It?

    - by Chris Hoffman
    Windows uses a page file to store data that can’t be held by your computer’s random-access memory when it fills up. While you can tweak the page file settings, Windows can manage the page file fine on its own. The Windows page file is somewhat misunderstood. People see it as the cause of slowdowns because it’s slower to use the page file than your computer’s RAM, but having a page file is better than not having one. Image Credit: Blake Patterson on Flickr HTG Explains: What is the Windows Page File and Should You Disable It? How To Get a Better Wireless Signal and Reduce Wireless Network Interference How To Troubleshoot Internet Connection Problems

    Read the article

  • Realistic planetary terrain generation with weights

    - by Programmdude
    I need terrain generation for a planet. The planet will be divided up into several hundred hexes, and I need it to be realistic and based on weights. I have dabbled in terrain generation before, but nothing like this. So I figure it would be a good idea to ask the community for answers, recommended articles or the like. By realistic, I mean not just random hexes, but continent shaped things with a few islands. More desert around the equator and more ice around the poles. I also have two weights I need to base it around: ice percentage and water percentage. That means that around XX% of the planet will need to be water. Does anyone have any advice or places to start? Generating arbitrary terrain is easy, but something a bit more "organic" like this seems rather difficult. It also needs to be seamless. Should be obvious since it's a planet, but no harm in pointing it out.

    Read the article

  • HTG Explains: Why You Only Have to Wipe a Disk Once to Erase It

    - by Chris Hoffman
    You’ve probably heard that you need to overwrite a drive multiple times to make the data unrecoverable. Many disk-wiping utilities offer multiple-pass wipes. This is an urban legend – you only need to wipe a drive once. Wiping refers to overwriting a drive with all 0’s, all 1’s, or random data. It’s important to wipe a drive once before disposing of it to make your data unrecoverable, but additional wipes offer a false sense of security. Image Credit: Norlando Pobre on Flickr HTG Explains: Learn How Websites Are Tracking You Online Here’s How to Download Windows 8 Release Preview Right Now HTG Explains: Why Linux Doesn’t Need Defragmenting

    Read the article

  • GameplayScreen does not contain a definition for GraphicsDevice

    - by Dave Voyles
    Long story short: I'm trying to intergrate my game with Microsoft's Game State Management. In doing so I've run into some errors, and the latest one is in the title. I'm not able to display my HUD for the reasons listed above. Previously, I had much of my code in my Game.cs class, but the GSM has a bit of it in Game1, and most of what you have drawn for the main screen in your GameplayScreen class, and that is what is causing confusion on my part. I've created an instance of the GameplayScreen class to be used in the HUD class (as you can see below). Before integrating with the GSM however, I created an instance of my Game class, and all worked fine. It seems that I need to define my graphics device somewhere, but I am not sure of where exactly. I've left some code below to help you understand. public class GameStateManagementGame : Microsoft.Xna.Framework.Game { #region Fields GraphicsDeviceManager graphics; ScreenManager screenManager; // Creates a new intance, which is used in the HUD class public static Game Instance; // By preloading any assets used by UI rendering, we avoid framerate glitches // when they suddenly need to be loaded in the middle of a menu transition. static readonly string[] preloadAssets = { "gradient", }; #endregion #region Initialization /// <summary> /// The main game constructor. /// </summary> public GameStateManagementGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.IsFullScreen = false; graphics.ApplyChanges(); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); // Activate the first screens. screenManager.AddScreen(new BackgroundScreen(), null); //screenManager.AddScreen(new MainMenuScreen(), null); screenManager.AddScreen(new PressStartScreen(), null); } namespace Pong { public class HUD { public void Update(GameTime gameTime) { // Used in the Draw method titleSafeRectangle = new Rectangle (GameplayScreen.Instance.GraphicsDevice.Viewport.TitleSafeArea.X, GameplayScreen.Instance.GraphicsDevice.Viewport.TitleSafeArea.Y, GameplayScreen.Instance.GraphicsDevice.Viewport.TitleSafeArea.Width, GameplayScreen.Instance.GraphicsDevice.Viewport.TitleSafeArea.Height); } } } class GameplayScreen : GameScreen { #region Fields ContentManager content; public static GameStates gamestate; private GraphicsDeviceManager graphics; public int screenWidth; public int screenHeight; private Texture2D backgroundTexture; private SpriteBatch spriteBatch; private Menu menu; private SpriteFont arial; private HUD hud; Animation player; // Creates a new intance, which is used in the HUD class public static GameplayScreen Instance; public GameplayScreen() { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); } protected void Initialize() { lastScored = false; menu = new Menu(); resetTimer = 0; resetTimerInUse = true; ball = new Ball(content, new Vector2(screenWidth, screenHeight)); SetUpMulti(); input = new Input(); hud = new HUD(); // Places the powerup animation inside of the surrounding box // Needs to be cleaned up, instead of using hard pixel values player = new Animation(content.Load<Texture2D>(@"gfx/powerupSpriteSheet"), new Vector2(103, 44), 64, 64, 4, 5); // Used by for the Powerups random = new Random(); vec = new Vector2(100, 50); vec2 = new Vector2(100, 100); promptVec = new Vector2(50, 25); timer = 10000.0f; // Starting value for the cooldown for the powerup timer timerVector = new Vector2(10, 10); //JEP - one time creation of powerup objects playerOnePowerup = new Powerup(); playerOnePowerup.Activated += PowerupActivated; playerOnePowerup.Deactivated += PowerupDeactivated; playerTwoPowerup = new Powerup(); playerTwoPowerup.Activated += PowerupActivated; playerTwoPowerup.Deactivated += PowerupDeactivated; //JEP - moved from events since these only need set once activatedVec = new Vector2(100, 125); deactivatedVec = new Vector2(100, 150); powerupReady = false; }

    Read the article

  • 12.10 does not boot sometimes from the hard drive, but it does consistently from the CD

    - by Robert
    I have recently switched from Windows 7 to Ubuntu 12.10. I have installed Ubuntu 12.10 and I cleared everything from my computer, but it randomly stops at different screens. Only a purple screen comes up. I can choose Ubuntu from a list and a blinking white dot appears in the top left corner. The previous things happen and the Ubuntu login screen appears an I can log in. It is random. and I have not changed anything. I can always insert the bootable CD and it will work every time.

    Read the article

  • Seeking some advice on pursuing MS in CS from Stanford or Carnegie Mellon or Caltech

    - by avi
    What kinds of projects are given preference in top notch colleges like Stanford, Caltech, etc to get admission into MS programme in Computer Science? I have an average academic portfolio. I'm pursuing Btech from a not so popular university in India with an aggregate of 67%. I'm good at designing algorithms and possess good knowledge of core subjects but helpless with my percentage. So, I think the only way I can impress them is with my project(s). Can anyone please suggest me the kinds of projects that are given preference by such top level institutes? Could you please also suggest some good projects? My area of interest would be Artificial Intelligence or any application/software/algorithm design which could be of some help to common people. Or if you have any other random idea for my project then please share it with me. Note: Web based projects and management projects like lib management wouldn't be my priority.

    Read the article

  • combo microphone does not work on Natty.

    - by Senthil Kumaran
    I have a Internal Audio Hardware card and my Laptop (Lenevo IdeaPad) presents a single slot as a combo Microphone and headphone jack. On Windows, I attach my ipod headphone to jack and speak directly to my computer. I assume there is a microphone which is listening to my voice and I can communicate two-way. On Ubuntu, the microphone always seem to be listening to random noise. So any input by speaking to the computer is not possible. What could be the reason and how do I troubleshoot this?

    Read the article

  • How do engines avoid "Phase Lock" (multiple objects in same location) in a Physics Engine?

    - by C0M37
    Let me explain Phase Lock first: When two objects of non zero mass occupy the same space but have zero energy (no velocity). Do they bump forever with zero velocity resolution vectors or do they just stay locked together until an outside force interacts? In my home brewed engine, I realized that if I loaded a character into a tree and moved them, they would signal a collision and hop back to their original spot. I suppose I could fix this by implementing impulses in the event of a collision instead of just jumping back to the last spot I was in (my implementation kind of sucks). But while I make my engine more robust, I'm just curious on how most other physics engines handle this case. Do objects that start in the same spot with no movement speed just shoot out from each other in a random direction? Or do they sit there until something happens? Which option is generally the best approach?

    Read the article

  • 2d shapes in XNA 4.0?

    - by Lautaro
    Having some experience of XNA but none of 3D programming. I have an idea i want to realize but i have not decided to do it in 3d or 2d. Im not sure which one will be best in XNA. I want to have a shape like a blob that can reshape depending on input. The morphing does not need to be very advanced. It could be a circle (2d) or globe (3d) that just has one point that moves slightly in a random direction. In ASP.NET i have made this through the 2d Draw classes where i can make lines, circles, squares etc and then modify the points that makes them up. But it seems to me that XNA does not have classes for making 2d shapes (can i get this confirmed?). If it had, then this would be the quickest solution for me.

    Read the article

  • How to handle bugs that I think I fixed, but I'm not entirely sure

    - by vsz
    There are some types of bugs which are very hard to reproduce, happen very rarely and seemingly by random. It can happen, that I find a possible cause, fix it, test the program, and can't reproduce the bug. However, as it was impossible to reliably reproduce the bug and it happened so rarely, how can I indicate this in a bugtracker? What is the common way of doing it? If I set the status to fixed, and the solution to fixed, it would mean something completely fixed, wouldn't it? Is it common practice to set the status to fixed and the solution to open, to indicate to the testers, that "it's probably fixed, but needs more attention to make sure" ? Edit: most (if not all) bugtrackers have two properties for the status of a bug, maybe the names are not the same. By status I mean new, assigned, fixed, closed, etc., and by solution I mean open (new), fixed, unsolvable, not reproducible, duplicate, not a bug, etc.

    Read the article

  • Is there a way to procedurally generate the history of a world?

    - by pdusen
    I am somewhat intrigued by the diagram found here representing 1800 years of cultural history in an imaginary world some guy created. This sort of thing would seem to have strong applications for game development, insofar as world design. It looks like he did this diagram by hand. What I'm interested in is seeing if there is a way to create this sort of diagram programatically. If you were tasked with generating diagrams in the style of the above from random values, how would you go about it? Are there any particular data structures or algorithms that you would consider?

    Read the article

  • Phishing alert but file never existed

    - by IMB
    I got an alert from Google Webmasters. They say the following file was present in my host: example.com/~jhostgop/identity.php I checked my files and it never existed at all. I've experience this problem in two different host and domains but the file never existed in my file system. It appears somebody out there is linking a random domain and it prefixes the link with /~jhostgop/identity.php. Now Google may have indexed them so now I get those false phishing alerts. Anyone experienced this? Is it possible to prevent this?

    Read the article

  • Possibility of recovering files from a dd zero-filled hard disk

    - by unknownthreat
    I have "zero filled" (complete wiped) an external hard disk using dd, and from what I have heard: people said you should at least "zero fill" 3 times to be sure that the data are really wiped and no one can recover anything. So I decided to scan the disk once again after I've zero filled the disk. I was expecting the disk to still have some random binary left. It turned out that it has only a few sequential bytes in the very beginning. This is probably the file structure type and other headers stuff. Other than that, it's all zeros and nothing else. So if we have to recover any file from a zero filled disk, ...how? From what I've heard, even you zero fill the disk, you should still have some data left. ...or could dd really completely annihilate all data?

    Read the article

  • Get coordinates of arraylist

    - by opiop65
    Here's my map class: public class map{ public static final int CLEAR = 0; public static final ArrayList<Integer> STONE = new ArrayList<Integer>(); public static final int GRASS = 2; public static final int DIRT = 3; public static final int WIDTH = 32; public static final int HEIGHT = 24; public static final int TILE_SIZE = 25; // static int[][] map = new int[WIDTH][HEIGHT]; ArrayList<ArrayList<Integer>> map = new ArrayList<ArrayList<Integer>>(WIDTH * HEIGHT); enum tiles { air, grass, stone, dirt } Image air, grass, stone, dirt; Random rand = new Random(); public Map() { /* default map */ /*for(int y = 0; y < WIDTH; y++){ map[y][y] = (rand.nextInt(2)); System.out.println(map[y][y]); }*/ /*for (int y = 18; y < HEIGHT; y++) { for (int x = 0; x < WIDTH; x++) { map[x][y] = STONE; } } for (int y = 18; y < 19; y++) { for (int x = 0; x < WIDTH; x++) { map[x][y] = GRASS; } } for (int y = 19; y < 20; y++) { for (int x = 0; x < WIDTH; x++) { map[x][y] = DIRT; } }*/ for (int y = 0; y < HEIGHT; y++) { for(int x = 0; x < WIDTH; x++){ map.set(x * WIDTH + y, STONE); } } try { init(null, null); } catch (SlickException e) { e.printStackTrace(); } render(null, null, null); } public void init(GameContainer gc, StateBasedGame sbg) throws SlickException { air = new Image("res/air.png"); grass = new Image("res/grass.png"); stone = new Image("res/stone.png"); dirt = new Image("res/dirt.png"); } public void render(GameContainer gc, StateBasedGame sbg, Graphics g) { for (int x = 0; x < WIDTH; x++) { for (int y = 0; y < HEIGHT; y++) { switch (map.get(x * WIDTH + y)) { case CLEAR: air.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case STONE: stone.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case GRASS: grass.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case DIRT: dirt.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; } } } } public static boolean blocked(float x, float y) { return map[(int) x][(int) y] == STONE; } public static Rectangle blockBounds(int x, int y) { return (new Rectangle(x, y, TILE_SIZE, TILE_SIZE)); } } Specifically I am looking at this: for (int x = 0; x < WIDTH; x++) { for (int y = 0; y < HEIGHT; y++) { switch (map.get(x * WIDTH + y).intValue()) { case CLEAR: air.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case STONE: stone.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case GRASS: grass.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; case DIRT: dirt.draw(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE); break; } } } How can I access the coordinates of my arraylist map and then draw the tiles to the screen? Thanks!

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >