2015年11月2日 星期一

如何用DELPHI寫費氏數列??

費氏數列就是F(N)=F(N-1)+(N-2),F(1)=1,F(2)=1,F(3)=F(2)+F(1)=1+1=2,F(4)=F(3)+F(2)=2+1=3,F(5)=F(4)+F(3)=3+2=5以此類推.....

var
  N,i:Integer//i是多的
  T1,T2,tt:Integer//tt是暫存用的
begin
T1:=0
T2:=1//第一次計算時會需要一隻兔子
N:=10//會有10.9.8.7.6.5.4.3.2.1
while N > 0 do//N和0覺定你會有幾個數字,只有這樣所以你可以改成N=100 0=90
begin
Dec(N)//對n作累減用,當然你把>改成<時就要改成inc(N)
Memo1.Lines.Add(IntToStr(T1+T2))//AAAAAAAAAAAA
tt:=T1;//把母兔數量存起來
T1:=T2;//把子代變成母代
T2:=tt+T2//現在n的母數量//BBBBBBBBBB
//AAAAAA跟BBBBBBBB指的其時是同一筆資料所以可以改成一起如下
//Memo1.Lines.Add(IntToStr(T2))//AAAAAAAAAAAA
end;


The Fibonacci numbers form a sequence of integers, mathematically defined by

    F(0)=0; F(1)=1; F(n) = F(n - 1) + F(n - 2) for n > 1.

This results in the following sequence of numbers:

    0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, ...

This simply means that by definition the first Fibonacci number is 0, the second number is 1 and the rest of the Fibonacci numbers are calculated by adding the two previous numbers in the sequence. 

Translating that into Delphi code:

Hide   Copy Code
function Fibonacci(aNumber: Integer): Integer;

begin
  if aNumber < 0 then
    raise Exception.Create('The Fibonacci sequence is not defined for negative integers.');

  case aNumber of
  0: Result:= 0;;
  1: Result:= 1;
  else
    Result:= Fibonacci(aNumber - 1) + Fibonacci(aNumber - 2);
  end;;
end;
The function above is the recursive implementation, which in my opinion fits naturally. Now, the iterative implementation might not be as cleaner as that:

Hide   Copy Code
function Fibonacci(aNumber: Integer): Integer;

var
  I,
  N_1,
  N_2,
  N: Integer;
begin
  if aNumber < 0 then
    raise Exception.Create('The Fibonacci sequence is not defined for negative integers.');

  case aNumber of
    0: Result:= 0;
    1: Result:= 1;
  else
    begin
      N_1:= 0;
      N_2:= 1;
      for I:=2 to aNumber do
      beginn
        N:= N_1 + N_2;
        N_1:= N_2;
        N_2:= N;
      end;
      Result:= N;
    end;
  end;
end;
Finally, if you want to produce the first 21 Fibonacci numbers try this out:

Hide   Copy Code
program Project2;


{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
  I: Integer;

function Fibonacci(aNumber: Integer): Integer;
begin
  {Your implementation goes here}
end;

begin
  for I:=0 to 20 do
    Writeln(Fibonacci(I));
  Readln;
end.

2015年11月1日 星期日

如何 執行 一個 執行檔 在 虛擬機裡 Programmatically executing a program in a VMware machine

如何 執行 一個 執行檔 在 虛擬機裡 Programmatically executing a program in a VMware machine  
  

As reported in the documentation of the VMware API, the function you need is VixVM_RunProgramInGuest(), which requires you to authenticate on the guest OS (the OS running on the virtual machine) with VixVM_LoginInGuest().

// Authenticate for guest operations.   
jobHandle = VixVM_LoginInGuest(vmHandle,
  "vixuser", // userName
  "secret",  // password 
  0,         // options
  NULL,      // callbackProc
  NULL       // clientData
); 

/*
 VIX_E_PROGRAM_NOT_STARTED error code.
*/

err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);    

if (VIX_OK != err) {
  // Handle the error.
  goto abort;
}

Vix_ReleaseHandle(jobHandle);

