Posts

Java Data Base Connectivity (JDBC) with MongoDB

Lets first start with some basics of MongoDB. What is MongoDB? MongoDB is document-oriented NoSQL database. This is a collection of documents where data is stored in the form documents, unlike old SQL systems where data is stored in the form of tables. Here each document consists of the key-value pairs which are the building block of the NoSQL database. The data is stored in documents in the key-value pairs.  example: { "first_name":"Ambarish", "last_name" :"Dashora" } So basically the data is stored in the JSON format called documents in MongoDB. Now we are here to connect, create, access, and modify collections and documents of MongoDB using java. So let's get started. First of all, we will learn how to set up a MongoDB client driver for java. I am assuming that you have installed MongoDB on your system. If not then download and install it from this link:   MongoDB . Get M

Generator function and Comprehension in Python

What is 'Generator Function'? Every function of python which has a keyword 'yield', written in it at least one time is a generator function. for example: # xyz is Generator Function as it has yield written in it. def xyz (): x = 1 print ( "1st yield" ) yield x x += 1 print ( "2nd yield" ) yield x x += 1 print ( "3rd yield" ) yield x #When we call xyz then it will return the reference of gnerator class a = xyz () print ( "Type of object in a=" , type ( a )) for i in a : print ( "value of i=" , i ) Output: Type of object in a= <class 'generator'> 1st yield value of i= 1 2nd yield value of i= 2 3rd yield value of i= 3 When we will call xyz function (Generator function) then it will return the reference of generator type of object.

Designing a function of python which can accept variable number of arguments

In this post, we will know how to make a function in python that can accept any number of arguments. To make a function with variable arguments the syntax is *arg. When a function is written with a parameter having * before it then that function can take any number of arguments in the form of a tuple. The parameter of a function having * before it will get the arguments in the form of a tuple of all the arguments. Below is the example which illustrates it: EXAMPLE-1 1 2 3 4 5 6 7 8 9 10 11 12 #Created a sum function with an star before its parameter def sum ( * arg): sum =0 print ( type (arg)) for i in arg: sum += i return sum a = sum ( 10 , 20 , 30 , 40 ) print ( "a=" ,a) b = sum ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ) print ( "b=" ,b) output:  <class 'tuple'> a=100 <class 'tuple'>

PROJECT-2 Picture Modifier

Image
Picture Modifier Picture Modifier is a desktop application created using java. It is an image editor with various features to edit an image. This application has been made using inbuilt libraries of java and its user interface has been made using java swing and Java AWT. Before we move further here is the video which shows how this application works. Features of this Application: It can modify RGB (Red, blue, green) components of an image by sliding the bar of the intensity of each component. It can modify the contrast and brightness of the image. Using this we can zoom in and zoom out to resize the image and we can rotate an image by 360 degrees. There are various filters available for the image like Grayscale, negative image, pencil art, dot portrait, etc. How to install this application: Go to this GitHub repository:  Picture Editor - gitHub   Download the zip file of this and extract it to your desired folder. In the classes folder, there is a file named opencv_java420.rar, extrac

PROJECT 1 DerbyDB Creator -SQL scripting tool for Apache Derby

Image
'DerbyDB Creator' is a SQL scripting tool with Graphical User Interface for Apache derby databases.  Apache derby is an RDBMS (Relational Database Management System)  developed by the  Apache Software Foundation  that can be embedded in  Java  programs.   The core of the technology, Derby's database engine, is a full-functioned relationally embedded database-engine, supporting JDBC  and SQL  as programming APIs. Before we move further Have a look at this video which shows the functioning of DerbyDB Creator 1) What is DerbyDB Creator? DerbyDB Creator as a Graphical User Interface to access databases of apache derby and modify the databases by providing various SQL commands for the apache derby database. It is a replacement for 'ij' command-line tool of Apache org. This application has been created using JDBC(Java Database Connectivity) and the interface is created using Java Swing and Java AWT