Thursday, November 12, 2015

How to Enable Win XP, Win 2003 ... to access NAS Network


To access the network shares Windows relies on one of the Windows Service "Network DDE DSDM" also known "Manages Dynamic Data Exchange (DDE)", If this service is stopped, DDE network shares will be unavailable.

To Start this Service:
Go to Windows Start Button-->Administrative Tools-->Services, locate "Network DDE DSDM" and to set it to "Automatic" then start up the service.

Friday, March 6, 2015

MySQL Settings



Configuration File Location:
for Windows 7:  C:\ProgramData\MySQL\MySQL Server 5.6\my.ini


How to move database to different directory

  1. Stop the MySQL instance service.
  2. Copy the data directory to the location where the new data directory should be.
  3. Giving a full control privileges to user NetworkService on the new data directory, otherwise the service won't start.

Thursday, October 23, 2014

WMI Error 0x80041003 in Event Viwer while Windows Server 2008 startup


The error message in Event Viwer show as below:
Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA "Win32_Processor" AND TargetInstance.LoadPercentage > 99" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected.


Here a script can fix this problem.
To run this script require administrator permission. Copy the script code are shown below
into fixwin7.vbs file, Then open the Command Prompt window as a Administrator and run this script file.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\subscription")

Set obj1 = objWMIService.ExecQuery("select * from __eventfilter where name='BVTFilter' and query='SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99'")

For Each obj1elem in obj1
set obj2set = obj1elem.Associators_("__FilterToConsumerBinding")
set obj3set = obj1elem.References_("__FilterToConsumerBinding")

For each obj2 in obj2set
WScript.echo "Deleting the object"
WScript.echo obj2.GetObjectText_
obj2.Delete_
next

For each obj3 in obj3set
WScript.echo "Deleting the object"
WScript.echo obj3.GetObjectText_
obj3.Delete_
next

WScript.echo "Deleting the object"
WScript.echo obj1elem.GetObjectText_
obj1elem.Delete_
Next
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Explorer crashes due MSVCR100.dll in Windows 7

Faulting application name: explorer.exe, version: 6.1.7601.17567, time stamp: 0x4d672ee4
Faulting module name: MSVCR100.dll, version: 10.0.40219.325, time stamp: 0x4df2bcac
Exception code: 0xc0000005
Fault offset: 0x000000000003c145
Faulting process id: 0x1be8
Faulting application start time: 0x01cf723c3fbeee54
Faulting application path: C:\Windows\explorer.exe
Faulting module path: C:\Windows\system32\MSVCR100.dll
Report Id: 825626cb-de2f-11e3-ab39-0026b904b93e


The synwinxt.dll of Synergy caused this issue reported before:

Solution:
go to the C:\Program Files\Synergy folder and rename the synwinxt.dll  to synwinxt.dll.bak

Saturday, January 18, 2014

The all Android supports measurements units


  • px (pixels): Dots on the screen.
  • in (inches): Size as measured by a ruler.
  • mm (millimeters): Size as measured by a ruler.
  • pt (points): 1/72 of an inch.
  • dp (density-independent pixels): An abstract unit based on the density of the screen. On a display with 160 dots
  • per inch, 1dp = 1px.
  • dip: Synonym for dp, used more often in Google examples.
  • sp (scale-independent pixels): Similar to dp but also scaled by the user’s font size preference.
sp unit is recommend for text sizes
dip unit for everything else

Sunday, December 15, 2013

How to remote debug android emulator for windows


For Remote Machin run with SDK and Android Emulator
1. Install freeSSHd on remote machin
    2.1 start freeSSHd. don't run freeSSHd more than one time, It will
        make the second freeSSHd instance show SSH Server start faile.
    2.2 in the windows taskbar bottom right corner find out freeSSHd
        icon and click setting menu item.
    2.3 in the Server status tab make sure SSH server is running
    2.4 In Users tab add new user for ssh login
    2.5 In Tunneling tab checked 'Allow local port forwarding'
2. Install android SDK and run emulator in remote machin.


For Development Machin run with Eclipse and SDK
3. Setup putty SSH client
    3.1 open putty go to 'Connection -> SSH -> Tunnel' add forward port as follow:
        option: Local, Auto
        L5554  Localhost:5554
        L5555  Localhost:5555
        5554 is the first running emulator in remote machin, if you wanna connect more emulators
        you have to add addtional pairs of port as above.
    3.2 go to 'Session' add remote machin IP with SSH 22 port, Then save it to session name, the tunnel
        setting you do above will save into this session name.
4. connect to remote machin, type login name and password to login.
   and just keept putty running here as a SSH tunnle connector.
5. stop adb server in develop machin, and restart it again or let step 6. do it automatically.
    adb kill-server
6. relocate devices, remote emulator should be show.
   adb devices

Sunday, July 7, 2013

Relocate All Folders Setting in Visual Studio


Change all location settings in the Registry below

Visual Studio 2010
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0

Visual Studio 2008
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0
HKEY_CURRENT_USER\Software\Microsoft\MSDN\9.0

