Microsoft Office 2007 Save as PDF or XPS

September 21, 2009 by cunyalen1

2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS

  • Microsoft Office Access 2007
  • Microsoft Office Excel 2007
  • Microsoft Office InfoPath 2007
  • Microsoft Office OneNote 2007
  • Microsoft Office PowerPoint 2007
  • Microsoft Office Publisher 2007
  • Microsoft Office Visio 2007
  • Microsoft Office Word 2007

Very convenient. You don’t need acrobat printer.

Retrieve data from .fig matlab figure file

July 21, 2009 by cunyalen1

1. If your fig file is opened, pull it to active current window.

To find what data you want, check properties: get(get(gca,’Children’)) .

Let’s say, you have a curve and want get data ‘XData’ and ‘YData”.

 x = get(get(gca,’Children’),’XData’);

 y = get(get(gca,’Children’),’YData’);

If you plot(x,y), you’ll get the same the same curve.

If your figure is not opened yet. You can open it and do 1.

We can also use gcf. gcf is the handle of the current figure; gca is the handle of the current axis.

“gca” is the same as ”get(gcf,’Children’) “.

That means, we can also do this:

get(get(gcf,’Children’),’Children’),’XData’)

We can also break it down to steps with struct or objects using gca or gcf.

  • hAxes = get(gca);
  • hProperties = hAxes.Children;
  • x = get(hProperties, ‘XData’);

or

  • hFig  = get(gcf);     %save figure handle object to a struct
  • hAxes = hFig.Children;
  • hProperties = get(hAxes);
  • hLine = hProperties.Children;
  • x = get(hLine, ‘XData’);

2. We can open the figure and store the handle to a variable:

fighandle = openfig(‘myfigure.fig’), which is basically the same as ”gcf” if we open the figure first. Then we can do the same thing as in 1.

get(get(fidhandle,’Children’),’Children’),’XData’)

3. We don’t open the figure, but load the figure file into a struct variable.

myFigStruct = load(myfigure.fig’,'-MAT’) ;

or

myFigStruct = load(‘-MAT’,myfigure.fig’);

Note: the root element of the figure is called ‘hgS_070000′ for
Matlab7+ figures – it’s called something else for figures saved in
Matlab6- (probably ‘hgS_06…’ or something).

Then find the data element in the hierarchy, like ‘XData’:

myFigStruct.hgS_070000.children.children.properties.XData

4. Save the data of the figure file to a .mat file.

  • open .fig file.
  • saveas(gcf,’mydata’,'mmat’)   %save data of the .fig file to .mat file called mydata.mat
  • load ‘mydata’
  • The object variable  ‘mat’ now contains all your data. To extract it from it, do: x1=mat{1}, x2=mat{2} etc.

5.  If the figure is a line, we can also use findobj or findall from the figure handle.

fighandle=openfig(‘myfigure.fig’);
ax=findall(fighandle,’Type’,'line’);
x=get(ax,’XData’);
y=get(ax,’YData’);

or

s=hgload(‘myfigure.fig’);
h = findobj(s,’Type’,'line’);
x=get(h,’xdata’);
y=get(h,’ydata’);
 

view.atdmt.com spyware removal

October 14, 2008 by cunyalen1

I kept getting ‘Sorry, we couldn’t find http://view.atdmt.com/MSR/iview/yhxxxlam0010000079msr/direct%3Bwi.728%3Bhi.90/01/%3Ftime”  with IE7.

I found a few solutions. Check which one works for you.

1. Run regedit, search for atlassolutions. Remove it and that will fix the problem.

2. IE->Tools->Manage Add-ons->Enable or Disable Add-ons

Find CBrowserHelper under names and highlight it (the publisher should be Dell). Then select “disable” in the “Settings” box on the bottom left side. OK and close IE.

3. Window Key + E to oepn file browser -> Tools->Folder Options->Tab View->Show hidden files and folders. Then go to C:\Documents and Settings\User Name\Local Settings\Temp, delete all files. You can also go to the current user temp folder by run  %temp%.

4. Create a .reg file with the following content and run:

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
“Do404Search”=hex:01,00,00,00
“Search Page”=”http://www.microsoft.com/isapi/redir.dll?prd=ie&ar=iesearch”
“Search Bar”=”http://search.msn.com/spbasic.htm”
“Use Custom Search URL”= dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\URLSearchHooks]
“{CFBFAE00-17A6-11D0-99CB-00C04FD64497}”=”"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl]
“”=”http://home.microsoft.com/access/autosearch.asp?p=%s”
“provider”=”"
” “=”+”
“&”=”%26″
“+”=”%2B”
“#”=”%23″
“?”=”%3F”
“=”=”%3D”

[HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Main]
“Search Page”=”http://www.microsoft.com/isapi/redir.dll?prd=ie&ar=iesearch”
“Search Bar”=”http://search.msn.com/spbasic.htm”

[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Search]
“SearchAssistant”=”http://ie.search.msn.com/{SUB_RFC1766}/srchasst/srchasst.htm”
“CustomizeSearch”=”http://ie.search.msn.com/{SUB_RFC1766}/srchasst/srchcust.htm”
“Default_Search_URL”=”http://www.microsoft.com/isapi/redir.dll?prd=ie&ar=iesearch”

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main]
“Default_Search_URL”=”http://www.microsoft.com/isapi/redir.dll?prd=ie&ar=iesearch”
“Search Page”=”http://www.microsoft.com/isapi/redir.dll?prd=ie&ar=iesearch”

[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL]

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL]

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL\DefaultPrefix]
@=”http://”

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL\Prefixes]
“ftp”=”ftp://”
“gopher”=”gopher://”
“home”=”http://”
“mosaic”=”http://”
“www”=”http://”

