Tuesday, 6 December 2011

Audible .aa files to mp3.

If you have need of converting an Audible .aa (that's file format 4) into an mp3 or similar (because you can't find anywhere that sells the thing DRM free):
i)  You'll find plenty of shareware apps that claim to be able to do it (like SoundTaxi and TuneConvert) and (a) it looks like they can if you want to pay the price (or they'll only do 90 seconds), and (b) they all look like they're by the same people / based on the same stuff.
ii)  Alternatively, if you're more cheapskate (in my case I only wanted to convert a single file) then there's a post from 2007 that (if you persevere with getting the Visual C++ DLL installed on Windows 7 64 bit) still seems to more or less work:   http://forums.afterdawn.com/thread_view.cfm/589613

I didn't want to install iTunes and try to burn to CD then re-rip.   [I dislike iTunes, though frankly that route would have been less system-invasive than the stuff I ended up doing.]

Tuesday, 21 June 2011

Excel-form-controls-aaaargh!

Excel 2007.
I worked out how to put form-controls on a spreadsheet. Combo Boxes.
(Ain't the ribbon lovely? You're looking for the (hidden, IIRC) Developer ribbon....)

I worked out how to put some options in the Combobox (henceforth ddlb) using a range as the source.
I worked out how to attach a macro to execute on-change. Then in the code, I want to get the text in the box.
Minutes passed as I failed to work it out using autocomplete. I googled. Hours passed as I continued to fail.
Can it really possibly be as convoluted as I've made it?
Anyway, I bring you (me) a solution using the now-hidden / obsolete DropDowns property...



Function GetDDLBText(controlname As String) As String
Dim wsheet As Worksheet
Set wsheet = ThisWorkbook.Worksheets("")
Set allDropDowns = wsheet.DropDowns
Dim ddlb As DropDown
Set ddlb = allDropDowns(controlname)
If ddlb Is Nothing Then
GetDDLBText = ""
MsgBox ("Trapped error - control named '" & controlname & "' is not found.")
Exit Function
End If
GetDDLBText = "" ' default to this.
If ddlb.ListIndex > 0 Then
GetDDLBText = ddlb.List(ddlb.ListIndex)
End If
Exit Function
End Function

Wednesday, 16 February 2011

And then for Oracle HTTP Server...

