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.
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, January 31, 2012

And welcome to Events for me. And more importantly, welcome to threads in ExtJS.

How to read Ext.data.JsonStore elements ... store.each?:

No, as I said before the store load is _asynchronous_. Do this instead:

Code:
store.on("load", function(s,rs) {
var myArray = new Array();
store.each(function(record) {
alert(record.data.ID);
myArray.push(record.data.ID);
});
});


Makes it slightly more complicated to debug your data loads, but such is the price of progress with Javascript, I guess.

Labels: ,


posted by ruffin at 1/31/2012 11:20:00 AM
0 comments
Saturday, January 28, 2012

I looked around until something worked without any serious editing, and here's our winner...


   1 public void actuallySendMail ()
2 {
3 // And the winner is from...
4 // http://huseyincakir.wordpress.com/2010/03/11/mono-c-sending-mail-through-gmail/
5 // (fancier lib for sending jive here: http://emailsender.codeplex.com/
6 // and maybe here: http://higlabo.codeplex.com/)
7 MailMessage mail = new MailMessage ();
8 mail.IsBodyHtml = true;
9 SmtpClient SmtpServer = new SmtpClient ("smtp.gmail.com");
10 mail.From = new MailAddress ("yourEmailige@gmail.com");
11 mail.To.Add ("yourEmailige@gmail.com");
12 mail.Subject = "TEST";
13 mail.Body = "This is for <b>testing</b> SMTP mail from GMAIL: "
14 + DateTime.Today.ToString ();
15 SmtpServer.Port = 587;
16 SmtpServer.Credentials =
17 new System.Net.NetworkCredential ("yourEmailige", "yourPasswordige");
18 SmtpServer.EnableSsl = true;
19 ServicePointManager.ServerCertificateValidationCallback =
20 delegate(object s, X509Certificate certificate, X509Chain chain,
21 SslPolicyErrors sslPolicyErrors) {
22 return true;
23 };
24 SmtpServer.Send (mail);
25 }

Labels: , ,


posted by ruffin at 1/28/2012 11:17:00 PM
0 comments
Saturday, January 21, 2012

I tend to be a standards guy myself, but Grubes does an excellent job arguing against using open standards for Apple's iBooks:

It’s the difference between “What’s the best we can do within the constraints of the current ePub spec?” versus “What’s the best we can do given the constraints of our engineering talent?” — the difference between going as fast as the W3C standards body permits versus going as fast as Apple is capable.

I don't know that I think Apple's got another iTunes Music Store for textbooks by any stretch, and I am sure that this argue doesn't mean Apple couldn't have opened their own format for use by anyone on any platform (see C# and Mono for Microsoft surprisingly Doing It Right), but it is a good argument against Glazman's claims (quoted in the same link) that Apple should have embraced standards.

The iBooks format isn’t different just for the sake of being different, it’s different for the sake of being better — not better in the future, after a W3C review period and approval, but better today, in the textbooks you can download and read in iBooks right now.

Again, that doesn't argue for the iBook as a legally-enforced closed ecosystem, but it does argue very well for not using w3c sanctioned standards.

But here's where we have trouble... Grubes sets out three scenarios. 1.) Publishers only use iBooks for ebook distribs. 2.) Publishes integrate iBooks into their current workflow. 3.) Publishers don't use iBooks.

On two, he says...
If they choose to work iBooks Author into their cross-platform production workflow, and it proves to be a pain in the ass, that’s not Apple’s problem.

That's not true. If Apple gains the sort of dominance in ebooks that it has in emusic, then fine, Apple isn't significantly hurt by others going elsewhere. But if, to go all Gladwellian on Grubes' arse, the difficulty of integrating iBooks is the barrier to entry that keeps iBooks from hitting a market tipping point, well, then that certainly is Apple's problem, ain't it?

(Grubes essentially admits this... "(What would be Apple’s problem is if iBooks’s new layout and design features do not prove to be a competitive advantage in the e-book market. But even then, Apple would merely be right back where they were prior to yesterday’s announcements.1)" ... but I think he misses 1.) the opportunity cost of releasing iBooks and 2.) the degree to which the utility of being able to work a new format into your workflow drives competitive advantage. Apple's really not back to where they started before the announcement. Not that Apple can't afford to miss a few more times.)

Labels: , ,


posted by ruffin at 1/21/2012 05:45:00 AM
0 comments
Friday, January 20, 2012

It's recursive call day!

/dev/movabletripe � Recursively chmod directories only:
Recursively chmod directories only
June 19th, 2006
find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;


Had some issues with git similar to these...
Git chmod problem: Checkout screws exec bit . 644 for files, 755 for dirs, apparently because without executable rights, you can only list the dir's contents, not enter them. Whaddyano?

Labels: ,