Source:

http://forums.techguy.org/malware-removal-hijackthis-logs/432534-view-atdmt-com-spyware-removal.html
http://forums.majorgeeks.com/showthread.php?t=62461

The 2nd solution for CBrowserHelper fixed my problem.

Delay, Pause, Wait or Sleep in VB

August 7, 2008 by cunyalen1

Use SetWaitableTimer: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q231/2/98.asp&NoWebContent=1

Instead of lNumberOfSeconds As Long, I use lNumberOfSeconds As Double. So I can use 0.3 second (300 milliseconds).

Using Sleep: http://www.vbforums.com/showthread.php?t=357961

Using DoEvents and Timer: http://bytes.com/forum/post59842-8.html

Start another program using Shell and wait until it finishes: http://www.vb-helper.com/howto_shell_wait.html

How to pause and restart a thread : http://www.tek-tips.com/faqs.cfm?fid=6580

Matlab Matrix

May 15, 2008 by cunyalen1
  • Matrix A, B. What’s A(B)?

1. Elements of B are logical.

A =[1 2; 3 4]

1 2

3 4

B = [1 0; 1 0]

1 0

1 0

A(B) =

1 0

3 0

2. Elements of B are positive integers.

B = [1 1;2 2]

A(B) =

1 1

3 3

  • Matrix A is x dimension A(:,:,:…), how to copy A to matrix B(n,:,:,:,…)’s first dimension B(1,:,:,:…)?

d = size(A);

B = zeros([n size(A)]);

B( 1, : ) = A( : );

How to deal with .001, .002 … files

April 29, 2008 by cunyalen1

It could be .iso.001, .iso.002 … or .part1.rar, .part2.rar … or .r01, .r02 … etc etc.

There’re two possibilities to extract these files. 1. These are slpitted files during compression using winrar. Put all files in one folder. Just extract the first file, it will extract everything. 2. These are splitted files using splitting software such as cutncopy, hjsplit etc. We need use them to joint all files together.

There’re some explaination links:

http://www.slyck.com/ng.php?page=10

http://forums.afterdawn.com/thread_view.cfm/248020

http://answers.yahoo.com/question/index?qid=20071006003758AA4XgLb

Show hidden files and folders

April 29, 2008 by cunyalen1

 

I got a problem with my computer. I can’t show hidden files and folders. If I choose “Show Hidden Files and Folders”, it will be change back to “Do Not …” . I did a search on the Net. The second solution solved my problem.

Solution 1:

  1. Start->Run->Regedit
  2. Go to:

//HKEY_CURRENT_USER//SoftWare//MicroSoft//Windows//CurrentVersion//Explorer//Advanced

  1. Set key Hidden = 1
  2. Refresh

Solution 2:

If you got RavMon virus etc, you may need this.

  1. Start->Run->Regedit
  2. Go to:
     

    HKEY_LOCAL_MACHINE//SoftWare//MicroSoft//Windows//CurrentVersion//Explorer//Advanced

  3. SET DWORD key CheckedValue = 1If it’s not DWORD value, delete it and recreate as DWORD value and set it to 1.
  4. Refresh

 

Foxit PDF Reader/Editor

April 29, 2008 by cunyalen1

Acrobat is very powerful. But the it’s pretty big taking a lot of space and memory. With version 8+ professional, people can create fillable and savable forms. For those files with un-savable forms, people can only print it after they fill out the form which sometimes make things annoying. Most of times, we just use it to read and print papers stuff. When we are viewing a website with a pdf file and we want to open it. Then we need a while to wait for the acrobat to bootup. For some computers, it could cause problems if the file is pretty big or you have a lot of files to open.

I started using foxit reader/editor a while ago. It seems this is a pretty nice alternative. It’s very tiny small which takes a little harddrive space and memory which of course will also vary for different sized pdf files. And, it could even edit any file and SAVE it even no matter if it’s a fillable or savable form. So I would use foxit as my main pdf reader. If necessary, e.g. I want to do some advanced work that foxit can’t do, I run acrobat. Actually, there are a lot of advanced add-on features with foxit that we could download anytime. But those are not free. The foxit editor can basically create a pdf file like using word. If you could get a cracked editor, you can use it without any marks printed on your file.

Foxit PDF Tools Download:

http://www.foxitsoftware.com/downloads/

“include” a .m file into another .m file

April 29, 2008 by cunyalen1
If you’re trying to call the main function of another file inside your first
file, just call it like any other MATLAB function.
If you’re trying to call a subfunction in the second file from within your
first file, you can have the main function in the second file be a
“switchyard” that accepts the name of the subfunction to call:

% begin switchyard.m
function y = switchyard(fcn, x)
% Call as:
% y = switchyard(‘mycos’, 1:10);
% or
% y = switchyard(‘mysin’, pi);

y = feval(fcn, x);

function y = mycos(x)
y = cos(x);
function y= mysin(x)
y = sin(x);
% end switchyard.m

or you can have the main function return a handle to the subfunction and
call them that way:

% begin createhandles.m
function s = createhandles
% Call as:
% s = createhandles
% y1 = s.mycos(1:10);
% y2 = s.mysin(pi);

s.mycos = @mycos;
s.mysin = @mysin;

function y = mycos(x)
y = cos(x);
function y= mysin(x)
y = sin(x);
% end createhandles.m

If the other file is a script, just run it by typing the name of the script.

 

Hello world!

March 10, 2008 by cunyalen1

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!