<?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/"
	>

<channel>
	<title>Talk Unafraid &#187; isksense</title>
	<atom:link href="http://www.talkunafraid.co.uk/tag/isksense/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.talkunafraid.co.uk</link>
	<description>The (occasionally coherent) ramblings of a geek</description>
	<lastBuildDate>Sat, 07 Jan 2012 22:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MySQL to PostgreSQL, a tricky move for ISKsense</title>
		<link>http://www.talkunafraid.co.uk/2009/09/mysql-to-postgresql-a-tricky-move-for-isksense/</link>
		<comments>http://www.talkunafraid.co.uk/2009/09/mysql-to-postgresql-a-tricky-move-for-isksense/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 21:22:25 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Code Snippets and Examples]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[isksense]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=495</guid>
		<description><![CDATA[I just finished migrating ISKsense to PostgreSQL. This was more of a move for convenience&#8217;s sake, as MySQL on my server is basically deprecated because PostgreSQL rocks so hard. ISKsense is the last major app to move, and by far the trickiest. The move comes as I prepare to move the server to Ruby 1.9.1 [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished migrating ISKsense to PostgreSQL. This was more of a move for convenience&#8217;s sake, as MySQL on my server is basically deprecated because PostgreSQL rocks so hard. ISKsense is the last major app to move, and by far the trickiest. The move comes as I prepare to move the server to Ruby 1.9.1 from Ruby 1.8.7, a major change; I had the ISKsense source checked out on my staging server for 1.9.1 testing and decided to go ahead and move the db.</p>
<p>This is kinda a documentation post to describe the move and how you, too, can migrate your databases with a relative amount of sanity remaining intact, unlike me.<span id="more-495"></span></p>
<h3>Export from MySQL</h3>
<p>This is the easy bit.</p>
<pre>mysqldump -B yourdb --compatible=postgresql --skip-opt --quick --extended-insert -t &gt; dump.sql</pre>
<p>Easy. Except that &#8211;compatible=postgresql doesn&#8217;t help much.</p>
<h3>Working around MySQL&#8217;s crap</h3>
<p>OK, so now we have some issues to deal with. Let&#8217;s get the simple ones out of the way first. Fire up vi and run these:</p>
<pre>:%s/,'/,E'/g
:%s/\\0/0/g</pre>
<p>That does proper string escaping and removes null bytes, which PostgreSQL can&#8217;t handle as it uses C-style string termination internally. You may face consistency issues if you&#8217;re going from, say, LATIN1 to UTF8 in your migration; if that&#8217;s the case, add this to the top of your dumpfile:</p>
<pre>SET CLIENT_ENCODING TO 'LATIN1';</pre>
<p>Do you use booleans in MySQL? Heavily? You&#8217;re going to want to stab a MySQL Core Developer in a moment, so make sure the knives are somewhere you can&#8217;t find them when you&#8217;re angry. I&#8217;ll wait.</p>
<p>OK. MySQL doesn&#8217;t have a boolean. It&#8217;s actually TINYINT(1), with 1 being a true and 0 being a false. Which makes a sort of sense. But MySQL dump doesn&#8217;t export &#8216;true&#8217; or &#8216;false&#8217;, it exports 1s and 0s. PostgreSQL expects true or false values, and won&#8217;t cast integers to booleans. Welcome to hell.</p>
<p>The easiest(!) solution myself, Makurid and the combined efforts of #mysql and #postgresql on Freenode could come up with was to set the column types in PostgreSQL to be character varying, load the dataset, rename the columns as c_columnname, make a new column which is the boolean column columnname and run the following SQL:</p>
<pre>UPDATE table SET columnname=(CASE WHEN c_columnname::int=1 THEN true ELSE false END)</pre>
<p>Repeat for each column, in each table. Once done, you&#8217;re good. Pat yourself on the back and go get the knives out again.</p>
<h3>Importing back into PostgreSQL</h3>
<p>Now you&#8217;re on the home straight.</p>
<p>However, one note. If you&#8217;re like me and use an insanely long password for the database user (more than 100 characters), you&#8217;ve got a problem! psql accepts passwords as a hidden entry field, but it silently cuts off at around 48 characters. There&#8217;s a workaround, though, and this is the command you&#8217;d use to import back in:</p>
<pre>PGPASSWORD=longpasshere psql -U username database &lt; dump.sql</pre>
<p>The PGPASSWORD envvar passes the password in directly, no matter how long. Problem solved! You should now have a database full of data. You may also now have some issues with sequences not being correctly set. For each table:</p>
<pre>ALTER SEQUENCE table_id_seq RESTART WITH (SELECT MAX(id) FROM table);</pre>
<p>This will set the current value of the sequence to be the current maximum ID in that table, meaning the next assigned id will be that, plus one. Problem solved, again! You now have a database ready to face the world. Feel free to get the knives out again and find that MySQL core developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2009/09/mysql-to-postgresql-a-tricky-move-for-isksense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Of OLAP and T3 (Plus more on projects)</title>
		<link>http://www.talkunafraid.co.uk/2009/02/of-olap-and-t3-plus-more-on-projects/</link>
		<comments>http://www.talkunafraid.co.uk/2009/02/of-olap-and-t3-plus-more-on-projects/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 20:29:55 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[EVE Metrics]]></category>
		<category><![CDATA[ISKsense]]></category>
		<category><![CDATA[MMMetrics]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[accview]]></category>
		<category><![CDATA[activewarehouse]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[EVE]]></category>
		<category><![CDATA[eve metrics]]></category>
		<category><![CDATA[isksense]]></category>
		<category><![CDATA[nexus]]></category>
		<category><![CDATA[olap]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[t3]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=213</guid>
		<description><![CDATA[Blimey, it&#8217;s been a while since my last post. I hasten to add that this delay comes only by virtue of the fact that I am exceptionall busy with various projects right now. I thought an update might be appropriate, in any case. I&#8217;ve spent most of my time working on EVE Metrics. There&#8217;s some [...]]]></description>
			<content:encoded><![CDATA[<p>Blimey, it&#8217;s been a while since my last post. I hasten to add that this delay comes only by virtue of the fact that I am exceptionall busy with various projects right now. I thought an update might be appropriate, in any case.</p>
<p>I&#8217;ve spent most of my time working on <a href="http://www.eve-metrics.com/">EVE Metrics</a>. There&#8217;s some very cool, very powerful changes coming up soon; early Feb saw the introduction of much more accurate prices and indexes, with a newly improved algorithm for calculating the average prices of items. But even better is some of the new stuff coming in the next few weeks- notably the implementation of a fully-fledged OLAP warehouse for EVE Metrics, which will open up some very awesome possibilities in the long run.</p>
<p>Also under the scalpel this month has been the API system. EVE Metrics will support full and limited keys when it comes to the API. However, there will be a quirk; if you want to make use of other people&#8217;s API data, for example to see more detailed market analysis with transactions hooked in and so on, then you&#8217;ll have to share your data. This means if you want to benefit from other people&#8217;s data, you must reciprocate and share your data for the benefit of others. Your data will, in all cases, be used for global averages, but entirely anonymously; for example, the number of transactions per day on a given item may include data from your API, but nobody would know it. This system will hopefully encourage users to share data more often than hide it. I&#8217;m planning to make this an opt-out system, with the choice to opt-out given on the API key page as part of the form. It&#8217;ll be really hard to miss, and those who are paranoid or wish to hide their activity completely can check the box to opt out.</p>
<p>I released <a href="http://accview.mmmetrics.co.uk/">accVIEW</a> a few days ago, and it&#8217;s had quite rapid takeup from corporations. It&#8217;s a service that lets you perform background checks on prospective new members to your corporation- the basic tool lets you view skills, characters on an account, and various bits of information like their corp details, CEO, and so on. The premium version (For the low cost of 150mISK) lets you see the applicant&#8217;s wallet journal (with tools to show suspcious transactions and filter the results), as well as their recent kills/losses.</p>
<p>EVE&#8217;s M10 expansion, Apocrypha, should be awesome. Tech 3 is going to be great- lots of people complain about the skill loss and the fact that it&#8217;ll make FCing a nightmare. Well, no. The skill loss makes sense, and provides an interesting new dynamic to EVE. FCing- well, those who complain about T3 making FCing impossible are evidently not up to scratch as FCs. It&#8217;ll give FCs a real change and challenge for the first time in years. The wormhole stuff will be an interesting thing to watch pan out- there&#8217;s lots ot potential there, and it could end up being a lot of fun&#8230;</p>
<p>Nexus is progressing slowly but surely; the large amount of data we&#8217;re gleaning via an API-scraping installation for Sc0rched Earth is helping no end with development, and we&#8217;re busy tidying things up behind the scenes and refining some of the interface to make more sense. Once I&#8217;ve gotten ActiveWarehouse&#8217;s ETL library working properly, my next step will be to break out Photoshop and my text editor- EVE Metrics, ISKsense, maybe accVIEW, and the new MMMetrics site (Which will be launched soon) are all going under the knife and getting a serious facelift. And then it&#8217;s on to even more awesome stuff for EVE Metrics!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2009/02/of-olap-and-t3-plus-more-on-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MMMetrics, Nexus</title>
		<link>http://www.talkunafraid.co.uk/2008/12/mmmetrics-nexus/</link>
		<comments>http://www.talkunafraid.co.uk/2008/12/mmmetrics-nexus/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 20:05:10 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[MMMetrics]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[corporation]]></category>
		<category><![CDATA[eve metrics]]></category>
		<category><![CDATA[isksense]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[shamelessplug]]></category>
		<category><![CDATA[stuffisawesome]]></category>
		<category><![CDATA[work in progress]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=141</guid>
		<description><![CDATA[OK, where to start&#8230; MMMetrics. I&#8217;ve been pondering having a proper name to affiliate my work under for some time, so MMMetrics it is. Of course, short for Massively Multiplayer Metrics, and soon to be located at http://mmmetrics.co.uk- when the bloody DNS records update, that is&#8230; Over the next few weeks I&#8217;ll be reskinning EVE [...]]]></description>
			<content:encoded><![CDATA[<p>OK, where to start&#8230; MMMetrics. I&#8217;ve been pondering having a proper name to affiliate my work under for some time, so MMMetrics it is. Of course, short for Massively Multiplayer Metrics, and soon to be located at http://mmmetrics.co.uk- when the bloody DNS records update, that is&#8230;</p>
<p>Over the next few weeks I&#8217;ll be reskinning EVE Metrics, ISKsense, and various other things to have a much much nicer theme and one that is consistent across websites, giving each site their own visual take on the theme. Those sites will also be getting some much-needed optimisation, graphics, and new layouts.</p>
<p>Nexus is the other thing this brief post will touch on. Myself and flexd, the other developer working on the project and new member of VAF, have decided that open-sourcing the whole thing would be mad. It&#8217;s hideously complex to set up in places (though much easier than it used to be), and in any case a lot of the functionality Nexus provides is heavily aimed at alliances rather than corporations. We&#8217;ll still be offering Nexus to some alliances on an ask-and-we-might-let-you basis, but we will be forking Nexus, stripping it back to the killboard and fittings components, and releasing that as open source on Github.</p>
<p>That means if you&#8217;re an average corp you won&#8217;t get things like the tactical/intel overviews and IGB components, and all the alliance-level member managemet, capfleet management, and so on will be out. Because 99% of people don&#8217;t need it, to be honest. By keeping things more limited we&#8217;re keeping it much more hackable, more secure, easier to maintain and easier to extend, which means we&#8217;ll get it out of the door much quicker than we would have if we&#8217;d kept it all bundled together. So we&#8217;re looking at somewhere early-to-mid 2009 as our first release.</p>
<p>I think that just about covers it. Oh, other than to say happy holidays and a happy new year in advance, so I don&#8217;t forget as I obviously will do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2008/12/mmmetrics-nexus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

