Archive for the 'Technology' Category

iPhone Dev: Adding the slide transition between views

The slide transition that’s used in the navigation controller is not a standard iPhone SDK transition. To add the slide transition (from right) between different UIViews use the following code

//1. Add the QuatzCore Framework from library to the Frameworks folder
//2. At the top include the header file

#import

//3. Implement the code

yourViewController = [[YourViewController alloc]
initWithNibName:@”YourViewController” bundle:nil];

//4. Add the transition in the method that moves to the next view
// get the view that’s currently showing
UIView *currentView = self.view;
// get the the underlying UIWindow, or the view containing the current view
UIView *theWindow = [currentView superview];

UIView *newView = yourViewController.view;

// remove the current view and replace with myView1
[currentView removeFromSuperview];
[theWindow addSubview:newView];

// set up an animation for the transition between the views
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

//5. The key is any unique string. From the CALayer class reference.
//key = “A string that specifies an identifier for the animation. Only one animation
//per unique key is added to the layer. The special key kCATransition is automatically
//used for transition animations. The nil pointer is also a valid key.”
[[theWindow layer] addAnimation:animation forKey:@”SwitchToNextView”];

Thanks to the participants at iphonedevsdk.com

Toll free bridges and the iPhone

Good description of toll free bridges (data types in the Core Foundation framework (Carbon) and the Foundation framework (Cocoa) that can be used interchangeably) in a Stack Overflow question.

Where is the jboss.bind.address configured?

From ConfigureServerPorts

jboss.bind.address is configured using the “-b” option to the JBoss startup script (run.sh or run.bat in the bin directory). For example, run -b 0.0.0.0 enables jboss to listen for connections on all IP addresses of the machine (if multi-homed).

View the JBoss JNDI Namespace

You can view the JNDI entries in JBoss by
1 - Browse to http://localhost/jmx-console
2 - Click “service=JNDIView”
3 - Invoke the “list()” operation

Notes:
1 - This is for JBoss 4.2.3.GA
2 - You must have the jmx-console installed.

Shrink a VMWare Fusion Image

I run VMWare Fusion on my Mac. The Windows XP image is 13 GB and the VM disk is set to 30 GB max on 2 GB boundaries. I began to run out of disk space on my Mac and noticed that the VMWare image was taking about 44 GB. This made NO sense as only 13 GB was being used by WinXP. I was able to clean up all the extra space by deleting snapshots. If you think you’ve deleted all your snapshots and Fusion is still consuming a lot of space, take a snapshot of your VM and then immediately delete the snapshot. In deleting the snapshot, Fusion will clean up files left over from previous snapshots. Also, make sure you have plenty of free space. If Fusion states that it doesn’t have enough free space, make some free space by temporarily moving non-Fusion folders (e.g. Documents) to an external drive. Then take a snapshot and immediately remove the snapshot.

MySQL XA datasource and JBoss

For some reason, I had a really hard time finding how to setup an XA datasource in JBoss for MySQL. Below is the contents of the file mysql-xa-ds.xml.

<datasources>
     <xa-datasource>
         <jndi-name>jdbc/DataSource</jndi-name>
         <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/ordb</xa-datasource-property>
         <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
         <user-name>root</user-name>
         <password>password</password>
         <track-connection-by-tx>true</track-connection-by-tx>
         <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-chec    ker-class-name>
         <min-pool-size>1</min-pool-size>
         <max-pool-size>10</max-pool-size>
         <idle-timeout-minutes>10</idle-timeout-minutes>
         <metadata>
             <type-mapping>mySQL</type-mapping>
         </metadata>
     </xa-datasource>
 </datasources>

Wireshark, WPA2, and MacBook Pro

It took me a couple of hours of playing with settings to get the WPA2 decode feature of Wireshark to work. I had to do the following

  • Navigate to Edit > Preferences > Protocols > IEEE 802.11
  • Select Enable Decryption
  • Select Assume Packets have FCS
  • Select Yes - with IV
  • Enter the appropriate keys. To get the keys you may have to do the following
    • Capture data with the 802.11 header setting
    • Filter on EAPOL packets
    • View the key(s) listed in the EAPOL packets
    • Enter those keys in the 802.11 preferences above (e.g. wpa-psk:0011223….)
  • Click OK
  • View captured data and look for TCP packets
  • Click on the “Decrypted…” tab in the lower window

Google Admits "Data is the Intel Inside"O'Reilly Radar

IBM recorded demonstration portfolioAlbert T. Wong

Static on the Dream PhoneO'Reilly Radar

Next Page »