When I post in Wordpress, I use Visual for appearance and forcing double-spaces, but I use HTML for adding links and being very picky with my code. Here's how to add a button in the HTML editor bar to not only add LJ user code, but to have it plug in the username in the right spots.
0) You will be editing the /wp-includes/js/quicktag.js file. Make backups, &c &c.
1) Open the file and look for the first instance of this line: edButtons[edButtons.length]
Underneath that code block (should be for the 'strong' tag), add this:
edButtons[edButtons.length] =
new edButton('ed_lj'
,'LJ User'
,'<a href="http://###.livejournal.com/profile"><img style="margin: 0px; vertical-align: middle;" title="ljuser" src="[img src]" alt="ljuser" border="0" width="17" height="17"></a><a href="http://###.livejournal.com/"><strong>###</strong></a>'
,"
,'ljuser'
);
If you stop and save at this point, you will have a button that will add the LJ user code. ### should be replaced with the user name, and [img src] should be replaced with where you've saved the 17×17 LJ user icon. (I recommend saving it locally.)
However, I want it to ask for and insert the username, so I don't have to. So…
2) Search for this string: function edShowButton(button, i) {
You should see an if/else if/else block. Insert this code above the else if line:
else if (button.id == 'ed_lj') {
document.write('<input id="' + button.id + '" class="ed_button" onclick="edInsertLJUser(edCanvas, ' + i + ');" type="button" value="' + button.display + '" accesskey="' + button.access + '" />');
}
3) Search for this string: function edInsertLink(myField, i, defaultValue) {
Below that function (and above the edInsertImage function), add this code block:
function edInsertLJUser(myField, i, defaultValue) {
if (!defaultValue) {
defaultValue = 'news';
}
if (!edCheckOpenTags(i)) {
var theUser = prompt(quicktagsL10n.enterURL, defaultValue);
if (theUser) {
edButtons[i].tagStart = '<a href="http://' + theUser + '.livejournal.com/profile"><img style="margin: 0px; vertical-align: middle;" title="ljuser" src="[img src]" alt="ljuser" border="0" width="17" height="17"></a><a href="http://' + theUser + '.livejournal.com/"><strong>' + theUser + '</strong></a>';
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}
4) Finally, save, close, and refresh the Add New Post or Edit Post page. When you click on the HTML tab now, you should see LJ User. Click on that, and where it says 'news' (the default LJ user), put in the LJ username you want to enter in. This will return code that (a) has the username in all the right places and (b) looks right both in WP and LJ.
Ta-da!
I sent this in response to a question sent in an Excel Tips newsletter. I figured I'd post it here, since I know some people use Excel, and because I want to save it for later.
–
"At the beginning of each year I make a copy of the previous year's Excel workbook. I then need to delete everything in the copy except for formulas. Is there a way to do this easily?"
One way is to protect the cells with formulas, then just run a macro that deletes every cell that isn't protected. I don't know the best way, but here's what I found:
Sub DeleteFree()
ActiveSheet.Unprotect
Application.ScreenUpdating = False
strRange = ActiveCell.SpecialCells(xlLastCell).Address(False, False)
intCheck = Val(Mid(strRange, 2, 1))
If intCheck = 0 Then intCol = 2 Else intCol = 1
intRows = Val(Right(strRange, Len(strRange) – intCol))
strCol = Left(strRange, intCol)
For x = 1 To intRows
y = 0
Do
y = y + 1
If Cells(x, y).Locked = True Then Cells(x, y) = ""
Loop Until UCase(Left(Cells(x, y).Address(False, False), intCol)) = strCol
Next
Application.ScreenUpdating = True
This assumes that you first go through and unlock all cells, then lock the ones with formulas. You can do this by selecting the cells, going to Format > Cells, clicking on the Protection tab, and toggling 'Locked'.
Technology: Where have all the women gone?, by Kathi Kellenberger over at sqlservercentral.com.
It's more of a personal essay than an article, per se. (Not that there's anything wrong with that.) What I like are the comments, which start out all "Women are nurturers!" until Grasshopper says:
Inevitably this discussion comes up. Inevitably the answer is that women just aren't fit for IT, because they're sweet, mothering types that can't hack the competitive industry or the hours or the work. It must be the nature of the work and the genetic/socialized nature of women.
It couldn't possibly have anything to do with the culture or sexism or the fact that being the only woman working in large groups of men really has some distinct downsides, particularly if you're unfortunate enough to be young/pretty.
Wordy McWord.
She links to HOWTO Encourage Women in Linux by Val Henson, which contains many interesting theories and links.
I suppose I could've written more on this, but I have to go write a bug report.
I realise that by posting this publicly, there is a chance in hell that the object of my distinctly poisonous bafflement may find what I've written and comment on it. To which I say, good.
GoldMine's Infocenter (their version of a knowledgebase) is organised by book, then folder, then page. So, an example listing:
[B] How To
-> [P] Back up a database
-> [P] Repair a database
-> [F] Windows
-> -> [P] Boot a PC in Safe Mode
-> -> [P] Display all files
[B] Information
-> [F] Palm
-> -> [P] Palm Desktop
In the database back-end, there are two columns, Tsection and Topic. Topic contains the page names, which is fine. Tsection contains the book and folder names, in a fixed width format, which is asinine. Observu, Leganto:
Tsection
How To
How To Windows
Information
Information Palm
By which I mean to say, what the fuck.
Thank god I know about the substring function in SQL Server, since I don't really have time for an unholy quest to cut out the GoldMine database creator's still-beating heart to recreate the entire thing in SQL Server just to clean it up for the migration.
(To the DB creator – I'll assume, for the sake of sanity, that this was some sort of management decision, and that you're a good person, really.)
You know, sometimes I wonder if I should start some sort of "How To Search" thing. A series of posts, perhaps. I'm not certain this would be something I'm good at, since I view myself as being naturally very good at doing searching, and I've often noticed that being naturally very good at something has no relation to being able to teach it to others.
Allow me to elaborate on the "naturally" part. First, I waaay more often than not find what I want, even when it's obscure. Second, I've had friends ask me to find things because they see that I usually can, I suppose. (I never thought to ask why, since the challenge of finding $thing is great and powerful. I'm not being sarcastic.) Third, I 'unno, people often comment on "How did you ever find $thing?", and I have ears with which to listen. Summary: I'm not being a pompous ass, nor am I attempting to set up a competition. Moving on.
I think it's because I've been increasingly bothered by some people's inability to perform basic searches. Today's example: finding people in a contact database.
When I use a contact database, if I don't find 'Philip', I try 'Phillip'. If I don't find 'Laurie', I type in 'Laur' and see if anything comes up, then try again with 'Lor'. On 'Robert', I try 'Bob', and so forth. I search based on the company name, the contact name, and the phone number, and any permutation of these is valid. Is the company name PPI Contractors? Did I try P.P.I., P P I, and maybe any consonant that rhymes with P? Did I check all three phone fields, and did I ask the customer if maybe another number was used?
To me, this is all extremely basic. It's a trade-off of 30 seconds to search versus a potential duplicate contact record in the database. It cannot possibly be that hard.
And yet…
"What drivers do I need for my Logitech trackball mouse?" Search at logitech.com for the model name or number; barring that, use Google, and search for '$model $model_number driver'. If this all fails, email the company directly and ask "Seriously, wtf?".
This can't be hard!
So I'm thinking of doing a sort of "Today's searching tip", but I'm torn as to whether to post my own tips, or to do a Google search for 'how to search', and post tips from there. Of course, no one ever said that information and irony are mutually exclusive…
In creating my layout, I used HTML Color Code Combination Chooser. You can click on a colour map, adjust RGB settings manually or by slider, or enter in a hex colour code. It will show you the colour by itself, with complementary colours, and in a small layout preview screen. It is Highly Neat.