Solution for Matlab 7.0 R14 on XP Pro Start up Corruption

概要:
matlab会因为某些设置不能启动,corrupt。
删除配置文件可以解决。
主要的配置文件在user profile中的MATLAB.prf文件中。
也有一部分在-nodesktop参数启动时创建在windows安装目录的matlab.ini中。
后者比较难被发现(我用filemon.exe找到)。

I fixed the problem exactly as discribed above.
Setting of “Echo on” does cause the problem.
The setting stored in “C:\windows\matlab.ini” but not matlab.prf in
user profile. (I run Matlab 7.01 R14 on Windows XP SP2 En)
Modifiy “Echo on” setting in the matlab.ini to 0, then done.

It seems matlab.ini was generated when running “matlab.exe -nodesktop”
mode.
So reinstall the software helps nothing.

I think this is a bug of this version matlab.

[现象和环境. Problem and Environment]

Matlab 7.0.0 R14 automatically shuts down immediately after starting.
This computer has Windows XP Pro SP1, Intel P4.

Below is a copy of the log file:

————————————————————————
Segmentation violation detected at Sat Oct 29 19:39:48 2005
————————————————————————

Configuration:
MATLAB Version: 7.0.0.19920 (R14)
Operating System: Microsoft Windows XP
Window System: Version 5.1 (Build 2600)
Processor ID: x86 Family 15 Model 2 Stepping 7, GenuineIntel
Virtual Machine: Java 1.4.2 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM
(mixed mode)
Default Charset: ibm-5348_P100-1997

Register State:
EAX = 78b9a3c0 EBX = 50000000
ECX = 00000000 EDX = 00000000
ESI = 79066dce EDI = 00000001
EBP = 00cdeb60 ESP = 00cdeb60
EIP = 789b9225 FLG = 00010246

Stack Trace:
[0] m_interpreter.dll:public: bool __thiscall
dbstopIfTable::getIdentifier(char const *)(0×78b9a3c0 “any”,
0×00cdeb80 “HñÍ”, 0×789cf2a0, 0×78b9a3c0 “any”) + 5 bytes
[1] m_interpreter.dll:_inGetStopIfWarning(0×78b9a3c0 “any”,
0×789b109b, 0×50000000, 0×00cdf148 “hñÍ”) + 18 bytes
[2] m_interpreter.dll:_inRefreshGlobalJitEnablement(0×77f78b01,
0×79066e34 “Matlab Settings”, 0×79066fc8 “Echo On”, 0) + 32 bytes
[3] uiw.dll:void __cdecl uiwProfileCmds(int,struct HWND__ *)(2,
0×00160516 “JóJóJóJóJóJó”, 17, 0×00160516 “JóJóJóJóJóJó”) + 321 bytes
[4] uiw.dll:void __cdecl opnCmdWnd(struct HINSTANCE__ *,int,char
*,bool)(4194304, 1, 0×79067014 “MATLAB Command Window”, 1) + 173
bytes
[5] uiw.dll:_uiwSetupWindows(4194304, 1, 1, 0) + 187 bytes
[6] mcr.dll:private: void __thiscall
mcrGlobalOptionsInternal::mcr_complete_initialization(void)(0×01545f88
” T@”, 0, 0×01545f88 ” T@”, 0×77f488f5) + 64 bytes
[7] mcr.dll:public: void __thiscall
mcrGlobalOptionsInternal::mcr_initialize(class MfileReader
*,bool)(0×01545f88 ” T@”, 0, 0×77e6df37, 0×015420c0) + 70 bytes
[8] mcr.dll:public: __thiscall mcrInstance::mcrInstance(class
mcrOptions &,class MfileReader *)(0×00cdff04, 0×01545f88 ” T@”,
0×0004238a “-logfile log”, 0×4d5c3a43) + 265 bytes
[9] MATLAB.exe:0×00401c86(4194304, 0, 0×0004238a “-logfile log”,
0×015420c0)
[10] MATLAB.exe:0×00403e45(0×80000002, 0×00d5dec8, 0×7ffdf000,
0xef0b8cf4)
[11] kernel32.dll:0×77e762b6(0×00403cc0 “jth(U@”, 0, 0, 1245343)
MATLAB program terminated.

The log file should contain some instructions at the bottom: if you can
consistently reproduce this segmentation violation please send it to our
technical support staff. If you can’t consistently reproduce it, send it to
the segv address at mathworks.com.

Based on a quick glance at the log file,
[解决办法. Solution]
try going into your preferences
directory (it should probably be in your Windows profile, under Application
Data\MathWorks\MATLAB\R14) and rename the MATLAB.prf file to oldMATLAB.prf.

If that resolves the issue, please send the older file to support so they
can determine what was wrong with that file.

*snip log file*


Steve Lord
s…@mathworks.com

Mark Couwenberg nospam
Nov 2, 9:26 pm show options
Newsgroups: comp.soft-sys.matlab
From: “Mark Couwenberg” - Find messages by this author
Date: Wed, 2 Nov 2005 08:26:04 -0500
Local: Wed, Nov 2 2005 9:26 pm
Subject: Re: Segmentation violation Matlab 7.0 R14 on XP Pro
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

I tried to find the matlab.prf file, but it was not there. Therewas 1
directory from my older version of Matlab (R13). I copied this one
and renamed as R14, but the results of the logfile are the same all
the time.
What’s more: the logfile how I copied in the 1st message is exactly
the one I get, so there are no instructions at all. The last line is
something with kernel32. I have no idea how to interpret this and use
it for faultfinding.

- Hide quoted text -
- Show quoted text -
Steven Lord wrote:

Steven Lord
Nov 2, 9:37 pm show options
Newsgroups: comp.soft-sys.matlab
From: “Steven Lord” - Find messages by this author
Date: Wed, 2 Nov 2005 08:37:55 -0500
Local: Wed, Nov 2 2005 9:37 pm
Subject: Re: Segmentation violation Matlab 7.0 R14 on XP Pro
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

“Mark Couwenberg” wrote in message

news:ef19cd9.1@webx.raydaftYaTP…

In that case, since it sounds like you can consistently reproduce this
segmentation violation, send it in to the technical support staff. They’ll
see if there’s anything similar in their database, and contact the
developers if necessary to figure out what’s wrong.


Steve Lord
s…@mathworks.com

zh.char…@gmail.com
Dec 2, 5:52 pm show options
Newsgroups: comp.soft-sys.matlab
From: zh.char…@gmail.com - Find messages by this author
Date: 2 Dec 2005 01:52:44 -0800
Local: Fri, Dec 2 2005 5:52 pm
Subject: Re: Segmentation violation Matlab 7.0 R14 on XP Pro
Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse

I fixed the problem exactly as discribed above.
Setting of “Echo on” does cause the problem.

[解决办法补充. supplement on Solution]

The setting stored in “C:\windows\matlab.ini” but not matlab.prf in
user profile. (I run Matlab 7.01 R14 on Windows XP SP2 En)

Modifiy “Echo on” setting in the matlab.ini to 0, then done.

It seems matlab.ini was generated when running “matlab.exe -nodesktop”
mode.
So reinstall the software helps nothing.

I think this is a bug of this version matlab.

Regards,

Charlie Zhu
zh.char…@gmail.com

End of messages

Operation result by-Value or by-Reference [Python]

对一个对象的操作使这个对象有所变化。
这种情况很常见,比如“去除一个list的后三个元素”。
我首先想到的方法是:

>>> a = [1,2,3,4,5,6,7]
>>> a = a[:-3]
>>> a
[1, 2, 3, 4]
>>>

这样的确能使a得到想要的改变,但实际上a“已经不是原来那个a”了。

>>> id(a)
20363584
>>> a = a[:-3]
>>> id(a)
20365224

a所代表的对象已经不同。id函数可以得到对象的标识(identify),从而区别不同对象。

这种情况有时会产生很致命的错误。比如a作为参数传递给一个函数,因为Python的函数参数调用是“引用传值,pass-by-reference”的,所以可能希望函数内对a的操作影响到函数外a对象,这时上面的情况就会发生错误。
正是这个错误耽误了我半天的时间来debug。
针对不同的对象,解决这个的问题方法不同。仅对这里提出的问题做个正解:

>>> a = [1,2,3,4,5,6,7]
>>> id(a)
14198904
>>> del a[-3:]
>>> id(a)
14198904
>>> a
[1, 2, 3, 4]

这个问题的最根本问题其实出在

>>> a = a[:-3]

这句。“=”默认的意思是“赋值,pass the value”,不是传递对象的引用。

list partterns in Matlab and Python

list partterns in Matlab and Python

A comparation between usage in Matlab against Python of the List variable as the most common and frequently utility in the languages.

Indexing

Key point of Indexing: Index, List to be filtered
Matlab

>> lst = rand(2,3) %@ the List to be filtered
lst =
0.4103 0.0579 0.8132
0.8936 0.3529 0.0099

>> i = lst > 0.5 %@ the Index, a list with integer elements
i =
0 0 1
1 0 0

>> lst(i) %@ the Result, get a new list from lst with elements indexed by i
ans =
0.8936
0.8132

>> lst(lst>0.5)=1
lst =
1.0000 0.0579 1.0000
1.0000 1.0000 0.0099

Append

Python

lst.append(obj)

Matlab
No declaration or additional appending operation.

>> clear
>> lst(2) = 1
lst =
0 1

>> lst(5) = 1
lst =
0 1 0 0 1

>> lst(length(lst)+1) = 9 %@ Appending operation
lst =
0 1 0 0 1 9

Sorting

>> lst=rand(3,4)
lst =
0.9501 0.4860 0.4565 0.4447
0.2311 0.8913 0.0185 0.6154
0.6068 0.7621 0.8214 0.7919
>> sort(lst) %@ Matrix sorting means “Sorts each column”.
ans =
0.2311 0.4860 0.0185 0.4447
0.6068 0.7621 0.4565 0.6154
0.9501 0.8913 0.8214 0.7919
>> sortrows(lst,1) %@ Each row treated as a element in List.
ans =
0.2311 0.8913 0.0185 0.6154
0.6068 0.7621 0.8214 0.7919
0.9501 0.4860 0.4565 0.4447

Test Zoundry

A test of Zoundry. Noticed that it’s built up by Python. A Tag could be added and what will happen?

Del.icio.us :

Fwd: Spy printers

监视局域网上共享打印机上的JOB,PYTHON脚本,看看别人都打印什么东西在看。

# PrinterReader.py
# Enum jobs on local printers
# Could be add to system Scheduled Tasks
from win32print import *
ps = EnumPrinters(PRINTER_ENUM_CONNECTIONS)
for p in ps:
hPrinter = OpenPrinter(p[2])
pStatus = GetPrinter(hPrinter, 2)
print ‘..:: %s’ %pStatus['pPrinterName']
js = EnumJobs(hPrinter, 0, pStatus['cJobs'])
for j in js:
print [j['JobId'], j['Submitted'], j['pUserName'], j['TotalPages'], ]

貂蝉


018
Originally uploaded by Charlie.Zhu.

脸型的确和我媳妇很像。

吕布头像


120
Originally uploaded by Charlie.Zhu.

结婚照

 Posted by Picasa

结婚照


B135_过滤后
Originally uploaded by Charlie.Zhu.

满族服装。像年画上的小孩。

吕布


Gmail labels
Originally uploaded by Charlie.Zhu.

吕布骑马相@曹操传
一直用作头像
原来用脸部特写那张,和爱妃的貂婵配合得很好,而且还挺像我们两个人的。
侧面说明曹操传中的吕布貂婵果然有夫妻相啊。

Next Page »

Random posts

  • 同是底层的人
  • 春运铁路的确应该涨价,吴敬琏说得很对
  • SPAM site hosted by Google Docs
  • 一些厂商提供的数据仓库工具
  • 推荐8box的音乐专题:在忧伤的旋律中的情人节