2012年10月10日 星期三

[Debugger/Hadware] Windows7 Installer cannot detect hard drive during installation

when the installation cannot detect the hard drive, there are several workable way to fix that

  1. reason: unknown
    • Solution:
    • run diskpart command from a prompt.
      Then each of these commands, followed by the enter key after each one.
      list disk (to show the ID number of the hard disk to partition, normally Disk 0)
      select disk 0 (change 0 to another number if applicable)
      clean (this deletes all partitions)
      create partition primary size=80000 (creates a partition with 80 GB space; to use the entire disk as one partition, omit the “size=value” parameter switch; use a similar command to create more partitions if needed or create in Windows 7 after installation)
      select partition 1
      active
      format fs=ntfs quick
      exit
  2. reason: unknown
    • solution: use linux live enter the system usb and delete all the partitions (tried in Linux mint 13)
  3. reason: Partition cannot be detected
    • Solution: Use another computer and set the Hard drive partition. and the windows installer can find the partition
Fail trial:
  1. create MBR in other windows 7 OS

2012年10月2日 星期二

[Programming/Debugger]常常Lost掉的想法


  1.  Think the mathematical formulation while programming.
  2. When update the lowest value, we usually also need to update the lowest Index and vice versa.
  3. While using iterator or loop, be aware of the begin and end


2012年9月27日 星期四

[Programming] "is of non-class type" and Constructor with no input


class Foo
{
  public:
    Foo() {};
    Foo(int a) {};
    void bar() {};
};
int main()
{
  // this works...
  Foo foo1(1);
  foo1.bar();

  // this does not...
  Foo foo2();
  foo2.bar();

  return 0;
}
ER MSG:
nonclass.cpp: In function int main(int, const char**)’:
nonclass.cpp:17: error: request for member bar in foo2’, which is of non-class type Foo ()()’
Correct:
Foo foo2;
Compiler think  the declaration Foo foo2()  is not a constructor. Instead, it is a function "foo2()" which return class FOO.
Therefore, when we are going to access the member function, bar, we "request for member"bar" in foo2但foo2 is of non-class type"

Some similar error msg
error: request for member 'computeLog2Det' in '((ULSA3a*)this)->ULSA3a::matrixComputer', which is of non-class type 'CORRE_MA_OPE*'|
when matrixComputer is declared as CORRE_MA_OPE* matrix computer  
and we use in matrixComputer.computeLog2Det(1.0,cSystem->allSupStru);

[Debugger]Windows/Unix: Memory Initialization

For variable memory initialization:
Windows won't initialize the unassigned variable to zero, while Linux(Fedora) do so.

The bug happened refer to the ULSA2g in M2M Network Simulator when I access the uninitialized reference variable.