jbanana: Badly drawn banana (Default)
I was looking at the Shard from my office window. It occurred to me that a tall thin pyramid is a silly shape for a building.

Cuboid volume: length × width × height
Pyramid volume: length × width × height ÷ 3

So the Shard is three times the height it needs to be for its floor space, if only the walls didn't lean inwards.

(OK, not quite, because the top few floors are an empty "spire", but they're small so it doesn't make much difference.)
jbanana: Badly drawn banana (Default)
I posted before about what's wrong with elections. I think that I got it wrong. The real problem is the candidates (and therefore the selection process). Everyone in the world thinks it's mad to let Trump anywhere near an election, but Clinton's approval ratings are poor. So Americans will be choosing between the crazy bloke and the woman they dislike. WTF?

Less distressingly, in the last US presidential election straight people were split down the middle (if we believe the Wikipedia stats) so it was the gay, lesbian and bisexual vote that won Obama a second term.
jbanana: Badly drawn banana (Default)
I have some annoying software that switches off the Windows option "Show window contents while dragging". That means that dragging a window just moves an outline, and the window only moves when you drop the outline. That's grim. You can switch this option in Control Panel. That's a bunch of clicks, and it'll get switched back later. Grr!

Siva Mulpuru knows enough Powershell to fix a similar setting (thanks, Google) so I borrowed that code and fixed it up to do what I wanted.
$setwindowsdragfull = @"
using System.Runtime.InteropServices;
public class dragfixer
	[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
	private static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni);
	public static void SetDragFullWindows ()
		SystemParametersInfo( 0x0025, 1, "", 0x03 );
Add-Type -TypeDefinition $setwindowsdragfull
Then I had to figure out how to run a Powershell script. This seems to work.
@powershell -executionpolicy bypass -File SetDragFullWindows.ps1
Then I can put an icon somewhere handy and click the annoyance away.
jbanana: Badly drawn banana (Default)
Today I forgot the most important rule of meetings: don't go in to a meeting if you think you might need to pee. Eventually I had to bail, and that never looks good.

Edit: by "bail" I meant "leave the meeting", not "scoop out liquids". Just in case you were wondering.
jbanana: Badly drawn banana (Default)
I got fed up with the font rendering in Vivaldi (shame - nice browser, but stuffed by upstream changes to Chromium).

I used to use SeaMonkey a lot, so I tried that again, and found that I could fix most of its annoyances. The addons I needed were:
  • Adblock Plus

  • Dorando keyconfig (the only way I could find to add a second key that also opens a tab was: "BrowserOpenTab();")

  • Ghostery

  • Mouse Gestures Suite

  • "Shift+LeftClick opens links in a new active tab" (delightfully named)

  • Speed Start

  • Tab Clicking Options (had to hack this one to make it work with the latest SeaMonkey, but only to change the compatibility labelling!)

  • True Full Screen

  • Undo Close Tab Button

  • British English Dictionary

