MacBook, defective by design banner

title:
Put the knife down and take a green herb, dude.


descrip:

One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com

Using 89% of the same design the blog had in 2001.

FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.

As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.

x

MarkUpDown is the best Markdown editor for professionals on Windows 10.

It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.

Features you won't find anywhere else include...

You've wasted more than $15 of your time looking for a great Markdown editor.

Stop looking. MarkUpDown is the app you're looking for.

Learn more or head over to the 'Store now!

Tuesday, October 22, 2024

TL;DR -- If you Ikea stiffed you some 101350 fluted dowels, you can buy 5/16" dowels from Home Depot, 50 for under $4.

Depending on the precise usage, however, you may have to cut them down.


One of the funniest things about Ikea is that they're scamming all sorts of bougie yuppies to save Ikea the cost of actually assembling furniture. Don't get me wrong: They're maestros at making it so most anyone who's walked past someone with a handy gene can, with enough desire, get from flatpack to functional in an hour. Still, if you're Ikea, you've got all sorts of schmoes who clock $80+ an hour at their place of employment doing $15 an hour work for you, for free. That's an amazing ability to employ the most widely distributed micro-gig workforce, allowing you to have tons more in your warehouses, save crudloads on shipping, etc etc.

But, you know what, I really enjoy putting them together. There's something about assembling the furniture that's very Lego-like, which might not be too surprising, as the companies' headquarters are a long but doable drive away from each other. Must be in the water.

Setting out space, putting together a minimalist's toolset, and solving a beginner's level brainteaser seems a small price to pay for furniture that... isn't embarrassing. Probably won't get listed by name in your will, but functionally excellent. I've put together a wide swath of Ikea choices over the years, from a kitchen table for six, with a leaf that lets it expand to eight that was so easy to assemble that it should have the Ikea label taken off, to a chest of drawers (and its slimmer sidekick, apparently no longer available) whose drawers really do slide open and closed with a special grace on those Ikea rails, to a loft/desk/closet unit with ladder for a kid that, um, was more complex to assemble.

Anyhow, as one does, I recently got a Tarva queen-sized bedframe, which comes with slats in place of box springs for $149. I've got an extra mattress and space for a bed, so... why not?

Opening it up, I was already impressed. What seemed like a great deal also seemed like $40 of plywood sitting on my bedroom floor. I mean, there's some metal for support rails and the fancy slats, but Ikea has to maintain a decent profit margin. Like it's literally just a bunch of 1"x4"s and 1.5"x1.5"s with nicely predrilled holes.

Not patient enough to stain the pine, which is likely a mistake, I did the usual.

  1. Open box.
  2. Toss aside cardboard packing spacers.
  3. Organize pieces by material.
  4. Open plastic bags of small things.
  5. Separate small things into matching groups.
  6. Scan the page in the instructions depicting the small pieces with the faintest attention. (This will be important later.)
  7. Start following instructions.

Problem: I got to step 7. of the Tarva instructions and noticed I didn't have enough dowels. Like not nearly enough. I didn't notice until I had one side assembled and screwed down, but if I only used one dowel for every two indicated on the second side, I'd make it. So that's what I did, and tightened everything up.

Well, until I got to step 9, where I needed four more. So I gave up, feeling guilty I'd skimped on the headboard anyway, and took that last half of the headboard that only had half the dowels intended back apart.

Options:

  1. Call Ikea and hope they'd mail me some dowels before, well, before too long.
  2. Wait until I'm back near an Ikea, the closest being about 3 1/2 hours' drive away.
  3. Find another dowel source.

So after taking one of the dowels with me to Home Depot, it turns out the 5/16" dowels they carry are right close, and almost exactly the right diameter. Fifty count for under $3.50!! That's got to less trouble than the cost of my time bugging Ikea for freebees.

Took them home, opened them up, and started in. Now they're a little longer than the Ikea part number 101350 dowels, but I'd noticed putting it together that longer might've be better anyhow, because leaving the dowels more than half-way out had let me catch just the end of each, making pushing the side board down and together easier. Or so I thought.

I put them in each missing hole on the middle, inner board and pushed the headboard slats in. No problem! Worked fine! Makes some sense. If you need a couple different sizes of dowel, but one length would be within tolerance and make do for each of those usages, of course Ikea just gives you a ton of the universal fit dowel. Saves them money and makes it easier for you now that you don't have to keep them organized by size. The Home Depot dowels are just over a quarter-inch longer. They work fine on the inside of the slats. That means they likely should work as-is all over!