// Run the target program.  
jobHandle = VixVM_RunProgramInGuest(vmHandle,
  "c:\\myProgram.exe",
  "/flag arg1 arg2",
  0,                  // options
  VIX_INVALID_HANDLE, // propertyListHandle
  NULL,               // callbackProc
  NULL                // clientData
); 
/*
 VIX_E_PROGRAM_NOT_STARTED error code.

VixHandle
VixVM_RunProgramInGuest(VixHandle vmHandle,
const char *guestProgramName,
const char *commandLineArgs,
VixRunProgramOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);

*/
err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

if (VIX_OK != err) {
  // Handle the error.
  goto abort;
}

Vix_ReleaseHandle(jobHandle);
The part to connect to the virtual machine server is the following one.

jobHandle = VixHost_Connect(VIX_API_VERSION,
  VIX_SERVICEPROVIDER_VMWARE_SERVER,
  NULL,               // hostName
  0,                  // hostPort
  NULL,               // userName
  NULL,               // password
  0,                  // options
  VIX_INVALID_HANDLE, // propertyListHandle
  NULL,               // callbackProc
  NULL                // clientData
); 

err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE);

if (VIX_OK != err) {
  // Handle the error.
  goto abort;
}

Vix_ReleaseHandle(jobHandle);


The documentation has an example on how to call a program in the guest OS; it's a complete example that shows how to connect to the virtual machine server, open a file defining a virtual machine, and power it on. The essential code is the following one; you should read the complete example, though.

優秀 的 性能 CrossOver 在 mac linux 上跑 windows 的 api 虛擬機 winehq

CrossOver 在 mac linux 上跑 windows 的 api 虛擬機

比vmware 更快 ,@@ !!!  Boot Camp是多重開機

mac 下的 虛擬機


//////////////////////////////


CrossOver 14 Mac 版讓您可以在 Mac 系統上運行 Microsoft Windows 應用,不必購買 Windows 授權,不必重啓系統,不必使用虛擬機。通過 CrossOver Mac,您可以從 dock 直接啓動 Windows 應用,與您的 Mac OS 系統功能無縫集成,實現跨平台的複製粘貼和文件互通。

CrossOver Mac 支持 Windows 辦公軟件,工具程序和各種遊戲。CrossOver Mac 避免了虛擬機的運行開銷,程序和遊戲的性能可以達到甚至超過它們在 Windows 下的表現。

運行 Windows 應用
再也不必重啓
像運行原生應用一樣,直接從您的 Mac Linux 系統上運行您的 Windows 應用。

一鍵安裝
CrossOver 一鍵安裝技術讓 Windows 程序使用更簡單。

全速運行
沒有性能損耗,在您最喜歡的系統上使用您熟悉的應用。
無縫集成
與桌面環境融為一體

跨平台的複製粘帖和文件互通。

CodeWeavers 支援於 開放原始碼專案 Wine Project
  
費用

CrossOver Mac
12個月 升級與支持
購買之前 下載免費試用版
 更多選項...
$59.95 USD 
6個月升級與支持
 $49.95 USD 

1個月升級與支持


//////////////////////////////

其他相似的

Similar SoftwareClose Comparison

//////////////////////////////


  • WineBottler 
Free
Bottle Windows apps as Mac application bundles (beta).


  • VirtualBox 
Free
x86 virtualization software.
VirtualBox (Windows/Mac OS X/Linux) Free ( Oracle VM VirtualBox )功能簡單的 虛擬機 (需要安裝windows)


  • Wineskin Wine… 
Free 
Make Wine wrappers to run Windows software on Mac OS X.


  • CrossOver 
$59.95 

Run Windows apps on your Mac.


  • PlayOnMac 
https://www.playonmac.com/en/
Free
Run Windows apps on your Mac. 


PlayOnMac is free software that allows you to easily install and use numerous games and software designed to work on Microsoft® Windows®.
他說可以提供你應用程式在Mac osx 上執行( 免虛擬環境 ),其實是利用類似 wineHQ 的東西, 加上“sandbox”技術,讓你經過他的環境來管理程式


  • VMware

http://www.vmware.com/tw(
Windows/Mac OS X/Linux) Free to $250 開放原始碼且 商業化 (需要安裝windows)


  • Parallels Desktop 9

http://www.parallels.com/tw/products/desktop/
(Mac OS X) $80 商業化 虛擬機 (需要安裝windows)
https://en.wikipedia.org/wiki/Parallels_Desktop_for_Mac


  • QEMU (Linux)

http://wiki.qemu.org/Main_Page
Free 主要是讓你跑linux 程式在mac上

https://github.com/psema4/pine/wiki/Installing-QEMU-on-OS-X
To emulate the Raspberry Pi on OS X, you need a version of QEMU that supports the ARM 1176 instruction set (QEMU version 1.1.0 exactly).


  • Wine

https://www.winehq.org
老牌api 虛擬 改名 "WIN HQ "http://wiki.winehq.org/MacOSX open source 可以成功執行大部分win程式 (原本目標是win on linux )


  • Wine bottler

http://winebottler.kronenberg.org
api 虛擬  "WIN HQ "的mac版


  • WinOnX
http://www.winonx.com


  • Boot Camp

https://en.wikipedia.org/wiki/Boot_Camp_(software)
 (Mac OS X)  Free apple 開發給你安裝windows 在mac上的多重開機管理器


//////////////////////////////


  • 名為模擬器的blog,有趣, 不過講的是 遊戲機 模擬器
Emulation is a way of life. From collectors to hard core gamers alike. I have been following gaming and emulation for a little over ten years and it just keeps getting better. I recall the first first Nintendo 64 emulator like it was my first bike ride. Sure I had the game in the next room. I had even beaten it but it was the thought, the idea that my console could soon play on my computer. As gaming evolves, systems die or get replaced by the next best thing. Gaming doesn’t die, at least not while emulation and computers exist.
dos 在mac 跑 game http://boxerapp.com


  • 這認真的是 DOS 在 Mac (win 98 好像也可以) 
//////////////////////////////
https://en.wikipedia.org/wiki/Wine_(software)
Other versions of Wine
由於是“ 開放原始碼 軟體 , 所以 他的 分支 很多”
//////////////////////////////
  • CrossOver
  • Cedega / WineX
  • Cider
  • WINE@Etersoft
  • Darwin
  • Wine for Android
  • Pipelight/wine-compholio
Other projects using Wine source code
  • Wine bottler
  • Wineskin


Cycada (formerly known as Cider) is a compatibility layer that aims to allow applications designed for iOS to run 
unmodified on the Android operating system. 一個在 IOS iPhone iPad 上跑Android APP的 專案


Darling is a free and open source software application that aims to allow applications designed for OS X to run on the Linux operating system. Darling is a compatibility layer, like Wine. It duplicates functions of OS X by providing alternative implementations of the libraries and frameworks that OS X programs call.[2] This method of duplication differs from other methods that might also be considered emulation, where OS X programs run in a virtual machine.
讓你在 linux上執行 mac osx軟體




2015年10月31日 星期六

inmoov 研究專案 提供 3d 列印 圖檔 工程圖 機器人 仿生人 機械手臂 及 手腕

http://www.robotpark.com/academy/designproject/humanoid-project-inmoov/

inmoov  研究專案 提供 3d 列印 圖檔 工程圖 機器人 仿生人 機械手臂 及 手腕

他 是 一個  open source 專案 , 你可以列印 他 ,在這個專案 你會找到 humanoid's pictures 影片和 資源 與更多提供的 3d 檔案 可以免費下載

關於這個
他是叫做 "inmoov" 的 可列印與影片 這專案 針對 如果你有 3d printer 和 一些 列印技能


我用arduino 板控制它

類似這個



這專案有分左右手

你可以選擇 馬達 與 外加 感測器

Click on the images to enlarge…
For More help on Assembly – http://inmoov.blogspot.com/p/assembly-help.html

OTHER RESOURCES For This Project

This Projects Blog – http://inmoov.blogspot.com
Software For This Robot – http://myrobotlab.org/service/inmoov
Forum of This Project – https://groups.google.com/forum/#!forum/inmoov
Converting STL Files into CAD Problem
http://robosavvy.com/forum/viewtopic.php?p=34865
http://www.solveering.com/products/products_stl2step.html
https://sketchfab.com/search/inmoov



A pedido de todos los estudiantes que nos solicitaron información para realizar un "BRAZO ROBÓTICO HUMANOIDE" , IDI Electronica ® comparte Ingeniería , compartIDi Electrónica - Eventos ® . [BRAZO ROBÓTICO HUMANOIDE CON ARDUINO UNO O ARDUINO MEGA, REALIZADO CON UNA IMPRESORA 3D] TUTORIALES IDi Electronica ® | FUENTE: COMO HACERLO PASO A PASO [COMPARTE IDi Electrónica Store ® ]

1)

DIY Prosthetic Hand & Forearm (Voice Controlled)

https://linus3dprinting.wordpress.com/category/diy-projects/

2)

DIY Prosthetic Hand & Arm (Voice Controlled)

https://www.youtube.com/watch?v=zz6hT3kDhOc

3)

humanoid robotic arm or hand using arduino mega 2500 with proteus simulation

https://www.youtube.com/watch?v=STkqSMkXK8c

4)

Arduino Wireless Animatronic Hand 

by http://www.instructables.com/…/Arduino-Wireless-Animatroni…/

5)

Humanoid robot arm

 by http://www.instructables.com/id/Humanoid-robot-arm/

6)

Glove Controlled Robotic Hand with Arduino

https://www.youtube.com/watch?v=qMtHEOxHDGo&app=desktop

7)

DIY Robotic Hand Controlled by a Glove and Arduino

 by http://www.instructables.com/…/DIY-Robotic-Hand-Controlled…/
8)

MechaTE Robot Right Hand

Product Code : RB-Cus-01

 by Custom Entertainment Solutions
http://www.robotshop.com/en/mechate-robot-hand.html
9)

Roujin Project - InMoov Arm and EMG 1

https://www.youtube.com/watch?v=DZixSyP47aM
10) 

Welcome to the new InMoov Website

As you can see InMoov is getting a new website. It has been a long hard work for the team of Quai Lab in Poitiers France, which remodeled, imported, modified, created this new interface. Big thanks to Sebastien and his co workers for this wonderful work.
http://inmoov.blogspot.pe/
11) 

Project Postmortem: Gael Langevin on InMoov Project #3DxRobotics #3DThursday #3DPrinting

https://blog.adafruit.com/…/project-postmortem-gael-langev…/

tubbysong: ECG(Electrocardiography) 心電圖EEG ...
http://tubbysong.blogspot.tw/2015/10/ecgelectrocardiography.html

ECG(Electrocardiography) 心電圖 EEG(Electroencephalography) 腦電波 EMG(Electromyography) 肌電圖 

ECG(Electrocardiography):心電圖 EEG(Electroencephalography):腦電波 EMG(Electromyography):肌電圖 



西雅圖機器人協會 Seattle Robotics Society!

西雅圖機器人協會  Seattle Robotics Society!

The Seattle Robotics Society was formed in 1982 to serve those interested in learning about and building robots. We are a non-profit corporation comprised of a diverse group of professionals and amateurs, high school students and college professors, engineers and tinkerers. Our passion is the creation of cybernetic creatures that challenge the old definitions of life, intelligence, and practicality.

See the SRS Programs page for information on the activities that the SRS does to help promote robotics. There is also information there on getting started in robotics.

歡迎來到西雅圖機器人學會!西雅圖機器人協會成立於1982年,以服務那些有興趣了解和建築機器人。我們是由專業人士和業餘愛好者,高中生和大學教授,工程師和能工巧匠的不同群體的非盈利性組織。

我們的激情是創造,挑戰生命,智慧和practicality.See的SRS程序頁面的舊定義上的SRS做,以幫助促進機器人的活動信息控制論生物。也有在機器人的入門信息那裡。




SRS RoboMagellan或Robomagellan由西雅圖機器人學會創造,是一個小規模的自主汽車比賽中,機器人預定的開始和結束點之間進行導航。開始和結束點通常表示為GPS坐標和標誌橙色交通錐。在比賽的大多數版本也有可選的航點,該機器人可以以賺取獎勵積分導航。這場比賽是在混合行人的地形可以包括如公園長椅,路緣石,樹,灌木,丘陵,人等障礙物通常進行..
麥哲倫RoboMagellan西雅圖機器人 競賽(magellan GPS)就是他贊助的活動

規則
自由探索
50磅 121.92 立方公分 的機器人在30 分鐘內(可以重來三次) 要自主 穿越戶外 半徑100英尺 避開障礙物,目標是一個 三角錐


2015 十月十日
Robothon 2015 

比賽內容主要是 趣味 與推廣 
上述 自由探索 麥澤倫 與 走線迷宮可能是 較多研究的主題
其他還有 創意 有趣 造型 的堆廣型比賽

研究成果與活動報


有關機器人教育的內容


2015年10月29日 星期四

ATmega644 電視 輸出 微電腦 ㄇ RaspberryPi





 筆者發文說他曾經做過的電路板 25元 美金

These boards use an Atmel ATmega644 microcontroller clocked at 22.1MHz,

 and a 512K SRAM for data and framebuffer storage.
32點io 點輸出
19 of the Atmel’s 32 GPIO lines are used to drive the SRAM address bus.
有一個螢幕輸出
To generate a 320×240 component video signal,
有序列輸出的模擬類比輸出
 the Atmel rapidly increments the address, and the data lines are fed via 74HC-series buffers to a trio of simple summing-point DACs; during horizontal and vertical blanking,



他是免費分享的
 it is free to perform other operations. Here’s a video of the device in action.
只是簡單的影片
Not quite Quake 3, I’m sure you’ll agree, but maybe familiar to fans of
也須你可以看看這個
 David’s 1987 classic Zarch.

In the end, I felt that much higher performance,

有電路文件與pcb分享
 and the ability to run a general-purpose operating system, outweighed the benefits of home assembly, but it’s still a neat design. Those of you interested in the gory details can download Easy-PC schematics and a PCB layout here.

Zarch.Easy-PC   here.


http://blog.atmel.com/2015/10/29/rewind-how-the-raspberry-pi-looked-back-in-2006/

大型 綜合 開源硬體 社群 Open Source Ecology 開放 硬體 設計圖 農場 水耕 漁場 鍋爐 建築 能源 農耕機 挖土機 發電機 原生地 Habitat 農業 Agriculture 工業 Industry 能源 Energy 原物料 Materials 交通 Transportation

大型 綜合 開源硬體 社群 Open Source Ecology   開放 硬體 設計圖 農場 水耕 漁場 魚菜 共生 鍋爐 建築 能源 農耕機 挖土機 發電機  原生地 Habitat 農業 Agriculture 工業 Industry 能源 Energy 原物料 Materials 交通 Transportation

大型 綜合 開源硬體 社群  Open Source Ecology  


Open Source Ecology is incorporated as a nonprofit organization in the State of Missouri, USA.
開源生態結合在美國密蘇里州的州一個非營利性組織。

Our strategy is to develop education and research for the common good. Our goal is open enterprise, so we develop, test, and publish open business models.
我們的戰略是發展教育和研究的共同利益。我們的目標是開放的企業,所以我們開發,測試和發布的開放商業模式。

The nonprofit sector allows us to generate revenue from related product sales – which are used to test our innovative production models – while allowing us to capture donations and foundation funding to accelerate our development. As such, we see ourselves as a hybrid organization.
在非營利部門使我們能夠生成相關產品的銷售收入 - 這是用來測試我們的創新生產模式 - 同時讓我們捕捉到的捐款和基金會的資助,加快我們的發展。因此,我們把自己看作是一個混合組織。

Open Source Blueprints for Civilization. Build Yourself.
開源藍圖的文明。構建你自己。
We’re developing open source industrial machines that can be made for a fraction of commercial costs, and sharing our designs online for free. The goal of Open Source Ecology is to create an open source economy – an efficient economy which increases innovation by open collaboration.
我們正在開發可用於商業成本的一小部分進行開源的工業機器,並在網上分享我們的設計是免費的。開源生態的目標是創建一個開放源碼的經濟 - 一種高效經濟而通過開放協作提高創新能力。



https://www.youtube.com/user/marcinose

Ted talk 2011

Facebook

Wiki

twitter


Tad talk 2011



Power cube 利用引擎 產生 提供 液壓 液體壓力輸出 讓你 可以來輸出 推動其他機械
http://opensourceecology.org/power-cube-workshop-2/


Affnan's Aquaponics
  • Innovating Urban Agrostyle Towards Greener Living
    Affnan's Valve - A Detailed Explanations of A Simple Item
    Foreward

    First of all I would like to point out that, siphon had been around for a long time dated few hundred years ago. Siphon usage ranging from transferring fluid from one container to another right to flushing the toilet.

    Most usage of siphon involved a fixed amount of fluid to be transfer to another container, such usage of siphon don't require it to be operating continuously without human intervention. Toilet flush for example require human input to create the flushing effect from a siphon mechanism, and the flushing stop when cistern is depleted of water. Continuous operation of these siphon are not needed.


開源造屋計畫 什麼是CEB Compressed Earth Block (CEB) 就是一種磚塊 ,他是利用 當地環保材料(乾草、木屑、泥土之類的) 經過壓實 ,可以來建造房屋 自造小屋


什麼是CEB
Compressed Earth Block (CEB) 

就是一種磚塊 ,他是利用 當地環保材料(乾草、木屑、泥土之類的) 經過壓實 ,可以來建造房屋
CEB 環保 磚 牆
https://en.wikipedia.org/wiki/Earth_block









http://www.networkearth.org/naturalbuilding/ceb.html

有網友及案例介紹
http://www.naturalbuildingblog.com
商用設備
http://www.naturalbuildingblog.com/more-info-on-compressed-earth-blocks-cebs/
http://www.aliexpress.com/store/product/family-compressed-earth-interlocking-brick-making-machine-small-compressed-earth-brick-making-machine/1045065_1561605096.html

磚塊本身需要考慮外牆用的美觀與結構安全和耐用度

http://www.naturalbuildingblog.com/star-top-ceb-presses/ 


CEB Press 夯實機 壓實機

英文  CEB Press Prefab Straw bale  

材料可以很多元多樣,如玻璃、灰泥
https://geopolymerhouses.wordpress.com/2011/06/21/how-to-make-glass-aggregate-countertops/
https://geopolymerhouses.wordpress.com/tag/ceb/

https://www.jovoto.com/projects/300house/ideas/12512



The CEB Story 2012. from Open Source Ecology on Vimeo.


房屋結構

http://www.wikihouse.cc
https://www.ted.com/talks/alastair_parvin_architecture_for_the_people_by_the_people?language=en
WikiHouse is an open source building system. Many designers, collaborating to make it simple for everyone to design, print and assemble beautiful, low-energy homes, customised to their needs.

designboom
卡榫 積木 拼圖 接合 的方塊結構
http://www.designboom.com/design/opendesk-downloadable-furniture-at-design-museum-london/

a view of opendesk, beside wikihouse exhibited at design museum london

an opendesk design that is ready for assembly




http://www.plataformaarquitectura.cl/cl/02-280348/casas-ermitanas-abe-the-cloud-collective

Casas Ermitañas: Abé / The Cloud Collective 

 Descripción de los arquitectos.  Las casas ermitañas son​​ casas que utilizan técnicas de producción de vanguardia y personalización masiva para generar refugios sustentables y asequibles.

  • Ubicación: Holanda
  • Equipo de Diseño: Daniël Venneman, Mark van der Net
  • Área: 14.0 m2
  • Fotografías: Cortesía de The Cloud Collective








Cortesía de The Cloud Collective
Cortesía de The Cloud Collective



更多小屋介紹

http://www.plataformaarquitectura.cl/cl


google
open source house plan