Monday 1 October 2018

Angular Issue being faced


ERROR Error: Found the synthetic property @fadeInOut. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.

  1. Imported BrowserAnimationsModule in app.module.ts
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
  1. Added to imports in app.module.ts
imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    routing,
    Ng2SmartTableModule,
    TreeModule,
    BrowserAnimationsModule
  ]

ERROR Error: Found the synthetic property @fadeInOut. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.

Replaced MaterialModule with MaterialModule.forRoot()


 

TS2428: All declarations of 'WeakMap' must have identical type parameters.

  Use below dependencies in package.json     "lodash": "4.17.4",    "@types/lodash": "^4.14.110"

Sunday 11 February 2018

Tenser Flow


1. Set up TenserFlow on system https://www.tensorflow.org/mobile/tflite/


Start Machine Learning using Tenser Flow



  • https://www.tensorflow.org/get_started/get_started_for_beginners
  • https://machinelearningmastery.com/introduction-python-deep-learning-library-tensorflow/
  • https://pythonprogramming.net/tensorflow-introduction-machine-learning-tutorial/
  • https://www.youtube.com/watch?v=uh2Fh6df7Lg
  • https://www.youtube.com/watch?v=2zWSr-3gkWY

TenserFlow Wrapper for Java

  • https://www.tensorflow.org/install/install_java

Learn Python 


  • https://www.youtube.com/watch?v=Vxw1b8f_yts
  • https://www.python.org


Download Python 

  • https://www.python.org

Machine Learning can be categorized into three parts

  • Supervised Learning
  • Unsupervised Learning
  • Reinforcement Learning

Wednesday 15 February 2017

    Creating Circular referencing in Hibernate



There are situations when we need to create tree json. For that we need to create self join on the same Entity to make Parent child relationship on same entity.

Following is the  example:

            @Entity
            @Table(name = "tree")
             public class Tree implements Serializable {

                  private static final long serialVersionUID = 663408095532480033L;

                  @Id
          @GeneratedValue(strategy=GenerationType.AUTO)
                  @Column(name="id")
                   private String id;

                  @Column(name="fruit")
                  private String fruit ;

                 @ManyToOne
                 @JoinColumn(name="child_id", nullable=false)
                  private Tree rootId;

}

When you will try to retrieve the following entity you will get Child First and inside it will get parents.

In order to retrieve parent first and then inside get childs following should be the structure.


            @Entity
            @Table(name = "tree")
             public class Tree implements Serializable {

                  private static final long serialVersionUID = 663408095532480033L;

                  @Id
          @GeneratedValue(strategy=GenerationType.AUTO)
                  @Column(name="id")
                   private String id;

                  @Column(name="fruit")
                  private String fruit ;

                 @ManyToOne
                 @JoinColumn(name="child_id", nullable=false)
                  private Tree rootId;

                 @OneToMany(mappedBy=rootId)
                 private List<Tree> children;

           }

Here when you will return the entity to frontend user issue of infinite json refrencing will come in order to resolve the issue need to add json annotations in entity that is following :

            @Entity
            @Table(name = "tree")
             public class Tree implements Serializable {

                  private static final long serialVersionUID = 663408095532480033L;

                  @Id
          @GeneratedValue(strategy=GenerationType.AUTO)
                  @Column(name="id")
                   private String id;

                  @Column(name="fruit")
                  private String fruit ;

                 @ManyToOne
                 @JoinColumn(name="child_id", nullable=false)
                 @JsonBackReference
                  private Tree rootId;

                 @OneToMany(mappedBy=rootId)
                 @JsonManagedReference
                 private List<Tree> children;

           }

Enitity would return the  following Json:

[
  {
    "id": "1",
    "fruit": "ROOT",
    "child": [
      {
        "id": "2",
        "fruit": "CHILD",
        "child": [
          {
            "id": "3",
            "fruit": "CHILD1",
            "child": []
          }
        ]
      }
    ]
  },
  {
    "id": "4",
    "fruit": "Root",
    "child": [
      {
        "id": "5,
        "fruit": " Root Child 1",
        "child": [
          {
            "id": "6",
            "fruit": " Root Child 2"
            "child": []
          }
        ]
      }
]

Hope this will help happycoding. :)

Wednesday 19 October 2016

HOW TO CREATE USER AND ROLES  ON JASPER SERVER


To access reports on JasperServer we need to have a user account which includes ID and Password.
Roles are created to determine which user can access which repository.User can have multiple roles.

An administrator can create roles and users on JasperServer and assign roles to user.Set roles permission on repository .


 Creating Roles

 Following are the steps to create roles :

 1.) Login to jasperserver admin account.

 2.) Select manage role then click on add role.

 3.) Enter the desired role name.






