Daily Archives

Articles indexed Wednesday March 28 2012

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How do i stop or turn off the x-server?

    - by Alex
    im trying to do this tutorial: http://wiki.accelereyes.com/wiki/index.php/Installing_CUDA_Under_Ubuntu_10.04 I need the command that would completely stop/turn off the x-server. when i try to install the nvidia developer driver, i get a blue screen telling my Error:cant install with x-server running, please turn it off (something like that). "sudo service gdm stop" worked at the time i guess, (didnt give any errors) but the x-server is still running. is this the command i should be using? thanks for anyhelp!

    Read the article

  • What is vt.handoff=7 parameter in grub.cfg

    - by sirkubax
    I wonder what vt.handoff=7 parameter does. I can not find any good man for that... BTW, if you have a nice descriptoon about : search --no-floppy --fs-uuid --set=root I would be happy :) grub.cfg example: menuentry 'FAILSAFE' --class ubuntu --class gnu-linux --class gnu --class os { recordfail set gfxpayload=$linux_gfx_mode insmod part_msdos insmod ext2 set root='(hd0,msdos8)' search --no-floppy --fs-uuid --set=root 36286167-4eba-4a1e-a202-155c6baafa01 linux /boot/vmlinuz-2.6.37-12-generic root=UUID=36286167-4eba-4a1e-a202-155c6baafa01 ro vt.handoff=7 quiet splash initrd /boot/initrd.img-2.6.37-12-generic } BTW2 - i can not create tag vt.handoff ;(

    Read the article

  • How to make Unity remember brightness settings?

    - by Teresa H
    This question has been asked many times for Ubuntu 11.10 but it always has been closed and linked with this link, but that accepted answer is from 2010 and that setting doesn't work anymore for Ubuntu 11.10. Furthermore, the brightness setting doesn't exist anymore in "Energy" options. It is now on "Screen" options and it doesn't seem to remember the setting after reboot. So, how to make Unity remember brightness settings?

    Read the article

  • Need for gksudo for "Install new software" in eclipse

    - by Captain Giraffe
    I have been developing for android on eclipse for a while now, and my experience with the eclipse environment on Ubuntu10.10 has not been a smooth one. With the repo install of eclipse I have had to sudo eclipse to install the required components for android development. (a big red flag for me) I tried today to install updates for the eclipse and android platform and my eclipse installation seems to have broken horribly. I can no longer find and of the urls for new software if i gksudo it, if I run it in user mode it fails (as it always has) with permissions problems. I have chowned user:user all my eclipse and android related private/user files. This is a system running ubuntu 10.10 with gnome2.x. On my kubuntu 11.10 install it work a lot better. Is there an easy fix to this? Is the repo version of eclipse broken? Should I do a clean install for just my user? (if so can I retain my previously installed software? the installation process is very time consuming) I saw there was a previous post here recommending this for new installations.

    Read the article

  • Where is the /etc/inittab file or how to set the default runlevel

    - by YumYumYum
    I was trying to find the /etc/inittab where I do my autologin. But in Ubuntu 11.04 that file seems to be lost. Is this the correct way you do it in Ubuntu? # Auto Login for Ubuntu how? # 1. apt-get install mingetty # 2. vim /etc/init/tty1.conf # tty1 - getty # # This service maintains a getty on tty1 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn #exec /sbin/getty -8 38400 tty1 exec /sbin/mingetty --autologin <PUTYOUR_USERNAME_HERE> tty1 ^ |____ edited only this line, seems to be working

    Read the article

  • Develop website locally and push updates on Remote Server using Git

    - by John
    Together with a friend we are looking to develop a website (using Symfony2). We are on a Shared Hosting with SSH access. Below is the environment we'd like to setup: * Use git as Version Control (we are new to Git) * Share the tasks and develop on our local machines * Push the updates onto the remote server Here's our initial thoughts on how to do it (assuming Git is already running both locally and remotely): * Install Symfony on the Remote Server (basic setup) * Get a clone (using Git) of the project locally * Develop project locally and push updates (using Git) on the remote server Does this approach make sense, if not, any recommendations? Thanks

    Read the article

  • TXT vs SPF record for Google servers SPF record, either or both?

    - by sebastien
    According to Google’s documentation, https://support.google.com/a/bin/answer.py?hl=en&answer=178723 It clearly says Create a TXT record containing this text: v=spf1 include:_spf.google.com ~all Why is this not a SPF record? RFC4408 defines SPF records, but it seems it’s not really used https://tools.ietf.org/html/rfc4408#section-3.1.1 Is that right? Should I create both TXT and SPF ? Thanks

    Read the article

  • My page no longer shows up in Google's results for a keyword

    - by user6456
    I have a small website about a commercial product, with a description and tutorial. 2 days ago it was in position 11th in Google search results, without any kind of SEO optimization on my part. Today it's gone. Totally gone - not even in the first 200 results. It's still very high in bing.com and duckduckgo.com. The site is very on topic. It's hosted under domain Keyword.com, and it's about commercial product which addresses the Keyword. How can I know what happened?

    Read the article

  • Abnormal alexa ranking score

    - by SteenhouwerD
    I have 2 websites of ecommerce in France and for these websites I have a strange behaviour of the alexa results. Here are some statistics about the websites : Unique Visits January 2012 Website A : 158,828 Website B : 58,867 Number of Search Results google Website A : 5,100 Website B : 56,000 Links to my site Website A : 3,120 Website B : 2,180 ALEXA Score Website A : 405,804 Website B : 278,944 How does it come that website B with 1/3 of the visitors of website A have a much better Alexa Score ( x2 ) then website A?

    Read the article

  • Finding furthermost point in game world

    - by user13414
    I am attempting to find the furthermost point in my game world given the player's current location and a normalized direction vector in screen space. My current algorithm is: convert player world location to screen space multiply the direction vector by a large number (2000) and add it to the player's screen location to get the distant screen location convert the distant screen location to world space create a line running from the player's world location to the distant world location loop over the bounding "walls" (of which there are always 4) of my game world check whether the wall and the line intersect if so, where they intersect is the furthermost point of my game world in the direction of the vector Here it is, more or less, in code: public Vector2 GetFurthermostWorldPoint(Vector2 directionVector) { var screenLocation = entity.WorldPointToScreen(entity.Location); var distantScreenLocation = screenLocation + (directionVector * 2000); var distantWorldLocation = entity.ScreenPointToWorld(distantScreenLocation); var line = new Line(entity.Center, distantWorldLocation); float intersectionDistance; Vector2 intersectionPoint; foreach (var boundingWall in entity.Level.BoundingWalls) { if (boundingWall.Intersects(line, out intersectionDistance, out intersectionPoint)) { return intersectionPoint; } } Debug.Assert(false, "No intersection found!"); return Vector2.Zero; } Now this works, for some definition of "works". I've found that the further out my distant screen location is, the less chance it has of working. When digging into the reasons why, I noticed that calls to Viewport.Unproject could result in wildly varying return values for points that are "far away". I wrote this stupid little "test" to try and understand what was going on: [Fact] public void wtf() { var screenPositions = new Vector2[] { new Vector2(400, 240), new Vector2(400, -2000), }; var viewport = new Viewport(0, 0, 800, 480); var projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, viewport.Width / viewport.Height, 1, 200000); var viewMatrix = Matrix.CreateLookAt(new Vector3(400, 630, 600), new Vector3(400, 345, 0), new Vector3(0, 0, 1)); var worldMatrix = Matrix.Identity; foreach (var screenPosition in screenPositions) { var nearPoint = viewport.Unproject(new Vector3(screenPosition, 0), projectionMatrix, viewMatrix, worldMatrix); var farPoint = viewport.Unproject(new Vector3(screenPosition, 1), projectionMatrix, viewMatrix, worldMatrix); Console.WriteLine("For screen position {0}:", screenPosition); Console.WriteLine(" Projected Near Point = {0}", nearPoint.TruncateZ()); Console.WriteLine(" Projected Far Point = {0}", farPoint.TruncateZ()); Console.WriteLine(); } } The output I get on the console is: For screen position {X:400 Y:240}: Projected Near Point = {X:400 Y:629.571 Z:599.0967} Projected Far Point = {X:392.9302 Y:-83074.98 Z:-175627.9} For screen position {X:400 Y:-2000}: Projected Near Point = {X:400 Y:626.079 Z:600.7554} Projected Far Point = {X:390.2068 Y:-767438.6 Z:148564.2} My question is really twofold: what am I doing wrong with the unprojection such that it varies so wildly and, thus, does not allow me to determine the corresponding world point for my distant screen point? is there a better way altogether to determine the furthermost point in world space given a current world space location, and a directional vector in screen space?

    Read the article

  • Attributes and Behaviours in game object design

    - by Brukwa
    Recently I have read interesting slides about game object design written by Marcin Chady Theory and Practice of the Game Object Component Architecture. I have prototyped quick sample that utilize all Attributes\Behaviour idea with some sample data. Now I have faced a little problem when I added a RenderingSystem to my prototype application. I have created an object with RenderBehaviour which listens for messages (OnMessage function) like MovedObject in order to mark them as invalid and in OnUpdate pass I am inserting a new renderable object to rederer queue. I have noticed that rendering updates should be the last thing made in single frame and this causes RenderBehaviour to depend on any other Behaviour that changes object position (i.ex. PhysicsSystem and PhysicsBehaviour). I am not even sure if I am doing this the way it should be. Do you have any clues that might put me on the right track?

    Read the article

  • What is the best way to exploit multicores when making multithread games?

    - by Keeper
    Many people suggest to write a program, and then start optimizing it. But I think that when it's coming to multithreading with multicore, a little think ahead is required. I've read about using threads, and experienced it myself during some courses at the university (still a student). The big question is simple, but a bit abstract: What thread related steps in game design do I need to take, before implementation? Now trying to be more specific. Let's say, as an example, that I'm making a small board game (like Monopoly) that I want to be multithreaded. My goal Is that this multithreaded game will exploit the best of the multicore system, lets say 4-6 cores (like in i7 processors). My answer to this question at the moment is, one thread for each of these four basic components: GUI User Input / Output AI (computer rival) Other game related calculations (like shortest path from A to B, or level up status change) I'm not an expert (yet!), and I'm sure there are better answers out there. Any suggestion, answer, different approach will be helpful. Some thoughts: Maybe splitting the main database is a good way.. (or total disaster.. )

    Read the article

  • Pre game loading time vs. in game loading time

    - by Keeper
    I'm developing a game in which a random maze is included. There are some AI creatures, lurking the maze. And I want them to go in some path according to the mazes shape. Now there are two possibilities for me to implement that, the first way (which I used) is by calculating several wanted lurking paths once the maze is created. The second, is by calculating a path once needed to be calculated, when a creature starts lurking it. My main concern is loading times. If I calculate many paths at the creating of the maze, the pre loading time is a bit long, so I thought about calculating them when needed. At the moment the game is not 'heavy' so calculating paths in mid game is not noticeable, but I'm afraid it will once it will get more complicated. Any suggestions, comments, opinions, will be of help. Edit: As for now, let p be the number of pre-calculated paths, a creatures has the probability of 1/p to take a new path (which means a path calculation) instead of an existing one. A creature does not start its patrol until the path is fully calculated of course, so no need to worry about him getting killed in the process.

    Read the article

  • Creating several instances of the same object, and selecting only one

    - by hustlerinc
    I'm playing around with making a puzzle game, haven't done that much before I run into my first problem. Basically, I want to create a certain amount of the same object/function. But without hardcoding the different instances. I think maybe an array is a good idea? and then a for loop to push the objects in? And then I need to be able to select one of these objects by clicking on it, how would I do that? How do I know which ball in the array was clicked? A loop again? I made a jsFiddle example (you need to click the orange ball to select, then you can move it around by clicking the canvas). This is what I want to do, but with more balls. How would you solve this? Help appreciated.

    Read the article

  • How can I create tiles that scale to multiple resolutions?

    - by Darestium
    I am trying to create a multiplayer version of the popular Flash game N in Java. However, I'm not sure how to create a tileset that will scale up. Are the tiles for N pre-drawn or are they defined with mathamatical formulas in code? I do see how they would scale up in Flash if they were pre-rendered. So if anyone has any ideas how I should go about creating the tileset, or how they are created in the game please let me know. You can check out the game here.

    Read the article

  • How to render 2D particles as fluid?

    - by luke
    Suppose you have a nice way to move your 2D particles in order to simulate a fluid (like water). Any ideas on how to render it? This is for a 2D game, where the perspective is from the side, like this. The water will be contained in boxes that can be broken in order to let it fall down and interact with other objects. The simplest way that comes to my mind is to use a small image for each particle. I am interested in hearing more ways of rendering water.

    Read the article

  • Spritegroups and colorkeys

    - by Fristi
    I have a problem using spritegroups in pygame. In my situation I have 2 spritegroups, one for humans, one for "infected". A human is represented by a blue circle: image = pygame.Surface((32,32)) image.fill((255,255,255)) pygame.draw.circle(image,(0,0,255),(16,16),16) image = image.convert() image.set_colorkey((255,255,255)) An infected by a red one (same code, different color). I update my spritegroups as follows: self.humans.clear(self.screen, self.bg) self.humans.update(time_passed) self.humans.draw(self.screen) self.infected.clear(self.screen, self.bg) self.infected.update(time_passed) self.infected.draw(self.screen) Self.bg is defined: self.bg = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT)) self.bg.fill((255,255,255)) self.bg.convert() This all works, except that when a red circle overlaps with a blue one, you can see the white corners of the bounding box around the actual circle. Within a spritegroup it works, using the set_colorkey function. This does not happen with overlapping blue circles or overlapping red circles. I tried adding a colorkey to self.bg but that did not work. Same for adding a colorkey to self.screen.

    Read the article

  • Stencil buffer appears to not be decrementing values correctly

    - by Alex Ames
    I'm attempting to use the stencil buffer as a clipper for my UI system, but I'm having trouble debugging a problem I'm running in to. This is what I'm doing: A widget can pass a rectangle to the the stencil clipper functions, which will increment the stencil buffer values that it covers. Then it will draw its children, which will only get drawn in the stencilled area (so that if they extend outside they'll be clipped). After a widget is done drawing its children, it pops that rectangle from the stack and in the process decrements the values in the stencil buffer that it has previously incremented. The slightly simplified code is below: static void drawStencil(Rect& rect, unsigned int ref) { // Save previous values of the color and depth masks GLboolean colorMask[4]; GLboolean depthMask; glGetBooleanv(GL_COLOR_WRITEMASK, colorMask); glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask); // Turn off drawing glColorMask(0, 0, 0, 0); glDepthMask(0); // Draw vertices here ... // Turn everything back on glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]); glDepthMask(depthMask); // Only render pixels in areas where the stencil buffer value == ref glStencilFunc(GL_EQUAL, ref, 0xFF); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); } void pushScissor(Rect rect) { // increment things only at the current stencil stack level glStencilFunc(GL_EQUAL, s_scissorStack.size(), 0xFF); glStencilOp(GL_KEEP, GL_INCR, GL_INCR); s_scissorStack.push_back(rect); drawStencil(rect, states, s_ScissorStack.size()); } void popScissor() { // undo what was done in the previous push, // decrement things only at the current stencil stack level glStencilFunc(GL_EQUAL, s_scissorStack.size(), 0xFF); glStencilOp(GL_KEEP, GL_DECR, GL_DECR); Rect rect = s_scissorStack.back(); s_scissorStack.pop_back(); drawStencil(rect, states, s_scissorStack.size()); } And this is how it's being used by the Widgets if (m_clip) pushScissor(m_rect); drawInternal(target, states); for (auto child : m_children) target.draw(*child, states); if (m_clip) popScissor(); This is the result of the above code: There are two things on the screen, a giant test button, and a window with some buttons and text areas on it. The text area scroll box is set to clip its children (so that the text doesn't extend outside the scroll box). The button is drawn after the window and should be on top of it completely. However, for some reason the text area is appearing on top of the button. The only reason I can think of that this would happen is if the stencil values were not getting decremented in the pop, and when it comes time to render the button, since those pixels don't have the right stencil value it doesn't draw over. But I can't figure out whats wrong with my code that would cause that to happen.

    Read the article

  • Calling delegate methods and calling selectors

    - by Crystal
    I'm new to the concept of delegates and selectors when used with notifications. So my first question is, 1) Let's say you have a button that has a delegate that implements some doWork method. If you want the same functionality that's in the method, is it 'ok' to just call that method? I didn't know if that was considered good coding practices and/or if you should do that, or do something different in getting that type of functionality. Like if that is ok architecture? 2) Similarly, with NSNotificationCenter, I see some code that posts a notification. Then there's a HandleSegmentedControl:(NSNotification *)notification method. If I want to manually have that functionality, but without pressing the segment control, is it 'ok' to just take that functionality out of that method and put it in a new method so it would look like this: Original: - (void)HandleSegmentedControl:(NSNotification *)notification { NSDictionary *dict = [userInfo notification]; // do stuff with the dictionary } New: - (void)HandleSegmentedControl:(NSNotification *)notification { NSDictionary *dict = [userInfo notification]; [self newMethod:dict]; } - (void)newMethod:(NSDictionary *)dict { // do stuff with the dictionary } - (void)myOtherMethodThatNeedsTheSameFunctionality { NSDictionary *dict = // create some dictionary [self newMethod:dict]; } Sorry if these are basic questions. I'm not sure what the best practices are for things like this and wanted to start the right way. Thanks.

    Read the article

  • How to get result size from an SQL query and check size

    - by Jimmy
    Hi I'm trying to write a piece of code for a simple verification method as part of a MVC. At present the SQL is not written as a prepared statement so obviously it is at risk to a SQL injection so any help in regards to writing the SQL as a prepared statement would be really helpful. The method which is in the User model. public boolean getLoginInfo() { try { DBAccess dbAccess = new DBAccess(); String sql = "SELECT username, password FROM owner WHERE username = '" + this.username + "'AND password = '" + this.password + "';"; dbAccess.close();dbAccess.executeQuery(sql); dbAccess.close(); return true; } catch (Exception e) { return false; } } I want to get the size of the result set which is generated by the SQL query and if the size of it is 1 return true else it's false. If you need more info on the rest of the MVC just post and I'll get it up here.

    Read the article

  • Is there a way of providing a final transform method when chaining operations (like map reduce) in underscore.js?

    - by latentflip
    (Really strugging to title this question, so if anyone has suggestions feel free.) Say I wanted to do an operation like: take an array [1,2,3] multiply each element by 2 (map): [2,4,6] add the elements together (reduce): 12 multiply the result by 10: 120 I can do this pretty cleanly in underscore using chaining, like so: arr = [1,2,3] map = (el) -> 2*el reduce = (s,n) -> s+n out = (r) -> 10*r reduced = _.chain(arr).map(map).reduce(reduce).value() result = out(reduced) However, it would be even nicer if I could chain the 'out' method too, like this: result = _.chain(arr).map(map).reduce(reduce).out(out).value() Now this would be a fairly simple addition to a library like underscore. But my questions are: Does this 'out' method have a name in functional programming? Does this already exist in underscore (tap comes close, but not quite).

    Read the article

  • Gradient a Parallelogram

    - by nuclearpenguin
    I'm working in JavaScript drawing on a canvas, and have four coordinates to draw a parallelogram, called A, B, C, and D starting from the top-left, top-right, bottom-left, and bottom right, respectively. An example of some coordinates might be: A: (3, 3) B: (4, 3) C: (1, 0) D: (2, 0) I can draw the parallelogram just fine, but I would like to fill it in with a gradient. I want the gradient to fill in from left to right, but matching the angle of the shape. The library I use (CAKE) requires a start and stop coordinate for the gradient. My stop and start would be somewhere half way between A and C, and end somewhere half way between B and D. Of course, it is not simply EXACTLY half way because the angles at A, B, C, and D are not right angles. So given this information (the coordinates), how to I find the point on the line A - C to start, and the point on the line B - D to stop? Remember, I'm doing this in JavaScript, so I have some good Math tools at my disposal for calculation.

    Read the article

  • Check something before django server starts

    - by Vijay Shankar Kalyanaraman
    I am running my api behind a django server and say I have a one time token that is needed by the django application and used through out its existence until the process quits. To check if I can proceed and serve requests (using the django server) I need to validate this token against a database entry. Now, I can have a script that hits the db, then issues the run server command if the token is valid. But if the db used by the django applications change, I will have to change the script also to point to the same db. Is there a way I can pass this token into the runserver command as an additional parameter (along with hostname:port) and validate this before django serves any requests? How can I access this parameter that is sent into ./manage.py runserver. Thanks.

    Read the article

  • How to access the relative directory of a ASP.NET website?

    - by Michael Schilling
    I need to access a folder that will contain various text files for my web site. I'm using Visual Web Developer 2010 Express. I made a web site using visual basic. Here is the failing code: Dim fileName As String fileName = CurDir.ToString + fileName.Text + ".txt" FileOpen(1, fileName, OpenMode.Output) FileClose(1) CurDir.ToString is giving me strange directory path that isn't anywhere near where my website files are located. I need to be able to access the files in a folder inside of the WebSite1 folder without using C:\Users\..., but I'm at a loss on how to do that. Can anyone help me out?

    Read the article

  • Basic CHMOD restriction

    - by Marshall Mathews
    i have an uploads folder on my website. What i want to do is restrict users from accessing like i dont want them to go to www.mysite.com/uploads/ and see the files in there and it should show forbidden, but they should be able to download via my website, for example www.mysite.com/downloads.php?id=1 If thats not possible, how can i atleast not show them the directory index on /uploads How is it that file sharing websites does this? An htaccess with deny from all stops php from accessing the file as well Please tell me a solution if you would know, i googled and asked on irc a few days ago about this issue, its pretty confusing to me.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >