Search Results

Search found 4 results on 1 pages for 'zyq524'.

Page 1/1 | 1 

  • Regular Expression Question

    - by zyq524
    I'm trying to use regular expression to extract the comments in the heading of a file. For example, the source code may look like: //This is an example file. //Please help me. #include "test.h" int main() //main function { ... } What I want to extract from the code are the first two lines, i.e. //This is an example file. //Please help me. Any idea?

    Read the article

  • Install h5py in Mac OS X 10.6.3

    - by zyq524
    I'm trying to install h5py in Mac OS X 10.6.3. First I installed HDF5 1.8, which used the following commands: ./configure \ --prefix=/Library/Frameworks/Python.framework/Versions/Current \ --enable-shared \ --enable-production \ --enable-threadsafe \ CPPFLAGS=-I/Library/Frameworks/Python.framework/Versions/Current/include \ LDFLAGS=-L/Library/Frameworks/Python.framework/Versions/Current/lib make make check sudo make install Then install h5py: /Library/Frameworks/Python.framework/Versions/Current/bin/python \ setup.py \ build \ --api=18 \ --hdf5=/Library/Frameworks/Python.framework/Versions/Current Then I got the errors: Configure: Autodetecting HDF5 settings... Custom HDF5 dir: /Library/Frameworks/Python.framework/Versions/Current Custom API level: (1, 8) ld: warning: in detect/vers.o, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: in /Library/Frameworks/Python.framework/Versions/Current/lib/libhdf5.dylib, file was built for unsupported file format which is not the architecture being linked (i386) Undefined symbols: "_main", referenced from: start in crt1.10.5.o ld: symbol(s) not found collect2: ld returned 1 exit status Failed to compile HDF5 test program. Please check to make sure: * You have a C compiler installed * A development version of Python is installed (including header files) * A development version of HDF5 is installed (including header files) * If HDF5 is not in a default location, supply the argument --hdf5=<path> error: command 'cc' failed with exit status 1 I just updated my Xcode, I don't know whether this is because my gcc's default setting. If so, how can I get rid of this error? Thanks.

    Read the article

  • Python Class Variables Question

    - by zyq524
    I have some doubt about python's class variables. As my understanding, if I define a class variable, which is declared outside the init() function, this variable will create only once as a static variable in C++. This seems right for some python types, for instance, dict and list type, but for those base type, e.g. int,float, is not the same. For example: class A: dict1={} list1=list() int1=3 def add_stuff(self, k, v): self.dict1[k]=v self.list1.append(k) self.int1=k def print_stuff(self): print self.dict1,self.list1,self.int1 a1 = A() a1.add_stuff(1, 2) a1.print_stuff() a2=A() a2.print_stuff() The output is: {1: 2} [1] 1 {1: 2} [1] 3 I understand the results of dict1 and list1, but why does int1 behavior different?

    Read the article

1