Search Results

Search found 1803 results on 73 pages for 'pi calculation'.

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

  • Hyperion Calculation Manager in the Oracle Communities

    - by THE
    (guest post by Mel)Do you use the Oracle Hyperion Calculation Manager?Did you know that an easy way to access the product knowledge of Oracle employees and other customers are the My Oracle Support Communities?Oracle Hyperion Calculation Manager can be used with these Oracle Hyperion products: HFM Hyperion Planning Hyperion Essbase OBIEE OBIA Please log into the  My Oracle Support Communities and post your question to the relevant community.I like to encourage you to add Calculation Manager or "Calc Man" at the beginning of the subject field when posting your questions.This will help the Oracle moderators and other Community member to quickly identify queries about the Oracle Hyperion Calculation Manager and assist you with it.Thank you for your ongoing contributions to our My Oracle Support Community.

    Read the article

  • L'inventeur du pi-calcul est mort, Robin Milner nous quitte à 76 ans

    L'inventeur du pi-calcul est mort, Robin Milner nous quitte à 76 ans Robin Milner est décédé hier à Cambridge, où il fut professeur à l'Université (ainsi qu'à celles de Londres, Swansea, Edimbourg et Stanford). Informaticien anglais, il a fait trois découvertes principales dans sa carrière, qui ont largement contribué à l'évolution de l'informatique moderne et qui lui valurent de se voir attribuer le prix Turing en 1991 : - LCF, le premier système de preuves automatiques, utilisé pour démontrer automatiquement des assertions mathématiques - Le langage ML - La théorie d'analyse des systèmes concurrents (calculus of communicating systems, CCS) et son successeur, le pi-calcul RIP Robin...

    Read the article

  • Java SE Embedded-Enabled Raspberry Pi Ice Bucket Challenge

    - by hinkmond
    Help fight ALS at: http://www.alsa.org/fight-als/ See: Java SE Embedded-Enabled Raspberry Pi Ice Bucket Challenge My Java SE Enabled Raspberry Pi accepts the nomination for the ALS Ice Bucket Challenge and I hereby nominate the Nest thermostat, the Fitbit fitness tracker, and Apple TV. Take the Ice Bucket Challenge. Help find the cure for ALS: http://www.alsa.org/fight-als/ice-bucket-challenge.html Hinkmond

    Read the article

  • jQuery calculation plugin: show total in form field rather than text

    - by Katherine
    I'm embarrassed by the 'basicness' of this question, but after wasted hours, here goes. In an effort to do something with the jQuery Calculation plugin, I am playing with the basic example of the order form on the plugin site. I want to have the grand total as a form field,rather than text, so I can use the value. The function that calculates and shows the grand total is: function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#grandTotal").text( // round the results to 2 digits sum.toFixed(2) ); } the total updates on keyup in: <span id="grandTotal"></span> But this does not work with: <input type="text" id="grandTotal" value=""/> Can anyone point me to what I need to add/change to make that work? To call my javascript basic would be a compliment, so please talk to me like I know nothing!

    Read the article

  • PHP + Code Igniter Timecode Calculation Logic Error

    - by Tim
    Hello everyone, I have what I suspect to be a logic problem with an algorithm I am using to work with Video timecode in PHP. All help is appreciated. The Objective Well basically I want to work with timecode and perform calculations For those not familiar with timecode it looks like this 01:10:58:12 or HH:MM:SS:FF 'AKA' HOURS:MINUTES:SECONDS:FRAMES I have used the script from HERE to help me with working with this format. The Problem Now can i just say that this script works!!! Timecode calculations (in this case additions) are being performed correctly. However this script continually throws the following errors, yet still produces the correct output when I try and do the following calculation 00:01:26:00 + 00:02:00:12 The errors from this calculation are shown below A PHP Error was encountered Severity: Notice Message: Undefined index: key Filename: staff/tools.php Line Number: 169 A PHP Error was encountered Severity: Notice Message: Undefined index: key Filename: staff/tools.php Line Number: 169 Line Number 169 is in the parseInput() function // feed it into the tc array $i=0; foreach ($tc AS $key=>$value) { if ( is_numeric($array["$i"]) ) { $tc["$key"]= $array["$i"]; if ($tc["$key"] < 10 && $tc["$key"] > 0 && strlen($tc['key'])==1 ) $tc["$key"]= "0".$tc["$key"]; } $i++; } return $tc; Now I should also mention that the number of times the above error is thrown depends on what I am calculating 00:00:00:00 + 00:00:00:00 returns no errors. 01:01:01:01 + 02:02:02:02 produces 8 of the above errors. For your reference, here is the code in it's entirety function add_cue_sheet_clips_process() { $sheetID = $_POST['sheet_id']; $clipName = $_POST['clip_name']; $tcIn = $_POST['tc_in']; $tcOut = $_POST['tc_out']; // string $input // returns an associative array of hours, minutes, seconds, and frames // function parseInput ($input) { // timecode should look something like hh:mm:ss;ff // allowed separators are : ; . , // values may be single or double digits // hours are least-significant -- 5.4 == 00:00:05;04 $tc= array("frames"=>"00", "seconds"=>"00", "minutes"=>"00", "hours"=>"00"); $punct= array(":", ";", ".", ","); // too big? too small? $input= trim($input); if (strlen($input)>11 || $input=="") { // invalid input, too long -- bzzt return $tc; } // normalize punctuation $input= str_replace( $punct, ":", $input); // blow it up and reverse it so frames come first $array= explode(":", $input); $array= array_reverse($array); // feed it into the tc array $i=0; foreach ($tc AS $key=>$value) { if ( is_numeric($array["$i"]) ) { $tc["$key"]= $array["$i"]; if ($tc["$key"] < 10 && $tc["$key"] > 0 && strlen($tc['key'])==1 ) $tc["$key"]= "0".$tc["$key"]; } $i++; } return $tc; } // array $tc // returns a float number of seconds // function tcToSec($tc) { $wholeseconds= ($tc['hours']*3600) + ($tc['minutes'] * 60) + ($tc['seconds']); $partseconds= ( $tc['frames'] / 25 ); $seconds= $wholeseconds + $partseconds; return $seconds; } // float $seconds // bool $subtract // returns a timecode array // function secToTc ($seconds=0, $subtract=0) { $tc= array("frames"=>"00", "seconds"=>"00", "minutes"=>"00", "hours"=>"00"); $partseconds= fmod($seconds, 1); $wholeseconds= $seconds - $partseconds; // frames if ($subtract==1) $tc['frames']= floor( $partseconds * 25 ); else $tc['frames']= floor( $partseconds * 25 ); // hours $tc['hours']= floor( $wholeseconds / 3600 ); $minsec= ($wholeseconds - ($tc['hours'] * 3600)); // minutes $tc['minutes']= floor( $minsec / 60 ); // seconds $tc['seconds']= ( $minsec - ($tc['minutes'] * 60) ); // padding foreach ( $tc AS $key=>$value ) { if ($value > 0 && $value < 10) $tc["$key"]= "0".$value; if ($value=="0") $tc["$key"]= "00"; } return $tc; } // array $tc // returns string of well-formed timecode // function tcToString (&$tc) { return $tc['hours'].":".$tc['minutes'].":".$tc['seconds'].";".$tc['frames']; } $timecodeIN = parseInput($tcIn); $timecodeOUT = parseInput($tcOut); // normalized inputs... $tc1 = tcToString($timecodeIN); $tc2 = tcToString($timecodeOUT); // get seconds $seconds1 = tcToSec($timecodeIN); $seconds2 = tcToSec($timecodeOUT); $result = $seconds1 + $seconds2; $timecode3 = secToTc($result, 0); $timecodeDUR = tcToString($timecode3); $clipArray = array('clip_name' => $clipName, 'tc_in' => $tcIn, 'tc_out' => $tcOut, 'tc_duration' => $timecodeDUR); $this->db->insert('tools_cue_sheets_clips', $clipArray); redirect('staff/tools/add_cue_sheet_clips/'.$sheetID); } I hope this is enough information for someone to help me get on top of this, I would be extremely greatful. Thanks, Tim

    Read the article

  • Calculation Conundrum - how do I influence another textfield?

    - by LawVS
    Hey! Basically I have a problem in that when certain parameters are used in my calculator app - it makes the result incorrect. The issue is that I have separate text fields for hours and minutes and say for example I have as the start time "13" in one text field and "30" in the other with the finish time "24" and "00" in their respective text fields. The answer should be 10 hours 30 minutes, but the answer I get is 11 hours 30 minutes. The code for this is the following. -(IBAction)done:(id)sender { int result = [finishHours.text intValue] - [startHours.text intValue]; totalHours.text = [NSString stringWithFormat:@"%d", result]; if (result < 0) { totalHours.text = [NSString stringWithFormat:@"%d", result + 24]; } -(IBAction)done2:(id)sender { int result = [startMinutes.text intValue] - [finishMinutes.text intValue]; totalMinutes.text = [NSString stringWithFormat:@"%d", result]; if (result < 0) { totalMinutes.text = [NSString stringWithFormat:@"%d", result + 60]; } } I want to make it so if certain parameters are met, then the totalHours.text is reduced by 1 hour to reflect the total minutes. How would I go about that calculation in code? Thanks!

    Read the article

  • Raspberry Pi + Azure + Mobile App

    - by Richard Jones
    Ongoing project idea. So this is of long running personal interest to build a Mobile App that shows you a push notification/pop up alert, when anyone calls your house phone. So I've taken delivery of a Raspberry Pi. I've ordered a new Crucible Technology Caller ID Box. (arriving soon). I have been writing/learning Python to implement the Listener software. This will in turn push xml messages up to Azure for final delivery via push notifications to an App. iOS app already written to receive the notifications/allow address book additions made up from phone numbers from incoming calls. So this is fusion, R-Pi, Azure, Hardware and iOS. Details to follow as this plan unfolds.

    Read the article

  • Long running calculation on background thread

    - by SundayMonday
    In my Cocos2D game for iOS I have a relatively long running calculation that happens at a fairly regular interval (every 1-2 seconds). I'd like to run the calculation on a background thread so the main thread can keep the animation smooth. The calculation is done on a grid. Average grid size is about 100x100 where each cell stores an integer. Should I copy this grid when I pass it to the background thread? Or can I pass a reference and just make sure I don't write to the grid from the main thread before the background thread is done? Copying seems a bit wasteful but passing a reference seems risky. So I thought I'd ask.

    Read the article

  • Calculation Expression Parser with Nesting and Variables in ActionScript

    - by yuletide
    Hi There, I'm trying to enable dynamic fields in the configuration file for my mapping app, but I can't figure out how to parse the "equation" passed in by the user, at least not without writing a whole parser from scratch! I'm sure there is some easier way to do this, and so I'm asking for ideas! Basic idea: public var testString:String = "(#TOTPOP_CY#-#HISPOP_CY#)/#TOTPOP_CY#"; public var valueObject:Object = {TOTPOP_CY:1000, HISPOP_CY:100}; public function calcParse(eq:String):String { // do calculations return calculatedValue } So far, I was thinking of splitting the expression by either the operators, or maybe the variable tokens, but that gets rid of the parenthetical nesting. Alternatively, use a series of regex to search and replace each piece of the expression with its value, recursively running until only a number is left. But I don't think regex does math (i.e. replace "\d + \d" with the sum of the two numbers) Ideally, I'd just do a find/replace all variable names with their values, then run an eval(), but there's no eval in AS... eesh I downloaded some course materials for a course on compiler design, so maybe I'll just write a full-fledged calculator language and parser and port it over from the OTHER flex (the parser generator) :-D

    Read the article

  • jquery performing calculation on dynamically generated elements

    - by user306472
    I have a table made up of a row of 3 input elements: Price, Quanity, and Total. Under that, I have two links I can click to dynamically generate another row in the table. All that is working well, but actually calculating a value for the total element is giving me trouble. I know how to calculate the value of the first total element but I'm having trouble extending this functionality when I add a new row to the table. Here's the html: <table id="table" border="0"> <thead> <th>Price</th><th>Quantity</th><th>Total</th> </thead> <tbody> <tr> <td><input id ="price" type = "text"></input></td> <td><input id ="quantity" type = "text"></input></td> <td><input id ="total" type = "text"></input></td> </tr> </tbody> </table> <a href="#" id="add">Add New</a> <a href="#" id="remove">Remove</a> Here's the jquery I'm using: $(function(){ $('a#add').click(function(){ $('#table > tbody').append('<tr><td><input id ="price" type = "text"></input></td><td><input id ="quantity" type = "text"></input></td><td><input id ="total" type = "text"></input></td></tr>'); }); $('a#remove').click(function(){ $('#table > tbody > tr:last').remove(); }); }); $(function(){ $('a#calc').click(function(){ var q = $('input#quantity').val(); var p = $('input#price').val(); var tot = (q*p); $('input#total').val(tot); }); }); I'm new to jquery so there's probably a simple method I don't know about that selects the relevant fields I want to calculate. Any guidance would be greatly appreciated.

    Read the article

  • Need help nesting an Excel calculation

    - by Frank
    Here's what's currently happening: Z8: 100 Z9: =((Z8*W2)+Z8) Z10: =Z9*X2+Z9 Z11: =Z10*Y2+Z10 I start with a value of 100 and then add data from W2, X2 and Y2. This works, but it spans across three cells. I need it to fit into one. I'm drawing a blank on nesting the equations to fit into the one. Help?

    Read the article

  • jquery calculation sum two different type of item

    - by st4n
    I'm writing a script like the example shown in the demo where All of the "Total" values (Including the "Grand Total") are Automatically Calculated using the calc () method. at this link: But I have some fields in which to apply the equation qty * price, and others where I want to do other operations .. you can tell me how? thank you very much i try with this, but it is a very stupid code .. and the grandTotal .. not sum the two different fields: function recalc() { $("[id^=total_item]").calc("qty * price", { qty: $("input[name^=qty_item_]"), price: $("[id^=price_item_]") }, function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, function ($this){ // sum the total of the $("[id^=total_item]") selector var sum = $this.sum(); $("#grandTotal").text( // round the results to 2 digits "$" + sum.toFixed(2) ); }); $("[id^=total_otheritem]").calc("qty1 / price1", { qty1: $("input[name^=qty_other_]"), price1: $("[id^=price_other_]") }, function (s){ // return the number as a dollar amount return "$" + s.toFixed(2); }, function ($this){ var sum = $this.sum(); $("#grandTotal").text( // round the results to 2 digits "$" + sum.toFixed(2) ); }); }

    Read the article

  • C++ calculation evaluated to 0

    - by Alexander Stolz
    I'm parsing a file and trying to decode coordinates to the right unit. What happens is that this code is evaluated to 0. If I type it into gdb the result is correct. int pLat = (int)( (argv[6].data() == "plus" ? 1 : -1) * ( atoi(argv[7].data()) + atoi(argv[8].data()) / 60. + atoi(argv[9].data()) / 36000.) * 2.145767 * 0.0001); P.s. If someone knows a better title for this question, please change it

    Read the article

  • Is there a Linux distro that will easily run "embedded style" on a Raspberry Pi?

    - by Dan Harper
    I need a Linux distro that will give me the following: Run on a Raspberry Pi Can reliably survive power loss (like via a read-only filesystem) I've been able to hunt down some documentation on how to change a regular Linux distro over to read-only mode. I was hoping that there would be a distro already built that was designed to run in an embedded environment. I don't need many packages or drivers, just enough to have the Pi working with USB/Ethernet. I don't need any GUI interface or anything, this will just be running a custom service built in C. Does anyone know of a distro that would fit?

    Read the article

  • SAP PI 7.1 Runtime Workbench error: Domain ??? (domain.null)

    - by Techboy
    Within the Runtime Workbench screen of my SAP PI 7.1 system I have the error: Domain ??? (domain.null) Integration Server Integration Engines Non-Central Adapter Engines J2SE Adapter Tools The SLD CIM instance, class XI Domain shows: CreationClassName: SAP_XIDomain Name: domain.null Caption: Domain null With the associations: XI Contained Integration Repository XI Contained Integration Server XI Contained Integration Server If I do this: Move these associations to the correct SAP_XIDomain Delete the SAP_XIDomain 'Domain null' Restart the SLD Restart the SAP PI system it all appears okay (i.e. the 'Domain null') issue does not appear. The 'Domain null' issue re-appears as soon as I go into the SAP Runtime Workbench. Please can you tell me why it says domain.null and how to resolve it?

    Read the article

  • Raspberry Pi, Time Capsule Progress

    - by Richard Jones
    So by way of an update. I thought all was good with my Raspberry Pi, Debian and Netatalk Apple Time Capsule Clone. However something very strange going on. Although I could backup my Mac's + PC's fine to Raspberry Pi with external USB HD; strangely with RPI running, I couldn't use AirPlay. I found myself unable to play anything from Mac to Apple TV. So after lots of trying to make this work, I about turned and finally went out and got myself a 2TB Apple Time Capsule. More cash than I would want to spend on anything like this, but Apple you got me. I would like to offer a top tip, which maybe goes a small way to justifying silly expenditure... You can easily add a USB HD to any Time Capsule. I've just added a 3 TB external USB HD, giving me a 5 TB of total backup grunt. 3 TB External USB HD, was peanuts by comparison to Apple kit. So all working, its all solid as you'd expect.Apple 2, maybe me .5. But strong, solid backups now happening, without hassle (but a bit of a credit card bill to follow)

    Read the article

  • Skynet Big Data Demo Using Hexbug Spider Robot, Raspberry Pi, and Java SE Embedded (Part 3)

    - by hinkmond
    In Part 2, I described what connections you need to make for this demo using a Hexbug Spider Robot, a Raspberry Pi, and Java SE Embedded for programming. Here are some photos of me doing the soldering. Software engineers should not be afraid of a little soldering work. It's all good. See: Skynet Big Data Demo (Part 2) One thing to watch out for when you open the remote is that there may be some glue covering the contact points. Make sure to use an Exacto knife or small screwdriver to scrape away any glue or non-conductive material covering each place where you need to solder. And after you are done with your soldering and you gave the solder enough time to cool, make sure all your connections are marked so that you know which wire goes where. Give each wire a very light tug to make sure it is soldered correctly and is making good contact. There are lots of videos on the Web to help you if this is your first time soldering. Check out Laday Ada's (from adafruit.com) links on how to solder if you need some additional help: http://www.ladyada.net/learn/soldering/thm.html If everything looks good, zip everything back up and meet back here for how to connect these wires to your Raspberry Pi. That will be it for the hardware part of this project. See, that wasn't so bad. Hinkmond

    Read the article

  • Quickie Guide Getting Java Embedded Running on Raspberry Pi

    - by hinkmond
    Gary C. and I did a Bay Area Java User Group presentation of how to get Java Embedded running on a RPi. See: here. But, if you want the Quickie Guide on how to get Java up and running on the RPi, then follow these steps (which I'm doing right now as we speak, since I got my RPi in the mail on Monday. Woo-hoo!!!). So, follow along at home as I do the same steps here on my board... 1. Download the Win32DiskImager if you are on Windows, or use dd on a Linux PC: https://launchpad.net/win32-image-writer/0.6/0.6/+download/win32diskimager-binary.zip 2. Download the RPi Debian Wheezy image from here: http://files.velocix.com/c1410/images/debian/7/2012-08-08-wheezy-armel/2012-08-08-wheezy-armel.zip 3. Insert a blank 4GB SD Card into your Windows or Linux PC. 4. Use either Win32DiskImager or Linux dd to burn the unzipped image from #2 to the SD Card. 5. Insert the SD Card into your RPi. Connect an Ethernet cable to your RPi to your network. Connect the RPi Power Adapter. 6. The RPi will boot onto your network. Find its IP address using Windows Wireshark or Linux: sudo tcpdump -vv -ieth0 port 67 and port 68 7. ssh to your RPi: ssh <ip_addr_rpi> -l pi <Password: "raspberry"> 8. Download Java SE Embedded: http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html NOTE: First click accept, then choose the first bundle in the list: ARMv6/7 Linux - Headless EABI, VFP, SoftFP ABI, Little Endian - ejre-7u6-fcs-b24-linux-arm-vfp-client_headless-10_aug_2012.tar.gz 9. scp the bundle from #8 to your RPi: scp <ejre-bundle> pi@<ip_addr_rpi> 10. mkdir /usr/local, untar the bundle from #9 and rename (move) the ejre1.7.0_06 directory to /usr/local/java That's it! You are ready to roll with Java Embedded on your RPi. Hinkmond

    Read the article

  • A Slice of Raspberry Pi

    - by Phil Factor
    Guest editorial for the ITPro/SysAdmin newsletter The Raspberry Pi Foundation has done a superb design job on their new $35 network-enabled Linux computer. This tiny machine, incorporating an ARM processor on a Broadcom BCM2835 multimedia chip, aims to put the fun back into learning computing. The public response has been overwhelmingly positive.Note that aim: "…to put the fun back". Education in Information Technology is in dire straits. It always has been, but seems to have deteriorated further still, even in the face of improved provision of equipment.In many countries, the government controls the curriculum. It predicted a shortage in office-based IT skills, and so geared the ICT curriculum toward mind-numbing training in word-processing and spreadsheet skills. Instead, the shortage has turned out to be in people with an engineering-mindset, who can solve problems with whatever technologies are available and learn new techniques quickly, in a rapidly-changing field.In retrospect, the assumption that specific training was required rather than an education was an idiotic response to the arrival of mainstream information technology. As a result, ICT became a disaster area, which discouraged a generation of youngsters from a career in IT, and thereby led directly to the shortage of people with the skills that are required to exploit the potential of Information Technology..Raspberry Pi aims to reverse the trend. This is a rig that is geared to fast graphics in high resolution. It is no toy. It should be a superb games machine. However, the use of Fedora, Debian, or Arch Linux ARM shows the more serious educational intent behind the Foundation's work. It looks like it will even do some office work too!So, get hold of any power supply that provides a 5VDC source at the required 700mA; an old Blackberry charger will do or, alternatively, it will run off four AA cells. You'll need a USB hub to support the mouse and keyboard, and maybe a hard drive. You'll want a DVI monitor (with audio out) or TV (sound and video). You'll also need to be able to cope with wired Ethernet 10/100, if you want networking.With this lot assembled, stick the paraphernalia on the back of the HDTV with Blu Tack, get a nice keyboard, and you have a classy Linux-based home computer. The major cost is in the T.V and the keyboard. If you're not already writing software for this platform, then maybe, at a time when some countries are talking of orders in the millions, you should consider it.

    Read the article

  • Time Capsule With Raspberry Pi

    - by Richard Jones
    So I have a Raspberry PI, with an 1TB external USB HD plugged into it. I have Debian Wheezy installed to which I added the NetaTalk package. Following this guide which is on Ubuntu, but was easy enough to understand - http://kremalicious.com/ubuntu-as-mac-file-server-and-time-machine-volume/ I was even able to change the icon to look like an X-Serve :-) Next step to add a second HD that will backup my Windows 8 laptop as well.

    Read the article

  • Viewport / Camera Calculation in 2D Game

    - by Dave
    we have a 2D game with some sprites and tiles and some kind of camera/viewport, that "moves" around the scene. so far so good, if we wouldn't had some special behaviour for your camera/viewport translation. normally you could stick the camera to your player figure and center it, resulting in a very cheap, undergraduate, translation equation, like : vec_translation -/+= speed (depending in what keys are pressed. WASD as default.) buuuuuuuuuut, we want our player figure be able to actually reach the bounds, when the viewport/camera has reached a maximum translation. we came up with the following solution (only keys a and d are the shown here, the rest is just adaption of calculation or maybe YOUR super-cool and elegant solution :) ): if(keys[A]) { playerX -= speed; if(playerScreenX <= width / 2 && tx < 0) { playerScreenX = width / 2; tx += speed; } else if(playerScreenX <= width / 2 && (tx) >= 0) { playerScreenX -= speed; tx = 0; if(playerScreenX < 0) playerScreenX = 0; } else if(playerScreenX >= width / 2 && (tx) < 0) { playerScreenX -= speed; } } if(keys[D]) { playerX += speed; if(playerScreenX >= width / 2 && (-tx + width) < sceneWidth) { playerScreenX = width / 2; tx -= speed; } if(playerScreenX >= width / 2 && (-tx + width) >= sceneWidth) { playerScreenX += speed; tx = -(sceneWidth - width); if(playerScreenX >= width - player.width) playerScreenX = width - player.width; } if(playerScreenX <= width / 2 && (-tx + width) < sceneWidth) { playerScreenX += speed; } } i think the code is rather self explaining: keys is a flag container for currently active keys, playerX/-Y is the position of the player according to world origin, tx/ty are the translation components vital to background / npc / item offset calculation, playerOnScreenX/-Y is the actual position of the player figure (sprite) on screen and width/height are the dimensions of the camera/viewport. this all looks quite nice and works well, but there is a very small and nasty calculation error, which in turn sums up to some visible effect. let's consider following piece of code: if(playerScreenX <= width / 2 && tx < 0) { playerScreenX = width / 2; tx += speed; } it can be translated into plain english as : if the x position of your player figure on screen is less or equal the half of your display / camera / viewport size AND there is enough space left LEFT of your viewport/camera then set players x position on screen to width half, increase translation (because we subtract the translation from something we want to move). easy, right?! doing this will create a small delta between playerX and playerScreenX. after so much talking, my question appears now here at the bottom of this document: how do I stick the calculation of my player-on-screen to the actual position of the player AND having a viewport that is not always centered aroung the players figure? here is a small test-case in processing: http://pastebin.com/bFaTauaa thank you for reading until now and thank you in advance for probably answering my question.

    Read the article

  • How is time calculation performed by a computer?

    - by Jorge Mendoza
    I need to add a certain feature to a module in a given project regarding time calculation. For this specific case I'm using Java and reading through the documentation of the Date class I found out the time is calculated in milliseconds starting from January 1, 1970, 00:00:00 GMT. I think it's safe to assume there is a similar "starting date" in other languages so I guess the specific implementation in Java doesn't matter. How is the time calculation performed by the computer? How does it know exactly how many milliseconds have passed from that given "starting date and time" to the current date and time?

    Read the article

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