Search Results

Search found 439 results on 18 pages for 'accuracy'.

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

  • OpenGL render to texture causing edge artifacts

    - by mysticalOso
    This is my first post here so any help would be massively appreciated :) I'm using C++ with SDL and OpenGL 3.3 When rendering directly to screen I get the following result And when I render to texture I this happens Anti-aliasing is turned off for both. I'm guessing this has something to do with depth buffer accuracy but I've tried a lot of different methods to improve the result but, no success :( I'm currently using the following code to set up my FBO: GLuint frameBufferID; glGenFramebuffers(1, &frameBufferID); glBindFramebuffer(GL_FRAMEBUFFER, frameBufferID); glGenTextures(1, &coloursTextureID); glBindTexture(GL_TEXTURE_2D, coloursTextureID); glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,SCREEN_WIDTH,SCREEN_HEIGHT,0,GL_RGB,GL_UNSIGNED_BYTE,NULL); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); //Depth buffer setup GLuint depthrenderbuffer; glGenRenderbuffers(1, &depthrenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, depthrenderbuffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, SCREEN_WIDTH,SCREEN_HEIGHT); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthrenderbuffer); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, coloursTextureID, 0); GLenum DrawBuffers[1] = {GL_COLOR_ATTACHMENT0}; glDrawBuffers(1, DrawBuffers); // if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) return false; Thank you so much for any help :)

    Read the article

  • issues with ASUS S301L ultrabooks

    - by Wuerze
    I just like to tell you what still is a Problem in Ubuntu 14.04 and should be solved for a nice experience of this distribution. Unfortunately I do not have any hints to tell you, because I am just a user and know not much about programming. Anyway, I hope it helps. 1) Intel open source Graphics issues (proprietary) -when attaching HDMI-cable the screen switches to the external monitor and it's fine, but there is no switching back unless restart with HDMI deattached -black screen appears for like 2 seconds as if I would change screen in the settings; frequency increases with intensity of driver use (i.e. videos or video games) 2) hotkeys (commonly recognised) -there is no possibility to adjust brightness with the hotkeys (Fn+F5 and Fn+F6) 3) touchscreen (commonly recognised) -the touchscreen is behaving like a mouse -configuring gestures for the multi touch screen seems to always end in disabling touch pad gestures 4) panel symbols -battery symbol has got a low accuracy while it determines accurately the energy left; only 5 steps of energy are shown by the symbol Thank you all for participating in the solution of these problems! I will stay tuned and edit this list if something has been solved.

    Read the article

  • How much information can you mine out of a name?

    - by Finglas Fjorn
    While not directly related to programming, I figured that the programmers on here would be just as curious as I was about this question. Feel free to close the question if it does not meet with the guidelines. A name: first, possibly a middle, and surname. I'm curious about how much information you can mine out of a name, using publicly available datasets. I know that you can get the following with anywhere between a low-high probability (depending on the input) using US census data: 1) Gender. 2) Race. Facebook for instance, used exactly that to find out, with a decent level of accuracy, the racial distribution of users of their site (https://www.facebook.com/note.php?note_id=205925658858). What else can be mined? I'm not looking for anything specific, this is a very open-ended question to assuage my curiousity. My examples are US specific, so we'll assume that the name is the name of someone located in the US; but, if someone knows of publicly available datasets for other countries, I'm more than open to them too. I hope this is an interesting question!

    Read the article

  • Boundary conditions for testing

    - by Loggie
    Ok so in a programming test I was given the following question. Question 1 (1 mark) Spot the potential bug in this section of code: void Class::Update( float dt ) { totalTime += dt; if( totalTime == 3.0f ) { // Do state change m_State++; } } The multiple choice answers for this question were. a) It has a constant floating point number where it should have a named constant variable b) It may not change state with only an equality test c) You don't know what state you are changing to d) The class is named poorly I wrongly answered this with answer C. I eventually received feedback on the answers and the feedback for this question was Correct answer is a. This is about understanding correct boundary conditions for tests. The other answers are arguably valid points, but do not indicate a potential bug in the code. My question here is, what does this have to do with boundary conditions? My understanding of boundary conditions is checking that a value is within a certain range, which isn't the case here. Upon looking over the question, in my opinion, B should be the correct answer when considering the accuracy issues of using floating point values.

    Read the article

  • Moving windows using keyboard...faster?

    - by Alois Mahdal
    I like using keyboard shortcuts because it's faster as it does not force me to move my hands off the keyboard. In Windows I can use them to move windows around desktop: Press Alt+Space to open common windows menu Press M to choose "Move" command Navigate window position by cursor keys Confirm new position with Enter Additionally, to achieve better accuracy, I can hold Ctrl while navigating. Now the problem is that the normal "step" when moving is about 20px, and my desktop is quite large, so "walking" all the way across takes quite a long time. This kind of defeats the purpose of using keyboard for these tasks. Is it possible to change size of this step so that takes less steps to walk the same distance? (I imagine a hidden setting in Windows registry...?) I tried holding Alt while navigating, but it does not seem to have influence on speed.

    Read the article

  • Dangers of the pyton eval() statement

    - by LukeP
    I am creating a game. Specifically it is a pokemon battle simulator. I have an sqlite database of moves in which a row looks something like: name | type | Power | Accuracy | PP | Description However, there are some special moves. For said special moves, their damage (and other attributes not shown above, like status effects) may be dependant on certian factors. Rather than create a huge if/else in one of my classes covering the formulas for every one of these moves. I'd rather include another column in the DB that contains a formula in string form, like 'self.health/2'(simplified example). I could then just plug that into eval. I always see people saying to stay away from eval, but from what I can tell, this would be considered an acceptable use, as the dangers of eval only come into play when accepting user input. Am I correct in this assumption, or is there somthing i'm not seeing.

    Read the article

  • Selecting objects on a 2D map

    - by Dave
    I have a object selection function by checking the mouse click and getting the relevant object. How ever there is a rare situation where if one object is partially behind the other then both objects are in the given area so im wondering how I can make the game know which one was selected, as currently my method does not know. This is my function that works it out: function getobj(e){ mx = e.pageX - curleft; //mouse click x my = e.pageY - curtop; //mouse click y function searchSprites(sprites, x, y) { var matches = [], i = 0, data = null; for (i = 0; i < spritea.length; ++i) { data = spritea[i].data; if (x > data[0] && y > data[1] && x < data[2] && y < data[3]) { var imageData = ctx2.getImageData(x, y, 1, 1); if(imageData.data[3] !== 0){ return [spritea[i].id]; i = spritea.length; } } } } res = searchSprites(spritea, mx, my); bid = res[0]; if(bid === '1'){ alert('You selected the skyscraper in front!'); }else if(bid === '3'){ alert('You selected the skyscraper behind!'); } } Image of the map: It keeps telling me I clicked the skyscraper behind which is not necessarily what the user is trying to do. How can I improve the accuracy of this ?

    Read the article

  • The best programmer is N times more effective than the worst? Who Cares?

    - by StevenWilkins
    There is a latent belief in programming that the best programmer is N times more effective than the worst. Where N is usually between 10 and 100. Here are some examples: http://www.devtopics.com/programmer-productivity-the-tenfinity-factor/ http://www.joelonsoftware.com/articles/HighNotes.html http://haacked.com/archive/2007/06/25/understanding-productivity-differences-between-developers.aspx There is some debate as to whether or not it's been proven: http://morendil.github.com/folklore.html I'm confident in the accuracy of these statements: The best salesmen in the world are probably 10-100 times better than the worst The best drivers in the world are probably 10-100 times better than the worst The best soccer players in the world are probably 10-100 times better than the worst The best CEOs in the world are probably 10-100 times better than the worst In some cases, I'm sure the difference is greater. In fact, you could probably say that The best [insert any skilled profession here] in the world are probably 10-100 times better than the worst We don't know what N is for the rest of these professions, so why concern ourselves with what the actual number is for programming? Can we not just say that the number is large enough so that it's very important to hire the best people and move on already?

    Read the article

  • Help with selecting objects on a map

    - by Dave
    I have a object selection function by checking the mouse click and getting the relevant object. How ever there is a rare situation where if one object is partially behind the other then both objects are in the given area so im wondering how i can make the game know which one was selected, as currently my method does not know. This is my function that works it out: function getobj(e){ mx = e.pageX - curleft; //mouse click x my = e.pageY - curtop; //mouse click y function searchSprites(sprites, x, y) { var matches = [], i = 0, data = null; for (i = 0; i < spritea.length; ++i) { data = spritea[i].data; if (x > data[0] && y > data[1] && x < data[2] && y < data[3]) { var imageData = ctx2.getImageData(x, y, 1, 1); if(imageData.data[3] !== 0){ return [spritea[i].id]; i = spritea.length; } } } } res = searchSprites(spritea, mx, my); bid = res[0]; if(bid === '1'){ alert('You selected the skyscraper in front!'); }else if(bid === '3'){ alert('You selected the skyscraper behind!'); } } Image of the map: http://i.imgur.com/qcKij.jpg It keeps telling me i clicked the skyscraper behind which is not necessarily what the user is trying to do... how can i improve the accuracy of this ?

    Read the article

  • Android: get current location from best available provider

    - by AP257
    Hi all, I have some Android code that needs to get the best available location QUICKLY, from GPS, network or whatever is available. Accuracy is less important than speed. Getting the best available location is surely a really standard task. Yet I can't find any code to demonstrate it. The Android location code expects you to specify criteria, register for updates, and wait - which is fine if you have detailed criteria and don't mind waiting around. But my app needs to work a bit more like the Maps app does when it first locates you - work from any available provider, and just check the location isn't wildly out of date or null. I've attempted to roll my own code to do this, but am having problems. (It's inside an IntentService where an upload happens, if that makes any difference. I've included all the code for info.) What's wrong with this code? @Override protected void onHandleIntent(Intent arg0) { testProviders(); doUpload(); } private boolean doUpload() { int j = 0; // check if we have accurate location data yet - wait up to 30 seconds while (j < 30) { if ((latString == "") || (lonString == "")) { Log.d(LOG_TAG, "latlng null"); Thread.sleep(1000); j++; } else { Log.d(LOG_TAG, "found lat " + latString + " and lon " + lonString); break; } //do the upload here anyway, with or without location data //[code removed for brevity] } public boolean testProviders() { Log.e(LOG_TAG, "testProviders"); String location_context = Context.LOCATION_SERVICE; locationmanager = (LocationManager) getSystemService(location_context); List<String> providers = locationmanager.getProviders(true); for (String provider : providers) { Log.e(LOG_TAG, "registering provider " + provider); listener = new LocationListener() { public void onLocationChanged(Location location) { // keep checking the location - until we have // what we need //if (!checkLoc(location)) { Log.e(LOG_TAG, "onLocationChanged"); locationDetermined = checkLoc(location); //} } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } }; locationmanager.requestLocationUpdates(provider, 0, 0, listener); } Log.e(LOG_TAG, "getting updates"); return true; } private boolean checkLoc(Location location) { float tempAccuracy = location.getAccuracy(); int locAccuracy = (int) tempAccuracy; Log.d(LOG_TAG, "locAccuracy = " + locAccuracy); if ((locAccuracy != 0) && (locAccuracy < LOCATION_ACCURACY)) { latitude = location.getLatitude(); longitude = location.getLongitude(); latString = latitude.toString(); lonString = longitude.toString(); return true; } return false; } public void removeListeners() { // Log.e(LOG_TAG, "removeListeners"); if ((locationmanager != null) && (listener != null)) { locationmanager.removeUpdates(listener); } locationmanager = null; // Log.d(LOG_TAG, "Removed " + listener.toString()); } @Override public void onDestroy() { super.onDestroy(); removeListeners(); } Unfortunately, this finds the network provider, but only ever outputs latlng null 30 times - it never seems to get a location at all. I never even get a log statement of locationChanged. It's funny, because from ddms I can see output like: NetworkLocationProvider: onCellLocationChanged [305,8580] NetworkLocationProvider: getNetworkLocation(): returning cache location with accuracy 75.0 seeming to suggest that the network provider does have some location info after all, I'm just not getting at it. Can anyone help? I think working example code would be a useful resource for the Android/StackOverflow community.

    Read the article

  • Java Simple WGS84 Lat Lon to Pixel X, Y

    - by Cnich
    I've read a multitude of information regarding map projection today. The amount of information available is overwhelming. I am attempting to simply convert lat, long values into a screen X, Y coordinate not using any map. I do not need the values projected onto any map, just on the window. The window itself is representing approx. a 1500x1500 meter location. Lat, Long accuracy needed is to a 1/10th of a second. What may be some simpler ways in converting lat/long representation to the screen? I've read several articles and post regarding translation onto images, but nothing related to the natural java coordinate system. Thanks for any insight.

    Read the article

  • Copying the bitmap contents of a UIView's context to that of another UIView

    - by Joonas Trussmann
    Basically what I want to do is copy the already rendered content (a PDF drawn into the UIView's graphics context using CGContextDrawPDFPage()) onto a similar UIView, without having to re render the PDF. The idea is, that I'd then be able to perform an animated transform on the UIView and later re render the PDF with more accuracy. For both UIViews I'm using a larger-than-screen CATiledLayer to make it easier to rerender the PDF once the user zooms in, if that makes any difference. Any tips? I'm kind of lost here.

    Read the article

  • Sensor Manager getOrientation, doesnt display text and only works in debug mode?

    - by Aidan
    Hi Guys, My code appears to crash. I'm trying to setup a SensorManager for getting the Orientation of the device. I also have a listener that should update when conditions change. But when I run this code it crashes... public void sensor(){ // Locate the SensorManager using Activity.getSystemService sm = (SensorManager) getSystemService(SENSOR_SERVICE); sm.getOrientation(mR, mOrientation); // Register your SensorListener sm.registerListener(sl, sm.getDefaultSensor(Sensor.TYPE_ORIENTATION),SensorManager.SENSOR_DELAY_NORMAL); } private final SensorEventListener sl = new SensorEventListener() { @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent event) { if (event.sensor.getType()==Sensor.TYPE_ORIENTATION) { Global.Orientation = "Orientation is equal to: "+ SensorManager.getOrientation(mR, mOrientation); } } sm is defined as SensorManager sm; as a class wide variable also. I've got some other classes outputting the Orientation to a screen which I know works. The problem is somewhere in these methods. Am I doing it wrong or Is there a better way of doing this?

    Read the article

  • iPhone - Native App GeoLocation VS Web App GeoLocation

    - by Sam
    Here's my situation; I've built a very simple web app that looks up a users location and plots it on a Google map. Here's my code: http://pastebin.com/d3a185efd When I test it, my location is detected as being = 500 meters from where I actually stand. BUT When I open up Google Maps or Gowalla my location is correct to within <20 meters? So my question is: Do native iPhone apps benefit from a higher accuracy rate than web apps? If so, why?

    Read the article

  • how to sort a multidemensional array by an inner key

    - by Derek Vance
    i have this enormous array that i am pulling from an API for BattleField Bad Company 2, and the soldier stats can be pulled as a multi dimensional array with an inner array for each soldier, however the API sormats it sorting the soldiers by name alphabetically, i want to sort them by rank (which is just another key within that soldiers array). ive been trying to figure this out for days, anyone have any ideas? (ie sort the array by $arr[players][][rank] here is a bit of the array Array ( [players] = Array ( [0] = Array ( [name] = bigjay517 [rank] = 29 [rank_name] = SECOND LIEUTENANT II [veteran] = 0 [score] = 979440 [level] = 169 [kills] = 4134 [deaths] = 3813 [time] = 292457.42 [elo] = 319.297 [form] = 1 [date_lastupdate] = 2010-03-30T14:06:20+02:00 [count_updates] = 13 [general] = Array ( [accuracy] = 0.332 [dogr] = 86 [dogt] = 166 [elo0] = 309.104 [elo1] = 230.849 [games] = 384 [goldedition] = 0 [losses] = 161 [sc_assault] = 146333 [sc_award] = 567190 [sc_bonus] = 35305 [sc_demo] = 96961 [sc_general] = 264700 [sc_objective] = 54740 [sc_recon] = 54202 [sc_squad] = 53210 [sc_support] = 70194 [sc_team] = 21215 [sc_vehicle] = 44560 [slevel] = 0 [spm] = 0 [spm0] = 0 [spm1] = 0 [srank] = 0 [sveteran] = 0 [teamkills] = 67 [udogt] = 0 [wins] = 223 )

    Read the article

  • Translate google co-ordinates to the pixels on picture.

    - by kalininew
    I have a city "map" (for example - Moscow). She in accuracy repeats the contours the given city in google maps (that is it is copied from google maps and it is a little processed, but the sense remained the same). Also I have object co-ordinates in a city (in co-ordinates of google). Problem: how to translate google co-ordinates to the co-ordinates of my picture (that is in pixels on OX and OY on a picture). That is I receive google-co-ordinates and it is necessary for me to draw this point on my picture. I know that on small scales (for example on city scales) it to make simply enough (it is necessary to learn what google-co-ordinates has one of picture corners, then to learn "price" of one pixel in google-co-ordinates on a picture on axes OX and OY separately). But on the big scales (country scale) "price" of one pixel will be not a constant, and will vary strongly enough and the method described above cannot be applied. How to solve a problem on country scales?

    Read the article

  • Quickest and easiest way to implement speech to text conversion for a small speech subset.

    - by sgtpeppers
    Hi, I want to implement a system that receives speech through a microphone on my Mac OS x. I know arbitrary speech recognition is close to impossible without training the system so I'm willing to restrict it to 10 simple sentences. It must recognize with a high degree of accuracy which of these 10 sentences are being spoken, generate the text and add an entry to a remote MySQL database. With these being the architecture of the system I want to implement, could anyone give me an overview of what would be the best way to go about implementing this system? I'm looking for ideas like open source libraries to minimize the coding as this is just a prototype application for a demonstration. Basically I'm looking for a quick and easy solution. Thanks!

    Read the article

  • algorithm for image comparison

    - by Rajnikant
    Please consider following use case, I have one bigger image, lets called is master image. Now from some where else, I am getting one small image. I want to check whether this small image is subset of master image or not. important points are, smaller image might have different file format, smaller image might captured from comparatively different view. smaller image may have different light intensity. At this stage of algorithm/computation advancement, which level of accuracy I could expect? Any algorithm/open source implementation that would have such implementation? Thanks, Rajnikant

    Read the article

  • Convet long/lat to pixel x/y on a given picure.

    - by kalininew
    I have a city "map" (for example - Moscow). She in accuracy repeats the contours the given city in google maps (that is it is copied from google maps and it is a little processed, but the sense remained the same). Also I have object co-ordinates in a city (in co-ordinates of google). Problem: how to translate google co-ordinates to the co-ordinates of my picture (that is in pixels on OX and OY on a picture). That is I receive google-co-ordinates and it is necessary for me to draw this point on my picture. I know that on small scales (for example on city scales) it to make simply enough (it is necessary to learn what google-co-ordinates has one of picture corners, then to learn "price" of one pixel in google-co-ordinates on a picture on axes OX and OY separately). But on the big scales (country scale) "price" of one pixel will be not a constant, and will vary strongly enough and the method described above cannot be applied. How to solve a problem on country scales?

    Read the article

  • How hard is it to modify the Django Models?

    - by alex
    I am doing geolocation, and Django does not have a PointField. So, I am forced to writing in RAW SQL. GeoDjango, the Django library, does not support the following query for MYSQL databases (can someone verify that for me?) cursor.execute("SELECT id FROM l_tag WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm),asbinary(PointFromWKB(point(%s, %s)))))) < %s + accuracy + %s)\ I don't nkow why GeoDjango library cannot do this in MYSQL database. I hate writing RAW SQL for calculating distances between two points. Is there a way I can create my own library for Django that can handle this? If so, how hard is it?

    Read the article

  • comparing two angles

    - by Elazar Leibovich
    Given four points in the plane, A,B,X,Y, I wish to determine which of the following two angles is smaller ?ABX or ?ABY. I'd rather not use cos or sqrt, in order to preserve accuracy. In the case where A=(-1,0),B=(0,0), I can compare the two angles ?ABX and ?ABY, by calculating the dot product of the vectors X,Y, and watch it's sign. What I can do in this case is: Determine whether or not ABX turns right or left If ABX turns left check whether or not Y and A are on the same side of the line on segment BX. If they are - ?ABX is a smaller than ABY. If ABX turns right, then Y and A on the same side of BX means that ?ABX is larger than ?ABY. But this seems too complicated to me. Any simpler approach?

    Read the article

  • Memory footprint of a parsed XML file in Classic ASP?

    - by Pete Duncanson
    Anyone know of a way to find out the amount of memory/size of a XMLDocument once it has parsed a XML file? I've been doing "beer mat" calculations so far but have been asked to come up with some more legit numbers through monitoring some how. I need to create about 1500 XML files (via FreeThreadedXMl-DOM object), which verge between 3-9K in size and store them in Application vars but our SysAdmin is worried about us gobbling up too much memory. Other than the crude method of booting up a fresh IIS instance and then loading everything in and monitoring before and after memory usage in Task Manager I can't think of a way of doing it with a bit more accuracy.

    Read the article

  • Mobile Safari Geolocation API Issues

    - by sph
    Hi, since Mobile Safari's Geolocation API should be an implementation of the W3C Geolocation API I found some bugs. I was wondering if anybody noticed the same. As specified in the W3C Geolocation API the PositionCallback returns a Position object, which contains a Coordinates object. In this object all attributes are of type double. Using navigator.geolocation.getCurrentPosition and checking the Position object in the successCallback the accuracy attribute is always an object, but should be a double. The heading attribute is always -1 when testing in the iPhone simulator, but should be null or between 0 and 360. 2. Setting the options parameter for navigator.geolocation.watchPosition or navigator.geolocation.getCurrentPosition as specified in the W3C Geolocation API has no effect. No matter what is set as the timeout value, the win callback is called every 10 seconds. For example setting the timeout=1000 should immediately call either the successCallback or errorCallback. Thanks

    Read the article

  • Polygon area calculation using Latitude and Longitude generated from Cartesian space and a world fil

    - by Heath
    Given a series of GPS coordinate pairs, I need to calculate the area of a polygon (n-gon). This is relatively small (not larger than 50,000 sqft). The geocodes are created by applying an affine transform with data from a world file. I have tried to use a two step approach by doing converting the geocodes to cartesian coordinates: double xPos = (lon-lonAnchor)*( Math.toRadians( 6378137 ) )*Math.cos( latAnchor ); double yPos = (lat-latAnchor)*( Math.toRadians( 6378137 ) ); then I use a cross product calculation to determine the area. The issue is that the results are a bit off in accuracy (around 1%). Is there anything I can look into to improve this? Thanks.

    Read the article

  • How do you detect a website visitor's country (Specifically, US or not)?

    - by BigDave
    I need to show different links for US and non-US visitors to my site. This is for convenience only, so I am not looking for a super-high degree of accuracy, and security or spoofing are not a concern. I know there are geotargeting services and lists, but this seems like overkill since I only need to determine (roughly) if the person is in the US or not. I was thinking about using JavaScript to get the user's timezone, but this appears to only give the offset, so users in Canada, Mexico, and South America would have the same value as people in the US. Are there any other bits of information available either in JavaScript, or PHP, short of grabbing the IP address and doing a lookup, to determine this?

    Read the article

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