<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OOPS</title>
	<atom:link href="http://www.weston-fl.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.weston-fl.com/blog</link>
	<description>Oops Tech Blog</description>
	<lastBuildDate>Tue, 07 Sep 2010 13:14:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>User and company name comments in Xcode projects</title>
		<link>http://www.weston-fl.com/blog/?p=1220</link>
		<comments>http://www.weston-fl.com/blog/?p=1220#comments</comments>
		<pubDate>Mon, 06 Sep 2010 00:22:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.weston-fl.com/blog/?p=1220</guid>
		<description><![CDATA[Question: I am wondering how you change the comments that Xcode puts in the top of each source file to set the proper username and company name instead of updating every file by hand if these macro fields are different from the default settings of Address Book. I am speaking about these source code lines:
// [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> I am wondering how you change the comments that Xcode puts in the top of each source file to set the proper username and company name instead of updating every file by hand if these macro fields are different from the default settings of Address Book. I am speaking about these source code lines:<br />
// Created by  MyUserName on 8/19/10.<br />
// Copyright __MyCompanyName__ 2010. All rights reserved.<br />
<span id="more-1220"></span><br />
<strong>Answer:</strong> Since the Xcode 3.1 the USERNAME and ORGANIZATIONNAME values in templates are replaced with the User Name and Company Name from the current user’s Address Book card, if present. In Xcode 4+ you can set the company name in your project settings. See File -&gt; Get Info -&gt; Organization Name. With this utility you can easily assign individual company names to your projects.</p>
<p>If the <em>PBXCustomTemplateMacroDefinitions</em> user default has already been set, it will be honored by Xcode 3.1+. So the answer is here:</p>
<ol>
<li>Close your Xcode.</li>
<li>Open the Finder.</li>
<li>Navigate to (your) Library\Preferences folder. Open the com.apple.Xcode.plist file.</li>
<li>Find, open (or create) the PBXCustomTemplateMacroDefinitions dictionary key.</li>
<li>Modify or add the ORGANIZATIONNAME key as a String if not present, set the value to your desire.</li>
<li>Modify or add the USERNAME key as a String if not present, set the value.</li>
<li>Save changes.</li>
<li>Open Xcode.</li>
</ol>
<div id="xcode" class="wp-caption aligncenter" style="width: 490px"><img title="Xcode settings for iPhone and iPad projects" src="http://www.weston-fl.com/blog/images/xcode_comment.png" alt="How to set Xcode to show user and company name" width="480" height="280" /><p class="wp-caption-text">Comment settings for Xcode projects</p></div>
<p>By using the Terminal window you can avoid the hassle of changing the plist file manually. Run the <em>defaults </em>command:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{&quot;ORGANIZATIONNAME&quot; = &quot;WHATEVER Name Here&quot;;}' <br />
<br />
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{&quot;USERNAME&quot; = &quot;WHOEVER Name Here&quot;;}'<br />
<br />
---- do not forget to hit Return :-)</div></td></tr></tbody></table></div>
<p>If you want to find out what expansion macros you have defined, you can do this:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">defaults read com.apple.Xcode PBXCustomTemplateMacroDefinitions</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.weston-fl.com/blog/?feed=rss2&amp;p=1220</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cancel window closing operation in java app</title>
		<link>http://www.weston-fl.com/blog/?p=1202</link>
		<comments>http://www.weston-fl.com/blog/?p=1202#comments</comments>
		<pubDate>Mon, 30 Aug 2010 22:00:17 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>

		<guid isPermaLink="false">http://www.weston-fl.com/blog/?p=1202</guid>
		<description><![CDATA[Question: In my Java swing crossplatform project I have to ask the user if he/she really wants to quit from the desktop application before exit, so I have to handle the WindowClosing event. My problem is simple. I expected the DO_NOTHING_ON_CLOSE flag to prevent the form from closing. I didn&#8217;t thought the WindowClosing event will [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> In my Java swing crossplatform project I have to ask the user if he/she really wants to quit from the desktop application before exit, so I have to handle the WindowClosing event. My problem is simple. I expected the DO_NOTHING_ON_CLOSE flag to prevent the form from closing. I didn&#8217;t thought the WindowClosing event will be fired even if the setDefaultCloseOperation was set to DO_NOTHING. When I even click on the NO button the window does close! Have you experienced it before and what have you done? Thank you in advance. I am attaching my code.<span id="more-1202"></span></p>
<p><strong>Answer:</strong> The answer is in the org.jdesktop.application.Application.ExitListener interface documentation. Read more <a href="http://java.sun.com/developer/technicalArticles/javase/swingappfr/" title="How to handle application events" target="_blank">from here</a>. This web page contains a SingleFrameApplication example code that shows how you might implement an ExitListener object. The exit method calls the shutdown method only if all listeners approve the request to exit.</p>
<p>Your code is:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:400px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; // In my .app class:<br />
&nbsp; &nbsp; public class MyProjectApp extends SingleFrameApplication {<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; @Override protected void startup() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; show(new MyProjectAppView(this));<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; // .... <br />
&nbsp; &nbsp; &nbsp; &nbsp; public static void main(String[] args) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; launch(MyProjectApp.class, args);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; // ...... In MyProjectAppView constructor:<br />
&nbsp; &nbsp; &nbsp; &nbsp; JFrame frm = getFrame();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // I set the DO_NOTHING_ON_CLOSE flag here:<br />
&nbsp; &nbsp; &nbsp; &nbsp; frm.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);<br />
&nbsp; &nbsp; &nbsp; &nbsp; frm.setResizable(false);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // I add closing listener<br />
&nbsp; &nbsp; &nbsp; &nbsp; frm.addWindowListener(new WindowAdapter() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void windowClosing(WindowEvent e) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseApp();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/ /....<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; @Action<br />
&nbsp; &nbsp; &nbsp; &nbsp; public void CloseApp(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Returns YES = true , NO = false <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( Question(&quot;Do you really want to quit?&quot;) ){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getFrame().dispose();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.exit(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</div></td></tr></tbody></table></div>
<p>The Application class implements an exit method to shut down your application. According to the Java documentation, this process involves asking any ExitListener objects whether exiting is possible, then alerting those same listeners that the Application will actually shut down. Regardless of how you finally call the exit method, you should override it to perform application-specific cleanup. It should work for you:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp;// Insert into View constructor<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.getApplication().addExitListener(new ExitHandler());<br />
&nbsp; &nbsp; &nbsp;// ...<br />
&nbsp; &nbsp; &nbsp;// <br />
&nbsp; &nbsp; &nbsp;// Add inner class event handler for app exit to your View class<br />
&nbsp; &nbsp; class ExitHandler implements org.jdesktop.application.Application.ExitListener<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; public boolean canExit(EventObject e) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // In your CloseApp() method set boolean flag bCanExit to true or false<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // By the way it is a perfect place for App cleanup<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return bCanExit; &nbsp;// true or false<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; public void willExit(EventObject e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.weston-fl.com/blog/?feed=rss2&amp;p=1202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strong 8345CI remote control for SlingBox</title>
		<link>http://www.weston-fl.com/blog/?p=1168</link>
		<comments>http://www.weston-fl.com/blog/?p=1168#comments</comments>
		<pubDate>Mon, 09 Aug 2010 15:30:38 +0000</pubDate>
		<dc:creator>Misa</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[SlingBox]]></category>

		<guid isPermaLink="false">http://www.weston-fl.com/blog/?p=1168</guid>
		<description><![CDATA[Question: I have a SlingBox Pro HD. I bought a Strong 3845 CI satellite and DVB-T receiver in Vienna I want to control and watch remotely from the States. So I opened the Setup Assistant and went through the device options and when I get to &#8216;Who Manufactured your Satelite Receiver&#8217; I could not find [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> I have a SlingBox Pro HD. I bought a Strong 3845 CI satellite and DVB-T receiver in Vienna I want to control and watch remotely from the States. So I opened the Setup Assistant and went through the device options and when I get to &#8216;Who Manufactured your Satelite Receiver&#8217; I could not find my Strong receiver. I tried all kinds of options and still can not get it done. I heard that I needed a programmer who could create remote control codes in a binary file for the SlingBox. I have a home network with WiFi DSL router and a laptop.<span id="more-1168"></span></p>
<p><strong>Answer:</strong> You do need neither a programmer nor the Setup Assistant. SlingBox published &#8211; but has not advertised &#8211; a great web site that helps you create, and save and load custom remote control codes. This beta site is a perfect tool for creating and editing remote controls for all of us. Use it! It is much easier than the so-called JP1 remote method to create .BIN files for the SlingPlayer.</p>
<p>With this &#8220;hidden&#8221; web site we have created an .LRZ file for you that is downloadable from us:</p>
<p>1. Switch on your SlingBox and check out the IR blaster cable. Connect your SlingBox and your computer to your home network (LAN).</p>
<p>2. Download to your computer the latest IR remote control file from here: <a href="http://www.weston-fl.com/blog/images/SlingBoxRemote_Strong8345CI.zip" target="_blank" title="Download remote control codes for STRONG 8345CI">SlingBoxRemote_Strong8345CI.zip</a>. Save it to a convenient place, such as C:\ or your desktop.</p>
<p>3. Extract the SlingBoxRemote_Strong8345CI.lrz from the ZIP file. Remember the path. </p>
<p>4. Open the SlingBox beta site to get the browser plugin: <a href="http://betaremotes.slingbox.com/remotes/start" target="_blank" title="SlingBox beta site for setting remote control">http://betaremotes.slingbox.com/remotes/start</a></p>
<p>5. Select your SlingBox. Navigate to the next page and click on Import Remote button. </p>
<p>6. Give the exact full path name of the downloaded file such as C:\SlingBoxRemote_Strong8345CI.lrz</p>
<p>7. After clicking on the OK button, the browser plugin copies Strong remote control codes to your SlingBox.</p>
<p>8. Quit from the browser. Open your SlingPlayer. You can now find and use your Strong 8345CI remote controller.</p>
<p>Notes: If you are using the Slingplayer Desktop then I recommend that you also test it on the Web Slingplayer. You likely face no problem until the next firmware upgrade. </p>
<p>If you have updated your firmware and the remote controller appears in one but not the other, then uninstall the faulty software and reinstall it by using the latest version. If error still persists with both the Web SlingPlayer and the SlingPlayer Desktop then most likely the problem is a corrupted remote control file (that was uploaded into the SlingBox earlier). Try reconfiguring the Video Source. The Setup Assistant will upload a new remote file at the end of the process. If that fails, as a last resort, use the &#8220;Reset&#8221; button to manually clear the settings and go through the setting process again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weston-fl.com/blog/?feed=rss2&amp;p=1168</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK 4 binary is not accepted by iTunes</title>
		<link>http://www.weston-fl.com/blog/?p=1120</link>
		<comments>http://www.weston-fl.com/blog/?p=1120#comments</comments>
		<pubDate>Sat, 17 Jul 2010 19:05:51 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.weston-fl.com/blog/?p=1120</guid>
		<description><![CDATA[Question: I&#8217;m going crazy. I&#8217;m trying to upload a new binary compiled by the latest iPhone SDK 4 to the iTunes App Store. I have got the error message: &#8220;Apple is not currently accepting applications built with this version of the SDK.&#8221; I build the code under SDK 4.0 with a deployment target of OS [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question:</strong> I&#8217;m going crazy. I&#8217;m trying to upload a new binary compiled by the latest iPhone SDK 4 to the iTunes App Store. I have got the error message: &#8220;Apple is not currently accepting applications built with this version of the SDK.&#8221; I build the code under SDK 4.0 with a deployment target of OS 3.0 or below and it does not work. I checked my code on the built-in simulator before uploading the bundle. Provisioning profile is correctly selected. I have even reinstalled the iPhone SDK 4.0.<br />
<span id="more-1120"></span><br />
<strong>Answer:</strong> We managed to upload an iPhone app to the App Store today. Before uploading an app to iTunes check out that you surely build your application with <strong>Device</strong> SDK and the configuration is set to <strong>Release</strong>. You may set your Deployment target to 3.0, so any iPhone running 3.0 or higher can run your app. Since iPhone SDK 4 we have to pay attention to these details.</p>
<p>You do not have to reinstall Xcode. The latest iPhone SDK will let you only build up against Device 3.2 (iPad only) or 4.0, but you can set your deployment target lower like iPod 3, iPhone 3G, iPhone 3GS running iPhone OS 3 or newer. Actually you can also select 2.0 &#8230; 2.2.1 deployment targets but it is not recommended.</p>
<div id="xcode4device" class="wp-caption aligncenter" style="width: 490px"><img title="How to build projects for iTunes App Store" src="http://www.weston-fl.com/blog/images/xcode4-sdk-device-settings.jpg" alt="Xcode settings before uploading an app to iTunes" width="480" height="250" /><p class="wp-caption-text">Select a Device to build an application bundle. iPhone Device 3.2 = iPad</p></div>
<p>If you build your app&#8217;s release version with the active SDK set to Simulator, iTunes App Store will not accept it.</p>
<p>The app store is a moving target. In iPhone SDK 4 also pay attention to the App ID. Generate a new provisioning profile with full name for your app such as <em>com.myco.appname</em>. You can no longer use a wildcard for distributing your apps or, if you try, you likely get  a message from iTunes: &#8220;<em>The binary you uploaded was invalid. The application-identifier entitlement is not formatted correctly; it should contain your 10-character App ID Seed, followed by a dot, followed by your bundle identifier.</em>&#8221; </p>
<p>If you try to work-around the problem and add your <em>application-identifier</em> key-value pair to the Entitlements.plist file, you will notice that the iPhone SDK will rewrite it. We can patch the Xcode but that is not in our job description.</p>
<p>Another solution is to delete the Entitlements.plist from your project. When you re-add it, it will be created from a template that has a prebuilt correct application-identifier property. See the app bundle. Annoying though.</p>
<p>When you get the warning of &#8220;<em>Building with &#8216;Targeted Device Family&#8217; set to iPhone only (&#8217;1&#8242;) not supported with SDK &#8216;Device &#8211; iPhone OS 3.2&#8242;</em>&#8221; from Xcode and the target is not iPad exclusive, you must set the base SDK to 4.0. You can change the deployment target in the active target settings to whatever iPhone OS (see above). Use base SDK 3.2 in iPad projects. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.weston-fl.com/blog/?feed=rss2&amp;p=1120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
