2011/07/26

http, put

- reference

-- java
--- http://d.hatena.ne.jp/nacookan/20080108/1199774995

--- http://stackoverflow.com/questions/2099576/java-http-put-with-httpurlconnection

--- http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=48794&forum=12

-- java : sounds untrue
http://stackoverflow.com/questions/1051004/how-to-send-put-delete-http-request-in-httpurlconnection-looks-like-not-working

-- java servlet
--- http://mergedoc.sourceforge.jp/tomcat-servletapi-5-ja/javax/servlet/http/HttpServlet.html

-- perl : http://blog.tanarky.com/2010/01/perlhttp-put-method.html

2011/07/25

apache directive

* settings file

- /etc/httpd/conf/httpd.conf

- reference : http://httpd.apache.org/docs/2.0/ja/mod/core.html

* PUT

- in /etc/httpd/conf/httpd.conf

-- affirm
--- LoadModule dav_module modules/mod_dav.so
--- LoadModule dav_fs_module modules/mod_dav_fs.so

-- add DAV On

<Directory "/var/www/html"&rt;
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
DAV On
</Directory &rt;


* OPTIONS

- Request
  1. OPTIONS / HTTP/1.1  
  2. User-Agent: Java/1.6.0_26  
  3. Host: 192.168.11.10  
  4. Connection: keep-alive  

- Response
  1. HTTP/1.1 200 OK  
  2. Date: Tue, 26 Jul 2011 10:39:10 GMT  
  3. Server: Apache/2.2.3 (Red Hat)  
  4. DAV: 1,2  
  5. DAV: <http: apache.org="" dav="" propset="" fs="" 1="">  
  6. MS-Author-Via: DAV  
  7. Allow: OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,COPY,MOVE,LOCK,UNLOCK  
  8. Content-Length: 0  
  9. Keep-Alive: timeout=15, max=100  
  10. Connection: Keep-Alive  
  11. Content-Type: httpd/unix-directory  
  12.   
  13. </http:>  

linux centos ftp

* vsftpd

** install & start

- yum -y install vsftpd

- /etc/rc.d/init.d/vsftpd start

** default path

./var/ftp/pub/

** settings

- /etc/vsftpd/vsftpd.conf 


- reference :
-- http://centossrv.com/vsftpd.shtml
-- http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=41607&forum=10

2011/07/24

java iterator - for

  1. for(int i=0;i<projects.length;i++){  
  2.   Log.logInfo(projects[i].toString());  
  3. }  

Handling File in Eclipse Plugin


* Add Dependenceis in MANIFEST.MF
- MANIFEST.MF > Dependencies > Add > org.eclipse.core.resources


  1. IWorkspace ws = ResourcesPlugin.getWorkspace();   
  2. IWorkspaceRoot root = ws.getRoot();     
  3. IProject[] projects = root.getProjects();  
  4.   
  5. //ws.toString:org.eclipse.core.internal.resources.Worksapce@**  
  6. //root.toString : R  
  7.   
  8. IProject project = projects[0];  
  9. IFolder tmpDir = null;  
  10. IFile file = null;  
  11.     
  12. if(project.exists()){  
  13.   //1. Create in Project not System  
  14.   tmpDir = project.getFolder((new Path("tmp")));  
  15.   if(!tmpDir.exists()){  
  16.     try {  
  17.       //2. Create in System  
  18.       tmpDir.create(falsetruenull);  
  19.     }catch (CoreException e) {            
  20.       e.printStackTrace();  
  21.     }  
  22.   }  
  23.   file = tmpDir.getFile(new Path("boo.txt"));  
  24.   if(!file.exists()){  
  25.     try{          
  26.       String str = "dummy";  
  27.       InputStream is = new ByteArrayInputStream(str.getBytes());  
  28.       file.create(is, falsenull);            
  29.     }catch(CoreException e){  
  30.       e.printStackTrace();  
  31.     }  
  32.   }  
  33.   Log.logInfo(file.getLocation().toString());  
  34. }else{  
  35.   Log.logInfo("project is NOT exist");  
  36. }  


- reference :
--http://www.masatom.in/pukiwiki/Eclipse/%A5%D7%A5%E9%A5%B0%A5%A4%A5%F3%B3%AB%C8%AF%A4%CETIPS%BD%B8/%A5%EF%A1%BC%A5%AF%A5%B9%A5%DA%A1%BC%A5%B9%A4%CE%A5%EA%A5%BD%A1%BC%A5%B9%A4%F2%BC%E8%A4%EA%B0%B7%A4%A6/

eclipse link

* Eclipse Tips Japanese

http://www.masatom.in/pukiwiki/Eclipse/%A5%D7%A5%E9%A5%B0%A5%A4%A5%F3%B3%AB%C8%AF%A4%CETIPS%BD%B8/

* Eclipse Tutorials English

2011/07/23

2011/07/22

eclipse plugin (sample action)


1. Open plugin of sample view

2. View MANIFEST.MF

2-1. show Extensions tab > add > Extension Points : org.eclipse.ui.actionSets

2-2. Edit

* org.eclipse.ui.actionSets
- Extension Element Details
-- id : foo.foo.foo.actionSet_id1
-- label : any string
-- visible : true

