Forum for General Microwave Discussions
Because of the general queries I have received in response to my online microwave tools I have decided to initiate a general microwave communications engineering discussion forum. I am hoping that this forum will enable the many knowledgeable microwave engineers out there and myself (with more than 25 years microwave planning experience) to answer any questions regarding microwave communications engineering you might have and at the same time build up a useful knowledge base.
By the way the tools can be found here:
Microwave Link Engineering Tool, MLET
Microwave Line-of-Sight Tool, MLOST
Microwave Online Tools Forum
I have initiated a forum in order to enable discussions regarding my online microwave tools. I will answer any questions about the tools and act upon suggestions if possible.
The tools can be found here:
Microwave Link Engineering Tool, MLET
Microwave Line-of-Sight Tool, MLOST
Deleting root’s trash
Time again I manage to delete the root trash but next time I’ve forgotten how to do it. So this time I’ll write it down.
open a root nautilus window with
gksu nautilus /root/.Trash/
now highlight the files you want to delete and then press Shift-delete.
Do not “move to trash” as they will just pop up again
Microwave Planning Tool for Your Website
Imagine this microwave planning tool on your company webpage with your companies look and feel! Imagine how that would impress your customers!
The LOS part can be seen here and the microwave calculation part here.
I am prepared to sell the source code together with documentation and assistance in adapting it to your needs.
I could also include a new php script I have written which enables the free NASA SRTM3 height data to be installed and read from your own server.
If you are interested leave a short comment below and I will contact you by email.
Nautilus “Open as root” script and “gksudo nautilus” not working.
I recently tried my “open as root” script and it didn’t work so I tried “gksudo nautilus” from the terminal and got the following error:
steve@x-desktop:~$ sudo nautilus [sudo] password for steve: seahorse nautilus module initialized Initializing nautilus-share extension (nautilus:6653): GLib-GIO-CRITICAL **: g_simple_async_result_set_from_error: assertion `error != NULL' failed (nautilus:6653): GLib-CRITICAL **: g_error_free: assertion `error != NULL' failed (nautilus:6653): GLib-GIO-CRITICAL **: g_simple_async_result_set_from_error: assertion `error != NULL' failed (nautilus:6653): GLib-GIO-WARNING **: (/build/buildd/glib2.0-2.16.6/gio/gfile.c:5249):IA__g_file_load_partial_contents_finish: runtime check failed: (g_simple_async_result_get_source_tag (simple) == g_file_load_contents_async) Segmentation fault
The problem was that I had a blank CD in the drive. After I removed the CD everything was back to normal.
I have made a currency convertor which uses the daily updated European Central Banks exchange rates. You can convert between 35 different currencies.
The converter can be found here.
The previous post shows how I download and upload the ECB XML file.
Using the ECB Currency XML with Javascript
The European Central Bank make available daily an XML file with the exchange rate of the Euro to 34 currencies. This can be found at http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml
To use this in javascript I faced two problems:
1) How to get around the inter-domain problem. The easiest way to do this is with PHP/Curl but my ISP does not support php! I solved this by downloading the file and uploading it to my webserver. First I GET the file from the CEB website.
<?php
function get_file1($file, $local_path, $newfilename) {
$out = fopen($newfilename, 'wb');
if ($out == FALSE){
print "File not opened<br>";
exit;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $file);
curl_exec($ch);
curl_close($ch);
}
and the I PUT the file onto my server.
$url = "ftp://my.server.at/ECBRates.xml";
$localfile = "/var/www/ECBRates";
$fp = fopen ($localfile, "r");
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERPWD, 'user:password');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));
$http_result = curl_exec($ch);
$error = curl_error($ch);
$http_code = curl_getinfo($ch ,CURLINFO_HTTP_CODE);
curl_close($ch);
fclose($fp);
print $http_code;
print "<br /><br />$http_result";
if ($error) {
print "<br /><br />$error";
}
?>
Copy these into a single document and name it xmlgetandput.php and run it using curl:
curl localhost/xmlgetandput.php
If for whatever reason you are unable to do this yourself I can upload the file (or any other file) to your webserver daily for fee of €5 per month. Just make a comment with the title “upload” and I will contact you via email with details.
2) Loading and parsing an XML file is different for DOM compliant browsers and for Internet Explorer. I found this simple for the DOM complient browsers but it took me over a week of googling to get the IE working. The problem was further compounded by the fact that the ECB Currency XML has a strange hierarchy. But I got it working with the following javascript code.
var doc
function load() {
if (document.implementation &&document.implementation.createDocument){
doc = document.implementation.createDocument("", "", null);
doc.load('CEBrates.xml');
doc.onload = createTableMoz;
}
else if (window.ActiveXObject){
var doc1 = new ActiveXObject('Msxml2.DOMDocument.3.0');
function loadXML(xmlFile){
doc1.async=false;
doc1.load(xmlFile);
doc1.setProperty("SelectionLanguage", "XPath");
var nsMappings = "xmlns:gesmes='http://www.gesmes.org/xml/2002-08-01' " + "xmlns:default='http://www.ecb.int/vocabulary/2002-08-01/eurofxref'";
doc1.setProperty("SelectionNamespaces", nsMappings);
var xpath = "/gesmes:Envelope/default:Cube/default:Cube";
var cubeMain = doc1.selectNodes(xpath)
var dateRate = cubeMain[0].getAttribute('time');
var dateRateSplit = dateRate.split('-');
xpath = "/gesmes:Envelope/default:Cube/default:Cube/default:Cube";
var cubes = doc1.selectNodes(xpath);
for (var i = 2; i < cubes.length; i++){
var currency = cubes[i].getAttribute('currency');
var rate = cubes[i].getAttribute('rate');
rateObject[currency] = rate;
}
document.getElementById('boldStuff').innerHTML = dateRateSplit[2] + "." + dateRateSplit[1] + "." + dateRateSplit[0];
document.getElementById("currency").value = "GBP";
getRates();
}
loadXML('CEBrates.xml');
}
else {
alert('ActiveX must be enabled for this feature');
return;
}
}
function createTableMoz() {
var cubes = doc.getElementsByTagNameNS('http://www.ecb.int/vocabulary/2002-08-01/eurofxref','Cube');
var dateRate = cubes[1].getAttribute('time');
var dateRateSplit = dateRate.split('-');
for (var i = 2; i < cubes.length; i++){
var currency = cubes[i].getAttribute('currency');
var rate = cubes[i].getAttribute('rate');
rateObject[currency] = rate;
}
document.getElementById('boldStuff').innerHTML = dateRateSplit[2] + "." + dateRateSplit[1] + "." + dateRateSplit[0];
document.getElementById("currency").value = "GBP";
getRates();
};
var rateObject = {};
function getRates() {
var curr= document.getElementById("currency").value;
var currRate = rateObject[curr];
var currStatement= "1 EUR = " + currRate + " " + curr ;
document.getElementById("rate").value=currStatement;
var currRev=1/currRate;
currRevFix=currRev.toFixed(5);
var currRevStatement= "1 " + curr +"= " + currRevFix + " EUR";
document.getElementById("rateRev").value=currRevStatement;
};
Here is a link to the finished product http://members.chello.at/stephen.joung/indexCC.html . You might find the currency converter useful.
Ubuntu 8.04 Gnome logout hangs system
After the upgrade from 7.10 to 8.04 I have hit the first small bug. I couldn’t use the “System – Quit” or the Log Out Button in Gnome to logout as they caused the session to hang. Also “gnome-session-save –kill” in a terminal caused the same fault. The only way out was a Control-Alt-Backspace. The forum is down today so I have struggled to find a solution and I have succeeded. Here it is:
Go to “System – Preferences – Sessions” and either activate or add and activate “gnome-power-manager”. and restart Gnome. That’s it, the usual logout box now appears as soon as you click the Log Out Button.
Ubuntu upgrade from 7.10 to 8.04.1
As you may have noticed I have been busy with javascript and Gmaps API topics recently and have delayed upgrading the Hardy Heron to avoid being distracted.
However yesterday I bit the bullet and upgraded via the update manager and everything seems to have worked well. One thing bugs me about the update manager is that it stops and asks if you want to keep your configuration files for certain applications such as Privoxy or replace them. Of course I want to keep them, why would I want to delete this information and then re-enter it, so really the question is stupid. But what bugs me is that the upgrade stops until these useless questions are answered and so you can’t start the update and then go out for a beer and expect the update to be finished when you get back.
I will keep you informed of issues as and when they occur.
Google Chart API. Extended encoding with scaling
I am using the Google Charts API to produce the path profiles in my Microwave Feasibility Tool and my Pedometer
Initially I used the Text Encoding with scaling method but the URL’s became too long for profiles over 30km as I check the height every 100m. I therefore changed to using the Extended Encoding method to request the charts but found it difficult to scale according to the whichever of my arrays had the highest and lowest points. I have eventually figured it out and here is the method I used as a script which you can copy and adapt for your own purposes. You can view this online at Extended Encoding
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Google Chart API Extended Encoding Example</title>
</head>
<body onload=”load()”>
<input id=”arrayA” value=”1,2,3,4,5,6,7,8,100,8,7,6,5,4,3,2,1″ size=”60″ type=”text” /> Array0<br />
<input id=”arrayB” value=”0,10,20,30,40,50,60,70,80,90,80,70,60,50,40,30,20,10,0″ size=”60″ type=”text” /> Array1<br />
<input id=”arrayC” value=”20,20,30,40,200,50,50″ size=”60″ type=”text” /> Array2<br />
<input type=”button” value=”Draw New Chart” onclick=”load()”/><br />
<div id=”chart” style=”width: 100%; height: 220px;” onclick=”newWindow()” ></div><script type=”text/javascript”>
var max;
var min;
var scale;
var legend;function load() {
var hiPoints= [];
var loPoints= [];
var array0= document.getElementById(”arrayA”).value
var array1= document.getElementById(”arrayB”).value;
var array2= document.getElementById(”arrayC”).value;
array0= array0.split(’,');
array1= array1.split(’,');
array2= array2.split(’,');
var arrays=[array0,array1,array2];for(i=0; i<arrays.length; i++) {
var maxHeight = Math.max.apply(null, arrays[i]);
hiPoints.push(maxHeight);
var minHeight = Math.min.apply(null, arrays[i]);
loPoints.push(minHeight);
}
var maxBiggest = Math.max.apply(null, hiPoints);
var maxRound = Math.ceil(maxBiggest/10)*10;
max= maxRound;
var minLowest = Math.min.apply(null, loPoints);
min= Math.floor(minLowest/10)*10;
var yaxis=”0:|” + min + “|” + max/2 + “|” + max ;
legend = “&chxt=y&chxl=” + yaxis;var firstArrayScaled= scaling(array0);
var secondArrayScaled = scaling(array1);
var thirdArrayScaled = scaling(array2);var chartBaseUrl = “http://chart.apis.google.com/chart?”;
var chartParams = “cht=lc&chs=450×220&chls=3,1,0|3,1,0|3,1,0|3,1,0&chco=005500,ff0000,000099,000000″;
var values = “&chd=e:”;
var title = “&chtt=Steve\’s%20Eample%20of%20Extended%20Encoding%20with%20scaling”;
values = values + extendedEncode(firstArrayScaled) + “,” + extendedEncode(secondArrayScaled) + “,” + extendedEncode(thirdArrayScaled);
document.getElementById(’chart’).innerHTML = “<img src=” + chartBaseUrl + chartParams + title + values + legend + “>”;
}
function scaling(values) {
var ymin=0;
var ymax=4095;
var arraylength = values.length;
var newvalues = new Array();
for (var i=0; i<arraylength;i++){
var v = values[i];
var y=Math.round((((ymin-ymax)/(max-min))*(max-v))+ymax);
newvalues.push(y);
}
return newvalues;
}function extendedEncode(values) {
var encodingString = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.’;
var chartData = [''];
var esln = encodingString.length;
var firstChar, secondChar;
for (var i = 0; i < values.length; i++) {
var currentValue = values[i];
if (!isNaN(currentValue) && currentValue >= 0) {
firstChar = encodingString.charAt(Math.floor(currentValue/esln));
secondChar = encodingString.charAt((currentValue % esln));
chartData.push(firstChar+secondChar);
}
else {
chartData.push(’__’);
}
}
return chartData.join(”);
}
</script>
</body>
</html>