Microsoft SQL Server Management Studio
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server
HKEY_CURRENT_USER\Software\Microsoft\MSDN\8.0

Monday, May 20, 2013

jQuery append() not work in IE 7, IE8

Shame the MS IE bad ass once again trying to break down the web developers...

When you using jQuery .apend() function in IE 7 or 8, It will throw a error and break the web page function down.

for example the code below will throw an error and stop to continue execute the rest of the code after this line:
    elm.append("<elm2></elm2>");

There is a example can solve this problem which is using XML DOM.

var strXml = "<root>"
                       + "<publish>"
                       + "    <store>"
                       + "        <book title=\"How to fix IE\"/>"
                       + "    </store>"
                       + "</publish>"
                       + "</root>";
         
// Build XML document
var xDoc = $.parseXML(strXml);

// create new child element using XML Document
var xBook = xDoc.createElement("book");

// setting the attributes of child element using XML DOM method 
xBook.setAttribute("title", "How to fix bad ass IE!");

// setting the attributes of child element using jQuery
$(xBook).attr("authr", "Bill ...");

// Append child element to some where in the XML Document
var xStore = $(xDoc).find("store");
xStore.append(xBook);




Sunday, February 17, 2013

How to Take Ownership of a locked folders in Windows 7



takeown /f "C:\Locked Directory" /r /d y
icacls "C:\Locked Directory" /grant administrators:F /t

Tuesday, December 11, 2012

How to make inner float div inside the outer div

When you put some float div inside another div, The outer div will collapse in other words the size of dimension the outer div will small than the inner float div.

The solution is append a div with clear and block style in the end of the other float inner div as below:
<div id="outer_div">
    <div class="float-style">Item 1</div>
    <div class="float-style">Item 2</div>
    <div class="float-style">Item 3</div>
    <div style="clear:both;display:block;"></div>
</div>

Solution 2: using overflow:auto; in the outer div style can also prevent outer div collapsed. But this method may cause outer div appear scroll bar when new div adding to it.
<div id="outer_div" style="overflow:auto;">
    <div class="float-style">Item 1</div>
    <div class="float-style">Item 2</div>
    <div class="float-style">Item 3</div>
    <div style="clear:both;"></div>
</div>


related link: http://css-tricks.com/all-about-floats/

Friday, November 23, 2012

Create log off message for Windows



  1. Click Start > Run, type “regedit” click Ok button. Registry Editor window will popup.
  2. Find this path from left side of Registry Editor window: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Double click LegalNoticeCaption from right side Registry Editor window. This will popup Edit String window. Type in Value data any name that you want to be your message window title. Click Ok button.
  4. Double click LegalNoticeText from right side Registry Editor window. This will popup Edit String window. Type in Value data any message, this message will show up on your message window. Click Ok button. Close your Registry Editor window.
  5. Log off from your computer.


Wednesday, November 7, 2012

How to check which process using TCP/IP Ports in Windows


Run the following command from a command prompt to find the PID of the process which is using TCP port 80 and/or 443. 
   
    netstat -aon | find ":80" 

    netstat -aon | find ":443"

You will see an output similar to the following. Remember the actual PID will vary from case to case.
    TCP    0.0.0.0:80    0.0.0.0:0    LISTENING    3604 
    TCP    0.0.0.0:443   0.0.0.0:0    LISTENING    3320

Now using Task Manager you can easily find out to which process the above PID belongs and take appropriate action.

http://support.microsoft.com/kb/973094

Friday, July 13, 2012

GDI+ .NET Color & HatchStyle Chart

Color Chart

HatchStyle Chart

Tuesday, July 10, 2012

Page Layout Using DIV


100% height and scroll able div

<html>
  <body style="overflow:hidden;">
    <div style="overflow:auto; position:absolute; top: 0px; left:0px; right:0px; bottom:0px">
    </div>
  </body>
</html>


Fix height header and footer and scroll able main content

<html>
  <body style="overflow:hidden;">
      <div id="header" style="overflow:hidden; position:absolute; top:0; left:0; height:50px;"><div>
      <div id="leftNav" style="overflow:auto; position:absolute; top:50px; left:0px; right:200px; bottom:50px;"></div>
      <div id="mainContent" style="overflow:auto; position:absolute; top:50px; left: 200px; right:0px; bottom:50px;"></div>
      <div id="footer" style="overflow:hidden; position:absolute; bottom:0; left:0; height:50px"></div>
  </body>
</html>

Note: for IE the main content div require doctype definition, without this the div height will not expand to the bottom position.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Tuesday, June 19, 2012

SQL Server version information



SQL Server 2012 version information

The following table lists the major releases of SQL Server 2012.
ReleaseProduct Version
SQL Server 2012 Service Pack 111.00.3000.00
SQL Server 2012 RTM11.00.2100.60


SQL Server 2008 R2 version information

The following table lists the major releases of SQL Server 2008 R2.

