Increase your software development productivity 100x

Get more work done, for less effort!

The above might sound like an exaggeration. However, it is not! Simply because in Phosphorus Five, you can reuse almost everything you do. In the video below, I am demonstrating reducing my projects from 388 LOC (Lines Of Code) to 1 LOC, by creating a reusable extension widget, from an existing web app page.

Basically, what this implies, is that you can reuse almost everything you do in one project, to the next. This suggests that if you’re creating more than one project, then every time you start out a new project, you’ll be almost done with it, before you even start!

You can find the code for this below the video. For the record, I had to slightly modify the code below, to avoid angle brackets, etc, since my blog can’t handle angle brackets in code segments, even if I HTML encode them manually …

Now before you check out the code, realise that we started out with a “page”. Then we turned that page into a reusable extension widget, in roughly 5 seconds. The end result, being a reusable component, we can reuse in other projects, or in other pages in the same solution. Please watch the video for an explanation of how we did this.

Features of our GitHub project browser

The video also demonstrates some other pretty nifty features. For instance, we are able to traverse any project from GitHub, without using any of the GitHub APIs. The way this works, is that we are able to treat HTML semantically, and extract parts of the HTML returned by GitHub, by transforming it into a lambda object, to retrieve its actual “data”. Basically, we’re scraping GitHub, and semantically extracting parts of their HTML, to semantically “understand” the structure of the project we’re browsing.

In addition, we will automatically parse any Markdown files, and show them in HTML view, and show any code segments accordingly. To do this, we use the HTTP REST capabilities of P5, which allows us to download files, using any of the HTTP verbs, such as GET, POST, PUT, etc. Notice, this is done on the server!

Below is the code we ended up with, after having created our extension widget. Evaluate the following code in the System42/Executor.

/*
 * Creates a GitHub folder browser, that will allow the user 
 * to browse and read all files within each folder of a project.
 * Will create one Ajax TreeView mirroring the folder structure of the project, 
 * semantically parsed from the HTML of the project's landing page, in addition
 * to a "datagrid" allowing the user to see all files within currently selected folder,
 * and view its content.
 */
