contact

Archive for the ‘Tech Questions’ Category

how to start a scriptaculous drag with code

Saturday, August 2nd, 2008

Usually a scriptaculous draggable will only start the drag if you click on it. As I was adding drag and drop functionality to a web based filebrowser I actually wanted to start the drag of an other object when the user clicked on a file and dragged it. So the user clicks on a file from a list view but does drag the actual dom element from the list view. the click on the file calls a function that slips a file icon under the mouse of the user and starts the drag of that file icon. That way a user can drag and drop just the icon which looks much nicer and gave me the ability to drag and drop all selected files from the list view. its actually pretty simple, you just pass on the click event to the initDrag method of your draggable.

</pre>
$('yourObjectThatWillBeClicked').observe('mousedown', function(event){
 //observe the object for clicks
 $('yourActualDraggable').setStyle({
 // slipping the draggable under the users mouse
 position:'absolute',
 top:Event.pointerY(event)-16+'px',
 // this gets us the position of the users cursor
 left:Event.pointerX(event)-24+'px'
 })
 Drager=new Draggable('yourActualDraggable',onEnd:function(){Drag.destroy()});
 // making it a real scriptaculous draggable
 Drager.initDrag(event)
 // passing on the event and starting the drag
 }
<pre>
screenshot that illustrates this technique in my application

screenshot that illustrates this technique in my application

script.aculo.us

Mac OS X Leopard – Time Machine & Airdisk after 10.5.3 Update

Wednesday, June 4th, 2008

I run a Airport Extreme basestation with a western digital My Book 500GB USB harddrive attached to it and since 10.5.2 it has been possible to do wireless backup, with a few draw backs. I had to mount the drive manually each time I wanted to perform a back and the back ups took considerably longer than they used to over fire wire but it was working. After I upgraded to 10.5.3 Time Machine kept on telling me

The drive could not be mounted

even though it was already mounted and Time Machine could access it for back ups. I read up on the problem and found some fairly complicated solutions but in fact it is really easy to solve the problem:

Simply go to system preferences and Time Machine and choose select drive and reselect your Airdisk. Not only that Time Machine will continue your old back up but it now also mounts the drive all by it self which which completly automates the Backup process.

I now enjoy Time Capsule like backup without having had to spend a the extra money.

Jailbreaking an ipod touch 1.1.4 using a mac

Tuesday, April 22nd, 2008

Warning: Everything described below only reflects my opinion, I don’t take any warranty if something goes wrong. These are just guidlines!

I got my ipod touch several months ago but never tried to jailbreak it until last week. And I must say with the right tools it is really easy. Before I go on talking about how to do I want to answer some questions that keept me from doing it.

Q: can I brick my ipod touch?

A: no you can’t.

Q: if something goes wrong will it be hard to restore?

A: no not at all, just don’t panic and follow the steps I will descirbe later.

Q: after restoring what firmware will my ipod touch have?

A: the same firmware it had before you jailbroke it.

Q: can experiementing with cause any major problems?

A: no. you can savely play around, if you like it jailbroken fine, if not restore it and you get your old more boring ipod back

So lets get startet: supposing you got your ipod plugged into your mac you want to got to this site http://ipluspwns.com/?q=node/2 and download iliberty+ for mac. There is a PC version also.

There is another tool that says it can do Ipod touch jailbreaks and thats Ziphone, but I never got it to work, neither on a pc nor on my mac.

well one you downloaded iliberty unpack it and run and simply click jealbreak then wait a fec seconds and you are done with your jailbroken ipod touch. really really easy. If you need more details see this guide http://ipluspwns.com/?q=node/99

Now things get a little bit more interesting. Start your ipod and you will find the installer app on the homescreen, which is a great program but I found it a bit confusing at first. There is plenty tutorials out there how to use installer. After I got the installer running I was aksing myself, well what can I do with it. Well first you want to install some vital utilities. In order to do so, in installer go to sources and install the sources that you find there. After that the list of new apps in the installer should have increased significantly.

So lets talk about Files.

How to watch Movies in Apple Front Row without importing them to Itunes

Thursday, February 21st, 2008

 In order to watch movies in Itunes you have to convert them into one of the few supported formats, which for longer movies is a lot of work. I have my home server with an harddrive full of movies and I really wanted to be able to access them with the nice remotely controlled interface of Apples Front Row, which is actually capable of playing a lot more video formats than itunes supports. In Leopard Front Row offers you the possibility to access the movies folder on your mac. I only have a 120 GB Harddrive so now way I could keep all my movies in this folder, but the solution is simple:

Simply create an alias of the folder your movies are in and place it inside the designated movies Folder. That way you can add any location from a usb Harddrive to a Windows SMB share. Then run Front Row and check the movies folder for the alias. And you are done watching all your movies without importing them to itunes.

Western Digital MyBook does not power up

Monday, February 18th, 2008

 I recently bought a Western Digital 500GB Mybook and was very pleased. The Firewire 800 is really fast and the automated power up and down is very convenient. I haven’t been to my flat for about three weeks now and was shocked to see that my Mybook would not show any sign of life when I connected it to my Macbook Pro. Pushing the button, using USB or Firewire 400 did not change anything either. No need to throw away your harddrive yet. The solution is simple:

Simply disconnect the power adapter, and all connections to your computer. Then reconnect and it should power up and fulfill its duty.

Using Anchors and GET variables

Monday, February 18th, 2008

Well in general it is impossible to use them both. So http://www.yourdomain.com/yourpage.php?get=fubar#anchor1 is not going to work in most browsers, so we want to forget about that. I solved this problem with a little javascript workaround and an additional GET varibale. So step one is that your links would have to include a get variable “?a=YourAnchor”. Now we dont use the usual anchor but place a div with the id YourAnchor at the position we want the page to jump to. I use some javascript that is called when the page loads and the looks up the div with the id YourAnchor and scrolls the page to its position.

</pre>
<div id="YourAnchor"></div>
onload="go_to('<?php echo $_GET['a']; ?>')"

//in order to call the function simply place the following code in your body tag
<pre>

note that this is quite insecure though.

Google Analytics data update interval

Friday, January 25th, 2008

I keep track of my blog usage by using google analytics . A very good tool that gives a huge amount of data and very good reporting, but what bothers me is that you always have to wait about a day till the data gets updated. A very simple trick gives instant data updates – simply click on the field where you set the time interval, go to the timeline mode and drag the slider all the way to the right. Your done. the stats should now be up to date.

Screen shot 2009-12-03 at 6.53.22 PM

Networking issues with Mac OS X 10.5 Leopard

Monday, January 21st, 2008

 I got my mac with Tiger and was amazed how well the networking worked in comparison to windows. Once I upgraded to leopard I wasn’t all that happy anymore. So here I want to address the bugs I came across and how I partially solved them.

Wifi problems:

At my parents house a have a simple WEP encrypted Wifi which used to work great, but Leopard simply can’t connect properly since it wants to force WPA security settings although its WEP. Nothing would solve the problem unless I ran the diagnose assistant. There it was recognized as WEP and I could get a connection. The big drawback is that I had to repeat this step every time my Notebook wakes up from standby. In addition Leopard does not remember the WiFi. It is listet in the Know Networks but I have to go through all these steps again and again.

Windows shares / SMB shares

At the very beging I noticed that my windows shared computers would not show up in the sidebar as they should. One thing you can do if your shared computer does not show up is to connect manually using this command:

smb://yourcomputersnameorIP

This will mount the lost share and you can access it.

 

Using Mysql Data in Flash via php

Sunday, January 20th, 2008

In this post I want to describe a very simple technique I use in order to read Mysql data into flash via a php-dynamically created xml file. So what do you need to get this work:

  • a Mysql Database filled with Data of your choice
  • a php capable webserver, if you dont want to upload everytime for testing try installing

Installing Bootcamp with Windows XP on Mac OS X 10.5

Saturday, January 19th, 2008

bootcamp.png

 When I first heard about bootcamp I thought why would I ever want windows on my mac if Mac OS X is so much better but after I found out that the Mac Version of C&3 is not avaliable in Austria there was no other way than infesting my mac book pro with the evil. I thought it would be really easy, like Steve said, and followed the steps in the bootcamp assistant. I encountered pretty much every problem you can possibly have when installing bootcamp so here is what I did to finally make it work. 

  •  Start the bootcamp Assistant. When prompted to create A partition you could get this Error ( german only): 

Ihre Festplatte kann nicht partitioniert werden, weil einige Daten nicht verschoben werden können.Legen Sie eine Sicherung der Festplatte an und formatieren Sie sie mit dem Festplatten-Dienstprogramm als Mac OS Extended (Journaled) Einzelvolume. Stellen Sie anschließend die Informationen von der Sicherung wieder her und starten Sie den Boot Camp Assistenten erneut.

  •  In order to solve this Problem you have to boot the Mac from your OS Disc and start the Disc Utility. Select Repair Volume and wait till its done. After completion restart your Mac and you should be good to go. Launch the Bootcamp Assistant again and follow the procedure, it should work now. 
  • Your next step depends on the Windows XP SP2 CD you have. There are some that are capable of Formatting a predefined partition(BOOTCAMP) and some that can’t. I had and Educational License from my University, which was not able to perform the task. So the Setup crashed on my serveral times till I figured this out. In order for Bootcamp to work you somehow need to reformat the partition named Bootcamp which has been created by the Assistant.
  • go to www.freedos.org, download the full CD ISO, burn the Image to a CD using the Disk Utility. Boot the Mac from that CD by restarting and holding down the "C" key. Then select option 5 to run freedos from the cd.

format the partion by typing "format c:" into the dos console

  •  Now you are already on the save side. Restart the Mac and run Bootcamp again, install Windwos and you should be fine.

When putting together this post I found a really good German HowTo on this problem.