* org.eclipse.ui.actionSets > Right Click > New > menu
- Extension Element Details
-- id : foo.foo.foo.menu_id1
-- label : {Label of Menu Bar}
-- path : additions @@
-- icon :

** Right Click on actionSet > New > gourpMaker
- Extension Element Details
-- name : content @@

** Right Click on actionSet > New > separator
- Extension Element Details
-- name : additions @@

* org.eclipse.ui.actionSets > Right Click > New > action
-- menubarPath : foo.foo.foo.menu_id1/content
-- toolbarPath : Normal/additions
-- Click class @ then create class.
--- implements IWorkbenchWindowActionDelegate ((equals to interface))

-3. Debugging

-- Project Property > Run As > Eclipse Application




wmv in mac

* Flip4Mac

- Mac Menu > System Environment Setting > Flip4Mac
-- Player > Advanced > Add Application



2011/07/18

Apache HTTP Server return : Destination unreachable


* Problem : http server returns

- ICMP : Destination unreachable (Host administratively prohibited)
-- Type : 3 = Destination unreachable
-- Code : 10 = Host administratively prohibited

* Solution
- Here are some firewall.

- CentOS

-- MenuBar > System > Security level and Firewall Settting
--- HTTP




Log in android

  1. import android.util.Log;  
  2.   
  3. public class FooActivity extends Activity {  
  4.   public static final String LOGTAG = "[Foo] FooActivity";  
  5.   Log.d(LOGTAG, "Start");  
  6.   //...  
  7. }  

Blogger Syntax Hightlighter : Test Java

  1. public class HelloWorld {  
  2.    public static void main(String[] args) {  
  3.        System.out.println("Hello World!");  
  4.    }  
  5. }  

Blogger Syntax Hightlighter : Test C

  1. int main (){  
  2.  printf("Hello world\n");  
  3.  return 0;  
  4. }  

Blogger Syntax Hightlighter

reference : http://code.google.com/p/syntaxhighlighter/
reference : http://www.kuribo.info/2008/06/blogger-syntax-highlighter.html

<pre name="code" class="java">

</pre>


in HTC Desire HD, Android 2.3(Ginger) is rooted

* GingerBread

- successed.

- Download
-- http://forum.xda-developers.com/attachment.php?attachmentid=578771&d=1303829207



* Visionary+

- Exception is occured.

Android adb command

* Install

- C:\Android\android-sdk\platform-tools>adb.exe install C:\Users\taku\Downloads\com.modaco.visionaryplus.r14.apk


Android debug of HTC Desired HD

* Android USB Driver


- C:\Android\android-sdk\SDK Manager.exe

-- Available packages > Third party Add-ons > Google Inc > Google Usb Driver package

--- clear the check box for "Display updates only"

-- Install C:\Android\android-sdk\extras\google\usb_driver

-- Edit C:\Android\android-sdk\extras\google\usb_driver\android_winusb.inf

[Google.NTx86]
; HTC Desire HD
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0CA2
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0CA2&MI_01

* HTC setting

- Setting > Application > Development > USB Debug : ON

2011/07/17

Handling android APK programatically

* Install / Uninsatll APK programatically
- Point is "AndroidManifest.xml"
-- keyword :
--- intent-filter, mimetype
---- data android:mimeType="application/vnd.android.packaga-archive"



- Package Manager Reference :
http://developer.android.com/reference/android/content/pm/PackageManager.html

- Android
-- /data/app/*.apk
-- /data/data/javapackage

- Eclipse
-- {project}/bin/foo.apk

2011/07/15

Memory tickler of linux

* DNS

- /etc/resolv.conf

- don't need to reboot

eclipse plugin (sample view)

* First Sample Plugin

1. Eclipse Menu > File > New > Plug-in Project
- Plug-in Project
-- Project Name : foo.foo.foo
-- Next

- Context
-- ID
-- Vesion **
-- Name
-- Next

- Templates
-- Select "Plug-in with an editor"
-- Next

- Main View Settings
-- View Class Name

2. Affirm
- view src
-- Activator.java
-- SampleView.java

- view MANIFEST.MF


3. Building a Product

- Project Property > Export > Plug-in Development > Deployable plug-ins and fragments
-- Destination
--- Check Archive file : ****
-- Options
--- Check Export source : include source in exported plug-ins
--- Save as Ant Script : ****

-- Finish

4. Installing and Running the above Product

-4.1 Shutdown eclipse

-4.2 cp file.jar in zip to C:\application\eclipse\*\plugins

-4.3 Restart eclipse


5. Show Sample View

- Eclipse Menu > Window > Show View > Others > Sample Category > Sample View



* Reference

- eclipse plug-ins Third Edition


2011/07/11

Network settings of Win7

* Ping

- Control Panel > System & Security > Windows Firewall > Detail Setting > ICMP ***
-- Activation

* LPR

- Control Panel > プログラムのアンインストール > Windowsの機能の有効化と無効化 > 印刷とドキュメントサービス

* Firewall

- Control Panel > セキュリティが強化されたWindows Firewall

2011/07/06

Coding Theory

There are essentially two aspect to Coding theory.

1. Data compression (or source coding)

2. Error correction (channel coding)

reference : wikipedia

2011/07/02

Inception

I like settings about dream in this movie :)

They have hierarchical framework and creative aspect.



Who is Cletis Tout ? (2002)

If you love a good old movie, you love it.
I love this movie :)