distanceFromLocation: Calculate distance between two points
CLLocation *location1 = [[CLLocation alloc] initWithLatitude:57.052443 longitude:9.910623];
CLLocation *location2 = [[CLLocation alloc] initWithLatitude:57.0533791 longitude:9.9052496];
float betweenDistance=[location1 distanceFromLocation:location2];
NSLog(@"Distance is %f km",betweenDistance/1000);
Will output "Distance is 0.340660 km"
Problems handling special characters in Air Video
I had problems with handling nordic character (æ-ø-å) correct in my Air Video server, but I find a simple fix for it.
Under Air Video Server Click on Options / preferences, go to Subtitles. Change "Default Encoding" to Western (ISO Latin 1; ISO 8859-1).
Force iScroll to refresh
If you add or remove items inside your content. You need to refresh your iScroll script.
Insert this javascript line.
setTimeout(function () { myScroll.refresh(); }, 0);
myScroll is the name of your call like:
myScroll = new iScroll('RightContent', { useTransition:true });
Touch Scroll for Iphone and Ipad with finger scrolling
While there are plenty of frameworks (e.g. jQuery Mobile, SenchaTouch, etc.) that can help get you started with mobile web apps. I found a pure JavaScript library called iScroll 4 very helpfull to create mobile websites. It have a list of nice features like:
'Scroll up and down'
'Snap to element'
'Pinch / Zoom'
iScroll support both iPhone/Ipod touch, iPad and Android.
In this tutorial I will teach you how to use iScroll 4 and implement a pages where you can scroll a part of a window with finger up and down without moving the rest of the screen.
Download iScroll's javascript file from this site:
http://cubiq.org/iscroll-4 - Click on download.
Insert this code in your
tag:<script type="application/javascript" src="iscroll.js"></script>
<script type="text/javascript">
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper');
}
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
Remember to change src="iscroll.js" to where your placed the file.
Insert this code in your
tag:<div id="wrapper">
<div id="scroller">
<ul>
<li>Content</li>
..
..
</ul>
</div>
</div>
In this example the UL element will be scrolled. The iScroll must be applied to the wrapper of the scrolling area.
Final result:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>iScroll demo</title>
<script type="text/javascript" src="../../src/iscroll.js"></script>
<script type="text/javascript">
var scroll1;
function loaded() {
scroll1 = new iScroll('standard');
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
<style type="text/css" media="all">
ul,li {
padding:0;
margin:0;
border:0;
}
body {
font-size:12px;
-webkit-user-select:none;
-webkit-text-size-adjust:none;
font-family:helvetica;
padding:20px;
}
#standard {
position:relative; z-index:1;
display:block; float:left;
width:300px; height:400px;
background:#aaa;
overflow:auto;
border:1px solid #aaa;
}
.scroller {
position:absolute; z-index:1;
/* -webkit-touch-callout:none;*/
-webkit-tap-highlight-color:rgba(0,0,0,0);
width:100%;
padding:0;
}
.scroller ul {
list-style:none;
padding:0;
margin:0;
width:100%;
text-align:left;
}
.scroller li {
padding:0 10px;
height:40px;
line-height:40px;
border-bottom:1px solid #ccc;
border-top:1px solid #fff;
background-color:#fafafa;
font-size:14px;
}
#myFrame {
position:absolute;
top:0; left:0;
}
</style>
</head>
<body>
<div id="standard">
<div class="scroller">
<ul>
<li><strong>Standard iScroll</strong></li>
<li>Pretty row 2</li>
<li>Pretty row 3</li>
<li>Pretty row 4</li>
<li>Pretty row 5</li>
<li>Pretty row 6</li>
<li>Pretty row 7</li>
<li>Pretty row 8</li>
</ul>
</div>
</div>
</body>
</html>
Move WIMP to your Home screen on IPeng
If your are using WIMP as your primary music source it's useful to have it it on your homescreen.
Go to http://www.mysqueezebox.com login with your informations.
Select "My Apps"
Click on WIMP
Select "Player Settings"
Change your player to "Display on home menu" in the dropdown menu.
How to setup DS Audio on your IPhone, IPod touch or IPad
For users who own a Synology DiskStation, DS audio allows you to stream music stored on DiskStation with your iPhone/iPad/iPod touch when Internet connection is available.
Before using DS photo+, you need to upgrade your DS firmware to the newest one.
You can find the newest firmware on http://www.synology.com/ or upgrade from your own interface on the Synology box.
1.
First we need to actived Audio Station on your Synology Box. Go to your Interface (http://#IP#:5000) click on your Control panel icon.

2.
Click on Audio Station.

3.
Check "Enable Audio Station 3"

4.
Check if you have a user with admin rights. If not you need to create one.
You can do that under your Synology interface "Control panel - User - Create".

5.
Then install and launch DS Audio on your iPhone or IPad.
6.
On the logon screen for DS Audio insert these informations.
IP => IP of your Synology box. (Internal it's something like 192.168.1.100, but you can use DDNS as well like yourname.homeip.net)
Account => Your Audio Station account which has admin access rights.
Password => The password of the admin account.

7.
Check if port 5000 are open on your Router.
Type - Audio Station
Port Number - 5000
Protocol - TCP
Now you should have access to all your music from your device.
How to setup DS photo+ on IPhone, IPod Touch or IPad
Before using DS photo+, you need to upgrade your DS firmware to the newest one.
You can find the newest firmware on http://www.synology.com/ or upgrade from your own interface on the Synology box.
Check if you have a user with admin rights. If not you need to create one.
You can do that under your Synology interface "Control panel - User - Create".

Then install and launch DS photo+ on your iPhone, iPod Touch or IPad.
On the logon screen for DS photo+ insert these informations.

Server => IP of your synology box. (Internal it's something like 192.168.1.100, but you can use DDNS as well like yourname.homeip.net)
Account => Photo Station account which has admin access rights.
Password => The password of the admin account.
Now you should have access to all your photos from your device.