create-event:sys42.samples.git-hub.file-browser
  return
    container
      oninit
        p5.web.include-css-file:"https://highlightjs.org/static/demo/styles/rainbow.css"
        p5.web.include-javascript-file:"https://highlightjs.org/static/highlight.site.pack.js"
      events

        /*
         * Downloads GitHub index page, and returns the URLs for both 
         * the child folders, and the Markdown files.
         * Expects [_arg] being URL of GitHub HTML page to download, and semantically parse.
         * Returns [.files] and [.folders] being collection of source files, 
         * and folders recursively inwards.
         */
        sys42.samples.git-hub._get-files-folders

          /*
           * Checking cache to see if requested folder has already been traversed, 
           * and exists in cache.
           */
          p5.web.cache.get:sys42.samples.git-hub.{0}
            :x:/../*/_arg?value
          if:x:/@p5.web.cache.get/*/*
            return:x:/@p5.web.cache.get/*/*/*

          /*
           * Buffers.
           */
          .folders-tmp
          .files-tmp
          .folders
          .files

          /*
           * Retrieving all "xxx.md" types of files, in addition to all folders.
           */
          p5.http.get:x:/../*/_arg?value
          p5.html.html2lambda:x:/-/**/content?value
          add:x:/@.files-tmp
            src:x:@"/@p5.html.html2lambda/**/svg/*/\@class/=octicon octicon-file-text/././+/**/a/*/\@href"
          add:x:/@.folders-tmp
            src:x:@"/@p5.html.html2lambda/**/svg/*/\@class/=octicon octicon-file-directory/././+/**/a/*/\@href"

          /*
           * Massaging results from above.
           */
          for-each:x:/@.folders-tmp/*
            split:x:/@_dp/#?value
              =:/
            add:x:/@.folders
              src:@"{0}:""{1}{2}"""
                :x:/@split/0/-?name
                :"https://github.com"
                :x:/@_dp/#?value
          for-each:x:/@.files-tmp/*
            split:x:/@_dp/#?value
              =:/
            add:x:/@.files
              src:@"{0}:""{1}{2}"""
                :x:/@split/0/-?name
                :"https://github.com"
                :x:/@_dp/#?value

          /*
           * Returning folders and files to caller, making sure we cache results first.
           */
          add:x:/../*/p5.web.cache.set/*/*/items
            src:x:/@.files|/@.folders
          p5.web.cache.set:sys42.samples.git-hub.{0}
            :x:/../*/_arg?value
            src
              items
          return:x:/@.files|/@.folders

        /*
         * Creates our TreeView bugger.
         * Expects [.folders] being initially treeview root items to create.
         * Will also create the default "files datagrid" after TreeView has been created.
         * Hence, also expects [.files], which it will pass into creation of "files datagrid".
         */
        sys42.samples.git-hub._create-tree-view

          /*
           * Deleting any previously created datagrids, if existing.
           */
          if
            fetch:x:/0/0?value
              widget-exists:git-hub-treeview
            delete-widget:git-hub-treeview

          /*
           * Adding our treeview items.
           */
          split:x:/../*/_arg?value
            =:int:8
          add:x:/../*/create-widget/*/*/*/items/*/*/items
            src:x:/../*/.folders/*
          set:x:/../*/create-widget/**/root?name
            src:x:/@split/1?name

          /*
           * Creating our actual treeview.
           */
          create-widget:git-hub-treeview
            parent:results-wrapper
            class:col-xs-12 col-md-6 prepend-top git-hub-tree
            widgets
              sys42.widgets.tree

                /*
                 * Lambda callback for when an item is selected.
                 * We just simply retrieves files and folders, and create our 
                 * Markdown "files datagrid" here.
                 */
                .on-select
                  sys42.samples.git-hub._get-files-folders:x:/../*/items/*?name
                  add:x:/../*/sys42.samples.git-hub._create-files-grid
                    src:x:/../*/sys42.samples.git-hub._get-files-folders/*/.files
                  sys42.samples.git-hub._create-files-grid:x:/../*/items/*?name

                /*
                 * Lambda callback for retrieving child items.
                 * We retrieve the files and folders, and returns items to caller (TreeView).
                 */
                .on-get-items
                  sys42.samples.git-hub._get-files-folders:x:/../*/_item-id?value
                  add:x:/../*/return/*/items
                    src:x:/@sys42.samples.git-hub._get-files-folders/*/.folders/*
                  return
                    items
                items
                  root:x:/../*/_arg?value
                    items

          /*
           * Making sure we initially select the root tree item, and populate our
           * datagrid with the root Markdown files.
           */
          add:x:/../*/sys42.widgets.tree.select-items/*
            src:@"""{0}"""
              :x:/../*/_arg?value
          sys42.widgets.tree.select-items:git-hub-treeview
            items
          add:x:/../*/sys42.samples.git-hub._create-files-grid
            src:x:/../*/.files
          sys42.samples.git-hub._create-files-grid

        /*
         * Creates the "datagrid" that shows our files.
         * Expects [.files] being collection of files to create our "datagrid" around.
         */
        sys42.samples.git-hub._create-files-grid

          /*
           * Deleting any previously created datagrids, if existing.
           */
          if
            fetch:x:/0/0?value
              widget-exists:git-hub-datagrid
            delete-widget:git-hub-datagrid

          /*
           * "Databinding" our datagrid.
           */
          apply:x:/../*/create-widget/*/*/*/*/tbody/*/widgets
            src:x:/../*/.files/*
            template
              tr
                onclick

                  // Databound above.
                  {_url}:x:?value
                  sys42.samples.git-hub._create-file-view-widget:x:/@_url?value
                  set-widget-property:x:/../*/_event?value
                    class:active
                  p5.web.viewstate.get:sys42.samples.git-hub.active-row
                  if:x:/@p5.web.viewstate.get/*?value
                    and
                      fetch:x:/0/0?value
                        widget-exists:x:/@p5.web.viewstate.get/*?value
                    delete-widget-property:x:/@p5.web.viewstate.get/*?value
                      class
                  p5.web.viewstate.set:sys42.samples.git-hub.active-row
                    src:x:/../*/_event?value
                widgets
                  td
                    {innerValue}:x:?name

          /*
           * Creating our actual datagrid.
           */
          create-widget:git-hub-datagrid
            after:git-hub-treeview
            class:col-xs-12 col-md-6 prepend-top git-hub-grid
            widgets
              table
                class:table table-hover
                role:button
                widgets
                  thead
                    widgets
                      tr
                        widgets
                          td
                            innerValue:"Files"
                  tbody
                    widgets

        /*
         * Creates the "file-view" widget that shows the content of our files.
         * Expects URL to file to display as [_arg].
         */
        sys42.samples.git-hub._create-file-view-widget

          /*
           * Deleting any previously created markdown widgets, if existing.
           */
          if
            fetch:x:/0/0?value
              widget-exists:git-hub-markdown
            delete-widget:git-hub-markdown

          /*
           * Massaging URL.
           */
          replace:x:/../*/_arg?value
            src:"https://github.com"
            dest:"https://raw.githubusercontent.com"
          replace:x:/@replace?value
            src:"/blob/master/"
            dest:"/master/"

          /*
           * Retrieving Markdown file, creating HTML out of it, 
           * and creating our result widget showing file.
           */
          p5.http.get:x:/@replace?value
          if:x:/@p5.http.get/*/result/*/Content-Type?value
            !~:text/plain

            // We only handle text types of files.
            sys42.windows.info-tip:File is not a text file.
            return

          // Checking type of file.
          if:x:/@replace?value
            ~:.md

            // Markdown file.
            index-of:x:/@replace?value
              src:/
            split:x:/@replace?value
              =:x:/@index-of/0/-?value
            markdown2html:x:/@p5.http.get/**/content?value
              root-url:{0}/
                :x:/@split/0?name
            create-widget:git-hub-markdown
              parent:results-wrapper
              class:col-xs-12 prepend-top git-hub-markdown
              element:div
              innerValue:x:/@markdown2html?value

          else

            // Source code file.
            p5.html.html-encode:x:/@p5.http.get/**/content?value
            create-widget:git-hub-markdown
              parent:results-wrapper
              class:col-xs-12 prepend-top git-hub-markdown
              element:pre
              oninit
                p5.web.send-javascript:@"hljs.highlightBlock(p5.$('{0}').el);"
                  :x:/../*/_event?value
              innerValue:x:/@p5.html.html-encode?value

      widgets

        /*
         * This is our input for having user supply the URL to some GitHub project website.
         */
        container
          class:input-group
          widgets
            span
              class:input-group-addon
              innerValue:URL
            void:url
              placeholder:GitHub project's URL ...
              class:form-control
              accesskey:U
              value:"https://github.com/"
            container
              class:input-group-btn
              widgets

                /*
                 * Button will download main GitHub project's landing page, 
                 * and semantically parse the HTML for any sub-folders and all of its source files.
                 * Will use this result for creating a "folder Ajax TreeView" to allow you to browse
                 * the project structure, in addition to a "files datagrid" allowing you 
                 * to view the content of each file.
                 */
                button
                  class:btn btn-primary
                  innerValue:Fetch
                  onclick

                    /*
                     * Clearing out any previous results.
                     */
                    clear-widget:results-wrapper

                    /*
                     * Retrieving root URL for project, and fiding all "xxx.md" types of files, 
                     * in addition to all folders.
                     */
                    get-widget-property:url
                      value
                    sys42.samples.git-hub._get-files-folders:x:/@get-widget-property/*/*?value

                    /*
                     * Verifying that we actually found something worth looking at.
                     */
                    if:x:/@sys42.samples.git-hub._get-files-folders/*/*
                      not
                      sys42.windows.info-tip:No folders or files found at specified URL
                        class:info-window info-window-error
                      return

                    /*
                     * Creates our Ajax TreeView for navigating folders.
                     */
                    add:x:/../*/sys42.samples.git-hub._create-tree-view
                      src:x:/@sys42.samples.git-hub._get-files-folders/*(/.folders|/.files)
                    sys42.samples.git-hub._create-tree-view:x:/@get-widget-property/*/*?value

        /*
         * Used to hold our results widgets.
         * Both the TreeView, DataGrid and markdown/code widgets are appended as children into this bugger.
         */
        container:results-wrapper

