Search Results

Search found 94 results on 4 pages for 'toby hede'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • UIView drawRect; class variables out of scope

    - by Toby Wilson
    Short & sweet version of my last question in light of new information. I have a UIVIew with an init and a drawrect method (and another thread and a bunch of other stuff, but I'll keep it short & sweet). All of the class variables that I alloc and init in the -(id)init method are out of scope/nil/0x0 in the drawRect method, and I am unable to access them. For example; In the interface: NSObject* fred; In the implementation: -(id)init { if(self == [super init]) { fred = [[NSObject alloc] init]; } return self; } -(void)drawRect:(CGRect)rect { NSLog(@"Fred is retained %i times",[fred retainCount]); //FAIL NSLog(@"But his variable is actually just pointing at uninitialised 0x0, so you're not reading this in the debugger because the application has crashed before it got here." } Should add that init IS being called before drawRect also. Anyone have any ideas?

    Read the article

  • [[UIDevice currentDevice] orientation] always null

    - by Toby Wilson
    As per the title. Calling [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] has no effect. DidRotateToInterfaceOrientation etc events are working fine, but I need to be able to poll the device orientation arbitrarily. How can I fix/do this? The long story: I have a tab application with a navigation controller on each tab. The root view of tab number one is a graph that goes full screen when the orientation changes to landscape; however this needs to be checked whenever the view appears as the orientation change could have occurred elsewhere, so I was hoping to poll the orientation state whenever this view appears.

    Read the article

  • H.264 over RTP - Identify SPS and PPS Frames

    - by Toby
    I have a raw H.264 Stream from an IP Camera packed in RTP frames. I want to get raw H.264 data into a file so I can convert it with ffmpeg. So when I want to write the data into my raw H.264 file I found out it has to look like this: 00 00 01 [SPS] 00 00 01 [PPS] 00 00 01 [NALByte] [PAYLOAD RTP Frame 1] // Payload always without the first 2 Bytes -> NAL [PAYLOAD RTP Frame 2] [... until PAYLOAD Frame with Mark Bit received] // From here its a new Video Frame 00 00 01 [NAL BYTE] [PAYLOAD RTP Frame 1] .... So I get the SPS and the PPS from the Session Description Protocol out of my preceding RTSP communication. Additionally the camera sends the SPS and the PPSin two single messages before starting with the video stream itself. So I capture the messages in this order: 1. Preceding RTSP Communication here ( including SDP with SPS and PPS ) 2. RTP Frame with Payload: 67 42 80 28 DA 01 40 16 C4 // This is the SPS 3. RTP Frame with Payload: 68 CE 3C 80 // This is the PPS 4. RTP Frame with Payload: ... // Video Data Then there come some Frames with Payload and at some point a RTP Frame with the Marker Bit = 1. This means ( if I got it right) that I have a complete video frame. Afer this I write the Prefix Sequence ( 00 00 01 ) and the NALfrom the payload again and go on with the same procedure. Now my camera sends me after every 8 complete Video Frames the SPS and the PPS again. ( Again in two RTP Frames, as seen in the example above ). I know that especially the PPS can change in between streaming but that's not the problem. My questions are now: 1. Do I need to write the SPS/PPS every 8th Video Frame? If my SPS and my PPS don't change it should be enough to have them written at the very beginning of my file and nothing more? 2. How to distinguish between SPS/PPS and normal RTP Frames? In my C++ Code which parses the transmitted data I need make a difference between the RTP Frames with normal Payload an the ones carrying the SPS/PPS. How can I distinguish them? Okay the SPS/PPS frames are usually way smaller, but that's not a save call to rely on. Because if I ignore them I need to know which data I can throw away, or if I need to write them I need to put the 00 00 01 Prefix in front of them. ? Or is it a fixed rule that they occur every 8th Video Frame?

    Read the article

  • vb.net system beep sound on XP

    - by Toby
    Is it possible to have a vb.net program sound the PC's internal speaker? you know the one that produces C's \a BELL I have tried beep(), but this only produces the error sound on the sound card. I have also tried <Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint:="Beep", SetLastError:=True, _ CharSet:=Runtime.InteropServices.CharSet.Unicode, ExactSpelling:=True, _ CallingConvention:=Runtime.InteropServices.CallingConvention.StdCall)> _ Public Shared Function _ aBeep(ByVal dwFreq As Integer, ByVal dwDuration As Integer) _ As Boolean End Function With no joy apparently its only good on vista and above Any suggestions? thanks

    Read the article

  • Progressive Enhancement with box-shadow

    - by toby
    I would like to use WebKit's box-shadow css property for a little drop-down. The code would look like: .drop_down{ -webkit-box-shadow: 1px 1px 4px #888; box-shadow: 1px 1px 4px #888; } However, for browsers that do not have this capability, I would like to use borders to approximate this drop shadow, like so: .drop_down{ border-top: 1px solid #bbb; border-left: 1px solid #bbb; border-right: 2px solid #bbb; border-bottom: 2px solid #bbb; } The problem is, I don't want the border-based shadow to show up for the browsers that DO support box-shadow. I would like to avoid browser sniffing because I assume it's hard to cover all the cases. What is the simplest way to do this? I prefer a javascript-less solution, but I will consider simple javascript-based ones too.

    Read the article

  • Change the height of a list item when it's in edit mode

    - by toby
    I have custom list item renderers and editors for a List control. I need for the editor to have a greater height then the renderer, i.e., the row should expand(in height) when it goes into edit mode. However, even when the list's variableRowHeight is set to true, it doesn't do what I want: the height seems to be based on the height of the renderer only, not the editor. Is there any way to do what I want?

    Read the article

  • setting target for disclosure button on subclassed UITableViewCell

    - by Toby Wilson
    I've created a subclass of UITableViewCell to create some custom appearance and UI functionality ('swipe to reveal delete button'). Some of the cells are disclosure/detail disclosure type, and have a UIButtonTypeDetailDisclosure etc added manually. I cannot use the table view controllers' UITableViewCellAccessory for row at index path method. The question is, how do I set the target of these manually added buttons so that they correctly send the didSelectRowAtIndexPath to their table view controller?

    Read the article

  • Objective-C NSDate memory issue (again)

    - by Toby Wilson
    I'm developing a graphing application and am attempting to change the renderer from OpenGL to Quartz2D to make text rendering easier. A retained NSDate object that was working fine before suddenly seems to be deallocating itself, causing a crash when an NSMutableString attempts to append it's decription (now 'nil'). Build & analyse doesn't report any potential problems. Simplified, the code looks like this: NSDate* aDate -(id)init { aDate = [[NSDate date] retain] return self; } -(void)drawRect(CGRect)rect { NSMutableString* stringy = [[NSMutableString alloc] init]; //aDate is now deallocated and pointing at 0x0? [stringy appendString:[aDate description]]; //Crash } I should stress that the actual code is a lot more complicated than that, with a seperate thread also accessing the date object, however suitable locks are in place and when stepping through the code [aDate release] is not being called anywhere. Using [[NSDate alloc] init] bears the same effect. I should also add that init IS the first function to be called. Can anyone suggest something I may have overlooked, or why the NSDate object is (or appears to be) releasing itself?

    Read the article

  • iPhone NSTimer OpenGL problem

    - by Toby Wilson
    I've got a problem that only seems to occur on the device, not in the simulator. My app's animation is started and stopped using these methods: NSTimer* animationTimer; -(void)startAnimation { if(animationTimer = nil) animationTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f/60.0f target:self selector:@selector(drawView) userInfo:nil repeats:YES]; } -(void)stopAnimation { [animationTimer invalidate]; animationTimer = nil; } In the simulator this works fine and drawView starts being called at 60fps. On the device (testing on iPod Touch), the scheduleTimerWithTimeInterval method doesn't seem to work. Furthermore, [animationTimer invalidate] causes EXC_BAD_ACCESS. I've spotted an obvious but minor flaw; adding if(animationTimer != nil) to the stopAnimation method will prevent the crash, but doesn't solve the problem of the animation timer not being properly initialised. Edit: The above doesn't prevent a crash. animationTimer != nil yet calling invalidate causes EXC_BAD_ACCESS. Should also add, this problem doesn't occur all the time on the device. Maybe 40% of the time.

    Read the article

  • GORM column names for simple one to many mapping

    - by Toby Hobson
    I have this setup class User { Date lastLogin // logins is a history of logins static hasMany = [logins : Date] def setLastLogin(Date date) { if (date) { lastLogin = date addToLogins(date) } } } GORM is generating a table MEMBER_LOGINS which currently looks like this: USER_ID, LOGINS Instead I would like USER_ID, DATE I tried adding a mapping in User static mapping = { logins column: 'date'; } But that just changed the foreign key so i now have DATE, LOGINS How can I change the LOGINS column? Thanks!

    Read the article

  • CSS overflow character not pushing down <div>

    - by Uncle Toby
    I have a <div> called bigbox which contain a <div>called wrapper . The wrapper contain 2 <div> called textbox and checkbox. If the characters inside textbox overflow , it doesn't push the other wrapper below . How can I make the below wrapper go down ? here is the jsfiddle : http://jsfiddle.net/WA63P/ <html> <head> <title>Page</title> <script type="text/javascript" src="jquery-1.9.1.min.js"></script> <style type="text/css"> .bigbox { background-color: #F5E49C; color: #000; padding: 0 5px; width:280px; height:500px; position: absolute; text-align: center;content: "";display: block;clear: both; } .box { background-color: #272822; color: #9C5A3C; height:100px; width:260px; margin-bottom: 10px; position: relative; top:10px; } .textbox { background-color: #FFFFFF; color: #272822; height:100px; width:160px;float:left;text-align: left } .checkbox { background-color: #FFFFFF; height:50px; width:50px; float:right; d } </style> <div class="bigbox"> <div class="box"> <div class="textbox">background background background background background background background background background background background background background background background background background background background background background background </div> <div class="checkbox"> </div> </div> <div class="box"> <div class="textbox"> </div> <div class="checkbox"> </div> </div> </body> </html>

    Read the article

  • Randomly Losing Session Variables Only In Google Chrome & URL Rewriting

    - by Toby
    Using Google Chrome, I'm seemingly losing/corrupting session data when navigating between pages (PHP 5.0.4, Apache 2.0.54). The website works perfectly fine in IE7/8, Firefox, Safari & Opera. The issue is only with Google Chrome. I narrowed down the problem. I'm using search friendly URL's, and hiding my front controller (index.php) via a .htaccess file. So the URL looks like: www.domain.com/blah/blah/ Here's the .htaccess file contents: Options +FollowSymlinks RewriteEngine on #allow cool urls RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php [L] #allow to have Url without index.php If I remove the .htaccess file, and expose the front controller in the URL: www.domain.com/index.php/blah/blah/, Chrome works perfectly fine. Any thoughts ideas? I'm thinking it's some kind of problem with how Chrome identifies what cookie to use and send to the server? This happens in Chrome 4 & 5. Thanks!

    Read the article

  • dynamic model is not loading fields

    - by Toby Justus
    I am using a dynamic model found on the forum of sencha. function modelFactory(name, fields) { alert(fields); return Ext.define(name, { extend: 'Ext.data.Model', fields: fields }); } I placed the alert(fields) to check what happens with the field because it was not working. I get this: [object Object],[object Object],[object Object] How can i change this into a correct way to use it in the fields? Is there a way to check if the model has been created? With Firebug or something? EDIT: i get this in firebug: [Object { name="ccuDesignation", type=null}, Object { name="wanNumber", type=null}, Object { name="carrierName", type=null}, Object { name="dataPackageName", type=null}, Object { name="simIccid", type=null}, Object { name="expiryTime", type=null}, Object { name="bytesRx", type=null}, Object { name="bytesTx", type=null}]

    Read the article

  • Getting Excel add ins to modify array formula parameters; or perform 'ctrl-shift-enter'

    - by Toby Wilson
    I am trying to make a C# Excel add in change the parameters of an array formula in-place; i.e. do the same as a user modifying an array formula and hitting ctrl-shift-enter. Setting the activeCell.FormulaArray property does not achieve this; it throws a 'You cannot change part of an array' error. Does anyone know how I can achieve this? A solution that also works in VBA would be brilliant. I've tried creating some logic that 'walks' to the perimeter of the array formula and deletes it first, but it doesn't account for adjacent array formulas and I believe this is unnecessarily drastic.

    Read the article

  • Managing project configurations in VS 2010

    - by Toby
    I'm working on a solution with multiple projects (class libraries, interop, web application, etc) in VS2010. For the web application, I would like to take advantage of the config transformations in VS2010, so at one point I added configurations for each of our environments: Development, Test, Production, and so on. Some time later, after having rearranged the project layout, I noticed that some projects show all of the configurations in the properties page dropdown. Some projects (added since I did that setup) show only the standard Debug & Release configurations. Once I realized that this was going to make build configurations worse, not better, I decided to remove all of the extra configurations I had added. I've removed all of the various configuration options from the solution, but the projects that had the alternate configuration options still have them, and I can't figure out how to get rid of them in individual projects. Also, now that I see that not all projects have to have the same configurations, I would like to create my environmental configurations at the solution level, and in the web application project (for the config transforms), but leave all of the class libraries with the basic Debug/Release configurations. I've been unable to find any tool in the UI, or any information on the 'Net, concerning how to set up such a thing. So, in short, what's the best/easiest way to manage configurations at the project level in VS2010?

    Read the article

  • casting BSTR as char* in a dll; different results depnding on VB/C# caller.

    - by Toby Wilson
    I have a dll function that takes BSTR parameters. These are casted as char* before being used for other things. When the dll is called from VB code this works fine. However, when it is called from C# code, only the first character is pointed to. Both of these are excel addIns for Pre-2007 and 2007+ versions of Office, which call into a faster C++ AddIn. They actually call it directly, not through Excel. The VB function declaration looks like this: Private Declare Function Test Lib "ExcelAddIn.xll" (ByVal param As String) As String The C# function declaration looks like this: [DllImport("ExcelAddIn.xll", CharSet=CharSet.Ansi)] [return:MarshalAs(UnmanagedType.BStr)] private static extern string Test([MarshalAs(UnmanagedType.BStr)] string param); When debugging the dll and watching the input BSTR values, they appear to be correct from both; just the C# one only casts the first character. Charset=CharSet.Unicode makes no difference. Any ideas anyone?

    Read the article

  • Objective-C memory management issue

    - by Toby Wilson
    I've created a graphing application that calls a web service. The user can zoom & move around the graph, and the program occasionally makes a decision to call the web service for more data accordingly. This is achieved by the following process: The graph has a render loop which constantly renders the graph, and some decision logic which adds web service call information to a stack. A seperate thread takes the most recent web service call information from the stack, and uses it to make the web service call. The other objects on the stack get binned. The idea of this is to reduce the number of web service calls to only those appropriate, and only one at a time. Right, with the long story out of the way (for which I apologise), here is my memory management problem: The graph has persistant (and suitably locked) NSDate* objects for the currently displayed start & end times of the graph. These are passed into the initialisers for my web service request objects. The web service call objects then retain the dates. After the web service calls have been made (or binned if they were out of date), they release the NSDate*. The graph itself releases and reallocates new NSDates* on the 'touches ended' event. If there is only one web service call object on the stack when removeAllObjects is called, EXC_BAD_ACCESS occurs in the web service call object's deallocation method when it attempts to release the date objects (even though they appear to exist and are in scope in the debugger). If, however, I comment out the release messages from the destructor, no memory leak occurs for one object on the stack being released, but memory leaks occur if there are more than one object on the stack. I have absolutely no idea what is going wrong. It doesn't make a difference what storage symantics I use for the web service call objects dates as they are assigned in the initialiser and then only read (so for correctness' sake are set to readonly). It also doesn't seem to make a difference if I retain or copy the dates in the initialiser (though anything else obviously falls out of scope or is unwantedly released elsewhere and causes a crash). I'm sorry this explanation is long winded, I hope it's sufficiently clear but I'm not gambling on that either I'm afraid. Major big thanks to anyone that can help, even suggest anything I may have missed?

    Read the article

  • Getting Database Data to the client side.

    - by Toby Allen
    I'm sure this has been asked a million times, but what is the accepted approach to this? I have been writing php code for a while and up until recently I only copied+pasted javascript code, but now with help from YUI I've begun to understand javascript and want to use it more in an existing web app I have. I want to get various amounts of data from databases etc to the clientside javascript. I have access to this data in my php pages when loading. What is the correct way to get this data to my client side script. Generate clientside javascript in my php or smarty template files inserting the data where I need it? Use an Ajax call to retrieve the information I need from a php file - returning JSON data? Generate a JSON data construct of the data needed by the page and either return it via a script inclusion or dumping it to the generated page? Something really obvious I haven't thought of.

    Read the article

  • PHP: How to forward on $_FILES using cURL

    - by Toby
    Hi. I'm trying to use cURL to forward on a http request from a form in a web application I'm developing. Essentially I need to submit the same form twice on different servers, for the second server I'm adding some security measures to the post data. I can receive $_POST information on the second form perfectly fine, however I'm having major troubles with my $_FILES - I've tried separating the two so there's a separate request for post and files data but still no luck. Is this possible?

    Read the article

  • Data format for content heavy iPhone app - Plist or XML?

    - by Toby
    Hello, I'm building an iPhone app that is essentially a book, it will be bundled with a lot of text-heavy content. I considered bundling the data as XML and load it when the application starts but the XML would contain a lot of nested structures and be a bit of a pain to parse. Would it be better to use a plist? I'm concerned about memory usage and plists are loaded entirely into memory - can they be parsed in chunks? Is there a maximum size to a plist and how efficient are they? I'm not sure how big the bundled content is going to be yet but I should imagine it could be anywhere from 500k to 4MB. Thanks in advance.

    Read the article

  • A tool for finding duplicate code in PHP

    - by Toby
    Are there any tools available that can scan multiple .php files and report back duplicated lines/chunks of code? It doesn't have to be really smart but basically give me a starting point for manual scans to improve the codebase of some of my apps.

    Read the article

  • Magento: Add (and retrieve) custom database field for CMS pages

    - by Toby H
    I want to assign custom parameters to CMS pages in Magento (i.e. 'about', 'customer service', etc), so they can be grouped. The end goal is to use the parameters for each page to show (or hide) them in a nav menu. Writing a quick method in the page/html block to retrieve the pages (active only) for the menu was easy, but I can't figure out how to group them so that 'testimonials', 'history', and 'contact' are associated with 'about', and 'return policy', 'shipping', and 'contact' are associated with 'customer service'. Any help to point me in the right direction would be greatly appreciated. Thanks!

    Read the article

  • Recreating http request with cURL incl. files

    - by Toby
    I consistently get the error 'failed creating formpost data' from the below code, the same thing works perfectly on my local testing server, but on my shared host it throws the error. The sample part is just to simulate building the array with both files and non-file data. Essentially all I'm trying to do here is redirect the same http request to another server, but I'm running into so many troubles. $count=count($_FILES['photographs']['tmp_name']); $file_posts=array('samplesample' => 'ladeda'); for($i=0;$i<$count;$i++) { if(!empty($_FILES['photographs']['name'][$i])) { $fn = genRandomString(); $file_posts[$fn] = "@".$_FILES['photographs']['tmp_name'][$i]; } } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"http://myurl/wp-content/plugins/autol/rec.php"); curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch,CURLOPT_HEADER,TRUE); curl_setopt($ch,CURLOPT_POST,TRUE); curl_setopt($ch,CURLOPT_POSTFIELDS,$file_posts); curl_exec($ch); print curl_error($ch); curl_close($ch);

    Read the article

  • Preserve name of file using cURL to transfer files

    - by Toby
    I'm transferring files from an existing http request using cURL like so... $postargs = array( 'nonfilefield' =>'nonfilevalue', 'fileentry' => '@'.$_FILES['thefile']['tmp_name'][0] ); $ch = curl_init('http://localhost/curl/rec.php'); curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_POST,TRUE); curl_setopt($ch,CURLOPT_POSTFIELDS,$postargs); curl_exec($ch); curl_close($ch); The only way I can get this to work is using the tmp_name, without this it won't send. However, I then lose the name value for when I want to name the file later. Is there some way to do this preserving the $_FILES array as it normally would be without curl? I'm also using an array of file fields in my script, so at the moment I have to convert my multidimensional array into a single dimension for this to work

    Read the article

< Previous Page | 1 2 3 4  | Next Page >