The problem is, your project is missing the raster resources for pre-lollipop versions. Check, if you have file values/drawables.xml. It seems like you copied some source, but not this file. The file contains references to raster images, that are used as alternatives to the vector images:


<resources xmlns:android="http://schemas.android.com/apk/res/android">

<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item>

<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item>

<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item>

<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item>

<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item>

<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item>

</resources>



Android lollipop(5.0) 이하 버전에서는 values 폴더에 drawables.xml 파일에 위의 코드가 추가 되어야지

정상적으로 실행이 되어진다.



출처 : https://stackoverflow.com/questions/35673722/binary-xml-file-line-16-error-inflating-class-android-support-design-widget-na

Posted by 모과이IT
,

이번에는 이더리움 가상머신 (EVM)에 대해 설명해보도록 하겠습니다.
먼저, 이더리움이라고 하면 플랫폼 코인이며
ERC20 토큰들의 마더코인이란 사실이 자연스럽게 떠오르실겁니다.
ERC20 토큰들이 만들어지고 동작하는 장소가
바로 이 이더리움 가상머신 입니다.

이더리움 가상머신은 가상의 컴퓨터라고 보시면 됩니다.
그럼 간단하게 어떤 순서로 개발자들은 코드를 작성하고 실행하는지 보여드리겠습니다










먼저, 개발자들은 Solidity라는 언어로 코드를 작성해야 합니다.
작성된 코드를 컴파일하면 Ethereum Bytecodes 로 이더리움 가상머신이 인식 가능한 형태로 변환이 되고
이 변환된 코드가 이더리움 가상머신에서 실행되게 되는 구조입니다.

그럼 제3자가 무한루프가 도는 코드나 매우 고도의 연산량을 필요로 하는
비효율적인 코드들을 많이 생성시킨다면, 이더리움 가상머신에 매우 큰 부하가 걸릴 것입니다.
이를 예방하기 위해 이더리움 가상머신에서 동작하는 모든 코드들은
프로그램 동작단위의 일종인 task 단위로 GAS라는 수수료를 지불해야합니다.
즉, 수행해야하는 코드양이 많을수록 많은 수수료가 요구됩니다.








위 그림은 이더리움 생태계를 나타냅니다.
개발자는 스마트컨트랙트 기술을 활용하여 DApp을 개발합니다.
물론 Solidity 언어를 사용해야 합니다.
그럼 컴파일을통해 이더리움 가상머신에서 해당 코드를 실행할 수 있게 된다.
이때, 이더리움 가상머신을 동작시키는 원동력은 이더리움 노드들입니다.
즉, 채굴자들이 이더리움가상머신을 작동시키고
이로인해 수수료를 수익으로 받게됩니다.

요약하자면, 개발자는 DApp에 관련된 코드를 작성 후
이더리움 가상머신에서 실행시키며 수수료를 지불합니다.
채굴자는 이더리움 가상머신을 동작시키며
발생한 수수료를 지급받습니다.
이더리움 가상머신은 스마트컨트랙트를 처리해주는 컴퓨터라고 이해하시면 좋을듯 합니다.





'개발지식창고 > BlockChain' 카테고리의 다른 글

[용어] Smart Contract(스마트 계약)  (0) 2018.05.09
Posted by 모과이IT
,

1996년 닉 자보가 처음으로 제안

2013년 비탈릭 부테린(Vitalik buterin)이 비트코인의 소스 코드를 일부 수정하여 스마트 계약 기능을 구현하고자 하였으나, 비트코인 커뮤니티에서 자신의 요구가 받아들여지지 않자, 비트코인을 Fork(소스를 복제)하여 새로 이더리움(Ethereum)이라는 가상화페를 만들고 스마트 계약 기능을 구현하였다.


스마트 계약이란?

특정 조건에 부합하는 이벤트가 발생하면 약속된 계약 내용을 자동적으로 실행하는것


예를 들면,

ICO 모금단계에서 토큰을 지급하는 행위를 스마트 계약으로 구현한다면


"조건에 부합하는 이벤트 : 이더리움 입금

계약내용 : 1이더당 해당 토큰 1만개 지급"


이러한 스마트 계약을 활용하여 DAPP을 개발



'개발지식창고 > BlockChain' 카테고리의 다른 글

Ethereum Virtual Machine(EVM)  (0) 2018.05.09
Posted by 모과이IT
,

php.ini 

opcache.enable=0



Posted by 모과이IT
,

$_SERVER['DOCUMENT_ROOT'] : 사이트 루트의 물리적 경로. ex) /home/ksprg/www


$_SERVER['HTTP_ACCEPT_ENCODING'] : 인코딩 받식. ex) gzip, deflate


$_SERVER['HTTP_ACCEPT_LANGUAGE'] : 언어. ex) ko


$_SERVER['HTTP_USER_AGENT'] : 사이트 접속한 클라이언트 프로그램 정보. ex) Mozilla/4.0(compatible; MSIE 7.0; Windows NT 5.1; Q312461; .NET CLR 1.0.3705


$_SERVER['REMOTE_ADDR'] : 사이트 접속한 클라이언트의 IP. ex) 192.168.0.100

 

$_SERVER['HTTP_REFERER'] : 현제 페이지로 오기전의 페이지 주소값. <a> 또는 <form> 태그로 전송시 값이 넘어옴. 

                                            ex) http://roadrunner.tistory.com/write.php 


$_SERVER['SCRIPT_FILENAME'] : 실행되고 있는 파일의 전체경로. ex) /home/ksprg/www/index.php


$_SERVER['SERVER_NAME'] : 사이트 도메인 : roadrunner.tistory.com (virtual host에 지정한 도메인)

 

$_SERVER['HTTP_HOST'] : 사이트 도메인 : roadrunner.tistory.com (접속할 때 사용한 도메인)


$_SERVER['SERVER_PORT'] : 사이트 포트. ex) 80


$_SERVER['SERVER_SOFTWARE'] : 서버의 소프트웨어 환경

                                                 ex) Apache/1.3.23 (Unix) PHP/4.1.2 mod_fastcgi/2.2.10 mod_throttle/3.1.2 mod_ssl/2.8.6


$_SERVER['GATEWAY_INTERFACE'] : CGI 정보. ex) CGI/1.1


$_SERVER['SERVER_PROTOCOL'] : 사용된 서버 프로토콜. ex) HTTP/1.1


$_SERVER['REQUEST_URI'] : 현재페이지의 주소에서 도메인 제외. ex) /index.php?user=ksprg&name=hong


$_SERVER['PHP_SELF'] : 현재페이지의 주소에서 도메인과 넘겨지는 값 제외. ex) /test/index.php

                                    파일명만 가져올때 : basename($_SERVER['PHP_SELF']);


$_SERVER['APPL_PHYSICAL_PATH'] : 현재페이지의 실제 파일 주소. ex) /home/ksprg/www/

 

$_SERVER['QUERY_STRING'] : GET 방식의 파일명 뒤에 붙어서 넘어오는 파라미터 값. ex) ?user=ksprg&name=hong 



출처: http://roadrunner.tistory.com/158 [삶의 조각들]


Posted by 모과이IT
,



sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool NO

Posted by 모과이IT
,

To make sure you will get through this installation first get a developer license first. You need it during the installation of wowza. You can get as many and as often one. The license is valid for 180 days and you can use it for 1 upload stream and 10 viewers. For developing purposes this should be enough. When the 180 days are over, just replace it with a new one;).
https://www.wowza.com/media-server/developers/license

  1. Make sure your ubuntu server is up to date. Run the 2 commands.

    2. Wowza is depending on Java, so we have to install it.

    3. Install Oracle JDK package

    4. Time to install wowza. Go to a tmp directory

    Download the latest version (in this case 4.7.1) you can replace it with the latest version (which you can find here: https://www.wowza.com/pricing/installer)

    Make the file executable:

    Time to run the file and start the actual installation:

    5. Some questions will be asked. they all can be answered with Enter or yes.

    Get your license key on standby. You need it here:

    After this you have to create a username and password to your choice (words in capitals you should fill in yourself.

    Do you want to start wowza automaticly after a reboot?

    Setup is ready. Continue to install wowza with the settings you gave in above questions. Not sure? (type N to start from step 4 again).

    Time to get some coffee (it will take about a minute or 2)

    After this the setup is done

    You can now access your wowza streamingEngine Manager in your browser by typing your ipadress instead of the YOUR_SERVER_IP in the example below.

    Update sept 4, 2017:
    Go on the commandline again an check the java version:

    It will show something like this:

    When you go into the Enginemanager and to server > About
    You will most likely see a different (older) version. In my case it was: 1.8.0_77

    So Wowza is not using my latest java version on the server. Here is a fix for that:
    Go on the commandline again:

    This will remove the current java version and create a symlink to the latest version. After this restart the streamingengine and enginemanager. 

    Now login again in the Enginemanager and check the java version again. It should give you the same version as you have on the server. In my case: 1.8.0_144

 


출처 : https://vanmarion.nl/blog/blog/wowza-streamingengine-4-x-installation/

Posted by 모과이IT
,

http://recoveryman.tistory.com/186

Posted by 모과이IT
,



[리눅스에서 삼바셋팅 일반적인방법]

http://naompine.blogspot.kr/2015/08/14-centos-samba.html


[문제점]

위의 일반적인 셋팅 방법대로 해주어도 실제 윈도우에서 리눅스 공유 폴더로 접속을 하면

해당 리눅스 폴더의 권한과 파일권한을 다 주었는데도 파일 write와 modify가 되지 않았다. 


[원인]

Centos는 레드햇 계열이라 "보안 강화 리눅스"(Security Enhanced linux) 즉 selinux 설정 해제를 해주어야지 실제로 write와 modify가 정상적으로 되어진다.


[해결 방법]


1. vi 를 통해 "/etc/selinux/config" 에 접속한다.

2. selinux 를 화면과 같이 disabled 하면 된다.


[root@ns1 log]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - SELinux is fully disabled.

SELINUX=disabled

# SELINUXTYPE= type of policy in use. Possible values are:

# targeted - Only targeted network daemons are protected.

# strict - Full SELinux protection.

SELINUXTYPE=targeted


시스템 재부팅


기타 방법 ( 위 내용 추천)

1. 수동으로 끄기(일시적으로만 먹힘)

system-config-securitylevel

setenforce 0


2. 커널 명령행에 다음 옵션 추가. (grub.conf 등에)

selinux=0


3. 명령어(바로 적용)

켜기 : # setenforce 1 

끄기 : # setenforce 0

 

[참고사이트]

http://blog.naver.com/tkdldjs35/221035408692

http://88240.tistory.com/405

https://ko.wikipedia.org/wiki/보안_강화_리눅스




Posted by 모과이IT
,

[NodeJS 설치]

1. nodejs 다운로드

https://nodejs.org/ko/download/ 

에서 url 확인

wget http://nodejs.org/dist/v6.11.4/node-v6.11.4-linux-x64.tar.xz


2. 압축해제

 tar xf node-v6.10.2-linux-x64.tar.xz


3. 위치 이동

 mv ./node-v6.10.2-linux-x64 /usr/local/nodejs



4. Path 설정을 위해 profile 수정

 vi /etc/profile


맨아래에 추가

export NODE_HOME=/usr/local/nodejs

export PATH=$PATH:$NODE_HOME/bin


 source /etc/profile


5. 필요시 서버 재부팅 필요

 shutdown -r now


6. npm 업데이트

npm update -g npm


[테스트 소스]

const http = require('http');

http.createServer((request, response) => {

  return request

    .on('error', (err) => { // 요청에 에러가 있으면

      console.error(err);

    })

    .on('data', (data) => { // 요청에 데이터가 있으면

      console.log(data);

    })

    .on('end', () => { // 요청의 데이터가 모두 받아졌으면

      response.on('error', (err) => { // 응답에 에러가 있으면

        console.error(err);

      });

      response.statusCode = 200; // 성공 상태 코드

       response.setHeader('Content-Type', 'text/plain'); // header 설정

      response.write('hi\n'); // body에 정보 탑재

      response.end('the end!'); // 정보 탑재 후 브라우저로 전송

    });

}).listen(8080);




[방화벽 8080 포트 열기]

1. /etc/sysconfig/iptables 파일 열기 & 수정

    [root@moguwai ~]# vi /etc/sysconfig/iptables


    열고자 하는 포트를 아래 라인과 같이 추가. (8080 포트 열기)

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT


2. iptables restart - 아래 명령 사용.

    [root@moguwai ~]# service iptables restart

    또는

    [root@moguwai ~]# /etc/init.d/iptables restart



Posted by 모과이IT
,