Search Results

Search found 1780 results on 72 pages for '400'.

Page 24/72 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • OpenGL Coordinate system confusion

    - by user146780
    Maybe I set up GLUT wrong. Basically I want verticies to be reletive to their size in pixels. Ex:right now if I create a hexagon, it hakes up the whole screen even though the units are 6. #include <iostream> #include <stdlib.h> //Needed for "exit" function #include <cmath> //Include OpenGL header files, so that we can use OpenGL #ifdef __APPLE__ #include <OpenGL/OpenGL.h> #include <GLUT/glut.h> #else #include <GL/glut.h> #endif using namespace std; //Called when a key is pressed void handleKeypress(unsigned char key, //The key that was pressed int x, int y) { //The current mouse coordinates switch (key) { case 27: //Escape key exit(0); //Exit the program } } //Initializes 3D rendering void initRendering() { //Makes 3D drawing work when something is in front of something else glEnable(GL_DEPTH_TEST); } //Called when the window is resized void handleResize(int w, int h) { //Tell OpenGL how to convert from coordinates to pixel values glViewport(0, 0, w, h); glMatrixMode(GL_PROJECTION); //Switch to setting the camera perspective //Set the camera perspective glLoadIdentity(); //Reset the camera gluPerspective(45.0, //The camera angle (double)w / (double)h, //The width-to-height ratio 1.0, //The near z clipping coordinate 200.0); //The far z clipping coordinate } //Draws the 3D scene void drawScene() { //Clear information from last draw glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); //Reset the drawing perspective glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_POLYGON); //Begin quadrilateral coordinates //Trapezoid glColor3f(255,0,0); for(int i = 0; i < 6; ++i) { glVertex2d(sin(i/6.0*2* 3.1415), cos(i/6.0*2* 3.1415)); } glEnd(); //End quadrilateral coordinates glutSwapBuffers(); //Send the 3D scene to the screen } int main(int argc, char** argv) { //Initialize GLUT glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutInitWindowSize(400, 400); //Set the window size //Create the window glutCreateWindow("Basic Shapes - videotutorialsrock.com"); initRendering(); //Initialize rendering //Set handler functions for drawing, keypresses, and window resizes glutDisplayFunc(drawScene); glutKeyboardFunc(handleKeypress); glutReshapeFunc(handleResize); glutMainLoop(); //Start the main loop. glutMainLoop doesn't return. return 0; //This line is never reached } How can I make it so that a polygon of 0,0 10,0 10,10 0,10 defines a polygon starting at the top left of the screen and is a width and height of 10 pixels? Thanks

    Read the article

  • SQL 2008 HierarchyID - Select X descendants down

    - by NTulip
    How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee? Here is the current structure: CREATE TABLE [dbo].[Employees]( [NodeId] [hierarchyid] NOT NULL, [EmployeeId] [int] IDENTITY(1,1) NOT NULL, [FirstName] [varchar](120) NULL, [MiddleInitial] [varchar](1) NULL, [LastName] [varchar](120) NULL, [DepartmentId] [int] NULL, [Title] [varchar](120) NULL, [PhoneNumber] [varchar](20) NULL, [IM] [varchar](120) NULL, [Photo] [varbinary](max) NULL, [Bio] [varchar](400) NULL, [Active] [bit] NULL, [ManagerId] [int] NULL )

    Read the article

  • get records from sqlite group by month

    - by peacmaker
    hi i hve an sqlite db which contain transactions each transaction has an price and has an transDate i want to retrieve the sum of the transaction group by month so the retrieved records should be like the following Price month 230 2 500 3 400 4 pleas any help

    Read the article

  • Does anybody have any suggestions on which of these two approaches is better for large delete?

    - by RPS
    Approach #1: DECLARE @count int SET @count = 2000 DECLARE @rowcount int SET @rowcount = @count WHILE @rowcount = @count BEGIN DELETE TOP (@count) FROM ProductOrderInfo WHERE ProductId = @product_id AND bCopied = 1 AND FileNameCRC = @localNameCrc SELECT @rowcount = @@ROWCOUNT WAITFOR DELAY '000:00:00.400' Approach #2: DECLARE @count int SET @count = 2000 DECLARE @rowcount int SET @rowcount = @count WHILE @rowcount = @count BEGIN DELETE FROM ProductOrderInfo WHERE ProductId = @product_id AND FileNameCRC IN ( SELECT TOP(@count) FileNameCRC FROM ProductOrderInfo WITH (NOLOCK) WHERE bCopied = 1 AND FileNameCRC = @localNameCrc ) SELECT @rowcount = @@ROWCOUNT WAITFOR DELAY '000:00:00.400' END

    Read the article

  • Application Engineering and Number of Users

    - by Kramii
    Apart from performance concerns, should web-based applications be built differently according to the number of (concurrent) users? If so, what are the main differences for (say) 4, 40, 400 and 4000 users? I'm particularly interested in how logging, error handling, design patterns etc. would be be used according to the number of concurrent users.

    Read the article

  • Define Javascript slider hit/rollover area

    - by Rob
    Hey, Im having an issue defining the hit area for a javascript sliding element. See example: http://www.warface.co.uk/clients/warface.co.uk/ Please slide over the grey box on the right side to reveal the button, although this works I would only like for the slider to only be triggered by rolling over the red block. CSS .slidingtwitter { /* -- This is the hit area -- */ background: #ccc; width:255px; height:55px; overflow: hidden; top:50%; right: 0px; /* -- This is the sliding start point -- */ position: fixed; font-family: Gotham, Sans-Serif; z-index: 50; } .slidingtwitter.right { right:0px; } .slidingtwitter .caption { /* -- This is the sliding area -- */ background: #fff; position: absolute; width:260px; height:55px; right: -205px; /* -- This is the sliding start point -- */ } .slidingtwitter a { color: #484848; font-size: 20px; text-transform: uppercase; } .slidingtwitter a:hover { color: black; } .slidingtwitter .smaller { font-size: 12px; font-family: Gotham Medium; } .twitterblock { background: #f35555 url("styles/images/button_twitter.png") no-repeat 14px 15px ; width:35px; height:35px; padding:10px; float:left; display:block; } .slidingtwitter .followme { background: url("styles/images/button_arrowheadthin.jpg")no-repeat right 0; height:35px; display:block; float:left; line-height:14px; width:140px; margin:10px 0px 0px 14px; padding-top:6px; padding-right: 40px; } JS $('.slidingtwitter').hover(function(){ $(".slide", this).stop().animate({right:'0px'},{queue:false,duration:400}); //Position on rollover },function() { $(".slide", this).stop().animate({right:'-205px'},{queue:false,duration:400}); //Position on rollout }); Any suggestions would be much appreciated.

    Read the article

  • Google App Engine - Error vacuuming indexes

    - by Spines
    I had an index that had status error, so following the docs I tried to vacuum my indexes to remove it. When running appcfg.py to vacuum it I got this error message: Error 400: --- begin server output --- Deleting a composite index failed: ApplicationError: 1 --- end server output --- Now all of my indexes are in error state. How can I fix this?

    Read the article

  • Issue with Flash Player 10.

    - by Gans
    Some times when the URL is clicked it navigates to the videopage, but I am hearing audio but not seeing any video. Why might this be? I am using the latest version of Flash Player 10. The SWF in question was created in Flash 9 (CS2). var s1 = new SWFObject("flvplayer.swf","single","560","400","7"); === What is wrong with this?

    Read the article

  • SQL Server 2008 takes up a lot of memory?

    - by Ahmed Said
    I am conducting stress tests on my database, which is hosted on SQL Server 2008 64-bit running on a 64-bit machine with 10 GB of RAM. I have 400 threads. Each thread queries the database every second, but the query time does not take time, as the SQL profiler says that, but after 18 hours SQL Server uses up 7.2 GB of RAM and 7.2 GB of virtual memory. Is this normal behavior? How can I adjust SQL Server to clean up unused memory?

    Read the article

  • backbone.js - Having multiple instances of the same view

    - by TrueWheel
    I am having problems having multiple instances in of the same view in different div elements. When I try to initialize them only the second of the two elements appear no matter what order I put them in. Here is the code for my view. var BodyShapeView = Backbone.View.extend({ thingiview: null, scene: null, renderer: null, model: null, mouseX: 0, mouseY: 0, events:{ 'click button#front' : 'front', 'click button#diag' : 'diag', 'click button#in' : 'zoomIn', 'click button#out' : 'zoomOut', 'click button#on' : 'rotateOn', 'click button#off' : 'rotateOff', 'click button#wireframeOn' : 'wireOn', 'click button#wireframeOff' : 'wireOff', 'click button#distance' : 'dijkstra' }, initialize: function(name){ _.bindAll(this, 'render', 'animate'); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 15, 400 / 700, 1, 4000 ); camera.position.z = 3; scene.add( camera ); camera.position.y = -5; var ambient = new THREE.AmbientLight( 0x202020 ); scene.add( ambient ); var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.75 ); directionalLight.position.set( 0, 0, 1 ); scene.add( directionalLight ); var pointLight = new THREE.PointLight( 0xffffff, 5, 29 ); pointLight.position.set( 0, -25, 10 ); scene.add( pointLight ); var loader = new THREE.OBJLoader(); loader.load( "img/originalMeanModel.obj", function ( object ) { object.children[0].geometry.computeFaceNormals(); var geometry = object.children[0].geometry; console.log(geometry); THREE.GeometryUtils.center(geometry); geometry.dynamic = true; var material = new THREE.MeshLambertMaterial({color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors }); mesh = new THREE.Mesh(geometry, material); model = mesh; // model = object; scene.add( model ); } ); // RENDERER renderer = new THREE.WebGLRenderer(); renderer.setSize( 400, 700 ); $(this.el).find('.obj').append( renderer.domElement ); this.animate(); }, Here is how I create the instances var morphableBody = new BodyShapeView({ el: $("#morphable-body") }); var bodyShapeView = new BodyShapeView({ el: $("#mean-body") }); Any help would be really appreciated. Thanks in advance.

    Read the article

  • Custom Error page | Redirect type =301?

    - by FlopScientist
    I guess this may be a novice question ( Which I am :) ). While redirecting user to custom error page, for e.g. 404, to tell that page wasn't found, the type of this redirect is 302. <error statusCode="404" redirect="/Utility/Error404.aspx" /> <error statusCode="400" redirect="/Utility/Error404.aspx" /> Is it possible to make this redirect 301 through Web.config? Thanks in advance to you all code maniacs.

    Read the article

  • Error:A generic error occurred in GDI+

    - by sanfra1983
    Hi, I created a web project on the server, and when I upload an image shows me the error Error: A generic error occurred in GDI +. I have read many links on the net that talk about this issue, and although I made the changes, nothing went wrong. I was thinking if the case is not an issue of permissions to folders. In fact I have two folders one inside the other. This is the code to resize the image: public Bitmaps ResizeImage (Stream stream, int? width, int? height) ( System.Drawing.Bitmap bmpOut = null; const int defaultWidth = 800; const int defaultHeight = 600; int width = lnWidth == null? defaultWidth: (int) width; int height = lnHeight == null? defaultHeight: (int) height; try ( LoBMP bitmap = new Bitmap (stream); ImageFormat loFormat = loBMP.RawFormat; decimal lnRatio; lnNewWidth int = 0; lnNewHeight int = 0; if (loBMP.Width <& & lnWidth loBMP.Height <lnHeight) ( loBMP return; ) if (loBMP.Width> loBMP.Height) ( lnRatio = (decimal) lnWidth / loBMP.Width; lnNewWidth = lnWidth; decimal = lnTemp loBMP.Height lnRatio *; lnNewHeight = (int) lnTemp; ) else ( lnRatio = (decimal) lnHeight / loBMP.Height; lnNewHeight = lnHeight; decimal = lnTemp loBMP.Width lnRatio *; lnNewWidth = (int) lnTemp; ) bmpOut = new Bitmap (lnNewWidth, lnNewHeight); Graphics g = Graphics.FromImage (bmpOut); g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.FillRectangle (Brushes.White, 0, 0, lnNewWidth, lnNewHeight); g.DrawImage (loBMP, 0, 0, lnNewWidth, lnNewHeight); loBMP.Dispose (); ) catch ( return null; ) bmpOut return; ) and this is the code that I insert in the codebehind: string filepath = AppDomain.CurrentDomain.BaseDirectory + img_veterinario / "; string = filepathM AppDomain.CurrentDomain.BaseDirectory + img_veterinario / img_veterinarioM; Reseize Reseize R = new (); Bitmap = photosFileOriginal r.ResizeImage (fucasiclinici.PostedFile.InputStream, 400, 400); Bitmap = photosFileMiniatura r.ResizeImage (fucasiclinici.PostedFile.InputStream, 72, 72); String filename = Path.GetFileName (fucasiclinici.PostedFile.FileName); photosFileOriginal.Save (Path.Combine (filepath, filename)); photosFileMiniatura.Save (Path.Combine (filepathM, filename)); Can you help me? Thanks

    Read the article

  • popup login page reload

    - by Mahmoude Elghandour
    i use fancybox for popup the login page jQuery(function () { jQuery(".spop").fancybox({ 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'speedIn': 400, 'speedOut': 200, 'width': 320, 'height': 315, 'padding': 0, 'margin': 0, 'titleShow': false, 'scrolling': 'no', 'type': 'iframe', 'overlayShow': true, 'onClosed': function () { parent.location.reload(true); } }); as you see i use event 'onClosed': function () { parent.location.reload(true); but i need to do this event but under some condition if the user click close i need fancebox don't reload you can find this issues in this link http://www.aqar4me.com/rent.aspx

    Read the article

  • Painted JPanel won't show up in JFrame

    - by javawarrior
    When I run my code, I expect to see a JPanel in my JFrame, but nothing shows up. I had a button in the frame, and it shows up. But the JPanel doesn't show up, I even colored it in red. Here is the code for my JPanel: import java.awt.*; import javax.swing.JPanel; public class graphic extends JPanel { private static final long serialVersionUID = -3458717449092499931L; public Game game; public graphic(Game game){ this.game = game; this.setPreferredSize(new Dimension(400,400)); this.setBackground(Color.RED); } public void paintComponent(Graphics g){ for (Line l:game.mirrors){ g.setColor(Color.BLACK); g.drawLine(l.start.x, l.start.y, l.end.x, l.end.y); } } } And my JFrame code: import java.awt.Container; import java.awt.event.*; import java.util.Timer; import java.util.TimerTask; import javax.swing.*; public class Viewer implements ActionListener { public JFrame frame; public JButton drawShoot; public boolean draw; public Game game; public graphic graphic; public TimerTask timert; public Timer timer; public Viewer(){ draw = true; game = new Game(); } public static void main(String args[]){ Viewer v = new Viewer(); v.setup(); } public void setup(){ frame = new JFrame("Laser Stimulator"); drawShoot = new JButton("Edit Mode"); graphic = new graphic(game); graphic.repaint(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBounds(300, 300, 600, 600); Container contentPane = frame.getContentPane(); SpringLayout layout = new SpringLayout(); contentPane.setLayout(layout); drawShoot.addActionListener(this); timert = new TimerTask() { @Override public void run() { } }; timer =new Timer(); timer.scheduleAtFixedRate(timert, 0, 1000/30); contentPane.add(graphic); layout.putConstraint(SpringLayout.NORTH, graphic, 0, SpringLayout.NORTH, contentPane); layout.putConstraint(SpringLayout.WEST, graphic, 0, SpringLayout.WEST, contentPane); frame.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource()==drawShoot){ draw = !draw; drawShoot.setText((draw)?"Edit Mode":"Shoot Mode"); } } }

    Read the article

  • creating a full html file out of webloc in a batch mode

    - by Wordpress Newbie
    Hi, I've got over 400 bookmarks saved as .webloc files. I'd like to move them to the iPhone's goodReader app. goodReader cannot open webloc files. It can sork with pdf, html but not webloc. Do you know of a way or a program that would take a folder as its input, and convert every single .webloc file in it into a PDF version or a html version - so I can grab the converted files and move them onto iPhone. Thank you

    Read the article

  • limit PHP script to one domain per license

    - by Mac Os
    what is the best way to make my php code working on one domain and sure i will encode the whole code by ioncube i want function like function domain(){ } if($this_domain <> domain()){ exit('no'); } or $allowed_hosts = array('foo.example.com', 'bar.example.com'); if (!isset($_SERVER['HTTP_HOST']) || !in_array($_SERVER['HTTP_HOST'], $allowed_hosts)) { header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request'); exit; } now i want know the best way to do that may be will user strpos

    Read the article

  • Flickering Image in Java?

    - by Noah Cagle
    OK so I am coding a game right now to prepair for Ludum Dare SharkJam, and I am using a new method for programming, because the last method I had crashes my PC, so this one should work. Well it does work and all, better too, but the images that I put in it flicker. Here is the whole main class (where the images are drawn) package me.NoahCagle.watermaze; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import javax.swing.JFrame; import me.NoahCagle.watermaze.entity.EntityShark; import me.NoahCagle.watermaze.entity.Player; import me.NoahCagle.watermaze.input.Keys; import me.NoahCagle.watermaze.map.Map; public class Game extends JFrame { private static final long serialVersionUID = 1L; Map map = new Map(0, 0); Player player = new Player(50, 30); static EntityShark shark = new EntityShark(400, 400); public Image dbImage; public Game() { setSize(800, 600); setDefaultCloseOperation(EXIT_ON_CLOSE); setLocationRelativeTo(null); setVisible(true); setTitle("Water Maze"); setResizable(false); setBackground(Color.blue); addKeyListener(new Keys()); } public static void main(String[] args) { new Game(); Thread s = new Thread(shark); s.start(); } public void paint(Graphics g) { dbImage = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); g.drawImage(dbImage, map.x, map.y, null); g.drawImage(player.player, player.x, player.y, this); g.drawImage(shark.shark, shark.x, shark.y, this); repaint(); } } What this code does for me is makes the Images work correctly, just flickering, alot. Can anyone help me with my issue? EDIT: I think it has something to do with where I call the repaint method in the paint method, so look there.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >