tag:blogger.com,1999:blog-80250444450104554792024-03-14T00:29:05.252+13:00www.steamed-design.comThe most common format of music on an iPod is 'stolen'.
- Steve BallmerNeilhttp://www.blogger.com/profile/15947112692784516745noreply@blogger.comBlogger64125tag:blogger.com,1999:blog-8025044445010455479.post-43992540520771602882011-03-29T22:10:00.007+13:002011-03-30T10:23:26.177+13:00Pyamf Not Installing for TipfyI have spent the last three days trying to get Pyamf to work in tipfy to no avail, every time I try I got an error saying it could not compile.
<br />
<pre>AMF-0.6.1/distribute-0.6.14-py2.5.egg
WARNING: Could not build extension for 'temp.tmpla7hzZ.distribute-0.6.14.tests.shlib_test.hello', no source found
no previously-included directories found matching 'doc/build'
no previously-included directories found matching 'doc/_build'
warning: no previously-included files matching '*.swf' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
cpyamf/amf0.c:9329: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/lP/lPvYUKh7FLinUlJcZuddfE+++TI/-Tmp-//ccxqbDjN.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1
An error occurred when trying to install PyAMF 0.6.1. Look above this message for any errors that were output by easy_install.
While:
Updating app_lib.
Getting distribution for 'pyamf'.
Error: Couldn't install: PyAMF 0.6.1
</pre>
It was driving me insane that was until this morning when I actually read the error and changed was I was searching for, after a while I found a simular error and with a little guess work I came up with the following:
<br />
<pre>sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install multiprocessing</pre>
And thats it.Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8025044445010455479.post-61201040860430580722011-03-09T13:55:00.000+13:002011-03-09T13:55:06.498+13:00How to turn off the Shutdown Event Tracker for Windows Server<span id="internal-source-marker_0.8666064568535461" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Configure the Shutdown Event Tracker</span><br />
<ol>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Click Start, Run, and then enter gpedit.msc. Click OK.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">The Group Policy Object Editor console opens.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">In the left pane, expand Computer Configuration, and then Administrative Templates.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Click System</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">In the right pane, find and double-click the Display Shutdown Event Tracker.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">When the Display Shutdown Event Tracker Properties dialog box opens, select one of the following options:</span><ul>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Not Configured</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Enabled</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Disabled</span></li>
</ul>
</li>
</ol>
<ol>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">If
you select the Enabled option, you can choose between the following
options to specify when the Shutdown Event Tracker should be displayed:</span><ul>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Always: This option is self explanatory.</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"> </span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Server Only: When selected, the Shutdown Event Tracker is displayed for only Windows Server 2003/2008 servers.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Workstation Only: When selected, the Shutdown Event Tracker is displayed for only Windows XP Professional workstations.</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"> </span></li>
</ul>
</li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">If you want to view help information on the Shutdown Event Tracker application, click the Explain tab.</span></li>
<li><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Click OK, and then close the Group Policy Object Editor console.</span></li>
</ol>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-19552230803737669192011-03-04T10:16:00.000+13:002011-03-04T10:16:26.122+13:00Use your own toolsI got an email today from Microsoft and it had a calendar appointment in it for outlook when I looked at the map link and is was using google maps not bing.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh3.googleusercontent.com/-KowYi3G8mO0/TXAEL4cTkDI/AAAAAAAAADs/v4Lms1xXOYc/s1600/googlemaps.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://lh3.googleusercontent.com/-KowYi3G8mO0/TXAEL4cTkDI/AAAAAAAAADs/v4Lms1xXOYc/s320/googlemaps.PNG" width="320" /></a></div>
Maybe if you want other people to use your maps you should use them yourself.<br /><br />Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-51465593804536630632011-02-08T11:14:00.003+13:002011-02-08T11:22:27.128+13:00Don't By Mass Effect 2 from PSNI have had real problems with getting Mass Effect 2 to download from PSN (I downloaded it 4 times and it failed every time, which cost me $50 for bandwidth). Over the last 2 weeks I have made many phone calls trying unsuccessfully to get a refund for the purchase to my credit card so I can go and buy Mass Effect 2 from the store. Today I got this email.<br />
<blockquote>
Hi </blockquote>
<blockquote>
We only provide refunds to the wallet.<br />
As per our Terms of Service "If we are liable to you for failure to deliver content or services, our liability is limited either to re-providing the relevant content or service or (at our option) refunding the amount you paid for the content or service to your PSN wallet." </blockquote>
<blockquote>
Regards<br />
Maddalena</blockquote>
It looks like I am not getting Mass Effect 2 after all, and I have $100 of PSN credit I don't want to use.<br />
<br />
<span class="Apple-style-span" style="font-size: large;"><b>Thanks for nothing Sony!</b></span>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-7097719127926022362010-08-20T10:47:00.000+12:002010-08-20T10:47:08.039+12:00Simplicity vs. ChoiceI found this video today it is really worth watching if you do anything with software.<embed allowfullscreen="true" allowscriptaccess="always" height="350" src="http://blip.tv/play/hatvgfWNIgI" type="application/x-shockwave-flash" width="480"></embed>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-7948719808670254082010-07-14T13:40:00.000+12:002010-07-14T13:40:41.178+12:00Why CamelCase is goodJust though I would share today I was woking on someone sp and found the name was:<br />
<code>SPF_GETHARMONISEDSERIESDETAILTARIFFBYHARMONISEDSERIESDETAILID</code><br />Readable? I think not.
<br /><br />
But with a small change, you can actuall read it:<br />
<code>spf_GetHarmonisedSeriesDetailTariffByHarmonisedSeriesDetailID</code>.Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-85702769206259145062010-07-13T17:34:00.004+12:002010-07-13T17:34:00.647+12:00NotImplementedError: Unable to find the Python PIL libraryI have been playing with Google App engine on both mac and windows and in both cases when using <code>images.resize</code> I get the following error:<br />
<pre>NotImplementedError: Unable to find the Python PIL library. Please view the SDK documentation for details about installing PIL on your system.</pre>
After using my friend Google I found the solution.<br /><br />
<strong>For Mac OSX:</strong>
<ol>
<li>
Open to Terminal by navigating to your Applications folder, open Utilities, and double click on Terminal. You will be greeted with a message similar to this:<br />
<pre>Last login: Tue Mar 6 17:21:36 on console
Welcome to Darwin!
imac:~ Matt$</pre>
</li>
<li>
Type in "<code>sudo easy_install --find-links http://www.pythonware.com/products/pil/ Imaging</code>" into the Terminal and press enter.
</li>
<li>
Enter in your password when prompted and then you are done.
</li>
</ol>
<strong>For Windows:</strong>
<ol>
<li>
Download "Python Imaging Library 1.1.7 for Python 2.6" <a href="http://www.pythonware.com/products/pil/">from their website</a> and install.
</li>
<li>
Reboot and then you are done.
</li>
</ol>
Simple huh?Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-60234964782098081442010-07-02T08:38:00.000+12:002010-07-02T08:38:56.424+12:00My First Facebook spam<div class="separator" style="clear: both; text-align: center;">
<a href="http://grab.by/grabs/8c253843a3fb16aaded7022e68e73330.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="118" src="http://grab.by/grabs/8c253843a3fb16aaded7022e68e73330.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;"><br />I am no happy!
</div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-20671118905249837772010-05-16T12:32:00.000+12:002010-05-16T18:47:07.288+12:00Good Bye JSPI have tried using JSP on several occasions and every time I realise that I hate it, but when I started playing with Google App Engine(GAE) and the GWT I came to a conclustion that I am not a fan of that either.
<br /><br />
I first started with GAE and Python and found that <a target="_blank" href="http://www.djangoproject.com/">django</a> was quite nice in the way it let you seperate the code and presentation easily, were someone with not python knowladge could easily edit the template.
<br /><br />
So I turned to google and types in "JSP alternative", the first one I found was <a target="_blank" href="http://freemarker.sourceforge.net/">Freemaker</a> so I downloaded the latest version and set out to complete this <a target="_blank" href="http://www.javaworld.com/jw-01-2001/jw-0119-freemarker.html">tutorial</a>. There was one small problem the tutorial was a little out of date and try as I might I could not the the <code><list></code>. It turns out the the tutorial is a little old is not for the newest version(2.3.16 at the time of posting) of Freemarker and there have been a few changes with one major change, that being tags such as <code><list></code> and <code><if></code> now have a # before them so they look like <code><#list></code> and <code><#if></code> I made the change and the example worked!
<br /><br />
To go from JSP to Freemarker I had to make a few changes. First I added freemarker.jar to <code>/war/WEB-INF/lib/</code>.
<br />
Next I created a template file called index.html and added to the war folder here is the template.
<br /><pre>
<div class="html4strict" style="font-family:monospace;color: #006; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
<span style="color: #009900;"><#list files as file></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"/filestorage?name=${file.name}"</span>></span>${file.name}<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>></span> (${file.mime})
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span>#list></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/hr.html"><span style="color: #000000; font-weight: bold;">hr</span></a> <span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">enctype</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"multipart/form-data"</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"/filestorage"</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"POST"</span>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"hidden"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"MAX_FILE_SIZE"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"1000000"</span> <span style="color: #66cc66;">/</span>></span>
Choose a file to upload:
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"uploadedfile"</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"file"</span><span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">br</span></a><span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<a style="color: #000060;" href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"Upload File"</span><span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a style="color: #000060;" href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>></span></div>
</pre><br />
After that I added a function to the serverlet to set the template values and display the template
<br />
<pre>
<div class="java" style="font-family:monospace;color: #006; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><span style="color: #666666; font-style: italic;">/*
* Displays the template
*/</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> DisplayTemplate<span style="color: #009900;">(</span>HttpServletResponse resp<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #666666; font-style: italic;">//Now loads the data and adds it to a SimpleHash</span>
SimpleHash modelRoot <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleHash<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
modelRoot.<span style="color: #006633;">put</span><span style="color: #009900;">(</span><span style="color: #0000ff;">"files"</span>, FileDAL.<span style="color: #006633;">getFilesHash</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">{</span>
resp.<span style="color: #006633;">setContentType</span><span style="color: #009900;">(</span><span style="color: #0000ff;">"text/html"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
Configuration cfg <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Configuration<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
Template tpl <span style="color: #339933;">=</span> cfg.<span style="color: #006633;">getTemplate</span><span style="color: #009900;">(</span><span style="color: #0000ff;">"index.html"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
tpl.<span style="color: #006633;">process</span><span style="color: #009900;">(</span>modelRoot, resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">(</span><a style="color: #000060;" href="http://www.google.com/search?hl=en&q=allinurl%3Aexception+java.sun.com&btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> e<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<a style="color: #000060;" href="http://www.google.com/search?hl=en&q=allinurl%3Asystem+java.sun.com&btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">(</span>e.<span style="color: #006633;">getLocalizedMessage</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span></div>
</pre>
<br />
Last of all I replaced <code>resp.sendRedirect("/index.jsp");</code> with <code>DisplayTemplate(resp);</code> and thats it.
<br />The source is available from <a target="_blank" href="http://github.com/korich/example/tree/Freemaker/GAEFiles">github</a>.Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-56194092839499107432010-05-11T17:53:00.003+12:002010-05-16T18:40:53.903+12:00File storage in the cloudI have been playing with google app engine for a while now mainly with <a href="http://www.graniteds.org/" target="_blank">Granite Data Services</a> and Flex, recently I decided to see if I could store files in the datastore as blobs.<br />
<br />
I stared by searching on the web on how to save a file as a blob to the <a href="http://code.google.com/appengine/docs/java/datastore/" target="_blank">datastore</a> after a bit of playing I managed to get it all working using JSP pages and the <a href="http://commons.apache.org/fileupload/">apache commons fileupload</a>, using this little bit of code:<br />
<pre><div class="java" style="font-family:monospace;color: #006; border: 1px solid #d0d0d0; background-color: #f0f0f0;">ServletFileUpload upload <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ServletFileUpload<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
FileItemIterator iter<span style="color: #339933;">;</span>
iter <span style="color: #339933;">=</span> upload.<span style="color: #006633;">getItemIterator</span><span style="color: #009900;">(</span>req<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
FileItemStream fileItem<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">(</span>iter.<span style="color: #006633;">hasNext</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
fileItem <span style="color: #339933;">=</span> iter.<span style="color: #006633;">next</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<a style="color: #000060;" href="http://www.google.com/search?hl=en&q=allinurl%3Ainputstream+java.sun.com&btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">InputStream</span></a> fileStream <span style="color: #339933;">=</span> fileItem.<span style="color: #006633;">openStream</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<a style="color: #000060;" href="http://www.google.com/search?hl=en&q=allinurl%3Ablob+java.sun.com&btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Blob</span></a> imageBlob <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a style="color: #000060;" href="http://www.google.com/search?hl=en&q=allinurl%3Ablob+java.sun.com&btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Blob</span></a><span style="color: #009900;">(</span>IOUtils.<span style="color: #006633;">toByteArray</span><span style="color: #009900;">(</span>fileStream<span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">(</span>fileItem.<span style="color: #006633;">getContentType</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">)</span>
FileDAL.<span style="color: #006633;">createFile</span><span style="color: #009900;">(</span>fileItem.<span style="color: #006633;">getName</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span>, fileItem.<span style="color: #006633;">getContentType</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span>, imageBlob<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span></div></pre>
The full source <a href="http://github.com/korich/example/tree/JSP/GAEFiles">is available on github</a>.<br />
<br />
I have decided that I really hate JSP Pages so I am going to look into a different template engine stay tuned...Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-38805719683232620662010-03-22T11:02:00.004+13:002010-05-13T09:38:22.528+12:00Cannot Open Database Project<p>Today I opened visual studio and got an error message.<p><blockquote>".dbproj files cannot be opened because its project type(.dbproj) is not supported by this version of the application"</blockquote><p>I reinstalled the service pack and then reinstalled visual studio and it I still couldn't open my database project and all the packs and it was still not working.</p><p>So I turned to google and found out that all I had to do was reset the dev environment by running the following command.</p><p><pre>devenv /resetskippkgs</pre></p><p>If only i have of known this before I spent half the day reinstalling everything.</p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-1563516060806294732009-11-14T09:38:00.008+13:002011-04-08T09:05:01.221+12:00MonoTouch - Image View in Interface BuilderI have been playing with MonoTouch recently in an attempt to make a iPhone app. I was playing quite happily there just one problem. I couldn't work out how to set the image for the "Image View" in Interface Builder I searched the internet for a few hours and still couldn't find a thing. So it was time to start randomly clicking and compiling until it worked.
Here is what I did....<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>Create a new iPhone Solution in MonoDevelop.</li>
<li>Drag the image you want to use in to the Solution Explorer.</li>
<li>Click Copy on the dialog box.</li>
<li>Right click the image in the solution and select "Properties", the Properties panel should show up.<br /><a href="http://i.imgur.com/JQkCH.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/JQkCH.png" style="cursor: move;" /></a></li>
<li>Change the "Build Action" to "Content".</li>
<li>Double Click MainWindow.xib in the "Solution Explorer" and Interface builder should open up.</li>
<li>Click "Tools" > "Library", the library window will pop open.</li>
<li>Drag and "Image View" (under "Library" > "Cocoa Touch" > "Data Views") to the "Window".</li>
<li>Click on the Image View, then click "Tools" > "Attribute Inspector".</li>
<li>Type the name of the image in the "Image" field. The image view will be replaced with a question mark icon</li>
<li>Close interface builder.</li>
<li>In MonoDevelop Click "Run" > "Run".</li>
<li>Wait for the iPhone Simulartor to start and enjoy the results.</li>
</ol>Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8025044445010455479.post-69050069814241664622009-11-08T08:32:00.010+13:002009-11-08T08:48:49.821+13:00Free Mac Apps Go get yours now!<a href="http://www.macheist.com"><img width="437" height="174" src="http://grab.by/grabs/a5c6b8fe224c7ef10efd70069e35993c.png" border="0" alt="" /></a>
<p><a target="_blank" href="http://www.macheist.com/">MacHeist</a> are at it again and are giving away free apps one of which I used to to grab the image for this post.</p><p>If you want the pack just jump on over to <a href="http://www.macheist.com/" target="_blank">MacHeist</a> sign up and then get to downloading. You have to be quick tho because the deal ends in four days from today(Sunday 8 November 2009).</p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-59015396895917387852009-10-22T12:42:00.006+13:002009-11-08T10:24:19.234+13:00Single Quotes in TSQL<p>Recently I had a to format some data, originally the formatting was done using the MVC.NET page but there was one for small problem it took over five minutes to return 2,000 records which is just a little bit to long for my liking.</p><p>We only had a day to fix this problem so it was time for a dirty yet brilliant hack. I created a table variable and for the formatted data added the data to it and returned the date all in one stored procedure, there was one problem tho I needed to generate T-SQL and run it using EXECUTE (I know its not the best way to do things). I was working away at this and then a problem popped up there is no way to escape single quotes that I could work out in T-SQL.</p><p>But with a little trickery..... <pre>DECLARE @singleQuote CHAR(1);
SET @singleQuote = CHAR(39);</pre></p>
<p><strong>Problem Solved!</strong></p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-81295046114790358462009-09-24T16:27:00.009+12:002010-05-13T13:06:22.684+12:00Flex - Button label truncation problem<p>I recently had trouble with Flex truncating the label on some but... <br /><br /><br />
<img alt="" border="0" width="112" height="71" src="http://3.bp.blogspot.com/_yOxZXJ3n0Zo/Srr13pAginI/AAAAAAAAACA/Lc_UnxqCT_o/s400/1.png" /> <br /><br />
It was a particularly aggravating affair, playing with the padding and the width which had no apparent effect. After hours of searching the net and finding nary a shred I discovered that there was a simple fix. <br /><br /><br />
<img alt="" border="0" id="BLOGGER_PHOTO_ID_5384887479874916370" src="http://2.bp.blogspot.com/_yOxZXJ3n0Zo/Srr2ofFkkBI/AAAAAAAAACI/HYP9hWFa2Jo/s400/2.png" height="160" width="243" /> <img alt="" border="0" src="http://4.bp.blogspot.com/_yOxZXJ3n0Zo/Srr2o5t8foI/AAAAAAAAACQ/cKcpiomsujk/s400/3.png" height="165" width="239" /> <br /><br />
Simply changing the label placement property of the button to 'bottom' had the desired effect rendering the label correctly.<br /><br /><br />
<img alt="" border="0" id="BLOGGER_PHOTO_ID_5384887494453952898" src="http://1.bp.blogspot.com/_yOxZXJ3n0Zo/Srr2pVZfAYI/AAAAAAAAACY/P7ot0-yE15c/s400/4.png" height="92" width="135" /> <br /><br />
Ahhhhh, much better.</p>Neilhttp://www.blogger.com/profile/15947112692784516745noreply@blogger.com4tag:blogger.com,1999:blog-8025044445010455479.post-71104490109864206312009-09-01T11:58:00.004+12:002010-05-13T13:08:41.162+12:00Making the Eclipse XML editor Useful<p>I use <a href="http://www.eclipse.org/" target="_BLANK">Eclipse</a> for editing pretty much everything I on my Mac with its great free plugins who wouldn't want to use it there is only one small problem. That problem is the built in XML editor for Eclipse sucks, it tree based meaning you can't get the the underlying code without using the default Text Editor. <br /><br />
I decided that there must be a free plugin you can use so I Googled "free eclipse xml editor" and found <a href="http://www.eclipse-blog.org/xml/xmlbuddy-for-eclipse.html" target="_BLANK">several</a> <a href="http://www.roseindia.net/eclipse/plugins/XML/XMLBuddy.shtml" target="_BLANK">articles</a> about an editor called XmlBuddy but there was a problem, the domain www.xmlbuddy.com has been sold so you are not going to be able to download it from there crap! So yet again I turn to my friend google and at last I have found <a href="http://lmgtfy.com/?q=XMLBuddy+2.0.72+download" target="_BLANK">the answer</a>.<br /><br />
I downloaded the plugin from <a href="http://www.eclipse-blog.org/xml/xmlbuddy-for-eclipse.html" target="_BLANK">cnet</a> unzipped into my Eclipse plugins directory, now I finally have a decent XML editor.</p>Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8025044445010455479.post-83273911846245905972009-08-17T17:13:00.002+12:002009-08-17T18:33:11.109+12:00Custom Events in Action Script<p>You have an custom actionscript 3.0 class and it does all sorts of great thing, but now you want other people to be able to use it. There are many ways to do this but for this example I am going to create a custom event. Lets get started.</p><p>First add the following imports to your class.</p><pre>import flash.events.Event;
import flash.events.EventDispatcher;</pre>
<p>Then add the metadata about the custom event, the event in this example is called customEvent.</p><pre>[Event(name="customEvent", type="flash.events.Event")]</pre>
<p>Next copy and paste the following code anywhere into your class this is used to add the functions need to create event listeners and dispatch events.</p><pre>private var disp:EventDispatcher;
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false,
priority:int=0, useWeakReference:Boolean=false):void {
if (disp == null) disp = new EventDispatcher();
disp.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void {
if (disp == null) return;
disp.removeEventListener(type, listener, useCapture);
}
public function dispatchEvent(event:Event):void {
if (disp == null) return;
disp.dispatchEvent(event);
}</pre>
<p>Next you need to add the code to fire your custom event to do this add the following code to the function you want to fire the event.</p><pre>var deviceDataEventObject:DeviceDataEvent = new Event("customEvent");
dispatchEvent(deviceDataEventObject);</pre>
<p>OK you custom class can now fire your custom event all you need to do is set up a event listener in the calling class, use this code.</p><pre>customClass.addEventListener("customEvent", yourFunction);
private function yourFunction(event:Event):void{
//Do Something here
}</pre>
<p>Thats it you are done simple huh?</p>Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8025044445010455479.post-9270482682795992852009-07-30T11:02:00.015+12:002011-04-07T15:37:38.162+12:00Free Flex Visual Studio Plug-inThere is a plug-in for visual studio it is not as good as the adobe IDE but is free will do the job, for more info on the plug-in go to <a href="http://www.ensemble.com/products/tofino.html" target="_BLANK">their website</a>.
First you need to download all the required files listed below:<br />
<ul>
<li><a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" target="_BLANK">Flash Develop</a> - "Release notes and download" link, then towards the bottom of the page redirected page.</li>
<li><a href="http://java.sun.com/javase/downloads/index.jsp" target="_BLANK">Java SE Runtime Environment (JRE)</a> - download button under the table heading (Java SE Runtime Environment (JRE).</li>
<li><a href="http://opensource.adobe.com/wiki/display/flexsdk/Downloads" tatget="_BLANK">Flex SDK</a> - "Free Adobe Flex 3 SDK" link.</li>
<li><a href="http://www.ensemble.com/products/tofino.shtml" tatget="_BLANK">Tofino Visual Studio Plugin</a> - "Download Tofino [version] without Flex SDK" link.</li>
</ul>
Now you have a directory full of downloads it is time to start installing(please note <code>[version]</code> is a place holder for the current version of the file you downloaded):
<br />
<ol>
<li>Extract the Flex SDK (<code>flex_sdk_3.zip</code>) to "C:\Flex\3\".</li>
<li>Install the visual studio plugin (<code>EnsembleTofinoWithoutFlexSDK.[version].msi</code>) by double clicking it.</li>
<li>Open Visual studio</li>
<li>Open the Options Windows</li>
<li>Check the "Show all settings" checkbox if its there</li>
<li>Go to Projects > Flex Projects</li>
<li>Set the Flex 3 SDK location to "C:\FlexSDK\3\|</li>
</ol>
<br />
For more info on how to use the plug-in there is an article at <a href="http://www.developerfusion.com/article/9536/using-adobe-flex-in-visual-studio/" target="_BLANK">developer fusion</a>.Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8025044445010455479.post-38953812436532432222009-07-29T23:46:00.010+12:002010-05-13T13:11:04.534+12:00Controlling Flex With Javascript<p>For work I had to do a proof of concept to show that I could control flex using javascript and <a href="http://demos.steamed-design.com/demos/javascript/index.html" target="_BLANK">here is is</a> with the <a href="http://demos.steamed-design.com/demos/javascript/srcview/index.html" target="_BLANK">source</a>, if you want to do it follow <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=11946" target="_BLANK">this article</a>. <br />
<br />
I did have one problem tho and that was i was using <a href="http://www.steamed-design.com/2009/07/free-flex-ide.html" target="_BLANK">Flash Develop</a> and there is no "Create Ajax Bridge." menu option, luckily this can be solved pretty simply just by copying the the files from you sdk directory to you project they are located in <br /><br />
<br />
<code>[sdk]\frameworks\javascript\fabridge\src\bridge\</code>.</p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-3626203020129428732009-07-25T14:18:00.008+12:002009-07-26T17:11:30.964+12:00The Eclipse IDE and Google App Engine<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://code.google.com/appengine/images/appengine_lowres.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 142px; height: 109px;" src="http://code.google.com/appengine/images/appengine_lowres.gif" alt="" border="0" /></a><a href="http://code.google.com/appengine/">App Engine</a> is Googles offering in the realm of cloud computing. The free service that Google offers should be more than enough to host small websites. If an application does need extra resources, there is the option to enable flexible billing which alows a web application to scale and only pay for resources used. see <a href="http://code.google.com/appengine/docs/billing.html">Googles Billing Docs</a>
Orginally the App Engine only supported the Python scripting language, though the Google team have recently anounced <a href="http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html">Java support.</a>
Google have released an SDK and set of plugins for the Eclipse IDE, together they provide an integrated developement and deployment environment.
<h3>How to set up Eclipse/App Engine</h3>
<span style="font-weight: bold;">Software needed:</span>
<ul>
<li><a href="http://java.sun.com/javase/downloads/index.jsp">Java SE Development Kit(JDK)</a></li>
<li><a href="http://www.eclipse.org/">The Eclipse IDE</a></li>
</ul>
<span style="font-weight: bold;">Installation:</span>
<ol>
<li>Install the Java SE DEvelopment Kit</li>
<li>Unpack the Eclipse IDE</li>
<li><a href="http://code.google.com/appengine/docs/java/tools/eclipse.html">Follow these steps</a> to install the SDK and App engine plugin through the Eclipse software update service. You will likely need to reboot.</li>
</ol>
<span style="font-size:100%;">
<span style="font-weight: bold;">Further Information:</span>
<a href="http://code.google.com/appengine/docs/">App Engine Docs</a>
<a href="http://code.google.com/p/google-app-engine-samples/">Sample applications</a></span>Neilhttp://www.blogger.com/profile/15947112692784516745noreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-3392258369034085082009-07-22T17:57:00.010+12:002009-11-09T15:32:01.457+13:00Free Flex IDE<a href="http://www.flashdevelop.org" target="_BLANK"><img style="float:left; margin:0 10px 10px 0;" width="135" height"135" src="http://2.bp.blogspot.com/_bxl1yT9K6fw/SmaIE4AurLI/AAAAAAAAAW8/dKc8b8fFGnE/s400/flexdevelop.png" border="0" alt="Flash Develop Logo" /></a>Ok so flex is great but there is one small problem and thats the US$ 299 for the <a href="http://www.adobe.com/go/flex_trial" target="_BLANK">IDE from adobe</a>. Yes there is a free trial available so you can at least spend 60 days trying the IDE but what happens after your 60 days are up and you still want to use flex but don't have US $299 laying around to buy yourself the full version. With <a href="http://www.flashdevelop.org/">Flash Develop</a> and a two <a href="http://www.flashdevelop.org/community/viewtopic.php?f=4&t=4660" target="_BLANK">little</a> <a href="http://www.flashdevelop.org/community/viewtopic.php?f=4&t=3727" target="_BLANK">plugins</a> you can.
<p><strong>Installing</strong>
First you need to download all the required files listed below:<ul><li><a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" target="_BLANK">Flash Develop</a> - "Release notes and download" link, then towards the bottom of the page redirected page.</li>
<li><a href="http://java.sun.com/javase/downloads/index.jsp" target="_BLANK">Java SE Runtime Environment (JRE)</a> - download button under the table heading (Java SE Runtime Environment (JRE).</li>
<li><a href="http://opensource.adobe.com/wiki/display/flexsdk/Downloads" tatget="_BLANK">Flex SDK</a> - "Free Adobe Flex 3 SDK" link.</li>
<li><a href="http://www.flashdevelop.org/community/viewtopic.php?f=4&t=3727" target="_BLANK">Design View plugin</a> - "Download Plugin" link.</li>
<li><a href="http://sourceforge.net/projects/designview/files/" target="_BLANK">Design View Air Package</a> - "designview.air" link.</li>
<li><a href="http://gforge.opensource-sw.net/gf/project/flexdbg/frs/" target="_BLANK">Debugger Plugin</a> - "FlexDbg.zip" link.</li></ul></p>
<p>Now you have a directory full of downloads it is time to start installing(please note <code>[version]</code> is a place holder for the current version of the file you downloaded):
<ol><li>Run the installer(<code>FlashDevelop[version].exe</code>) for Flash Develop and and leave everything as the defaults.<li>Install the Java SE Runtime Environment (<code>jre-[number]-windows-i586.exe</code>).</li>
<li>Extract the Flex SDK(<code>flex_sdk_3.zip</code>) to "C:\Flex\3\".</li>
<li>Install the Design View AIR app(<code>designview.air</code>) by double clicking it.</li>
<li>Open the Design View plugin(<code>FlexDesignView-[version].zip</code>) and copy the contents of "<code>Data</code>" to "<code>C:\Program Files\FlashDevelop\Data\</code>" and the contents of "<code>Plugins</code>" to "<code>C:\Program Files\FlashDevelop\Plugins\</code>".</li>
<li>Extract the Debugger Plugin(FlexDbg.zip) to "<code>C:\Program Files\FlashDevelop\Plugins\"</code>".</li></ol></p>
<p>Now Everything is in installed all you need to do is set up flex in Flash Develop:
<ol><li>Open the Flash Develop(<code>Start > Applications > Flex Develop > Flex Develop)</code>.</li>
<li>Once the application is opened press <code>F10</code> or go to "<code>Tool > Program Settings</code>" to open the Program Settings.</li>
<li>Click on AS3Content button (1. in the image below).</li>
<li>Then set the "<code>Flex SDK Location</code>" (2. in the image below) to "<code>C:\Flex\3\</code>".</li>
<li>Click Close, and enjoy <a href="http://www.flashdevelop.org" target="_BLANK">Flash Develop</a>.</li></ol></p>
<p><strong>Program Settings</strong>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_bxl1yT9K6fw/SmaCsJvb6vI/AAAAAAAAAW0/qbHrqXwQUec/s1600-h/options.jpg"><img style="cursor:pointer; cursor:hand;width: 400px; height: 293px;" src="http://4.bp.blogspot.com/_bxl1yT9K6fw/SmaCsJvb6vI/AAAAAAAAAW0/qbHrqXwQUec/s400/options.jpg" border="0" alt="Settings Screen" id="BLOGGER_PHOTO_ID_5361116101471890162" /></a></p>
<p><strong>Update:</strong> as requested here are some screen shots with FlashDevelop in both Source and Design Views.
<a href="http://2.bp.blogspot.com/_bxl1yT9K6fw/Svd9HyetWxI/AAAAAAAAAXU/nmKpnZu7324/s1600-h/SourceView.png"><img src="http://2.bp.blogspot.com/_bxl1yT9K6fw/Svd9HyetWxI/AAAAAAAAAXU/nmKpnZu7324/s320/SourceView.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5401923850817329938" /></a>
<a href="http://1.bp.blogspot.com/_bxl1yT9K6fw/Svd9HmeNlwI/AAAAAAAAAXM/y0Kjb4hmgHw/s1600-h/DesignView.png"><img src="http://1.bp.blogspot.com/_bxl1yT9K6fw/Svd9HmeNlwI/AAAAAAAAAXM/y0Kjb4hmgHw/s320/DesignView.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5401923847594022658" /></a>Anonymousnoreply@blogger.com16tag:blogger.com,1999:blog-8025044445010455479.post-22610174805394107852009-07-20T13:47:00.009+12:002009-07-21T11:33:34.109+12:00Solved It!I have been having <strong>A LOT</strong> of trouble trying to get my Papervision3D to run a tween just after loading. I spent a good part of the weekend trying to get it to work with no avail. Today I decided that it was time to use a process of elimination with event listeners to work it out, luckly for me it was the third event <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" target="_BLANK">FlashDevelop's</a> drop down list.
Here is the code "view" is a BasicView and "zoomCamera" is the function called after loading view:<pre>view.addEventListener(Event.ADDED_TO_STAGE, zoomCamera);</pre>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-75762173162158803072009-07-18T23:44:00.001+12:002009-07-18T23:46:47.634+12:00Sexy touching machines<object height="231" width="400"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5349178&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1"><embed src="http://vimeo.com/moogaloop.swf?clip_id=5349178&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="231" width="400"></embed></object>Neilhttp://www.blogger.com/profile/15947112692784516745noreply@blogger.com1tag:blogger.com,1999:blog-8025044445010455479.post-76456878138741308902009-07-17T08:16:00.002+12:002009-07-17T11:47:34.646+12:00Adding Interactivity to Papervision 3D<a style="float:right; padding-left:10px;" href="http://demos.steamed-design.com/demos/interactivity/index.html" target="_BLANK"><img width="200" height="222" src="http://3.bp.blogspot.com/_bxl1yT9K6fw/Sl7T-n2415I/AAAAAAAAAWA/EWrqO2eUwLA/s400/interactivity.png" border="0" alt="Interactivity Demo" /></a>There are two types of Interactivity in <a href="http://demos.steamed-design.com/demos/interactivity/index.html" target="_BLANK">this demo</a> the first is controlling the camera and the second the 3D Animation i.e. making the panels spin when you click them.
<strong>Controlling the Camera</strong>
Controlling the camera is pretty simple in this example all you need to do is track the mouse movement and translate it into camera movement.
To do this simply add the following code into your Event.ENTER_FRAME listener, where view is the Papervision View you are using.
<pre>view.camera.x += (((stage.mouseX - (stage.stageWidth * .5)) * 2) - view.camera.x ) * .02;
view.camera.y += (((stage.mouseY - (stage.stageHeight * .5)) * 2) - view.camera.y ) * .02;</pre>
<p><strong>Controlling 3D Animation</strong>
The easiest what to control 3D animation is to use <a href="http://code.google.com/p/tweener/">tweener</a>. Basically Tweener helps you move things around on the screen using only code, instead of the timeline. Tweener has no idea about Papervision 3D and in fact it only changes a variable over time which means that you can change any variable as long as it is a number.</p><p>To do this you first need to set the view to interactive, then add event listeners to the 3D objects.</p><pre>var controlPlane:Plane = new Plane();
controlPlane.addEventListener (InteractiveScene3DEvent.OBJECT_CLICK, plane1Clicked);
controlPlane.addEventListener (InteractiveScene3DEvent.OBJECT_OVER, plane1Rollover);
controlPlane.addEventListener (InteractiveScene3DEvent.OBJECT_OUT, plane1Rollout);</pre>
<p>Then create functions and use tweener to manipulate the 3D objects</p><pre>private function plane1Rollover (myEvent:InteractiveScene3DEvent):void {
//moves the panel back on roll over
Tweener.addTween(myEvent.currentTarget, { z:120, time:.5, transition:"easeInOutQuint" } );
}
private function plane1Rollout (myEvent:InteractiveScene3DEvent):void {
//moves the panel froward to its original position on roll out.
Tweener.addTween(myEvent.currentTarget, { z:100, time:.5, transition:"easeInOutQuint" } );
}
private function plane1Clicked (myEvent:InteractiveScene3DEvent):void {
//Resets the panels X rotation
myEvent.currentTarget.rotationX = 0;
//Flips the panel 360
Tweener.addTween(myEvent.currentTarget, { rotationX:360, time:1, transition:"easeInOutQuint" } );
}</pre>
<p>Follow <a href="http://demos.steamed-design.com/demos/interactivity/index.html" target="_BLANK">this link to view a demo</a> and as usual to view the <a href="http://demos.steamed-design.com/demos/interactivity/srcview/index.html" target="_BLANK">full source</a> right click the demo.</p>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8025044445010455479.post-675841941248041932009-07-16T13:25:00.003+12:002009-07-16T13:39:03.523+12:00Subverting Visual StudioI have recently come across <a href="http://ankhsvn.open.collab.net/">ankhsvn</a>, a free plugin that allows you to use the <a href="http://subversion.tigris.org/">Subversion</a> version control system.
This will be useful for further investigation into the <a href="http://code.google.com/apis/gdata/samples.html#NET">Google .Net api</a>.
other useful links ->
<a href="http://google-gdata.googlecode.com/svn/docs/index.html">.Net Gdata online documentation</a>Neilhttp://www.blogger.com/profile/15947112692784516745noreply@blogger.com0