Search Results

Search found 8 results on 1 pages for 'ggambett'.

Page 1/1 | 1 

  • Developing instincts and "subconscious debugging" [closed]

    - by ggambett
    For some time now (a couple of years, perhaps?) I've noticed something that happens when I'm writing code. I write something with a syntax error, or some other subtle error. I don't really notice it on a conscious level, but I have a weird feeling about what I just wrote. I then try to compile it and I get a warning or error on the line that provoked the feeling. Lately I've been trying to pay attention to these feelings as they happen, and more often than not, I find errors right there. It's like I'm developing a subconscious debugger (or at least subconscious syntax checking ;)) I've heard of people fixing bugs in their sleep (I did a couple of times), but I don't think I've heard this kind of thing. Does it happen to someone else?

    Read the article

  • Weird UIView transforms in Retina iPhone

    - by ggambett
    I'm having a problem I don't understand. I'm developing an OpenGL app for iOS. Because at some points I want to force the orientation of the view programatically, and Apple for whatever reason doesn't make it easy (or even possible), I'm doing it by hand. I return always NO in shouldAutoRotateToInterfaceOrientation, and when I want to change the orientation (to portrait, for example), I do something like this in the UIView: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(0, 0, 768, 1024)]; This works fine. In order to support Retina devices, I started checking [UIScreen mainScreen].scale, and setting self.contentScaleFactor accordingly. I also modified the code above to account for the new dimensions, like this: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(0, 0, 2*768, 2*1024)]; Same rotation, different size. The weird result with this is that I get a "screen" with the right size, but offsetted half a screen to the bottom and the left. To correct for this, I need to do the following: [self setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 0)]; [self setBounds:CGRectMake(-768, -1024, 2*768 - 768, 2*1024 - 1024)]; This works, but it's ugly, I also need to make similar corrections when I get touch coordinates, and worst of all, I don't understand what's going on or why the above "correction" works. Can anyone shed some light on this issue?

    Read the article

  • Need HP recovery partition info

    - by ggambett
    I'm configuring a new HP Pavillion DV4 with a 320 GB disk. I made the recovery DVDs, then did a couple other things (including deleting the recovery partition), and finally decided to restore the system. Unfortunately, the recovery process fails; the three DVDs are read (the recovery program says "Reformatting the Windows partition" and "Copying files required to restore the hard drive") but after it finishes reading the 3rd, and the progress bar reaches 100%, it fails with error 0xe0f00013 - Googling it didn't return anything at all. I'm afraid this may be because I deleted the partitions. So, I'm kindly asking for one of the following, in order of preference, from a HP Pavillion DV4 with a 320 GB hard disk or a similar enough one : 1) A dump of the MBR 2) The type and size of all the partitions in a "new" system so I can try to make a partition table resembling the original one. BTW, I thought the recovery DVDs were supposed to work even if the entire disk was wiped - isn't that the case? Thanks!

    Read the article

  • Cross-domain policy issues after redirect in Flash

    - by ggambett
    I'm having trouble with a cross-domain policy. I'm using the AS3 Loader to fetch an image; I'm making it load the policy file, like this : var pLoader : Loader = new Loader(); var pContext : LoaderContext = new LoaderContext(); pContext.checkPolicyFile = true; pLoader.load(new URLRequest(sURL), pContext); This works fine as long as the image is directly accessible; however, when the server sends a redirect, the loader follows it but loses the checkPolicyFile flag, resulting in a SecurityException - that is, it doesn't check the cross-domain policy of the redirected URL. I've found a solution here ( http://www.stevensacks.net/2008/12/23/solution-as3-security-error-2122-with-300-redirects ) but looks fragile (that is, looks like it will fail if there's more than one redirect). What would be the correct way of doing this?

    Read the article

  • "Link" against a SWC in Flex

    - by ggambett
    I'm trying to do a very simple app in Flash/Flex, that loads an image embedded in the swf itself and then shows it. The thing is I'm trying to do it using the command line only (mxmlc and compc) and without using @Embed, and failing miserably. I have a very simple Main.as : package { import flash.display.*; import flash.utils.*; public class Main extends Sprite { public function Main () : void { var pDef:Class = getDefinitionByName("icon_big.png") as Class; var _image:BitmapData = new pDef(0, 0); var pSprite:Sprite = new Sprite(); pSprite.graphics.beginBitmapFill(_image); pSprite.graphics.drawRect(0, 0, _image.width, _image.height); pSprite.graphics.endFill(); addChild(pSprite); } } } This works fine if I add icon_big.png to the Library using the Flash IDE, but I can't figure out how to do it from the command line. I'm using compc to put the png inside a swc : compc --include-file icon_big.png icon_big.png -output assets.swc This generates a 17 kb assets.swf, slightly bigger than icon_big.png. Then I try to compile and link Main.as : mxmlc -include-libraries+=assets.swc Main.as This produces a 944 byte Main.swf, which clearly doesn't include the asset, and fails at runtime. According to the mxmlc docs I found, -include-libraries should link with every class, including the ones not directly referenced by code (as is the case here, since I'm getting the class from code), and it unsurprisingly fails at runtime. Note that this same code (or, more precisely, quite equivalent code) works when used within a Flash project - I'm not looking to fix the code, but how to do in the command line whatever Flash does internally. I feel I'm just "not getting" something... any clues?

    Read the article

  • Memory usage in Flash / Flex / AS3

    - by ggambett
    I'm having some trouble with memory management in a flash app. Memory usage grows quite a bit, and I've tracked it down to the way I load assets. I embed several raster images in a class Embedded, like this [Embed(source="/home/gabriel/text_hard.jpg")] public static var ASSET_text_hard_DOT_jpg : Class; I then instance the assets this way var pClass : Class = Embedded[sResource] as Class; return new pClass() as Bitmap; At this point, memory usage goes up, which is perfectly normal. However, nulling all the references to the object doesn't free the memory. Based on this behavior, looks like the flash player is creating an instance of the class the first time I request it, but never ever releases it - not without references, calling System.gc(), doing the double LocalConnection trick, or calling dispose() on the BitmapData objects. Of course, this is very undesirable - memory usage would grow until everything in the SWFs is instanced, regardless of whether I stopped using some asset long ago. Is my analysis correct? Can anything be done to fix this?

    Read the article

  • Handling big user IDs returned by FQL in PHP

    - by ggambett
    I'm using FQL to retrieve a list of users from Facebook. For consistency I get the result as JSON. This causes a problem - since the returned JSON encodes the user IDs as numbers, json_decode() converts these numbers to floating point values, because some are too big to fit in an int; of course, I need these IDs as strings. Since json_decode() does its own thing without accepting any behavior flags, I'm at a loss. Any suggestions on how to resolve this?

    Read the article

  • g++ fails mysteriously only if a .h is in a certain directory

    - by ggambett
    I'm experiencing an extremely weird problem in a fresh OSX 10.4.11 + Xcode 2.5 installation. I've reduced it to a minimal test case. Here's test.cpp: #include "macros.h" int main (void) { return 1; } And here's macros.h: #ifndef __JUST_TESTING__ #define __JUST_TESTING__ template<typename T> void swap (T& pT1, T& pT2) { T pTmp = pT1; pT1 = pT2; pT2 = pTmp; } #endif //__JUST_TESTING__ This compiles and works just fine if both files are in the same directory. HOWEVER, if I put macros.h in /usr/include/gfc2 (it's part of a custom library I use) and change the #include in test.cpp, compilation fails with this error : /usr/include/gfc2/macros.h:4: error: template with C linkage I researched that error and most of the comments point to a "dangling extern C", which doesn't seem to be the case at all. I'm at a complete loss here. Is g++ for some reason assuming everything in /usr/include/gfc2 is C even though it's included from a .cpp file that doesn't say extern "C" anywhere? Any ideas? EDIT : It does compile if I use the full path in the #include, ie #include "/usr/include/gfc2/macros.h" EDIT2 : It's not including the wrong header. I've verified this using cpp, g++ -E, and renaming macros.h to foobarmacros.h

    Read the article

1