Wednesday, December 30, 2020

Extracting structure failed --- Error while importing SBT project

 I have used the following plugin

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2") 

 Got the following error.


When  i change the plugin version to the following then everything is working fine.


addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2")

view the library dependencies (as you would with Maven) rather than the task dependencies (which is what inspect tree displays)

 If you want to actually view the library dependencies (as you would with Maven) rather than the task dependencies (which is what inspect tree displays), then you'll want to use the sbt-dependency-graph plugin.

Add the following to your project/plugins.sbt (or the global plugins.sbt).

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2")

Then you have access to the dependencyTree command, and others.



Sunday, November 29, 2020

7 Ways to improve your programming skills

 In this era of continuous advancements in the software industry, it is important for coders to focus on the improvement of their programming skills. Upskilling, reskilling, and practice are some of the few options that software professionals follow to keep pace with the rapid improvements. If you aspire to become a successful programmer, imbibe the below-mentioned tips that will help you enhance your programming skills precisely.


1. Improve your learning method
Learning is an art and this art is a quality in some from birth while the rest of the population earns it. As a programmer, you might feel overwhelmed from the similar problem solving tasks. Therefore, it is necessary to include entertaining techniques to learn effectively like flashcards, online quizzes, algorithmic puzzles, designing creative apps etc. Always give yourself time to remember the concept rather than just referring notes. Enjoy coding or you will feel burdened by the concepts.

2. Gain fluency in debugging
Debugging is an integral part of programming. When a programmer compromises basic concepts of debugging, they waste precious time and efforts on searching bugs. This is why, debugging techniques including divide and conquer, and proper usage of logs and debuggers should be crystal-clear in your head.

3. Read other developer’s code
Before considering yourself a master already, see how a master creates a code. In simple words, browse through GitHub repositories, learn how other developers have written their code and make your own judgement on how to add quality in the code. This is how one can master coding.

4. Write readable code
As stated by Martin Fowler, “any fool can write code that a computer can understand. Good programmers write code that humans can understand”. A good programmer should write code that are readable and understandable as -
  • It will help you debug your code easily
  • It will allow other developers to understand your code effortlessly.

5. Work on projects
Search for an app to build, learn how to get started, and work on it. I am not asking you to add quality but at least challenge yourself and see how bonded you are with coding concepts. You will be able to judge your weak points and get a chance to improve.

6. Master one tech stack
Trying to learn every other tool, framework, and programming language is good for professionals who have just begun their career. However, once you have gained familiarity with almost all professional tools, it is recommended to pick one technology stack and master at it. Proficient professionals can attract excellent and startling opportunities.

7. Have curiosity
Your curiosity to learn more and more may get you hired. A good recruiter hires candidates who can contribute to the company's long-term growth rather than the one who plans to use the known skills on


Reference:

Friday, November 27, 2020

Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.SparkSession

 problem

Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.SparkSession
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass
Solution:
change the scope of all the spark dependencies from provided to compile

Extracting structure failed sbt task failed, see log for details

 Step 1: 

we have check the installed sbt version . 

  if sbt installed version on out laptop is say : 1.3.13 

[info] welcome to sbt 1.3.13 (Ubuntu Java 11.0.9.1)


then we have to use the same version in  build.properties in  sbt project in Eclipse or IntelliJ


when both are same , we will not get the mentioned error.


first Time when we are compiling sbt better to use  command line .

like : 

Need to run the following commands in the same sequence.

sbt 

clean

complie   



Friday, October 30, 2020

Hortonworks Change Ambari Admin Password

Note Here :  

userName: root

Password: hadoop

current User Password: hadoop

new Password:  sometthing

change ambari admin password:


ambari-admin-password-reset 


new Password: admin

Retype new Password: admin 



Monday, October 5, 2020

What interesting code can you teach a non-technical person in less than 5 minutes?

 


  1. Open chrome window.
  2. Open Quora or Amazon or any site that you like.
  3. Open developer's tool in chrome (If you don't know then press Ctr+Sft+I).
  4. Go to Console.
  5. Write document.designMode = "on"
  6. Start editing web page.

Sunday, October 4, 2020

LO writer: how to view side-by-side table of content and document?

 

You can use the Navigator for that. It is the "compass" icon in the sidebar. You can place the sidebar outside the document window if you like that. First drag it, so that it is floating. Then drag the floating sidebar outside the document window. Open the part "Headings". A double-click on the heading sets the cursor to that heading. You can reach other parts of the document easily too.



