hirax.net::inside out::2009年10月

最新記事(inside out)へ  |   年と月を指定して記事を読む(クリック!)

2009年9月 を読む << 2009年10月 を読む >> 2009年11月 を読む

2009-10-01[n年前へ]

IronRuby+Mathematica Playerでグラフィック表示(試行錯誤中) 


 IronRubyMathematica Player
@kernel.Compute(@inputBox.Text) 
if @kernel.Graphics.Length>0
  @pictureBox.image=@kernel.Graphics.first 
end
Mathematica PlayerMathematica Player"Compute"

 
@pictureBox.image=
  kernelLink.EvaluateToImage(
    @inputBox.text,500,500)
MathematicaMathematicaMathematica Player

 
loop=
  MathLinkFactory.CreateLoopbackLink()
loop.PutFunction("ListPlot", 1)
loop.PutFunction("List", 2)
loop.Put(4)
loop.Put(0)
loop.EndPacket()
e=loop.GetExpr()
loop.Close()
@pictureBox.image=
  kernelLink.EvaluateToImage(e,500,500)
 ExprMathematica Mathematica

 
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
result=kernelLink.EvaluateToOutputForm(
  "g=Plot[SIn[x],{x,0,5}]", 0)
result=kernelLink.EvaluateToOutputForm(
   'Export["test.gif"g]',0)
puts result
kernelLink.close
 
=Export

 使

2009-10-02[n年前へ]

IronRubyとMathematica Playerの良い組み合わせ方を考える 


 .NETRubyIronRuby使Mathematica PlayerRuby使EvaluateToInputForm使EvaluateToOutputForm 使便

 4 x+3==0 1
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
result=kernelLink.EvaluateToInputForm(
            "Solve[4 x+3==0,x]", 0)
puts result
kernelLink.close
{{x -> -3/4}}
MathematicaRuby(x-3/4)使

  EvaluateToInputForm EvaluateToOutputForm 
         3
{{x -> -(-)}}
         4
Ruby使便MathematicaOutputForm

 Mathematica  IronRuby ATOKAmetMulti使ATOK for Windows 使

2009-10-03[n年前へ]

「IronRuby」+「Mathematica Player」=「∞の可能性」 


 (.NETRuby)IronRuby()Mathematica Player使Mathematica便Ruby便.NET

 Mathematica使IronRuby+Mathematica Player
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
result=kernelLink.EvaluateToOutputForm(
  'datarecords = {
{"Joe", "Smith", 158, 64.4}, 
{"Mary", "Davis", 137, 64.4}, 
{"Bob", "Lewis", 141, 62.8}, 
{"John", "Thompson", 235, 71.1},
{"Lewis", "Black", 225, 71.4}, 
{"Sally", "Jones", 168, 62.},
{"Tom", "Smith", 243, 70.9}, 
{"Jane", "Doe", 225, 71.4}};', 0)
result=kernelLink.EvaluateToOutputForm(
  'FindClusters[Drop[datarecords, None,
   {1, 2}] -> datarecords]', 0)
puts result
kernelLink.close

{{{Joe, Smith, 158, 64.4}, {Mary,Davis, 137, 64.4}, {Bob, Lewis, 141, 62.8},{Sally, Jones, 168, 62.}}, {{John,Thompson, 235, 71.1}, {Lewis, Black, 225, 71.4}, {Tom, Smith, 243,70.9}, {Jane, Doe, 225, 71.4}}}
MathematicaRubyRuby使便

 
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
result=kernelLink.EvaluateToOutputForm(
  'FindShortestTour[
{{4, 3}, {1, 1}, {2, 3}, {3, -5}, 
  {-1, 2}, {3, 4}}]', 0)
puts result
kernelLink.close
{11 + Sqrt[2] + Sqrt[5] + 3 Sqrt[10],
 {1, 3, 5, 2, 4, 6}}


 IronRubyMathematica PlayerIronRuby+Mathematica Player使

2009-10-04[n年前へ]

IronRubyとMathematica Playerで経済データも自由自在 


 (.NETRuby)IronRuby()Mathematica Player

 MathematicaCountryData使40GDP()
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=
  MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
gdp=kernelLink.EvaluateToInputForm(
  'CountryData["Japan", {{"GDP"}, {1970, 2008}}]', 0)
puts gdp
kernelLink.close
1970
2008(GDP)
{{{1970, 1, 1, 0, 0, 0}, 2.0295777757538376*^11}, {{1971, 1, 1, 0, 0, 0}, 2.2925 011052164844*^11}, {{1972, 1, 1, 0, 0, 0}, 3.0359415844215283*^11}, {{1973, 1, 1 , 0, 0, 0}, 4.124671054658262*^11}, {{1974, 1, 1, 0, 0, 0}, 4.578535174149201*^1 1}, {{1975, 1, 1, 0, 0, 0}, 4.978680032023408*^11}, {{1976, 1, 1, 0, 0, 0}, 5.59 553536053367*^11}, {{1977, 1, 1, 0, 0, 0}, 6.886633644946532*^11}, {{1978, 1, 1,  0, 0, 0}, 9.675983051549285*^11}, {{1979, 1, 1, 0, 0, 0}, 1.0071187368835983*^1 2}, {{1980, 1, 1, 0, 0, 0}, 1.0552047308073224*^12}, {{1981, 1, 1, 0, 0, 0}, 1.1 662277105414326*^12}, {{1982, 1, 1, 0, 0, 0}, 1.0838309489751625*^12}, {{1983, 1 , 1, 0, 0, 0}, 1.182236662061611*^12}, {{1984, 1, 1, 0, 0, 0}, 1.258002926042118 4*^12}, {{1985, 1, 1, 0, 0, 0}, 1.3467326711952527*^12}, {{1986, 1, 1, 0, 0, 0},  1.9954327828900427*^12}, {{1987, 1, 1, 0, 0, 0}, 2.4200293838043384*^12}, {{198 8, 1, 1, 0, 0, 0}, 2.9383777035023525*^12}, {{1989, 1, 1, 0, 0, 0}, 2.9401349260 95067*^12}, {{1990, 1, 1, 0, 0, 0}, 3.018112125973376*^12}, {{1991, 1, 1, 0, 0, 0}, 3.4512768484608447*^12}, {{1992, 1, 1, 0, 0, 0}, 3.766884938703116*^12}, {{1 993, 1, 1, 0, 0, 0}, 4.3237911294441895*^12}, {{1994, 1, 1, 0, 0, 0}, 4.76016480 3785754*^12}, {{1995, 1, 1, 0, 0, 0}, 5.24425055236488*^12}, {{1996, 1, 1, 0, 0,  0}, 4.620457424448448*^12}, {{1997, 1, 1, 0, 0, 0}, 4.2337825304782827*^12}, {{ 1998, 1, 1, 0, 0, 0}, 3.8422661071666924*^12}, {{1999, 1, 1, 0, 0, 0}, 4.3476506 956717817*^12}, {{2000, 1, 1, 0, 0, 0}, 4.649614280538379*^12}, {{2001, 1, 1, 0,  0, 0}, 4.0877256836277627*^12}, {{2002, 1, 1, 0, 0, 0}, 3.904822831192468*^12},  {{2003, 1, 1, 0, 0, 0}, 4.231254569386364*^12}, {{2004, 1, 1, 0, 0, 0}, 4.58488 9737074735*^12}, {{2005, 1, 1, 0, 0, 0}, 4.559019715540946*^12}, {{2006, 1, 1, 0 , 0, 0}, 4.434993203595208*^12}}
 

 GDPGDPIronRuby+Mathematica Player

 Mathematica便Mathematica Player使Mathematica使(.NETRuby)IronRuby()Mathematica Player

 

 使 Mathematica Player便Mathematica使

 RubyMathematican使使

2009-10-05[n年前へ]

無料の「ネット記事」を読むなら、無料の「GRAPHICATION」も読みませんか? 


 GRAPHICATIONGRAPHICATIONGRAPHICATION
 

GRAPHICATION 20099164 ()


 GRAPHICATION使

 GRAPHICATION
 GRAPHICATION


 Graphication

 GRAPHICATION

 2,3

 GRAPHICATION

 

 GRAPHICATION
 196019701960

 1970




 GRAPHICATION

 GRAPHICATIONGRAPHICATION GRAPHICATION

2009-10-06[n年前へ]

無料配布MathematicaカーネルとNET Framework実装IronRubyでグリッド・Matheatica計算環境は5分で作れる 


 Mathematica使.NET FrameworkRubyIronRuby使

 MathematicagridMathematicaMathematicaMathematica(10cm

 Mathematica使.NET FrameworkRubyIronRuby使gridMathematica

 RubydRuby使(IronRuby)Ruby使Mathematica

 ()Mathematica
class Mathematica
  require 'Wolfram.NETLink'
  include Wolfram::NETLink
  def initialize()    
  end
  def open
     @kernelLink=MathLinkFactory.CreateKernelLink()
     @kernelLink.WaitAndDiscardAnswer()
  end
 def do(command)
     @kernelLink.EvaluateToInputForm(command, 0)
  end
  def close
    @kernelLink.EvaluateToInputForm('MVClose[]', 0)
  end
end

require 'webrick'
include WEBrick
m=Mathematica.new
m.open
s=HTTPServer.new(:Port=>ARGV[0].to_i, 
                             :DocumentRoot=>'',
                             :RequestTimeout=>600,
                             :MaxClients=>1)
s.mount_proc("/restart") {m.close;m.open}
s.mount_proc("/shutdown") {s.shutdown}
s.mount_proc("/"){|req,res|
  res.body='use /evaluate/command'
  if /evaluate\/(.+)$/=~req.path
    res.body=m.do($1) 
  end
}
trap("INT"){m.close;s.shutdown}
s.start
 
URIWEB

  mathematicaServer.rb 
ir.exe mathematicaServer.rb 80
80
WEB
ir.exe mathematicaServer.rb 81
81
WEBPCPCPC

 "Mathematica"
require 'pp'
require 'net/http'
Net::HTTP.version_1_2
result=[]
threads = []
command='2+2'
uri=['localhost','localhost']
port=[80,81]
2.times do |i|
  threads.push( 
    Thread.new do
      Net::HTTP.start(uri[i],port[i]){ |http| 
        r=http.get('/evaluate/'+command);
                        result<<r.body;} 
    end
  )
end
threads.each do |t|  t.join end
pp result
 mathemat
icaController.rb
ir.exe mathematicaController.rb
IronRuby
ruby mathematicaController.rb
WEBRuby

 PC2Mathematica使"2+2"
["4","4"]
http使GET

 Mathematica使Mathematica使.NET FrameworkRubyIronRuby使!?

 MathematicaNET FrameworkIronRubyMatheatica5

 Mathematica

2009-10-07[n年前へ]

「細切れの知識」や「あるあるネタ」と「腹持ちのする豊かな知恵」の違い 


 GRAPHICATION 

 GRAPHICATION

 GRAPHICATION

 

 GRAPHICATION

 GRAPHICATION GRAPHICATION

2009-10-08[n年前へ]

使えそうだけれど役に立ちそうにないモノは捨てる…!? 


 使使使

 20使

 PIC使




 

 使

 使

使えそうで・だけど役に立ちそうにないモノは捨てる…!?使えそうで・だけど役に立ちそうにないモノは捨てる…!?使えそうで・だけど役に立ちそうにないモノは捨てる…!?






2009-10-09[n年前へ]

無料配布のMathematica PlayerとIronRubyで天文学計算をしてみよう 


 Mathematica使.NET FrameworkRubyIronRuby使

 Mathematica使使
include System
require 'Wolfram.NETLink'
include Wolfram::NETLink
kernelLink=MathLinkFactory.CreateKernelLink()
kernelLink.WaitAndDiscardAnswer()
com='$GeoLocation={35.658587,139.745425};'
com+='AstronomicalData["Sun","NextRiseTime"]'
result=kernelLink.EvaluateToInputForm(
  com, 0)
puts result
kernelLink.close
 使Mathematic
a
$GeoLocation={35.658587,139.745425};
AstronomicalData["Sun","NextRiseTime"]
{2009, 10, 13, 5, 46, 0.9059999999990396}
20091013
5460.9"Sun""Moon"

 WEB API

2009-10-10[n年前へ]

楽しい?辛い?日本横断日帰りツーリング 


  

  

 012辿

 GIANT ESCAPE R3

 

GIANT ESCAPE R3






2009-10-11[n年前へ]

「金星」や「木星」と「金木犀」 


 

 

 

 

2009-10-12[n年前へ]

引数付きのMathLinkFactory.CreateKernelLinkの書き方 


 Mathematica使.NET FrameworkRubyIronRuby使"MathLinkFactory.CreateKernelLink() "使"MathKernel.exe"

 MathLinkFactoryMathematicaMathematica(稿mathkernel.exeMathKernel.exe)
require 'pp'

class Mathematica
require 'Wolfram.NETLink'
include Wolfram::NETLink

def initialize
   @kernelLink=MathLinkFactory.CreateKernelLink(
    "-linkmode launch -linkname 
    'C:\\Program Files\\Wolfram Research\\
     Mathematica Player\\7.0
    \\MathKernel.exe'")
   @kernelLink.WaitAndDiscardAnswer()
 end

 def do(command)
   @kernelLink.EvaluateToInputForm(command, 0)
 end

 def close
   @kernelLink.EvaluateToInputForm(
       'MVClose[]', 0)
 end

end

m=Mathematica.new
pp m.do('Table[i,{i,1,10}]')
m.close
 CreateKernel
Mathematica Player便

2009-10-13[n年前へ]

MathematicaとMathematica Playerの描画関数の違いを調べてみる 


 使Mathematica Player調

 Mathematica PlayerMathematicaKernel.exe

 Mathematica PlayerMathematicaMathematicaMathematica Player

 Mathematica Player使.nbpMathematica

 Wolfram()Mathematica.nbp.nbpGraphic22Raterize(Line)Plot使

 PlotMathematica(Mathematica Player)

 PlotMathematica使PlotMathematica PlayermathematicaKernel.exeMathematica使使使

 Mathematica/使Mathematica Player

2009-10-14[n年前へ]

AutoHotkeyで任意の場所・タイミングでRubyやPerl等を使おう 


 使AmetMulti,AmetPerlATOKAMET使AtokAmetMuti使





 ATOK使ATOKAMET使

 Windows()AutoHotKey使AutoHotKeyAutoHotkeyAutoHotkey使

 AutoHotKey使"rby"Ruby

 AutoHotKeyAutoHotKeyAutoHotkey.ahkRubyRubyPerl

 AutoHotkey.ahk
::rby::
a=ruby -e '
c='
d=%a%%clipboard%%c%
pi:=PRun(d)
PWaitExit(pi)
r:=PRead(pi)
Send,%r%
PClosehandle(pi)
return
rbyruby
-e

 AutoHotKey.ahk
puts Time.now.month
rby
10 puts Math.sin(5) rby-0.958924274663138

 
a=ruby -e '
a=perl -e '
Perl使awk

 autoHotKey使RubyPerlMathematica Player

2009-10-15[n年前へ]

「身長・体重・スリーサイズ」で「今昔アイドル」をクラスタリングしてみよう 


 Mathematica Player(.NETIron Ruby使使(BWH使MathematicaFindClustersPlayerMathematica
data = Flatten[ Import["c:\\actress.xls"], 1];
data2 = Drop[data, None, {1}];
FindClusters[data2 -> data, 10]
10

 {}
{{{,,,,,,}{, ,,,,,,}{,, ,,,,,}{,,,, ,,,,,}{,,,西 ,,,}{,,,,,}{ ,,,,,,}{, ,,,,,,,, ,}{,,,,,,, ,,,,}{,西,,, ,,,,,,,}}}
 (BWH

 (BWH

  

2009-10-16[n年前へ]

Mathematica Player用.nbpファイルに埋め込まれた画像データのナゾ 


 WolframWolfram使MathematicaMathematica Player使Mathematica.nbWolfram.nbp

 nbp調

 

 Wolfram Mathematica Player.nbp使Wolfram Mathematica Player

 .nbp使 

Mathematica Player用.nbpファイルに埋め込まれた画像データのナゾMathematica Player用.nbpファイルに埋め込まれた画像データのナゾ






2009-10-17[n年前へ]

エクセルからMathematica(無料Player)の計算機能を使う 


 Microsoft ExcelMathematica使(Excel)Mathematica(使Mathematica Player)MathematicaKernel.exe使

 ExcelMathematica使MathematicaNET FrameworkIronRubyMatheatica5URIWEB(Excel)WEBExcel VBA WEB2007/2003 使

 MathematicaNET FrameworkIronRubyMatheatica5
ir.exe mathematicaServer.rb 80
http
80WEB

 2003WEB2007-WEBURL"http://localhost/evaluate/2+2""2+2" Mathematicahttp

 VBA使
Sub httpGet()
 Range("E3").Select
 With Selection.QueryTable
  .Connection = "URL;http://localhost/evaluate/2+2"
   .WebSelectionType = xlEntirePage
   .WebFormatting = xlWebFormattingNone
   .WebPreFormattedTextToColumns = True
   .WebConsecutiveDelimitersAsOne = True
   .WebSingleBlockTextImport = False
   .WebDisableDateRecognition = False
   .WebDisableRedirections = False
   .Refresh BackgroundQuery:=False
 End With
End Sub


 使Mathematica使Mathematica(使Mathematica Player)MathematicaKernel.exe便MathematicaWEB

2009-10-18[n年前へ]

「長岡京市と平家」と「伊豆長岡京市と源氏」 


 2

 

 
 89

2009-10-19[n年前へ]

「美的曲線」で「理想のバスト形状」を作り出そう 


 
 調α=-1α=1調




 SPA!調

 

 No.1

2009-10-21[n年前へ]

無料のMathematicaカーネルとIronRubyでP2Pグリッド数式処理システムを作ってみよう 


 Mathematica使.NET FrameworkRubyIronRuby使MathematicaNET FrameworkIronRubyMatheatica5 Mathematicahttp使

 URL(Iron)Ruby

 mathnode.rb
class Mathematica
  require 'Wolfram.NETLink'
  include Wolfram::NETLink
  PAR="-linkmode launch -linkname
 'C:\\Program Files\\Wolfram Research\\
Mathematica Player\\7.0\\MathKernel.exe'"
  def initialize()    
  end
  def open
    @kernelLink=MathLinkFactory.CreateKernelLink(PAR)
    @kernelLink.WaitAndDiscardAnswer()
  end
 def do(q)
     @kernelLink.EvaluateToInputForm(q, 0)
  end
  def close
    @kernelLink.EvaluateToInputForm('MVClose[]', 0)
  end
end

class Mathnode
  require 'webrick'
  include WEBrick
  require 'net/http'
  require 'uri'  
  Net::HTTP.version_1_2
  attr_reader :server
  
  def initialize()    
    @m=Mathematica.new
    @m.open
  end

  def start(port)
    @server=Thread.new do
      @s=HTTPServer.new(:Port=>port, 
                             :DocumentRoot=>'',
                             :RequestTimeout=>600,
                             :MaxClients=>1)  
      @s.mount_proc("/restart") {@m.close;@m.open}
      @s.mount_proc("/shutdown") {@s.shutdown}
      @s.mount_proc("/"){|req,res|
        res.body='use /evaluate/command'
        res.body=URI.encode(@m.do(URI.decode(req.query['q']) )) if req.query['q']
      }
      trap("INT"){@m.close;@s.shutdown}
      @s.start
    end
  end

  def stop
    @server.shutdown
  end
  
  def sendCommand(host,port,q)
    result=''
    Net::HTTP.start(host,port){ |http| 
        r=http.get('/evaluate?q='+URI.encode(q))
        result=URI.decode( r.body )
    } 
    result
  end

end
 使
require 'mathnode.rb'
mathnode=Mathnode.new
mathnode.start(ARGV[0].to_i)
mathnode.server.join
node.rb
httpTCP/IP
ir.exe node.rb 80
80http


 mathnode.rb使main.rb
require 'mathnode.rb'
mathnode=Mathnode.new
puts mathnode.sendCommand(
  'localhost',ARGV[0].to_i,
  'Solve[x+y==3,x]')
x+y==3x使
ir.exe main.rb 80
localho
st80Mathematicax+y==3x

 peer to peer 

 MathematicaNET FrameworkIronRubyMatheatica5
require 'pp'
require 'net/http'
require 'uri'

Net::HTTP.version_1_2
result=[]
threads = []
command='Solve[x+y==3,x]'
uri=['localhost']
port=[80]
2.times do |i|
  threads.push( 
    Thread.new do
      Net::HTTP.start(uri[i],port[i]){ |http| 
        r=http.get('/evaluate?q='+URI.encode(command));
        result<<URI.decode( r.body );} 
    end
  )
end
threads.each do |t|  t.join end
pp result
 
Mathematica

 使P2P使

2009-10-23[n年前へ]

2700円以下で泊まれるベスト宿はどこだ!? 


 3500宿3  CLASSICO331503500宿LAN使

 

 2,700宿()410宿宿24使

 (LAN)21

 使2600 26002700

 宿

2009-10-24[n年前へ]

「対数螺旋という美的曲線」と「美乳カーブ」 


 
 α=-1α=1 


-!?-

 
 
 

「対数螺旋という美的曲線」と「美乳カーブ」






2009-10-26[n年前へ]

「エクセル」と「無名関数」 


 Mathematica使 使使

 RubyRuby
d=[]
10.times{d<<'=2*RC[1]'}
d<<ARGV[0]
puts d.join(',')
 '=2
*RC[1]'RubyRC[1]2使
 Rubym.rb
ruby m.rb > m.csv
m.
csvcsvR1C1
512 256 128 64 32 16 8 4 2 1


 使

2009-10-28[n年前へ]

「引っ越し」と「宅急便で配達される送付物」 


 便便便便便便便便調

 GRAPHICATIONGRAPHICATION便GRAPHICATIONWEB

 GRAPHICATIONGRAPHICATION
 WEB

 便

2009-10-29[n年前へ]

「MathematicaPlayer+IronRubyでMathematica風AJAX WEBアプリ」の動作動画  


 MathematicaPlayer+IronRuby+AJAX 使使







 IronRubyMathematica.NET使

 IronRuby

2009-10-30[n年前へ]

「京都市鴨川源流」を廻る「理系風デート」 


 



 
 


 

     (  100-103)
 77

 17367

 
 

「京都市鴨川源流」を廻る「理系風デート」






2009-10-31[n年前へ]

「マンハッタン距離」と「続 理系風デート」 


 
 
<︲>西<︲>

 沿

西

使使

 
 
 

 
 
 2,31

 ////