Sunday, October 20, 2019

C#


  • Read a text file

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-read-a-text-file-one-line-at-a-time


  • convert a string to numbers
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/how-to-convert-a-string-to-a-number
  • Split a string by a specified delimiter:
https://www.completecsharptutorial.com/csharp-articles/csharp-string-function.php
  1. string[] split = firstname.Split(new char[] { 'e' });
  2.  

Friday, October 18, 2019

Xcode Basics


  • Build in Release

Go to "Product" menu, "Scheme" and "Edit Scheme".
Select "Run" from the list on the left.
Change "Build Configuration" to "Release".




  • Build directory

Select you project in the Xcode. On the right side select "Build Settings". Select desired target and under "Build Locations" you will find paths for debug, release and distribution configurations. These paths are relative to your "Deriver Data" directory. To open that directory in Finder, do the following. Xcode menu: Window->Organizer. When you get "Organizer" window, on the left side select you project and on the right side you will get "Derive Data" path. Clicking on the arrow at the end of the "Derived Data" path you will open that directory in the Finder.
https://stackoverflow.com/questions/28921091/how-to-get-the-xcode-build-directory/53727382
  • Import dynamic link libraries
First, add the path to the header files to "Header Search Paths"(Not necessarily the deepest folder where they are saved, it suffices to tick "recursive").
Then, drag&drop dylib files under "Link Binary With Libraries".
(When do we need to write "opencv2/..."??)


http://nn-hokuson.hatenablog.com/entry/2017/05/12/201453
http://warapuri.com/post/70283352060/unityでopencvを動かしてみよう主にmac対応


  • Build a bundle file

https://forum.unity.com/threads/building-opencv-plugin-for-mac-osx.623662/




Wednesday, October 16, 2019

Unity


  • To group variables in Inspector pane, one can use [Header("")]

https://answers.unity.com/questions/28050/how-to-group-variables-in-the-inspector.html


  • To iterate child game object, "foreach" for transform component:
foreach(Transform child in parent.transform) {}
  • Similarly, to find a child game object by name, transform.find(its_name)
  • To hide or unhide an object, set GetComponent<Renderer>().enabled true or false.
https://answers.unity.com/questions/1171111/hideunhide-game-object.html

This GetComponent method ofcouse works for other types of components too, with which one can toggle/untoggle check boxes.
  • Active objects at the start of the game can be set inactive, but not vice-versa.
https://answers.unity.com/questions/926399/find-inactive-game-object.html
  • Editor window
    https://rightcode.co.jp/blog/information-technology/editorwindow-unity-convenient


Writing a post in Markdown in Blogger

Following articles are helpful. * [【令和最新版】Blogger で Markdown を用いて記事を書く方法](https://qiita.com/hoge_fu-ga/items/267ea5ad4f8c120eaeb8) * [Bl...