There are still a few things bothering me:
  • Can't put tabs at the bottom

  • Single key shortcuts (can't stop pressing 6 to reset the zoom!)

  • Side bar pops up whenever I search from the right-click menu Edit: in the side bar, you can switch off the search tab!

  • Tab tiling (but I can work round that easily enough)
jbanana: Badly drawn banana (Default)
Here are some people who make me feel good. It's not an exhaustive list.

Click to embiggen
jbanana: Badly drawn banana (Default)
Here are two things that annoy me.
  1. Sometimes someone asks me a question and I answer, but only later it becomes clear that they were really asking something else, which bugs me no end.
    What time is it?
    Half past twelve
    Long pause where they feel hurt that I didn't realise that they wanted us to go for lunch...

  2. Sometimes when I ask a question, it's completely obvious that there's a reason for asking it, so I don't say that part, but the other person completely misses the point.
    What time is it?
    Half past twelve
    Long pause where I feel hurt that they didn't realise that I wanted us to go for lunch...
jbanana: Badly drawn banana (Default)
When Blackberries were popular, people called them Crackberries because the users spent so much time on them. Now that's just phones.
jbanana: Badly drawn banana (Default)
The command prompt in Unix/Linux has always let you do fancy stuff. For example, here's one way to edit all the Java code that contains "someSearchString":
find . -name "*.java" -exec grep -q "someSearchString" '{}' \; -exec someEditor '{}' \;
On Windows, the command prompt is less rubbish than used to be. Here's one way to do the same task:
for /f "tokens=*" %G in ('dir /s /b *.java') do @((type %G | find "someSearchString") && someEditor %G)
I like the way that both examples use find but it means something completely different.

Edit: one obvious difference: the *nix version ill search for a regex, but Windows will only do plain text
jbanana: Badly drawn banana (Default)
A man near me was sitting doing not much. Suddenly he leaned forward to his bag, took out a belt, and put it on. Why?

Did he think his trousers would fall down when he stood up? He'd got to his seat without mishap.
Did he just like wearing an unnecessary belt? He'd put the belt in his bag instead of round his waist.

When he'd got the belt on, he carried on doing not much.
jbanana: Badly drawn banana (Default)
I prefer web mail, but I'm currently forced to use Outlook, a bizarre and Byzantine behemoth* that frustrates me if I try anything beyond "write message" and "read message". Worst of all is the search, which often doesn't find things that are definitely there, and doesn't understand "quotes means phrase search".

But I found how to make it work: obscure words. I have a long-running email chain with the word "putative" in the subject, and Outlook finds those messages easily and quickly. So when you send a new message, get your thesaurus out.

*Apologies about annoying alliteration.


Mar. 17th, 2016 12:17 pm
jbanana: Badly drawn banana (Default)
I found this on a packet of tea:
The sun streams in through the window. Rain beats down on the roof. Wind rustles through the trees. Or a blanket of snow waits outside.

Whatever you wake up to, pop the kettle on and drink in the day.
Quite poetic for marketing blurb.
jbanana: Badly drawn banana (Default)
I was trying to get my head round Java 8 streams. Here's a typical example:
List<Integer> transactionsIds = transactions.stream()
         .filter(t -> t.getType() == Transaction.GROCERY)
"Get the grocery transactions, largest value first, and tell me their IDs."

So this seems cool, and you can make a stream parallel, so it might be a good way to implement a lot of things.

The lightbulb came on when I realised that you can only apply a predefined set of operations. The thing you're calling methods on is the stream, not the contents. So you might be able to re-write existing code in terms of filter, map, etc. but you can't just drop an existing chunk of code into a stream and get magic.
jbanana: Badly drawn banana (Default)
"If you make it publicly available, everyone can see it."
Well... yes.
jbanana: Badly drawn banana (Default)
Traditional: EventQueue.invokeLater(new Runnable(){@Override public void run(){doThings();}});
Hmm - lots of syntax to get those things done later.

Lambda style: EventQueue.invokeLater(()->doThings());
Nicer (but identical).

When you make a lambda in Java, it's an anonymous instance of some interface. But how does it know which interface? It matters, because the lambda has to have the right params, and it has to implement the right method (even though you didn't say what the method was).

Duh, stupid! The compiler figures it out from the context. "I need a Runnable here, so that's what this lambda must be." And now I'm not thinking "How can this possibly work?"

Edit: usual excellent stuff on the basics of this from Jenkov
jbanana: Badly drawn banana (Default)
Most of the time, software issues are about understanding the problem well enough and writing some clean code. It's unusual to have to deal with difficult problems, but there are some well known hard things.

Lots of people would include concurrency because it's so easy to get it wrong, but I don't think that that makes it intrinsically difficult.
jbanana: Badly drawn banana (Default)
This is a nice idea, but I'm not sure if it will succeed. Everywhere in the world can be located by three words. Similar addresses are purposely far apart: There are probably several 3m squares that cover where you live, so you get some choice about your three words.

Edit: Not sure why I find this so amusing...

Edit 2:

Edit 3:

Edit 4:

Edit 5:

Edit 6: I found a pumpkin carving party in the Caucasus Mountains nowhere near anywhere, and a scout slumber party in Kazakhstan.
jbanana: Badly drawn banana (Default)
Remember my UI generator, Compositor, that I mentioned before? Never mind. 8~)

I released a new version today: http://sourceforge.net/projects/compositor/files/0.4/
jbanana: Badly drawn banana (Default)
I had fun today. We had a problem on our live servers. An end user reported it. It hadn't been noticed by the developer, the code reviewer, the QA team, or the acceptance testers.

Why was it fun? Because just for once, we get to do fix-it-now, fly-by-the-seat-or-your-pants work. There's no lead time, no meetings, no prioritisation. "Find out what's wrong and fix it today."

Tomorrow, back to dull production line normal.
jbanana: Badly drawn banana (Default)
I downloaded a new version of Semagic today. There hasn't been a new version for years, so while I was downloading, I had a poke around and found a graph of Semagic downloads over time. It's basically tailed off to nothing.

Of course, if anything I wrote was to get the number of downloads I just called "nothing", I'd be astonished.
Page generated Oct. 28th, 2016 05:42 pm
Powered by Dreamwidth Studios