2015년 2월 1일 일요일

맥북 프로 충전 단자 깜빡일때


dbartul 의 방법으로 구사일생 (2011 late)

Won't start up; charger blinking orange
https://discussions.apple.com/thread/4270970


Had the same problem with my MacBook Pro 13" (Late 2011), switching adapters didn't work, SMC reset didn't work and I was just about to quit trying and take it to the shop when out of frustration I've unplugged the battery connector and plugged it right back in and that FIXED IT!!
(note: do not remove the battery since that will void the warranty, just remove the connector)

2014년 12월 26일 금요일

rotation VS orientation

An orientation is a state: “the object’s orientation is…”
A rotation is an operation: “Apply this rotation to the object”

That is, when you apply a rotation, you change the orientation. Both can be represented with the same tools, which leads to the confusion.

from http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/

2014년 10월 25일 토요일

Missing launcher and window menu bar of Ubuntu 12.04 on Paralles

Parallels 에 돌아가는 Ubuntu 의 menu bar가 사라져있음.

해결 : unity --reset

2014년 9월 29일 월요일

Hardware Accelerated Execution Manager


다음의 에러:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX is not installed on this machine (/dev/HAX is missing).

Intel® Hardware Accelerated Execution Manager 설치하면 됨.
The Intel Hardware Accelerated Execution Manager (Intel HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (Intel VT) to speed up Android app emulation on a host machine.


2014년 9월 9일 화요일

string이 URL 형태인지 체크 (Java)


import java.net.MalformedURLException;
import java.net.URL;


try { URL url = new URL("url_string"); }
catch (MalformedURLException e) { /* invalid URL */ }



http://stackoverflow.com/questions/9902265/find-out-the-string-is-url

2014년 9월 2일 화요일

Permission issue of Apache2 on OSX Mavericks

Permission issue of Apache2 on OS X Mavericks :



sudo vi /private/etc/apache2/httpd.conf

Just replace "Deny" with "Allow"

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all

Restart Apache server :
sudo apachectl restart

"It works!"

2014년 9월 1일 월요일

Lemon 설치


아래와 같이 Policy 때문에 설치가 안됨.
관련 문서 : http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html

$ cmake ..
CMake Error at CMakeLists.txt:3 (CMAKE_POLICY):
  Policy "CMP0048" is not known to this version of CMake.

CMakeLists.txt 에서 주석처리함.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

#CMAKE_POLICY(SET CMP0048 OLD)

SET(PROJECT_NAME "LEMON")
PROJECT(${PROJECT_NAME})


$ cmake ..
CMake Error at CMakeLists.txt:3 (CMAKE_POLICY):
  Policy "CMP0048" is not known to this version of CMake.


-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.3")
-- Found Wget: /usr/bin/wget
-- Found Doxygen: /usr/bin/doxygen
-- Found Ghostscript: /usr/bin/gs
-- Found GLPK: /usr/lib/libglpk.so (Required is at least version "4.33")
-- Could NOT find ILOG (missing:  ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR)
-- Could NOT find COIN (missing:  COIN_INCLUDE_DIR COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_COIN_UTILS_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY)
-- Could NOT find SOPLEX (missing:  SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Copy doc from source tree
-- Configuring incomplete, errors occurred!






2014년 8월 10일 일요일

Fragment 동적으로 만들떄

동적으로 만들때


xml 쪽에는
       android:id="@+id/fragment_place"
       android:layout_height="match_parent">
 

or

        android:id="@+id/fragment_place"
        android:layout_marginTop="120dp"
        android:layout_height="match_parent"
        android:layout_width="match_parent"        >
   


.java 파일에는
...
// Create new fragment and transaction
        Fragment newFragment = new FragmentDefault();
        FragmentTransaction transaction = getFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack
        transaction.replace(R.id.fragment_place, newFragment);
        transaction.addToBackStack(null);
// Commit the transaction
        transaction.commit();


https://github.com/codepath/android_guides/wiki/Creating-and-Using-Fragments

2014년 7월 31일 목요일

Android에서 키보드 사라지게 하기


다음처럼부르면 됨

DDUtil.setupUI(MainActivity.this, findViewById(R.id.parent));


다음처럼 간단히
public class DDUtil {
    public static void setupUI(final Activity activity, View view) {
        //Set up touch listener for non-text box views to hide keyboard.
        if(!(view instanceof EditText)) {
            view.setOnTouchListener(new View.OnTouchListener() {
                public boolean onTouch(View v, MotionEvent event) {
                    hideSoftKeyboard(activity);//MainActivity.this
                    return false;
                }
            });
        }
        //If a layout container, iterate over children and seed recursion.
        if (view instanceof ViewGroup) {
            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
                View innerView = ((ViewGroup) view).getChildAt(i);
                setupUI(activity, innerView);
            }
        }
    }
    public static void hideSoftKeyboard(Activity activity)
    {
        InputMethodManager inputMethodManager = (InputMethodManager)  activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
    }
}



참고 :
http://stackoverflow.com/questions/4165414/how-to-hide-soft-keyboard-on-android-after-clicking-outside-edittext


2014년 7월 28일 월요일

Maya: parenting an object


parent 붙일child  parent노드


풀기 : unparent given object(s) -- parent to world
parent -w instrument_asm_10mm;

엮기
parent 붙일child  parent노드
parent coupler:IGES_Model_Data active_arm_v1_tmp:transform1094;


아래는 공식 사이트에서


// Move the circle under group2.
// Note that the circle remains where it is.
parent circle1 group2;


2014년 7월 9일 수요일

CMAttitudeReferenceFrame

Enum constants for indicating the reference frames from which all attitude samples are referenced.


typedef enum {
     CMAttitudeReferenceFrameXArbitraryZVertical = 1 << 0,
     CMAttitudeReferenceFrameXArbitraryCorrectedZVertical = 1 << 1,
     CMAttitudeReferenceFrameXMagneticNorthZVertical = 1 << 2,
     CMAttitudeReferenceFrameXTrueNorthZVertical = 1 << 3
} CMAttitudeReferenceFrame


CMAttitudeReferenceFrameXArbitraryZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.

CMAttitudeReferenceFrameXArbitraryCorrectedZVertica
: Describes the same reference frame as CMAttitudeReferenceFrameXArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of CMAttitudeReferenceFrameXArbitraryZVertical results in increased CPU usage.

CMAttitudeReferenceFrameXMagneticNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.

CMAttitudeReferenceFrameXTrueNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.

all available in iOS 5.0 and later.


source : Apple dev page.