Oops. That is what we call in the Ikea trade "an insurmountable gap".

So here's the deal: The holes on the inside can take longer dowels, but the holes on the outside can't. The drilled holes aren't deep enough. Two options.

  • Remove all the short dowels from the inside of the slats and replace with longer ones, then use those short ones on the outside.

Downside: I'd still come up three dowels short. For this to really work, you'd need to take the first half of backboard slats back apart.

For some reason I really hate taking things apart that have been put together "right" already.

... orrrrrr ...

  • Cut down some of the longer dowels.

You can guess what I did. First I put aside four Ikea dowels for the step 9 (having discovered that some usages require the regulation-length Ikea dowels, I didn't want to risk it on unknown step 9), I pulled out all the short dowels on the inside of the headboard with my teeth, just like you should when the Home Depot dowels say "Warning: Carcinogen" (hopefully Ikea dowels aren't made of the same stuff?), and went outside to hacksaw three Home Depot dowels down to Ikea 101350 dowel height.

Long story only slightly shorter: It worked! I cut the dowels down to match the stock 101350 length and poof! Didn't even have to whittle down the edges to fit; they went right in. After a bit of lining things up, the pieces went together and tightened up without a fight.

So, again, a trip to Home Depot, $3.50, and only another hour of my time and look! I didn't even have to call Ikea and wait for them to send me the missing dowels! What a bargain. And, once I got done with Tarva step 7 fully doweled, I even went ahead and finished up steps 9, 10, and 12 [sic] before writing this and going to sleep!

Good thing I got those dowels at Home Depot and saved so much time. I'm obviously in a real hurry.

Labels: , ,


posted by ruffin at 10/22/2024 11:46:00 PM
Friday, September 28, 2012

Mouse not quick enough in OS X?  Here's a win:

How to speed up mouse tracking in OS X - MacRumors Forums:
defaults write -g com.apple.mouse.scaling 5.0

"5.0" being the number designating the speed. Change that number to whatever you like. I've got my Magic Mouse set to 150 or so.

This does not change the acceleration, just the scaling. Altering the setting via the preferences pane overrides the Terminal command.

Log out and back in to activate.



Actually works.  I'm impressed.  The default max is apparently 3 in OS X settings (with the slider, above, set to the far right).  I'm using 8 on my Dell mouse, and it's too fast, if that gives you any idea of where to start testing, but YMMV by mouse.

Note that setting the scroll with the bar, above, apparently overwrites the setting made in the terminal, which would cause you to run the statement again, log out, and then log back in to reset.

Labels: ,


posted by ruffin at 9/28/2012 09:00:00 AM
Wednesday, March 28, 2012

At least when running against ExtJS 2.2, the example from Listing 7.1 on page 159 of ExtJS in Action, (c) 2011, has a few careless errors. If you use the GridPanel source from Building_our_simple_gridpanel.html to finish things up, you need to make a number of changes. First, he's changed the mapping for the first column from 'name' on page 159 to 'fullName' (case is important) in the example code. That's not technically an error, but is an inconsistency that's surprising given the quality of most of the sample code, which is usually quite thorough down to its whitespace.

That said, there are a number of errors where the code in Listing 7.1 is misdescribed in the corresponding paragraphs. There are numbers that are supposed to match from text to code, and they often don't. So I'm guessing Listing 7.1 isn't up to snuff.

There are two serious, outright errors, afaict. The first is that the Ext.data.Store is never loaded. The second is in the nameRecord declaration. It's an oboe error with indices -- again, at least when used against 2.2 (the book assumes 3.1). He's got the first column at 1 and second at 2. That borks. You want 0 and 1.

Let's just cut to the chase and spit it all out here. Note that I also put in a hardcoded height, since I wasn't rendering to the body.