ReleaseProduct version
SQL Server 2008 R2 Service Pack 210.50.4000.0
SQL Server 2008 R2 Service Pack 110.50.2500.0
SQL Server 2008 R2 RTM10.50.1600.1
For more information information about the latest service packs for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
2527041  How to obtain the latest service pack for SQL Server 2008 R2
For more information about the latest cumulative updates available for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
981356  The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was released
2567616  The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 was released


SQL Server 2008 version information

The following table lists the major releases of SQL Server 2008.
ReleaseProduct version
SQL Server 2008 Service Pack 310.00.5500.00
SQL Server 2008 Service Pack 210.00.4000.00
SQL Server 2008 Service Pack 110.00.2531.00
SQL Server 2008 RTM10.00.1600.22
For more information information about the latest service packs for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
968382  How to obtain the latest service pack for SQL Server 2008
For more information about the latest cumulative updates available for SQL Server 2008, click the following article numbers to view the articles in the Microsoft Knowledge Base:
956909  The SQL Server 2008 builds that were released after SQL Server 2008 was released
970365  The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 1 was released
2402659  The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 2 was released
2629969  The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released


SQL Server 2005 version information

The following table lists the major releases of SQL Server 2005.
ReleaseProduct version
SQL Server 2005 Service Pack 49.00.5000.00
SQL Server 2005 ServicePack 39.00.4035
SQL Server 2005 Service Pack 29.00.3042
SQL Server 2005 Service Pack 19.00.2047
SQL Server 2005 RTM9.00.1399


For more information information about the latest service packs for SQL Server 2005, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

For more information about the latest cumulative updates available for SQL Server 2005, click the following article number to view the article in the Microsoft Knowledge Base:
937137 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
960598 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 3 was released
2485757 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 4 was released

SQL Server 2000 version information

The following table lists version number of the Sqlservr.exe file. 


ReleaseProduct version
SQL Server 2000 Service Pack 48.00.2039
SQL Server 2000 ServicePack 3a8.00.760
SQL Server 2000 Service Pack 38.00.760
SQL Server 2000 Service Pack 28.00.534
SQL Server 2000 Service Pack 18.00.384
SQL Server 2000 RTM8.00.194
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
290211  How to obtain the latest SQL Server 2000 service pack



Older versions of SQL Server

SQL Server 7.0

Use the version number in the following table to identify the product or service pack level: 
Version numberService pack
7.00.1063SQL Server 7.0 Service Pack 4
7.00.961SQL Server 7.0 Service Pack 3
7.00.842SQL Server 7.0 Service Pack 2
7.00.699SQL Server 7.0 Service Pack 1
7.00.623SQL Server 7.0 RTM
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
301511  How to obtain the latest SQL Server 7.0 service pack



SQL Server 6.5

Use the version number in the following table to identify the product or service pack level: 
Version numberService pack
6.50.479SQL Server 6.5 Service Pack 5a Update
6.50.416SQL Server 6.5 Service Pack 5a
6.50.415SQL Server 6.5 Service Pack 5
6.50.281SQL Server 6.5 Service Pack 4
6.50.258SQL Server 6.5 Service Pack 3
6.50.240SQL Server 6.5 Service Pack 2
6.50.213SQL Server 6.5 Service Pack 1
6.50.201SQL Server 6.5 RTM
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
273914  Readme.txt for SQL Server 6.5 post-Service Pack 5a Update




For more information: http://support.microsoft.com/kb/321185

Tuesday, September 20, 2011

How To boot into text mode in linux fedora

Power on computer  when bios info shows up on the screen press F2 or F3, the GRUB boot screen appears.
Select the Fedora that you want to boot into, Press the a key boot kernel argument will show up. in the end of the argument string add '3'

    Original argument
  kernel /vmlinuz-2.6.40.4-5.fc15.x86_64 root=LABEL=/ acpi=on rhgb quiet

 
    after modified in the end of arguments add a 3
    kernel /vmlinuz-2.6.40.4-5.fc15.x86_64 root=LABEL=/ acpi=on rhgb quiet 3

  and press enter to be continue
   the number 3 will cause fedora boot into text mode.







Monday, September 19, 2011

Transaction Log issue for SQL Server

-- View Transaction log
DBCC Log(myDbName)




If the recovery model is set to SIMPLE the log data will be cleared automatically.

-- How to Change Recovery Model to simple
use myDbName
-- Change Recovery model to simple
ALTER DATABASE
myDbName SET RECOVERY SIMPLE
-- enable auto shrink option
ALTER DATABASE
myDbName SET AUTO_SHRINK ON
-- Shrink DB Log file
DBCC SHRINKFILE(
myDbName_log, TRUNCATEONLY)

-- This command help you to find out what is database log file name
USE myDbName
SELECT * FROM sys.database_files

Thursday, September 15, 2011

the Linux rights of files and directory


 
1. the "file1" can be a file or directory

          |---- owner
          ||----- group
          |||------- other users
   chmod  467  file1    
  
   1 = Execute
   2 = Write
   4 = Read
  
   3 = 2+1   can Write, Execute
   5 = 4+1   can Read, Execute
   6 = 4+2   can Read, Write
   7 = 4+2+1 can Read, Write, Execute