Then create a “lambda” page, with the following code in it, to consume the widget we created above.

/*
 * This will create a page, consuming our newly created 
 * extension widget.
 */
create-widget
  parent:content
  class:col-xs-12
  widgets
    sys42.samples.git-hub.file-browser

BouncyCastle, the only real alternative for cryptography on .Net/C#

BouncyCastle is a group of cyberpunks from Australia, that have created a really kick ass cryptography library for Java and C# (or any other language on the .Net platform).

It’s a kick ass quality piece of work, with tons of features, supporting most standards out there in regards to cryptography. And I freakin’ love it! However, I must admit, that it suffers from an extreme lack of good documentation. You’ll find some information about it over at StackOverflow.com. However, in general terms, you’re basically “on your own” when trying to understand the thing. If you have a lot of spare time though, you could probably dissect its unit tests, to at least get a basic understanding of some of its features, but that’s clearly not for the faint at heart.

Phosphorus Five is using a lot of the features from BouncyCastle. In fact, for the most parts “indirectly” through MimeKit, where Jeffrey Steadfast has done an incredible job at abstracting away the gory details of BC. And I have even gone further to take away the pains, on top of MimeKit again.

Cryptography is one of those things you really should not create yourselves. The reasons are, that a simple bug, might literally mean the difference between life and death for your customers. Hence, instead of using BouncyCastle directly, which is a real pain – I encourage you to at least use it indirectly through MimeKit, or even preferably even through Phosphorus Five. That way, you’ll get a flying start, being capable of easily creating, at the very least some PGP encrypted emails, and creating your own PGP keys, etc – Without running the risk of messing everything up …

Check out the docs for how to get started hereΒ – (scroll a little bit down to see how to create your first encrypted email) – Below is a small video I created, that should get you started, within 5 minutes. So what are you waiting for?

Let’s Encrypt!!Β πŸ˜€

EU proposing ban on cryptography backdoors

No more of this please …!!

Finally som sanity! It now seems that EU is trying to push for a new law, which criminalises any attempts at installing backdoors, that will bypass cryptography solutions. Source; The Telegraph. I must say, that this is a surprising turn of events, since a lot of governments have made the exact opposite arguments, for quite some time. I guess they finally realised that it’s ipso facto impossible to keep our government communication secured online, unless they commoditise the same security to their people!

Thank you EU! Thank you very much!! ❀

PS!
Phosphorus Five has tons of cryptographically secured goodies … πŸ˜‰

MimeKit, simply the best MIME parser out there for C#

I have done a lot of work on MIME, meaning the Multi purpose Internet Message Exchange standard. This standard is at the heart of being able to send and receive emails, over e.g. POP3 and/or SMTP – Which are the two most commonly used standards for retrieving and sending emails.

Every time you want to send an email, you are basically using the MIME standard, which allows for “multiple entities”, such as attachments, HTML views, plain text views, etc. Hence, at least having a partial understanding of how MIME works, is crucial in order to be able to create software that somehow sends or retrieves emails. I have researched several different MIME parsers in the .Net space, and I have concluded with the following basically.

Unless you’re using MimeKit, you’re doing something wrong!

Every now and then, some geek comes around, and is able to do some really incredible thing. Jeffrey Steadfast is one of these guys. He has created the fastest MIME parser in existence previously in C, and over the last couple of years, implemented a MIME parser for the CLR. MimeKit can be found here. If you don’t believe me, look at his performance benchmark of his own baby compared to the alternative MIME parsers out there, at his GitHub website for MimeKit.

MIME is a notoriously difficult to understand standard (like most of them are), full of arcane language, and cross-references to other standards. Luckily, Jeffrey have created a brilliant API, which allows you to more easily understand how to create MIME messages, without having to wade through tons of documentation.

Below I have a video, demonstrating encrypting and putting more than 5000 PNG files into a single MIME message, using MimeKit at its core. On my MacBook Air from 2015, it is able to do that job in roughly 7 seconds. For the record, that’s staggeringly fast!

Even Microsoft has publicly announced that it is the superior MIME parser, indirectly, by making it become the recommended MIME parser, through making the old SmtpClient obsolete, and encouraging its users to use MailKit instead. MimeKit simply rules!

Why is software development hard?

Wouldn’t you rather want to be here, than in your office?

When Henry Ford invented the assembly line, he reduced the cost of creating cars by one order of magnitude, within some few years. When Gutenberg invented the printing press, he reduced the price of copying a Bible from a small fortune, to the point where you literally get them tossed after you by missionaries today. Obviously the software industry is not “entirely there”.

According to studies in the subject, 25% of all software projects completely fail, while 50% of them are “challenged”. Hence purely logically, we’re at the point where we’re “trying to build cars, with nothing but a hammer and a chisel”, right? Software developers work 80 hours a week often, trying to meet unrealistic expectations, effectively “outsourcing” their lives in the process. Obviously there must exist some tool for us as software developers, that gives us the same effect as the assembly line, or the printing press, right …?

I have invented such a tool in fact. It’s called Phosphorus Five, and allows you to become at least 10x as productive, and sometimes produce up to 220 times better results.

Don’t believe me, then check it out for yourselves!

When you’ve found my claims to be true, feel free to join me at the beach … πŸ˜‰

I’ll do 90% of your work for β‚¬57

Software development is a weird profession in many ways. For instance, if you can solve a problem once, the cost of solving the same problem 1 billion times, is the price of copying a file.

That I will do 90% of your job for €57 might sound weird. After all, you’re likely being paid 50-100.000 dollars per year for doing your job today. The idea that I will do 90% of what you do today, for €57, might at first seem ridiculous. However, I have already done most of your job! Assuming you’re a web developer at least.

This is because all software projects have similar problems. For instance, most of your web apps requires you to solve some repeating problem, over and over again, for each project you do. If you could extract the commonalities for your solutions, and create a re-usable component out of them, you would end up with having permanently solved that problem, for the rest of your life!

I have created software since I was 8 years old. I am 43 today. In 2011 I had a somewhat nervous breakdown, due to having worked 80 hours a week, for almost 20 years straight. I quickly realised that I am not alone in these regards. Most developers are suffering from inhumane expectations, and hence tends to burn out long before they’re supposed to retire. I decided to bounce back, and solve this problem, out of compassion for other developers.

All the software that we create, have basically 90% of its problems in common. I have been able to over the last 5 years, pinpoint these commonalities, extract them, and create generic solutions for them – At least when it comes to web apps development, and especially within the enterprise space.

In order to do this, I had to create a new programming language called “Hyperlambda”, Β invent a new way to create Ajax, and create a new design pattern called Active Events – To significantly reduce the complexity of having components integrate with each other, and play together, almost the same way the musicians in a symphony orchestra plays together.

In this process, I was able to improve your productivity 10x, improve the quality of what you create with sometimes as much as 100x, eliminate 90 percent of your potential bugs, and increasing the security of your apps by at least one order of magnitude.

The funny thing, is that you don’t have to believe me. In fact, I want you to disbelieve me! Only by being critical to my claims, you can become able to find the truth for yourselves. I have therefor chose to create my solutions as Open Source and Free Software solutions, to allow anyone wanting to test my claims to download it for free, for themselves to verify my claims. You can find my code at GitHub.

Then after you have found my claims to be correct, you can purchase a commercial license, that allows you to create closed source apps. Just please remember, that the €57 offer is only valid until the 15th of July 2017!

If you think I am full of bullshit, and don’t care to spend time checking out my claims – Then please realise that I have been published twice in MSDN Magazine about my ideas!

If Microsoft is willing to give my ideas some space, wouldn’t it be wise for you to do the same …?

Buy a better life for β‚¬57

Having a Coconut on the local restaurant in Brazil

If you’re a software developer, chances are you’re having a shitty life. Working 70 hours every week, trying to meet unrealistic expectations, from customers you probably deep down inside hate. I can solve your suffering, by making you equally productive as you are today, without having to work more than 1 hour every day!

It’s really quite simple to understand in fact too. I can basically make you apprx. 10-100 times more productive than what you are today. And I can prove it with math and science!

A commercial license to Phosphorus Five will cost you €57. Such a license, will allow you to develop proprietary and close source software with P5, at least 10x as fast, and at least 100x the quality, of what you are able to do today with your existing tools!

Don’t believe me, keep on reading my blog, and see with your own eyes, how I have spent most of my life for the last 5 years, travelling the world, working as little as possible, still outperforming all software developers on the planet, in regards to all performance criteria possible to measure with science!

