Montag, 19. Oktober 2015

ArchLinux - Maude


  1. Download the latest version of maude:
    http://maude.cs.illinois.edu/w/index.php?title=Maude_download_and_installation
  2. Export the *.zip by typing unzip ~/Downloads/Maude*
  3. Go into the exported directory.
  4. Run the file maude.linux64

Troubleshooting:
  • Programm does not start and does not find libtinfo.so.5. Note we're referencing a lib which might has a similar name. Show yourself all similar libs with ls /lib64 | grep libncurs.
    cd /lib64
    sudo ln -s libncursesw.so.6.0 libtinfo.so.5

Mittwoch, 7. Oktober 2015

From Java to C# - A few notes


  • You might instantiate a generic class like a normal array:
    List<T> mylist = new List<T>() { t1, t2, t3, ..., tn};
  • LINQ - Language Integrated Query
    • Queries for different DBs, XML, Generics
  • Properties
    • These are easy written accessors
    • Futhermore an easy possiblity to convert information
      • e.g. we store seconds in our time class
      • you might write a property which allows you to simulate an other variable, like hours
        which still relays on the seconds.
      • public string Name
        {
          get { return ...; }
          set { ... = value;}
        }
  • Only functions noted with the keyword virtual might be overwritten.
  • Override is a keyword, not an annotation
  • Javas super is C#s base
  • You must to append an f to your float
    • float f = 3.141f
  • There is a special keyword var
    • var is a type which is determined at compile-time. So it can't change on run-time!
    • var v = (new List<int>() {1,2,3})[0];
      • v has the type int now
    • You might use var in foreach
  • foreach (Type t in Collection) is javas for (T t : Collection)
  • All types are objects!
    • There are two subtypes:
      • Valuetypes
      • Referencetypes
  • There is not multiple inheritance.
  • You implement interfaces and super classes in the same way:
    • class sub : super
      {
        // ...
      }
    • class implementation : interface
      {
        // ...
      }
  • There a different types of lambdas:
    • Action<T1, ..., Tn>(...) which maps on void
    • Func<T1, ..., Tn, Tresult>(...) which maps on given type Tresult
  • Futhermore there are two keywords for easy threading:
    • await
    • async




Dienstag, 6. Oktober 2015

Edit Markdown with vim like a king!

When i did start writing Markdown files, it was for my projects on github. After editing on githubs webpage, i was using vim at local repositories.

After a short time, i figured out that chromium has a Markdown interpreter. It's called MarkDown Preview Plus. I installed it because of the following features:

  • It can read local files.
  • On the fly refresh - When you edit your markdown file and store it, the interpreter upgrades the view automatically. 

After i installed the file, i was wondering if i couldn't bind chromium to a vim hotkey.

So i added this line to my .vimrc:
autocmd BufEnter *.md exe 'noremap <F5> :! chromium %:p<CR>'

This line binds the key F5, on files ending with .md to chromium. So, when you press F5 chromium opens and the Markdown Preview Plus interprets the file.