Search Results

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

Page 1/72 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Detect if square in grid is within a diamond shape

    - by myrkos
    So I have a game in which basically everything is a square inside a big grid. It's easy to check if a square is inside a box whose center is another square: *** x *o* --> x is not in o's square *** **x *o* --> x IS in o's square *** This can be done by simply subtracting the coordinates of o and x, then taking the largest coordinate of that and comparing it with the half side length. Now I want to do the same thing but check if x is in o's diamond, like so: * **x **o** --> x IS in o's diamond *** * What would be the best way to check if a square is in another square's surrounding diamond-shaped area, given the diamond's half width/height?

    Read the article

  • B.S.in Computer Science, weak eyes => career change

    - by Prometheus
    So I am going to earn B.S. in Computer Science soon. I like computers. I like programming. The problem is that my eyes are very weak. Depending on their condition, I can only put in about 6 hours in front of computer a day. If I push myself, I have trouble even keeping my eyes open because of soreness/pain, consequently headaches. My eyes do not have medical conditions. I was just born with weak eyes. I tried many different approaches to work around this problem - better monitor, breaks every 10 minutes, supplements... I even memorized a lot of shortcuts to reduce my time on computers! But I am finally giving up. I do not think I can be a programmer for the rest of my life. I was the top of my class in high school because all works were paper-based, I did average in college due to the nature of my eyes and the difficulty of the material. So what do you recommend I do? Or, Is there a career that is similar to programming but requires interacting with computers less?

    Read the article

  • Arrays- Square root of an Array and printing the result JAVA

    - by roger34
    Hello, The title says it all, really. I'm trying to get an array of (9) numbers squared then printed but I keep coming back with only one result - the number of numbers in the array squared- obviously not what I want. Thanks for any help. Ok, here is my terrible code so far. Trying to pass it to a method as well. public static void main ( String args[] ) { double[] nums = {126, 12.939, 795, 320.16, 110, 34.7676, 7773, 67, 567, 323}; System.out.println ("Square root is " +square); square(nums); } public static double square (double [] array) { double result; for( double i = 0; i < array.length ; i++ ) result = Math.sqrt(array[i]); return result; } }

    Read the article

  • XNA C# Rectangle Intersect Ball on a Square

    - by user2436057
    I made a Game like Peggle Deluxe using C# and XNA for lerning. I have 2 rectangles a ball and a square field. The ball gets shoot out with a cannon and if the Ball hits the Square the Square disapears and the Ball flys away.But the Ball doesent spring of realistically, it sometimes flys away in a different direction or gets stuck on the edge. Thads my Code at the moment: public void Update(Ball b, Deadline dl) { ArrayList listToDelete = new ArrayList(); foreach (Field aField in allFields) { if (aField.square.Intersects(b.ballhere)) { listToDelete.Add(aField); Punkte = Punkte + 100; float distanceX = Math.Abs(b.ballhere.X - aField.square.X); float distanceY = Math.Abs(b.ballhere.Y - aField.square.Y); if (distanceX < distanceY) { b.myMovement.X = -b.myMovement.X; } else { b.myMovement.Y = -b.myMovement.Y; } } } It changes the X or Y axis depending on how the ball hits the Square but not everytimes. What could cause the problem? Thanks for your answer. Greetings from Switzerland.

    Read the article

  • accessing array values without square brackets in php

    - by amb
    In php how can I access an array's values without using square brackets around the key? My particular problem is that I want to access the elements of an array returned by a function. Say function(args) returns an array. Why is $var = function(args)[0]; yelling at me about the square brackets? Can I do something like $var = function(args).value(0); or am I missing something very basic?

    Read the article

  • Eyes easily get dry and itchy [closed]

    - by Lo Wai Lun
    I have currently working as a programmer for half a year Very often, I often looking the monitors with natural contrast and brightness. Still when the weather is getting cold, my eyes feel dry and itchy. Sometimes I can see some red 'tree-roots' (capillaries) near iris. At home, i sometimes use my notebook for 13" or Galaxy Nexus Brightness are also natural contrast and brightness , a bit dim How should we take care of our eyes under this scenario?

    Read the article

  • Square Peg Web: Gets you the traffic to where it matters most: Your Website!

    - by demetriusalwyn
    Have you decided to start your business online or is your business not reaching the targeted audience? Come to Square Peg Web; where you will find what you want to make your business reach new heights. The team at Square Peg Web is professionals who understand what you want and make sure you get it right. Our confidence stems from the fact of thousands of satisfied clients who keep referring friends and business associates to us and we do not let our clients down. Many companies promise the sky but how far is does their work live up to the promises? We do not know about the others however, we are sure that we strive to put together all our ideas and thoughts to make your website rank among the top. Web hosting is something that needs to have a personal touch; Square Peg Web customizes everything to suit your requirements so that you do not have to look further. With Square Peg Web you have a host of features to make your Business go viral. Some of the product details that are offered with Square Peg Web are unlimited product options/ variants/ properties giving you an option on price modifiers. You get unlimited customized input fields for your products and you can also Customer-define the prices. Square Peg Web provides you an option of using multiple product images with zoom features and one can also list a particular product in several categories. There are other aspects which make Square Peg Web the best choice for your website needs; every sale of yours’ is important to you and to us. We make sure that each sale is tracked by the product and also the list of bestsellers that appeal to the audience. Other comprehensive statistics of Square Peg Web includes searchable order data, an interface for shipments and order fulfillments, export sales & customer data for usage in a spreadsheet and the ability to export orders to QuickBooks format. With Square Peg Web; Admin Panel is a lot simpler. Administrative access is completely password protected and any changes done are all in real-time. You can have absolute control on the cart from anywhere around the world using your web browser and the topping on the cake is the unlimited amount of admin accounts that can be created for you. Square Peg Web offers you a world of experience with the options of choosing from marketing websites to e-commerce and from customized applications to community oriented sites. Some of the projects which appear in the portfolio of Square Peg Web are Online Marketing Web Sites, E-Commerce Web Sites, customized web applications, Blog designing and programming, video sharing and the option of downloading web sites, online advertisements, flash animation, customer and product support web sites, web site re-designing and planning and complete information architecture.

    Read the article

  • Calculating the square of BigInteger

    - by brickner
    Hi, I'm using .NET 4's System.Numerics.BigInteger structure. I need to calculate the square (x^2) of very large numbers. If x is a BigInteger, What is the time complexity of: x*x; or BigInteger.Pow(x,2); ? If it's worse than O(n^2), do you have a better implementation? Maybe something like Schönhage–Strassen algorithm?

    Read the article

  • Drawing random smooth lines contained in a square [migrated]

    - by Doug Mercer
    I'm trying to write a matlab function that creates random, smooth trajectories in a square of finite side length. Here is my current attempt at such a procedure: function [] = drawroutes( SideLength, v, t) %DRAWROUTES Summary of this function goes here % Detailed explanation goes here %Some parameters intended to help help keep the particles in the box RandAccel=.01; ConservAccel=0; speedlimit=.1; G=10^(-8); % %Initialize Matrices Ax=zeros(v,10*t); Ay=Ax; vx=Ax; vy=Ax; x=Ax; y=Ax; sx=zeros(v,1); sy=zeros(v,1); % %Define initial position in square x(:,1)=SideLength*.15*ones(v,1)+(SideLength*.7)*rand(v,1); y(:,1)=SideLength*.15*ones(v,1)+(SideLength*.7)*rand(v,1); % for i=2:10*t %Measure minimum particle distance component wise from boundary %for each vehicle BorderGravX=[abs(SideLength*ones(v,1)-x(:,i-1)),abs(x(:,i-1))]'; BorderGravY=[abs(SideLength*ones(v,1)-y(:,i-1)),abs(y(:,i-1))]'; rx=min(BorderGravX)'; ry=min(BorderGravY)'; % %Set the sign of the repulsive force for k=1:v if x(k,i)<.5*SideLength sx(k)=1; else sx(k)=-1; end if y(k,i)<.5*SideLength sy(k)=1; else sy(k)=-1; end end % %Calculate Acceleration w/ random "nudge" and repulive force Ax(:,i)=ConservAccel*Ax(:,i-1)+RandAccel*(rand(v,1)-.5*ones(v,1))+sx*G./rx.^2; Ay(:,i)=ConservAccel*Ay(:,i-1)+RandAccel*(rand(v,1)-.5*ones(v,1))+sy*G./ry.^2; % %Ad hoc method of trying to slow down particles from jumping outside of %feasible region for h=1:v if abs(vx(h,i-1)+Ax(h,i))<speedlimit vx(h,i)=vx(h,i-1)+Ax(h,i); elseif (vx(h,i-1)+Ax(h,i))<-speedlimit vx(h,i)=-speedlimit; else vx(h,i)=speedlimit; end end for h=1:v if abs(vy(h,i-1)+Ay(h,i))<speedlimit vy(h,i)=vy(h,i-1)+Ay(h,i); elseif (vy(h,i-1)+Ay(h,i))<-speedlimit vy(h,i)=-speedlimit; else vy(h,i)=speedlimit; end end % %Update position x(:,i)=x(:,i-1)+(vx(:,i-1)+vx(:,i))/2; y(:,i)=y(:,i-1)+(vy(:,i-1)+vy(:,1))/2; % end %Plot position clf; hold on; axis([-100,SideLength+100,-100,SideLength+100]); cc=hsv(v); for j=1:v plot(x(j,1),y(j,1),'ko') plot(x(j,:),y(j,:),'color',cc(j,:)) end hold off; % end My original plan was to place particles within a square, and move them around by allowing their acceleration in the x and y direction to be governed by a uniformly distributed random variable. To keep the particles within the square, I tried to create a repulsive force that would push the particles away from the boundaries of the square. In practice, the particles tend to leave the desired "feasible" region after a relatively small number of time steps (say, 1000)." I'd love to hear your suggestions on either modifying my existing code or considering the problem from another perspective. When reading the code, please don't feel the need to get hung up on any of the ad hoc parameters at the very beginning of the script. They seem to help, but I don't believe any beside the "G" constant should truly be necessary to make this system work. Here is an example of the current output: Many of the vehicles have found their way outside of the desired square region, [0,400] X [0,400].

    Read the article

  • Move a 2D square on y axis on android GLES2

    - by Dan
    I am trying to create a simple game for android, to start i am trying to make the square move down the y axis but the way i am doing it dosent move the square at all and i cant find any tutorials for GLES20 The on draw frame function in the render class updates the users position based on accleration dew to gravity, gets the transform matrix from the user class which is used to move the square down, then the program draws it. All that happens is that the square is drawn, no motion happens public void onDrawFrame(GL10 gl) { user.update(0.0, phy.AccelerationDewToGravity); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); // Re draws black background GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 12, user.SquareVB);//triangleVB); GLES20.glEnableVertexAttribArray(maPositionHandle); GLES20.glUniformMatrix4fv(maPositionHandle, 1, false, user.getTransformMatrix(), 0); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); } The update function in the player class is public void update(double vh, double vv) { Vh += vh; // Increase horrzontal Velosity Vv += vv; // Increase vertical velosity //Matrix.translateM(mMMatrix, 0, (int)Vh, (int)Vv, 0); Matrix.translateM(mMMatrix, 0, mMMatrix, 0, (float)Vh, (float)Vv, 0); }

    Read the article

  • Square game map rendered as sphere

    - by Roflha
    For a hobby project of mine I have created a finite voxel world (similar to Minecraft), but as I said, mine is finite. When you reach the edge of it, you are sent to the other side. That is all working fine along with rendering the far side of the map, but I want to be able to render this grid as a sphere. Looking down from above, the world is a square. I basically want to be able to represent a portion of that square as a sphere, as if you were looking at a planet. Right now I am experimenting with taking a circular section of the map, and rendering that, but it look to flat (no curvature around the edges). My question then, is what would be the best way to add some curvature to the edges of a 2d circle to make it look like a hemisphere. However, I am not overly attached to this implementation so if somebody has some other idea for representing the square as a planet, I am all ears.

    Read the article

  • Dual Control / Four Eyes Principle

    - by Ralf
    I have the requirement to implement some kind of Dual Control or Four-Eyes-Principle, meaning that every change of an object done by user A has to be checked by user B. A trivial example would be a publishing system where an author writes an article and another has to proofread it before it is published. I am a little bit surprised that you find nearly nothing about it on the net. No patterns, no libraries (besides cibet), no workflow solutions etc. Is this requirement really so uncommon? Or am I searching for the wrong terms? I am not looking for a specific solution. More for a pattern or best practice approach.

    Read the article

  • Dual Inspection / Four Eyes Principle

    - by Ralf
    I have the requirement to implement some kind of dual inspection or four-eyes principle as a feature of my software, meaning that every change of an object done by user A has to be checked by user B. A trivial example would be a publishing system where an author writes an article and another has to proofread it before it is published. I am a little bit surprised that you find nearly nothing about it on the net. No patterns, no libraries (besides cibet), no workflow solutions etc. Is this requirement really so uncommon? Or am I searching for the wrong terms? I am not looking for a specific solution. More for a pattern or best practice approach. Update: the above example is really trivial. Let's add some more complexity to it. The article has been published, but it now needs an update. Putting the article offline for the update is not an option, but the update has to be proof read, too.

    Read the article

  • Google Glasses–A new world in front of your eyes

    - by Gopinath
    Google is getting into a whole new business that would help us to see the world in a new dimension and free us from all gadgets we carry we today. Google Glasses is a wearable tiny computer that brings information in front of your eyes and lets you interact with it using voice commands. It’s a kind of glasses(spectacles) that you can wear to see and interact with the world in a new way.  With Google Glasses, for example you can look at a beautiful location and through voice you can instruct it to capture a photograph and share it to your friends. You don’t need a camera to capture the beautiful scene, you don’t need an App to upload and share it.  All you need is just Google Glasses By the way these glasses are not heavy head mountable stuff, they are very tiny one and look beautiful too. Check out the embedded video demo released by Google to see them in action and for sure you are going to be amazed.   Last year December 9 to 5 Google posted details about this secret project and NY Times says that these glasses would be available to everyone at affordable cost, anywhere between $250 and $600. It is powered by Android OS and the contains a GPS, motion sensor, camera, voice input & output devices. Check out Project Glass for more details.

    Read the article

  • Generating triangles from a square grid

    - by vivi
    I have a 2D square grid of values representing terrain elevations, and I want to generate triangles from that grid to make a 3D view of the terrain. My first thought was to split each square diagonally into 2 triangles, however the split diagonal can clearly be seen, especially from the top : [Sorry, as a new user I can't post images, please see here : imgur] Is there a recommended way to generate triangles to remove/reduce this effect ?

    Read the article

  • How to calculate square root in PHP [explained] [on hold]

    - by Enes Imsirovic
    At first code ! Don't forget embed the JQuery ! <html> <head> <title>Simple jQuery and PHP Square Root example</title> <script src="js/jquery-1.10.1.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('#form').submit(function(){ var number = $('#number').val(); $.ajax({type:"post",url:"calculate.php",data:"number=" +number,success:function(msg){$('#result').hide(); $("#result").html("<h3>" + msg + "</h3>").fadeIn("slow"); } }); return false; }); }); </script> </head> <body> <form id="form" action="calculate.php" method="post"> Enter number: <input id="number" type="text" name="number" /> <input id="submit" type="submit" value="Calculate Square Root" name="submit"/> </form> <p id="result"></p> </body> </html> Second code witch would be connected with first : calculate.php <?php if($_POST['number']==null){ echo "Please Enter a Number"; }else { if (!is_numeric($_POST['number'])) { echo "Please enter only numbers"; }else{ echo "Square Root of " .$_POST['number'] ." is ".sqrt($_POST['number']); } } ?> Chiefly for begginers, to see the power of PHP :) xD Load this on your localhost.. PHP files and JS : https://mega.co.nz/#!Et8zWSBb!KX2PFxa2Pzw_l-wi6QU8xi_eKTlHbtQuBsT_DvXrifk At least it look like this : http://imgur.com/vNnDRQ3

    Read the article

  • Square game map rendered as sphere with OpenGL

    - by Roflha
    Okay so I have been trying to find a good way to do this for a while now and so far I have nothing. For a hobby project of mine I have created a finite voxel world (similar to minecraft), but as I said, mine is finite. When you reach the edge of it, you are sent to the other side. That is all working fine along with rendering the far side of the map, but I want to be able to render this grid as a sphere. Looking down from above, the world is a square. I basically want to be able to represent a portion of that square as a sphere, as if you were looking at a planet. Right now I am experimenting with taking a circular section of the map, and rendering that, but it look to flat (no curvature around the edges). My question then, is what would be the best way to add some curvature to the edges of a 2d circle to make it look like a hemisphere. However, I am not overly attached to this implementation so if somebody has some other idea for representing the square as a planet, I am all ears.

    Read the article

  • Control diamond square algorithm to generate islands/pangea.

    - by Gabriel A. Zorrilla
    I generated a height map with the diamond square algorithm. The thing is i do not manage to create islands, this is, restrict the height other than water level range to a certain value in the center of the map. I manualy seeded a circle in the middle of the map but the rest of the map still receives heights over the water level. I dont fully understand the Perlin noise algorithm so i'd like to work with my current implementation of the diamond square algorithm which took me 3 days to interpret and code in PHP. :P

    Read the article

  • Square Reader Modified to Record Off Old Reel-to-Reel Tape [Video]

    - by Jason Fitzpatrick
    The Square Reader is a tiny magnetic credit card reader that has taken the mobile payment industry by storm. This clever hack dumps the credit card reading in favor of snagging the audio from old music reels. Evan Long was curious about whether the through-the-headphones interface of the Square Reader could be used to read audio data off old magnetic recordings. With a very small modification (he had to bend a metal tab inside the reader to allow the audio tape to slide through more easily) he was able to listen to and record audio off old reels. Watch the video above to see it in action or hit up the link below to read more about his project. iPod Meets Reel [via Make] HTG Explains: What Is Windows RT and What Does It Mean To Me? HTG Explains: How Windows 8′s Secure Boot Feature Works & What It Means for Linux Hack Your Kindle for Easy Font Customization

    Read the article

  • Announcing the ADF Architecture Square at OOW12

    - by Chris Muir
    The ADF product management team are happy to announce at Oracle Open World the publication of the ADF Architecture Square: Over the last number of years Oracle has recognized that many customers have matured their ADF skills and are now looking for information on advanced concepts beyond the how-do-I-get-this-poplist-to-work type questions.  In order to satisfy this demand we've devised the ADF Architecture Square where papers, presentations and demos will consider such broad software engineering concepts as ADF architecture, development and testing, building and deployment, and infrastructure.   If you have a look at the site right now it's a rather modest affair, but we hope to continue to expand the content to give further guidance and information to help shortcut your ADF project needs.  Either watch the website or follow our dedicated @adfarchsquare twitter feed.

    Read the article

  • Implement Fast Inverse Square Root in Javascript?

    - by BBz
    The Fast Inverse Square Root from Quake III seems to use a floating-point trick. As I understand, floating-point representation can have some different implementations. So is it possible to implement the Fast Inverse Square Root in Javascript? Would it return the same result? float Q_rsqrt(float number) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y = number; i = * ( long * ) &y; i = 0x5f3759df - ( i >> 1 ); y = * ( float * ) &i; y = y * ( threehalfs - ( x2 * y * y ) ); return y; }

    Read the article

  • How to create a magic square in PHP?

    - by TerranRich
    I'd like to try my hand at creating a Magic Square in PHP (i.e. a grid of numbers that all add up to the same value), but I really don't know where to start. I know of the many methods that create magic square, such as starting "1" at a fixed position, then moving in a specific direction with each iteration. But that doesn't create a truly randomized Magic Square, which is what I'm aiming for. I want to be able to generate an N-by-N Magic Square of N² numbers where each row and column adds up to N(N²+1)/2 (e.g. a 5x5 square where all rows/columns add up to 65 — the diagonals don't matter). Can anybody provide a starting point? I don't want anybody to do the work for me, I just need to know how to start such a project? I know of one generator, written in Java (http://www.dr-mikes-math-games-for-kids.com/how-to-make-a-magic-square.html) but the last Java experience I had was over 10 years ago before I quickly abandoned it. Therefore, I don't really understand what the code is actually doing. I did notice, however, that when you generate a new square, it shows the numbers 1-25 (for a 5x5 square), in order, before quickly generating a fresh randomized square.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >