Recently we decided to move our git repo to local git server so we chose GitLab. During weeks use GitLab it was really convenient. Until one day we have a thought about checking code style before push. Basically Git support 2 kinds of hooks. One is Client side and the other is from Server side http://git-scm.com/book/en/Customizing-Git-Git-Hooks In terms of checking code style we can do both on Client and Server side. However we want this rules be more STRICT :D, so we decided to make it from Server side . So here is problem! After investigation we found GitLab actually changed quite a lot from Gitorious. Especially Gitlab uses Gitlab-Shell to wrapper the Git commands. So when we found "Hooks" folder what we can get is like this: ONLY ONE "UPDATE" . If you open it you will found quite simple codes: So check GitlabUpdate in ../lib/ And if you change the codes to exit with "1", all the push request will be rejecte...
I was using HttpClient to handle the http request and response. Previously I always debug on latest phones which are upper 4.0 everything works fine. One day I tried on my older phone Moto Defy running 2.3.7 from Cyanogenmod . There was one issue when I tried to post an image . I got the log : Invalid use of SingleClientConnManager: connection still allocated. or Caused by: java.lang.IllegalStateException: No wrapped connection. or Caused by: java.lang.IllegalStateException: Adapter is detached. Searched in stackoverflow normally it is because of accessing single instance of HttpClient in different thread or did not close InputStream of httpresponse. Mine issue is the first one. So I learnt one solution to get a thread safe httpclient. public static DefaultHttpClient getThreadSafeClient () { DefaultHttpClient client = new DefaultHttpClient (); ClientConnectionManager mgr = client . getConnectionManager (); HttpParams para...
Damon How to make Android Gridview unscrollable. I found one solution is : GridView .setOnTouchListener( new OnTouchListener(){ public boolean onTouch(View v, MotionEvent event) { return event.getAction() == MotionEvent. ACTION_MOVE ; } }); the code means consume the gridview's ACTION_MOVE touch event.
Comments
Post a Comment