I needed to put APEX (Application Express), version 3.2.1, on this same CentOS box.
I followed the installation instructions (for 3.2) found over at Oracle, then needed the HTTP server.
This is on the 10g database companion CD. Installing that went finely (once I'd decided to install it into a different home from the database) until one of the configuration-wizard steps failed.
The log pointed me to another (httpd) log, which said libdb.so.2 was missing.
The solution to that is to run:
ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2
and then retry the configuration-step.


Friday, 11 February 2011

Centos 5.5 x86-64 and Oracle 10g Enterprise 10.2.0.1 64bit

Installing the full caboodle, on a VMWare VM as it happens.
Having installed a Server + ServerGUI version of CentOS via the net install, I moved onto the Oracle stuff.

I followed all - okay, most - of the prerequisite steps apparently required. (As documented here.)
Mostly, I didn't do the checking of required packages.

I finally got to the point where I could run the installer - which I seem to recall required having done a
yum install libXp
and then running the installer (from a terminal while logged into X as the oracle user) as
./runInstaller -ignoreSysPrereqs (was it?)

It failed with several errors at the linking stage.
More or less, I then ran the following and tried again (having done an rm -Rf on the couple of failed-install directories beneath the ORACLE_BASE).

yum install gcc
yum install glibc-devel.i386
yum install *compat-gcc-34.x*
yum install *compat-gcc-34-c++*
yum install *gdb.x86*
yum install unixODBC-devel.i386
yum install *gcc-c++*
yum install elfutils-libelf-devel-static*
yum install sysstat
yum install libaio-devel.x86_64
yum install ibtermcap-devel.x86_64
yum install readline-devel.x86_64
yum install libaio-devel*
yum install compat-db.x86_64
yum install libstdc++-devel.i386
ln -s /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.5

...and that time it worked! (BTW, this was using "file storage" for the database.)

Friday, 18 September 2009

orangemms + orangeinternet = ...

Recently got a Samsung Galaxy i7500. Android phone. Bought off German Ebay.
I'm with Orange UK. I'd managed to configure my old SEK800i to work for internet browsing and with MMS, but I think I'd setup separate entries for the two usual Orange APNs of orangeinternet and orangemms.
Anyway, I think I've just managed to merge the two on my i7500: I'm getting 'net access and I've received (and apparently just managed to send) an MMS.

So:
Under Settings / Wireless Controls / Mobile Networks / Access Point Names,
create a new APN.

Name: orange internet
APN: orangeinternet
Proxy: <Not set>
Port: <Not set>
Username: <Not set>
Password: <Not set>
Server: <Not set>
MMSC: http://mms.orange.co.uk
MMS proxy: 192.168.224.10
MMS port: 8080
MCC: 234
MNC: 33
APN type: Internet + mms
Authentication Type: Normal(PAP)

Don't forget to Save.
(I accidentally rebooted the phone after I'd done that swapping my SIM back in from the SEK800i.)

You're welcome!

Friday, 7 August 2009

Trojan Alert!

[This happened a couple of weeks ago. I've been "clean" ever since.]

I'm kind of confused as to exactly what my laptop was infected with, but I noticed that my laptop was smtp-ing mails all over the place (but mostly to Russia).
[I only noticed because I have a somewhat peculiar locally-running-my-own-smtp-server email setup - and whatever had infected me had determined that server to be a suitable relay for the odd message.]

Anyway, the obvious symptom was that the absolutely real services.exe process was connecting on port-25 and sending mail. (Lots of connections seen via "netstat -ao".)

I noticed that my hosts file had been tampered with; the often-dependable spybot-s&d found a few things (including sdra64.exe, IIRC) and then malwarebytes' anti-malware told me sysdiag.dll and ipcmd.dll (in system32) were problems and got rid of those for me.
[Microsoft's/SysInternals' ProcessExplorer showed me that those DLLs were infact what was being loaded up into the services.exe process to send the mail.]
AdAware and some other thing starting with super (superspyware-something or other?) didn't find anything. McAfee was finding nothing (and never found anything, even after I'd manually updated it to the should-have-been-auto-updating-but-was-actually-failing new version) - until after I'd uploaded sysdiag.dll to webimmune.net and got a patch file.
Online virus-scanners showed that maybe 20% of the products they used detected these DLLs were malicious at all - and none of the products seemed to agree on a problem-name.

I thought I was clean at that point. But no - after a while the DLLs were trying to come back. (With the patch applied, McAfee was blocking them - every half an hour or so.)

I'd googled and found a few references to some of these files, but none of the problem-descriptions really tallied with the problem I had. (Which was lucky, because by most accounts if I'd got these files on my system then I'd got some completely incurable virus!)

I was getting close to deciding to reinstall Windows - I'd wasted a couple of days on this and my project deadline wasn't exactly getting further away.

Anyway, I continued throwing all the (now varying) dll names that McAfee was warning me about into Google and the only web page that was consistently coming up was somewhere under prevx.com. It didn't give much detail (and I was even a little suspicious that it wasn't just a scare-ware site, given that their product seemed to cost) but after searching for a little comfort on PrevX I downloaded the "trial" product and ran a scan.

Lo! Four minutes later and this program's quick little scan revealed problems that hours of scanning with McAfee and all the other spyware progs I could find had got nowhere near. Rather marketingly-cleverly, the prog does the scan for free and then makes you pay for (most) removals. I paid up the 20 quid for a year's subscription.

Rather quickly, cleanly and successfully, Prevx3 sorted out my machine for me.

Now as a general rule I dislike paying for software. (In case you were wondering, this means either work pays, or I try to get away with free / open-source stuff - and not that I'm into nicking it. I'm not into the piracy angle - I do figure if it's that indispensible to me then I should buy it and reward someone for their efforts.)

It's probably something to do with having spent two frustrating days getting to the point, but I'm actually finding myself feeling proud and clever to have shelled out (my own money!) for prevx - and I think it's such a sleek and effective bit of software that I'm happy to recommend you pay for it too!

I've since seen some excellent support being offered on some forum or other and they also have a they'll-remotely-fix-your-machine and/or a give-you-your-money-back-guarantee too. So when the other (free) tools aren't doing it for you, let prevx have a quick look and then decide if a quick result is worth a few dollars/quid/euros to you...

Wednesday, 13 May 2009

Which control lost the focus?

Sometimes underneath all the abstraction that is the .Net framework, they take away stuff that you really want to know. My requirement was essentially that, for a load of textboxes on a Windows Form, when the user clicks on the one-and-only command-button I needed to know which control/textbox had the focus before the button was clicked.
Clearly I could manually code things in the OnLostFocus/OnLeave methods, or listen for LostFocus or Leave events on each of the controls, but that seemed like plenty of work and plenty ugly. (After all, I'm only interested when the user clicks on the button and the button's GetFocus / Enter events fire, so this functionality should belong to the button, right?)

The "Win32" event which the .Net framework is massaging into its own events does provide the control that's losing focus, apparently. And you can override the framework method, WndProc, that's way up the stack there somewhere.

Anyway, I'm working in vb.net at the moment so I've come up with something like what's below...
(I haven't necessarily worked out all the foibles, but it's certainly doing the basic job. I also haven't bothered synchronising access to the PreviousControl property - can't see when that's going to cause me an issue, but YMMV. BTW, Google tells me Microsoft Access had a PreviousControl property... hence the name.)

Public Class ButtonThatTracksPreviousFocus
Inherits Button

''' <summary>
''' This PreviousControl property holds the last control that was known to have focus before this button
''' received the focus. Note that where this button has the focus on an inactive window, when the parent
''' window activates the PreviousControl will end up being the last control to have focus on the
''' other form, it seems.
''' </summary>
''' <remarks></remarks>
Private _previousControl As Control

Public Property PreviousControl() As Control
Get
Return _previousControl
End Get
Set(ByVal value As Control)
_previousControl = value
End Set
End Property


Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

' First check to see if this message is related to our gaining focus. If it is, make a note of the
' window / control that's losing it.

If m.Msg = 7 Then 'This is the WM_SETFOCUS message (which tells us in WParam the "window" that's losing focus)
Try
' We don't expect errors, but in the event that we get them we can simply assume we couldn't
' find the control and otherwise ignore.
If Not IntPtr.Zero.Equals(m.WParam) Then
Dim ctrl As Control = Control.FromHandle(m.WParam)
If Not ctrl Is Nothing AndAlso Not (ctrl.Equals(Me)) Then
' Store a reference to the "lost-focus" control. Note that this could actually be on
' another form so client-code may need to take account of this!
Me.PreviousControl = ctrl
End If
End If
Catch
Me.PreviousControl = Nothing
End Try


End If

'Regardless, normal message processing is carried out...
MyBase.WndProc(m)

End Sub

End Class