Posts Tagged ‘iphone’
06
ott

Yesssss!

it’s only a preview, i’m working on… but it works! It’s in objective-c.

Bing Map on iPhone

Bing Maps on iPhone!

Stay tuned….






Bing reference: http://www.microsoft.com/maps/isdk/ajax/
Rif: http://www.albertopasca.it/




FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , ,

12
set

Well,
for your information, albertopasca.it had a custom page for iPhone!
Navigate with safari from your iPhone to show it!

Here a screenshot:


albertopasca.it - iPhone

cheers!

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , ,

02
ago

Do you want to create an UIColor from RGB value?

Here the snipplet:

1
2
3
4
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

to use:

1
UIColor aColor = UIColorFromRGB(0xFF00FF);

it’s all!

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , ,

02
lug

Apple: iPhone 4 reception problem is a software issue, fix coming in ‘a few weeks’

Upon investigation, we were stunned to find that the formula we use to calculate how many bars of signal strength to display is totally wrong. Our formula, in many instances, mistakenly displays 2 more bars than it should for a given signal strength. For example, we sometimes display 4 bars when we should be displaying as few as 2 bars. Users observing a drop of several bars when they grip their iPhone in a certain way are most likely in an area with very weak signal strength, but they don’t know it because we are erroneously displaying 4 or 5 bars. Their big drop in bars is because their high bars were never real in the first place.

To fix this, we are adopting AT&T’s recently recommended formula for calculating how many bars to display for a given signal strength. The real signal strength remains the same, but the iPhone’s bars will report it far more accurately, providing users a much better indication of the reception they will get in a given area. We are also making bars 1, 2 and 3 a bit taller so they will be easier to see.

We will issue a free software update within a few weeks that incorporates the corrected formula. Since this mistake has been present since the original iPhone, this software update will also be available for the iPhone 3GS and iPhone 3G.

Rif: http://www.engadget.com/2010/07/02/apple-iphone-4-reception-problems-a-software-issue-fix-coming/

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , , , ,

28
gen

Ebbene si, finalmente qualcuno c’è l’ha fatta!!!

Il tutto grazie a GeoHot, già noto per il jailbreak su iPhone che ci è riuscito lavorandoci poco più di 5 settimane.

Play Station 3 Exploit

Per eseguire questo exploit, rigorosamente fatto in linguaggio C avanzatissimo direi (a giudicare da come è scritto e dall’utilizzo che fa della memoria…) è necessario avere sulla play station installato linux, che in ogni caso potete seguire la documentazione da qui.

L’exploit è stato rilasciato e si può scaricare tranquillamente. Nel pacchetto troverete il codice sorgente C da compilare, il makefile e lo script per la sua esecuzione.

Volete sapere come funziona? Ecco qui:

geohot: well actually it’s pretty simple
geohot: i allocate a piece of memory
geohot: using map_htab and write_htab, you can figure out the real address of the memory
geohot: which is a big win, and something the hv shouldn’t allow
geohot: i fill the htab with tons of entries pointing to that piece of memory
geohot: and since i allocated it, i can map it read/write
geohot: then, i deallocate the memory
geohot: all those entries are set to invalid
geohot: well while it’s setting entries invalid, i glitch the memory control bus
geohot: the cache writeback misses the memory :)
geohot: and i have entries allowing r/w to a piece of memory the hypervisor thinks is deallocated
geohot: then i create a virtual segment with the htab overlapping that piece of memory i have
geohot: write an entry into the virtual segment htab allowing r/w to the main segment htab
geohot: switch to virtual segment
geohot: write to main segment htab a r/w mapping of itself
geohot: switch back
geohot: PWNED
geohot: and would work if memory were encrypted or had ECC
geohot: the way i actually glitch the memory bus is really funny
geohot: i have a button on my FPGA board
geohot: that pulses low for 40ns
geohot: i set up the htab with the tons of entries
geohot: and spam press the button
geohot: right after i send the deallocate call

With great power comes great responsibility…


Fonti:

- Punto Informatico
- Blog GeoHot
- Wiki Play Station Developer

[ref -> albertopasca.it]

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , , , , , ,

23
lug

Bene, semplifichiamoci la vita.
Ecco come fare un parser di un xml in modo facile e veloce in pochi passi!

ReverseGeo.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#import <foundation /Foundation.h>

@interface ReverseGeo : NSObject {
       /* dichiarazioni */
  NSXMLParser   *revParser;
  NSMutableDictionary *item;
  NSString      *currentElement;
 
