Here I document some issues for searching of which I spent more then 15 minutes

  • Kaggle competition attempt. Not successful

    Greetings everybody,

    here I want to preserve for future usage my code which I've used to train model for one of Kagglecompetitions:

    1 package org.deeplearning4j.examples.convolution;


    3 import;

    4 import;

    5 import org.deeplearning4j.datasets.iterator.BaseDatasetIterator;

    6 import org.deeplearning4j.datasets.iterator.FloatsDataSetIterator;

    7 import org.deeplearning4j.datasets.iterator.impl.ListDataSetIterator;

    8 import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;

    9 import org.deeplearning4j.eval.Evaluation;

    10 import org.deeplearning4j.nn.api. … more

  • How to create learning set for neural network in deeplearning4j

    Hello everybody,

    today I want to document one simple feature of Deeplearning4j library. Recently I had an assignment to feed into neural network for Deeplearning4j.

    If your learning set is not big ( later I'll explain what big means ) then you can put all your data into INDArray and then based on that you can create DataSet. Take a look at fragments of

    1 // list off input values, 4 training samples with data for 2

    2 // input-neurons each

    3 INDArray input = Nd4j.zeros(4, 2);


    5 // correspondending list with expected output values, 4 training samples

    6 // with data for 2 output-neurons each

    7 INDArray labels = Nd4j. … more

  • How override Persist method in Acumatica

    Hello everybody,

    today I want to show sample of code on overriding Persist method in Acumatica. 

    Consider following scenario, you need to modify saving logic of screen Purchase Orders in Acumatica. How you can achieve this? Following steps can help you to do this:

    Create extension class for POOrderEntry

    Override Perist method

    Both of those details implemented below:

    public class POOrderEntryExt : PXGraphExtension<POOrderEntry>



        public void Persist(Action del)


            //Here you can add some of your code that should be executed before persisting PO Order to database




    With such simple steps you can modify persisting … more

  • Normalization formulas for neural networks

    Hello everybody,

    today I want to write a short note about normalization for neural networks. 

    So, first goes formula how to normalize input in range [0, 1] ( taken from here ): 

    Another good for me example is going below ( taken from here ):

    p = [4 4 3 3 4;

    2 1 2 1 1;

    2 2 2 4 2];

    a = min(p(:));

    b = max(p(:));

    ra = 0.9;

    rb = 0.1;

    pa = (((ra-rb) * (p - a)) / (b - a)) + rb;

    In this example ra stands for maximum value of range, rb stands for minimum value of range that we want to make. 


  • How to read little endian file of floats in Java

    Hello everybody,

    today I want to document another issue that took from me plenty of time. Recently I've used following code in Python in order to save array of numpy numbers:

    import numpy as np

    newImage = ...some way of getting array

    np.ndarray.tofile(newImage, newFn)

    But when I tried to get that content in Java code, I faced issue that my inputs where unreadable by Java. After spending some time over net I've found that Python uses little endian encoding, while Java uses another encoding for saving floats. 

    So my research of little endian gave me the following code result in java for reading little endian:

    InputStream inputStream = null;DataInputStream dataInputStream = null; … more

  • How to hide tab in Acumatica

    Hello everybody,

    today I want to share piece of knowledge about Acumatica controls. Recently I was asked to add one more tab to page Checks and payments.

    Let's suppose it was named Allocations. It should be displayed only if type of payment is set to Prepayment.

    Such kind of behaviour is possible to implement via three steps:

    Add tab with name Allocations

    Set VisibleExp to the following: 


    Set BindingContext to the form like this:


    Or just more detailed picture:


    <px:PXTabItem Text="PO Allocations" VisibleExp="DataControls[&quot;edDocType&quot;].Value==PPM" BindingContext=" … more

  • DeletedDatabaseRecord in Acumatica

    Hello everybody,

    today I want to write few words about interesting feature of Acumatica: column DeletedDatabaseRecord. As you may know plenty of ERP systems have strategy of holding everything that ever passed through them, and even if user has huge desire to ask ERP system to forget something via deletion of some entity, ERP "pretends" that record was deleted, but leaves it in db. 

    From this standpoint Acumatica can be exception. It allows to preserve records that lived inside of it. Allows mean can preserve or not preserve. 

    How programmer can achieve this kind of behaviour? Via column DeletedDatabaseRecord. 

    If you want Acumatica to hold some kind of entities in db, just add this … more

  • Multithreading in Acumatica

    Hello everybody,

    today I want to say a few words about my practice of usage Multithreading in Acumatica. I have a dedicated server which has 40 cores. And I have a need to read plenty of records from some other system. General schema is like this:

    Create some graph instance.

    Fill created graph instance data views with needed data

    At created graph instance call method graphInstance.Actions.PressSave();

    And that schema is perfectly workable, but for my disappoitment my 40 cores were not busy at all with doing something useful. So I had to figure out how to use them more fully. 

    Here are some fragments of code that I've used:

    int numberOfLogicalCores = Environment. … more

  • Some notes on Buttons creation in Acumatica

    Hello everybody,

    today I want to write few words about buttons usage in Acumatica.

    So, first of all, if you just need to add button at your form, you can use following syntax:

    public PXAction<PrimaryDACClass> SomeAction;

    [PXButton(CommitChanges = true)][PXUIField(DisplayName = "Some Action")]protected virtual void someAction(){      ...}

    Following syntax will create a button for you in the top buttons panel of Acumatica.

    Take note of CommitChanges=true attribute. In case if you need just some activity without persistance to database, then you can set it to false. But if you want button to save some changes to database then set it always to true.

    There is one more way of declaring … more

  • How to make back up of db smaller in MS SQL

    Hello everybody,

    today I want to document one hack that preserved me plenty of space on my hard drive.

    Recently I've tried to make back up of production database and was shocked to see that it had almost 200 Gb on my hard drive.  So it made me wonder how can I have smaller backups. 

    And here is the solution.

    In Microsoft SQL Server Management Studio click on database, and choose new query

    enter there following command: sp_configure 'backup compression default', 1

    then this: reconfigure WITH OVERRIDE;

    After such manipulations I've got back up that had only 27 Gb. more

General information

Greetings to everybody stopping at my blog. Purpose of this web site is to be google of my brain. Everything I found useful, or of possible beneficial for usage in future I've save here at this blog

Contact information

If you want to contact me more on any subject printed at this web stie, you can email me: zaletskiy(at)

Job information

If to speak in general, I'm developer. For now I work as team lead in company GlobalLogic.