Skip to content

Yaccc/ChmodUtil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tool description


JAVA PACKAGE

  • FilterAnnotationUtil.javaIs a tool for filtering file notes,The main filtration and two kinds of notes /**/ //. Call this methodString filterContent(URL url),URL path to the file
FilterAnnotationUtil.Instance().filterContent(fileUrl)

Thanks for Alienero's ideas

  • ReadWriteLockOfLockSimpleReadWriteLockCanAccessThese two classes are read and write lock implementation, the former is relatively simple to achieve, the latter is relatively complete,Basically realize the read / write lock can be re entered,Read lock upgrade, write lock degradation and other functions。Of course, the gap is still very large and JDK,Just to provide you with a learning idea。readwritelock.examplePackage is an example.
public void run() {                                                                
         if (!isWrite){                                             
             readWrite.readLock();                                  
             try {                                                  
                 Thread.currentThread().sleep(5000);              
             } catch (InterruptedException e) {                 
                 e.printStackTrace();                              
             }                                                  
             readWrite.unReadLock();                          
         }else{                                                 
             readWrite.writeLock();                                             
             try {                                                   
                 Thread.currentThread().sleep(3000);             
             } catch (InterruptedException e) {                     
                 e.printStackTrace();                        
             }                                                          
             readWrite.unWriterLock();                                               
         }                                                                              
     }                                                                                  

Python PACKAGE

  • python-db.pyIs a package of SQL tools.Use it(see below)
from DBUtils.PooledDB import PooledDB
#CRUDExceptSelect Can execute SQL CRUD
#The last parameter indicates whether is batch,the first is your SQL,the second is your value arrays
k=[['wo222ijoi'],['1231231']]
print CRUDExceptSelect(sql='insert into user (name) values(?)',kw=k,batch=True)

About

Record some of my tools, not limited to language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published