tag:blogger.com,1999:blog-83294508441234701602024-03-20T08:29:09.587+11:00pimaster: aka Russell MullensGeekpimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.comBlogger121125tag:blogger.com,1999:blog-8329450844123470160.post-36827731253983267722022-06-21T15:05:00.007+10:002022-06-21T15:08:10.576+10:00I wrote a Magic the Gathering deck viewer \o/<p> <a href="https://pimaster.github.io/decky/">decky</a></p><p>My theory being is that you shouldn't have to sign in and save something to a database to share an idea.</p><p>Here is a link to my 3 card giggle: <a href="https://pimaster.github.io/decky/#%7B%22c2%22:%2200D304xf01mo%22%7D">Lure, Lunch, Launch</a>.</p><p>Been a long time in development. Glad that github can host html pages without much work.<br />Shall be interesting to see if I get any contributions.</p>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-88090129517198699342022-05-14T17:34:00.001+10:002022-05-14T17:34:04.510+10:00Dell Monitor: 2405FPW Capacitor Replacements<p>Another day, another death of a monitor. <br /></p><p></p><p><img alt="Image" height="400" src="https://pbs.twimg.com/media/FSrnT1yVIAAhQPh?format=jpg&name=large" width="265" /> </p><p>Well, this one started behaving badly. Blacks that were just 1 bit off were displaying in a mostly green. It wasn't good. Video was terrible.</p><p>Since I recorded what caps were replaced on the power board last time, thought I'd do it again.</p><p>470uF 35v x6. This is the one that showed most damage.<br />47uF 35v x2<br />1uF 100v x1 <- didn't replace.<br />120uF 450v x1 <- didn't replace as I couldn't find replacement.<br />220uF 35v x1 <- probably didn't need to be replaced as it looked like it was on the sound bar power line.</p><p>I'm amused that this repair involved less capacitors than my 19"</p><p>Only thing I'm annoyed with is I somehow missed a screw when putting it together. Don't think it is a problem. Not going through all the hassle to dismantle it again for ONE screw.<br /></p>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-84731728131367208152021-10-06T19:27:00.001+11:002021-10-06T19:28:41.899+11:00Dell Monitor: 1905fp Rev A02 Capacitor Replacements<div class="separator" style="clear: both; text-align: left;">I've been holding onto my monitors for a long time. I don't see a matching bezel style in 24" and 19", let alone the same base style.</div><div class="separator" style="clear: both; text-align: left;">So when my 19" failed to turn on. I was sad. I thought it was the Display Port > DVI cable as when I switched the cable, the monitor lit up. Now I'm guess there was just the right conditions for the power to be 'ok'.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBFKC-RlYQP_a84wxCSX2DXdJ4ds5RRUa-omay4Lrarcs8mduxccv1b1X9aSSLgyCSEC05NTFajxrgily90HhgpkRZZWwXm_5xY0elE1zDR1eqvAIbVxagwPC51nVzokZyFJ4_3oWyKNY0/s960/BadCaps.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="579" data-original-width="960" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBFKC-RlYQP_a84wxCSX2DXdJ4ds5RRUa-omay4Lrarcs8mduxccv1b1X9aSSLgyCSEC05NTFajxrgily90HhgpkRZZWwXm_5xY0elE1zDR1eqvAIbVxagwPC51nVzokZyFJ4_3oWyKNY0/w400-h241/BadCaps.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;">But I want to keep a record of what was in there and what I replaced. I wasn't able to get them all from JayCar as the are required to be low ESR.</div><div class="separator" style="clear: both; text-align: left;">470uF 35v x4</div><div class="separator" style="clear: both; text-align: left;">1000uF 25v x1</div><div class="separator" style="clear: both; text-align: left;">1000uF 10v x3</div><div class="separator" style="clear: both; text-align: left;">220uF 50v x2</div><div class="separator" style="clear: both; text-align: left;">22uF 50v x1</div><div class="separator" style="clear: both; text-align: left;">2.2uF 50v x1</div><div class="separator" style="clear: both; text-align: left;">10uF 50v x1</div><div class="separator" style="clear: both; text-align: left;">4.7uF 50v x1</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">I could only get the 22uF in a 63V package. I understand that a higher voltage in a capacitor is fine.</div><div class="separator" style="clear: both; text-align: left;">I couldn't replace the 2.2, 10 and 4.7 because I couldn't get them in low ESR.</div><div class="separator" style="clear: both; text-align: left;">I also had to skip the 220 as my click and collect order was one short (and had an extra 470). They look like they are related to the backlighting.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">My friend has suggested https://www.digikey.com.au/ so I'll have to check that out in the future.</div>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-64654468656892899192021-03-11T15:58:00.003+11:002021-03-11T15:59:10.765+11:00Twitter ban hammer<p> </p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbkjJDN3Y9R0m7Q7wHDwNfTdpnsa7WltyPpNW5yBG_FIiRpX28J3JeNMx2RgvrK7cI9h6bF6e0wMyQ6MhJD_OUWGg6HyE2ntelfmfdSDGRo1hyphenhyphenHTUbplZwDsp04wIE6ZGDe-POwWEJ0wt7/s438/TwitterBanHammer.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="153" data-original-width="438" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbkjJDN3Y9R0m7Q7wHDwNfTdpnsa7WltyPpNW5yBG_FIiRpX28J3JeNMx2RgvrK7cI9h6bF6e0wMyQ6MhJD_OUWGg6HyE2ntelfmfdSDGRo1hyphenhyphenHTUbplZwDsp04wIE6ZGDe-POwWEJ0wt7/s16000/TwitterBanHammer.jpg" /></a></div>I got hit by the Twitter ban hammer. I'm not allowed to post anything for 12 hours even though I thought deleting the offending tweet was complying with their rules. I must have failed to understand that text.<p></p><p>Now that I've deleted the tweet I've given up my ability to challenge the decision. After going for a walk I wish that I had left it up. Sensitive topic but that doesn't mean it should be censored.</p><p>Which is amusing as I've tweeted about that before as well.</p><div class="separator" style="clear: both; text-align: center;">
<a href="https://twitter.com/the_pimaster/status/1020871339849027590">
<img alt=""I don't want people to be afraid of words if it stops them from having a dialogue." - Jimmy, South Park S19E08" border="0" data-original-height="218" data-original-width="598" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfHBwUZk1I3utAMQzPWt-FmyCjvuxCQrCOyfajCWmpA4x8d3O96Z-7Cca96rhfX55jOhJOminBBVMk5FMl5do3ae9w3KWFqqXvO57UKXx87_Bu0kVL2KwkyjcJKCKS1o9Yw1x8NsK1pdVh/w400-h146/JimmySpeech.jpg" width="400" />
</a>
</div>Twitter is my place to rant usually... 9 hours to go.<p></p>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-86752228442601032462021-02-27T14:21:00.001+11:002021-02-27T14:21:08.271+11:00Oh look, a link to a news article!Ready, the amazing feature of the 'web'...<br />
<a href="https://abcnews.go.com/Business/wireStory/australia-google-makes-publisher-deals-facebook-walks-75954101">This is a link to news.</a><br />
Since blogger is owned by Google and they have <a href="https://www.nbcnews.com/media/google-news-corp-strike-deal-rcna291">struck a deal</a> with 'registered news businesses', does this mean the link is going to cost them? How unmanageable is that. A company has to shell out a price based on what a user can post. Maybe Google only have to pay if the link is clicked? What if no one reads this page?<div><br /></div><div>I find the whole thing offensive. It was so exciting to see Facebook pull the plug on every piece of news in Australia and see the government throw a tantrum. </div><div><br /></div><div>Their own report was vague on what the definition of new was!</div><blockquote><div>News and journalistic content are then defined in the CMT report as:
'A diverse range of informative content about matters of import that can be defined by characteristics such as timeliness. ... Deliberately elastic, it extends beyond content produced by journalists' <br /></div></blockquote>
<a href="https://parlinfo.aph.gov.au/parlInfo/download/legislation/billsdgs/7808228/upload_binary/7808228.pdf">Official government document on the issue</a>, page 15.<div><br /></div><div>I wrote my local member of parliament. I got a call back the day after the bill was put into place so I don't know how much impact it had.</div>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-14294279325818585432021-02-27T11:38:00.004+11:002021-02-27T11:40:03.675+11:00Holy cow, I’m starting on a websiteHeads up.
I have no idea when I started writing this and I don't know why it was only a draft instead of being published. I can't even remember what project it was for :(
So yesterday and today were spent setting up the structure of a java web application using maven. I had previously used maven at work but focus is on the project rather than the tool (probably as it should be). So I got to bang my head against a fresh script.<br />
And boy, am I not happy.<br />
It shouldn't take 2 days to put together something that just displays a page when deployed. I must admit that it is doing a lot of things that I don’t need yet like running tests, javadocing, test reports, general “what is this project” website etc.<br />
Some of the problem was over naming, cobertura-maven-plugin and maven-cobertura-plugin is just confusing.<br />
I also had a configuration issue with cobertura. Apparently it is really hard to put the generated file into a specific directory (since it is a derived resource, it should exist in the target/ directory). So the work around is to clean the file specifically.<br />
<code>[xml]<br /><br />maven-clean-plugin<br /><br /> ${basedir}<br /> <br /> cobertura.ser<br /></code><br />
The other stuff that has been slowing me down is because it is the kind of configuration that you do at the start of a project and forget.<br />
Like a working log4j.properties file. For some reason I wasn’t able to generate one that just worked, so I had to google around to find a <a href="http://forum.java.sun.com/thread.jspa?threadID=778082&messageID=4428524">default one</a> and I’ll move from there.<br />
<br />
Just need to get automated deploy and web tests happening and I should be able to start coding functionalitypimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-38838730019063906572016-05-09T10:22:00.000+10:002016-05-09T10:22:03.934+10:00Pyra got a quick overviewThe biggest problem I saw with describing the pyra is that all of the individual parts are a little underwhelming. It is when they are thrown together in the one package that this device starts to shine. That's hard to do with text.<br />
<br />
I'm not sure whether EvilDragon was planning on putting out a short video or whether <a href="https://pyra-handheld.com/boards/threads/what-a-great-start-prepare-for-the-next-level.77376/#post-1377085">my post</a> inspired him but here is the video.<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/rZDfTVX8Nb8" width="560"></iframe>
<br />
<br />
So glad it came out. Was a joy for me to watch too as it is the first video of a completed pyra.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-22652969339835193102016-05-02T09:44:00.001+10:002016-05-02T09:48:35.317+10:00I'm excited about the Pyra, successor to the OpenPandoraIt's been a while since I've typed anything here but I thought I'd share my excitement about getting a new toy.<br />
<br />
The Pyra is a portable ARM computer with a QWERTY keyboard and gaming controls. It's powerful enough to be a simple desktop and portable to be a gaming machine. Full details on the <a href="https://pyra-handheld.com/boards/pages/pyra/">Pyra website</a>.<br />
Lots of people are excited about the emulation possibilities.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHtSof7_NzcDNeOXrvCzD9oqQl6_incOs-0i7ExL37G3XfSm4NOf1NtwFcp_fhvUj5hd3P3Sp8BBTusv1X5fDVJseda0n49OokJD0rnagbq6avt5OsFVYEcswSvwCBQajAqVGqCbSvmT-/s1600/pyra-preorder-standard-edition-2gb-ram-pyra.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHtSof7_NzcDNeOXrvCzD9oqQl6_incOs-0i7ExL37G3XfSm4NOf1NtwFcp_fhvUj5hd3P3Sp8BBTusv1X5fDVJseda0n49OokJD0rnagbq6avt5OsFVYEcswSvwCBQajAqVGqCbSvmT-/s400/pyra-preorder-standard-edition-2gb-ram-pyra.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Render of the Pyra</td></tr>
</tbody></table>
18 of these units have been produced and they are ready to build more.<br />
Unfortunately, you can't buy them yet. They are being produced by a small group of people and don't have the funding to lay out the capital.<br />
You can put a down payment on one.<br />
<a href="https://www.dragonbox.de/en/45-pyra" rel="">Pyra at the Dragon Box store</a><br />
I was part of the pre-preorder crowd so as well as being guaranteed one from the first batch made, I got a sweet board, signed and numbered by the team.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj2jd7It37RPy8_WW0koNXqNhO60o3J-0FgiRPO-neIGsMrNf2TphxFifMdxAo4b5V_KQAYGC7AUIpnw4T3BfjqDTkGb72lVSzFhyB7aIwdcK6BLCnnYm2CQcEBHNVah9rwpZhU4rnW3tT/s1600/2016-01-15+08.16.47.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj2jd7It37RPy8_WW0koNXqNhO60o3J-0FgiRPO-neIGsMrNf2TphxFifMdxAo4b5V_KQAYGC7AUIpnw4T3BfjqDTkGb72lVSzFhyB7aIwdcK6BLCnnYm2CQcEBHNVah9rwpZhU4rnW3tT/s400/2016-01-15+08.16.47.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pyra pre-preorder board. <a href="https://pyra-handheld.com/boards/threads/i-miss-a-case-etc.76666/">Others were equally excited</a>.</td></tr>
</tbody></table>
It's not a device for everyone. It might be a little expensive for what it does.<br />
It is unique though and I'm looking forward to getting it.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-28388467890540163592014-09-24T00:14:00.000+10:002014-09-24T00:14:57.985+10:00The stats of playing lands at the right time.I'm been playing a fair bit of Magic the Gathering and doing a lot of listening whilst on my walks.<br />
I'm enjoying the challenge of improving myself.<br />
<br />
When I first started playing over 10 years ago, I used to play with a deck that had a third of lands. When I started playing drafts in 2012, I was informed that a third was a little low and two fifths is what I should be aiming for.<br />
<br />
I found that games were going much smoother.<br />
<br />
As different sets came out, the requirement for how many lands you depended on changed.<br />
I've tried looking at different sites for probabilities based on the number of lands in a deck but I could never grok them.<br />
After producing my own numbers, I understand why. There is a lot to take in.<br /><br />
<iframe style="position:relative; z-index:99; background-color: white;" width="550" height="400" src="https://docs.google.com/spreadsheets/d/1PqzueqSjlk4Qos2Jh3V8e1QqI9Td4I38QCRdO5XxPzw/pubhtml?gid=676612640&single=true&widget=true&headers=false"></iframe>
(or play with the <a href="https://docs.google.com/spreadsheets/d/1PqzueqSjlk4Qos2Jh3V8e1QqI9Td4I38QCRdO5XxPzw/edit?usp=sharing">whole thing</a>)
<br /><br />
This sheet allows me to see the number of lands I can expect in a given turn.<br />
It should allow me to make decisions on whether I want to be sure I get to land X and what is the likely hood that I'll have more land in my hands than I need.<br />
It shows me how one more or one less land affect my hand.<br />
The thing that came out of the sheet that I didn't expect was, 'what does it mean if an outcome happens 10% of the time?'.<br />
In a draft, you are guaranteed 6 games, with a maximum of 9. That means if something had a probability of happening more that 16%, you had to be prepared for it happening at least once during the night.<br />
I was expecting to adjust the probabilities by around 5%. Swaying them closer to 15% seems a lot, but I'll see how I go.<br /><br />
Love a technical solution to a non-technical problem.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-60806328787777419542013-11-15T13:30:00.000+11:002013-12-17T22:30:57.589+11:00The final triumph<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi60V8Q0qW2PbEAkKivT-zhait7stHysBdxsUQ6lUG-bb_96EETnDsYGUVAHUPmncCecXn7YR9ZGGBRs2UHbGn52H3kOaqGJp6D6DQvXcDdZ8r9C1XlV1qGet-JpqUtgBN7xp3SPVMkTFq9/s1600/IMG_7017_small.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi60V8Q0qW2PbEAkKivT-zhait7stHysBdxsUQ6lUG-bb_96EETnDsYGUVAHUPmncCecXn7YR9ZGGBRs2UHbGn52H3kOaqGJp6D6DQvXcDdZ8r9C1XlV1qGet-JpqUtgBN7xp3SPVMkTFq9/s400/IMG_7017_small.jpg" width="400" /></a></div>
"Classic" companion cube.<br />
I love the idea that Portal is going to be a game that will be talked about hopefully forever, like Pong and Pacman.<br />
This one opens up to be a tiny container.<br />
I contemplated putting a note in there to start it off as a box of thoughts, but left it to the receiver to use in how she seen best.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-86813654661355632802013-11-13T15:30:00.000+11:002013-11-15T21:46:42.926+11:00Yet another birthday present<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNA-APu0cICE8RmC7yHPcKCUo4NbYoRo4dlPLM7qFfYl51UjImt8ybZbp9x6kY_fhgrjj8df8FOii7ERna3ck3GE15T4C9j_UchS9udHEwVeSayidy1F5SwLoDEqHRLpHGcA2M_ZbWMf23/s1600/IMG_7015_small.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNA-APu0cICE8RmC7yHPcKCUo4NbYoRo4dlPLM7qFfYl51UjImt8ybZbp9x6kY_fhgrjj8df8FOii7ERna3ck3GE15T4C9j_UchS9udHEwVeSayidy1F5SwLoDEqHRLpHGcA2M_ZbWMf23/s400/IMG_7015_small.jpg" width="400" /></a></div>
It was fun making <span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: 13px; line-height: 10.65625px;">Pokémon</span><span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: 13px; line-height: 10.65625px;"> so I made another one.</span><br />
<span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: 13px; line-height: 10.65625px;">It was a little bit dull since the colour scheme is very similar but I was getting better at printing the wings.</span>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-55340428333410712022013-11-11T14:00:00.000+11:002013-11-11T14:11:00.787+11:00Other breach of copyrightCould be posting more content to this blog.<br />
Not code but most people get a buzz out of it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUSZ6au4l1Qnt2Caf1_RUmMewlWeXfRKNV-WGiEGZ8GDLeHO-V9QZ3jOWt55T6LFeI54KScmMN99BYwxq30zj6C0gq8JwzXqYlAC8GEJCi0tTO3jJQuczlzXpAXBjz9WXqJRJZYTPnzc4t/s1600/IMG_7059_small.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUSZ6au4l1Qnt2Caf1_RUmMewlWeXfRKNV-WGiEGZ8GDLeHO-V9QZ3jOWt55T6LFeI54KScmMN99BYwxq30zj6C0gq8JwzXqYlAC8GEJCi0tTO3jJQuczlzXpAXBjz9WXqJRJZYTPnzc4t/s400/IMG_7059_small.jpg" width="400" /></a></div>
<br />
Starbug from Red Dwarf.<br />
This one lives at my house. Wanted more things on my shelf :)pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-37523841816636477772013-11-09T18:05:00.001+11:002013-11-09T18:29:16.332+11:00Breach of copyright?A while ago I bought a 3D printer with no specific purpose.<br />
It's come in handy a few times but it is more of a laugh than a useful toy at this point.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxvDkPyMTb0kmFKHuUgGKN_irLiGWqcTBErNdzBRO44nM6EUUHU7FZqdGpzdBnGhKwnSke7NI2ES1S0BIsAVVW-8KQB56P8bfVdaHBD1H9IPdtzqSdEbC4c0z97yqqKbDsP2nuvpqf1SN/s1600/IMG_7011_small.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxvDkPyMTb0kmFKHuUgGKN_irLiGWqcTBErNdzBRO44nM6EUUHU7FZqdGpzdBnGhKwnSke7NI2ES1S0BIsAVVW-8KQB56P8bfVdaHBD1H9IPdtzqSdEbC4c0z97yqqKbDsP2nuvpqf1SN/s640/IMG_7011_small.jpg" width="483" /></a></div>
Did this for a friend birthday though. It's obviously Dragonite from <span style="background-color: white; color: #444444; font-family: arial, sans-serif; line-height: 10.666666984558105px;">Pokémon and I have not asked permission to reproduce this model.</span><br />
<br />
Do I go to jail for this work or does he?<br />
<br />
Making this post as I've just stumbled upon <a href="http://www.creationistas.com/">http://www.creationistas.com</a> and believe it is important.<br />
<br />
-edit-<br />
Since my post was approved so quickly, thought I'd link directly to my post so the circle is complete: <a href="http://www.creationistas.com/bringing-2d-objects-to-life/">http://www.creationistas.com/bringing-2d-objects-to-life/</a>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-41660410268718900922013-09-23T16:00:00.002+10:002013-09-23T16:00:57.364+10:00A green capeTrying to take a picture of yourself can be hard.<br />
Love the challenge.<br />
I've added the new cape to the collection of capes page. Still need to do my blue basketball material one.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjURnQ7Bk8YLgEVGJto3Y1BVKpZWYs4Kafz2g8nf8AWLZiRTlt3QuXpvJT8-JuwDvd4d4HDIbOefDpOlbDUbLfy-dCUwQazuCBWZelGNS0bIkoPBASg0qNXbWSfyqfdGo5MbhaABu0xDV/s1600/IMG_7187_small.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjURnQ7Bk8YLgEVGJto3Y1BVKpZWYs4Kafz2g8nf8AWLZiRTlt3QuXpvJT8-JuwDvd4d4HDIbOefDpOlbDUbLfy-dCUwQazuCBWZelGNS0bIkoPBASg0qNXbWSfyqfdGo5MbhaABu0xDV/s1600/IMG_7187_small.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjURnQ7Bk8YLgEVGJto3Y1BVKpZWYs4Kafz2g8nf8AWLZiRTlt3QuXpvJT8-JuwDvd4d4HDIbOefDpOlbDUbLfy-dCUwQazuCBWZelGNS0bIkoPBASg0qNXbWSfyqfdGo5MbhaABu0xDV/s400/IMG_7187_small.jpg" width="365" /></a></div>
pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-31632857707068346572013-08-22T17:21:00.005+10:002013-08-22T17:21:49.970+10:00Minecraft got me onto githubI've been playing Minecraft for a long time now and I've always enjoyed knowing the fact it is written in Java. Things became interesting when I started playing with a friend on a private server. We hang out on Skype and basically make our own fun.<br />
<br />
The guy running the server felt a little out of his league and was struggling to keep up with updates. Always that frustrating balance of work and life.<br />
<br />
So I offered a hand. I've ran a few servers and I love looking after Java stuff.<br />
<br />
The first trick I needed to do was be able to set up a testing environment that wouldn't affect the people playing the game. Easy enough to use my little netbook. It took a little while to work out how to separate the server configuration from the server data but I managed to do it with a bukkit server. I think the main bit was moving the world data outside the home directory via world-container and launching the app with "-log-pattern ../minecraftData/server.log"<br />
<br />
We were using the <a href="https://github.com/gamerx/Backup">https://github.com/gamerx/Backup</a> plugin to take snapshots of the world but this plugin didn't recognise the world-container configuration. Was super simple to fork it at <a href="https://github.com/pimaster/Backup">https://github.com/pimaster/Backup</a>, build and deploy.<br />
<br />
I believe the changes have been pulled into gamerx's copy but a new version hasn't been released for such a minor change.<br />
<br />
dynamap took a lot more fiddling around trying to understand what it setup and expected.<br />
tilespath: ../../../minecraftData/dynmap/web/tiles<br />
webpath: ../../../minecraftData/dynmap/web<br />
I then copied some of the html that needed to be served into this directory so it knew how to server up the basic data. Fortunately it still looked in the plugins directory for some of the more dynamic resources.<br />
<br />
With this set, I was able to symlink the data directory to a directory in Dropbox. It meant the same configuration I was testing inside Eclipse was also used on my netbook. When I was happy with my testing, I used a diff application to move new settings and plugins to another folder in Dropbox that was synced the hosted server.<br />
<br />
I was in admin heaven :D<br />
<br />
Then came a request to have multiple worlds hosted by the same process. The requirement was we wanted people to be creative in some areas without the hassle of mobs but still be able to have the challenge of fighting of mobs without access to the creative tools.<br />
<br />
There were a couple of plugins that changed a players gamemode per world but none had the ability to remember a players state in a mixed world.<br />
So I wrote <a href="https://github.com/pimaster/GameModeRememberer">https://github.com/pimaster/GameModeRememberer</a>.<br />
Forces players into a game mode on some worlds.<br />
Remembers if a player has a certain game mode on others.<br />
Also has some basic inventory management when switching worlds.<br />
Need to work on enforcing certain rules in worlds. At the moment I believe a player in a survival world can be given resources from a player with operator status in creative worlds. Would be nice to stop this.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-46521534649898951122013-03-14T13:19:00.000+11:002013-03-14T13:19:05.195+11:00Building Browser PluginsYou know those moments when you are asked to build something that just cannot be done from a web app?<br />
Was asked how we could take a screen shot of a web page being viewed for annotation and review.<br />
<br />
The good thing being, this is what browser add ons are for.<br />
<br />
So I started with Chrome, being the browser most used after Internet Explorer.<br />
Took a little bit but finally got everything sorted.<br />
Was then able to take most of that knowledge and apply it to Firefox.<br />
Safari was meant to look stupidly simple, but it took me a while to work out that plugins weren't being activated on files served from the file system. Had to set up a http server :/<br />
<br />
You'll notice that I skipped IE even though it is the browser that sees the most use amongst the customers.<br />
That's because it doesn't have an add on system like the other browsers do.<br />
You have to build an add on that technically exists in the operating system and then targets the browser. I can't write javascript like I was for other browsers.<br />
<br />
<b>What did I take away from building the plugins?</b><br />
Chrome was the favourite. Building the plugins was rather easy. There is a clear path for reloading the plugin and bundling it for delivery. Documentation was good.<br />
<br />
Safari was the next easiest. Building the plugin was straight forward although I hated having the extra 'plugin builder' window open that is where I reloaded the plugin for. Filling out the details for the plugin via a UI is a very mac way of doing things. Documentation was a pain to navigate and sometimes missing some detail. Building the plugin for delivery was easy enough.<br />
<br />
Which leaves Firefox near the bottom of the list. You have to disable some caching options so that it always picks up the latest version of the plugin you are building. You also have to open a new window every time you want to reload your plugin which for me meant restarting Firefox for every change. Documentation was excellent though. Building the plugin for deployment was a little trickier than the others.<br />
<br />
At least I built add ons for those browsers. I just couldn't make it happen for IE.<br />
<br />
<b>Getting a grip on verbage.</b><br />
I keep wanting to use the word plug-in.<br />
Plugins are generally used for features like embedding the Flash player.<br />
Extension was sometimes used for other things as well, like supporting different image/video formats.<br />
Minor thing but annoying.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-17781409361687875032013-02-19T21:47:00.000+11:002013-02-19T21:48:30.242+11:00Drawing lines in the sandI don't think anyone reads this blog any more so I may as well put this here.<br />
<br />
I don't mind losing something I may never have had.<br />
My problem is with trusting someone whom maybe I shouldn't have trusted. Really thought I was past that.<br />
It would have been nice to find out if everything changed and maybe I just wasn't to trust her in the dying moments.<br />
<br />
I was terrified with the way you wanted to continue playing the game your way.<br />
<br />
12 years is a long time to not know someone.<br />
There were some fun moments but I was looking forward to discussing the bigger things in life with you.<br />
<br />
I like knowing why.<br />
I put all my eggs in one basket.<br />
I never want to be in a rush.<br />
I rarely have a backup plan.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-45072842159635484362013-02-01T16:34:00.005+11:002013-02-01T16:34:45.930+11:00Testing certficates on a serverJust been facing one of those problem where if you were dealing with it every day, you'd solve it in no time.<br />
On some of my browsers across my many machines, I was able to access my works https site without any warning of being an untrusted source.<br />
Firefox however, did not want to behave.<br />
<br />
Apparently a browser can optionally look up the intermediate certificate from the one the server provides. Obviously this sort of automatic trust can be a bit of a security issue.<br />
<br />
Finally found a site that did an independent test (wanted something automated and outside the network).<br />
<a href="https://www.wormly.com/">https://www.wormly.com</a><br />
Pointed out the problem and even gave a hint on how to fix it.<br />
Explained it to the network admin and he was able to track it down.pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-10157532577751553772012-11-14T10:11:00.002+11:002012-11-14T10:11:33.384+11:00Picture is worth 1000 wordsIt's funny when you compare API's.<br />
Java's drawImage method:<br />
<pre><span style="font-size: small;"><b>drawImage</b>(Image img, </span>
<span style="font-size: small;"> int dx1, int dy1, int dx2, int dy2, </span>
<span style="font-size: small;"> int sx1, int sy1, int sx2, int sy2, ImageObserver observer)</span></pre>
<span style="font-size: small;"><span style="font-size: small;">Javascript drawImage:</span></span><br />
<span style="font-size: small;"><span style="font-size: small;"><b>drawImage</b>(img, sx, sy, sw, sh, dx, dy, dw, dh)</span></span><br />
<br />
<span style="font-size: small;"><span style="font-size: small;">Wi<span style="font-size: small;">th Java your focus is on the destination first and then where you are reading the information from.</span></span></span><br />
<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">With Javascript, you grab some part of an image and put i<span style="font-size: small;">t <span style="font-size: small;">onto the canvas.</span></span></span></span></span></span><br />
<br />
<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">I found that working w<span style="font-size: small;">ith the width and heigh<span style="font-size: small;">t easier as well instead of doing things like<span style="font-size: small;"> "x + width"</span></span></span> all the time.</span></span></span></span></span></span><br />
<br />
<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">When I was trying to get it right though, seems I was trying to be too creative.</span></span></span></span></span></span><br />
<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">Found a <a href="http://www.html5canvastutorials.com/tutorials/html5-canvas-image-crop/">site</a> with a nice image explaining the situation though: </span></span></span></span> </span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.html5canvastutorials.com/demos/tutorials/html5-canvas-image-crop/html5-canvas-image-crop-diagram.png" imageanchor="1" style="margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://www.html5canvastutorials.com/demos/tutorials/html5-canvas-image-crop/html5-canvas-image-crop-diagram.png" /></a></div>
<span style="font-size: small;">
Props to the guys for making it look easy.</span>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-85162561125173850062012-11-13T16:09:00.001+11:002012-11-13T16:09:33.750+11:00Chrome captureVisibleTab and the CanvasWriting a browser plugin at work to capture what is being displayed in the current tab.<br />
Was originally looking at cool Javascript -> Canvas -> Image processors like <a href="http://html2canvas.hertzen.com/">http://html2canvas.hertzen.com/</a> but it just wasn't going to cut the cake.<br />
<br />
Chrome has a lovely call chrome.tabs.captureVisibleTab that just gave me what I wanted.<br />
Mocked up something simple to do a round trip to our server and I was good to go.<br />
<br />
Started working on the problem and it was obvious that I needed to crop the image before sending it to the server. Not a problem. I knew Canvas had a drawImage method that allowed cropping and scaling and I was happy to read from the Chrome documentation that the image data "may be assigned to the 'src' property of an HTML Image element for display."<br />
<br />
After writing the code to create the new image, do some cropping, passing messages between different layers in the extension I was ready for testing.<br />
After some initial PEBKAC issues like not supplying enough parameters to drawImage, I was just ending up with a white image.<br />
Hmmmm.<br />
So I drew a box on my canvas to make sure I was passing the right image back to the server.<br />
Finally got that working so I started stressing. What is with the drawImage method?<br />
<br />
Was making smaller and smaller changes and constantly reloading the plugin and the page I was testing from and then one time, I told it to capture a second time.<br />
<br />
Only when it fired the second time did it work.<br />
<br />
So straight to google to find concerning messages like <a href="http://stackoverflow.com/questions/3850312/canvas-drawimage-doesnt-draw-images-the-first-time">drawImage doesn't draw the first time</a>.<br />
It seems that even when the image is generated from a canvas, I was still required to wait for the image element to load.<br />
<br />
So for the whole purpose of posting some demo code:<br />
<br />
<br /><span style="font-family: "Courier New",Courier,monospace;"> chrome.windows.getCurrent(function(win)<br /> {<br /> chrome.tabs.captureVisibleTab(<br /> null, null, function(data) <br /> {<br /> var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'html:canvas')<br /> var image = new Image(800,600);<br /> var context = canvas.getContext('2d');<br /> canvas.width = 800;<br /> canvas.height = 600;<br /> image.onload = function() {<br /> context.drawImage(image, 0, 0); // Obviously cropping goes here<br /> var sender = new XMLHttpRequest();<br /> sender.open("POST", <<some url>>, false);<br /> var cropped = canvas.toDataURL('image/jpg', 90)<br /> sender.send(cropped.substring(cropped.indexOf(',')));<br /> }<br /> image.src = data;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> });<br /> });</span><br />
<br />
Hooray for code on a code blog \o/ pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com2tag:blogger.com,1999:blog-8329450844123470160.post-16634059327589735652012-09-16T11:56:00.001+10:002012-11-10T15:54:47.688+11:00Really loving my cameraI know it isn't always about the camera<br />
(Wow, how did blogger lose this image?)<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
I know the subjects aren't particularly unique.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sphotos-g.ak.fbcdn.net/hphotos-ak-ash3/546390_4077229083566_1175354558_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://sphotos-g.ak.fbcdn.net/hphotos-ak-ash3/546390_4077229083566_1175354558_n.jpg" width="400" /></a></div>
But I love sharing some of my shots.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-snc7/424632_4077228083541_1711631149_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="http://sphotos-f.ak.fbcdn.net/hphotos-ak-snc7/424632_4077228083541_1711631149_n.jpg" width="400" /></a></div>
<br />pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-31608623727056915332012-05-24T19:09:00.002+10:002012-05-24T20:15:05.756+10:00Today I wrote a Braille ConverterAs just a bit of a laugh, I wrote my Facebook status in morse code.<br />
After someone thought it was braille, I thought that doing a status in braille was a good idea.<br />
<br />
Except there were no converters that I could copy and paste the characters from, so I had to do it on the fly.
<br />
<br />
Since I am a coder though, I really should code my own solution.<br />
<a href="http://pmaster.customer.netspace.net.au/snippets/BrailleConverter.html">Braille Converter!!</a><br />
Feel like this is the sort of thing I could almost start a github account for.<br />
<br />
I was going to throw it straight onto this blog but I can't control the encoding of the page, so the UTF-8 characters got lost.<br />
<br />
Hooray for coding!!<br />
<br />
-- edit --<br />
Seems I've got an encoding issue in Chrome anyway //.opimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-32752142336349222732011-09-09T19:35:00.000+10:002011-09-09T19:35:36.295+10:00Drive out to MarysvilleJust wanted to go for another drive and managed to get caught in the snow.
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi72cpjqbdDLK0SZYFLIHzghlgfu6tVG9Dy0ZFnAalPFZGUx47Nbl58DqcL-Hdtq8g_WHvq13ox8MW3r3VdZqZY5D-Wcp0Aulyb17MqV-nWB_jFZflR9orc0wJgQOKMKTU4KhBiHtU1fRCq/s1600/IMG_1826_tiny.jpg" />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTd6bwkae03M1wkqdoiCtjG57Y1mZfdEqBT8ONQKapGFdBwfiPFiRUHu2xHQpuL8JpPUrkkdzkh18emmGPzQ6nShYhaIiG78FxxU_5J9h65erKu9txYl6WULhBbf6e0Fepnx6Oo3uTA0ka/s1600/IMG_1840_tiny.jpg" />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaHOCiacworMrhcTmh34JreRntnPmWaUQ44l3H8DPKbLWQm8VXuZxpS3ArWGwy-Oak1Glykqly_mSbZF5VnE86s1mFmwl5vPeUUEqZZh8_htiGeXMzoV-7isfe-NJmVRC4jeTL6QDx-rau/s1600/IMG_1850_tiny.jpg" />
pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-77107492788921401192011-08-27T09:00:00.001+10:002011-08-27T09:00:02.619+10:00Don't go chasing waterfalls?Well, that's what I did today...<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPGu-6oujhVdIL_oLfVE9UVkLRP4Tjlt0JYbWQ2z2LbGeLQrMK_EUsuJcq4W8zXAqR0Ngk5IyPv_F2_YT6B4jPJQDfDSTcwV0Ra4DyQQptSdNePZyo-FrfcSfNZf0NtDCLrKMEAf4XAIpj/s1600/IMG_1777_tiny.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPGu-6oujhVdIL_oLfVE9UVkLRP4Tjlt0JYbWQ2z2LbGeLQrMK_EUsuJcq4W8zXAqR0Ngk5IyPv_F2_YT6B4jPJQDfDSTcwV0Ra4DyQQptSdNePZyo-FrfcSfNZf0NtDCLrKMEAf4XAIpj/s1600/IMG_1777_tiny.jpg" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-G6YgXxTnDDsSSrAuvkRdQuTxJwH70k2koLF4JUIsZnAVWyYkOxUNySaRK36b9Wyw175MO9imFlQor_CQD4tl-6H3560eD3I6fI_FKrVmdvXXBj_V8D5y_jBeqxjUTefXit2Iqa9KqtWH/s1600/IMG_1787_tiny.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-G6YgXxTnDDsSSrAuvkRdQuTxJwH70k2koLF4JUIsZnAVWyYkOxUNySaRK36b9Wyw175MO9imFlQor_CQD4tl-6H3560eD3I6fI_FKrVmdvXXBj_V8D5y_jBeqxjUTefXit2Iqa9KqtWH/s1600/IMG_1787_tiny.jpg" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdsDPSX0X7u1aY_Iw8PleS1K34TKLZz9gz1c17KwT4eIqxKErNBPOiqVLkxTVpTvyzbutxxZ4e9J73cocQffUYTKVYPIuXQrZ46u3_sbCL6P16i9q8MpgsQwzKEBoAVrfHj8pApqXbs3J/s1600/IMG_1791_tiny.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdsDPSX0X7u1aY_Iw8PleS1K34TKLZz9gz1c17KwT4eIqxKErNBPOiqVLkxTVpTvyzbutxxZ4e9J73cocQffUYTKVYPIuXQrZ46u3_sbCL6P16i9q8MpgsQwzKEBoAVrfHj8pApqXbs3J/s1600/IMG_1791_tiny.jpg" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_5IhWhOimXrwT2IitZNGO-Qq8L6lfr10du6RyEjhADhFhfZvEr2jGLA6Ln_QQ51NXfAyOYw1iVOG2XPNJNkLSLZcQMjEElrK5r6ghJhU7x9Eae9yRMC8TPqF5YYZhcbucSiPHSHq8EELW/s1600/IMG_1794_tiny.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_5IhWhOimXrwT2IitZNGO-Qq8L6lfr10du6RyEjhADhFhfZvEr2jGLA6Ln_QQ51NXfAyOYw1iVOG2XPNJNkLSLZcQMjEElrK5r6ghJhU7x9Eae9yRMC8TPqF5YYZhcbucSiPHSHq8EELW/s1600/IMG_1794_tiny.jpg" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqbYoB1eOPToJnSHRSSCITKehqF_7nVujQq2dX7txK-XybTYuzdtek9eO1cHxNI79H-yar6YI1jlonKUNWAqKlrYIzD6jD-TkyJWRv7FkhzoSo8vGFwsZNSlwlrLx_Ltrq3R_H3Bp9UdPQ/s1600/IMG_1821_tiny.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqbYoB1eOPToJnSHRSSCITKehqF_7nVujQq2dX7txK-XybTYuzdtek9eO1cHxNI79H-yar6YI1jlonKUNWAqKlrYIzD6jD-TkyJWRv7FkhzoSo8vGFwsZNSlwlrLx_Ltrq3R_H3Bp9UdPQ/s1600/IMG_1821_tiny.jpg" /></a></div><br />
pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0tag:blogger.com,1999:blog-8329450844123470160.post-41400819321148261182011-08-25T17:52:00.000+10:002011-08-25T17:52:38.280+10:00Non sequential sequenceEvery now and then I've wanted to go from 0 to n in almost a random fashion. One way to solve this problem is to create a list of all the numbers from 0 to n and then shuffle the list. This works for small numbers and is definitely random but what if you have a larger set of numbers and aren't so fussed about the randomness?<br />
<br />
I was finally able to enter the right terms into my search engine to read up on <a href="http://en.wikipedia.org/wiki/Linear_feedback_shift_register">linear feedback shift registers</a>.<br />
I had a quick peek around the net to see if there was one written in Java and came up empty handed. So I wrote one.<br />
A quick & on the input to get the bits we were concerned with, >> to shift the bits and ^ the relevant bits to work out if I should stick a 1 on the high order bit.<br />
Turns out that was a bit overkill, just needed to know if the amount of relevant bits was even or odd. If odd, add the high order bit (and shift the whole lot of course).<br />
<br />
<pre> if(Integer.bitCount((input & trap) ^ trap) % 2 == 1)
{
return (input >> 1) | (1 << bits - 1);
}
else
{
return input >> 1;
}
</pre><br />
The interesting bit was the values for the taps based on the number of bits in the 'register' you want.<br />
The Wikipedia article says that for a LFSR to cycle through all numbers, there needs to be an even number of taps, the set of taps needs to be relatively prime.<br />
Not being up with the maths of that last bit, I delved deeper into Wikipedia.<br />
<br />
Then I realised I had the tools to brute force this puppy. Create a number of LFSR with different tap values and see which ones cycle through all numbers!<br />
<br />
<table border="1px" style="text-align: right;"><tbody>
<tr> <th>Size</th> <th>Taps</th> </tr>
<tr> <td>3</td> <td>11<br />
101</td> </tr>
<tr> <td>4</td> <td>11<br />
1001</td> </tr>
<tr> <td>5</td> <td>11<br />
1001<br />
1111<br />
10111<br />
11011<br />
11101</td> </tr>
<tr> <td>6</td> <td>11<br />
11011<br />
100001<br />
100111<br />
101101<br />
110011</td> </tr>
</tbody></table>This table starts to look like 3 is a good number to use, but it doesn't work for 8, 9, 10 and 11 bit registers. So unfortunately to get a good sequence of numbers, you need to know a good tap. I just haven't worked out a nice way to find out what they are.<br />
Might as well include a table of the numbers generated by the different taps. I'll use a 5 bit register because of the multiple taps.<br />
<table border="1px" style="text-align: right;"><tbody>
<tr> <td>101</td> <td>16</td> <td>8</td> <td>4</td> <td>18</td> <td>9</td> <td>20</td> <td>26</td> <td>13</td> <td>6</td> <td>19</td> <td>25</td> <td>28</td> <td>30</td> <td>31</td> <td>15</td> <td>7</td> <td>3</td> <td>17</td> <td>24</td> <td>12</td> <td>22</td> <td>27</td> <td>29</td> <td>14</td> <td>23</td> <td>11</td> <td>21</td> <td>10</td> <td>5</td> <td>2</td> <td>1</td> </tr>
<tr> <td>1001</td> <td>16</td> <td>8</td> <td>20</td> <td>10</td> <td>21</td> <td>26</td> <td>29</td> <td>14</td> <td>23</td> <td>27</td> <td>13</td> <td>6</td> <td>3</td> <td>17</td> <td>24</td> <td>28</td> <td>30</td> <td>31</td> <td>15</td> <td>7</td> <td>19</td> <td>25</td> <td>12</td> <td>22</td> <td>11</td> <td>5</td> <td>18</td> <td>9</td> <td>4</td> <td>2</td> <td>1</td> </tr>
<tr> <td>1111</td> <td>16</td> <td>8</td> <td>20</td> <td>26</td> <td>13</td> <td>22</td> <td>11</td> <td>21</td> <td>10</td> <td>5</td> <td>2</td> <td>17</td> <td>24</td> <td>28</td> <td>14</td> <td>23</td> <td>27</td> <td>29</td> <td>30</td> <td>31</td> <td>15</td> <td>7</td> <td>19</td> <td>9</td> <td>4</td> <td>18</td> <td>25</td> <td>12</td> <td>6</td> <td>3</td> <td>1</td> </tr>
<tr> <td>10111</td> <td>16</td> <td>24</td> <td>28</td> <td>14</td> <td>7</td> <td>19</td> <td>25</td> <td>12</td> <td>22</td> <td>27</td> <td>29</td> <td>30</td> <td>31</td> <td>15</td> <td>23</td> <td>11</td> <td>5</td> <td>2</td> <td>17</td> <td>8</td> <td>4</td> <td>18</td> <td>9</td> <td>20</td> <td>10</td> <td>21</td> <td>26</td> <td>13</td> <td>6</td> <td>3</td> <td>1</td> </tr>
<tr> <td>11011</td> <td>16</td> <td>24</td> <td>12</td> <td>22</td> <td>11</td> <td>21</td> <td>10</td> <td>5</td> <td>18</td> <td>9</td> <td>4</td> <td>2</td> <td>17</td> <td>8</td> <td>20</td> <td>26</td> <td>29</td> <td>30</td> <td>31</td> <td>15</td> <td>23</td> <td>27</td> <td>13</td> <td>6</td> <td>19</td> <td>25</td> <td>28</td> <td>14</td> <td>7</td> <td>3</td> <td>1</td> </tr>
<tr> <td>11101</td> <td>16</td> <td>24</td> <td>12</td> <td>6</td> <td>19</td> <td>9</td> <td>4</td> <td>18</td> <td>25</td> <td>28</td> <td>30</td> <td>31</td> <td>15</td> <td>23</td> <td>27</td> <td>29</td> <td>14</td> <td>7</td> <td>3</td> <td>17</td> <td>8</td> <td>20</td> <td>10</td> <td>21</td> <td>26</td> <td>13</td> <td>22</td> <td>11</td> <td>5</td> <td>2</td> <td>1</td> </tr>
</tbody></table><br />
<div>*In my code I refer to traps. Miss read the wiki :P</div>pimasterhttp://www.blogger.com/profile/07971894964100503498noreply@blogger.com0