For those, like me who didn't know where is "compass", it's under the Edition menu or F5.


Further, do you know how to toggle it, aka it expends when you hover on it, otherwise it folds down?

Tuesday, September 8, 2020

How do implicit work in Spark/Scala ?

Q: 

Here is a sample Spark code, which converts the Seq to the Dataset:

import spark.implicits._
val s = Seq(1, 2, 3, 4)
val ds = s.toDS()

The Scala Seq does not have the toDS method, it comes from Spark implicits. How is the Dataset created here?

A:

Scala has a way to add methods to existing classes, like extension method in Kotlin (and C# as I remember), but does it in a different way, through implicits.

To add the method to existing class, you first create implicit class:

object StringImplicits {
  implicit class StringUtils(s: String) {
    def someCoolMethod = println("Yooo")
  }
}

object Application extends App {
    import StringImplicits._
    val s = "Hello"
    s.someCoolMethod
}

You import this StringUtils and can call someCoolMethod on instance of String

Notice that StringUtils class takes String as a constuctor param.

When calling some method on String, scala compiler first looks this method in String class.

If it does not find it, it will look imported implicit classes which take String param.

If found, it calls the method from that class.

If no such class found, it will raise the error.


Monday, September 7, 2020

PDF to word conversion software?

 Download Abiword from Ubuntu Software Center or you can install it by typing following command in terminal:

sudo apt-get install abiword

Then perform the conversion:

abiword --to=doc example.pdf
OR

Install AbiWord from Ubuntu Software Center

Open Pdf Files with it.

Use Save As.. to save pdf in Word Doc format.

Its this easy :)

Friday, September 4, 2020

Formula to Read and understand properly and remembers more time, Revision at some intervals , Analytical Skills , Problem Solving Skills

Formula to Read  and understand properly and  remembers more time, Revision at some intervals , Analytical Skills , Problem Solving Skills 


I => Imagination - Imagine everything.(if image and source are mostly same then we can consider source as image, Image may be clear image or if clear image is not there then we will create some image for as of now. Letters are also some short of images. Imagination will be Clear Image and  Letter Images combination Or Only Clear Images Or Only  Letter Images )

L=> Linking the images (If we miss the linking between the images , then we we can not explain very well.)

P=> Identify the positives

N=>Identify the negatives

R=> Real Life Usage - Need to get at least one real life usage . 

N=> Notes

  • This is helpful to revision and to explain to others(if possible we must draw our image and show them to understand better.
  • If most((90%-mind will determine this) of the point of a topic are unknown or Image linking is missed then we can draw the images(if we have more time or possible to draw )
  • if Our Image and the Real image is same then need not to re draw the same again(wish).

E => Excellent but Not Enough => Try to improve the existing .

T=> Teaching to others with the Drawn Imaginative Linked Images.

Revision at some intervals (Hour wise , day wise  and month wise)


Practice Practice Practice........


Reading Skills : Imagination, Linking images, Positives, Negatives , Real time usage,Notes,Teaching

RevisionSkimming , Scanning ,Detailed Revision on any topic (mind decide)

Analytical skill is the ability to deconstruct information into smaller categories in order to draw conclusions (with the help of problem solving skill).

Problem solving skill is to identify all the participants and understand each participants positives and negatives and apply design thinking (create more ideas and pick the best one , create prototype and test it)








Monday, August 31, 2020

How to Convert Documents to PDF Format on the Ubuntu Command Line

 

Convert a single file to PDF format

Use the following command syntax in order to convert a single file located in your current directory:

$ lowriter --convert-to pdf filename.doc

For .docx files,

$ lowriter --convert-to filename.docx

Here is how I converted a .docx file to pdf. located in my Downloads folder.

Convert a single docx file to PDF on Linux

As you can see above, when I listed the contents of my current folder through the ls command, I could see the newly converted pdf file listed as well.

Saturday, August 22, 2020

Not able to access redshift Cluster in SQL Work Bench ? Solution is here.

 Go to AWS Redshift Dashboard.


Now Check for properties of the Cluster.



Now find the Network and Security tab 



Make sure that you have enabled 


Publicly accessible   Edit
Allow instances and devices outside the VPC connect to your database through the cluster endpoint

Yes

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...