‘Technology’ Archive

Phatnoise

6 February 2010 15:56

First blog post in a while, but, here goes anyway!

I’ve got a Phatnoise MP3 system in my Golf and have had the same music on the cartridge for ages. The problem is the company who make it don’t really seem to be around to much and I think have been acquired by Harmon. Either way if you need the latest version of the Phatnoise music / media manager I suggest you go check out this post on a very handy forum!

Filed: Technology // Tagged: , , , , // No Comments

Asynchronous Tracking with Google

2 December 2009 13:43

Google Analytics has had its latest update by now allowing asynchronous tracking cools. Pretty neat and also useful if you’re suffering or concerned on page load times. Interesting to see how it would work with multiple GA accounts, but, in theory should be easy to tweak.

http://code.google.com/apis/analytics/docs/tracking/asyncTracking.htm

Filed: Technology // Tagged: , , , // 1 Comment

Ruby Enterprise Install

9 November 2009 13:31

Trying to install Ruby Enterprise on a fresh RHEL5 64 bit box this morning and hit a few issues. Initially just the standard install requests for gcc, gcc-c++, readline-devel, openssl-devel and zlib-devel. They all installed fine, but, when I tried running the installer I got an error like this:

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:65,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:64:28: error: bits/c++config.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:69,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:65,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:46:25: error: bits/c++io.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/memory:54,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tempbuf.h:64,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:66,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:68,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:52:31: error: bits/c++allocator.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:45,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/string:52,
from src/base/commandlineflags.h:52,
from src/tcmalloc.cc:114:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:38:30: error: bits/atomic_word.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected template-name before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected `{' before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected unqualified-id before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h: In function ‘void std::random_shuffle(_RandomAccessIterator, _RandomAccessIterator)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:1906: error: ‘rand’ is not a member of ‘std’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h: At global scope:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:44: error: expected constructor, destructor, or type conversion before ‘__exchange_and_add’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:48: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:150: error: ‘_Atomic_word’ does not name a type
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_dispose(const _Alloc&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:232: error: ‘__exchange_and_add’ is not a member of ‘__gnu_cxx’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::size_type std::basic_string<_CharT, _Traits, _Alloc>::_M_check(typename _Alloc::rebind<_CharT>::other::size_type, const char*) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:306: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:306: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_M_check_length(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const char*) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:314: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::const_reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:726: error: tnction ‘typename _Alloc::rebind<_CharT>::other::const_reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:726: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:745: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc: In static member function ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc:145: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc: In static member function ‘static typename std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const _Alloc&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc:533: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration

The fix was two steps, first a simple install of libstdc++-devel then follow the instructions to install tcmalloc which is required. Odd that on a 32 bit system it installed straight away.

Filed: Technology // Tagged: , , , // No Comments

MSIE SSL Oddness

16 October 2009 15:09

Internet Explorer strikes again, sometimes. In Chrome, Firefox and Safari the problem doesn’t present. On a couple of webservers in a cluster we recently noticed the following type of error being returned randomly on images, CSS and JavaScript files when calling the page via SSL.

GET ERROR_INTERNET_SECURITY_CHANNEL_ERROR image/gif https://www.domain.com/path/to/image.gif

Now the majority of our SSL certificates for the site in question are server out via a SSL accelerator on our Cisco LBAL’s but this site wasn’t. It was still using a cert on the local box. Having dug deeper I noticed that a couple of the servers had the following lines of code in whereas all the others didn’t. Due to the load balancing that solves the randomness side of it.

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

Something in those lines of code causes the issues, I’m stabbing in the dark that it’s the session cache as none of the others would seem to be causing the problem. I’ve not tried line by line to find the offender.

Hopefully that will help someone out as I found lots of results in Google but not many solutions!

Filed: Technology, Work // Tagged: , , , , // No Comments

Get a domain from a URL

7 October 2009 17:11

Been looking for a function in ColdFusion to get the root domain from a url. There are a few but none actually cope with the many combinations. This function by no means copes with every combination however it does cover quite a lot. Comments inline indicate which domains the rules handle.


<cffunction name="getRootDomain" returntype="string" output="no" hint="Take a URL and get the domain from it.">
<cfargument name="url" type="string" required="true">
<cfset var dots = listLen(arguments.url,".")>
</cfset><cfset var domain = "">
</cfset><cfset host = arguments.url>
<!--- host.com, host.biz, host.ly --->
<cfif dots eq 2>
<cfset domain = host>
</cfset></cfif>
<cfif dots eq 3>
<!--- www.host.com, sub.host.com, www.host.mobi, www.host.ly, del.icio.us --->
</cfif><cfif listfirst(host,".") eq "www" or
((len(listgetat(host,3,".")) eq 3 or len(listgetat(host,3,".")) eq 2) and len(listgetat(host,"2",".")) gte 3)>
<cfset domain = listdeleteat(host,1,".")>
</cfset></cfif>
<!--- host.co.uk, host.com.za --->
<cfif (len(listgetat(host,3,".")) eq 2 and (len(listgetat(host,2,".")) eq 2) or len(listgetat(host,2,".")) eq 3)>
<cfset domain = host>
</cfset></cfif>
<cfif dots eq 4>
<!--- www.host.ltd.uk, www.host.co.uk --->
</cfif><cfif len(listgetat(host,4,".")) eq 2 and (len(listgetat(host,3,".")) eq 2 or len(listgetat(host,3,".")) eq 3)>
<cfset domain = listdeleteat(host,1,".")>
</cfset></cfif>
<!--- www.sub.host.com, sub.sub.host.com --->
<cfif len(listgetat(host,4,".")) eq 3 and len(listgetat(host,4,".")) gte 3>
<cfset domain = listdeleteat(listdeleteat(host,1,"."),1,".")>
</cfset></cfif>
<cfif dots eq 5>
<!--- sub.sub.host.co.uk, www.sub.host.co.uk, www.sub.host.com.za --->
</cfif><cfif len(listgetat(host,5,".")) eq 2 and (len(listgetat(host,4,".")) eq 2 or len(listgetat(host,4,".")) eq 3)>
<cfset domain = listdeleteat(listdeleteat(host,1,"."),1,".")>
</cfset></cfif>
<cfreturn domain />
</cfset></cfargument></cffunction>

Filed: Technology // Tagged: , // 1 Comment

ColdFusion Leap Year bug still there

13 July 2009 16:45

So just got ColdFusion 9 Beta 2 up and running and my old leap year bug is still there. I’ve posted a public bug, #78713 now the tracker has been launched. It effects 7, 8 & 9 so hopefully it’ll get fixed!

Filed: Technology // Tagged: , , // 1 Comment

New Releases

13 July 2009 13:17

A few new releases for you to catch up on. Firstly Wordpress 2.8.1 – essentially a bug fix and security release by the look of it but worth doing anyway, quick note that if you get stuck with a maintenance page check in your web root for a file called .maintenance, just rename that and the site will come back.

Next up two public beta’s from Adobe. ColdFusion 9 boasting some new useful and some not so useful/utterly pointless changes and the ColdFusion Builder which can either be standalone or as a plugin to Eclipse.

Filed: Technology // Tagged: , , , // No Comments

Awesome Idea

8 July 2009 11:11

Are you in an office with RFID door-entry? If not you should be… this idea is awesome! [via @timblair]

Filed: Technology // Tagged: , , // No Comments

Sphinx Multi-Value Attributes

6 July 2009 11:03

Sphinx allows you to create a multi-value attribute index which is great for document tags or categories. By default if you search across these the search is an OR match. If you want to run an AND match you must specify multiple filters rather than passing an array of values.

In ColdFusion using the Java API requires a little tweak as you can’t pass a normal ColdFusion array to sphinx, you have to use a basic java type array. Tim Blair has a good article on how to create them but here’s an example of calling the API.

This example will search for document tagged with either 100 or 200. Note the array creation method.

<cfset variables.sphinx = createobject("java", "org.sphx.api.SphinxClient").init()>
<cfset variables.sphinx.SetLimits(0, 10)>
<cfset variables.arrObj = createobject("java", "java.lang.reflect.Array")>
<cfset variables.jClass = createobject("java", "java.lang.Integer").TYPE>
<cfset variables.jArr = variables.arrObj.newInstance(variables.jClass, 2)>
<cfset variables.arrObj.setInt(variables.jArr, 0, 100)>
<cfset variables.arrObj.setInt(variables.jArr, 1, 200)>
<cfset variables.sphinx.SetFilter("tag", variables.jArr, FALSE)>

If you want to search for 100 AND 200 you’d do it like this:

<cfset variables.sphinx = createobject("java", "org.sphx.api.SphinxClient").init()>
<cfset variables.sphinx.SetLimits(0, 10)>
<cfset variables.sphinx.SetFilter("tag", 100, FALSE)>
<cfset variables.sphinx.SetFilter("tag", 200, FALSE)>

Filed: Technology // Tagged: , , , , // No Comments

More Geocoding

1 July 2009 23:18

More geocoding fun today, this time done with perl. For what I want to do, convert OS Grid easting and northing into latitude and longitude using an API, like Yahoo! was going to take ages due to throttling. Turns out that in perl using the handy Geography-NationalGrid-1.6 CPAN package it’s a lot easier and gives for most cases a result very close together.

Here’s a quick example:

#!/usr/bin/perl
use Geography::NationalGrid;
my $point1 = new Geography::NationalGrid( 'GB',
Easting => '385600',
Northing => '801900'
);
print "Latitude " . $point1->latitude . " Longitude " . $point1->longitude . "\n";

You can also give it a grid reference like TH 1234 1234 or a latitude and longitude.

Filed: Technology // Tagged: , // No Comments

 
Twitter   •   About   •   Contact
©2010 Ian Winter. All Rights Reserved.   •   Powered by WordPress   •   Hosted at Memset