       /* Array contenenti i valori trovati nell'xml */
  NSMutableArray    *elements;
  NSMutableString   *citta,
            *via,
            *dug;
}
- (void) parseXMLFileAtURL: (NSString *) URL;
@end

ReverseGeo.m

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#import "ReverseGeo.h"

@implementation ReverseGeo
- (void) parseXMLFileAtURL: (NSString *) URL {
 
  @try{
    elements = [[NSMutableArray alloc] init];
    NSURL *xmlURL = [[NSURL alloc] initWithString:URL];
   
    revParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
   
    [revParser setDelegate:self];
    [revParser setShouldProcessNamespaces:NO];
    [revParser setShouldReportNamespacePrefixes:NO];
    [revParser setShouldResolveExternalEntities:NO];
    [revParser parse]
   
  }@catch (NSException * e) { }
}

- (void) parserDidStartDocument: (NSXMLParser *) parser { }

- (void) parser: (NSXMLParser *) parser parseErrorOccurred: (NSError *) parseError {
     NSLog(@"Errore nel parser!");
}

- (void) parser: (NSXMLParser *) parser didStartElement: (NSString *) elementName
                                                              namespaceURI: (NSString *) namespaceURI
                                                              qualifiedName: (NSString *) qName
                                                                     attributes: (NSDictionary *) attributeDict{

  currentElement = [elementName copy];
        /* tag xml di partenza */
  if ([elementName isEqualToString:@"RevGeo_Out"])
  {
    item    = [[NSMutableDictionary alloc] init];
    citta   = [[NSMutableString alloc] init];
    via   = [[NSMutableString alloc] init];
    dug   = [[NSMutableString alloc] init];
  }
}

- (void) parser: (NSXMLParser *) parser didEndElement: (NSString *) elementName
                                                             namespaceURI: (NSString *) namespaceURI
                                                             qualifiedName: (NSString *) qName{  
 
  if ([elementName isEqualToString:@"RevGeo_Out"])
  {
                /* riempio gli array con le chiavi */
    [item setObject:citta forKey:@"citta"];
    [item setObject:via forKey:@"via"];
    [item setObject:via forKey:@"dug"];

    [elements addObject:[item copy]];  
  }
}

- (void) parser: (NSXMLParser *) parser foundCharacters: (NSString *) string{
  @try {
                /* prendo i tag xml seguenti */
    if ([currentElement isEqualToString:@"com"]) {
      [citta appendString:string];
    } else if ([currentElement isEqualToString:@"topo"]) {
      [via appendString:string];
    } else if ([currentElement isEqualToString:@"dug"]) {
      [dug appendString:string];
    }
  }@catch (NSException *e) { }
}

- (void) parserDidEndDocument: (NSXMLParser *)parser { }

- (void) dealloc {  [super dealloc]; }
@end

i due file sopra sono le definizioni per un corretto parser xml.


Ma… come si usa?
Beh, è più facile di quanto sembra!

1
2
3
4
5
6
7
8
9
        /* dichiarazione e allocazione */
  ReverseGeo reverse = [ReverseGeo new];

  NSString *reverseUrl =
    [[NSString alloc] initWithString:@"http://sito.xml"];
  [reverse parseXMLFileAtURL:reverseUrl];
 
        /* accesso ai campi */
  NSLog(@"VIA: %@ - CITTA: %@", reverse->via, reverse->citta);

EOF!

[ref -> albertopasca.it]

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, ,

23
lug

A differenza di Java ed altri linguaggi, Objective-C non ha un metodo per convertire da decimale a binario e viceversa, o almeno… io non l’ho trovato!

Ecco qui:

Conversione da decimale a binario:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
- (NSString*) getBinary:(int)num {
  int m, no = 0, a = 1, rem;
 
  m = num;
  while(num != 0)
  {
    rem = num % 2;
    no  = no + rem * a;
    num = num / 2;
    a   = a * 10;
  }
  NSString *bin = [[NSString alloc] initWithFormat:@"%d", no];
  return bin;
}

Conversione da binario a decimale:

1
2
3
4
5
6
7
8
9
10
11
12
13
- (NSString*) getDecimal:(NSString*)binary {
  int d = 0;
  NSString *a;
  for(int i=0; i< [binary length]; i++)
  {
    a = [[NSString alloc] initWithFormat:@"%c",
      [binary characterAtIndex:i]];
    double r = pow(2, [binary length] - 1 - i);
    d += ([a intValue] * r);
  }
  NSString *dec = [[NSString alloc] initWithFormat:@"%d", d];
  return dec;
}

è tutto!

[ref -> albertopasca.it]

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , ,

Switch to our mobile site