Search Results

Search found 3 results on 1 pages for 'tbw'.

Page 1/1 | 1 

  • Measuring 'total bytes written' under Linux

    - by badnews
    We're quite interested in exploring the possibility of using SSD drives in a server environment. However, one thing that we need to establish is expected drive longevity. According to this article manufacturer's are reporting drive endurance in terms of 'total bytes written' (TBW). E.g. from that article a Crucial C400 SSD is rated at 72TB TBW. Do any scripts/tools exist under the Linux ecosystem to help us measure TBW? (and then make a more educated decision on the feasibility of using SSD drives)

    Read the article

  • JSP/Struts2/Hibernate: loop through a self-referencing table.

    - by TBW
    Hello everyone, Let's say we have a self-referencing table called PERSON, with the following columns: ID, PARENT, where PARENT is a foreign key to the ID column of another element in the PERSON table. Of course, many persons can have the same parent. I use Hibernate 3 in lazy fetching mode to deal with the database. Hibernate fetches a person element from the database, which is then put in the ValueStack by the Struts2 action, to be used on the result JSP page. Now the question is : In JSP, how can I do to display all the child (and the child's child, and so on, like a family tree) of this person element? Of course, for the n+1 children I can use the < s:iterator tag over the person.person. I can also nest another < s:iterator tag over person.person.person to get the n+2 children. But what if I want to do this in an automated manner, up to the last n+p child, displaying in the process all the children of all the n+1..n+p elements? I hope I have been clear enough. Thank you all for your time. -- TBW.

    Read the article

  • Tile-based 2D collision detection problems

    - by Vee
    I'm trying to follow this tutorial http://www.tonypa.pri.ee/tbw/tut05.html to implement real-time collisions in a tile-based world. I find the center coordinates of my entities thanks to these properties: public float CenterX { get { return X + Width / 2f; } set { X = value - Width / 2f; } } public float CenterY { get { return Y + Height / 2f; } set { Y = value - Height / 2f; } } Then in my update method, in the player class, which is called every frame, I have this code: public override void Update() { base.Update(); int downY = (int)Math.Floor((CenterY + Height / 2f - 1) / 16f); int upY = (int)Math.Floor((CenterY - Height / 2f) / 16f); int leftX = (int)Math.Floor((CenterX + Speed * NextX - Width / 2f) / 16f); int rightX = (int)Math.Floor((CenterX + Speed * NextX + Width / 2f - 1) / 16f); bool upleft = Game.CurrentMap[leftX, upY] != 1; bool downleft = Game.CurrentMap[leftX, downY] != 1; bool upright = Game.CurrentMap[rightX, upY] != 1; bool downright = Game.CurrentMap[rightX, downY] != 1; if(NextX == 1) { if (upright && downright) CenterX += Speed; else CenterX = (Game.GetCellX(CenterX) + 1)*16 - Width / 2f; } } downY, upY, leftX and rightX should respectively find the lowest Y position, the highest Y position, the leftmost X position and the rightmost X position. I add + Speed * NextX because in the tutorial the getMyCorners function is called with these parameters: getMyCorners (ob.x+ob.speed*dirx, ob.y, ob); The GetCellX and GetCellY methods: public int GetCellX(float mX) { return (int)Math.Floor(mX / SGame.Camera.TileSize); } public int GetCellY(float mY) { return (int)Math.Floor(mY / SGame.Camera.TileSize); } The problem is that the player "flickers" while hitting a wall, and the corner detection doesn't even work correctly since it can overlap walls that only hit one of the corners. I do not understand what is wrong. In the tutorial the ob.x and ob.y fields should be the same as my CenterX and CenterY properties, and the ob.width and ob.height should be the same as Width / 2f and Height / 2f. However it still doesn't work. Thanks for your help.

    Read the article

1