Search Results

Search found 1562 results on 63 pages for 'edge'.

Page 8/63 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • In Sublime Text 2, how can I indent out to a straight column with multiple cursors on a ragged edge?

    - by mtoast
    Suppose I've got multiple cursors along several lines, like this: foo| barr| foobar| baz| How can I automatically push the whitespace at the end of each line out to a flat edge, like this?: foo | barr | foobar | baz | (In these examples, | is supposed to be my cursor.) EDIT #1 When you just Tab or Space from the initial arrangement, you get this: # Useful, but not what I'm looking for foo | barr | foobar | baz | That's useful, but not what I'm looking for. I'm looking for some kind of keyboard shortcut that will let me indent from a ragged multi-cursor insert out to a straight column.

    Read the article

  • How can I store this kind of graph in neo4j for fast traversal?

    - by James
    This is a graph whose nodes exist in many connected components at once because a node's relationships are a collection of edge groups such that only one edge per edge group can be present at once. I need to be able to find all of the connected components that a node exists in. What would be the best way to store this graph in neo4j to quickly find all of the connected components that a node exists in? Is there a way to use the built in traversals to do this? Also: is there a name for this kind of graph? I'd appreciate any help/ideas. Update: Sorry for not being clear. All nodes are of the same type. Nodes have a variable number of edge groups. Exactly one edge from each edge group needs to be chosen for a particular connected component. I'm going to try to explain through example: Node x1 is related to: (x2 or x3 or x4) AND (x5 or x6) AND (x7) Node x2 is related to: (x8) AND (x9 or x10) So x1's first edge group is (x2, x3, x4), its second edge group is (x5, x6), and its third edge group is (x7). So here are a few connected components that x1 exists in: CC1: x1 is related to: x2, x5, x7 x2 is related to: x8 x9 CC2: x1 is related to: x2, x6, x7 x2 is related to: x8, x9 CC3: x1 is related to: x3, x5, x7 CC4: x1 is related to: x3, x6, x7 etc. I'm grateful for your help in this.

    Read the article

  • Ball bouncing at a certain angle and efficiency computations

    - by X Y
    I would like to make a pong game with a small twist (for now). Every time the ball bounces off one of the paddles i want it to be under a certain angle (between a min and a max). I simply can't wrap my head around how to actually do it (i have some thoughts and such but i simply cannot implement them properly - i feel i'm overcomplicating things). Here's an image with a small explanation . One other problem would be that the conditions for bouncing have to be different for every edge. For example, in the picture, on the two small horizontal edges i do not want a perfectly vertical bounce when in the middle of the edge but rather a constant angle (pi/4 maybe) in either direction depending on the collision point (before the middle of the edge, or after). All of my collisions are done with the Separating Axes Theorem (and seem to work fine). I'm looking for something efficient because i want to add a lot of things later on (maybe polygons with many edges and such). So i need to keep to a minimum the amount of checking done every frame. The collision algorithm begins testing whenever the bounding boxes of the paddle and the ball intersect. Is there something better to test for possible collisions every frame? (more efficient in the long run,with many more objects etc, not necessarily easy to code). I'm going to post the code for my game: Paddle Class public class Paddle : Microsoft.Xna.Framework.DrawableGameComponent { #region Private Members private SpriteBatch spriteBatch; private ContentManager contentManager; private bool keybEnabled; private bool isLeftPaddle; private Texture2D paddleSprite; private Vector2 paddlePosition; private float paddleSpeedY; private Vector2 paddleScale = new Vector2(1f, 1f); private const float DEFAULT_Y_SPEED = 150; private Vector2[] Normals2Edges; private Vector2[] Vertices = new Vector2[4]; private List<Vector2> lst = new List<Vector2>(); private Vector2 Edge; #endregion #region Properties public float Speed { get {return paddleSpeedY; } set { paddleSpeedY = value; } } public Vector2[] Normal2EdgesVector { get { NormalsToEdges(this.isLeftPaddle); return Normals2Edges; } } public Vector2[] VertexVector { get { return Vertices; } } public Vector2 Scale { get { return paddleScale; } set { paddleScale = value; NormalsToEdges(this.isLeftPaddle); } } public float X { get { return paddlePosition.X; } set { paddlePosition.X = value; } } public float Y { get { return paddlePosition.Y; } set { paddlePosition.Y = value; } } public float Width { get { return (Scale.X == 1f ? (float)paddleSprite.Width : paddleSprite.Width * Scale.X); } } public float Height { get { return ( Scale.Y==1f ? (float)paddleSprite.Height : paddleSprite.Height*Scale.Y ); } } public Texture2D GetSprite { get { return paddleSprite; } } public Rectangle Boundary { get { return new Rectangle((int)paddlePosition.X, (int)paddlePosition.Y, (int)this.Width, (int)this.Height); } } public bool KeyboardEnabled { get { return keybEnabled; } } #endregion private void NormalsToEdges(bool isLeftPaddle) { Normals2Edges = null; Edge = Vector2.Zero; lst.Clear(); for (int i = 0; i < Vertices.Length; i++) { Edge = Vertices[i + 1 == Vertices.Length ? 0 : i + 1] - Vertices[i]; if (Edge != Vector2.Zero) { Edge.Normalize(); //outer normal to edge !! (origin in top-left) lst.Add(new Vector2(Edge.Y, -Edge.X)); } } Normals2Edges = lst.ToArray(); } public float[] ProjectPaddle(Vector2 axis) { if (Vertices.Length == 0 || axis == Vector2.Zero) return (new float[2] { 0, 0 }); float min, max; min = Vector2.Dot(axis, Vertices[0]); max = min; for (int i = 1; i < Vertices.Length; i++) { float p = Vector2.Dot(axis, Vertices[i]); if (p < min) min = p; else if (p > max) max = p; } return (new float[2] { min, max }); } public Paddle(Game game, bool isLeftPaddle, bool enableKeyboard = true) : base(game) { contentManager = new ContentManager(game.Services); keybEnabled = enableKeyboard; this.isLeftPaddle = isLeftPaddle; } public void setPosition(Vector2 newPos) { X = newPos.X; Y = newPos.Y; } public override void Initialize() { base.Initialize(); this.Speed = DEFAULT_Y_SPEED; X = 0; Y = 0; NormalsToEdges(this.isLeftPaddle); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); paddleSprite = contentManager.Load<Texture2D>(@"Content\pongBar"); } public override void Update(GameTime gameTime) { //vertices array Vertices[0] = this.paddlePosition; Vertices[1] = this.paddlePosition + new Vector2(this.Width, 0); Vertices[2] = this.paddlePosition + new Vector2(this.Width, this.Height); Vertices[3] = this.paddlePosition + new Vector2(0, this.Height); // Move paddle, but don't allow movement off the screen if (KeyboardEnabled) { float moveDistance = Speed * (float)gameTime.ElapsedGameTime.TotalSeconds; KeyboardState newKeyState = Keyboard.GetState(); if (newKeyState.IsKeyDown(Keys.Down) && Y + paddleSprite.Height + moveDistance <= Game.GraphicsDevice.Viewport.Height) { Y += moveDistance; } else if (newKeyState.IsKeyDown(Keys.Up) && Y - moveDistance >= 0) { Y -= moveDistance; } } else { if (this.Y + this.Height > this.GraphicsDevice.Viewport.Height) { this.Y = this.Game.GraphicsDevice.Viewport.Height - this.Height - 1; } } base.Update(gameTime); } public override void Draw(GameTime gameTime) { spriteBatch.Begin(SpriteSortMode.Texture,null); spriteBatch.Draw(paddleSprite, paddlePosition, null, Color.White, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0); spriteBatch.End(); base.Draw(gameTime); } } Ball Class public class Ball : Microsoft.Xna.Framework.DrawableGameComponent { #region Private Members private SpriteBatch spriteBatch; private ContentManager contentManager; private const float DEFAULT_SPEED = 50; private float speedIncrement = 0; private Vector2 ballScale = new Vector2(1f, 1f); private const float INCREASE_SPEED = 50; private Texture2D ballSprite; //initial texture private Vector2 ballPosition; //position private Vector2 centerOfBall; //center coords private Vector2 ballSpeed = new Vector2(DEFAULT_SPEED, DEFAULT_SPEED); //speed #endregion #region Properties public float DEFAULTSPEED { get { return DEFAULT_SPEED; } } public Vector2 ballCenter { get { return centerOfBall; } } public Vector2 Scale { get { return ballScale; } set { ballScale = value; } } public float SpeedX { get { return ballSpeed.X; } set { ballSpeed.X = value; } } public float SpeedY { get { return ballSpeed.Y; } set { ballSpeed.Y = value; } } public float X { get { return ballPosition.X; } set { ballPosition.X = value; } } public float Y { get { return ballPosition.Y; } set { ballPosition.Y = value; } } public Texture2D GetSprite { get { return ballSprite; } } public float Width { get { return (Scale.X == 1f ? (float)ballSprite.Width : ballSprite.Width * Scale.X); } } public float Height { get { return (Scale.Y == 1f ? (float)ballSprite.Height : ballSprite.Height * Scale.Y); } } public float SpeedIncreaseIncrement { get { return speedIncrement; } set { speedIncrement = value; } } public Rectangle Boundary { get { return new Rectangle((int)ballPosition.X, (int)ballPosition.Y, (int)this.Width, (int)this.Height); } } #endregion public Ball(Game game) : base(game) { contentManager = new ContentManager(game.Services); } public void Reset() { ballSpeed.X = DEFAULT_SPEED; ballSpeed.Y = DEFAULT_SPEED; ballPosition.X = Game.GraphicsDevice.Viewport.Width / 2 - ballSprite.Width / 2; ballPosition.Y = Game.GraphicsDevice.Viewport.Height / 2 - ballSprite.Height / 2; } public void SpeedUp() { if (ballSpeed.Y < 0) ballSpeed.Y -= (INCREASE_SPEED + speedIncrement); else ballSpeed.Y += (INCREASE_SPEED + speedIncrement); if (ballSpeed.X < 0) ballSpeed.X -= (INCREASE_SPEED + speedIncrement); else ballSpeed.X += (INCREASE_SPEED + speedIncrement); } public float[] ProjectBall(Vector2 axis) { if (axis == Vector2.Zero) return (new float[2] { 0, 0 }); float min, max; min = Vector2.Dot(axis, this.ballCenter) - this.Width/2; //center - radius max = min + this.Width; //center + radius return (new float[2] { min, max }); } public void ChangeHorzDirection() { ballSpeed.X *= -1; } public void ChangeVertDirection() { ballSpeed.Y *= -1; } public override void Initialize() { base.Initialize(); ballPosition.X = Game.GraphicsDevice.Viewport.Width / 2 - ballSprite.Width / 2; ballPosition.Y = Game.GraphicsDevice.Viewport.Height / 2 - ballSprite.Height / 2; } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); ballSprite = contentManager.Load<Texture2D>(@"Content\ball"); } public override void Update(GameTime gameTime) { if (this.Y < 1 || this.Y > GraphicsDevice.Viewport.Height - this.Height - 1) this.ChangeVertDirection(); centerOfBall = new Vector2(ballPosition.X + this.Width / 2, ballPosition.Y + this.Height / 2); base.Update(gameTime); } public override void Draw(GameTime gameTime) { spriteBatch.Begin(); spriteBatch.Draw(ballSprite, ballPosition, null, Color.White, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0); spriteBatch.End(); base.Draw(gameTime); } } Main game class public class gameStart : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public gameStart() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.Window.Title = "Pong game"; } protected override void Initialize() { ball = new Ball(this); paddleLeft = new Paddle(this,true,false); paddleRight = new Paddle(this,false,true); Components.Add(ball); Components.Add(paddleLeft); Components.Add(paddleRight); this.Window.AllowUserResizing = false; this.IsMouseVisible = true; this.IsFixedTimeStep = false; this.isColliding = false; base.Initialize(); } #region MyPrivateStuff private Ball ball; private Paddle paddleLeft, paddleRight; private int[] bit = { -1, 1 }; private Random rnd = new Random(); private int updates = 0; enum nrPaddle { None, Left, Right }; private nrPaddle PongBar = nrPaddle.None; private ArrayList Axes = new ArrayList(); private Vector2 MTV; //minimum translation vector private bool isColliding; private float overlap; //smallest distance after projections private Vector2 overlapAxis; //axis of overlap #endregion protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); paddleLeft.setPosition(new Vector2(0, this.GraphicsDevice.Viewport.Height / 2 - paddleLeft.Height / 2)); paddleRight.setPosition(new Vector2(this.GraphicsDevice.Viewport.Width - paddleRight.Width, this.GraphicsDevice.Viewport.Height / 2 - paddleRight.Height / 2)); paddleLeft.Scale = new Vector2(1f, 2f); //scale left paddle } private bool ShapesIntersect(Paddle paddle, Ball ball) { overlap = 1000000f; //large value overlapAxis = Vector2.Zero; MTV = Vector2.Zero; foreach (Vector2 ax in Axes) { float[] pad = paddle.ProjectPaddle(ax); //pad0 = min, pad1 = max float[] circle = ball.ProjectBall(ax); //circle0 = min, circle1 = max if (pad[1] <= circle[0] || circle[1] <= pad[0]) { return false; } if (pad[1] - circle[0] < circle[1] - pad[0]) { if (Math.Abs(overlap) > Math.Abs(-pad[1] + circle[0])) { overlap = -pad[1] + circle[0]; overlapAxis = ax; } } else { if (Math.Abs(overlap) > Math.Abs(circle[1] - pad[0])) { overlap = circle[1] - pad[0]; overlapAxis = ax; } } } if (overlapAxis != Vector2.Zero) { MTV = overlapAxis * overlap; } return true; } protected override void Update(GameTime gameTime) { updates += 1; float ftime = 5 * (float)gameTime.ElapsedGameTime.TotalSeconds; if (updates == 1) { isColliding = false; int Xrnd = bit[Convert.ToInt32(rnd.Next(0, 2))]; int Yrnd = bit[Convert.ToInt32(rnd.Next(0, 2))]; ball.SpeedX = Xrnd * ball.SpeedX; ball.SpeedY = Yrnd * ball.SpeedY; ball.X += ftime * ball.SpeedX; ball.Y += ftime * ball.SpeedY; } else { updates = 100; ball.X += ftime * ball.SpeedX; ball.Y += ftime * ball.SpeedY; } //autorun :) paddleLeft.Y = ball.Y; //collision detection PongBar = nrPaddle.None; if (ball.Boundary.Intersects(paddleLeft.Boundary)) { PongBar = nrPaddle.Left; if (!isColliding) { Axes.Clear(); Axes.AddRange(paddleLeft.Normal2EdgesVector); //axis from nearest vertex to ball's center Axes.Add(FORMULAS.NormAxisFromCircle2ClosestVertex(paddleLeft.VertexVector, ball.ballCenter)); } } else if (ball.Boundary.Intersects(paddleRight.Boundary)) { PongBar = nrPaddle.Right; if (!isColliding) { Axes.Clear(); Axes.AddRange(paddleRight.Normal2EdgesVector); //axis from nearest vertex to ball's center Axes.Add(FORMULAS.NormAxisFromCircle2ClosestVertex(paddleRight.VertexVector, ball.ballCenter)); } } if (PongBar != nrPaddle.None && !isColliding) switch (PongBar) { case nrPaddle.Left: if (ShapesIntersect(paddleLeft, ball)) { isColliding = true; if (MTV != Vector2.Zero) ball.X += MTV.X; ball.Y += MTV.Y; ball.ChangeHorzDirection(); } break; case nrPaddle.Right: if (ShapesIntersect(paddleRight, ball)) { isColliding = true; if (MTV != Vector2.Zero) ball.X += MTV.X; ball.Y += MTV.Y; ball.ChangeHorzDirection(); } break; default: break; } if (!ShapesIntersect(paddleRight, ball) && !ShapesIntersect(paddleLeft, ball)) isColliding = false; ball.X += ftime * ball.SpeedX; ball.Y += ftime * ball.SpeedY; //check ball movement if (ball.X > paddleRight.X + paddleRight.Width + 2) { //IncreaseScore(Left); ball.Reset(); updates = 0; return; } else if (ball.X < paddleLeft.X - 2) { //IncreaseScore(Right); ball.Reset(); updates = 0; return; } base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Aquamarine); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.End(); base.Draw(gameTime); } } And one method i've used: public static Vector2 NormAxisFromCircle2ClosestVertex(Vector2[] vertices, Vector2 circle) { Vector2 temp = Vector2.Zero; if (vertices.Length > 0) { float dist = (circle.X - vertices[0].X) * (circle.X - vertices[0].X) + (circle.Y - vertices[0].Y) * (circle.Y - vertices[0].Y); for (int i = 1; i < vertices.Length;i++) { if (dist > (circle.X - vertices[i].X) * (circle.X - vertices[i].X) + (circle.Y - vertices[i].Y) * (circle.Y - vertices[i].Y)) { temp = vertices[i]; //memorize the closest vertex dist = (circle.X - vertices[i].X) * (circle.X - vertices[i].X) + (circle.Y - vertices[i].Y) * (circle.Y - vertices[i].Y); } } temp = circle - temp; temp.Normalize(); } return temp; } Thanks in advance for any tips on the 4 issues. EDIT1: Something isn't working properly. The collision axis doesn't come out right and the interpolation also seems to have no effect. I've changed the code a bit: private bool ShapesIntersect(Paddle paddle, Ball ball) { overlap = 1000000f; //large value overlapAxis = Vector2.Zero; MTV = Vector2.Zero; foreach (Vector2 ax in Axes) { float[] pad = paddle.ProjectPaddle(ax); //pad0 = min, pad1 = max float[] circle = ball.ProjectBall(ax); //circle0 = min, circle1 = max if (pad[1] < circle[0] || circle[1] < pad[0]) { return false; } if (Math.Abs(pad[1] - circle[0]) < Math.Abs(circle[1] - pad[0])) { if (Math.Abs(overlap) > Math.Abs(-pad[1] + circle[0])) { overlap = -pad[1] + circle[0]; overlapAxis = ax * (-1); } //to get the proper axis } else { if (Math.Abs(overlap) > Math.Abs(circle[1] - pad[0])) { overlap = circle[1] - pad[0]; overlapAxis = ax; } } } if (overlapAxis != Vector2.Zero) { MTV = overlapAxis * Math.Abs(overlap); } return true; } And part of the Update method: if (ShapesIntersect(paddleRight, ball)) { isColliding = true; if (MTV != Vector2.Zero) { ball.X += MTV.X; ball.Y += MTV.Y; } //test if (overlapAxis.X == 0) //collision with horizontal edge { } else if (overlapAxis.Y == 0) //collision with vertical edge { float factor = Math.Abs(ball.ballCenter.Y - paddleRight.Y) / paddleRight.Height; if (factor > 1) factor = 1f; if (overlapAxis.X < 0) //left edge? ball.Speed = ball.DEFAULTSPEED * Vector2.Normalize(Vector2.Reflect(ball.Speed, (Vector2.Lerp(new Vector2(-1, -3), new Vector2(-1, 3), factor)))); else //right edge? ball.Speed = ball.DEFAULTSPEED * Vector2.Normalize(Vector2.Reflect(ball.Speed, (Vector2.Lerp(new Vector2(1, -3), new Vector2(1, 3), factor)))); } else //vertex collision??? { ball.Speed = -ball.Speed; } } What seems to happen is that "overlapAxis" doesn't always return the right one. So instead of (-1,0) i get the (1,0) (this happened even before i multiplied with -1 there). Sometimes there isn't even a collision registered even though the ball passes through the paddle... The interpolation also seems to have no effect as the angles barely change (or the overlapAxis is almost never (-1,0) or (1,0) but something like (0.9783473, 0.02743843)... ). What am i missing here? :(

    Read the article

  • PhoneGap Build 1.0 : Adobe relance son outil de conversion d'applications mobiles multiplateforme et enrichit son offre Cloud

    PhoneGap Build 1.0 : Adobe relance l'outil de conversion d'applications mobiles multiplateforme Et enrichit son offre Cloud avec 5 autres services Dans le cadre de sa conférence Create theWeb, Adobe a dévoilé hier une palette d'outils et de services pour les designers et les développeurs. Des outils très orientés HTML5, CSS3 et JavaScript. Leur but : « créer plus facilement des sites web, des contenus numériques et des applications mobiles ». La liste est assez longue. On y trouve PhoneGap Build 1.0 et une gamme Edge qui se compose à présent de Edge Animate 1.0, EdgeInspect 1.0 (ex-Shadow), Edge Web Fonts, Edge Code et en avant-première Edge Reflow.

    Read the article

  • PowerPoint save group as picture creates asymmetric edge, how to fix?

    - by Se Norm
    I created tons of figures for my thesis in PowerPoint and now I realized that when I try to save the grouped items (= one figure) as a picture (EMF), it somehow asymmetrically adds a border on the left and the bottom. First one is original group, second is the same pasted as a picture. Original group: Pasted as a picture: Does anyone have an idea how to fix that for a huge number of figures? I think it only started happening when I used a page size of 1m x 1m in PowerPoint to be able to zoom in more for some figures. However, I cannot not simply change the page size now as it messes up font and object sizes. Also, copying it into a smaller page and then saving as EMF doesn't do the trick. Maybe it is not related to the page size after all. Cropping every figure individually would be a lot of work, so I hope there is a different solution. I found the origin of the problem: the text label in the left bottom corner of each image (0s, 8s, 16s). I still do not understand why it is happening though, since the text label does not expand over the edge of the image (it was aligned using the align left function). It would still be great if there was an easy way to fix this, especially as I want to keep the text where it is.

    Read the article

  • Jung Meets the NetBeans Platform

    - by Geertjan
    Here's a small Jung diagram in a NetBeans Platform application: And the code, copied directly from the Jung 2.0 Tutorial:  public final class JungTopComponent extends TopComponent { public JungTopComponent() { initComponents(); setName(Bundle.CTL_JungTopComponent()); setToolTipText(Bundle.HINT_JungTopComponent()); setLayout(new BorderLayout()); Graph sgv = getGraph(); Layout<Integer, String> layout = new CircleLayout(sgv); layout.setSize(new Dimension(300, 300)); BasicVisualizationServer<Integer, String> vv = new BasicVisualizationServer<Integer, String>(layout); vv.setPreferredSize(new Dimension(350, 350)); add(vv, BorderLayout.CENTER); } public Graph getGraph() { Graph<Integer, String> g = new SparseMultigraph<Integer, String>(); g.addVertex((Integer) 1); g.addVertex((Integer) 2); g.addVertex((Integer) 3); g.addEdge("Edge-A", 1, 2); g.addEdge("Edge-B", 2, 3); Graph<Integer, String> g2 = new SparseMultigraph<Integer, String>(); g2.addVertex((Integer) 1); g2.addVertex((Integer) 2); g2.addVertex((Integer) 3); g2.addEdge("Edge-A", 1, 3); g2.addEdge("Edge-B", 2, 3, EdgeType.DIRECTED); g2.addEdge("Edge-C", 3, 2, EdgeType.DIRECTED); g2.addEdge("Edge-P", 2, 3); return g; } And here's what someone who attended a NetBeans Platform training course in Poland has done with Jung and the NetBeans Platform: The source code for the above is on Git: git://gitorious.org/j2t/j2t.git

    Read the article

  • Draw a JButton to look like a JLabel (or at least without the button edge?)

    - by Electrons_Ahoy
    I've got a JButton that for various reasons I want to act like a button, but look like a JLabel. It doesn't actually have to be a JLabel under the hood, I just don't want the raised button edge to show up. Is there an easy way to turn off the "button look" for JButtons but keep all the button functionality? I could build some kind of composed subclass hyperbutton that delegated to a jlabel for display purposes, but I'm really hoping there's something along the lines of button.lookLikeAButton(false).

    Read the article

  • What is considered bleeding edge in programming these days?

    - by iestyn
    What is "bleeding edge" these days? has it all been done before us, and we are just discovering new ways of implementing mathematical constructs within programming? Functional Programming seems to be making inroads in all areas, but is this just marketing to create interest in a programming arena where it appears that the state of the art has climaxed too soon. have the sales men got hold of the script, and selling ideas that can be sold, dumbing down the future? I see very old ideas making their way into the market place....what are the truly new things that should be considered fresh and new in 2010 onwards, and not some 1960-1980 idea being refocused.

    Read the article

  • If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this

    - by Anonymous
    I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C give me an edge? Or should I just learn Python on Ubuntu and then learn Objective-C when I get a new computer? Please give me your opinions! Thanks!

    Read the article

  • QuickGraph - How can I associate an Edge with a Class? (i.e. like you can with a Vertex)

    - by Greg
    Hi, Q1 - How can I associate an Edge with a Class? (i.e. like you can with a Vertex) In my case there are various types of edges I want to be able to model. So my real question I guess is how can I associate some level of data with Edges (e.g. edge type). The graph I was looking at using was: http://quickgraph.codeplex.com/wikipage?title=BidirectionalGraph&referringTitle=Documentation thanks

    Read the article

  • Custom Buttons in Android: How to get border/edge/frame when I read the background from xml?

    - by Anna
    Hi, Using Android Shapes in xml I have defined a gradient which I use as the background for a button. This all works nice, but there's no edge surrounding the button. I would like it to look similar to the normal Android button but I need more flexibility to control the color and look. The shape is defined as follows: I would expect the border to be set in the xml. Why doesn't "stroke" fix it? Stroke doesn't seem to do anything. I checked the Android Developer spec, but couldn't find the answer there: http://developer.android.com/guide/topics/resources/drawable-resource.html I have also looked through all the properties of the Android Button, but as expected there's no such parameter, probably since it's built into the normal Android button. Btw, I checked ImageButton properties too. Can someone please help? I know there's the alternative to make an image with proper edges and use an ImageButton, but there really should be a way to fix this programmatically. Thanks! Anna

    Read the article

  • How can I direct edge to get out of the diamond on the right?

    - by Didier Trosset
    I have a simple dot diagram to show how to perform tests. PerformTests; PerformTests<---+ PerformTests -> TestsPassed; | | TestsPassed [shape="diamond"]; v | TestsPassed -> Release [label="Yes"]; TestsPassed | TestsPassed -> FixErrors [label="No"]; Y| N\ | FixErrors -> PerformTests; v FixErrors Release The diagram shows square boxes for all nodes, except TestPassed that has a diamond shape. My issue is here. I'd like the edge that goes outside of the diamond for No to be getting out of the diamond at the right (east) instead of oblique down-right (south-east). What I have What I want ^ ^ / \ / \ < > < >---> \ /\ \ / v \ v I've seen such compass_pt in the dot grammar, but cannot figure out how to use it. I what I want possible, and how to do it?

    Read the article

  • Algorithm to Group All the Cycles Together

    - by Ngu Soon Hui
    I have a lot of cycles ( indicated by numeric values, for example, 1-2-3-4 corresponds to a cycle, with 4 edges, edge 1 is {1:2}, edge 2 is {2:3}, edge 3 is {3,4}, edge 4 is {4,1}, and so on). A cycle is said to be connected to another cycle if they share one and only one edge. For example, let's say I have two cycles 1-2-3-4 and 5-6-7-8, then there are two cycle groups because these two cycles are not connecting to each other. If I have two cycles 1-2-3-4 and 3-4-5-6, then I have only one cycle group because these two cycles share the same edge. What is the most efficient way to find all the cycle groups?

    Read the article

  • Finding a Eulerian Tour

    - by user590903
    I am trying to solve a problem on Udacity described as follows: # Find Eulerian Tour # # Write a function that takes in a graph # represented as a list of tuples # and return a list of nodes that # you would follow on an Eulerian Tour # # For example, if the input graph was # [(1, 2), (2, 3), (3, 1)] # A possible Eulerian tour would be [1, 2, 3, 1] I came up with the following solution, which, while not as elegant as some of the recursive algorithms, does seem to work within my test case. def find_eulerian_tour(graph): tour = [] start_vertex = graph[0][0] tour.append(start_vertex) while len(graph) > 0: current_vertex = tour[len(tour) - 1] for edge in graph: if current_vertex in edge: if edge[0] == current_vertex: current_vertex = edge[1] else: current_vertex = edge[0] graph.remove(edge) tour.append(current_vertex) break return tour graph = [(1, 2), (2, 3), (3, 1)] print find_eulerian_tour(graph) >> [1, 2, 3, 1] However, when submitting this, I get rejected by the grader. I am doing something wrong? I can't see any errors.

    Read the article

  • Create edges in Blender

    - by Mikey
    I've worked with 3DS Max in Uni and am trying to learn Blender. My problem is I know a lot of simple techniques from 3DS max that I'm having trouble translating into Blender. So my question is: Say I have a poly in the middle of a mesh and I want to split it in two. Simply adding an edge between two edges. This would cause a two 5gons either side. It's a simple technique I use every now and then when I want to modify geometry. It's called "Edge connect" in 3DS Max. In Blender the only edge connect method I can find is to create edge loops, not helpful when aiming at low poly iPhone games. Is there an equivalent in blender?

    Read the article

  • Scanline filling of polygons that share edges and vertices

    - by Belgin
    In this picture (a perspective projection of an icosahedron), the scanline (red) intersects that vertex at the top. In an icosahedron each edge belongs to two triangles. From edge a, only one triangle is visible, the other one is in the back. Same for edge d. Also, in order to determine what color the current pixel should be, each polygon has a flag which can either be 'in' or 'out', depending upon where on the scanline we currently are. Flags are flipped according to the intersection of the scanline with the edges. Now, as we go from a to d (because all edges are intersected with the scanline at that vertex), this happens: the triangle behind triangle 1 and triangle 1 itself are set 'in', then 2 is set in and 1 is 'out', then 3 is set 'in', 2 is 'out' and finally 3 is 'out' and the one behind it is set 'in', which is not the desired behavior because we only need the triangles which are facing us to be set 'in', the rest should be 'out'. How do process the edges in the Active Edge List (a list of edges that are currently intersected by the scanline) so the right polys are set 'in'? Also, I should mention that the edges are unique, which means there exists an array of edges in the data structure of the icosahedron which are pointed to by edge pointers in each of the triangles.

    Read the article

  • Algorithm to infer tag hierarchy

    - by Tom
    I'm looking for an algorithm to infer a hierarchy from a set of tagged items. E.g. if the following items have the tags: 1 a 2 a,b 3 a,c 4 a,c,e 5 a,b 6 a,c 7 d 8 d,f Then I can construct an undirected graph (or graphs) by tallying the node weights and edge weights: node weights edge weights a 6 a-b 2 b 2 a-c 3 c 3 c-e 1 d 2 a-e 1 <-- this edge is parallel to a-c and c-e and not wanted e 1 d-f 1 f 1 The first problem is how to drop any redundant edges to get to the simplified graph? Note that it's only appropriate to remove that redundant a-e edge in this case because something is tagged as a-c-e, if that wasn't the case and the tag was a-e, that edge would have to remain. I suspect that means the removal of edges can only happen during the construction of the graph, not after everything has been tallied up. What I'd then like to do is identify the direction of the edges to create a directed graph (or graphs) and pick out root nodes to hopefully create a tree (or trees): trees a d // \\ | b c f \ e It seems like it could be a string algorithm - longest common subsequences/prefixes - or a tree/graph algorithm, but I am a little stuck since I don't know the correct terminology to search for it.

    Read the article

  • How do I fix dragging windows to the adjacent workspace?

    - by Bill O'Dwyer
    I installed CompizConfig-Settings-Manager and I put on all the settings I liked and had in 11.10, including the ability to drag my windows to the adjacent workspace. It's under the Desktop Wall section, on the Edge Flipping tab and I've checked "Edge Flip Move" and "Edge Flip DnD." In 11.10, the movement was smooth between each workspace, and the window would still be "grabbed" in the same place. In 12.04, it's leaving the window behind and the mouse appears to be "grabbing" nothing, but I'm still holding onto the window, and I can still move and place it within the workspace (or indeed the previous workspace as it won't appear in the desired place until I drag the mouse all the way to the edge of the screen). Any way to fix this? I'm running 12.04 beta 2.

    Read the article

  • Adobe Acrobat Reader don't zoom out the page enough in "one page" mode

    - by mbaitoff
    I'm using Adobe Acrobat Reader version 9.4 under Debian Lenny. I'm experiencing a problem: when I push the "Show one page at a time" button, I expect the page to zoom such that pressing PgUp/PgDn would turn to the next/previous page. However, the zoom seems to be not enough - very thin bottom portion of the page doesn't fit inside the reader window, and pressing PgUp/PgDn gives the jitter of the same page, and I have to push twice to get to the next page. It is even worse in continuous page mode - a roll of pages begin to be non-synced with window boundaries, ending up with page break right in the middle of the view after several turns of the pages. This behaviour doesn't occur on windows version - I have a page properly zoomed in single/continuous modes, so that turning the pages is performed as page-at-once, as intended. How to make the Acrobat Reader fit the page to window properly? Thats how it looks before pressing PgDn (notice the bottom edge of the "paper" hidden beneath the bottom window edge): Thats how it looks after pressing PgDn (notice the "paper" bottom edge emerged from beneath the window edge, while the "paper" upper edge hides behind the upper window edge, showing that the document window size is not enough to contain the whole page):

    Read the article

  • Using apt-get from Canada

    - by Advant Edge
    I am using Ubuntu Server 12.04 LTS, and until yesterday, everything was quite peachy. I have installed several packages (MySQL, apache2) and to my knowledge have those configured correctly. Upon configuration of phpMyAdmin, I found that I was missing the directory path /etc/phpmyadmin, which got me thinking about the install. I am new to Ubuntu, so I guess I missed the message telling me that I did not download phpMyAdmin successfully. Anyway, trying to use apt-get yesterday/today results in "Failed to fetch..." messages, even if just to run sudo apt-get update. Some notable details: ···no GUI, command line only (sudo apt-get gksu fails, go figure) ···can ping 4.2.2.2, so I know the internet is out there (somewhere) ···this is a dedicated computer, using Samba to share files with Windows, which does work ···attempted to edit my /sources.list file, for various American/Canadian mirror, to no effect ···ensured I have correct DNS settings in /etc/networks/interfaces I'm not sure where along the way it happened, but I seem to have lost connections to repositories... :) Any advice (including GO BACK TO WINDOWS) is appreciated.

    Read the article

  • Why are there so many man-made edge cases in IT, and is there any hope for simplification / unificat

    - by Hamish Grubijan
    This question is meant to generate discussion and so it is marked as community wiki. My observation is that the field of information technology grows so rapidly and randomly, that for many it takes a lot of time to learn many intricacies of some tools that will be obsolete in just short 3 years. If you look at the questions asked on StackOverflow ... at least half of them stem from the fact that some language / tool / API / protocol was poorly designed, is backwards and has gotchas. There are so many things which distract developers from converting English into machine code; instead they spend their time configuring stuff and gluing together things that do not really fit. How many times do you pick up somebody else's project (or someone picks up yours :) ) and realize that this program does not need half of the dialogs that it has, and that the logic can be simplified a great deal? But, it had to be made and sold here before a better thing is made and sold elsewhere, and hence all this rush. I often wish that things would just slow down. I do not want Microsoft Windows to run on my car's computer, my watch, my table, my toaster oven, and my toilet seat. I'd rather have Windows that DOES NOT HAVE WINDOWS REGISTRY, I'd rather have Windows that allows two different programs to work on the same file at the same time, the way it works on Unix systems. Microsoft is just an example. I am looking forward to the day when I do not have to worry about Windows vs Unix new line break, when System32 actually means that this directory contains 32-bit binaries, and not 64-bit ones, the day when dll hell and manifest hell are no longer an issue, the day when it takes me a lot less than 3 months on a new job to learn the system. I do not mean learning the entire code base of a product (depending on the size of it, it can take a long time). I mean - remembering which build-assisting scripts are written in Perl and which version of it, and which ones are done through .bat files, when do I need to manually make every file in some directory writable before running a script, or else a critical step of a database maintenance home-grown tool will bomb, and it will take 2 days to clean that up. Makes me wonder if humans enslaved computers, or if it is the other way around. The key is that improving those things will not bring extra revenue, and hence those taking the time to fix crap like that are not "business focused". However, these imperfections irritate me immensely, particularly because my memory is limited - I can hold only a small portion of that useless knowledge of a system in my head at any given point in time. I must not be alone. Did you also happen to notice that a programmer can waste a lot of time on things that should have been a lot more straight-forward? Is there hope? Will things get better/simpler in the future, or will there be a lot more IT crap floating around? I suppose I see diversity of tools, protocols, etc. as a bad thing. Thank you for participation.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >