Search Results

Search found 4 results on 1 pages for 'ojreadmore'.

Page 1/1 | 1 

  • libarchive reads too many chars when extracting a file

    - by ojreadmore
    I've written a C program to extract files from a tar archive using libarchive. I'd like to extract a file from this archive and print it to standard output. But I get extra characters. It's garbage, but it's from another file (possibly adjacent to it in the archive.) I expect output to end at </html>. Here is the code that reads this tar file. libarchive 2.8.3 compiled on mac os X 10.6.3. gcc 4.2 x86_64 ls -l vendar-definition.html gives me 1921 for the file size. And so shows tar tfv 0000.tar | grep vendar-definition.html. So reports the C output that states the file size. To me this seems correct. Two possibilities I can see for why my output is not as expected: 1. I've made a beginner's mistake or 2. multibyte characters in the archive files has something to do with it.

    Read the article

  • Custom UITableViewCell trouble with UIAccessibility elements

    - by ojreadmore
    No matter what I try, I can't keep my custom UITableViewCell from acting like it should under the default rules for UIAccessiblity. I don't want this cell to act like an accessibility container (per se), so following this guide I should be able to make all of my subviews accessible, right?! It says to make each element accessible separately and make sure the cell itself is not accessible. - (BOOL)isAccessibilityElement { return NO; } - (NSString *)accessibilityLabel { return nil; } - (NSInteger)accessibilityElementCount { return 0; } - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier //cells use this reusage stuff { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self setIsAccessibilityElement:NO]; sub1 = [[UILabel alloc] initWithFrame:CGRectMake(0,0,1,1)]; [sub1 setAccessibilityLanguage:@"es"]; [sub1 setIsAccessibilityElement:YES]; [sub1 setAccessibilityLabel:sub1.text] sub2 = [[UILabel alloc] initWithFrame:CGRectMake(0,0,1,1)]; [sub2 setAccessibilityLanguage:@"es"]; [sub2 setIsAccessibilityElement:YES]; [sub2 setAccessibilityLabel:sub2.text] The voice over system reads the contents of the whole cell all at once, even though I'm trying to stop that behavior. I could say [sub2 setIsAccessibilityElement:NO]; but that would would make this element entirely unreadable. I want to keep it readable, but not have the whole cell be treated like a container (and assumed to be the English language). There does not appear to be a lot of information out there on this, so at the very least I'd like to document it.

    Read the article

  • Alternatives to UIWebView for rich content?

    - by ojreadmore
    In my app, I am displaying 4 "tabs", each are local content through a UIWebView. I create HTML markup from my simple data. This is slow to load and I'm trying to speed it up. I'm using UIWebView to accomplish these: 1. hyperlinks 2. some styling - font colors 3. HTML tables Writing my own class to handle this is okay for (1.) hyperlinks - I can use a touch event to call a method. And (2.) styling - I can use UILables to do basic formatting, no biggie here. BUT what I really love about the UIWebViews is the (3.) HTML tables! I find it troublesome to line up the UILabels in a way that mimics HTML Tables, for instance, one cell's height in a row changes the height of all cells. I'm looking for another perspective or knowledge of an alternative.

    Read the article

  • Generate unique ID from multiple values with fault tolerance

    - by ojreadmore
    Given some values, I'd like to make a (pretty darn) unique result. $unique1 = generate(array('ab034', '981kja7261', '381jkfa0', 'vzcvqdx2993883i3ifja8', '0plnmjfys')); //now $unique1 == "sqef3452y"; I also need something that's pretty close to return the same result. In this case, 20% of the values is missing. $unique2 = generate(array('ab034', '981kja7261', '381jkfa0', 'vzcvqdx2993883i3ifja8')); //also $unique2 == "sqef3452y"; I'm not sure where to begin with such an algorithm but I have some assumptions. I assume that the more values given, the more accurate the resulting ID – in other words, using 20 values is better than 5. I also assume that a confidence factor can be calculated and adjusted. What would be nice to have is a weight factor where one can say 'value 1 is more important than value 3'. This would require a multidimensional array for input instead of one dimension. I just mashed on the keyboard for these values, but in practice they may be short or long alpha numeric values.

    Read the article

1