Thursday, August 30, 2007

How to remove one replica from one clan

How to remove one replica from one clan

    1. Remove one replica which is never imported into another site

    2. We can use multiutil mkreplica –export to export one project and import the package in the destination site to create another family replica using multiutil mkreplica –import command. After each mkreplica –export command, some records will be logged into the schema db and project db before the project really setup in another site. For example, we have a family WOS in Q3 site and the clan name is OL. Now we want to make replica in another site ZH.  We run the below command to export the project in Q3 site,

      multiuitl –export –cl OL –site Q3 –family WOS –u admin –p adminpwd –out c:\temp\export_wos_to_zl zhengol:ZH

      After execute the command successfully, we can view the replica info in Q3 site as below (the project is not imported into ZH yet),

      multiutil –lsreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd
      You can see that the WOS has the replica in ZH already.

      Sometimes maybe the site name you type in the command is wrong; the site name should be ZL instead of ZH for example. How can we remove the replica form the master site? If we do not remove the obsolete replica and then setup the project in ZL maybe another site XX, the ZH replica can still be found in the family replicas. It may cause some error if some defects is changed its mastership to ZH wrongly. We use above scenario to remove the ZH replica records in Q3 (master) site.

      multiutil –rmreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd ZH

      If the project is created in other sites, need to sync the package into other sites.
      Pls note that even the ZH replica removed, it still can be viewed by the multiuitl lsreplica but the ZH can not be viewed in ClearQuest mastership dropdown list.


    2.      Remove one functionality replica

      Supposed we have one clan OL with family WOS in OL and Q3 (Master) sites. Now we want to remove the WOS replica from OL site. Here are the steps,

a.      change mastership of all objects in WOS project from OL to Q3 in OL site

          multiutil chmaster –cl OL –site ZL –family WOS –u admin –p adminpwd Q3 –all –long

        b.      sync the updated package from OL to Q3

          multiutil syncreplica –export –cl OL –site ZL –family WOS –u admin –p adminpwd –out c:\temp\syncout.txt Q3
          In Q3 site, import the package
          multiutil syncreplica –import –cl OL –site Q3 –family WOS –u admin –p adminpwd c:\temp\syncout.txt

        c.      remove WOS replica from OL site in master site

          In the master site Q3, run the command as blow,
          multiutil rmreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd ZL

               Here are some cases need be mentioned here,

      1. If the OL site has only one family WOS and is not used any more, we should change mastership of the user/groups from OL to Q3 before above step b. Here is the command in OL site,
      2. multiutil chmaster –cl OL –site ZL –family Mastr –u admin –p adminpwd Q3 –all –long

      b.      If we have another site named JC, we need to sync the update info from Q3 to JC after above step c.

      c.      For the removed replica+site, we can not use it any more. As this case, after remove the WOS from OL site, we can not make replica of WOS in OL site again. That means it will fail if run below command

        multiutil mkreplica –export –cl OL –site Q3 –family WOS –u admin –p adminpwd –out c:\temp\wos_out_to_ZL zhengol:ZL


Tuesday, August 28, 2007

Using system and exec (Part 9)-- Perl Study Notes

Using system and exec (Part 9)-- Perl Study Notes

Execute command shelll

  Using system commad

     
    the function system to invoke the shell command and return the exist code until the  shell command finished
         #example of system command usage
         #example 1
         #execute the date and output the result to the file right_now.
         #output one message and exit if the command fails
           system("date >right_now") && die "cannot create right_now";

         #example 2
         $where = "who_out.".++$i;
         #command followed $ like below, the shell will return without waiting
         # for the command finished.   
         # in below case, the return value is true if the command is executed or
         # false if the command is not invoked successfully.
         system "(date) >$where

    system can also receive command arguments, for example
         #example
        @args1=qw(perl.exe C:\clearquest\MultiScript\cq_exportol_zl.pl)
    system(@args1)==0 || die "system @args failed: $?"

        
    system can run multiple command and separated with comma, but the return value is not the exit code of each command but the successful or not indicator of invoking the command


Using backslash

         #example 1
         # get each output line of the command dir in each iternation
        foreach (`dir`)   
         {
            chomp();  
                   #get only file lists and exclude the folder
            unless (/<DIR>/) 
            {
                       ($modify_date,$modify_time,$amorpm,$filename)=/(\S+)\s+(\S+)\s(\S+)\s+\S+\s+(.*)/;
           print "$filename is created at $modify_date $modify_time $amorpm";
                     }
            }
          

  Using filehandles
       #example 1
       # to get the result to print the line which contains zhengol
       open (COMMANDOUTPUT, "dir|");
       foreach (<COMMANDOUTPUT>)
          {
               #print the user containing zhengol
               print if (/DIR/);
          }
       close (COMMANDOUTPUT);

        #example 2
        #to print the message to the printer
        open(COMMANDINPUT, "|lpr -Pslatewriter");
        print COMMANDINPUT, "Testing Message";
        close(COMMANDOUTPUT) ;
 
  Using folk/exec/wait/waitpid
     fork to clone current process to run    
     #example 1

    if (!defined($kidpid = fork())) {
       # fork returned undef, so failed
        die "cannot fork: $!";
    } elsif ($kidpid == 0) {
        # fork returned 0, so this branch is the child
        exec("date");
        # if the exec fails, fall through to the next statement
         die "can't exec date: $!";
    } else {
        # fork returned neither 0 nor undef,
        # so this branch is the parent
        waitpid($kidpid, 0);
    }

Wednesday, August 22, 2007

CIA criticises ex-chief over 9/11

CIA criticises ex-chief over 9/11

A CIA inquiry has accused the agency's ex-chief George Tenet and his aides of failing to prepare for al-Qaeda threats before the 9/11 attacks on the US.

"The agency and its officers did not discharge(履行) their responsibilities in a satisfactory manner," the CIA inspector general wrote in a scathing report.

The document was completed in June 2005 and kept classified until now. Its release was ordered by Congress.
Ex-CIA director George Tenet said the inspector general was "flat wrong".
Mr Tenet, who enjoyed strong support from President George W Bush, resigned in 2004 citing "personal reasons".
The review team led by Inspector General John Helgerson found no "single point of failure" that would have stopped the attacks on 11 September 2001.

But he says US spy agencies lacked a comprehensive plan to counter al-Qaeda.
The report concludes that Mr Tenet "by virtue of his position, bears ultimate responsibility for the fact that no such strategic plan was ever created".

It adds that various bodies "did not always work effectively and cooperatively".
For the record
Mr Helgerson called for accountability boards to look at the performance of Mr Tenet and his aides.
Such a move was rejected after the internal report was submitted to CIA leaders.
Current CIA Director Michael Hayden said the decision to release the report was not his preference, but that he was making it available as required by Congress in a law signed by Mr Bush earlier this month.

"I thought the release of this report would distract officers serving their country on the front lines of a global conflict," he said.

The BBC's James Coomarasamy says the criticism is in keeping with previous inquiries into the 11 September attacks.
It is notable, however, for having an unusually critical tone for an internal inquiry and for its personal criticism of Mr Tenet.

In a statement, the former CIA director said he had implemented a "robust plan, marked by extraordinary effort and dedication to fighting terrorism, dating back to long before 9/11".

"Without such an effort," Mr Tenet added, "we would not have been able to give the president a plan on September 15, 2001, that led to the routing of the Taliban... and combating terrorists across 92 countries".

Our correspondent says the administration has already taken steps to address some criticisms against the intelligence community, making this latest report more of an interesting historical document than a consequential one.

Tuesday, August 21, 2007

How to determine the master site in multisite


How to determine the master site in multisite

In ClearQuest multisite, we have only one master site. Many tasks should be acted in this site, such as make replica, import schema,change schema and so on. We have one command lsreplica to determine the master site in the multisite env.

Syntax of lsreplica
   multiutil lsreplica -cl.an name -site name -family name -u.ser username -p p.assowrd -working.master

For example
   multiutil lsreplica -clan productclan -site ZL -family CS2 -u admin -p 123456 -working

Then you can get the output like 'Multiutil:Working master site is XXX'. XXX is the master site.

But pls note that if we use Mastr in the family, it gets error message and says 'Multiutil: Error: Please log into a user db to figure out working master site.' That means you can only use the project name to get the master site instead of schema family name.

Friday, August 17, 2007

Padilla guilty in US terror trial

Padilla guilty in US terror trial

US citizen Jose Padilla has been found guilty of plotting(策划) to kill people overseas and supporting terrorism.
His two co-defendants, Lebanese-born Palestinian Adham Amin Hassoun and Jordanian-born Kifah Wael Jayyousi, were convicted on the same counts.

All three denied charges of conspiring to (密谋) murder in Chechnya, Afghanistan, Bosnia and elsewhere from 1993 to 2001. They now face possible life in jail.

Padilla was once suspected of, but not charged with, plotting a "dirty bomb".
The three men are due to be sentenced on 5 December this year, the judge in Miami said.
The jurors took only a day-and-a-half to find them guilty on all three counts against them.
They were convicted of conspiracy to murder, kidnap and maim (残害); conspiracy to provide material support for terrorism; and providing material support for terrorism.

'Coded calls'
Padilla's mother, Estela Lebron, said she expected her son's lawyers to appeal against his conviction.
Meanwhile, the White House was quick to welcome the verdict (裁决).
"We commend the jury for its quick work in this trial and thank it for upholding a core American principle of impartial justice for all," said White House spokesman Gordon Johndroe.

"Jose Padilla received a fair trial and a just verdict."
The chief evidence presented against Padilla was what the prosecution called an al-Qaeda application form bearing his fingerprints and date of birth that was found in Afghanistan.

The defence had suggested that Padilla handled the document once he was in custody.
FBI recordings of telephone conversations in Arabic between the defendants were also produced, containing, according to the prosecution, coded references to terrorist activity.

Defence lawyers argued that the three men had links with countries such as Afghanistan and Bosnia because they were involved in humanitarian aid for Muslims and said the charges against them were exaggerated.

A lawyer for Hassoun said he was "very disappointed" by the verdict but that his legal team would continue to fight for justice.

Legal battle
Padilla, a former Chicago gang member of Puerto Rican descent, is a convert to Islam.
He was arrested at Chicago's O'Hare Airport in May 2002 after returning from Pakistan.
He was accused of planning to detonate a radioactive dirty bomb and held in US military custody for more than three years.

Following a long battle between the Bush administration and civil liberties groups, Padilla was transferred to the civilian courts in 2006.

The indictment (诉状) against him made no mention of the alleged (有嫌疑) bomb plot.
Padilla has said he was tortured while in military detention, an accusation US officials deny.


Monday, August 13, 2007

Darfur force 'to be all-African'

Darfur force 'to be all-African'

African Union (AU) chairman Alpha Oumar Konare says enough African troops have been promised to a Sudan peacekeeping force for no outside help to be needed.

He said African countries can provide the 26,000 peacekeepers needed for the combined AU-United Nations force. The AU already has 7,000 troops in Darfur.

The UN had expected to call on Asian troops. Critics say Africa lacks enough trained troops for an effective force.
Sudan's government has long opposed the involvement of non-African soldiers.
Viable(可行的, 能生存的)plan?
Speaking after talks in Khartoum with the Sudanese President Omar al-Bashir, Mr Konare said: "I can confirm today that we have received sufficient commitments from African countries that we will not have to resort to non-African forces."

He added that the "ball is now in the court of the UN" to provide funding for the force.
Mr Bashir, who has long argued that a UN-backed force would be a violation of Sudan's sovereignty and could worsen the situation there, backed Mr Konare's plan.

"(We) support the AU force, which consolidates the efforts of the Sudanese government to ensure security, peace and stability in Darfur," he said after their meeting.

Mr Konare did not give a breakdown of the countries offering to supply more personnel, leading correspondents to question the viability of an all-African force.

The BBC's Africa editor, David Bamford, said it was unclear where so many African troops would come from.
Our correspondent questioned whether African nations would have the political commitment to stand alone against the forces seeking to continue to disrupt lives in Darfur.

Deadline looming
Mr Konare's announcement came just days after the UN published a list of Asian countries it said had already committed troops and police officers to a Darfur force.

UN officials said the joint AU-UN force would be "predominantly African", but confirmed that countries including Indonesia, Pakistan, Nepal and Bangladesh had pledged personnel.

According to a UN resolution, the composition of the force must be decided by 30 August.
At least 200,000 people are believed to have died and more than two million have been left homeless in Darfur since fighting broke out in 2003.

Sudan's Arab government, and the pro-government Janjaweed militias, are accused of war crimes against the region's black African population - although the UN has stopped short of calling it genocide (中古灭绝).

Friday, August 10, 2007

Russia sparks Cold War scramble

Russia sparks Cold War scramble

Russian bombers have flown to the US Pacific island of Guam in a manoeuvre(调动) reminiscent of (使人联想)the Cold War era.

Two Tu-95 turboprops flew this week to Guam, home to a big US military base, Russian Maj Gen Pavel Androsov said, a story confirmed by the US.

They "exchanged smiles" with US pilots who scrambled(紧急起飞) to track them, he added.
The sorties, believed to be the first since the Cold War ended, come as Russia stresses a more assertive(肯定的) foreign policy, correspondents say.

The flight is part of a pattern of more expansive Russian military operations in recent weeks, says BBC diplomatic correspondent Jonathan Marcus.

Old practice
Gen Androsov said the strategic bombers had flown 13 hours from their base in the Russian Far East during the exercise.

"It has always been the tradition of our long-range aviation to fly far into the ocean, to meet [US] aircraft carriers and greet [US pilots] visually," he said at a news conference.

"Yesterday [Wednesday] we revived this tradition, and two of our young crews paid a visit to the area of the base of Guam," he said.

"I think the result was good. We met our colleagues - fighter jet pilots from [US] aircraft carriers. We exchanged smiles and returned home," he added.

A spokesman for the Pentagon confirmed that the Tu-95s were spotted(noticed) heading to Guam, adding that US fighter readied themselves to repel(驱赶)them.

"We prepared to intercept(拦截) the bombers but they did not come close enough to a US Navy ship or to the island of Guam to warrant an air-to-air intercept," the spokesman said.

During the Cold War, Soviet bombers regularly flew long-haul missions to areas patrolled by Nato and the US.
The bombers have the capability of launching a nuclear strike with the missiles they carry.

Thursday, August 9, 2007

Pollution risk for Olympic even

Pollution risk for Olympic even

Speaking a year to the day before the start of the 2008 Games, the president of the International Olympic Committee (IOC) said: "It is an option.

"Sports with short durations would not be a problem, but endurance sports like cycling are examples of competitions that might be postponed or delayed."

Billions have been spent in an attempt to reduce pollution without success.
Report: Pollution risk for Olympic events
A host of (a large number of things) factories have been shut down, while many others have been moved out of town, but non-stop construction and booming car sales have made air quality even worse.

Beijing's filthy (very dirty) air and clogged(jammed) traffic are known to have worried Beijing organizers and the IOC for some time, but this is Rogge's strongest statement on the subject.

BBC sports news correspondent Gordon Farquhar said: "All the talk has been about human rights but there has been a growing realization that Beijing has a smog problem.

"People are beginning to come to terms with the fact it could be a major issue. Rogge said that some of the endurance events may be postponed and that would be disaster for the organizers."

BBC News' James Reynolds in Beijing added: "China is spending billions of pounds on new roads, new venues and on perfect celebratory shows but all that may come to nothing unless this city cleans up its air."

However, postponing events might not be an option because race schedules have already been decided, according to Wang Junyan, the director of cycling events for the games.

She added: "Rogge's comment reminds us that we have to work harder to fix environmental problems."
Australian Olympic Committee president John Coates has already revealed that the country's athletes won't arrive in Beijing until just before the Games begin next August to avoid possible respiratory (呼吸道的) problems.

Otherwise, the IOC said the Chinese have laid "strong foundations" for the Games during Rogge's visit to mark one year until the event kicks off.

Sixty-three official events took place across China to mark the beginning of the countdown to 8 August 2008.
However, human rights groups are using the milestone to highlight concerns over China's record on arms sales to Sudan, its record in Tibet and child labor.

Even before Beijing was awarded the Games on 13 July 2001, fears were expressed about the compatibility of China's human rights record and the spirit of the Olympic movement.

Sudan and Tibet are two issues that have caused controversy, while last month a Chinese stationery firm accused of using child labor was stripped of its license to produce official merchandise for the Games.

But Rogge is keen to stress the apolitical (非政治的) nature of the organization and points to the Olympic education projects which he says have involved 400 million children in 50,000 schools in China.

"If anything, the Games can only be a catalyst(催化剂) for constructive dialogue in a complex and sensitive transformation that is taking place in compressed time," he said.

"We believe that in the past six years the Olympic Games have had a positive impact in a number of areas such as education, media regulations and on environmental standards.

"Whilst not denying that more remains to be done, we are encouraged by the progress in these areas.
Organizers say all the competition venues, with the exception of the main National Stadium, will be completed by the end of this year.

But while praising China's preparations so far, Rogge has emphasized that there is much still to be done, and that the test events that will take place in the next year will be crucial.

"The coming 12 months will be very busy," Rogge said, adding: "I am pleased to see that strong foundations are in place - the venues will be outstanding.

"I can already begin to imagine the exhilarating (令人兴奋的) atmosphere the crowds will create as the athletes parade into the arena (the National Stadium) on 8 August."

The centerpiece of the festivities planned to mark the 8 August milestone was a huge party in Tiananmen Square, with the traditional fireworks and light show.

Chinese leaders and IOC officials joined a crowd of 10,000 in the televised event which aimed to invite more than 200 national Olympic committees to participate in next year's Games.

Wednesday, August 8, 2007

Directory Access && File and Directory Manipulation (Part 8)-- Perl Study Notes

Directory Access && File and Directory Manipulation (Part 8)-- Perl Study Notes

 Change Directory Tree
  chdir($dirpath);
  #here is the example
  print "where do you want to go?"
  chomp($toPath=<STDIN>);
  if(chdir $where){
   # we got there
   }
   else
   {
   # we cannot go there
   }
 
 Globing
  <$pattern>; #In array context, it returns all files, the folder as well, matched the pattern. In scalar context, it returns the next file name it matched the pattern

  glob($pattern); #it is equivalent to <$pattern>
  @a=<c:/temp/*>; #it returns all file lists
  @a=glob("c:/temp/*); # same as above
  while ($filename=<c:/temp/*>) # return the next filename, the folder as well, in each iteration
  {
    print "one of the file name is $filename";
  }
 
   while ($filename=glob("c:/temp/*") # return the next filename, the folder as well, in each iteration
  {
    print "one of the file name is $filename";
  }
 
  #pls be notes although file blobbing and regular-expression matching function similarly
  #the meaning of the various special characters in quite different
  #the *,[] can be used in the pattern
 
 Directory Handlers
  opendir(DirectoryHandler,$pathname);
  readdir(DirectoryHandler); #in array context, it returns all fills , the folder as well, under the path. in scalar context, it returns the next file(folder) name under the path

  closedir(DirectoryHandler);

Monday, August 6, 2007

Format (Part 7)-- Perl Study Notes

Format (Part 7)-- Perl Study Notes

Format (Part 7)-- Perl Study Notes

 The steps to use format
 1. Define the format
 2. Loading up the data to be printed into the variable portions of the format.
 3. Invoking the format
 
 Define the format
  the syntax of the format definition
  format formathandler=   #format is the reserved word, it says it is a format definition. formathandler is the format name

  fieldline               #formatted pattern
  value_one,value_two,value_three  #the value can be scalar or expressions/functions which return the scalar variable.But pls note that if the fieldholder is type of "Filled Fields", value can just be scalar instead of expression or function.

  fieldline
  value_one,value_two,value_three
  ...        #you can add another fieldline
  ...        #you can add another value mapped above fieldline
  .          # indicate the format definition is done
 
 Example of the Format
  #the fixed text format example
  format FIXFORMAT=
  This is the string to be printed out
  .         

Friday, August 3, 2007

US Senate tightens lobbying rules

US Senate (参议院) tightens lobbying(游说团体或个人)  rules 

Scandals surrounding lobbyists like Mr. Abramoff prompted the bill 
The US Senate has voted in favour of a bill to tighten rules on lobbying and ethics for lawmakers, following its approval in the lower house (众议院, House of Representatives in US or House of Commons in British)

Under the bill, which must still be signed by President Bush, lawmakers must disclose (公开) donations from lobbyists.

Democrats hailed the new legislation as one of the biggest advances in US congressional ethics in decades.

Lobbying scandals, involving mainly Republicans, played a decisive role in the Democrats' mid-term election win.

During the run-up to last November's poll the Democrats repeatedly attacked what they called a "culture of corruption" on Capitol Hill under the Republican party.

"The American people sent Democrats to Congress to clean up the mess," said Senate Democrat leader Harry Reid, "We have heard the call."

The law requires greater disclosure of so-called earmarks - allocations of funds for specific projects or purposes - in spending bills.

Lawmakers would also have to make public the names of lobbyists who raise $15,000 (£7,360) or more on their behalf.

Members would be banned from accepting gifts from lobbyists or their clients.

The new legislation also prevents senators from lobbying Congress for two years after leaving office while members of the House of Representatives would have to wait one year.

Several Republicans said the bill did not go far enough in requiring full disclosure of earmarks but most voted in favour of the bill.

"Americans were right to be outraged by the scandals that surfaced last year, they're right to hold their lawmakers to the highest standard of conduct," said Senate Republican leader Mitch McConnell.

Former lobbyist Jack Abramoff and former Republican congressman Randy Duke Cunningham are both now in prison on corruption charges involving illicit(违法的)lobbying activities.

The White House has not said whether US President George W Bush intends to sign the bill.
But White House spokeswoman Emily Lawrimore said Mr. Bush had "serious concerns" about the measure, according to the Associated Press.



Wednesday, August 1, 2007

Function (Part 6)-- Perl Study Notes

Function (Part 6)-- Perl Study Notes

 Arguments
  @_ is a array of all arguments passed to the subroutines
  $_[0],$_[1],$_[2]is the first/second/third/... arguments passed to the subroutines
 
 Define local variable
  my ($localScalar); #define one local scalar variable localScalar
  my (@localArray);  #define one local array variable localArray
  my (%localHash); #define one local hash variable localHash
  my ($localScalar,@localArray,%localHash); #define 3 local variables,localScalar, localArray and localHash
  my ($localScalar,@localArray) = ("Scalar",qw(list1 list2 list3)); # define the local variable and initial the variable

 
  Notes, operator local can be used to define the local variable. But we should prefer to use my over local because it is faster and safe

  local $_; # can not write like my $_;
  local $1; # can write like my $1;
  local @ARGV; # can write like my @ARGV;
 
  Perl pragma
   use strict; # write this in the top of the code file can keep from using the variable without declaration
   The advantages of forcing variable declarations are as below
   1. Will run slightly faster.(variables created with my are accessed slightly faster than ordinary variables)
   2. Can keep from variables typing error