Wednesday, June 15, 2011
Sunday, June 12, 2011
Install DCP-7040 on Ubuntu 64-bit..
1. sudo apt-get install brother-cups-wrapper-laser
2. Plug the printer into the USB slot. When asked to install a Printer, use the DCP-7020 (no 64-bit driver exists for the DCP-7040) and select the first option for the Brother DCP-7020 foomatic/hl1250 (first option). The ljet4 (third option) will only cause you to print blank pages.
3. Go to http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html and install brscan/brscan2/brscan3 depending on the Brother unit. In this case, brscan3 is what is needed.
4. sudo dpkg -i /tmp/brscan3-0.2.11-4.amd64.deb
2. Plug the printer into the USB slot. When asked to install a Printer, use the DCP-7020 (no 64-bit driver exists for the DCP-7040) and select the first option for the Brother DCP-7020 foomatic/hl1250 (first option). The ljet4 (third option) will only cause you to print blank pages.
3. Go to http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html and install brscan/brscan2/brscan3 depending on the Brother unit. In this case, brscan3 is what is needed.
4. sudo dpkg -i /tmp/brscan3-0.2.11-4.amd64.deb
Friday, June 10, 2011
Using Facebook's Batch API...
If you've built any type of Facebook API integration, chances are that you will gravitate towards batching up your API network requests. Since you are allowed a maximum of 20 requests per batch, you can effectively speed-up your overall performance by 14-15x (my own basic measurements) There may also be overall throttle limits to consider, but in general, the performance is a huge boost from sending individual network calls for each request.
While the API documentation is posted at http://developers.facebook.com/docs/api/batch/, there are several things that aren't well documented.
While the API documentation is posted at http://developers.facebook.com/docs/api/batch/, there are several things that aren't well documented.
- 1. You must provide some type of access token to issue Facebook Batch API requests. Even if you have access_token within the query strings of each individual request, Facebook still expects you to provide some type of access_token= in the POST request. You may encounter 404 errors without providing the access_token parameter. The access_token= parameter can either be a user OR application token. While there may be situations where you want to use a user token, what if you wanted to fetch multiple pages with different user tokens? What if the user's token has expired or he/she has changed the password, invalidating this token? For these situations, you can use the application token (http://developers.facebook.com/docs/authentication/), using the technique described in the "App Login" section. The code in Python looks like the following:
def fb_get_app_token():
""" For Facebook API requests, we need to get an app token to make Graph API calls. We can't
use fb_get_with_params() since it expects either/and a user/asset, which we don't use. Also,
the response from Facebook isn't in JSON format so we have to regex parse it."""
try:
token_request = urllib.urlencode({ 'client_id': settings.FACEBOOK_APP_ID,
'client_secret': settings.FACEBOOK_SECRET_KEY,
'grant_type': 'client_credentials'
})
token = urllib2.urlopen("https://graph.facebook.com/oauth/access_token?%s" % token_request).read()
except urllib2.HTTPError, e:
logging.debug("Exception trying to grab Facebook App token (%s)" % e)
return None
matches = re.match(r"access_token=(?P.*)", token).groupdict()
return matches.get('token', '')
You can then use this access_token as the fallback access token.
2. Buried within the Batch API section is the "Specifying different access tokens for different operations". The documentation states that the "access_token should be query string or form post parameter". There isn't an example of how to use it, but basically the access_token should be set in the relative_url path. curl -F ‘access_token=…’ \
-F ‘batch=[{ “method”: ”GET”, \
"relative_url": "me?access_token=ACCESS_TOKEN1", \
}, \
{ "method": "GET", \
"relative_url": "124456?access_token=ACCESS_TOKEN2", \
}]'
If you try to put a separate "access_token" : "ABC", Facebook won't recognize the token. You must put it in the query string for GET requests: { "method": "GET", \
"access_token" : ACCESS_TOKEN,
"relative_url": "124456?access_token=ACCESS_TOKEN2", \
}]'
3. The JSON dictionary that is returned must be JSON-decoded twice: once to retrieve the overall response, and then another to decode the 'body' key. The JSON decoder in Python doesn't seem to know how to decode nested dictionaries.
Printing on Windows 64 with the Konica Minolta PagePro 1350W
Konica apparently does not have a native Windows 64-bit driver, which apparently is required because the Minolta PagePro 1350W is sort of like a WinModem in that it contains no PostScript/PCL processor. Therefore, while the company apparently provides univeral drivers, http://kmbs.konicaminolta.us/content/support/universaldrivers.html, none of these will work. If you try to print to the 1350W, you'll find that the green LED lights up but nothing comes out.
The explanation is described here:
http://www.printerforums.net/substitute-driver-konica-minolta-pagepro-1350w-t4848.html
The workaround is to use a WinXP machine as the print server, and install the PagePro 1400W on your Windows 7 machine (http://printer.konicaminolta.com/support/current_printers/PP1400W_sup.htm#Drivers) You must also disable Bidirectional Printing since the printer driver tries to get an acknowledgment back from the printer before printing the full document. The steps to setup the print server is described below:
http://tiredblogger.wordpress.com/2007/03/11/howto-pagepro-1350w-on-x64-vista/
The explanation is described here:
http://www.printerforums.net/substitute-driver-konica-minolta-pagepro-1350w-t4848.html
Instead, the Windows GDI display information is passed to your Windows print driver--which in this case is actually the RIP, the raster image processor itself for this marking engine. Once the RIP is finished (it uses your host computer's power to do all the work in turning your document into a laser bitmap), it sends the bitmap to the marking engine over the USB cable.
The workaround is to use a WinXP machine as the print server, and install the PagePro 1400W on your Windows 7 machine (http://printer.konicaminolta.com/support/current_printers/PP1400W_sup.htm#Drivers) You must also disable Bidirectional Printing since the printer driver tries to get an acknowledgment back from the printer before printing the full document. The steps to setup the print server is described below:
http://tiredblogger.wordpress.com/2007/03/11/howto-pagepro-1350w-on-x64-vista/
Saturday, June 4, 2011
Scrubbing hard drives clean
This ISO image called "Boot and Nuke" works well to scrub your hard drives for donating...
http://sourceforge.net/projects/dban/files/dban/dban-2.2.6/dban-2.2.6_i586.iso/download
http://sourceforge.net/projects/dban/files/dban/dban-2.2.6/dban-2.2.6_i586.iso/download
Thursday, June 2, 2011
jQuery v1.4 and live handlers on IE
This bug report explains why setting 'disabled' on elements through IE were not being disabled...works for elements that use bind() but not live()....it has been fixed since 1.5. It explains a lot why setting 'disabled' to work on Firefox/Chrome but still has issues on IE. Upgrading to 1.5/1.6 should resolve the issue, though the Ajax module has been completely rewritten to allow for chaining callback routines (see http://blog.jquery.com/2011/01/31/jquery-15-released/).
http://bugs.jquery.com/ticket/6911
jQuery 1.4.3:
jQuery 1.5.2:
http://bugs.jquery.com/ticket/6911
jQuery 1.4.3:
function liveHandler( event ) {
var stop, maxLevel, elems = [], selectors = [],
related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
if ( typeof events === "function" ) {
events = events.events;
}
// Make sure we avoid non-left-click bubbling in Firefox (#3861)
if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
return;
}
jQuery 1.5.2:
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery._data( this, "events" );
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
return;
}
Wednesday, June 1, 2011
htmlStorage bug in Facebook's new SDK ..
Facebook must have rolled out a new SDK that breaks IE7. You can't see the problem in IE8/IE9 and simulating the bug within the browser since they already support the localStorage object. You have to load an IE7 browser to see the issue:
http://bugs.developers.facebook.net/show_bug.cgi?id=18039
If you put this line in your JavaScript code before the Facebook code loads,
The problem appears to happen inside the FB.init code:
Commenting out the FB.TemplateData.init() and FB.TemplateData.update code fixes things..
http://bugs.developers.facebook.net/show_bug.cgi?id=18039
If you put this line in your JavaScript code before the Facebook code loads,
if (typeof(localStorage) === "undefined") {
var localStorage = {};
}
The problem appears to happen inside the FB.init code:
FB.provide('', {
initSitevars: {},
init: function(a) {
FB.TemplateData.init();
FB.Event.subscribe('auth.sessionChange', FB.TemplateData.update);
Commenting out the FB.TemplateData.init() and FB.TemplateData.update code fixes things..
Subscribe to:
Posts (Atom)