2016年4月6日 星期三

Windows Update 卡住

有關於 WindowsUpdate 檢查更新卡住、下載更新卡住、安裝更新卡住、不管怎樣的卡住沒進度 0%
更新好久的問題都可以使用這個方式來解決看看!!! 

解決辦法:
首先找到 C:\Windows 的「SoftwareDistribution 」將裏頭的資料夾全刪除
 
重開機後再重回 WindowsUpdate 重新更新,雖然速度還是比較久一點,但絕對會順利下載!

2015年12月10日 星期四

ASUS TF101 upgrade Lollipop KatKiss 5.1

Download "Universal_Naked_Driver_0.72.zip" on PC
Unzip into folder

Download package for KatKiss 5.1.1 includes:
KatKiss-5.1_030.zip
gapps-KatKiss-5.1_20150920.zip
UPDATE-SuperSU-v2.46.zip (Find newest one is fine)
http://forum.xda-developers.com/eee-pad-transformer/development/rom-t2942560


Download newest signed_twrp-2.8.1.1_tf101.zip
http://forum.xda-developers.com/devdb/project/dl/?id=9482
(you can find newest one)

Copy those four file to micro SDcard either by turn off TF101 then hock on SDcard. Or dirctly save from TF101.


Download "Universal_Naked_Driver_0.72.zip" on PC
Unzip into folder

Download package for KatKiss 5.1.1 includes:
KatKiss-5.1_030.zip
gapps-KatKiss-5.1_20150920.zip
UPDATE-SuperSU-v2.46.zip (Find newest one is fine)
http://forum.xda-developers.com/eee-pad-transformer/development/rom-t2942560

Download newest signed_twrp-2.8.1.1_tf101.zip
http://forum.xda-developers.com/devdb/project/dl/?id=9482
(you can find newest one)

Copy those four file to micro SDcard either by turn off TF101 then hock on SDcard. Or dirctly save from TF101.

Download "EasyFlasher-0.8.3b-STABLE" on PC
Unzip into folder
Go to EasyFlasher/tools folder
Copy Superuser-3.1.3-arm-signed.zip from PC to TF101 "sdcard/internal storage".
If "internal storage" folder is not there, CREATE ONE.

Trun off TF101.
Hold on "Voleumn +" and "Power" key for 15 second.
Connect USB cable from TF101 to PC.
Wait... Wait.... Wait....

Driver may fail for now.
On PC, go to Device Manger by Right click on "Computer", then choose Device Manger
Question mark(?) will show on the device.
Go update new driver. Point to unzipped folder on Universal_Naked_Driver_0.72.zip (see above)

Go to EasyFlasher unzipped folder. Click on EasyFlasher.exe
Choose SBK2 if SN 80+ (It's ok to choose SBK1),
Click on "Click me!" for Root.
Click on "Flash".

On TF101, hold "Volumn -" and "Power" when logo show up. Press "Volumn +" right away.
Choose install from zip file then choose signed_twrp-2.8.1.1_tf101.zip on SD card

Unlink cable from USB and PC
Power off TF101 and turn on TF101 by holding "Volumn -" and "Power"
TRWP welcome screen will show up.
Choose Wipe, clean system. After clean system, then choose "format data". Choose "Back" to main.
Choose Install, select KatKiss-5.1_030.zip from SD -> "Add more zip" ->
select gapps-KatKiss-5.1_20150920.zip from SD -> "Add more zip" ->
select UPDATE-SuperSU-v2.46.zip from SD
-> wipe to install.
Choose "catch wipe" -> back
Choose reboot system.

Wait.... Wait..... Wait.... Wait..... Be patient. You may need to wait 10 more minetes.
You may think it's stock.... or hang, then start seach solution.
It's better to take a cup of coffee then come back.

2015年7月31日 星期五

Tomcat Java Eclipse ENCODING drive me crazy

This is what I update.
Under Tomcat 7 folder/conf/server.xml
Find 8080 word. This will be like:
URIEncoding="UTF-8"
/>
Add URIEncoding="UTF-8" if the encoding needs to be set UTF-8. Or you can change to any other fix charset.

Remember set same encoding on JSP file


Now...... Another problem happened. Same issue when using Eclipse to start Tomcat.
Solution: Expand "Server" on the Project Explorer (left side). There is anotehr Server.xml. The physical location should hiding under "workspace" folder. Change same URIEncoding="UTF-8".

NOW..... Database make the same issue.... The "words" select from DB and the data from web page is not equal........

2015年7月4日 星期六

Update ListView or BaseExpandableListAdapter After Saving Data

public class abc extends BaseExpandableListAdapter { ... // after updateProgress(progress); notifyDataSetChanged();

2013年9月11日 星期三

SQL: T1 without matching T2

SELECT T1.Field1, T1.ID FROM T1 LEFT JOIN T2 ON T1.Field1 = T2.Field1 WHERE (((T2.Field1) Is Null));

2013年8月15日 星期四

2013年8月5日 星期一

VMWare: HP ENVY: ERROR When Start up: binary translation is incompatible with long mode on this platform

Go to BIOS:

  • Start up Laptop
  • F10 to get into BIOS screen
  • Search Intel Virtualization Technology (VT) is "disabled" by default, in the BIOS
  • Change to Enable

2013年7月31日 星期三

WebLogic: Setup log4j for your Java Application

This is from: "http://phillips4jc.blogspot.com/2012/01/configuring-web-logic-1035-and-log4j.html"

I recently spent several days trying to track this down why Apache log4j for my Java application was working when deployed to Oracle WebLogic Server 10.3.5. I am posting my findings here in the hopes of saving others some time. I found several blogs that talked about this, but the end result was that log4j was still not working correctly. There was always one step missing. A co-worker and I finally figured it out for both Linux and Windows.

1. Copy wllog4j.jar from your WebLogic server/lib directory and place it in your domain_root/lib folder.
2. Copy your version of log4j.jar to your domain_root/lib folder.
3. Copy your log4j.xml to your domain_root folder. 
4. Log in to the your WebLogic admin server console. Click on Servers -> Admin Server -> Logging. Click on advanced mode, and change the logging implementation from JDK to Log4J. Save your changes.

Most of the blogs had these items, but the one critical piece that was missing:
5. (Linux)Edit the setDomainEnv.sh file in the domain_root/bin directory. and find the following code:

if [ "${LOG4J_CONFIG_FILE}" != "" ] ; then
       JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dlog4j.configuration=file:${LOG4J_CONFIG_FILE}"
       export JAVA_PROPERTIES
fi

Insert the following above those lines of code(replacing the path with the one for your system's domain_root directory:

LOG4J_CONFIG_FILE=”/u01/app/oracle/middleware/user_projects/domains/base_domain/log4j.xml”
Export LOG4J_CONFIG_FILE

5. (Windows)
Edit the setDomainEnv.cmd file in the domain_root/bin directory. and find the following code:

if NOT "%LOG4J_CONFIG_FILE%"=="" (                                                          
            set JAVA_PROPERTIES=%JAVA_PROPERTIES% -Dlog4j.configuration=file:%LOG4J_CONFIG_FILE%
)

Insert the following above those lines of code(replacing the path with the one for your system's domain_root directory:

set LOG4J_CONFIG_FILE=”C:\Oracle\Middleware\user_projects\domains\base_domain\log4j.xml”


6. Activate the changes and restart the admin server.

Here is a sample log4j.xml file. Obviously, you will need to update it for a valid location for your file appender, and replace yourcompany and yourproject with valid values.





   
   
   
    
        
        
            
            
        
    

    
        
        
        
            
        
    

    
    

    
      
    

    
        
    

    
        
    

    
    
    
        
        
    

Weblogic: Properties and xml files under WEB-INF/classes disappear after deployment

on WebLogic 10, all the Properties files and xml files will be on the _wls_cls_gen.jar file after deployment.
_wls_cls_gen.jar file will save under _WL_user/[application]... /lib folders.

zip:C:/bea103/user_projects/domains/Test_Domain/servers/AdminServer/tmp/_WL_user/testWebApp/8j5e1y/war/WEB-INF/lib/_wl_cls_gen.jar!/test.properties 

Now if we write the following code inside out application like Servlet then it won’t work and will fail while reading the Properties file: 

Note: Many frameworks uses the Following techinques and Sometimes WebLogic Code causes this issue..(http://forums.oracle.com/forums/thread.jspa?messageID=4217650#4217650)…which may cause our applications to fail while reading jar Archieved resources. because they uses the following techinque to read the resources available inside a JAR file: 

Change code:
  1. InputStream stream = null;  
  2.   
  3. try {  
  4.   
  5. Properties p = new Properties();  
  6.   
  7. String path=Thread.currentThread().getContextClassLoader().getResource(“Info.properties”).getPath();  
  8.   
  9. System.out.println(“—————-PATH: “+path);  
  10.   
  11. p.load(new java.io.FileInputStream(path));  
  12.   
  13. Host = p.getProperty(“Host”);  
  14.   
  15. Pot = p.getProperty(“Port”);  
  16.   
  17. User = p.getProperty(“User”);  
  18.   
  19. Passwd = p.getProperty(“Passwd”);  
  20.   
  21. System.out.println(“Property Key-Values:” +”\n”+ Host +”\n”+ Pot + “\n”+User+ “\n”+Passwd);  
  22.   
  23. catch (Exception e) {  
  24.   
  25. e.printStackTrace();  
  26.   
  27. }  


To:

  1. InputStream stream = null;  
  2.   
  3. System.out.println(“————————————”);  
  4.   
  5. try {  
  6.   
  7. Properties p = new Properties();  
  8.   
  9. stream=this.getClass().getClassLoader().getResourceAsStream(“Info.properties”);  
  10.   
  11. p.load(stream);  
  12.   
  13. Host = p.getProperty(“Host”);  
  14.   
  15. Pot = p.getProperty(“Port”);  
  16.   
  17. User = p.getProperty(“User”);  
  18.   
  19. Passwd = p.getProperty(“Passwd”);  
  20.   
  21. System.out.println(“Property Key-Values:” +”\n”+ Host +”\n”+ Pot + “\n”+User+ “\n”+Passwd);  
  22.   
  23. catch (Exception e) {  
  24.   
  25. e.printStackTrace();  
  26.   
  27. }  


2013年7月25日 星期四

JAVA on running Unix command: Not enough space

That's not what you think of "disk space". It means not enough swap, because your Java suddenly wants lots of GB of memory. When Java launches fork, it starts a new VM as a fork from current process. Thus for a short period between fork and exec, there is two instances of your stuff. That's temporary though. Exactly at this moment your system cries for a lack of swap.

2013年6月18日 星期二

Oracle: Update CLOB from file


Check file directory:
select * from dba_directories

Create directory:

create or replace directory dirName as
 'c:\data';



create or replace
procedure UPDATE_CLOB
AS

or use

DECLARE

   dest_clob CLOB;
   src_clob BFILE := BFILENAME('xxx from dba_directories', 'data1.txt');
   dst_offset number := 1 ;
   src_offset number := 1 ;
   lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
   warning number;
   BEGIN
DBMS_OUTPUT.ENABLE(100000);

SELECT text_value
      INTO   dest_clob
      FROM   SUBSIDY_ADMINISTRATION_SETTING
      WHERE  setting_id = 'test1'
      FOR UPDATE;

DBMS_OUTPUT.PUT_LINE('dest_clob' || dest_clob);

DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
DBMS_OUTPUT.PUT_LINE('length: ' || DBMS_LOB.GETLENGTH(src_clob));
DBMS_OUTPUT.PUT_LINE('length: ' || lang_ctx);

DBMS_LOB.LoadCLOBFromFile(
DEST_LOB => dest_clob
, SRC_BFILE => src_clob
, AMOUNT => DBMS_LOB.GETLENGTH(src_clob)
, DEST_OFFSET => dst_offset
, SRC_OFFSET => src_offset
, BFILE_CSID => DBMS_LOB.DEFAULT_CSID
, LANG_CONTEXT => lang_ctx
, WARNING => warning
);

UPDATE   SUBSIDY_ADMINISTRATION_SETTING set text_value= dest_clob
WHERE  setting_id = 'test1';
     
     
DBMS_LOB.CLOSE(src_clob);
COMMIT;
DBMS_OUTPUT.PUT_LINE('Loaded File using DBMS_LOB.LoadCLOBFromFile: (ID=1001).');
END;



2013年4月22日 星期一

Oracle: Cannot connect

Remember setup
export ORACLE_HOME=/oracle/11g/product/11.2.0

export ORACLE_SID=F87DEV

2013年2月26日 星期二

Install WebCenter 11.1.1.6 on Linux

Prepare linux.

Remember register linux:

yum install glibc.i686

yum install xorg-x11-apps
xhost +localhost.localdomain
    (xhost +computer name)

[reference also: 

other usefull yum(1) commands:
yum provides '*/xclock'
yum grouplist
yum groupinstall 'X Window System'
]

SQL Server: Restore from file


RESTORE DATABASE PSIWebV3
FROM DISK = 'C:\temp\PSIWebV3.dat'
WITH REPLACE

2012年9月12日 星期三

SharePoint 2010: Remove solution wsp from Central Administration

To deploy a solution by using Central Administration


1.On the Central Administration Home page, click System Settings.

2.In the Farm Management section, click Manage farm solutions.

3.On the Solution Management page, click the solution that you want to deploy.

4.On the Solution Properties page, click Deploy Solution.

5.On the Deploy Solution page, in the Deploy When section, select one of the following:



2012年9月11日 星期二

admin.aspx Failed to generate a user instance of SQL server due to failure in retrieving the user's local application data path app_data When move SQL server Express to SQL Server

When moving from SQL Server EXPRESS to SQL Server and then  go to admin.aspx, the error happened:
Failed to generate a user instance of SQL server due to failure in retrieving the user's local application data path app_data

SOLUTION:

  • Go to IIS 7.
  • Click on the site.
  • Double click on Connection Strings. Change the SocalSqlServerr value to new one.

2012年9月4日 星期二

Windows server 2008: the password does not meet the password policy requirements

To disable password policy:
Administrative tools ==> Local Security Policy
==> Account policies ==> Password Policy ==> disable the password complexity check.

2012年9月3日 星期一

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'


Web site connection fail on trying to open a connection to SQL Server.
Add a login to SQL Server for IIS APPPOOL\ASP.NET v4.0 and grant permissions to the database.
In SSMS, under the server, expand Security, then right click Logins and select "New Login...".
In the New Login dialog, enter the app pool as the login name and click "OK".
enter image description here
You can then right click the login for the app pool, select Properties and select "User Mapping". Check the appropriate database, and the appropriate roles. I think you could just select db_datareader anddb_datawriter, but I think you would still need to grant permissions to execute stored procedures if you do that through EF.

Oracle: Run Stored procedure with parameter and output

On SQL Developer:

SET serveroutput on;
variable f NUMBER;
execute user.package_name.procedure_name('parameter1', parameter2, :f);
print :f;