Then check out my photos for yourselves … πŸ˜€

Just another normal day at the office!

I used to attend private parties here dude!! πŸ˜‰

With our camping car in North Norway

The view from “Bodil” our first night in Lofoten. This photo was taken 1AM in the morning!

Yours truly making dinner for his beautiful girl somewhere in Croatia I think …?

My friends from Venice Beach!

My office in Berlin

My office in France

My office in Cyprus

The view from my office in Italy

The entrance to my office in Brazil

Celebrating my birthday at my office in Cyprus

Veni, vedi, vici!

Breaking news; Software guy saves the world from coffee shop in Rome

Yours truly at his office for the night πŸ˜€

“After having travelled the world for 5 years, on a Harley Davidson, spending no more than an hour working every day – A software developer solved the travelling salesmen algorithm problem, from a coffee shop in Rome! He has already been proposed as a candidate for the Turing award next year!”

Imagine the above scenario. In fact, you don’t have to imagine it, I have already lived this life. For the last 5 years, I have been beep boopin’ around the entire world, working as little as possible, while still being more than 10x as productive as my software development peers.

I have slept on Venice beach in California, I have hiked through Death Valley, I have done 1300 miles on my Harley Davidson through Los Angeles, I have spent 4 months in a camping car through Europe, going through 17 countries, I have spent 3 months meditating on the beaches of Brazil, and now I have been living in Cyprus for almost a year! And still I have been at least 10x as productive that all other software developers on the planet! Possibly combined some would argue, since IΒ  am giving you the opportunity to reproduce my way of life!

Below is a picture of my office in Venice, Italy; St. Mark’s Square.

A picture of me and my girl at the St. Mark’s Square in Venice, Italy. My office for the day!! πŸ˜€

And here’s my office in Nice, France …

A photo of yours truly taken in Nice

My office in Berlin …

My office in Berlin

And finally, discussing Agile software methodologies with one of my local employees in Cyprus!

One of my local employees is arguing Agile software with your truly …!! πŸ˜‰

So ask yourself the following question, do you envy my life? If the answer is yes, feel free to buy it for €57

Breaking news; Software developer spends 6 months at the beach in Cyprus

Would you want to be here, or in your office at night?

“In Cyprus, there’s a software developer who have spent the last 6 months almost exclusively living on the beaches of Cyprus, making money while swimming!”

Imagine if I could give you the tools necessary to accomplish the above. Would you dig it? Would that be groovy? What music would you be listening to on your iPhone, as you sip through your Frappe, from the beach? Who would you party with during the night? Which pubs would you go to?

I happen to have a toolkit, which I have proven will make you at least 10x as productive after a couple of weeks of learning it. This implies that if you spend 1 hour every day working with my toolkit, you will be equally efficient as 10 hours of work every day!

I will sell you this toolkit for the price of €57. This implies that you for the cost of a couple of dinners, a movie ticket, and some few beers – Could literally have the life I describe above!

Discussing Agile software methodologies with one of my employees! πŸ˜€

Breaking news; Software developer travels Europe on Harley Davidson

Yours truly took this photo in Greece, during one of my travels

Imagine if you could bring your laptop, start your Harley Davidson, and travel all across Europe. Making your living by spending 1 hour every afternoon, working from some hotel bed in Greece, or from beneath the stars in Italy? Still earning more money than working 70 hours a week from some cheesy office building? Would that be nice? Would you want to do it?

It’s actually quite easy in fact. All you have to do, is to make sure you’re 10 times more productive than you used to be. If you can somehow improve your productivity by 10x, you can actually do this. At this point the observant reader might complain, and say.

How on Earth do you expect me to become 10x more productive?

Well actually, pay €57 for a commercial license of Phosphorus Five, spend a couple of weeks learning P5, then go buy a Harley! It’s really that simple, and I have scientifically proven it, in a reproducible environment, that allows you to check up my claims!

The photo for this article is of the Corinth canal. It was built 2.000 years ago, and it made a journey that would normally require several days, if not weeks, be easily able to do in a couple of hours. It’s not really rocket science. Simply make sure you take the shortest path from a to b, and you can easily work 10x as fast!