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

OPTIONS / HTTP/1.1
User-Agent: Java/1.6.0_26
Host: 192.168.11.10
Connection: keep-alive


- Response


HTTP/1.1 200 OK
Date: Tue, 26 Jul 2011 10:39:10 GMT
Server: Apache/2.2.3 (Red Hat)
DAV: 1,2
DAV:
MS-Author-Via: DAV
Allow: OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,COPY,MOVE,LOCK,UNLOCK
Content-Length: 0
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: httpd/unix-directory

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


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

Handling File in Eclipse Plugin


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



IWorkspace ws = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = ws.getRoot();
IProject[] projects = root.getProjects();

//ws.toString:org.eclipse.core.internal.resources.Worksapce@**
//root.toString : R

IProject project = projects[0];
IFolder tmpDir = null;
IFile file = null;

if(project.exists()){
//1. Create in Project not System
tmpDir = project.getFolder((new Path("tmp")));
if(!tmpDir.exists()){
try {
//2. Create in System
tmpDir.create(false, true, null);
}catch (CoreException e) {
e.printStackTrace();
}
}
file = tmpDir.getFile(new Path("boo.txt"));
if(!file.exists()){
try{
String str = "dummy";
InputStream is = new ByteArrayInputStream(str.getBytes());
file.create(is, false, null);
}catch(CoreException e){
e.printStackTrace();
}
}
Log.logInfo(file.getLocation().toString());
}else{
Log.logInfo("project is NOT exist");
}


- 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/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


import android.util.Log;

public class FooActivity extends Activity {
public static final String LOGTAG = "[Foo] FooActivity";
Log.d(LOGTAG, "Start");
//...
}

Blogger Syntax Hightlighter : Test Java

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

Blogger Syntax Hightlighter : Test C

int main (){
printf("Hello world\n");
return 0;
}

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 :)