// Call createGrid from Ext.onReady() to render the simple grid
// to a div with id of 'divUiHook2'.
function createGrid() {

//==============================================
// code from Listing 7.1
//==============================================
var arrayData = [
['Jay Garcia', 'MD'],
['Aaron Baker', 'VA'],
['Susan Smith', 'DC'],
['Mary Stein', 'DE'],
['Bryan Shanley', 'NJ'],
['Nyri Selgado', 'CA']
];


var nameRecord = Ext.data.Record.create([
{ name:'name',mapping:0},
{ name:'state',mapping:1}
]);

var memoryProxy = new Ext.data.MemoryProxy(arrayData);
var arrayReader = new Ext.data.ArrayReader({ id:0 },nameRecord);

var store = new Ext.data.Store({
reader:arrayReader,
proxy:memoryProxy
});

store.load(); // this was missing -mfn
console.log(store.getCount()); // this is what clued me in -mfn


//==============================================
// code from Building_our_simple_gridpanel.html
//==============================================
var cm = new Ext.grid.ColumnModel([ // 1
{
header : 'Full Name',
sortable : true,

// changed this from fullName
dataIndex : 'name' // 2
},
{
header : 'State',
dataIndex : 'state'
}
]);

var gridView = new Ext.grid.GridView(); // 3
var selModel = new Ext.grid.RowSelectionModel({ // 4
singleSelect : true
});

var dummyGrid = new Ext.grid.GridPanel({ // 5
renderTo : 'divUiHook2', // changed from getBody.
//autoHeight : true, // replace with constant
height : 200, // constant height
width : 250,
store : store, // 6
view : gridView, // 7
colModel : cm, // 8
selModel : selModel,

title : 'Our first grid'
});
} // eo fn createGrid


Voila. That works, providing you have a DIV with id name divUiHook2 in your file and that you call the createGrid function.

Labels: , , ,


posted by ruffin at 3/28/2012 11:04:00 AM
Thursday, March 08, 2012

Where is the Hosts File on Windows x64? | sepago:
Navigate to C:\Windows\System32\drivers\etc.
QED.

And just for fun, here's where the Mac OS X hosts file is to (and how to edit it):

sudo pico /private/etc/hosts

(sure, I'd use vi, not pico, but if you can't figure pico out... Pico is awesome for anyone introducing themselves to *NIX.)

Labels: ,


posted by ruffin at 3/08/2012 10:13:00 AM
Wednesday, March 07, 2012

You don't want myFile.cs~ littering up your file system. There are some really heavy-handed fixes out there (like deleting all the files ending in tilde every so often), but that's a far cry from a best practice. In vim, I just set up a backup directory for those files so that they're all in one place, not over the file system. I think that causes some trouble when I edit files of the same name, but I haven't really checked. Still, a much more elegant solution than combing the whole system to blast every backup.

But how to do this in JEdit? Here we go...

Saving Files:

The behavior of the backup feature is specified in the Autosave and Backup pane of the Utilities>Global Options dialog box; see the section called โ€œThe Saving and Backup Paneโ€.`

The default behavior is to back up the original contents to the buffer's file name suffixed with a tilde (โ€œ~โ€). For example, a file named paper.tex is backed up to paper.tex~.
...
* If the Backup directory setting is non-empty, backups are saved in that location (with the full path to the original file under it). Otherwise, they are saved in the same directory as the original file. The latter is the default behavior.

So on a Mac, that's a Cmd-, for Preferences, then the below...


Step 3.) Profit.

Labels: ,


posted by ruffin at 3/07/2012 09:56:00 AM
Monday, March 05, 2012

I was trying to get an ExtJS 2.2 JsonStore to send raw parameters to a WCF service. Catch-22 was that WCF doesn't accept raw params, and JsonStore seems to like to throw POSTs only (by default) when requesting data. And this breaks the deadlock. Very nice.

Edgardo Rossettoโ€™s Blog ๏ฟฝ Raw HTTP POST with WCF:

Hereโ€™s how you read the input Stream:

public void DoWork(Stream input)

{

StreamReader sr = new StreamReader(input);

string s = sr.ReadToEnd();

sr.Dispose();

NameValueCollection qs = HttpUtility.ParseQueryString(s);

string firstName = qs["firstName"];

string lastName = qs["lastName"];

// Do work here

}

Labels: ,


posted by ruffin at 3/05/2012 02:28:00 PM
Wednesday, February 22, 2012

Aka, "Where did all my changes go, and why does this trigger's creation only work in sqlplus?"

Roland Bouman's blog: Oracle SQL Developer 1.1 Supports MySQL:
Sorry, that was a PEBKAC (Problem Exists Between User And Chair)

All I needed to do was turn on "auto commit" in SQL Developer.
Tools -> Preferences
Click next to Database,
Select Worksheet Parameters
Click checkbox to mark "Autocommit in SQL Worksheet"
Close SQL Developer and re-launch.

Problem solved.


More on how autocommit works in Oracle from an Ask Tom segment here (from 2000! though last updated this month).

I've always used SQuirreL-SQL when using Oracle to this point, and this hasn't been an issue. Very non-SQL Query Analyzer. Old habits die hardest, I guess.

Labels: , ,


posted by ruffin at 2/22/2012 11:09:00 AM
Thursday, February 16, 2012

Type this exactly, though you'll see something slightly different...

:1,$ s/Ctrl-QCtrl-M/\r/g

It'll look like...

:1,$ s/^M/\r/g

... which is what we wanted, right?

Labels: , ,


posted by ruffin at 2/16/2012 10:03:00 AM
Wednesday, February 01, 2012

Finally bothered to figure out what call() does, precisely, and why it needs 'this' passed in as an "extra" parameter.

Great explanation here, in odetocode.com:

var x = 10;
var o = { x: 15 };
function f(message)
{
alert(message);
alert(this.x);
}

f("invoking f");
f.call(o, "invoking f via call");


So the deal is that "this" becomes the "new" "this" within the function, making it approximate a real object oriented overload. So if you're, say, extending some ExtJS objects in ExtJS 2, this is how you'd call the superclass' functions from the class' extension.

So in Sencha's tutorial, you're first, very smartly, making a trivial extension of an existing object with code like this...

    initComponent:function() {
// call parent initComponent
Ext.ux.IconCombo.superclass.initComponent.call(this);
} // end of function initComponent


So initComponent will do the same that it's always done, but will pull in the extended (though, for now, only trivially extended with no new functionality) object's methods, props, etc. when "this" is called.

The whole Javascript revolution still seems like a giant kludge, but that obviously doesn't make it evil. It's a good hack, but takes a little head rethreading.

Labels: , ,


posted by ruffin at 2/01/2012 10:03:00 AM
Thursday, January 12, 2012

Now this is pretty cool, other than Javascript not supporting it... The RegEx Lookbehind. You can find a pattern and return hits only when it's not preceded by another pattern.

So I wanted to find where something was declared in a web/javascript app, not where it was instantiated by pulling it back by id. In this case, we're using the ExtJS framework (probably not my first choice, but a good, robust lib), so document.getElementById() or a jQuery $() is replaced by Ext.getCmp().

So I want to find any example of theObject that's not in the format...
Ext.getCmp("theObject")

Which is to say, I want to find any theObject not preceded by Ext.getCmp("

Here's the lookbehind-ige...
(?<!Ext\.getCmp\(")theObject

SHAZAM. That's neat.

And though it'll chew, JEdit will recursively Hypersearch that into a directory tree, no problems.

And then it'll clue me in that I need to say either " or ' in the regexp. Ooops.

(?<!Ext\.getCmp\(["|'])theObject

Cool.

Labels: ,


posted by ruffin at 1/12/2012 12:34:00 PM

Honestly, this sounds like it'd solve the majority of the Gmail Fail stuff I've been seeing, and with Google's ability to collect store the "triplets", they should be able to make this all pretty transparently from its users' perspectives.

Greylisting: Whitepaper:

The Greylisting method is very simple. It only looks at three pieces of information (which we will refer to as a "triplet" from now on) about any particular mail delivery attempt:

1. The IP address of the host attempting the delivery
2. The envelope sender address
3. The envelope recipient address

From this, we now have a unique triplet for identifying a mail "relationship". With this data, we simply follow a basic rule, which is:

If we have never seen this triplet before, then refuse this delivery and any others that may come within a certain period of time with a temporary failure.

Labels: , ,


posted by ruffin at 1/12/2012 12:02:00 PM
Friday, December 02, 2011

On Windows at least, Safari will apparently check some system-wide setting and see if there's a proxy it should be using. This would be taken from some wacky .pac file or some such.

So when Safari pops open a window saying... "To view this page you must log in to the http proxy server", you're probably (?) supposed to be blocked from viewing that site by your [office?] proxy. I've noticed that I can type in real mature stuff like "doo doo" for the user name and password and still through, however, so I'm not sure what's going on there.


To fix this (at least for me), you can go to settings in Safari, click Advanced, click the Change Settings button next to Proxies, click the LAN settings button on the new dialog, then if "Use automatic configuration script" is checked, uncheck it.

Profit.

That was a pain. I wanted to use Safari as my "no Javascript" test browser, and it was initially just hanging, and then it did this proxy jive after reinstall. Fun times.

Labels: ,


posted by ruffin at 12/02/2011 08:55:00 AM
Thursday, December 01, 2011

I've got a page with a save button that's to be enabled only after edits have been made (otherwise what are you saving, right?). So right now it's an asp:button, so I disable it with Enabled="false".

<asp:Button runat="server" ID="cmdSavePrimaryClientEdits" Text="Save" 
onclick="cmdSavePrimaryClientEdits_Click"
OnClientClick="checkCboMasks();"
Enabled="false" />


Bad news. I couldn't for the life of me figure out why my OnClientClick function call wasn't in the html. Finally, a StackOverflow comment gave me the answer...

asp.net - OnClientClick not working - Stack Overflow:


Another possibility: if the button is disabeld when the page is rendered, then the OnClientClick event is NOT written to HTML. Is your button disabled when the page is rendered? โ€“ AASoft Sep 17 '09 at 22:35


Hey, Ballmer, WHAT THE HECK GOOD IS IT TO REMOVE THE FREAKIN' ONCLIENTCLICK IF THE BUTTON'S DISABLED? IT'S NOT LIKE IT'LL ACCIDENTALLY GET CALLED, OKAY?!!!

ARGH. What a pain. I can now either use jQuery to attach my click event to the button after it's rendered OR I can remove the Enabled attribute and use jQuery to disable it once the page is done loading. What a freakin' kludge o' freakin' rama.

So here's the jQuery fix:
$('#<%=cmdSavePrimaryClientEdits.ClientID %>').attr('disabled', 'disabled');

/sigh

Labels: , ,


posted by ruffin at 12/01/2011 04:17:00 PM
Thursday, November 03, 2011

Codige follows. This is the first "seems to work" version. The Microsoft AJAX Control Toolkit ComboBox does a good job of providing almost identical functionality, but doesn't always show the "select"/dropdown portion of the pair.


   1 var gintStart = 0;
2 var gintEnd = 0;
3 var gstrLastVal = "";
4
5
6 function findMatch() {
7 frm1 = document.forms[0];
8 intMatch = -1;
9 txtLoc = frm1.elements['txtLoc'];
10 lstLoc = frm1.elements['<%=lstLocs.ClientID%>'];
11
12 var strCurText = txtLoc.value;
13 if (strCurText.length <= gstrLastVal.length) {
14 // ignore all this; allow deletes gracefully
15 } else {
16 //if ( gstrLastVal.length >= 2
17 //&& (0 != txtLoc.value.indexOf(gstrLastVal)) ) {
18 // gets rid of any hanging on autofilled text
19
20
21 if (0 != txtLoc.value.toUpperCase().indexOf(gstrLastVal.toUpperCase())) {
22 // txtLoc.value.slice(0, gstrLastVal.length - 1);
23 // then again let them do what they want. Don't try to overcomplete
24
25 } else {
26 if (txtLoc.value.length > 0) {
27 // go backwards to grab the first match
28 for (var i = lstLoc.options.length - 1; i >= 0; i--) {
29
30 var strOptTxt = lstLoc.options[i].text.toUpperCase();
31
32 if (0 == strOptTxt.indexOf(txtLoc.value.toUpperCase())) {
33 intMatch = i;
34 }
35 }
36
37 if (-1 != intMatch) {
38 lstLoc.options[intMatch].selected = true;
39
40 txtLoc.value = lstLoc.options[intMatch].text;
41 gintStart = strCurText.length;
42 gintEnd = txtLoc.value.length;
43 // (kinda ruining the whitespace to reduce width for blog)
44 //createSelection(txtLoc,strCurText.length,txtLoc.value.length);
45 // it looks like this tries to set the selection while focus is
46 // still going to another control, blowing up the selection.
47 // thus the delay tactics.
48 // unsuccessful delay tactics commented, below.
49 //backdoorSelection();
50 //setTimeout("createSelection(txtLoc,strCurText.length,txtLoc.value.length)",100);
51 //setTimeout("createSelection(txtLoc,4,9)",100);
52 setTimeout("backdoorSelection()", 30);
53 } else {
54 // no match. Deselect anything selected
55 lstLoc.selectedIndex = -1;
56 }
57 }
58 }
59 }
60 gstrLastVal = strCurText;
61 }
62
63 function backdoorSelection() {
64 createSelection(document.forms[0].elements['txtLoc'], gintStart, gintEnd);
65 }
66
67 function createSelection(field, start, end) {
68 if (field.createTextRange) {
69 var selRange = field.createTextRange();
70 selRange.collapse(true);
71 selRange.moveStart('character', start);
72 selRange.moveEnd('character', end);
73 selRange.select();
74 } else if (field.setSelectionRange) {
75 field.setSelectionRange(start, end);
76 } else if (field.selectionStart) {
77 field.selectionStart = start;
78 field.selectionEnd = end;
79 }
80 field.focus();
81 }

Labels: , ,


posted by ruffin at 11/03/2011 08:27:00 AM
Thursday, September 01, 2011

Surprising that I couldn't cut and paste from SQuirreL-SQL to phpMyAdmin when using sprocs. But then if you think about it for a second, it makes a lot of sense -- the parser in phpMyAdmin stops at a semi-colon and, Emeril-style, BAM! It runs it.

You've got to change your delimiter.

Nth Design ยป Using phpMyAdmin to Create Stored Procedures:
1 Open phpMyadmin.
2 Select a database to work with.
3 Open the SQL tab.
4 Select all of the SQL statements between the DELIMITER statements in your stored procedure script. Do not include the DELIMITER statements!

Hereโ€™s what my example script should look like:

DROP PROCEDURE IF EXISTS spFoo $$

CREATE PROCEDURE spFoo ()
BEGIN
SELECT 'Foo' FROM DUAL;
END $$


5 In the delimiter field, just below the SQL editorโ€™s text area, enter $$ as your delimiter.


So that delimiter spot is here:


Below "sig" from the Chrome BlogThis extension. I don't think Pyra's link ever did this. I'll leave it this time, Google, but I'm not using that extension again unless I'm really bored and have Chrome's bookmark toolbar off again.

'via Blog this'

Labels: , ,


posted by ruffin at 9/01/2011 10:10:00 AM
Thursday, August 18, 2011

I've been considering using Real Basic to write The Great American Mail Handler (a cousin of the Great American Novel), but the inexpensive Personal Edition doesn't come with SSL. What a pain. Is there any serious email provider that doesn't use secure sockets at this point? So if I'm going to test against a real server, I'd really kind of need SSL support, and I'm not paying $200 up front for a hobbyist project.

Enter stunnel, a "NIX package (also compiled into a service for Windows) that securely wraps a tunnel from your box to another. Instant https, POP3 with SSL, SMTP, you name it.

How difficult is it to set up? I spent an evening hacking, and after a few dumb mistakes, found out. Here's my post to the Real Basic user group mailing list.

> Yep, I think the stunnel package I'd mentioned a while back
> is going to be the way to go while developing.

Yeah, wow, that was easy. Forgive me for the bytes, but I figured I'd log
directions here in case someone Googles this thread up. I should add that
I'm using a Mac.

Download stunnel with GUI overlay from here:
http://www-act.ucsd.edu/downloads/SSLEnabler.dmg

Drag the SSL Enabler to Applications and start it up. Authenticate. Have
SSL Enabler install stunnel. It crashed on me then. No big deal.

Restart if it crashed, click Authenticate, and set up a Local Port for POP3
(say 1109), type "pop.gmail.com" (if you're using a Gmail account) as the
Remote Server IP, then 995 as the Remote Port, as 995 is the standard POP3
port for SSL connections.

Here's a catch -- and I've written utilities this sloppy before, I'm afraid
-- you have to have focus leave the Remote Port blank to make sure it
registers your change. Otherwise it sometimes records the default 9999
value. So change focus back to the Local Port or Remote Server IP entry
before clicking save.

Open a term window. Enter the following:

ps ax | egrep stun | egrep -v egrep

Hit return. You should see your stunnel there. For instance:

10526 ?? Ss 0:00.01 /usr/local/sbin/stunnel -c -d 1109 -r
pop.gmail.com:995

Now you can, for kicks, test out that things are working by telnetting into
Gmail's pop server. Ensure you've enabled POP in your test gmail account.
Note that this is different from enabling IMAP. If you enabled IMAP in the
past, make sure you go back in and do the same for POP. (Yes, personal
experience here. Stoopid.)

So things starting with + came from Google, and stuff before those + lines
are the stuff you'll type.

$ telnet 127.0.0.1 1109
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Gpop ready for requests from [your IP and other info]
user yourUserNameWith@gmail.com
+OK send PASS
pass yourPassword
+OK Welcome.
list
+OK 159 messages (1621817 bytes)
1 2935
2 2764
3 2456
....
retr 2
+OK message follows
MIME-Version: 1.0
Received: by 10.147.34.3; Sun, 2 Jan 2011 14:22:40 -0800 (PST)
Date: Sun, 2 Jan 2011 14:22:40 -0800
....
rset
+OK
quit
+OK Farewell.

Make sure you use "rset" to reset the POP server's state if you're testing.
You'll want the emails to stay "current" so that they show up on your next
LIST. If you don't, they've been permanently POPped, and the server won't
show them to you again without fiddling with Gmail's Mail Settings. (This,
of course, is a large part of why IMAP rocks. POP really is just the Post
Office shoving new stuff you haven't received into your mailbox and washing
their hands of the whole mess.)

In a Real Basic app, you'd start things off with code like this, perhaps in
your main window's Open() subroutine:
Socket1.Port = 1109
Socket1.Address = "127.0.0.1" ' with stunnel

Socket1.username = "yourUserNameWith@gmail.com"
Socket1.password = "yourPassword"

Socket1.Connect

To reset the server while you test and then disconnect, drop this into the
window's Close() sub:
Socket1.RollbackServer ' equivalent of RSET in telnet
Socket1.DisconnectFromServer ' QUIT

As long as you fire up SSL Enabler each time you start up your Mac and enter
in the stunnel, you can code away with the Personal POP3Socket against POP3
servers that require SSL, without the 5 minute warning some Zymail folk were
apparently slogging through as they tested builds without Professional.
Then write the great American novel and change over to POP3SecureSocket
years later once you've slain the whale. I think all you'd hack at that
point would be your Socket.Address from 127.0.0.1 to, in Gmail's case,
pop.gmail.com, the Port from 1109 (or whatever you stunneled) to 995, and
then you'd add these two lines in your window's Open():

Socket1.ConnectionType = POP3SecureSocket.SSLv23
Socket1.Secure = true

There's $200 "saved". ;^) (More accurately, there's $100 /spent/ on the
Personal Edition. Fun nighttime project.)

Thanks for your patience.

Labels: ,


posted by ruffin at 8/18/2011 01:18:00 PM
Sunday, August 14, 2011

from: http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/

What I did to solve this problem was to add a new source

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

After that a normal

sudo apt-get update
sudo apt-get install sun-java6-jdk


This is followed by this pressing question:

After requesting and downloading a java install on a terminal, I got the following, and ONLY the following:

Package configuration...

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Configuring sun-java6-jre โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ”‚...
โ”‚
โ”‚


There is no more to the window, no place to type a command, no way to read the whole agreement, nor to select Y/N or OK, or anything.

What do I do?

...

emeraldgirl08
August 8th, 2009, 01:53 AM
Have you tried pressing the TAB button?

gregapan
August 8th, 2009, 02:45 AM
emeraldgirl, thanks

I'm just wondering how users are supposed to know that TAB does magical things in ubuntu.

such things are not usually left to the user's guessing skills


I knew there was an easy way to do it...

Then, pick which to use, OpenJDK which is installed by default (and which an apt-get -purge didn't remove for me) or Sun's...

>Can I run both side by side?

Yes, you can and you can tell the system which one to use by default (for the Java software).

To get a list of the installed JDK

$ sudo update-java-alternatives -l

To set a new as default one (at the system level)

$ sudo update-java-alternatives -s


And just to add one more XAMPP related thing:

Once lampp is up and running, you want to run: sudo ufw enable to make sure folks aren't accessing your server, etc.

Labels:


posted by ruffin at 8/14/2011 01:24:00 PM
Sunday, June 05, 2011

newlines - Join lines inside paragraphs in vim - Super User:

This should do it:

:set tw=99999
gggqG
tw is set to some value at least as large as the number of characters in the longest paragraph. gg moves the cursor to the first line; gq is the command to reformat; G moves the cursor to the last line, telling gq to reformat from the current cursor location to the last line.


Seems to work. So to save paper, I'm taking an article from Firefox, saving as text, pulling out the line breaks with VIm, then printing from Word with very little margins.

Worth it? Doanno. Works though.

Labels:


posted by ruffin at 6/05/2011 01:59:00 PM
Monday, May 23, 2011

Authorize.net SIM module problem: "This transaction cannot be accepted" | Ubercart:

I am trying to setup the this module Authorize.net (SIM) payment method... but I keep getting this error when I try to complete a transaction:

'The following errors have occurred.
(99) This transaction cannot be accepted.'
...
Where exactly do I place my MD5 hash or what may be creating this error?

Thanks...


And the right answer, whether you're using Ubercart or, in my case, rolling your own SIM cart...

The has[h] is an MD5 of your API login ID and a few other fields in the transaction. Have you entered the correct login ID?

Welp, that's it. Whatever it is that you're doing, it's the fingerprint that's screwing up. I'm allowing customers to change quantities on the order page, so of course we've got to allow the amount to change as well. That screws up your fingerprint, and you have to generate a new one for each amount. I'm doing that with AJAX, and let's just say there are lots of places where you can screw that up.

Phew, glad that's over.

Labels:


posted by ruffin at 5/23/2011 11:02:00 PM

Sure, pop-ups are evil -- if they're for advertisements. If they're to relay information from AJAX, perhaps not so much. ColorBox, a "customizable lightbox plugin for jQuery 1.3, 1.4, & 1.5" is a pretty good widget for in-window pop-up feedback.

But what's the minimum code I could use to display this jive? Glad you asked...

   1 <html>
2
3 <head>
4 <title>Simplest (give or take) Colorbox</title>
5
6 <link media="screen" rel="stylesheet" href="./includes/colorbox.css" />
7 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
8 <!-- from http://colorpowered.com/colorbox/ -->
9 <script src="./includes/jquery.colorbox.js"></script>
10 <script>
11 // This is for colorbox support
12 function disFeedback(str) {
13 elmOut = document.getElementById("feedback");
14 var d = new Date();
15 <?php
16 if ($bDebug) {
17 echo "elmOut.innerHTML " .
18 "= elmOut.innerHTML + \"<br><br>\\n\" + " .
19 "d.getTime() + \"<br>\n\" + str;\n";
20 } else {
21 echo "elmOut.innerHTML = str;\n";
22 }
23 ?>
24 $.colorbox({width:"50%", inline:true, href:"#feedback"});
25 // alert('here');
26 }
27 </script>
28 </head>
29
30
31 <body>
32 This is some text.<br>
33 <!-- below DIV is for colorbox info -->
34 <div style='display:none'>
35 <div id='feedback' style='padding:10px; background:#fff;'></div>
36 </div>
37
38 <a href="#" onClick="disFeedback('<b>test feedback</b>');return false;">test</a>
39 </body>
40
41 </html>
42


You must also have an includes folder that looks something like this...


Enjoy.

Labels: , , ,


posted by ruffin at 5/23/2011 11:59:00 AM

<< Older | Newer >>


Support freedom
All posts can be accessed here:


Just the last year o' posts:

URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt)
* Professional links: resume, github, paltry StackOverflow * Regular Expression Introduction (copy)
* The hex editor whose name I forget
* JSONLint to pretty-ify JSON
* Using CommonDialog in VB 6 * Free zip utils
* git repo mapped drive setup * Regex Tester
* Read the bits about the zone * Find column in sql server db by name
* Giant ASCII Textifier in Stick Figures (in Ivrit) * Quick intro to Javascript
* Don't [over-]sweat "micro-optimization" * Parsing str's in VB6
* .ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); (src) * Break on a Lenovo T430: Fn+Alt+B
email if ya gotta, RSS if ya wanna RSS, (?_?), ยข, & ? if you're keypadless


Powered by Blogger etree.org Curmudgeon Gamer badge
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity.