Daily Archives

Articles indexed Monday December 17 2012

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

  • Multiplayer approach for tablets on wi-fi (FPS/TPS)? Server authority, etc

    - by Fraggle
    Looking for some guidance or what has worked well for others in implementing a multiplayer FPS/TPS type game on tablets (probably just 2-6 players at a time). The main issue being that tablets/phones are typically "less" connected than say a console or pc might be. And therefore, my thought is that to have complete Server authority of everything is not going to work. But maybe I'm off base on that. So I guess I'm struggling with what (if anything) should happen on a central server and what should happen locally. Or is centralized approach even needed? Some approaches I might do: Player movement : my thought is to control this locally (player-owner) and update server with positon (which then sends out to other clients). Use client side prediction for opponent players so that connection loss will not show a plane for example stop in mid air. Server will send update and try to smoothly correct an opponent player position to server updated one.But don't update owners position on owners device from server. Powerups (health kit/ammo/coins/etc) : need to see them disappear immediately, so do it locally. Add the health locally, but perhaps allow for server correction. If server doesn't see player near that powerup, reject the powerup and adjust server health for player. Fire weapons: Have to see it happen right away, so fire locally, create local bullet and send on its way. Send rpc to server so that this player on other clients also fires. Hit detection: Get's trickier. Make bullet/projectile disappear locally, and perhaps perform local hit animations (shaking, whatever). non-authoritative approach= take the damage locally and send rpc to server or others to update health and inform of hit. Authoritative approach-Don't take the damage, or adjust health. Server will do that if it detects a hit. Anyway that's my current thought stream. Let me know what you think of the above or what has worked for you.

    Read the article

  • Pygame surfaces and their Rects

    - by Jaka Novak
    I am trying to understand how pygame surfaces work. I am confused about Rect position of Surface object. If I try blit surface on screen at some position then Surface is drawn at right position, but Rect of the surface is still at position (0, 0)... I tried write my own surface class with new rect, but i am not sure if is that right solution. My goal is that i could move surface like image with rect.move() or something like that. If there is any solution to do that i would be happy to read it. Thanks for answer and time for reading this awful English If helps i write some code for better understanding my problem. (run it first, and then uncomment two lines of code and run again to see the diference): import pygame from pygame.locals import * class SurfaceR(pygame.Surface): def __init__(self, size, position): pygame.Surface.__init__(self, size) self.rect = pygame.Rect(position, size) self.position = position self.size = size def get_rect(self): return self.rect def main(): pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption("Screen!?") clock = pygame.time.Clock() fps = 30 white = (255, 255, 255) red = (255, 0, 0) green = (0, 255, 0) blue = (0, 0, 255) surface = pygame.Surface((70,200)) surface.fill(red) surface_re = SurfaceR((300, 50), (100, 300)) surface_re.fill(blue) while True: for event in pygame.event.get(): if event.type == QUIT: return 0 screen.blit(surface, (100,50)) screen.blit(surface_re, surface_re.position) #pygame.draw.rect(screen, white, surface.get_rect()) #pygame.draw.rect(screen, white, surface_re.get_rect()) pygame.display.update() clock.tick(fps) if __name__ == "__main__": main()

    Read the article

  • Writing to XML issue Unity3D C#

    - by N0xus
    I'm trying to create a tool using Unity to generate an XML file for use in another project. Now, please, before someone suggests I do it in something, the reason I am using Unity is that it allows me to easily port this to an iPad or other device with next to no extra development. So please. Don't suggest to use something else. At the moment, I am using the following code to write to my XML file. public void WriteXMLFile() { string _filePath = Application.dataPath + @"/Data/HV_DarkRideSettings.xml"; XmlDocument _xmlDoc = new XmlDocument(); if (File.Exists(_filePath)) { _xmlDoc.Load(_filePath); XmlNode rootNode = _xmlDoc.CreateElement("Settings"); // _xmlDoc.AppendChild(rootNode); rootNode.RemoveAll(); XmlElement _cornerNode = _xmlDoc.CreateElement("Screen_Corners"); _xmlDoc.DocumentElement.PrependChild(_cornerNode); #region Top Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _topLeftNode = _xmlDoc.CreateElement("Top_Left"); _cornerNode.AppendChild(_topLeftNode); // set the XYZ of the top left values XmlElement _topLeftXNode = _xmlDoc.CreateElement("TopLeftX"); XmlElement _topLeftYNode = _xmlDoc.CreateElement("TopLeftY"); XmlElement _topLeftZNode = _xmlDoc.CreateElement("TopLeftZ"); // indent these values to the top_left value in XML _topLeftNode.AppendChild(_topLeftXNode); _topLeftNode.AppendChild(_topLeftYNode); _topLeftNode.AppendChild(_topLeftZNode); #endregion #region Bottom Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _bottomLeftNode = _xmlDoc.CreateElement("Bottom_Left"); _cornerNode.AppendChild(_bottomLeftNode); // set the XYZ of the top left values XmlElement _bottomLeftXNode = _xmlDoc.CreateElement("BottomLeftX"); XmlElement _bottomLeftYNode = _xmlDoc.CreateElement("BottomLeftY"); XmlElement _bottomLeftZNode = _xmlDoc.CreateElement("BottomLeftZ"); // indent these values to the top_left value in XML _bottomLeftNode.AppendChild(_bottomLeftXNode); _bottomLeftNode.AppendChild(_bottomLeftYNode); _bottomLeftNode.AppendChild(_bottomLeftZNode); #endregion #region Bottom Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _bottomRightNode = _xmlDoc.CreateElement("Bottom_Right"); _cornerNode.AppendChild(_bottomRightNode); // set the XYZ of the top left values XmlElement _bottomRightXNode = _xmlDoc.CreateElement("BottomRightX"); XmlElement _bottomRightYNode = _xmlDoc.CreateElement("BottomRightY"); XmlElement _bottomRightZNode = _xmlDoc.CreateElement("BottomRightZ"); // indent these values to the top_left value in XML _bottomRightNode.AppendChild(_bottomRightXNode); _bottomRightNode.AppendChild(_bottomRightYNode); _bottomRightNode.AppendChild(_bottomRightZNode); #endregion _xmlDoc.Save(_filePath); } } This generates the following XML file: <Settings> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> </Settings> Which is exactly what I want. However, each time I press the button that has the WriteXMLFile() method attached to it, it's write the entire lot again. Like so: <Settings> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> </Settings> Now, I've written XML files before using winforms, and the WriteXMLFile function is exactly the same. However, in my winform, no matter how much I press the WriteXMLFile button, it doesn't write the whole lot again. Is there something that I'm doing wrong or should change to stop this from happening?

    Read the article

  • Using XNA for a 2D isometric game, but wanna move on

    - by Daniel Ribeiro
    I've been building a 2D isometric game (with learning purposes) in C# using XNA. I found it's really easy to manage sprite sheets loading, collision, basic physics and such with the XNA api. The thing is, I want to move on. My real goal is to learn C++ and develop a game using that language. What engine/library would you guys recommend for me to keep going on that same 2D isometric game direction using pretty much sprite sheets for the graphical part of the game?

    Read the article

  • Can I legally make a free clone of a game and use the same name? [closed]

    - by BlueMonkMN
    I gather from Is it legally possible to make a clone of the game? and How closely can a game resemble another game without legal problems that I should not try to profit from a clone if it is using the same assets, and, I presume, the same name. My question is whether it's legal to make a game like "Set" or "Catch Phrase", using the same name, and release it for free. What would I be risking if I did so -- just a take down notice, or could there be financial risk too? Edit: I guess my real question is whether the legal freedom is greater for a free game than one that is trying to make a profit. I just want a version of the game I can play remotely. Edit 2: I don't understand why this is being considered off-topic. I read the FAQ and it says it'S OK to ask questions about project management, which includes Publishing. And naming a game is a key aspect to publishing. That's what my question is about - choosing a legal name for my game with the consideration that I might post/publish it.

    Read the article

  • Animating DOM elements vs refreshing a single Canvas

    - by mgibsonbr
    A few years ago, when the HTML Canvas element was still kinda fresh, I wrote a small game in a rather "unusual" way: each game element had its own canvas, and frequently animated elements even had multiple canvases, one for each animation sprite. This way, the translation would be done by manipulating the DOM position of the canvases, while the sprite animation would consist of altering the visibility of the already drawn canvases. (z-indexes, of course, were the tricky part) It worked like a charm: even in IE6 with excanvas it showed a decent performance, and everything was rather consistent between browsers, including some smartphones. Now I'm thinking in writing a larger game engine in the same fashion, so I'm wondering whether it would be a good idea to do so in the current context (with all the advances in browsers and so on). I know I'm trading memory for time, so this needs to be customizable (even at runtime) for each machine the game will be running. But I believe using separate canvases would also help to avoid the game "freezing" on CPU spikes, since the translation would still happen even if the redraws lag for a while. Besides, the browsers' rendering engines are already optimized in may ways, so I'm guessing this scheme would also reduce the load on the CPU (in contrast to doing everything in JavaScript - specially the less optimized ones). It looks good in my head, but I'd like to hear the opinion of more experienced people before proceeding further. Is there any known drawback of doing this? I'm particulartly unexperienced in dealing with the GPU, so I wonder whether this "trick" would nullify any benefit of using a single, big canvas. Or maybe on modern devices it's overkill (though I'm skeptic about the claims that canvas+js - especially WebGL - will ever be a good alternative to native code). Any thoughts?

    Read the article

  • Yesterday's broken codebase hunt me back

    - by sandun dhammika
    I need a fun oky. I just love this openmoko hardware and hacking into it. Please could somebody help me to compile qemu.I 'm so sad and I want to compile qemu and it required the GCC3.x and then I downloaded gcc 3.2 but when I configure it and build it, it gives a very sad error message. G_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/gcc-3.2" "infodir=/gcc-3.2/info" "libdir=/gcc-3.2/lib" "prefix=/gcc-3.2" "tooldir=/gcc-3.2/i686-pc-linux-gnu" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do make[1]: Leaving directory `/gcc-3.2/gcc-3.2/zlib' make[1]: Entering directory `/gcc-3.2/gcc-3.2/fastjar' make[1]: Leaving directory `/gcc-3.2/gcc-3.2/fastjar' make[1]: Entering directory `/gcc-3.2/gcc-3.2/gcc' gcc -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I. -I./. -I./config -I./../include ./read-rtl.c -o read-rtl.o In file included from ./read-rtl.c:24:0: ./rtl.h:125:3: warning: type of bit-field ‘code’ is a GCC extension ./rtl.h:128:3: warning: type of bit-field ‘mode’ is a GCC extension ./read-rtl.c: In function ‘fatal_with_file_and_line’: ./read-rtl.c:61:1: warning: traditional C rejects ISO C style function definitions ./read-rtl.c: In function ‘read_rtx’: ./read-rtl.c:662:8: error: lvalue required as increment operand make[1]: *** [read-rtl.o] Error 1 make[1]: Leaving directory `/gcc-3.2/gcc-3.2/gcc' make: *** [all-gcc] Error 2 This is so sad and this is sooo bad. I have searched patches and workaround all over the Internet to this,but I couldn't find any alternative for this. I'm out of my patience now. I want that virtual machine ready and I want to make a debug host cos I don't have some money to buy original neo 1937 hardware. The patch that I have found comes with a nasty error too. I'm so sick of it.Any idea how could I fix this problem and make this work? Please please I'm begging you somebody help me please. Thanks all.

    Read the article

  • Storyboard elements are not sized properly on the device

    - by Joel Fischer
    In the storyboard, I am placing a table view element into a subclassed UIView. The element is not appearing on the iPad device I am running it on the same as it appears in the storyboard however. This also happens for additional content that I place into the storyboard. Below is a screenshot as it appears in the storyboard, as well as UI width/height information. And here is the description of the UI file running on the iPad. https://gist.github.com/4323186 (embedding it directly into the post is giving me problems) You'll notice that the tableview is explicitly set at 178 width, and is showing up in the description as 276 width. My initial thought was that perhaps a cell was forcing the parent to be larger (I'm very new to iOS UI development), but drilling into that shows the prototype cell it appears that the width is defined by it's parent at 178. The image views and label also are appearing in the incorrect spot, as shown in the second image below.

    Read the article

  • how does gwt work or rather how gwt loads the code into the app.html file

    - by Pero
    i would like to know what the rootPanel (which is in the entryClass) exactly is and how gwt loads the java code into the appname.html file via rootpanel. what happens there exactly? where is the connection between the rootpanel and the html file. i could not find any side which explains this process in a detail. the only thing i know i that all the created panels are div-elements. it would be very helpfulf if somebody could explain it or send some good links to websites which are explaining this issue. thx!

    Read the article

  • Operating System Widget Side Project

    - by Calpis
    I want to start on a side project and here's my idea: Whenever the user's mouse is pressed down, I want a small ring around the cursor to show up. I'm mainly doing this to learn more about programming and get myself to think outside of work related materials. My questions are: 1) is there a good source I can reference to start a project that deals with something like this? 2) Is visual studio a sufficient software to create such an application? Or would I need some other tool to do this. 3) What language should I choose to do this task? Thanks in advance!

    Read the article

  • Jquery .html and .load

    - by Jack Pilowsky
    I'm trying to teach myself jQuery and I'm a little stomped with the load() method. I'm working on eBay listings. Yes, I know includes are not allowed on ebay. However, there is a workaround that has been around for a few years and ebay doesn't seem to be cracking down on it. var ebayItemID='xxxxxxxxxxxxxx'; // This is eBay code. I cannot edit it. <h1 id="title"> TO BE REPLACED</h1> $(document).ready(function(){ var link = "http://www.ebay.com/itm/" + ebayItemID + "?item=" + ebayItemID + &viewitem=&vxp=mtr"; var newTitle = $('#title').load(link + "#itemTitle"); $('#title').html(newTitle); }); What's the point of this. I want to show the item title on the description, but I want to do so dynamically,

    Read the article

  • test php disabled caching

    - by user1691389
    My site had a problem in that certain browsers (especially opera and gecko) were "over-caching" (caching far too much for my taste). I've just added the following PHP snippet to hopefully disable caching in all browsers: <?php header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> Question: How would you test this out, to make sure it actually works?

    Read the article

  • Adding "Max Length" to Regex

    - by SeToY
    How can I extend already present Regex's with an attribute telling that the regex can't exceed a maximum length of (let's say) 255? I've got the following regex: ([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?) I've tried it like that, but failed: {.,255([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)}

    Read the article

  • use Variable on VBS

    - by Amirreza
    I Convert a reg file to VBS commands. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] @="" "VPService"="C:\\Windows\\System32\\VPService.exe" but i can't use %systemroot% variable instead C:\Windows\ on this. Option Explicit Dim objShell Set objShell = CreateObject("WScript.Shell") Dim strComputer, ArrOfValue, oReg const HKEY_USERS = &H80000003 const HKEY_LOCAL_MACHINE = &H80000002 const HKEY_CURRENT_USER = &H80000001 const HKEY_CLASSES_ROOT = &H80000000 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\", "" objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\", "", "REG_SZ" 'Default value objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\VPService", "C:\\Windows\\System32\\VPService.exe", "REG_SZ" Set objShell = Nothing WScript.Quit how can use %systemroot% variable instead C:\Windows\ on this code?

    Read the article

  • Default controller name is removed on browser refresh (CodeigniterPHP/Nginx issue?)

    - by tim peterson
    For all pages in my codeigniter app except my default controller, when I refresh the browser the url isn't affected as one would expect. However for my default controller, main.php, when when I refresh the browser at "http://localhost/main" or "http://mysite.com/main", the main part is stripped off the url. So the browser bar shows just "http://localhost" or "http://mysite.com". Totally lost on where to start with this but was just wondering if anyone has come across this before...? Here's what I think could be the relevant part of my nginx.conf (if Nginx is the problem). if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; }

    Read the article

  • Getting count() of class static array

    - by xylar
    Is it possible to get the count of a class defined static array? For example: class Model_Example { const VALUE_1 = 1; const VALUE_2 = 2; const VALUE_3 = 3; public static $value_array = array( self::VALUE_1 => 'boing', self::VALUE_2 => 'boingboing', self::VALUE_3 => 'boingboingboing', ); public function countit() { // count number $total = count(self::$value_array ); echo ': '; die($total); } } At the moment calling the countit() method returns :

    Read the article

  • mySQL - Separate Lastname,Firstname and CompanyName entries from a single column

    - by Decalmo
    I've got a column in a database which contains company names, and customer names all in one field... what I'd like to do is keep the CompanyName column completely intact, but wherever there is a comma in the CompanyName I'd like to take that information and populate it into a FirstName and LastName field. So that basically... Before: CompanyName: Big Company Inc Smith, John Sue, Maggie After: CompanyName: Big Company Inc Smith, John Sue, Maggie LastName: Smith Sue FirstName: John Maggie This one is pretty dang tricky for me... Any help is greatly appreciated!

    Read the article

  • Generate switch cases in php from an array?

    - by mopsyd
    Is it possible to generate the cases for a switch in php using an array? Something like: $x=array( 0 => 'foo', 1 => 'bar', 2 => 'foobar' ); $y='foobar' switch($y) { foreach($x as $i) { case $x: print 'Variable $y tripped switch: '.$i.'<br>'; break; } } I would like to be able to pull the case values from a database and loop through them with a while() loop.

    Read the article

  • PHP: Exception not caught by try ... catch

    - by Christian Brenner
    I currently am working on an autoloader class for one of my projects. Below is the code for the controller library: public static function includeFileContainingClass($classname) { $classname_rectified = str_replace(__NAMESPACE__.'\\', '', $classname); $controller_path = ENVIRONMENT_DIRECTROY_CONTROLLERS.strtolower($classname_rectified).'.controller.php'; if (file_exists($controller_path)) { include $controller_path; return true; } else { // TODO: Implement gettext('MSG_FILE_CONTROLLER_NOTFOUND') throw new Exception('File '.strtolower($classname_rectified).'.controller.php not found.'); return false; } } And here's the code of the file I try to invoke the autoloader on: try { spl_autoload_register(__NAMESPACE__.'\\Controller::includeFileContainingClass'); } catch (Exception $malfunction) { die($malfunction->getMessage()); } // TESTING ONLY $test = new Testing(); When I try to force a malfunction, I get the following message: Fatal error: Uncaught exception 'Exception' with message 'File testing.controller.php not found.' in D:\cerophine-0.0.1-alpha1\application\libraries\controller.library.php:51 Stack trace: #0 [internal function]: application\Controller::includeFileContainingClass('application\Tes...') #1 D:\cerophine-0.0.1-alpha1\index.php(58): spl_autoload_call('application\Tes...') #2 {main} thrown in D:\cerophine-0.0.1-alpha1\application\libraries\controller.library.php on line 51 What seems to be wrong?

    Read the article

  • Is there an easy way to replace a deprecated method call in Xcode?

    - by Alex Basson
    So iOS 6 deprecates presentModalViewController:animated: and dismissModalViewControllerAnimated:, and it replaces them with presentViewController:animated:completion: and dismissViewControllerAnimated:completion:, respectively. I suppose I could use find-replace to update my app, although it would be awkward with the present* methods, since the controller to be presented is different every time. I know I could handle that situation with a regex, but I don't feel comfortable enough with regex to try using it with my 1000+-files-big app. So I'm wondering: Does Xcode have some magic "update deprecated methods" command or something? I mean, I've described my particular situation above, but in general, deprecations come around with every OS release. Is there a better way to update an app than simply to use find-replace?

    Read the article

  • Filter a List via Another

    - by user1166905
    I have a requirement to filter a list of Clients based on if they haven't had any jobs booked in the last x months. In my code I have two lists, one is my Clients and the other is a filtered List of Jobs between today and x months ago and the idea is to filter Clients based on their id not appearing in the jobs list. I tried the following: filteredClients.Where(n => jobsToSearch.Count(j => j.Client == n.ClientID) == 0).ToList(); But I seem to get ALL clients regardless. I can easily do a foreach but this severly slows down the process. How can I filter the client list based on the job list effectively?

    Read the article

  • Is there a work around for slow performance of do.call(cbind.xts,...) in R 2.15.2?

    - by Petr Matousu
    I would expect cbind.xts and do.call(cbind.xts) to perform with similar elapsed time. That was true for R2.11, R2.14. For R2.15.2 and xts 0.8-8, the do.call(cbind.xts,...) variant performs drastically slower, which effectively breaks my previous codes. As Josh Ulrich notes in a comment below, the xts package maintainers are aware of this problem. In the meantime, is there a convenient work around?

    Read the article

  • Working with ieee format numbers in ARM

    - by Jake Sellers
    I'm trying to write an ARM program that will convert an ieee number to a TNS format number. TNS is a format used by some super computers, and is similar to ieee but different. I'm trying to use several masks to place the three different "part" of the ieee number in separate registers so I can move them around accordingly. Here is my unpack subroutine: UnpackIEEE LDR r1, SMASK ;load the sign bit mask into r1 LDR r2, EMASK ;load the exponent mask into r2 LDR r3, GMASK ;load the significand mask into r3 AND r4, r0, r1 ;apply sign mask to IEEE and save into r4 AND r5, r0, r2 ;apply exponent mask to IEEE and save into r5 AND r6, r0, r3 ;apply significand mask to IEEE and save into r6 MOV pc, r14 ;return And here are the masks and number declarations so you can understand: IEEE DCD 0x40300000 ;2.75 decimal or 01000000001100000000000000000000 binary SMASK DCD 0x80000000 ;Sign bit mask EMASK DCD 0x7F800000 ;Exponent mask GMASK DCD 0x007FFFFF ;Significand mask When I step through with the debugger, the results I get are not what I expect after working through it on paper. EDIT: What I mean, is that after the subroutine runs, registers 4, 5, and 6 all remain 0. I can't figure out why the masks are not working. I think I do not fully understand how the number is being stored in the register or using the masks wrong. Any help appreciated. If you need more info just ask. EDIT: entry point: Very simple, just trying to get these subroutines working. ENTRY LDR r1, IEEE ;load IEEE num into r1 BL UnpackIEEE ;call unpack sub SWI SWI_Exit ;finish

    Read the article

  • Data Driven MSTest: DataRow is always null

    - by David Back
    I am having a problem using Visual Studio data driven testing. I have tried to deconstruct this to the simplest example. I am using Visual Studio 2012. I create a new unit test project. I am referencing system data. My code looks like this: namespace UnitTestProject1 { [TestClass] public class UnitTest1 { [DeploymentItem(@"OrderService.csv")] [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "OrderService.csv", "OrderService#csv", DataAccessMethod.Sequential)] [TestMethod] public void TestMethod1() { try { Debug.WriteLine(TestContext.DataRow["ID"]); } catch (Exception ex) { Assert.Fail(); } } public TestContext TestContext { get; set; } } } I have a very small csv file that I have set the Build Options to to 'Content' and 'Copy Always'. I have added a .testsettings file to the solution, and set enable deployment, and added the csv file. I have tried this with and without |DataDirectory|, and with/without a full path specified (the same path that I get with Environment.CurrentDirectory). I've tried variations of "../" and "../../" just in case. Right now the csv is at the project root level, same as the .cs test code file. I have tried variations with xml as well as csv. TestContext is not null, but DataRow always is. I have not gotten this to work despite a lot of fiddling with it. I'm not sure what I'm doing wrong. Does mstest create a log anywhere that would tell me if it is failing to find the csv file, or what specific error might be causing DataRow to fail to populate? I have tried the following csv files: ID 1 2 3 4 and ID, Whatever 1,0 2,1 3,2 4,3 So far, no dice.

    Read the article

  • android content provider robustness on provider crash

    - by user1298992
    On android platforms (confirmed on ICS), if a content provider dies while a client is in the middle of a query (i.e. has a open cursor) the framework decides to kill the client processes holding a open cursor. Here is a logcat output when i tried this with a download manager query that sleeps after doing a query. The "sleep" was to reproduce the problem. you can imagine it happening in a regular use case when the provider dies at the right/wrong time. And then do a kill of com.android.media (which hosts the downloadProvider). "Killing com.example (pid 12234) because provider com.android.providers.downloads.DownloadProvider is in dying process android.process.media" I tracked the code for this in ActivityManagerService::removeDyingProviderLocked Is this a policy decision or is the cursor access unsafe after the provider has died? It looks like the client cursor is holding a fd for an ashmem location populated by the CP. Is this the reason the clients are killed instead of throwing an exception like Binders when the server (provider) dies ?

    Read the article

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