<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Oligofren</title>
	<atom:link href="http://oligofren.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://oligofren.wordpress.com</link>
	<description>adj., gr., åndssvak, evneveik</description>
	<lastBuildDate>Wed, 14 Dec 2011 15:27:24 +0000</lastBuildDate>
	<language>no</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='oligofren.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Oligofren</title>
		<link>http://oligofren.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://oligofren.wordpress.com/osd.xml" title="Oligofren" />
	<atom:link rel='hub' href='http://oligofren.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Clean SOAP output with tcpdump</title>
		<link>http://oligofren.wordpress.com/2011/12/14/clean-soap-output-with-tcpdump/</link>
		<comments>http://oligofren.wordpress.com/2011/12/14/clean-soap-output-with-tcpdump/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 15:20:28 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Progging]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=634</guid>
		<description><![CDATA[I often have to resort to tcpdump to debug the input and output to production services consuming SOAP messages. The problem with tcpdump is that the ASCII output is littered with binary garbage at the start, and this makes it a rather laborious thing to clean up. The following article is a description of some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=634&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I often have to resort to tcpdump to debug the input and output to production services consuming SOAP messages. The problem with tcpdump is that the ASCII output is littered with binary garbage at the start, and this makes it a rather laborious thing to clean up. The following article is a description of some scripts, along with the source code, that cleans up the output.<span id="more-634"></span></p>
<p>Dumping to stdout:<br />
<code>tcpdump -A -s 0 -w - \<br />
"dst $DST and port $PORT &gt; dump.dat"</code></p>
<p>Reading from the dump file using <code>tcpdump -s0 -A -r - &lt; dump.dat</code> results in output like this</p>
<p><code>15:01:32.748754 IP 10.246.126.172.19992 &gt; nw-ws-035.asplogon.com.http: Flags [.], seq 1831:3291, ack 9496, win 253, length 1460<br />
.@.u...<br />
.~.&gt;F(.N..P.({..&amp;..P.......&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;SOAP-ENV:Header&gt;&lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;wsse:UsernameToken SOAP-ENV:mustUnderstand="1"&gt;&lt;wsse:Username&gt;&lt;!-- more xml --&gt;</p>
<p>15:01:32.751756 IP 10.246.126.172.19992 &gt; nw-ws-035.asplogon.com.http: Flags [P.], seq 3291:3383, ack 9496, win 253, length 92<br />
.@.u...<br />
.~.&gt;F(.N..P.(.o.&amp;..P.......&lt;!-- the rest of the xml --&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</code></p>
<p>I just want the text, and so I filter it using the following Python snippet:</p>
<pre>#!/usr/bin/python
# -*- coding: UTF-8 -*-
# @author: Carl-Erik Kopseng
import sys
import re

length_of_tcp_packet = -1
combined_data = ""
for line in sys.stdin:
  pattern = '\d\d:\d\d:\d\d.*, length (\d+)'
  match = re.match(pattern, line)

  if match is None :
    if length_of_tcp_packet &lt;= 0:
      continue
    combined_data += &quot;&quot; + line
  else:
    sys.stdout.write( combined_data[-(length_of_tcp_packet+1):-1] )

    length_of_tcp_packet = int(match.group(1))
    combined_data = &quot;&quot;

sys.stdout.write( combined_data )
</pre>
<p>If the above commands were saved in &#8220;read_dump_file.sh&#8221; and &#8220;print_clean_data_packets_in_ASCII.py&#8221; you could then filter the dump file by running<br />
<code>./read_dump_file.sh &lt; dump.dat | ./print_clean_data_packets_in_ASCII.py</code></p>
<p>and get the following clean output</p>
<p><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;SOAP-ENV:Header&gt;&lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;wsse:UsernameToken SOAP-ENV:mustUnderstand="1"&gt;&lt;wsse:Username&gt;&lt;!-- more xml --&gt;&lt;!-- the rest of the xml --&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</code></p>
<p>Usually there is a lot more than just SOAP calls going in and out, and to filter out just the SOAP calls I usually also pipe the output through the following sed script for the final touch <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<code>sed -n '/&lt;[a-zA-Z:-]*Envelope/,/&lt;\/[a-zA-Z].*:Envelope&gt;/ p' $@</code></p>
<p>Hope this is of help to someone out there <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/commandline/'>commandline</a>, <a href='http://oligofren.wordpress.com/tag/dump/'>dump</a>, <a href='http://oligofren.wordpress.com/tag/filtering/'>filtering</a>, <a href='http://oligofren.wordpress.com/tag/linux/'>Linux</a>, <a href='http://oligofren.wordpress.com/tag/osx/'>osx</a>, <a href='http://oligofren.wordpress.com/tag/python/'>python</a>, <a href='http://oligofren.wordpress.com/tag/regex/'>regex</a>, <a href='http://oligofren.wordpress.com/tag/sed/'>sed</a>, <a href='http://oligofren.wordpress.com/tag/soap/'>soap</a>, <a href='http://oligofren.wordpress.com/tag/tcp/'>tcp</a>, <a href='http://oligofren.wordpress.com/tag/tcpdump/'>tcpdump</a>, <a href='http://oligofren.wordpress.com/tag/xml/'>xml</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/634/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=634&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/12/14/clean-soap-output-with-tcpdump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>Counting occurrences of a word matching a regex</title>
		<link>http://oligofren.wordpress.com/2011/12/14/counting-occurrences-of-a-word-matching-a-regex/</link>
		<comments>http://oligofren.wordpress.com/2011/12/14/counting-occurrences-of-a-word-matching-a-regex/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 14:54:20 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Progging]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[unique]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=618</guid>
		<description><![CDATA[This is a brief code snippet showing how to use command line tools to count the occurences of words matching a regex. In the following example, I am trying to list all the unique hits on the urls from the apache access log matching &#8220;/chart&#8221;. I am using the GNU version of sed (the Linux [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=618&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a brief code snippet showing how to use command line tools to count the occurences of words matching a regex. In the following example, I am trying to list all the unique hits on the urls from the apache access log matching &#8220;/chart&#8221;.<span id="more-618"></span></p>
<p>I am using the GNU version of <code>sed</code> (the Linux and CygWin version), so substitute &#8220;-r&#8221; for &#8220;-E&#8221; if using the BSD version (as on OS X).</p>
<p><code>tail -80000 /var/log/apache2/access_log &gt; tail.txt<br />
egrep "POST /chart/" tail.txt \<br />
|sed -r -n 's/.*chart\/(get[a-zA-Z]+).*/\1/p' \<br />
| sort &gt; sortert</code></p>
<p><code> for word in $(uniq &lt; sortert); do<br />
/bin/echo -n "$word : ";<br />
grep $word sortert |wc -l;<br />
done \<br />
| sed -r -n 's/([a-zA-Z]+) : (.+)/\2\t\1/p' \<br />
|sort -g</code> </p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/bsd/'>bsd</a>, <a href='http://oligofren.wordpress.com/tag/commandline/'>commandline</a>, <a href='http://oligofren.wordpress.com/tag/cygwin/'>cygwin</a>, <a href='http://oligofren.wordpress.com/tag/gnu/'>gnu</a>, <a href='http://oligofren.wordpress.com/tag/linux/'>Linux</a>, <a href='http://oligofren.wordpress.com/tag/osx/'>osx</a>, <a href='http://oligofren.wordpress.com/tag/regex/'>regex</a>, <a href='http://oligofren.wordpress.com/tag/sed/'>sed</a>, <a href='http://oligofren.wordpress.com/tag/unique/'>unique</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/618/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/618/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=618&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/12/14/counting-occurrences-of-a-word-matching-a-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>Matching Java method signatures with sed</title>
		<link>http://oligofren.wordpress.com/2011/11/10/matching-java-method-signatures-with-sed/</link>
		<comments>http://oligofren.wordpress.com/2011/11/10/matching-java-method-signatures-with-sed/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 12:15:11 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Beep-beep]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Progging]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=615</guid>
		<description><![CDATA[In the process of removing PMD warnings from our main product at work I was trying to automate some parts of this process by using sed (Stream EDitor), a command line program common on all Unices (such as OS X and Linux). I had already been using a regex in Vim to do remove final [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=615&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the process of removing PMD warnings from our main product at work I was trying to automate some parts of this process by using sed (Stream EDitor), a command line program common on all Unices (such as OS X and Linux). I had already been using a regex in Vim to do remove final modifiers from methods on a file by file basis, but thought it might be quicker to do this using &#8220;find&#8221; and &#8220;sed&#8221; in stead. Boy was I wrong <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But mainly just because of the different regex dialect of sed that took me a long time to figure out.</p>
<p>The problem was mainly due to trying to match square brackets, such as in &#8220;final public int[] myMethod(int[] args)&#8221;. <span id="more-615"></span>To substitute this expression in Vim with &#8220;public int[] myMethod(int[] args)&#8221; I used the following expression:</p>
<pre>s/final \([_a-zA-Z0-9\[\]&lt;&gt; ]*\)(/\1(/</pre>
<p>The problem was that sed did not cope well with the same expression. After reading up on sed&#8217;s syntax on the man page for &#8220;re_format&#8221; I found out that the left square bracket had to follow immediately after the right and that the right square bracket would need to be escaped. Why this inconsistency? I have no idea. But this means that to match an expression such as &#8220;int[]&#8221; I would need a regex like this &#8220;[]\[a-z]&#8220;. So the equivalent expression of the Vi regex above is</p>
<pre>s/final \([]\[_a-zA-Z&lt;&gt; ]*\)/\1/</pre>
<p>This could be used to replace all final modifiers from methods in Java source. A document like<br />
<code>final public class Test {<br />
final public void method1() { }<br />
final public List&lt;Integer&gt; method2() { }<br />
final public List&lt;Integer&gt; method3() { }<br />
final public int[] method4(List&lt;Integer&gt; liste) { }<br />
public List&lt;Integer&gt; non_final_method() { }<br />
} </code><br />
would turn into<br />
<code>final public class Test {<br />
public void method1() { }<br />
public List&lt;Integer&gt; method2() { }<br />
public List&lt;Integer&gt; method3() { }<br />
public int[] method4(List&lt;Integer&gt; liste) { }<br />
public List&lt;Integer&gt; non_final_method() { }<br />
}</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/615/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/615/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=615&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/11/10/matching-java-method-signatures-with-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>[Java] Solving the case of IllegalCharsetNameException: &#8220;UTF-8&#8243;</title>
		<link>http://oligofren.wordpress.com/2011/11/02/java-solving-the-case-of-illegalcharsetnameexception-utf-8/</link>
		<comments>http://oligofren.wordpress.com/2011/11/02/java-solving-the-case-of-illegalcharsetnameexception-utf-8/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 11:11:45 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Beep-beep]]></category>
		<category><![CDATA[Progging]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[charsets]]></category>
		<category><![CDATA[file.encoding]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=593</guid>
		<description><![CDATA[Have you specified file.encoding as a parameter to the JVM, but ended up getting an unexpected startup exception instead? Here is what caused it and how to fix it. First the quick important facts for the googlers out there. The solution to your problem is simply to remove the quotation marks from the &#8220;UTF-8&#8243; string [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=593&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you specified <code>file.encoding</code> as a parameter to the JVM, but ended up getting an unexpected startup exception instead? Here is what caused it and how to fix it.<br />
<span id="more-593"></span><br />
First the quick important facts for the googlers out there. The solution to your problem is simply to remove the quotation marks from the &#8220;UTF-8&#8243; string you are passing as the value of the file.encoding parameter to the JVM.</p>
<p>Now, why does that work, and why does it work with the quotation marks in the shell? The reason is simply that if you run your program from the shell, it removes the quotes before handing it over to the jvm. So when you are running<br />
<code>java -Dfile.encoding="UTF-8" MainClass</code> you are really running<br />
<code>java -Dfile.encoding=UTF-8 MainClass</code>.<br />
Whereas when you are specifying this in a configuration file, as Glassfish does for example, these quotes will be part of the string used as the value of the parameter.</p>
<p>The actual reason why it fails with an exception can be found in the source code for CharSet. There you will se that the checkName() method throws an error if the charset name contains any other characters than [a-zA-Z0-9-.]. As quote (&#8220;) is not in that range, the exception is thrown.</p>
<p><code>Error occurred during initialization of VM<br />
java.nio.charset.IllegalCharsetNameException: "UTF-8"<br />
at java.nio.charset.Charset.checkName(Charset.java:284)<br />
at java.nio.charset.Charset.lookup2(Charset.java:458)<br />
at java.nio.charset.Charset.lookup(Charset.java:437)<br />
at java.nio.charset.Charset.defaultCharset(Charset.java:579)<br />
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:37)<br />
at java.io.OutputStreamWriter.(OutputStreamWriter.java:94)<br />
at java.io.PrintStream.(PrintStream.java:100)<br />
at java.lang.System.initializeSystemClass(System.java:1083)</code></p>
<p>This error can be seen in many different cases, such as configuring Grails, Glassfish, and many others where configuration files are being used to set jvm parameters.</p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/bug/'>bug</a>, <a href='http://oligofren.wordpress.com/tag/charsets/'>charsets</a>, <a href='http://oligofren.wordpress.com/tag/file-encoding/'>file.encoding</a>, <a href='http://oligofren.wordpress.com/tag/glassfish/'>glassfish</a>, <a href='http://oligofren.wordpress.com/tag/grails/'>grails</a>, <a href='http://oligofren.wordpress.com/tag/java/'>java</a>, <a href='http://oligofren.wordpress.com/tag/jvm/'>jvm</a>, <a href='http://oligofren.wordpress.com/tag/utf-8/'>utf-8</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/593/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=593&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/11/02/java-solving-the-case-of-illegalcharsetnameexception-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>Sjelen må få tid til å flytte inn i klærne</title>
		<link>http://oligofren.wordpress.com/2011/10/06/sjelen-ma-fa-tid-til-a-flytte-inn-i-klaerne/</link>
		<comments>http://oligofren.wordpress.com/2011/10/06/sjelen-ma-fa-tid-til-a-flytte-inn-i-klaerne/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 18:49:31 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Brød og sirkus]]></category>
		<category><![CDATA[Kulturmelk]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=597</guid>
		<description><![CDATA[Var på en fin visning av Hansen i Norwegian Rains/T. Michaels lokaler i dag. Hansen (ved sjefsdesigner Åse Helen Hansen) har en karakteristisk stil som føles veldig dansk; naturmaterialer, god kvalitet, ikke strengt, men deilig og ledig å ha på. Kanskje en effekt av flere års utlendighet i Danmark? Det skal sies at Åse er [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=597&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://oligofren.files.wordpress.com/2011/10/hansen2baw112bcopy.jpg?w=300" alt="Bilde av en moderne bunadsvariant" /></p>
<p>Var på en fin visning av <a href="//hansengarments.com">Hansen</a> i Norwegian Rains/T. Michaels lokaler i dag. Hansen (ved sjefsdesigner Åse Helen Hansen) har en karakteristisk stil som føles veldig dansk; naturmaterialer, god kvalitet, ikke strengt, men deilig og ledig å ha på. Kanskje en effekt av flere års utlendighet i Danmark? Det skal sies at Åse er ekte bergenser &#8211; på lik linje med Silje og Aleksander som driver butikken i Kirkegata &#8211; en butikk som er det nærmeste man kommer bergensbølgen i tekstilform. (Aleksander Helle har faktisk leflet med tanken på å utvide butikken til en showcase for noe mer enn bare bergenske tekstiler. Kanskje et eget Tellé Records-hjørne ville gjort seg?)</p>
<p>Klær produsert med ull fra Gudbrandsdalen eller restpartier av engelsk høykvalitets tweed fra en ære som lengst er forbi blir naturligvis ikke billig. På den annen side er mange av klærne nærmest for investeringer å regne; kvaliteten er så god at man kan regne med å ha dem i år etter år. I samtale med Åses danske kjæreste om hvordan virkelig gode klær blir ens favorittøy med tiden, kom det utsagnet som fikk synapsene mine til å fyre av som et fyrverkeri:</p>
<p><em>Det er viktig at (&#8230;) sjelen må få tid til å flytte inn i klærne.</em></p>
<p>Jeg likte det så godt at jeg bare måtte få det ut &#8211; noe dette innlegget bare er en dårlig unnskyldning for <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/597/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/597/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=597&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/10/06/sjelen-ma-fa-tid-til-a-flytte-inn-i-klaerne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>

		<media:content url="http://oligofren.files.wordpress.com/2011/10/hansen2baw112bcopy.jpg?w=300" medium="image">
			<media:title type="html">Bilde av en moderne bunadsvariant</media:title>
		</media:content>
	</item>
		<item>
		<title>Infinitest in IntelliJ</title>
		<link>http://oligofren.wordpress.com/2011/10/05/infinitest-in-intellij/</link>
		<comments>http://oligofren.wordpress.com/2011/10/05/infinitest-in-intellij/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 09:29:38 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Beep-beep]]></category>
		<category><![CDATA[Progging]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[continuous testing]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[infinitest]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[jbrodwall]]></category>
		<category><![CDATA[johannes brodwall]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=590</guid>
		<description><![CDATA[The key missing part of getting it working after installing the plugin through the IntelliJ plugin wizard is to <strong>enable the Infinitest facet</strong> for your project. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=590&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We had <a href="http://johannesbrodwall.com/">TDD guru Johannes Brodwall</a> deliver a workshop on TDD and refactoring for <a href="http://cicero.no">my company</a> last Friday, and that prompted me to (yet again) try to get Infinitest working in IntelliJ. Today I managed to get it working, but it was certainly not thanks to the non-existing documentation!</p>
<p>The key missing part of getting it working after installing the plugin through the IntelliJ plugin wizard is to <strong>enable the Infinitest facet</strong> for your project. Right click on the project, choose facet, add Infinitest and voila! You now have a new tab called Infinitest.</p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/continuous-integration/'>continuous integration</a>, <a href='http://oligofren.wordpress.com/tag/continuous-testing/'>continuous testing</a>, <a href='http://oligofren.wordpress.com/tag/howto/'>howto</a>, <a href='http://oligofren.wordpress.com/tag/infinitest/'>infinitest</a>, <a href='http://oligofren.wordpress.com/tag/intellij/'>intellij</a>, <a href='http://oligofren.wordpress.com/tag/jbrodwall/'>jbrodwall</a>, <a href='http://oligofren.wordpress.com/tag/johannes-brodwall/'>johannes brodwall</a>, <a href='http://oligofren.wordpress.com/tag/plugin/'>plugin</a>, <a href='http://oligofren.wordpress.com/tag/tdd/'>tdd</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/590/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=590&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/10/05/infinitest-in-intellij/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting a Chrome Offline Installer for another OS</title>
		<link>http://oligofren.wordpress.com/2011/09/29/getting-a-chrome-offline-installer-for-another-os/</link>
		<comments>http://oligofren.wordpress.com/2011/09/29/getting-a-chrome-offline-installer-for-another-os/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 08:55:41 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[language choice]]></category>
		<category><![CDATA[offline installer]]></category>
		<category><![CDATA[other os]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=588</guid>
		<description><![CDATA[Due to some restrictions at work, we need to install software via USB and not by direct download. The problem is that when trying to get the Chrome Offline Installer it seems virtually impossible to download it for another os. There are links for other operating systems, but these lead to the online installers. Duh! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=588&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Due to some restrictions at work, we need to install software via USB and not by direct download. The problem is that when trying to get the <a href="http://www.google.com/chrome/eula.html?standalone=1">Chrome Offline Installer</a> it seems virtually impossible to download it for another os.</p>
<p>There are links for other operating systems, but these lead to the online installers. Duh! Fortunately I found a trick by looking at the URL generated for the online installer, where I saw that two parameter that could be used to select the right version:<br />
<strong>platform</strong> and <strong>hl</strong>.</p>
<p>Example url: http://www.google.com/chrome/eula.html?standalone=1&amp;platform=win&amp;hl=no</p>
<p>The url above would select a standalone (offline) installer for Windows where the language version would be Norwegian. Cool,huh?</p>
<p>Platform choices are: &#8220;mac&#8221;, &#8220;win&#8221; and &#8220;linux</p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/chrome/'>chrome</a>, <a href='http://oligofren.wordpress.com/tag/fix/'>fix</a>, <a href='http://oligofren.wordpress.com/tag/hack/'>hack</a>, <a href='http://oligofren.wordpress.com/tag/language-choice/'>language choice</a>, <a href='http://oligofren.wordpress.com/tag/offline-installer/'>offline installer</a>, <a href='http://oligofren.wordpress.com/tag/other-os/'>other os</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/588/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=588&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/09/29/getting-a-chrome-offline-installer-for-another-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>[OS X] Dial-up using Bluetooth on SE C702</title>
		<link>http://oligofren.wordpress.com/2011/09/14/connecting-os-x-to-the-internet-using-bluetooth-on-se-c702/</link>
		<comments>http://oligofren.wordpress.com/2011/09/14/connecting-os-x-to-the-internet-using-bluetooth-on-se-c702/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 13:24:12 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple support]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[bluetooth setup assistant]]></category>
		<category><![CDATA[bt]]></category>
		<category><![CDATA[c702]]></category>
		<category><![CDATA[dial-up]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[pan]]></category>
		<category><![CDATA[sec702]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[sony ericsson]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=580</guid>
		<description><![CDATA[How to set up a Sony Ericsson C702 for use with a Mac as a mobile modem and how to fix a problem that might arise. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=580&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently lost my iPhone and so I was back to my trusty, old Sony Ericsson C702. Far from fancy, but it works and I can use it for far longer than I ever could with my iPhone without charging. But I sometimes need on-the-road access to the internet, and now I kneed to do that using C702, which is what this post concerns.<span id="more-580"></span></p>
<h2>Getting online</h2>
<p>Getting online the first time was a no-brainer. The order in which you do this do not matter:</p>
<ul>
<li>Open the Network pane and add Bluetooth PAN</li>
<li>Set up Bluetooth device and answer the questions that might pop up on your phone.</li>
<li>Choose the device from the drop-down list and press connect</li>
</ul>
<p>That should be it! But you might experience problems &#8211; as I did.</p>
<h2>Troubleshooting</h2>
<p>Getting online the first time went like a breeze. But then for some reason I decided to redo the installation, and then, after pairing the phone with my Mac I got the following error:</p>
<blockquote><p>Bluetooth Setup Assistant can&#8217;t set up your device as a dial-up modem because the Bluetooth interface isn&#8217;t available. Open Network preferences to add it.</p></blockquote>
<p>What? An endless loop of trying to add/remove Bluetooth PAN/DUN from the Network Panel, the phone from Bluetooth devices, rebooting, etc. commenced, and every time I tried to go through the hoops again, I was confronted with the same error message. What to do? I called Apple Support. Which at first was pretty useless, saying they do not support Sony Ericsson, etc, blah, blah, blah, and basically wanted to hang up. But since this error message did not concern Sony Ericsson, but rather the setup of the machine (missing interface, remember?), I convinced the support to hang on a bit and try harder to find a solution. Then after asking me about the exact error message she asked me to do the following which turned out to solve all my problems:</p>
<ol>
<li><strong>Turn off the  machine and reset the power supply</strong>. Plug in the power cord. Turn off the machine. The resetting is done by pressing the power button while holding Ctrl-Option-Shift. This should (visually) do nothing, but does do something under the hood.</li>
<li><strong>Reset PRAM</strong>. Quoting Apple on what this does:<br />
<blockquote><p>A small amount of your computer’s memory, called “parameter random-access memory” or PRAM, stores certain settings in a location that Mac OS X can access quickly.</p></blockquote>
<p>This could explain why even after removing the phone from the installed Bluetooth devices, it stilled showed up in the &#8220;Connect&#8221; list in Network Panels &#8220;Bluetooth PAN&#8221; section. If it was still being referenced from PRAM (and not the disk settings), it might cause some flukes. OK, so I tried resetting, which is done by shutting down the computer, holding Cmd-Option-P-R and pushing the power button. Keep the buttons pressed until you hear the startup sound for the second time. The PRAM is now reset.</li>
</ol>
<p>After turning on my machine and trying to pair the phone, I was suddenly prompted by my phone: &#8220;Allow using this as a modem?&#8221;. Success! After pressing yes, and dismissing the next dialogs I could finally connect using the Bluetooth PAN dialog.</p>
<p><strong>Links</strong></p>
<ul>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.6/en/26871.html">Resetting PRAM (Apple)</a></li>
<li><a href="http://support.apple.com/kb/ht1379">Resetting your Mac&#8217;s PRAM and NVRAM</a></li>
<li><a href="http://dl.dropbox.com/u/514315/diskusjonsfora/feisar%20plugin%20setup.png">Picture of the dialog with the mentioned error message</a></li>
</ul>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/apple-support/'>apple support</a>, <a href='http://oligofren.wordpress.com/tag/bluetooth/'>bluetooth</a>, <a href='http://oligofren.wordpress.com/tag/bluetooth-setup-assistant/'>bluetooth setup assistant</a>, <a href='http://oligofren.wordpress.com/tag/bt/'>bt</a>, <a href='http://oligofren.wordpress.com/tag/c702/'>c702</a>, <a href='http://oligofren.wordpress.com/tag/dial-up/'>dial-up</a>, <a href='http://oligofren.wordpress.com/tag/error/'>error</a>, <a href='http://oligofren.wordpress.com/tag/modem/'>modem</a>, <a href='http://oligofren.wordpress.com/tag/osx/'>osx</a>, <a href='http://oligofren.wordpress.com/tag/pan/'>pan</a>, <a href='http://oligofren.wordpress.com/tag/sec702/'>sec702</a>, <a href='http://oligofren.wordpress.com/tag/snow-leopard/'>snow leopard</a>, <a href='http://oligofren.wordpress.com/tag/sony-ericsson/'>sony ericsson</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/580/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=580&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/09/14/connecting-os-x-to-the-internet-using-bluetooth-on-se-c702/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting the IP of a SaMBa server or Windows machine</title>
		<link>http://oligofren.wordpress.com/2011/09/06/getting-the-ip-of-a-samba-server-or-windows-machine/</link>
		<comments>http://oligofren.wordpress.com/2011/09/06/getting-the-ip-of-a-samba-server-or-windows-machine/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 16:28:47 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Beep-beep]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[netbios]]></category>
		<category><![CDATA[nmb]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[smb]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=573</guid>
		<description><![CDATA[At times my server gets a new ip from my router, thus rendering my hosts file invalid and generally making life less pleasant. So in order to get contact with the server again, I need to get the IP. This is where nmblookup comes in. Simply type nmblookup name-of-the-machine (where name-of-the-machine obviously is the samba [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=573&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At times my server gets a new ip from my router, thus rendering my hosts file invalid and generally making life less pleasant. So in order to get contact with the server again, I need to get the IP. This is where nmblookup comes in. </p>
<p>Simply type<br />
<code>nmblookup  name-of-the-machine</code><br />
(where name-of-the-machine obviously is the samba configured name) will pop out a result like this<br />
<code>querying name-of-the-machine on 192.168.10.0<br />
192.168.10.114<br />
</code></p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/linux/'>Linux</a>, <a href='http://oligofren.wordpress.com/tag/netbios/'>netbios</a>, <a href='http://oligofren.wordpress.com/tag/nmb/'>nmb</a>, <a href='http://oligofren.wordpress.com/tag/osx/'>osx</a>, <a href='http://oligofren.wordpress.com/tag/samba/'>samba</a>, <a href='http://oligofren.wordpress.com/tag/smb/'>smb</a>, <a href='http://oligofren.wordpress.com/tag/windows/'>Windows</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/573/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=573&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/09/06/getting-the-ip-of-a-samba-server-or-windows-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
		<item>
		<title>[Java] Checking for null values quickly</title>
		<link>http://oligofren.wordpress.com/2011/06/07/checking-for-null-values-quickly/</link>
		<comments>http://oligofren.wordpress.com/2011/06/07/checking-for-null-values-quickly/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 08:55:48 +0000</pubDate>
		<dc:creator>Carl-Erik</dc:creator>
				<category><![CDATA[Beep-beep]]></category>
		<category><![CDATA[Progging]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[asList]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[contains]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[null checking]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://oligofren.wordpress.com/?p=561</guid>
		<description><![CDATA[Quickly checking for nulls in your inputs: if ( asList(foo, bar, baz, fooFoo, fooBar, fooBaz, barFoo, barBar, barBaz ).contains(null) ) throw new IllegalArgumentException("No nulls allowed");<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=561&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thought I might share a little favorite code snippet that I like to use. It is quite useful if you need to check that a long list of variables do not contain any null variables, for instance as validation at the start of a public method. It makes use of the varargs version of Arrays.asList(Object &#8230;) and List.contains() and is for instance used like this:</p>
<pre>
if (asList(foo, bar, baz, fooFoo, fooBar, fooBaz, barFoo, barBar, barBaz )
           .contains(null)) {
    throw new IllegalArgumentException("No objects are allowed to be null");
}
</pre>
<p>Here I have used static imports to be able to simply write asList() instead of Arrays.asList(). Hope it turns out useful for someone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /> Tagged: <a href='http://oligofren.wordpress.com/tag/arrays/'>arrays</a>, <a href='http://oligofren.wordpress.com/tag/aslist/'>asList</a>, <a href='http://oligofren.wordpress.com/tag/code/'>code</a>, <a href='http://oligofren.wordpress.com/tag/contains/'>contains</a>, <a href='http://oligofren.wordpress.com/tag/java/'>java</a>, <a href='http://oligofren.wordpress.com/tag/list/'>list</a>, <a href='http://oligofren.wordpress.com/tag/null-checking/'>null checking</a>, <a href='http://oligofren.wordpress.com/tag/snippet/'>snippet</a>, <a href='http://oligofren.wordpress.com/tag/tip/'>tip</a>, <a href='http://oligofren.wordpress.com/tag/validation/'>validation</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oligofren.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oligofren.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oligofren.wordpress.com/561/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oligofren.wordpress.com&amp;blog=3410565&amp;post=561&amp;subd=oligofren&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oligofren.wordpress.com/2011/06/07/checking-for-null-values-quickly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cdd96f59bb81a26d81870ba244215bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Carl-Erik</media:title>
		</media:content>
	</item>
	</channel>
</rss>
