Archives

Archives / 2018 / June
  • Linear regression behavior with free weight

    Hello everybody,

    recently I've decided to implement some ML library in C#. But mine ultimate goal of that C# library was to make it use as much as possible TPL features of C#. 

    I'm aware about other ML libraries, but as often is said, if you wish to understand how some ML algorithm works, program it by yourself. I've decided to start with Linear regression.

    Here you can see how mine library utilizes processor:

    as you can see it uses 85% of mine 4-cores CPU, which is impossible with only one thread running.

    First step for me was to understand how that algorithm works. In order to understand it I've took course Machine Learning Specializationfrom University of Washington.

    I'll omit … more

  • Practical value of unit tests

    Hello everybody,

    Here will be another interesting benefit of writing unit tests which I've discovered recently for myself. 

    Simplified testability

    Imagine, that for you as for developer arrived some kind of bug. After investigation you've found that bug is caused with imporper method functionality. How can you fix method without unit tests? Way will be like this:

    Add code fix

    Execute application and make effort to re-prodcue bug

    If bug is not re-produced, you make commit/push and enjoy life

    If bug is not fixed, go to steps 1 - 3 one more time.

    Here is how those steps can look like in unit test:

    Add unit test that feed into method with bug wrong values

    Add fix to code … more

  • Some notes on xUnit usage

    Hello everybody,

    today I want to share with you small explanation about how xUnit works. 

    Take a look at presented code:

    [Theory]

    [InlineData(3, 4, 5)]

    [InlineData(7, 8, 9)]

    public void MethodDemo(int numberOne, int numberTwo, int numberThree)

    {

        double[][] data = new double[1][];

        data[0] = new double[3];

        data[0][0] = numberOne;

        data[0][1] = numberTwo;

        data[0][2] = numberThree;

        var sut = new Matrix(data);

    }

    If to describe this code in words, it has following meaning. 

    Attribute Theory says that it is test method which should be exeuted.

    Repeated twice Attribute InlineData says that method MethodDemo should be executed twice, with assigning to … more

  • Access rights in Acumatica

    Hello everybody,

    today I want to leave a short notice on how access rights work in Acumatica. So, if to enumerate them, there are following access permissions: revoked, select, update, insert, delete. 

    If to enumerate them in the list of smallest permissions to biggest, it will be list like this:

    Revoked - user can't see or edit

    Select - user can see, can't edit

    Update - user can see and edit

    Insert - user can see, edit, create new

    Delete - user can see, edit, create, delete

    So, if you configure permissions, and want to give highest level, then give Delete. But if you want to protect system from accidental deletion, then most probably you'll need give them Select set of … more

  • C# async/await usage

    Hello everybody,

    today I want to describe in simple words what C# does for .Net cases in IIS.

    Before I continue, I want to point the following. As usually IIS has 500 threads. It means that one IIS server can simultaneously server 500 customers. Keeping this idea in mind

    take a look at the following code:

    [HttpGet]

    public IEnumerable<string> GetSync()

    {

        string val1 = "value" +  LongRunningMethod().ToString();

        string val2 = "value2";

        return new[] { val1, val2 };

    }

    private int LongRunningMethod()

    {

        Thread.Sleep(10000);

        return 10;

    }

    and imagine that you have 600 customers simultaneously. For 500 lucky users of your web site it will mean that their … more

  • Import export data between different SQL servers

    Hello everybody,

    today I want to share some information on how to import some big chunks of data from one server to another. Need for this movement for me personally arised when I had a need to transfer big amounts of data on a regular basis. Big amount means 2.5 millons of records. My first apporach was to use SQL Server 2017 Import and Export Data. Initially I've used 32 bit tool, and found out that I sometime face strange error messages. After some googling I've found that for big volumes of data it's better to use SQL Server 2017 Import and Export Data 64 bit. 

    and all of the sudden strange configuration errors, drivers lack error, ODBC driver error had leave me. 

    So, one of the … more