미래학자
test 본문
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jQuery(a,c) { | |
// Shortcut for document ready (because $(document).each() is silly) | |
if ( a && a.constructor == Function && jQuery.fn.ready ) | |
return jQuery(document).ready(a); | |
// Make sure that a selection was provided | |
a = a || jQuery.context || document; | |
// Watch for when a jQuery object is passed as the selector | |
if ( a.jquery ) | |
return $( jQuery.merge( a, [] ) ); | |
// Watch for when a jQuery object is passed at the context | |
if ( c && c.jquery ) | |
return $( c ).find(a); | |
// If the context is global, return a new object | |
if ( window == this ) | |
return new jQuery(a,c); | |
// Handle HTML strings | |
var m = /^[^<]*(<.+>)[^>]*$/.exec(a); | |
if ( m ) a = jQuery.clean( [ m[1] ] ); | |
// Watch for when an array is passed in | |
this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != undefined && a[0].nodeType ? | |
// Assume that it is an array of DOM Elements | |
jQuery.merge( a, [] ) : | |
// Find the matching elements and save them for later | |
jQuery.find( a, c ) ); | |
// See if an extra function was provided | |
var fn = arguments[ arguments.length - 1 ]; | |
// If so, execute it in context | |
if ( fn && fn.constructor == Function ) | |
this.each(fn); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileClassLoader { | |
public static void main(String[] args) { | |
FileClassLoader fileClassLoader = new FileClassLoader(); | |
File cpList = new File(fileClassLoader.getClass().getResource("/").getPath(), "classpath.properties"); | |
FileClassLoader fcl = new FileClassLoader(); | |
try { | |
BufferedReader br = new BufferedReader(new FileReader(cpList)); | |
URL[] urlList = fcl.getUrl(br); | |
br.close(); | |
URLClassLoader ucl = new URLClassLoader(urlList); | |
Object obj = ucl.loadClass("test.Hello").newInstance(); | |
System.out.println(obj.getClass().getSimpleName()); | |
} catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
} catch (MalformedURLException e) { | |
e.printStackTrace(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} catch (IllegalAccessException e) { | |
e.printStackTrace(); | |
} catch (InstantiationException e) { | |
e.printStackTrace(); | |
} catch (ClassNotFoundException e) { | |
e.printStackTrace(); | |
} | |
} | |
private URL[] getUrl(BufferedReader br) throws MalformedURLException, IOException { | |
String line = null; | |
URL[] urlList = null; | |
while((line = br.readLine()) != null) { | |
File cp = new File(line); | |
if (cp.exists()) { | |
URL[] temp; | |
int length = 0; | |
if (urlList != null) { | |
length = urlList.length; | |
temp = new URL[length + 1]; | |
System.arraycopy(urlList, 0, temp, 0, length); | |
} else { | |
temp = new URL[1]; | |
} | |
temp[length] = cp.toURI().toURL(); | |
urlList = temp; | |
} | |
} | |
return urlList; | |
} | |
} |
'전산 지식' 카테고리의 다른 글
[자료구조] 퀵정렬(quick sort), 합병정렬(merge sort) (0) | 2018.04.22 |
---|---|
[자료구조] 정렬 - 버블, 선택, 삽입 (0) | 2018.04.15 |
클라우드 개념 (IaaS, PaaS, SaaS) (0) | 2017.03.26 |
[운영체제] Operating System Concepts 9th 연습문제 - 4 (0) | 2016.12.21 |
[운영체제] Operating System Concepts 9th 연습문제 - 3 (2) | 2016.12.21 |
Comments