Sunday, November 28, 2010

setup network printer laserjet 5m

The link below will be useful

http://www.tomshardware.com/forum/10387-2-help-installing-laserjet

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1290952858150+28353475&threadId=1187478

First of all. Check the HP MIO JetDirect Card in your LJ 5M. Which model is it? Make sure it is the Ethernet, not Token Ring. If you see an DB9 connector on it, chances are it is a Token Ring which will not work for you. If it is an Ethernet MIO Card, we coudl start to work:

1). Turn the Printer off.
2). Hold down the big [Go] button and turn the printer on.
3). Release the [GO]button when the msg" Cold Reset" appears.
Now. Follow the Procedure below to set the IP address on your printer manually:

>>>
23). Set MIO Manually
Procedure by Chris Emmanuel
To configure TCP/IP parameters from the control panel, use the following instructions:

Press the MENU button until HP MIO 1 (or 2), or HP EIO 1 (or 2) appears.

Press the ITEM button until CFG NETWORK = NO appears.

Press the PLUS or VALUE button until CFG NETWORK = YES appears.

NOTE: The CFG NETWORK = XXX (XXX being YES or NO) is a toggle, not a permanent setting. Changing it to YES allows the settings to be changed at that time. It will appear as CFG NETWORK = NO each time this menu is accessed.

Press SELECT or RESUME.

Press ITEM repeatedly until CFG TCP/IP = NO appears.

Press the PLUS or VALUE button until CFG TCP/IP = YES appears.

NOTE: The CFG TCP/IP = XXX (XXX being YES or NO) is a toggle, not a permanent setting. Changing it to YES allows the settings to be changed at that time. It will appear as CFG TCP/IP = NO each time this menu is accessed.

Press SELECT or RESUME.

Press the ITEM repeatedly until BOOTP = YES* appears.

Press the PLUS or VALUE button until BOOTP = NO appears.

NOTE: When using BootP or DHCP, keep the setting BOOTP = YES *. The BootP or DHCP server will configure the TCP/IP parameters on the HP Jetdirect. No other TCP/IP configuring is necessary.

Press SELECT or RESUME.

The following two steps apply to the HP Jetdirect 610n cards only:

DHCP=YES appears.

Press the PLUS or VALUE button until DHCP = NO appears.

NOTE: When using DHCP, keep the setting DHCP = YES *. The DHCP server will configure the TCP/IP parameters on the HP Jetdirect. No other TCP/IP configuring is necessary.

Press SELECT or RESUME.

Press ITEM until IP BYTE 1 = (value*) appears.

Press the PLUS or VALUE button, until the desired value of the first byte of the IP address appears. By pressing and holding the PLUS or VALUE button, the value will scroll rapidly (HP LaserJet 4000, 5000, and 8000 printers have a MINUS button to decrease the value).

Press SELECT or RESUME to save the value.

Press ITEM to continue. Repeat Steps 11-13 to configure the remaining bytes of the IP address.

Repeat Steps 11-13 to configure the subnet mask bytes (SM BYTE 1=), syslog server IP address (LG BYTE 1=), default gateway (GW BYTE 1=), and timeout (TIMEOUT=).

Press ONLINE, GO or MENU. Print a self-test page to verify the IP settings.

If the test page does not show the correct settings, power cycle the printer and reprint the test page.

##############################################
Installing the laserjet after setup.

(1) make sure one can ping and telnet to the printer
(2) In Mac, one can use HP laserjet socket to install the printer.
(3) In windows, one can install the internet printer.

iphone car charger.

http://wiki.siftah.com/IPhone_3G_3GS_USB_Cigarette_Lighter_Socket_Charger

Thursday, November 18, 2010

install perl/Tk on mac.

http://www.lehigh.edu/~sol0/Macintosh/X/ptk/

You can use the Perl 5.8.6 that comes with Tiger or build it yourself. Now fetch the Perl/Tk distribution, (Tk-804.027) . Unpack Perl/Tk and build it using the standard idiom:
tar -zxvpf Tk-804.027.tar.gz
cd Tk-804.027
perl Makefile.PL
make
make test
sudo make install
Helpful comments from others on my install instructions here.

color-coded ls command in mac

alias ls="ls -G"

http://hints.macworld.com/article.php?story=2000112201143624

Wednesday, November 17, 2010

web scarping in perl

http://search.cpan.org/dist/Web-Scraper/

http://teusje.wordpress.com/2010/05/02/web-scraping-with-perl/

http://www.slideshare.net/miyagawa/webscraper-for-sfpm-lt

http://www.catalyzed.org/2009/09/spiderin---scraping-information-with-webscraper.html

http://perldesignpatterns.com/?WebScraping

print a figure in landscape in matlab

http://www.mathworks.com/support/solutions/en/data/1-3TQNHK/index.html?product=ML&solution=1-3TQNHK

Subject:
How can I print a figure to pdf in landscape with the right scaling in MATLAB 7.3 (R2006b)?

