Thursday, 25 March 2021

 

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape


Solution:

We can use one of the three following solutions to fix your problem:


1: Just put r before your normal string it converts normal string to raw string:

pandas.read_csv(r"C:\Users\DeePak\Desktop\myac.csv")

2:

pandas.read_csv("C:/Users/DeePak/Desktop/myac.csv")

3:

pandas.read_csv("C:\\Users\\DeePak\\Desktop\\myac.csv")

Friday, 5 March 2021

cannot import name 'delayed' from 'sklearn.utils.fixes' - Google CoLab

 For Below Error 

Shows "ImportError: cannot import name 'Imputer' from 'sklearn.preprocessing' (/home/codeknight13/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/__init__.py)"

Sometime After PIP also doesnot work.

Fix : Actually the fix is very Simple. After every install we need to restart the Google Runtime.



Thursday, 4 March 2021

Finding Statistical Mode from 2 String Column of a Different Table using SQL

Lets Assume We have Below Two Tables

Table One 

Table1

ID   | EVENT

1     | Birthday

1     | Marriage

1     | Dance

2     | Birthday

2     | NONE

1     | NONE


Table2

ID   | EVENT

1     | Birthday

1     | Birthday

1     | None

2     | Birthday

2     | NONE

1     | Birthday


Task1 : is to find Mode from both tables for ID='1' Which should result 'Birthday' as this occured 4 times in Both Table.

Task2 : ignore all 'NONE' values

Task3 : if Mode is combination of Multiple Event value than place them as comma separated.


The Query :


select wm_concat(EVENT) as EVENT

FROM (

select  EVENT 

FROM

    (select EVENT , COUNT(EVENT) AS cnt1 from (

 select EVENT from TABLE1  

     Where EVENT!='NONE' AND ID ='1'

UNION ALL

select EVENT  from TABLE2  

     Where EVENT!='NONE' AND ID ='1' GROUP BY  EVENT)

WHERE cnt1 = (SELECT MAX (cnt2) FROM (select COUNT(EVENT) AS cnt2 from (

select EVENT from TABLE1  

    Where EVENT!='NONE' AND ID='1'

UNION ALL

select EVENT  from TABLE2  

    Where EVENT!='NONE' AND ID='1')GROUP BY  EVENT)))) 

Sunday, 13 September 2020

Eclipese Decompiler 2019-09 and beyond

 What is Java Decompiler?

It is a computer program which converts the class files in to Java source code, in a user friendly format.

How to install it in Eclipse?

In eclipse we need to go to Help -->  Eclipse Marketplace --> type search "decompiler"

next: select and install Enhanced Class Decompiler 3.1.1 or greater from the list


 Now Make it Work 

This step works in eclipse oxygen and later versions..

Click on "Windows--> Preferences --> General --> Editors --> File Associations"

Change default viewer to .class files, means

"*.class" : "Class Decompiler Viewer" is selected by default.

"*.class without source" : "Class Decompiler Viewer" is selected by default.




Sunday, 12 July 2020

IntelliJ Idea 2020.1 & SVN Plugin

Below are the steps to configure SVN correctly in IntelliJ IDE..

After Installing Intellij you can find the subversion plugin like below 

Press ctrl+alt+s or open settings-->Plugins and type svn



The plugin says it requires command line svn client which means it require a svn.exe files.

When we use TortoiseSVN most of the time we install it with default setting where default settings don’t install the svn.exe rather it uses a console svn client



Please install TortoiseSVN like below (Select command line client tools)


                                              You can find svn.exe in your installed folder





Issue : 


'C:\Program' is not recognized as an internal or external command, operable program or batch file. 


We need to correct the Path variable.

 

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk1.8.0_202:C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseSVN\bin\svn







Monday, 5 February 2018

Croma TV and Xiomi Mi Remote

I spent quit some time trying to pair my Croma TV and mi mobile infrared remote.

So the problem is by default Croma brand is not available in the list so choose vu brand.

Although for me still volume button and channel change button is not working.

Hope this will be useful to someone and also hope that someone have a better answer.

Friday, 10 June 2016

ATG 11.2 Rest MVC API Configuration, example of using it in profile module using Advance Rest Client Application

In general, a REST Web Services exposes data and function resources through the use of Uniform Resource Identifiers (URI). HTTP methods are used by the REST services to point to a resource like Form Handler, Droplet, Components, Methods, JSP etc.
Rest API makes the application client platform independent and mobile development ready as REST clients may be accesses from any browser, and security can be configured for each call.

ATG Rest MVC support GET and only POST method although Legacy REST Support PUT and DELETE but in ATG 11.2 it recommended to use only ATG REST Web Services.

Installing and Configuring the REST MVC
                Installation of the REST MVC module can be done using Oracle Commerce Platform Configuration and Installation Manager (CIM) or CRS mobile store selection while installing CRS 11.2 will install this folder.
Below a Screen Shot from CIM


After Installation you can check ATG REST Module in your ATG installation folder


In your Base module add REST on ATG-Required in MANIFEST file


When you build your ear you should find atg-rest-web1.0.war as below


Enabling REST Services
For security reasons, when you install the REST MVC module, none of the REST services are enabled. To enable a service, you should follow below steps.

1.       Disable enforceSessionConfirmation in atg/dynamo/service/actor/Configuration.propertes. This is require to enable the development mode.



You can find this file inside your atg 11.2 installation.


Second important file is ActorChainRestRegistry.properties. We can call only registered service in this file


You can find this file in your ATG 11.2 installation folder


Third important file is beanFilteringConfiguration.xml which used to map and render your output.


We can find this file in ATG 11.2 folder a below.


Lets now add Profile Actor to enable basic functionality of Login, Logout, Create, Edit

Add the ProfileActor.properties to your working codebase to enable future customization.


You can find this file at


Add the profileActor.xml in to your working codebase for future customization. Like repositories the xml append should work but I did not tested yet.


You can find in your Installation folder as below


Configure your ProfileFormHandler.properties as per your requirement




How it work and example    
Through Advance Rest Client (ARC) extension you send XML or JSON to the profile Actor it actually call the profile form handler’s handle methods and send result success URL or errors and Error URL.


Example
Lets log in using the rest API



  SyntaxError : (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape Solution:...