約 3,965,406 件
https://w.atwiki.jp/tsumurak/pages/12.html
大見出し java関連をまとめたページです!
https://w.atwiki.jp/ce00582/pages/3786.html
import javax.sound.sampled.*; public class game0714 { public static void main(String[] args) throws LineUnavailableException { int rate = 44100; AudioFormat audio_format = new AudioFormat(rate, 8, 1, true, true); DataLine.Info info = new DataLine.Info( SourceDataLine.class, audio_format); SourceDataLine line = (SourceDataLine)AudioSystem.getLine(info); line.open(); line.start(); byte[] b = new byte[rate]; int i,t; t=0; for (i= 0;i rate; i++) { if(t 100)b[i]=100; if(t 99)b[i]=-100; t=t+1; if(t 200)t=0; } line.write(b,0,rate); line.drain(); // 終了まで待機 } }
https://w.atwiki.jp/listbox/pages/21.html
●が100超なら◆に「正解」と出す。 50超なら◆に「惜しい」と出す。 それ以外なら「判定不可能」と出す。 ◆は英字に変えること(●´ω`●) スクリプトの途中で空行入れてもOK コメントは行頭に//で。 ━─━─━─━─━─━━─━─━─━─━─━ SCRIPT LANGUAGE= JavaScript function calc() { with(document.★) { if(●.value = 100) ◆.value = 正解 ; else if(●.value = 50) ◆.value = 惜しい ; else { ◆.value = 判定不可能 ; alert( 正しい数値を入力してください。 ); } } } /SCRIPT ━─━─━─━─━─━━─━─━─━─━─━ FORM NAME= ★ 正の数値を入力してください: INPUT TYPE= TEXT NAME= ● SIZE= 10 INPUT TYPE= button VALUE= 判定 onClick= calc() BR 判定結果: INPUT TYPE= TEXT NAME= ◆ SIZE= 20 /FORM ━─━─━─━─━─━━─━─━─━─━─━ a b 小なり a b 大なり a == b 等しい a != b 等しくない a = b 以下 a = b 以上 a === b 等しく型も同じ a !== b 等しくないか型が違う a == 1 b == 2 かつ a == 1 || b == 2 または !(a == b) 違う Math.floor() ... 切り捨て Math.ceil() ..... 切り上げ Math.round() .. 四捨五入 10円未満四捨五入なんてケースは/10)*10で。 value= デフォルト文字 onblur= if (this.value == ) this.value = デフォルト文字 ; onfocus= if (this.value == デフォルト文字 ) this.value = ; をくっつけるだけで、フォーカスすると文字が消える
https://w.atwiki.jp/ce00582/pages/1146.html
class tax{ public static void main(String args[]){ double th[]= new double[101]; double c[]= new double[101]; double y[]= new double[101]; int opc[]= new int[101]; int opy[]= new int[101]; int opq[]= new int[101]; double u[][][]=new double[101][3][3]; double ww[][][]=new double[100][3][3]; double v[][][][]=new double[100][3][3][21]; int gotoc[][][][]=new int[100][3][3][21]; int gotoy[][][][]=new int[100][3][3][21]; int gotoq[][][][]=new int[100][3][3][21]; double endv[][]=new double[3][3]; int endc[][]=new int[3][3]; int endy[][]=new int[3][3]; int endq[][]=new int[3][3]; int s; double tl; double tr; double ls; double w; double cs; double ys; double b1; double b2; double tr1; double tr2; double tr3; double wel; double maxwel; double maxtl; double maxtr; int t; int n; int n1; int n2; int pp; int q; int j; double c1; double l1; double h; double u1; int ns1; int ns2; int qx; int nx1; int nx2; double vs; double v1; double maxv; double dc; double dy; int e; double data1[]=new double[101]; double data2[]=new double[201]; data1=ex1(); data2=ex2(); for (s=1;s 101;s++){ c[s]=data2[s]; y[s]=data2[s+100]; } for (s=1;s 101;s++){ th[s]=data1[s]; } h=0.001; t=0; while(t 1000){ for (s=1;s 101;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ c1=c[s]+n1*h; l1=(y[s]+n2*h)/th[s]; u1=ux(c1,l1); u[s][n1+1][n2+1]=u1; } } } for (s=1;s 100;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ c1=c[s]+n1*h; l1=(y[s]+n2*h)/th[s+1]; u1=ux(c1,l1); ww[s][n1+1][n2+1]=u1; } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ for (q=-10;q 11;q++){ v[1][n1+1][n2+1][q+10]=-999; } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ q=n2-n1; v[1][n1+1][n2+1][q+10]=u[1][n1+1][n2+1]; } } for (s=2;s 100;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ for (q=-10;q 11;q++){ u1=u[s][n1+1][n2+1]; qx=q-n1+n2; pp=0; if (qx 10)pp=100; if (qx -10)pp=100; if (pp 50)qx=0; vs=-999; ns1=0; ns2=0; for (nx1=-1;nx1 2;nx1++){ for (nx2=-1;nx2 2;nx2++){ v1=u1+v[s-1][nx1+1][nx2+1][qx+10]; if (ww[s-1][nx1+1][nx2+1] u1)v1=-999; if (v1 vs)ns1=nx1; if (v1 vs)ns2=nx2; if (v1 vs)vs=v1; } } if (pp 50)vs=-999; gotoc[s][n1+1][n2+1][q+10]=ns1; gotoy[s][n1+1][n2+1][q+10]=ns2; gotoq[s][n1+1][n2+1][q+10]=qx; v[s][n1+1][n2+1][q+10]=vs; } } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ u1=u[100][n1+1][n2+1]; qx=n2-n1; vs=-999; ns1=0; ns2=0; for (nx1=-1;nx1 2;nx1++){ for (nx2=-1;nx2 2;nx2++){ v1=u1+v[99][nx1+1][nx2+1][qx+10]; if (ww[99][nx1+1][nx2+1] u1){ v1=-999; } if (v1 vs){ ns1=nx1; } if (v1 vs){ ns2=nx2; } if (v1 vs){ vs=v1; } } } endc[n1+1][n2+1]=ns1; endy[n1+1][n2+1]=ns2; endq[n1+1][n2+1]=qx; endv[n1+1][n2+1]=vs; } } maxv=-999; ns1=0; ns2=0; for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ if (endv[n1+1][n2+1] maxv){ ns1=n1; } if (endv[n1+1][n2+1] maxv){ ns2=n2; } if (endv[n1+1][n2+1] maxv){ maxv=endv[n1+1][n2+1]; } } } opc[100]=ns1; opy[100]=ns2; opc[99]=endc[opc[100]+1][opy[100]+1]; opy[99]=endy[opc[100]+1][opy[100]+1]; opq[99]=endq[opc[100]+1][opy[100]+1]; for (j=1;j 99;j++){ s=99-j; opc[s]=gotoc[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; opy[s]=gotoy[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; opq[s]=gotoq[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; } e=0; for (s=1;s 101;s++){ e=e+opc[s]*opc[s]+opy[s]*opy[s]; } for (s=1;s 101;s++){ c[s]=c[s]+opc[s]*h; y[s]=y[s]+opy[s]*h; } System.out.println(e); if (e 2){ h=h/2; } if (h 0.00001){ t=10000; } t=t+1; } for (s=1;s 100;s++){ dy=y[s+1]-y[s]; dc=c[s+1]-c[s]; if (dy 0)System.out.println(1-dc/dy); } } static double[] ex2(){ double th[]= new double[101]; int s; double tl; double tr; double ls; double w; double cs; double ys; double b1; double b2; double tr1; double tr2; double tr3; double wel; double maxwel; double maxtl; double maxtr; int t; int n; double h; double c[]= new double[101]; double y[]= new double[101]; double data1[]=new double[101]; double data[]=new double[201]; int n1; int n2; data1=ex1(); for (s=1;s 101;s++){ th[s]=data1[s]; } maxwel=-999; maxtr=0; maxtl=0; for (n=20;n 45;n++){ tl=0.01*n; tr1=0.01; tr2=0.02; tr=tr1; b1=bud(tl,tr1,th); t=0; while (t 100) { b2=bud(tl,tr2,th); tr3=tr2-b2*(tr2-tr1)/(b2-b1); tr1=tr2; tr2=tr3; b1=b2; if (b2*b2 0.00001)t=1000; t=t+1; } tr=tr2; wel=seekwel(tl,tr,th); if (wel maxwel)maxtl=tl; if (wel maxwel)maxtr=tr; if (wel maxwel)maxwel=wel; } tl=maxtl; tr=maxtr; for (s=1;s 101;s++){ w=(1-tl)*th[s]; ls=(w-tr)/(2*w); if (ls 0)ls=0; c[s]=w*ls+tr; y[s]=th[s]*ls; } for (s=1;s 101;s++){ data[s]=c[s]; data[s+100]=y[s]; } return data; } static double ux(double c1,double l1){ double u1; double c3; double l3; int pp; pp=0; c3=c1; l3=l1; if (c3 0)pp=100; if (l3 0)pp=100; if (l3 1)pp=100; if (pp 50)c3=0.5; if (pp 50)l3=0.5; u1=Math.log(c3)+Math.log(1-l3); if (pp 50)u1=-999; return u1; } static double bud(double tl,double tr,double th[]){ double bx; int s; double w; double y1; double c1; double l1; bx=0; for (s=1;s 101;s++){ w=(1-tl)*th[s]; l1=(w-tr)/(2*w); if (l1 0)l1=0; y1=th[s]*l1; c1=w*l1+tr; bx=bx+y1-c1; } return bx; } static double seekwel(double tl,double tr,double th[]){ double sw; int s; double w; double l1; double c1; sw=0; for (s=1;s 101;s++){ w=(1-tl)*th[s]; l1=(w-tr)/(2*w); if (l1 0)l1=0; c1=w*l1+tr; sw=sw+ux(c1,l1); } return sw; } static double[] ex1(){ double p; double mu; double sig; double yy; double th[]= new double[101]; int s; mu=0; sig=0.39; for (s=1;s 101;s++){ p=0.01*s-0.005; yy=seeky(p,mu,sig); th[s]=Math.exp(yy); } return th; } static double f(double x,double mu,double sig){ double pi,x1,x2,x3,fx; pi = 3.1415; x1=-Math.pow(x - mu,2) / (2*Math.pow(sig,2)); x2=Math.exp(x1); x3=sig*Math.pow(2*pi,0.5); fx=x2/x3; return fx; } static double g(double y,double mu, double sig){ double gx,h,x; int n,t; gx=0; h=0.001; t=(int)(y/h); for (n=-2000;n t;n++){ x=n*h; gx=gx+f(x,mu,sig)*h; } return gx; } static double seeky(double p,double mu,double sig){ double g1,g2,y1,y2,y3; int t; y1=0.4; y2=-0.2; g1=g(y1,mu,sig); t=0; while(t 100){ g2=g(y2,mu,sig); y3=y2+(p-g2)*(y2-y1)/(g2-g1); y1=y2; y2=y3; g1=g2; if (Math.pow(p-g2,2) 0.0001)t=1000; t=t+1; } return y2; } }
https://w.atwiki.jp/robobaka/pages/15.html
JAVAの基礎 1.アプリケーションとアプレットの違い 2.バイトコードとは何か? 3.アプリケーション内で最初に実行されるメソッドは何か? 4.JAVAの8つの基本データ型は? 5.型変換とは何か? 6.配列を作成するための手順は? 7.JAVAの3種類のコメントとは何か? 8.“CLASS”はキーワードか?
https://w.atwiki.jp/jainastudies/pages/30.html
ここでは、これまでに積み重ねられてきた研究の中から、『アーヴァッサヤ』についての研究情報を、紹介します。 ★アーヴァッサヤについては、諸注釈文献に関する研究も合わせて此処で紹介することとします。 2008-06-18 23 47 07 (Wed) Willem B. Bollee, Subject Index of the Inventory of the Stories in N.Balbir s AAva;syaka Studien. in International Journal of Jaina Studies 3-1 (2007), pp.1-23. →タイトル通り、N.Balbir の AAva;syaka Studien に対する subject index です。最近の Bollee 教授は各種テキストの subject index 作成に力を注いでおりますが、こういった面倒で地味な仕事は正直あまり誰もやる者がいないわけで、貴重な資料の提供に感謝すべきでしょう。 H.C.Bhayani, Notes on Some Words in Oherlies[sic] `AAva;syaka-Studien Glassar[sic] . in M.A.Dhaky J.B.Shah (eds.), Jambuu-jyoti (Munivara Jambuuvijaya Festschrift), Ahmedabad, n.d., pp.179-182.
https://w.atwiki.jp/ce00582/pages/3529.html
import javax.media.j3d.*; import javax.vecmath.*; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.geometry.*; import java.awt.*; import java.awt.event.*; import java.util.*; class game0320 extends Frame implements Runnable{ SimpleUniverse universe; BranchGroup group1,group2; TransformGroup transform_group1; Transform3D transform1; float x,y,z; float cx,cy,cz; float lx,ly,lz; public static void main(String [] args) { Frame f=new game0320(); f.setTitle("game0320"); f.setSize(700,700); f.setBackground(Color.yellow); f.setVisible(true); } game0320(){ x=0.0f; y=0.0f; z=0.0f; cx=1.4f; cy=1.4f; cz=2.0f; lx=0.2f; ly=-0.2f; lz=-0.8f; space3d(); cube3d(x,y,z); camera3d(cx,cy,cz); light3d(lx,ly,lz); this.setVisible(true); Thread th=new Thread(this); th.start(); addWindowListener(new stopwin()); } class stopwin extends WindowAdapter{ public void windowClosing(WindowEvent we){System.exit(0);} } public void run(){ int t; t=0; while(t 100){ x=x+0.01f; y=y+0.01f; z=z+0.00f; cube3d(x,y,z); try{ Thread.sleep(100); }catch(InterruptedException e){} t=t+1; } } void space3d(){ Panel cp = new Panel(); cp.setLayout(null); this.add(cp); GraphicsConfiguration g_config = SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(g_config); canvas.setBounds(0,0,700,700); cp.add(canvas); universe = new SimpleUniverse(canvas); } void cube3d(float x,float y,float z){ group1 = new BranchGroup(); ColorCube cube = new ColorCube(0.3f); transform_group1 = new TransformGroup(); transform_group1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); transform_group1.addChild(cube); transform1 = new Transform3D(); group1.addChild(transform_group1); universe.addBranchGraph(group1); transform1.set(new Vector3d(x,y,z)); transform_group1.setTransform(transform1); } void camera3d(float cx,float cy,float cz){ ViewingPlatform vp = universe.getViewingPlatform(); TransformGroup Camera = vp.getViewPlatformTransform(); Transform3D view_pos = new Transform3D(); Vector3f pos_vec = new Vector3f(cx,cy,cz); view_pos.setTranslation(pos_vec); Transform3D view_dir = new Transform3D(); Transform3D view_dir2 = new Transform3D(); view_dir.rotY(Math.PI/4); view_dir2.rotX(-Math.PI/4 + 0.1f); view_dir.mul(view_dir2); view_pos.mul(view_dir); Camera.setTransform(view_pos); } void light3d(float lx,float ly,float lz){ Color3f light_color = new Color3f(1.7f,1.7f,1.7f); Vector3f light_direction = new Vector3f(lx,ly,lz); DirectionalLight light = new DirectionalLight(light_color,light_direction); BoundingSphere bounds = new BoundingSphere(); light.setInfluencingBounds(bounds); BranchGroup group2 = new BranchGroup(); group2.addChild(light); universe.addBranchGraph(group2); } }
https://w.atwiki.jp/m_shige1979/pages/1013.html
記述サンプル body タグ内に記述 hoge1.html !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http //www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=UTF-8" / title テストサイト /title /head body script type="text/javascript" !-- document.write("Hello World"); // -- /script /body head タグ内に記述 hoge2.html !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http //www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=UTF-8" / title テストサイト /title script type="text/javascript" !-- document.write("Hello World2"); // -- /script /head body /body head タグ内の外部ファイルを定義 hoge3.html !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http //www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=UTF-8" / title テストサイト /title script type="text/javascript" src="./js_test3.js" /script /head body /body js_test3.js document.write("Hello World3");
https://w.atwiki.jp/ebi_xyz/pages/41.html
javascriptでcookieを読み書きする場合について cookieの操作はdocument.cookie変数に対して行う。 読み込む際は、「var str = document.cookie;」と行えばstrにcookieの中身が全て格納される。 cookieは"名前=値; 名前=値; 名前=値; ..."という形式で入っているので、文字列を分割して必要な値のみを使用する。 書き込む際は、「document.cookie = "cookie名=値; expires=賞味期限";」と行えば書き込まれる。 複数のcookieを書き込む際は、それぞれをdocument.cookieに対して格納する。 「document.cookie = "cookie名=値; cookie名=値; expires=賞味期限"というような記載はNG。 sample code html head meta http-equiv="content-type" content="text/html; charset=Shift_JIS" title JavaScriptCookie /title script language="javascript" !-- var ckary = new Array(); var delimiter = "%00"; function setck() { ckary[0] = document.forms[0].usr.value; ckary[1] = document.forms[0].eml.value; ckary[2] = document.forms[0].url.value; //alert ( ◎フォームの内容\n +ckary[0]+ +ckary[1]+ +ckary[2]); var saveDay = 365; var exp = createRimit(saveDay); var ckstr = escape(ckary[0]); var i = 1; while (ckary[i]){ ckstr += delimiter + escape(ckary[i]); i++; } //alert ( ◎ESCAPEされた文字列 +ckstr); document.cookie = "TEST=" + ckstr + "; expires=" + exp.toGMTString(); // TESTの他にTEST2も用意するなら以下のように記載。 //document.cookie = "TEST2=" + ckstr + "; expires=" + exp.toGMTString(); } function createRimit(pSd) { var exp = new Date(); exp.setTime(exp.getTime()+1000*60*60*24*pSd); return exp; } function getck() { //alert ( ◎cookie文字列全体\n +document.cookie); ckary= document.cookie.split("; "); var ckstr= ""; var cktarget= "TEST="; var cklen= cktarget.length; var i = 0; while (ckary[i]){ if (ckary[i].substr(0,cklen) == cktarget){ ckstr = ckary[i].substr(cklen, ckary[i].length); break; } i++; } //alert ( ◎抽出された文字列\n +ckary[i]); ckary = ckstr.split(delimiter); if (ckary[0]) document.forms[0].usr.value = unescape(ckary[0]); if (ckary[1]) document.forms[0].eml.value = unescape(ckary[1]); if (ckary[2]) document.forms[0].url.value = unescape(ckary[2]); } function reset() { document.forms[0].usr.value = ""; document.forms[0].eml.value = ""; document.forms[0].url.value = ""; } // -- /script /head body onload="getck()" bgcolor="#ffffff" form input value="test" name="usr" size="40" type="text" br input name="eml" size="40" type="text" br input name="url" size="40" type="text" br input value="記録" onclick="setck()" type="button" input value="呼び出し" onclick="getck()" type="button" input value="リセット" onclick="reset()" type="button" /form /body /html 2011-01-02
https://w.atwiki.jp/ayikat/pages/83.html
Sample1 form name="frm" action="" method="post" input type="checkbox" value="1" onclick="if(document.frm.c.disabled==true){document.frm.c.disabled=false;}else{document.frm.c.disabled=true;}" input type="button" name="c" value="check1" onclick="alert( aaaa );" disabled /form function change_pulldown(){ pulldown_option = document.getElementById("hoge").getElementsByTagName( option ); for(i=0; i pulldown_option.length;i++){ if(pulldown_option[i].value == "クラブマンハイレッグ"){ pulldown_option[i].selected = true; break; } } } select id="hoge" option value="イングラム" イングラム /option option value="グリフォン" グリフォン /option option value="タイラント2000" タイラント2000 /option option value="クラブマンハイレッグ" クラブマンハイレッグ /option /select head script language="javascript" function onPriviousPage() { var a = document.getElementById("idName").innerHTML; a = document.forms[0].abc.value; a = document.bbb.abc.value; location.href=a; } /script /head body form name="bbb" input type="button" value="PriviousPage" onclick="onPriviousPage()" br p %= aid % /p % if(aid.equals("1")){ % p id="idName" sample.html /p input type="hidden" name="abc" value="sample.html"/ % } else { % p id="idName" sample3.html /p input type="hidden" name="abc" value="sample3.html"/ % }% /body