Problem Description:
When I print my figure in landscape to pdf I always see a scaled picture which doesn't fit the paper size.
subplot(2,2,1), plot(randn(100,1));
subplot(2,2,2), plot(randn(200,1));
subplot(2,2,3), plot(randn(300,1));
subplot(2,2,4), plot(randn(400,1));

h=gcf;
set(h,'Position',[50 50 1200 800]);
set(h,'PaperOrientation','landscape');
print(gcf, '-dpdf', 'test.pdf')
Solution:
There are many options to fill the paper size in the printed pdf file:

1. You can change the option "PaperPositionMode" to "auto". This will adjust the size of the printed figure:

h=gcf;
set(h,'PaperPositionMode','auto');
set(h,'PaperOrientation','landscape');
set(h,'Position',[50 50 1200 800]);
print(gcf, '-dpdf', 'test1.pdf')

2. A better solution as changing the "Position" itself would be adjusting the "PaperPosition" to the "PaperSize":
h=gcf;
set(h,'PaperOrientation','landscape');
set(h,'PaperPosition', [1 1 28 19]);
print(gcf, '-dpdf', 'test2.pdf');
Then the option "PaperPositionMode" wouldn't change the appearance even if it is set to "manual".

3. Alternatively you can set "PaperUnits" to "normalized" and "PaperPosition" to "[0 0 1 1]". This will also have the effect of filling the page in the pdf file automatically:
h=gcf;
set(h,'PaperOrientation','landscape');
set(h,'PaperUnits','normalized');
set(h,'PaperPosition', [0 0 1 1]);
print(gcf, '-dpdf', 'test3.pdf');

Wednesday, November 10, 2010

making good figures in matlab

http://saig.phys.ualberta.ca/toolbox/Matlab/making_figures.html

no tick on one side of the axis.

https://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/824cb990c0c51e1?hl=en

Set XTickMode and YTickMode to 'manual',
set XTick and YTick to the empty vector, [],
then draw the tick marks in "by hand".
There is no Axes Property in Matlab that would give you the
tick style you are asking for.
Alternately.... once you have drawn the plot,
get(gca,'Color') to find the background colour
get(gca,'XLim') to find the x data range
get(gca,'YLim') to find the y data range
now draw a patch() rectangle near the top of the plot, using
the fetched colour as the patch colour;
Use a minimum X just slightly bigger than the lower limit of the
X data {about XLim(1) + 0.003 * (XLim(2) - XLim(1)) seems to work},
Use a maximum Y just slightly lower the the upper limit of the
Y data {about YLim(2) - 0.003 * (YLim(2) - YLim(1) seems to work}.
It appears that you can use a maximum X which is the same as the
XLim(2).
The minimum Y is not critical -- big enough to cover up the tick
marks, {about YLim(2) - 0.03 * (YLim(2) - YLim(1) seems to work}.
Set the 'EdgeColor' property of the patch to 'none'.
You can specify the patch using four vertices for the rectangle, as
it will be closed automatically, but I prefer not to rely on the
automatic closing.
[xmin xmax xmax xmin xmin], [ymin ymin ymax ymax ymin]
Repeat the same process, drawing a patch() rectangle near the
right side of the plot, again using the fetched colour as the patch
colour, using similar margins as for the above case.
Now the final trick:
axchild = get(gca, 'Children');
set(gca, 'Children', [axchild(3:end) axchild(1:2)]);
what this does is take the two patches you just created, and push them
underneath everything else you drew on the plot. They will still be
above the tick-marks and so will still hide the tick marks, but they
will be below the rest of your graphics. That's why the rectangle
thicknesses are not important -- the rectangle will be pushed under
the other graphics.
But the 0.003 margins I mentioned are still needed: without them, the
patch will cover over part of the box. You may need to play with the
0.003 figure; probably a better figure would be 1.25 pixels-worth of
the figure size (set the figure units to pixels and get its Position
and look at the 3rd and 4th entries to get the sizes in pixels). If
your margins are too small then part of the plot box will be obscured;
if your margins are too big, then part of the tick marks will be
left showing.

reposition axis label.

xlabh = get(gca,'XLabel');
set(xlabh,'Position',get(xlabh,'Position') - [0 .2 0])
The above would move the xlabel down by 0.2. The default units is
'data'.

https://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/0e0834478ebfa2e1?fwc=1&hl=en&pli=1

ylab=get( gca, 'YLabel' );
set( ylab, 'Position',get( ylab, 'Position' )-[0 .05 0]);

move the ylabel down by 0.05

Thursday, November 04, 2010

check mac model and specifications.

http://www.everymac.com/ultimate-mac-lookup/?search_keywords=MacBookPro5%2C1

it is pretty good site.

http://www.everymac.com/systems/apple/macbook_pro/stats/macbook-pro-core-2-duo-2.4-aluminum-15-late-2008-unibody-specs.html

this one easily check the maximum memory.
http://www.everymac.com/systems/by_capability/actual-maximum-ram-capacity-of-macs.html

Suppress output when a background job is finished

http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2005-05/0727.html

use subshell

(emacs &)

will not output the pid number.