Search Results

Search found 1800 results on 72 pages for 'square eyes'.

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

  • Graph databases and Php

    - by stagas
    I want to use a graph database using php. Can you point out some resources on where to get started? Is there any example code / tutorial out there? Or are there any other methods of storing data that relate to each other in totally random/abstract situations? Very abstract example of the relations needed: John relates to Mary, both relate to School, John is Tall, Mary is Short, John has Blue Eyes, Mary has Green Eyes, query I want is which people are related to 'Short people that have Green Eyes and go to School' - answer John It is possible in MySQL but it would require a fixed set of attributes/columns for each item and a complex non-flexible query, instead I need every attribute to be an item by itself and instead of 'belonging' to something, to be 'related' to something.

    Read the article

  • Programmer Health - how to avoid going blind and sick!

    - by stefanyko
    Hi All! this is my very first time here! so nice to meet you guys! ;-) When i was starting with this job, ( when i have chosed of doing this for the rest of my life) i have thinked also, one day, before or after, i would become blind or at least sick by drinking 5 or more coffee per day and of course by sitting down on my pc for hours!!! ;-\ From many years now, i'm asking myself how my eyes can stay in front o the monitor for so many hours per day!? well now i'm to a point of no return!!! i feel my eyes each day more tired, and my productivity is waning, but i can't change work now and i don't want do this!!!! what i need to do for prevent this to become a more serious problem for me and for my eyes!? any suggestion will be really appreciated!!! Thanks!

    Read the article

  • Wikipedia A* pathfinding algorithm takes a lot of time

    - by Vee
    I've successfully implemented A* pathfinding in C# but it is very slow, and I don't understand why. I even tried not sorting the openNodes list but it's still the same. The map is 80x80, and there are 10-11 nodes. I took the pseudocode from here Wikipedia And this is my implementation: public static List<PGNode> Pathfind(PGMap mMap, PGNode mStart, PGNode mEnd) { mMap.ClearNodes(); mMap.GetTile(mStart.X, mStart.Y).Value = 0; mMap.GetTile(mEnd.X, mEnd.Y).Value = 0; List<PGNode> openNodes = new List<PGNode>(); List<PGNode> closedNodes = new List<PGNode>(); List<PGNode> solutionNodes = new List<PGNode>(); mStart.G = 0; mStart.H = GetManhattanHeuristic(mStart, mEnd); solutionNodes.Add(mStart); solutionNodes.Add(mEnd); openNodes.Add(mStart); // 1) Add the starting square (or node) to the open list. while (openNodes.Count > 0) // 2) Repeat the following: { openNodes.Sort((p1, p2) => p1.F.CompareTo(p2.F)); PGNode current = openNodes[0]; // a) We refer to this as the current square.) if (current == mEnd) { while (current != null) { solutionNodes.Add(current); current = current.Parent; } return solutionNodes; } openNodes.Remove(current); closedNodes.Add(current); // b) Switch it to the closed list. List<PGNode> neighborNodes = current.GetNeighborNodes(); double cost = 0; bool isCostBetter = false; for (int i = 0; i < neighborNodes.Count; i++) { PGNode neighbor = neighborNodes[i]; cost = current.G + 10; isCostBetter = false; if (neighbor.Passable == false || closedNodes.Contains(neighbor)) continue; // If it is not walkable or if it is on the closed list, ignore it. if (openNodes.Contains(neighbor) == false) { openNodes.Add(neighbor); // If it isn’t on the open list, add it to the open list. isCostBetter = true; } else if (cost < neighbor.G) { isCostBetter = true; } if (isCostBetter) { neighbor.Parent = current; // Make the current square the parent of this square. neighbor.G = cost; neighbor.H = GetManhattanHeuristic(current, neighbor); } } } return null; } Here's the heuristic I'm using: private static double GetManhattanHeuristic(PGNode mStart, PGNode mEnd) { return Math.Abs(mStart.X - mEnd.X) + Math.Abs(mStart.Y - mEnd.Y); } What am I doing wrong? It's an entire day I keep looking at the same code.

    Read the article

  • Display ñ on a C# .NET application

    - by mmr
    I have a localization issue. One of my industrious coworkers has replaced all the strings throughout our application with constants that are contained in a dictionary. That dictionary gets various strings placed in it once the user selects a language (English by default, but target languages are German, Spanish, French, Portuguese, Mandarin, and Thai). For our test of this functionality, we wanted to change a button to include text which has a ñ character, which appears both in Spanish and in the Arial Unicode MS font (which we're using throughout the application). Problem is, the ñ is appearing as a square block, as if the program did not know how to display it. When I debug into that particular string being read from disk, the debugger reports that character as a square block as well. So where is the failure? I think it could be in a few places: 1) Notepad may not be unicode aware, so the ñ displayed there is not the same as what vs2008 expects, and so the program interprets the character as a square (EDIT: notepad shows the same characters as vs; ie, they both show the ñ. In the same place.). 2) vs2008 can't handle ñ. I find that very, very hard to believe. 3) The text is read in properly, but the default font for vs2008 can't display it, which is why the debugger shows a square. 4) The text is not read in properly, and I should use something other than a regular StreamReader to get strings. 5) The text is read in properly, but the default String class in C# doesn't handle ñ well. I find that very, very hard to believe. 6) The version of Arial Unicode MS I have doesn't have ñ, despite it being listed as one of the 50k characters by http://www.fileinfo.info. Anything else I could have left out? Thanks for any help!

    Read the article

  • Array of Objects

    - by James
    Complete and utter neophyte to Objective-C and the entire Mac platform so don't flame me please =). Basically I'm trying to create a simple game. The game has a board which I've created a class for and a board is comprised of squares which I also created a class for (board and square respectively). In my view controller I'm trying to instantiate a board and add boardSize^2 squares to said object. board contains an NSMutableArray *squares. I've also created a convenience method which sets an NSNumber *boardSize called initWithDimension. In my touchesBegan handler I have the following: board *game_board = [[board alloc] initWithDimension:10]; int size = [game_board.boardSize intValue]; for(int i = 0; i <= size; i++) { square *s = [[square alloc] init]; [game_board.squares addObject:s]; [s release]; } NSLog(@"%i", size); NSLog(@"%@", [game_board.squares objectAtIndex:0]); ...and I'm getting 10 (as expected) and then (null). This is probably glaringly obvious to an experienced developer, I've just struggled for an hour trying to solve it and have given up. I've tried it without the [s release] as well, same result. I've also imported square.h and board.h. Any ideas what's wrong here? Any other comments on what I'm brutalizing? Thanks.

    Read the article

  • ActionScript - clicking and determining the sprite's class

    - by TheDarkIn1978
    i'd like to add all or most of my mouse events to stage, but in order to do that i need to be able to tell what is the type of the sprite being clicked. i've added two sprites to the display list, one of which is from a class called Square, the other from a class called Circle. var mySquare:Sprite = new Square(); var myCircle:Sprite = new Circle(); addChild(mySquare); addChild(myCircle); now when i click on these sprites, i'd like to know from which class they are from, or which type of sprite it is. //mousePoint returns mouse coordinates of the stage var myArray:Array = stage.getObjectsUnderPoint(mousePoint()); if (myArray[myArray.length - 1] is Sprite) ... so far i know how to do is determine if it IS a sprite display object, but since i'll only be working with sprites i need something more specific. rather than checking "is Sprite", is there a way i can check "is Square" or "is Circle"? if (myArray[myArray.length - 1] is Square)

    Read the article

  • split line of text

    - by plys
    Hi all, I was wondering if there is an algorithm to split a line into multiple lines, so that the resulting set of multiple lines fit into a square shape rather than a rectangle. Let me give some examples, Input: Hi this is a really long line. Output: Hi this is a really long line Input: a b c d e f Output: a b c d e f Input: This is really such looooooooooooooooooooong line.This is the end. Output: This is really such looooooooooooooooooooong line This is the end. If you see in the above examples, input line fits into a wide rectangle. But the output more or less fits into a square shape. Essentially what needs to be done here is simply count the number of characters in the line, take the square root of that number. Then put square root number of characters in each line. But in the above example, the splitting needs to be done by respecting word wraps instead of characters. Is there any standard algorithm for this? Any code examples/ pointers would be appreciated!

    Read the article

  • Find the number of congruent triangles?

    - by avd
    Say I have a square from (0,0) to (z,z). Given a triangle within this square which has integer coordinates for all its vertices. Find out the number of triangles within this square which are congruent to this triangle and have integer coordinates. My algorithm is as follows-- 1) Find out the minimum bounding rectangle(MBR) for the given triangle. 2) Find out the number of congruent triangles, y within that MBR, obtained after reflection, rotation of the given triangle. y can be either 2,4 or 8. 3) Now find out how many such MBR's can be drawn within the given big square, say x; (This is similar to finding number of squares on a chess board) 4) x*y is the required answer. Am I counting some triangles more than once or I am missing something by this algorithm? It is a problem on online judge? It gives me wrong answer. I have thought a lot about it, but I am not able to figure it out.

    Read the article

  • Override java methods without affecting parent behaviour

    - by Timmmm
    suppose I have this classes (sorry it's kind of hard to think of a simple example here; I don't want any "why would you want to do that?" answers!): class Squarer { public void setValue(int v) { mV = v; } public int getValue() { return mV; } private int mV; public void square() { setValue(getValue() * getValue()); } } class OnlyOddInputsSquarer extends Squarer { @Override public void setValue(int v) { if (v % 2 == 0) { print("Sorry, this class only lets you square odd numbers!") return; } super.setValue(v); } } auto s = new OnlyOddInputsSquarer(); s.setValue(3); s.square(); This won't work. When Squarer.square() calls setValue(), it will go to OnlyOddInputsSquarer.setValue() which will reject all its values (since all squares are even). Is there any way I can override setValue() so that all the functions in Squarer still use the method defined there? PS: Sorry, java doesn't have an auto keyword you haven't heard about! Wishful thinking on my part.

    Read the article

  • AS3 colorTransform over multiple frames?

    - by user359519
    (Flash Professional, AS3) I'm working on a custom avatar system where you can select various festures and colors. For example, I have 10 hairstyles, and a colorPicker to change the color. mc_myAvatar has 10 frames. Each frame has a movieclip of a different hairstyle (HairStyle1, HairStyle2, etc.) Here's my code: var hairColor:ColorTransform; hairColor = mc_myAvatar.hair.colorLayer.transform.colorTransform; hairColor.color = 0xCCCC00; mc_myAvatar.hair.colorLayer.transform.colorTransform = hairColor; This correctly changes the initial color. I have a "nextHair" button to advance mc_myAvatar.hair to the next frame. When I click the button, I get an error message saying that I have a null object reference. I added a trace, and mc_myAvatar.hair.colorLayer is null on frame 2. Why??? I've clearly named HairStyle2 as "colorLayer" in frame 2. I think the problem is related to me using the same name for different classes/movieclips, but I don't know how to fix the problem... I added a square movieclip below my hairStyle movieclips, named the square "colorLevel", and deleted the name from my hairStyle clips. When I click the next button, the square correctly maintains the color from frame to frame. However, having a square doesn't do me much good. :( I tried converting the hairStyle layer to a mask. Doing this, however, results in yet another "null object" error - mc_myAvatar.hair.colorLayer is null after frame 1. I even tried "spanning" my colorLevel across all frames (no keyframes), thinking that this would give me just one movieclip to work with. No luck. Same error! What's going on, here? Why am I getting these null objects, when they are clearly defined in my movieclip? I'm also open to suggestions on a better way to do multiple frames and colors.

    Read the article

  • Optical Illusion Freezes Water In Place [Video]

    - by Jason Fitzpatrick
    This clever optical illusion uses sound frequency and a digital camera to “freeze” water in time and space. YouTube user MrBibio explains the hack: Creating the illusion of a static flow of water using sound. Of course this isn’t my idea and plenty more refined examples already exist. I tried this same experiment years ago but using a strobe light, but it’s harsh on the eyes after a while and hard to video successfully. It only dawned on me shortly before making this that for video purposes, no strobe light is required. This is because the frame rate and shutter of the camera is doing a similar job to the strobe. The speaker-as-frequency-generator model is definitely easier on the eyes than similar experiments that rely on high-speed strobes. How to Stress Test the Hard Drives in Your PC or Server How To Customize Your Android Lock Screen with WidgetLocker The Best Free Portable Apps for Your Flash Drive Toolkit

    Read the article

  • Reducing brightness of large areas containing bright colours

    - by intuited
    I do most of my work in either a terminal or a web browser. I prefer my terminals to use bright colours on dark. I would really prefer that web pages tended to look this way as well, but that's not under my control. The problem is that when I switch from a light-on-dark terminal to a dark-on-light web page (like this one), my eyes have to adjust to the overall rise in screen brightness. Apparently this is bad for your eyes, in addition to being painful and annoying. It would seem to be possible for some layer of the interface to adjust the displayed colours for parts of the screen, or perhaps for particular windows, to reduce the brightness of the brighter areas of the screen. Can this be done, possibly with a Compiz extension?

    Read the article

  • Just too bright

    - by Bunch
    Like a lot of folks I am using SSMS and VS pretty much all day. But staring at the text on the stark white background can be a bit much for my eyes after a while. I have seen quite a few different “themes” for these apps which change all the colors around to make it easier on your eyes. Some of them are pretty cool but all I really wanted was to dim the background a little not radically change the way everything looked. Since the stock colors for comments, breakpoints, keywords and the like are so familiar I wanted a background that did not interfere with those colors. So I picked the following custom color for the item background. It comes off as a parchment type color. Hue: 42        Red: 244 Sat: 123    Green: 245 Lum: 221    Blue: 224

    Read the article

  • Understanding implementation of glu.PickMatrix()

    - by stoney78us
    I am working on an OpenGL project which requires object selection feature. I use OpenTK framework to do this; however OpenTK doesn't support glu.PickMatrix() method to define the picking region. I ended up googling its implementation and here is what i got: void GluPickMatrix(double x, double y, double deltax, double deltay, int[] viewport) { if (deltax <= 0 || deltay <= 0) { return; } GL.Translate((viewport[2] - 2 * (x - viewport[0])) / deltax, (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); GL.Scale(viewport[2] / deltax, viewport[3] / deltay, 1.0); } I totally fail to understand this piece of code. Moreover, this doesn't work with my following code sample: //selectbuffer private int[] _selectBuffer = new int[512]; private void Init() { float[] triangleVertices = new float[] { 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f }; float[] _triangleColors = new float[] { 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }; GL.GenBuffers(2, _vBO); GL.BindBuffer(BufferTarget.ArrayBuffer, _vBO[0]); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(sizeof(float) * _triangleVertices.Length), _triangleVertices, BufferUsageHint.StaticDraw); GL.VertexPointer(3, VertexPointerType.Float, 0, 0); GL.BindBuffer(BufferTarget.ArrayBuffer, _vBO[1]); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(sizeof(float) * _triangleColors.Length), _triangleColors, BufferUsageHint.StaticDraw); GL.ColorPointer(3, ColorPointerType.Float, 0, 0); GL.EnableClientState(ArrayCap.VertexArray); GL.EnableClientState(ArrayCap.ColorArray); //Selectbuffer set up GL.SelectBuffer(512, _selectBuffer); } private void glControlWindow_Paint(object sender, PaintEventArgs e) { GL.Clear(ClearBufferMask.ColorBufferBit); GL.Clear(ClearBufferMask.DepthBufferBit); float[] eyes = { 0.0f, 0.0f, -10.0f }; float[] target = { 0.0f, 0.0f, 0.0f }; Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView(0.785398163f, 4.0f / 3.0f, 0.1f, 100f); //45 degree = 0.785398163 rads Matrix4 view = Matrix4.LookAt(eyes[0], eyes[1], eyes[2], target[0], target[1], target[2], 0, 1, 0); Matrix4 model = Matrix4.Identity; Matrix4 MV = view * model; //First Clear Buffers GL.Clear(ClearBufferMask.ColorBufferBit); GL.Clear(ClearBufferMask.DepthBufferBit); GL.MatrixMode(MatrixMode.Projection); GL.LoadIdentity(); GL.LoadMatrix(ref projection); GL.MatrixMode(MatrixMode.Modelview); GL.LoadIdentity(); GL.LoadMatrix(ref MV); GL.Viewport(0, 0, glControlWindow.Width, glControlWindow.Height); GL.Enable(EnableCap.DepthTest); //Enable correct Z Drawings GL.DepthFunc(DepthFunction.Less); //Enable correct Z Drawings GL.MatrixMode(MatrixMode.Modelview); GL.PushMatrix(); GL.Translate(3.0f, 0.0f, 0.0f); DrawTriangle(); GL.PopMatrix(); GL.PushMatrix(); GL.Translate(-3.0f, 0.0f, 0.0f); DrawTriangle(); GL.PopMatrix(); //Finally... GraphicsContext.CurrentContext.VSync = true; //Caps frame rate as to not over run GPU glControlWindow.SwapBuffers(); //Takes from the 'GL' and puts into control } private void DrawTriangle() { GL.BindBuffer(BufferTarget.ArrayBuffer, _vBO[0]); GL.VertexPointer(3, VertexPointerType.Float, 0, 0); GL.EnableClientState(ArrayCap.VertexArray); GL.DrawArrays(BeginMode.Triangles, 0, 3); GL.DisableClientState(ArrayCap.VertexArray); } //mouse click event implementation private void glControlWindow_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { //Enter Select mode. Pretend drawing. GL.RenderMode(RenderingMode.Select); int[] viewport = new int[4]; GL.GetInteger(GetPName.Viewport, viewport); GL.PushMatrix(); GL.MatrixMode(MatrixMode.Projection); GL.LoadIdentity(); GluPickMatrix(e.X, e.Y, 5, 5, viewport); Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView(0.785398163f, 4.0f / 3.0f, 0.1f, 100f); // this projection matrix is the same as one in glControlWindow_Paint method. GL.LoadMatrix(ref projection); GL.MatrixMode(MatrixMode.Modelview); int i = 0; int hits; GL.PushMatrix(); GL.Translate(3.0f, 0.0f, 0.0f); GL.PushName(i); DrawTriangle(); GL.PopName(); GL.PopMatrix(); i++; GL.PushMatrix(); GL.Translate(-3.0f, 0.0f, 0.0f); GL.PushName(i); DrawTriangle(); GL.PopName(); GL.PopMatrix(); hits = GL.RenderMode(RenderingMode.Render); .....hits processing code goes here... GL.PopMatrix(); glControlWindow.Invalidate(); } I expect to get only one hit everytime i click inside a triangle, but i always get 2 no matter where i click. I suspect there is something wrong with the implementation of the GluPickMatrix, I haven't figured out yet.

    Read the article

  • How to egrep the first character in second column?

    - by Steve
    using egrep, how can i print all lastnames start with K or k ??? Jennifer Cowan:548-834-2348:583 Laurel Ave., Kingsville, TX 83745:10/1/35:58900 Lesley Kirstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62:52600 Jennifer Cowan:548-834-2348:583 Laurel Ave., kingsville, TX 83745:10/1/35:58900 Lesley kirstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62:52600 William Kopf:846-836-2837:6937 Ware Road, Milton, PA 93756:9/21/46:43500 Arthur Putie:923-835-8745:23 Wimp Lane, Kensington, DL 38758:8/31/69:126000

    Read the article

  • Are Socket AM2/AM2+ Heatsinks Compatible with Socket AM3 processor?

    - by wag2639
    I bought an Asus Lion Square compatible with a AMD Athlon II X3 435 Socket AM3 processor? I know strictly speaking, the Lion Square specifies AM2 but I'm a little confused since AM2 and AM3 are suppose to be socket compatible (I'm a little confused here as well but I assume it means an AM3 board will support AM2/AM2+ CPUs). However, will there be a problem with chip height and spacing? Or do people have experience asking ASUS for a standoff adapter?

    Read the article

  • inkscape stroke inaccurate

    - by oshirowanen
    I am trying to add a stroke to a rectangle object, but if I add a 1px stroke, it places it 0.5px outside the edge of the rectangle and 0.5px inside the rectangle. I find this to be annoying when I want an object to be exactly 5px by 5px and it ends up becoming 6px by 6px. Is there a setting anywhere which places the stroke within the rectangle edge so a 5px by 5px square remains a 5px by 5px square. Please help.

    Read the article

  • Are Socket AM2/AM2+ Heatsinks Compatible with Socket AM3 Heatsinks?

    - by wag2639
    I bought an Asus Lion Square compatible with a AMD Athlon II X3 435 Socket AM3 processor? I know strictly speaking, the Lion Square specifies AM2 but I'm a little confused since AM2 and AM3 are suppose to be socket compatible (I'm a little confused here as well but I assume it means an AM3 board will support AM2/AM2+ CPUs). However, will there be a problem with chip height and spacing? Or do people have experience asking ASUS for a standoff adapter?

    Read the article

  • What advantage does a 2400x600 dpi printer have over a 1200x1200 dpi printer?

    - by Cygon
    I've seen laser printers with a resolutions of 1200x1200 dpi and, strangely, 2400x600 dpi. As the measure is dots per inch, not Kdots on a page or something (where a higher vertical resolution might make sense because paper is rectangular, not square), I'm wondering what the uneven resolution is good for. Why print one square inch with 2400 dots vertically but only 600 horizontally? Does this look more detailed than 1200 by 1200 dots? Or is it better for textile printing or some other special case?

    Read the article

  • Word Find - find any highlighted text that starts with a squared bracket

    - by user2953311
    Is there a way to Find highlighted text that ONLY begins with a open square bracket? I've tried using the square bracket as a wildcard, but it won't find any adjoining words. For example, I have a document containing conditional paragraphs, in squared brackets, with the "name" of the paragraph highlighted at the beginning: "[Document to return Thank you for sending the documents requested earlier.]" (the section in bold is highlighted in blue in Word) Is there a way to find "[Document to return"? I hope this makes sense Thanks in advance

    Read the article

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