- Time.time


 이 프레임의 시작 시간은 (읽기 전용). 이것은 게임의 시작한 시간이다.

 즉 게임이 시작하였을때부터 진행되어온 시간이 기록된다.



 - Time.frameCount


 게임이 시작된 이후부터 렌더링된 프레임의 회전 숫자가 기록된다.



 - Time.deltaTime


 프레임이 완료된 시점은 시간을 기록한다.

즉 이전 코드 실행이후 해당 프레임의 처리를 완료된 시점이 기록된다.



- Time.smoothDeltaTime


 deltaTime과 기능적으로는 비슷하나 조금더 객체가 부드럽게 움직일수 있도록


큰움직임을 제한하여 기록한다.



 

'개발' 카테고리의 다른 글

Unity UnityException: Unable to install APK!  (1) 2017.01.11
Unity 화면밖으로 객체가 나갈경우 이벤트  (0) 2016.12.17
[Spring Boot] MojoFailureException 오류  (1) 2016.10.12
swift Imageview not antialias  (0) 2016.06.03
jsoup 403 error  (0) 2015.11.23


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project MarkCommunity: There are test failures.

[ERROR] 

[ERROR] Please refer to /Users/myeongboseo/spring/MarkCommunity/target/surefire-reports for the individual test results.

[ERROR] -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException



Spring Boot 빌드를 하면 정상적으로 빌드되고 프로젝트도 동작을 하지만


maven 빌드를 하면 위와 같은 오류가 발생하였습니다.


위 같은 오류는 여러가지 이유가 있었지만 저는 spring boot를 최초 생성할때 package의 경로와


application class 의 경로가 일치하지 않아서 발생하여,


package경로와 Application class의 위치가 일치하니 정상적으로 동작합니다.

'개발' 카테고리의 다른 글

Unity 화면밖으로 객체가 나갈경우 이벤트  (0) 2016.12.17
Unity3d Time 클래스  (0) 2016.12.17
swift Imageview not antialias  (0) 2016.06.03
jsoup 403 error  (0) 2015.11.23
JAVA 클래스의 초기화 타이밍에 관한 고찰  (0) 2015.10.29


imageview.layer.magnificationFilter = kCAFilterNearest;

'개발' 카테고리의 다른 글

Unity3d Time 클래스  (0) 2016.12.17
[Spring Boot] MojoFailureException 오류  (1) 2016.10.12
jsoup 403 error  (0) 2015.11.23
JAVA 클래스의 초기화 타이밍에 관한 고찰  (0) 2015.10.29
출력 포맷(print format) - printf  (0) 2014.09.22

Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'mysql-bin.000091'


 

 저 같은 경우에는 replication 을 사용하는중 마스터 서버를 재부팅할때 발생하였습니다.


 


 이렇게 현재 읽고있는 log 를 다음으로 변경하여 수정하였습니다.

 


https://www.percona.com/blog/2014/10/08/mysql-replication-got-fatal-error-1236-causes-and-cures/




유저권한 없는상태에서 접근시 발생되는 오류입니다.




위처럼 유저값을 넣어주시면 됩니다.





 activity가 recreate 될때 freagment 도 destroy 됩니다.


 여기서 문제는 activity에 있는 fragment 포인터가 recreate시 달라지는 문제가 발생하게 될때


 setRetainInstance(true) 를 호출하여 recreate시 recreate하지 않도록 설정할수있습니다.


 안드로이드를 개발하다가 java의 초기화 타이밍에대해 다시금 생각하는 문제에 도달하여 이렇게 글을 남깁니다.


제가 도달한 문제인데 한번 알아두면 좋을것 같네요.


문제! 





print 된값은?




 ..


 ..


 ..


 ..


 ..


 ..


 ..


 ..


 ..


 ..


 ..


 ..


정답은 0 입니다.


 왜 0일까요? 분명 test라는 int를 5로 초기화 하는데,  결과값은 0이라니?


 이 문제때문에 한동안 고민했었는데요,  이유는 초기화 타이밍 때문이었습니다.


 JavaTest 라는 클래스를 초기화 하면서 test 라는 변수에 5라는 숫자를 넣기전에


 Parent 클래스가 test라는 변수를 호출하여 최초 클래스 생성시 기본값인 0 이 표시된것이지요,


 알고있으면 당연히 넘길 문제인데, 모르면 오랫동안 찾아도 쉽게 찾을수 없는 부분일듯 합니다.






Android Studio 에서 push GCM 구현


1. 프로젝트를 생성.

.


2. build.gradle 에서 gcm 라이브러리를 import 합니다.


dependencies 안에 값을 넣습니다.


 compile 'com.google.android.gms:play-services:8.1.0'





3. class 파일을 생성하여줍니다.


 총 3개의 파일이 필요합니다.


화면구성과 값 등록시 필요한 MainActivity 와,


push가 왔을때 전달할 GcmBroadcastReceiver 클래스


push 받은이후 동작을 구성할 GcmIntentService 클래스가 필요합니다.




MainActivity


mainActivity에서는 푸시를 등록하는 역활을 해줍니다.




SENDER_ID 값에다가 등록한이후 클라이언트 ID값을 넣어주시면 됩니다.


그리고 등록한 이후에 쿠키값을 서버에 전달하여 주면 됩니다.


regId = gcm.register(SENDER_ID); 


 서버에서는 서버키 값과 regId 두가지 값으로 push를 하게 되기때문에,


regId값을 서버에 넣는 코드를 추가하시면 됩니다.



GcmBroadcastReceiver


GcmBroadcastReceiver는 단순이 값을 받아서 서비스쪽에 전달하는 역활을 하게됩니다.




GcmIntentService


GcmIntentService는 push가 왔을때에 행동을 취하게 됩니다.


현재 클래스는 단순히 값이 왔을때 Log.i를 찍는 행동을 하게 됩니다.





2. manifest 에서 권한을 추가합니다.






manifest 에서 리시버와 서비스를 추가합니다.




AndroidManifest.xml



이후 서버쪽에 서버 키값과 regId 값을 전달해주시면,


서버쪽에서 push를 하게되면 디바이스쪽으로 전달됩니다.



 기다리고 기다려도 오지 않아 PIN 번호 발급이 잘못됬나?


 한글로 주소를 입력해서 안오는건가?


 우편부아저씨가 아무도 없다고 그냥가셨나?


 별에 별생각을 다했었는데, 드디어 왔네요.


 저는 오는데 20일 정도 걸린것같습니다.




 이제야 겨우 지급 받을수있겠네요~~


 휴우

 
org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [tc.wo.mbseo.exchangediary.https.datas.TestData] and content type [text/html]
 
 몇일 동안 고생했던 오류 ㅠ
 
@Rest(rootUrl = "주소",converters = {GsonHttpMessageConverter.class} )
public interface HttpTest {
...
...
...
}
 
androidannotations 에서 rest templete 을 사용하는데 계속 이 오류 뜨는 경우.
 
서버에서 가져오는 값이 text/html 으로 오고 있기때문에 
 
GsonHttpMessageConverter 으로 변환할수 없기때문에 발생하는 오류입니다.
 
 
 
1. 텍스트에 대한 대응 추가.
 
 
이럴때에는 "converters =" 에서 
 
StringHttpMessageConverter.class 를 추가하여 텍스트에 대한 대응을 추가하면
 
리턴받는 값이 text 값으로 정상적으로 들어오게 됩니다.
 
@Rest(rootUrl = "주소",converters = {GsonHttpMessageConverter.class, StringHttpMessageConverter.class} )
public interface HttpTest {
...
...
...
}
 
 
2. server 에서 수정 하는 방법
 
 사실상 서버쪽에서 발생된 오류가 볼수있으며, json 포멧으로 넘기고 타입은 text/html 을 넘기기 때문에
 
발생된 것이므로 서버쪽에서 header 에서 추가해주면 됩니다.
 
header('Content-Type: application/json')

3. android 쪽에서 수정하는 방법

 

 RestTemplate getRestTemplate();

 

 void setRestTemplate(RestTemplate restTemplate);

 

를 추가하여 template에 접근할수있도록 변경한이후,

 

        GsonHttpMessageConverter converter = new GsonHttpMessageConverter();

        final List<MediaType> supportedMediaTypes = new LinkedList<MediaType>(converter.getSupportedMediaTypes());
        final MediaType mediaType = new MediaType( MediaType.TEXT_HTML.getType() );
        supportedMediaTypes.add(mediaType);

        converter.setSupportedMediaTypes(supportedMediaTypes);
        httpTest.getRestTemplate().getMessageConverters().add(converter);
 
GsonHttpMessageConverter 에서 파싱할수있는 타입을 추가해주시면 됩니다.

 

+ Recent posts