'Programming'에 해당되는 글 1789건

  1. 2014.11.11 DTD / XSD
  2. 2014.11.11 xcache 1.3.2 for php 5.3.22 for ARM
  3. 2014.11.10 xml benchmark
  4. 2014.11.10 xml dtd xsd
  5. 2014.11.06 QT font 관련
  6. 2014.11.05 QT modules
  7. 2014.11.05 QT Quick UI 2
  8. 2014.11.05 include guard
  9. 2014.10.21 lighttpd + php 퍼미션 문제
  10. 2014.10.20 php.ini extension_dir
Programming/xml2014. 11. 11. 09:58
DTD는 namespace를 지원하지 않고
XSD는 XML 표준에 namespace를 지원한다.
XSD를 쓰는게 더 나을거 같기도 하고..
[링크 : http://stackoverflow.com/questions/1490583/dtd-or-xml-schema-which-one-is-better]

일단 예제를 보면 DTD는 XML 포맷이 아니고 XSD는 XML 포맷이다.
<!DOCTYPE note
[
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]> 

[링크 : http://www.w3schools.com/xml/xml_dtd.asp] DTD 


<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema> 

[링크 : http://www.w3schools.com/schema/] XSD 

[링크 : http://bsp.mits.ch/xsd2dtd/] XSD to DTD 

'Programming > xml' 카테고리의 다른 글

xmlstarlet  (0) 2016.05.26
DOM vs SAX  (0) 2014.11.21
xml parser 선택 / 종류  (0) 2014.11.21
xml benchmark  (0) 2014.11.10
xml dtd xsd  (0) 2014.11.10
Posted by 구차니
Programming/php2014. 11. 11. 08:18
암용으로 크로스컴파일 하려는데
이래저래 부딛히는 dog show!!

php 컴파일시 configure 파일에서 dlopen 으로  검색후
found=yes로 하여 강제로 dlopen(extension 사용 가능하도록) 수정해야 한다.

php 컴파일
$ rm config.cache
$ ./configure --host=arm-none-linux-gnueabi --disable-all --with-config-file-path=/etc --enable-simplexml --enable-cgi --enable-fpm 

if-else 그리고 fi를 주석처리 
$ vi configure
65281 line
flock_type=unknown
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else

65323 line
if test "$cross_compiling" = yes; then :
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else


xcache 컴파일
$ CC=arm-none-linux-gnueabi-gcc ./configure  --host=arm-none-linux-gnueabi --enable-xcache --enable-xcache-optimizer
xcache의 환경설정

$ vi /etc/php.ini

# 주석처리 되어있으니 주석만 삭제하면 될 듯
cgi.fix_pathinfo=1

# 이상한(?) 경로이니 옮겨서 사용하려면 주석삭제 및 수정 필요
extension_dir = "/usr/lib"

# 가장 아래 추가하면 됨
extension=xcache.so
[xcache.admin]
xcache.admin.enable_auth = Off

[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =               1M
xcache.count =                 1
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0

xcache.var_size  =            1M
xcache.var_count =             1
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

xcache.test =                Off
xcache.readonly_protection = Off
xcache.mmap_path =    "/dev/zero"
xcache.coredump_directory =   ""

xcache.cacher =               On
xcache.stat   =              Off
xcache.optimizer =           Off

[xcache.coverager]
xcache.coverager =          Off
xcache.coveragedump_directory = "" 

$ vi /etc/lighttpd/lighttpd.conf 
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".html" => "/usr/bin/php",
#                              ".php" => "/bin/php-cgi",
                               ".cgi" => "" )

fastcgi.server = ( ".php" => ((
                        "bin-path" => "/bin/php-cgi",
                        "socket" => "/tmp/php.sock",
                        "max-procs" => 1,
                        "bin-environment" => (
                                "PHP_FCGI_CHILDREN" => "1",
                                "PHP_FCGI_MAX_REQUESTS" => "100"),
                        "bin-copy-environment" => (
                                "PAHT", "SHELL", "USER" ),
                        "broken-scriptfilename" => "enable"
                ))
)

lighttpd 에서 cgi.assign 부분에 php를 주석처리 하지 않으면
php-cgi 가 fpm을 통해 데몬으로 구동되어도 cgi가 먼저 처리 하면서 캐싱이 되지 않는다. 
(cgi가 fastcgi보다 위에 있어서 그럴지도?) 



ab 로 벤치마크 결과 50% 정도 향상.. 이려나?
+xcache enable
Time taken for tests:   570.448 seconds
Requests per second:    1.75 [#/sec] (mean)
Time per request:       570.448 [ms] (mean)
Time per request:       570.448 [ms] (mean, across all concurrent requests)
Transfer rate:          38.86 [Kbytes/sec] received

+xcache disable
Time taken for tests:   916.042 seconds
Requests per second:    1.09 [#/sec] (mean)
Time per request:       916.042 [ms] (mean)
Time per request:       916.042 [ms] (mean, across all concurrent requests)
Transfer rate:          24.20 [Kbytes/sec] received 




-----
--enable-fpm을 추가하지 않아도 되긴 되는 듯?

'Programming > php' 카테고리의 다른 글

php simpleXML saveXML 정렬하기 (well-formed XML)  (0) 2014.12.23
php simpleXML  (0) 2014.12.22
lighttpd + php 퍼미션 문제  (0) 2014.10.21
php.ini extension_dir  (0) 2014.10.20
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
Posted by 구차니
Programming/xml2014. 11. 10. 15:01
옛날 글이라 큰 의미를 가지긴 어렵지만..
2009년도 당시에 QTXML 성능은.. 핵폐기물 수준이었던 건가?!

[링크 : http://xmlbench.sourceforge.net/results/benchmark200910/in
[링크 : http://xmlbench.sourceforge.net/index.php?page=results.php
[링크 : http://xmlbench.sourceforge.net/

'Programming > xml' 카테고리의 다른 글

xmlstarlet  (0) 2016.05.26
DOM vs SAX  (0) 2014.11.21
xml parser 선택 / 종류  (0) 2014.11.21
DTD / XSD  (0) 2014.11.11
xml dtd xsd  (0) 2014.11.10
Posted by 구차니
Programming/xml2014. 11. 10. 14:48
XML - eXtensible Markup Language
DTD -Document Type Definition
XSD - XML Schema Definition

[링크 : http://en.wikipedia.org/wiki/XML
[링크 : http://edia.org/wiki/Document_type_definition]
[링크 : http://en.wikipedia.org/wiki/XML_Schema_(W3C)

'Programming > xml' 카테고리의 다른 글

xmlstarlet  (0) 2016.05.26
DOM vs SAX  (0) 2014.11.21
xml parser 선택 / 종류  (0) 2014.11.21
DTD / XSD  (0) 2014.11.11
xml benchmark  (0) 2014.11.10
Posted by 구차니
Programming/qt2014. 11. 6. 15:03
/usr/local/QtEmbedded-4.8.3/lib/fonts
*.ttf
*.qpf

[링크 : http://forum.falinux.com/zbxe/index.php?document_srl=498350&mid=graphic]



1. qt는 PFA/FPB BDF,TTF,qtf 폰트등을 지원합니다. 

2. qpf 폰트는 qt가 이들 bdf, ttf 폰트를 로드해서 rendering 이라는 절차를 거치는 과정에서 qpf라는 폰트를 나름대로 만들어서 사용을 하는 폰트입니다. qt쪽에서 보다 더 빠르게 만들어 놓은 format입니다. 
[링크 : http://www.korone.net/bbs/board.php?bo_table=qt_qna&wr_id=15069

umlaut

'Programming > qt' 카테고리의 다른 글

qt signal & slot - connect / disconnect / emit  (0) 2014.11.21
qt 프로젝트 파일 연관  (0) 2014.11.20
QT modules  (0) 2014.11.05
QT Quick UI  (2) 2014.11.05
qt moc(Meta Object Compiler)  (0) 2014.09.20
Posted by 구차니
Programming/qt2014. 11. 5. 16:20
java 에서는 package라고 하고
qt 에서는 module 이라고 하나보다

아무튼 module 이름으로 include 하면된다.
#include <Qtgui> 


Modules for general software development
QtCore Core non-graphical classes used by other modules
QtGui Graphical user interface (GUI) components
QtMultimedia Classes for low-level multimedia functionality
QtNetwork Classes for network programming
QtOpenGL OpenGL support classes
QtOpenVG OpenVG support classes
QtScript Classes for evaluating Qt Scripts
QtScriptTools Additional Qt Script components
QtSql Classes for database integration using SQL
QtSvg Classes for displaying the contents of SVG files
QtWebKit Classes for displaying and editing Web content
QtXml Classes for handling XML
QtXmlPatterns An XQuery & XPath engine for XML and custom data models
QtDeclarative An engine for declaratively building fluid user interfaces.
Phonon Multimedia framework classes
Qt3Support Qt 3 compatibility classes
Modules for working with Qt's tools
QtDesigner Classes for extending Qt Designer
QtUiTools Classes for handling Qt Designer forms in applications
QtHelp Classes for online help
QtTest Tool classes for unit testing
Modules for Windows developers
QAxContainer Extension for accessing ActiveX controls
QAxServer Extension for writing ActiveX servers
Modules for Unix developers
QtDBus Classes for Inter-Process Communication using the D-Bus

[링크 : http://qt-project.org/doc/qt-4.8/modules.html]

'Programming > qt' 카테고리의 다른 글

qt 프로젝트 파일 연관  (0) 2014.11.20
QT font 관련  (0) 2014.11.06
QT Quick UI  (2) 2014.11.05
qt moc(Meta Object Compiler)  (0) 2014.09.20
Qt 기본 encoding 설정  (0) 2014.09.19
Posted by 구차니
Programming/qt2014. 11. 5. 16:12
요약 : Quick UI는 qml 이라는 문서를 통해 GUI가 생성된다.


심심(?)해서 Qt Widgets Application 대신 QT Quick UI를 해서 프로젝트를 생성하니


QT Creator 에서 복사하니 이렇게 코드가 컬러풀 하게 붙여지네 ㄷㄷ

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("&Open")
                onTriggered: console.log("Open action triggered");
            }
            MenuItem {
                text: qsTr("Exit")
                onTriggered: Qt.quit();
            }
        }
    }

    Button {
        text: qsTr("Hello World")
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
    }
}

이렇게 나온다 ㄷㄷ


'Programming > qt' 카테고리의 다른 글

QT font 관련  (0) 2014.11.06
QT modules  (0) 2014.11.05
qt moc(Meta Object Compiler)  (0) 2014.09.20
Qt 기본 encoding 설정  (0) 2014.09.19
qt 시그널 .. emit  (0) 2014.09.19
Posted by 구차니
Programming/C Win32 MFC2014. 11. 5. 15:21
대단한건 아니고 현업에서 작업을 해봤다면 다들 했고 봤을 그 녀석

#ifndef FILENAME_HEADER
#define FILENAME_HEADER 
#endif 

[링크 : http://en.wikipedia.org/wiki/Include_guard]

'Programming > C Win32 MFC' 카테고리의 다른 글

winUSB / win32 physical drive  (0) 2014.12.23
printf POSIX 확장 %1$d  (0) 2014.12.09
vc++ vector와 Vector 차이점?  (0) 2014.07.03
순열생성관련  (0) 2014.06.27
2중 포인터 사용이유  (0) 2014.03.19
Posted by 구차니
Programming/php2014. 10. 21. 15:01
원인불명으로.. 실행이 안되서 여전히 고민..
일단 php-cgi를 재컴파일 해서 바꿔치기 해서
php-cgi 자체의 소유권 때문인가 싶어서 테스트 해봤지만
php-cgi가 root:root 던 www:www던 둘다 상관없이 안되므로 패스..


srwxr-xr-x    1 www      www             0 Jan  1 09:00 php.sock-0 

lighttpd.log 에서는 아래와 같이 에러가 발생한다.
1970-01-01 09:00:25: (log.c.166) server started
1970-01-01 09:00:25: (mod_fastcgi.c.977) bind failed for: unix:/tmp/php.sock-0 Permission denied
1970-01-01 09:00:25: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed.
1970-01-01 09:00:25: (server.c.964) Configuration of plugins failed. Going down.

일단.. 임시 방책으로
mkdir /tmp/www
chown www:www /tmp/www
으로 회피 -_- 

'Programming > php' 카테고리의 다른 글

php simpleXML  (0) 2014.12.22
xcache 1.3.2 for php 5.3.22 for ARM  (0) 2014.11.11
php.ini extension_dir  (0) 2014.10.20
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php 5.5.17 opcache / arm  (0) 2014.10.14
Posted by 구차니
Programming/php2014. 10. 20. 11:03
configure를 다시 뒤져봐도 컴파일시 지정하지 못했던 부분인데 어디서 나오는건지..

phpinfo()에서 extension_dir을 보면
php 5.3.22 기준 아래의 경로를 찍어 주는데
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/

lighttpd -m/usr/lib를 해주어도 위의 경로에 무조건! 넣어 주어야 extension이 작동한다
일단.. 경로가 괴랄하니..

php.ini 에다가 
extension_dir = "/usr/lib" 라고 해주면 깔끔(?)하게 끝!

extension_dir
In what directory PHP should look for dynamically loadable extensions. See also: enable_dl, and dl().
 
[링크 : http://php.net/manual/en/ini.core.php#ini.extension-dir]

'Programming > php' 카테고리의 다른 글

xcache 1.3.2 for php 5.3.22 for ARM  (0) 2014.11.11
lighttpd + php 퍼미션 문제  (0) 2014.10.21
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php 5.5.17 opcache / arm  (0) 2014.10.14
php - extensions are not supported on this platform / arm  (0) 2014.10.14
Posted by 구차니