If existing role is selected then users assigned to the role gets listed out.


Creating Users

On Home page go to Manage select add roles.

Following are the steps to create new users .

1.) On Manage Users page click Add User.

2.) Enter the desired UserName,UserPassword,UserId,ConfirmPassword and ResetPassword.



Click the enable user check box.

3.) Click on Add User Now the User will appear in the User list.

4.) Repeat the steps for adding new Users.

Assigning Users

Following are the steps to assign users:

1.) From Home Page go to Manager -> Users.

2.) Select the desired User from the list and click on edit button.



3.) After clicking on Edit in the ROLE section two panes will open up. ROLES AVAILABLE and ROLES ASSIGNED.
    Select the ROLE FROM Available and click on Arrow if you want to assign the role.
    Select the ROLE FROM Assigned and click on Arrow if you want to deassign the role.



4.) Click on Save .Repeat the steps to add additional users.


Hope the above article helps. :)








Monday 11 April 2016

               Lock time seconds issue in JasperServer

 
 
When we have a report deployed on JasperServer holding millions record .While exporting this report it takes more than 90 seconds to export which is the default time to load in Jasper in this case Error: Unable to acquire conversation lock after 90 seconds comes.
 
 
1.) To Resolve this issue we have to change internal configuration settings of Jasper i.e xml files.
 
 
2.) Open WEB-INF/jasperserver-servlet.xml  in Apache-Tomcat folder.Make change in follwing line :
 
<property name="lockTimeoutSeconds" value="90"/>
 
 Change the value field here
 
 
3.) Save changes and restart JasperServer.

Tuesday 13 October 2015

How to resolve issue Drop ,Delete ,Alter commands taking long time?

 

Why this issue arises ?

This is probably due to Metadata locking .It is most common to see table gets struck in "Waiting for Metadata Locks". ..It comes basically due to some uncommitted Transactions.

Solution

In order to resolve this first we should wait for sometime for transaction to complete that might be using that table.If it is taking very long time then following are the steps to resolve this :

1.) Login Mysql 
     mysql -u root -p 
     ******

2.) RUN  

     Show Full Processlist.
     (Here you will get list of transactions that are creating lock on other transactions )

+-----+------+-----------+-------------------+---------+------+-------+------------------+
| Id  | User | Host      | db                | Command | Time | State | Info             |
+-----+------+-----------+-------------------+---------+------+-------+------------------+
| 404 | root | localhost | example           | Sleep   | 297  |       |                  |
| 410 | root | localhost |                   | Query   | 0    |       | show processlist |
+-----+------+-----------+-------------------+---------+------+-------+------------------+
 
Here process 404 is creating lock on other transactions.

3.) kill process 404 by running:

      kill 404

4.) If above process kill doesn't works then you can go for killing other processes as mentioned in  Step 3.

5.) Now try executing Drop ,Delete,Alter or any command it would now work correctly.



Above approach is a better approach instead of MySQL server restart.



Hope the above solution works .Looking forward for your questions and suggestions ..  :)

Tuesday 18 August 2015

Create Routines in Jasper ETL  

 

What are Routine ? 

Routines are habits which do not change and are repeated every time . In Jasper ETL Routines are Java Methods or reusable code that are required generally in Jobs for manipulating data.

Below are the list of default System Routines present in Jasper ETL.


Creating Custom/User Defined Routines   

There could be a point when we would require to create our own methods and classes to transform data in our jobs.In that case we could create our own Routines also known as User Defined Routines.
Below is the procedure to create user defined routines :-

a.) Right Click Routines inside Code and click on Create Routine.

  b.) Normaly Create a Java Class in any IDE or Notepad which ever is better for you.

       For e.g Here is the code I first wrote in NetBeans to convert any timezone to UTC

c.) Paste the same code inside the Routines window opened and save it.


d.) No you could continue to use this method in your jobs.Inside Categories select User Defined you will see the method created by you.
     


NOTE : Always declare custom  Methods as Public Static so that it could be accessed publicly and shown inside User Defined option.

Hope you find this article helpful :) .