posted by ruffin at 1/20/2012 03:40:00 PM
0 comments

Recursively delete .svn directories:

So, this will remove every .svn folder beginning from current directory.
source code: bash script


#!/bin/sh
echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`


You may save this script to /usr/bin/csvn (or other binary folder included in path) and use later to get 'clean' project source without typing lengthy commands.

posted by ruffin at 1/20/2012 03:01:00 PM
0 comments

gitk, the built-in (?) graphical git diff client, had an option to ignore "changed" lines that differed only in whitespace, which is something I'd like to keep on all the time when I work with js, cs, and html/aspx files. I'm awfully particular when it comes to good, consistent whitespace, but I don't need to review that to see if I've borked something with a change.

Hopefully this does it, from Help.GitHub - Git cheat sheets:

To ignore whitespace (Ruby is whitespace insensitive)

git config --global apply.whitespace nowarn

Labels: ,


posted by ruffin at 1/20/2012 11:37:00 AM
0 comments
Thursday, January 19, 2012

Can the Math.random() command actually return a 0 or 1? - CodingForums.com:

Can the Math.random() command actually return a 0 or 1?


Fun thread. TL;DR: 0 yes, but more likely you win the lottery. 1 never, except for Safari and Opera in 2002, both of which screwed up their implementation of Math.random(). So if you get a one, it's not exactly your fault.

(Strangely, those two browsers gave 1 something reportedly like 1 in 35,000 runs, which is unbelievably often.)

Labels:


posted by ruffin at 1/19/2012 01:30:00 PM
0 comments
Wednesday, January 18, 2012

Microsoft.Http.dll : The Official Microsoft ASP.NET Forums:
Re: Microsoft.Http.dll

Jul 20, 2010 12:23 PM | LINK

Those are part of the standard .NET Framework install. Can you not find them?

By default in VS2010, the target framework is the ".NET Framework 4 Client Profile" which does not include those DLLs. Change the target framework to the dropdown choice ".NET Framework 4".


Argh. Maybe the third time this happens I'll remember it.

posted by ruffin at 1/18/2012 09:59:00 AM
0 comments

Latest project uses ExtJS for nearly all of its UI. Still a pretty exhaustive toolkit and still seems fairly robust, but I've got to admit that I'm a little wary of abstraction layers. I often create docs in html rather than .doc(x) or what-have-you because I know I can, heck or high water, make html look like I want it to eventually. jQuery initially had me scared, but the ability to reach in with Javascript easily if something borked (and the ease with which you could go javascript parallel to jQuery) won me over, even on a .NET project.

With ExtJS, not so sure. I'm getting the feeling that stuff I do in javascript to get things done might get overwritten by ExtJS with more abandon.

Anyhow, changing a tree node's icon, though not easy or well-documented, was eventually pretty easy once I Firebugged it (another thing I didn't really need with jQuery, though I was a Chrome tools window junkie for a while).

Some decent help here and here (from StackOverflow on both counts).

   1 // (works, so touching the right OM)
2 Ext.select('.x-tree-icon').each(function(el){
3 console.log(el.getWidth());
4 });
5
6
7 //Changles icon. QED
8 Ext.select('.x-tree-icon-leaf').each(function(el){
9 el.setStyle('background-image','url("http://en.wikipedia.org/favicon.ico")'));
10 });
11
12
13 // shorthand also works, but seems to be undocumented:
14 // http://docs.sencha.com/ext-js/3-4/#!/api/Ext.CompositeElement
15 // I don't see it inheriting from something that'd add that.
16 Ext.select('.x-tree-icon-leaf')
17 .setStyle('background-image','url("http://www.apple.com/favicon.ico")');

Labels: , ,


posted by ruffin at 1/18/2012 08:58:00 AM
0 comments



The Wikipedia lock-out is getting some decent play in the media today, but to view it as usual, you only have to turn off javascript.

Still, perhaps the most free press (pun unintended) per line of code ever written.

Labels: ,


posted by ruffin at 1/18/2012 08:37:00 AM
0 comments
Friday, January 13, 2012

Make your website an iPhone web application | Luscarpa Blog:

Hide Safari Components

Add this line if you want that your web app/website don’t show the safari user interface components:

<meta name="apple-mobile-web-app-capable" content="yes" />

Labels: ,


posted by ruffin at 1/13/2012 08:34:00 AM
0 comments
Thursday, January 12, 2012

OpenSebJ by DSebJ: 64 Bit Windows with C# Express .Net and 32 Bit DLL's:

Any way there seems to be a saving grace, you can do development on a 64 Bit OS and set C# Express to specifically target your application to x86, it's just not obvious. Targeting x86 will mean that your application will still run on a 64 Bit OS but will use WoW (Windows on Windows, which is a compatibility layer to backwards support 32 Bit applications) so you won't get the native use of those 64 Bit Int's but you will be able to use your 32 Bit DLL's.

To setup your application to do this you need to
1 G[o] in to the menu option Tools>Options and the in the dialog box tick the box in the bottom right corner to "Show all settings"
2 Once the settings expand go to "Projects and Settings" expand it and click on "General"
3 Check the option which is called "Show advanced build configurations", then close the dialog box
4 Now if you right click on the solution explorer, chose properties
5 Goto "Configuration Properties", now you should be able to see the platform drop down. This will probably have only "Any CPU" selected; if so click on "Configuration Manager"
6 Chose the option "New" under the "Active Solution Platform" drop down box
7 Chose the new platform of x86 and copy your settings from "Any CPU"
8 Then just make sure that your projects in your solution refer to x86 as the platform rather that "Any CPU"

Labels: ,


posted by ruffin at 1/12/2012 09:29:00 PM
0 comments

Integration Ext JS and ASP.NET MVC:

In Visual Studio 2008 there is included support for javascript intellisense. When you put a *.js file in your page and click the Ctrl Shift J shortcut, you will update the intellisense and from this moment you can use it in your code:

Labels: ,


posted by ruffin at 1/12/2012 05:32:00 PM
0 comments

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
0 comments

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
0 comments

Well, this.initialize.apply means what follows; "this" obviously is a reserved word.

DailyJS: Let's Make a Framework: OO Part 2:

Last week I was parading around initialize as if you were intimately familiar with prototype.js or Ruby. I apologise for that. In case I confused you, all you need to know is initialize is our way of saying call this method when you set up my class.

Turing’s Class.create method sets up classes. During the setup it defines a function that will be called when the class is instantiated. So when you say new, it will run initialize. The code behind this is very simple:

  create: function() {
var methods = null,
parent = undefined,
klass = function() {
this.initialize.apply(this, arguments);
};

Labels:


posted by ruffin at 1/12/2012 11:08:00 AM
0 comments
Wednesday, January 11, 2012

http://stackoverflow.com/questions/111102/how-do-javascript-closures-work

Also a decent link from one of those answers, though the explanation is bit long.

http://jibbering.com/faq/notes/closures/

I think the one I like best, though, comes from here, even if the guy's a little snotty replying to one of the comments to his post:

I find the best way to explain them (and the way that I learned what they do) is to imagine the situation without them:

var bind = function(x) {
return function(y) { return x + y; };
}

var plus5 = bind(5);
alert(plus5(3));

What would happen here if JavaScript didn't know closures? Just replace the call in the last line by its method body (which is basically what function calls do) and you get:

alert(x + 3);

Now, where's the definition of x? We didn't define it in the current scope. The only solution is to let plus5 carry its scope (or rather, its parent's scope) around. This way, x is well-defined and it is bound to the value 5.

Labels:


posted by ruffin at 1/11/2012 12:17:00 PM
0 comments

Found Array.prototype.slice.apply in some inherited code. Why would you use the Array type's prototype method? Apparently to slice Array-like objects that aren't really arrays. Why Array's slice works with the non-but-almost-arrays, I don't know.

Understanding Array.prototype.slice.apply(arguments) in JavaScript � Sebastiano Armeli's Tech Blog:

There you go Array.prototype.slice.apply(arguments) converts arguments into an ARRAY.

Here we use one of the methods to call a function in JavaScript, the APPLY method, you can learn more about how to call a function in JS here.
So we apply the slice function to the first argument of the apply function(in this case “arguments”) and we know that the slice() method returns always an Array. We got our Array!


Similarly...

javascript - What's the use of Array.prototype.slice.call(array, 0)? - Stack Overflow:

The DOM usually returns a NodeList for most operations like getElementsByTagName.

Although a NodeList almost feels like an array, it is not. It has a length property like an array does, and a method item(index) to access an object at the given index (also accessible with the [index] notation), but that's where the similarity ends.

So to be able to use the wonderful array methods without rewriting them all for a NodeList, the above line is useful.

Labels:


posted by ruffin at 1/11/2012 11:29:00 AM
0 comments
Tuesday, January 10, 2012

I like Versions for svn, though I've mostly only used it for keeping track of my own code. Now that it looks like I'm going to be using git, I figured it was time to find a visual client. (Not sure why I like visual so much. Perhaps a VSS carryover from years back.)

So we Google up osx - Best visual client for Git on Mac OS X? - Stack Overflow:

I'm looking for a nice, Mac OS X-like, client for Git. As an example, I use Versions for Subversion and it's exactly what I'd like to purchase for Git access. Suggestions?
...
Another notable client is GitHub for Mac. I love our wild and wooly friends at GitHub as much as the next guy, but I think their client is pretty much doodoo. It has the same insane-in-the-membrane limitation as Tower... It has this Twitter-inspired iOS-wannabe interface that seems to prioritize lickability over usability. I think this product should probably have been called Hasbro™ My Little Pony® Baby's First Git Client instead. (emph mine)


Interesting. Wonder what he'd say uncensored by online decorum. Guess I'll give his positive recommendation a try instead. "Update 2011-10-07: SourceTree is good enough that it gradually displaced all other git clients."

posted by ruffin at 1/10/2012 05:13:00 PM
0 comments
Friday, January 06, 2012


From findbigmail.com.

Security is important to us. We only see the size of your emails, not their contents, and we never see your password.


Gosh, I hope so. Dumbest thing I think I've done in a while.

Labels: ,


posted by ruffin at 1/06/2012 03:12:00 PM
0 comments
Thursday, January 05, 2012

Tracing in ASP.NET - Plip's Weblog:

Remember way back to the top of the article, where I showed you an excerpt from the .NET SDK Documentation, it said “Trace statements are processed and displayed only when tracing is enabled.”?

It Lies. ;)


Couple of keys for tracing -- one, Tracing writes get executed even if tracing is off, apparently (well, in most cases duh -- you can't very well avoid "lets say you’ve put a large loop in to your page and it’s outputting data to the Trace log so you can debug it – why do we need to call this when Trace is turned off?" just by having .NET actually follow through on its claim that "Trace statements are processed and displayed only when tracing is enabled." The write is avoided, but the logic's all there) and two, Trace.IsEnabled is the way around that. I'd think a good compiler would compile out the whole Trace slew.

posted by ruffin at 1/05/2012 01:57:00 PM
0 comments
Monday, January 02, 2012

Delivered-To: MyEmailAddress@gmail.com
Received: by 10.180.93.5 with SMTP id cq5cs493894wib;
Mon, 2 Jan 2012 01:00:47 -0800 (PST)
Received: by 10.68.190.135 with SMTP id gq7mr56015631pbc.100.1325494844882;
Mon, 02 Jan 2012 01:00:44 -0800 (PST)
Return-Path: <warning@google-info.us>
Received: from p3plwbeout18-03.prod.phx3.secureserver.net
(p3plsmtp18-03-2.prod.phx3.secureserver.net. [173.201.193.186])
by mx.google.com with SMTP id l1si53388033pbo.151.2012.01.02.01.00.44;
Mon, 02 Jan 2012 01:00:44 -0800 (PST)
Received-SPF: neutral (google.com: 173.201.193.186 is neither permitted nor
denied by best guess record for domain of warning@google-info.us)
client-ip=173.201.193.186;
Authentication-Results: mx.google.com; spf=neutral (google.com: 173.201.193.186
is neither permitted nor denied by best guess record for domain of
warning@google-info.us) smtp.mail=warning@google-info.us
Received: (qmail 4458 invoked from network); 2 Jan 2012 09:00:44 -0000
Received: from unknown (HELO localhost) (173.201.193.244)
by p3plwbeout18-03.prod.phx3.secureserver.net with SMTP; 2 Jan 2012 09:00:43 -0000
Received: (qmail 28039 invoked by uid 99); 2 Jan 2012 09:00:43 -0000
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="utf-8"
X-Originating-IP: 41.151.153.77
User-Agent: Web-Based Email 5.6.09
Message-Id: <20120102020041.385dec6122f6f6d5d049074abbcc73b1.7955149003.wbe
@email18.secureserver.net>
From: "Gmail" <warning@inbox.com>
X-Sender: warning@google-info.us
To: info.support@gmail.com
Subject: Gmail Warning
Date: Mon, 02 Jan 2012 02:00:41 -0700
Mime-Version: 1.0

<html><body><span style=3D"font-family:Verdana; color:#000000; font-size:10=
pt;"><div><div style=3D""><span style=3D""><div style=3D""><div style=3D"">=
<div style=3D""><div style=3D"">We=0A are receiving an "Error Code 433" on =
your account which means your mail=0A account security is inactive on the n=
ew database and you may be =0Adisconnected soon, to keep your account secur=
ity active:</div><div style=3D"">Click Here: <a href=3D"http://fatrat.=
dmkproject.net/joomla/1/ok/secureity.html" title=3D"www.gmail.com" target=
=3D"_blank" style=3D"">www.gmail.com</a></div><div style=3D""> </div><=
div style=3D"">We apologize for any inconvenience and appreciate your coope=
ration and understanding..</div><div style=3D""> </div><div style=3D""=
>Sincerely,</div><div style=3D""> </div><div style=3D"">Email Disclaim=
er</div></div></div></div></span></div></div></span></body></html>


Sheesh. Honestly, unforgiveable.

Labels:


posted by ruffin at 1/02/2012 09:39:00 AM
0 comments

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.