Sunday, 19 July 2020

Deep Learning Network explanation



I prefer to read the scientific paper a lot, But here is the blog which I refer to anyone who is interested.
The blog provides the following.
1. Working
2. Architecture
3. References


Blogger : swethatanamala very good explanation of Deep learning network.

ref: https://developers.arcgis.com  


 

Tuesday, 30 June 2020

Start with computer vision

Basic to start with computer vision.


1. "Computer Vision: A Modern Approach"
2. "Computer Vision: A Modern Approach"

Credit: wlouyang

I would like to appreciate Mr wlouyang for sharing basic knowledge to kick start in computer vision.



Tuesday, 19 November 2019

check shape of array in numpy and tensorflow

Numpy : its a python module/package to perform scientific computation on arrays.

How to install numpy package in anaconda

>> pip install  numpy

or

>> conda install numpy

To check if numpy package is  installed or not use

>> conda list
output :
>> numpy                     1.14.2

Once the package is installed you can import into you application

ex : import numpy

Basic numpy operation on Array :

>>> input = np.array([[1,2,3],[2,3,4]])
>>> input.shape
>>> (2, 3)


Ex : In digit recognition using tensorflow we can get shape

import tensorflow as tf
mnist = tf.keras.datasets.mnist
import numpy as np
print( tf.__version__)
(x_train, y_train),(x_test, y_test) = mnist.load_data()

print(x_train.shape);
>> (60000, 28, 28)
print( x_train[0].shape)
>> (28, 28) 


Note :
1. Tensorflow | keras| framework is used.
2. Mnist database for digit recognition

Sunday, 28 October 2018

Recreational Music Making (RMM) for Working Adults


Recreational Music Making (RMM) has been scientifically proven to help the U.S. workplace by:
Reducing employee stress
Reducing employee depression
Reducing employee burnout
Improving employee retention
  • Employee stress is expensive for companies and widespread. Research shows that the economic impact is estimated at $300 billion each year (Source: New York Times). Experts claim that 60 to 90 percent of doctor visits involve stress-related complaints.
  • Engaging in RMM reduces stress. RMM has been shown to reverse the body’s response to stress at the DNA level (Source: Dr. Barry Bittman).
  • Depression is widespread in the workforce and is expensive for companies. The economic impact of depression in the workplace is estimated at $34 billion annually—$11 billion for treatment, $11 billion in decreased productivity, and $12 billion in absenteeism. Depression affects about 19 million people, 70 percent of whom are in the workforce. (Figures are according to Braun Consulting News).
  • Engaging in RMM reduces depression. Recent research with long-term care workers showed reduced depression (21.8 percent) six weeks after the completion of an RMM program consisting of one hour per week. (Source: A 2003 study conducted by Trip Umbach Healthcare Consulting, Inc.)
  • RMM can help companies reduce turnover, saving them millions. The research with long-term care workers showed an 18.3 percent overall reduction of employee turnover by implementing an RMM program. The total annual savings was projected at $1.46 billion.
Every worker can participate in RMM. There are no physical limitations or requirements.

OpenCV - cannot find module cv2


Solution :

Step 1 :
$ conda update anaconda-navigator
$ conda update navigator-updater

Step 2:
$ pip install opencv-python

or

conda install opencv

Ref: StackOVerflow

Note : The above solution is tried on ubuntu 14.


Thursday, 25 October 2018

Machine learning

Start the course with  following list of Lectures.

1. Machine Learning | Andrew Ng

2. cs321n 

Monday, 24 April 2017

Set font style in a table for a row. in apache poi


XWPFTable table = document.createTable();
XWPFTableRow row = table.insertNewTableRow(0);
XWPFRun run = row.addNewTableCell().addParagraph().createRun();
run.setBold(true);run.setText("Your Text");

ref : how-to-format-the-text-in-a-xwpftable-in-apache-poi

Tuesday, 11 April 2017

Monday, 28 November 2016

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

if you create a Debug configuration from your product file, in my case CDOServer.product, then
1. you go an select the Plug-ins tab in the Debug Configuration
2. then click "Add Required plug-ins"

it may build a dependency that just does not work.

It seems you have do step 1 above, then
2. "Deselect All"
3. Select your own package
4. Click "Add Required plug-ins" a few times until the number of required plugins stop increasing, see the display "x out of y selected"





ref : Eclipse

Could not resolve archetype

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.

Go to your Maven installation folder C:\apache-maven-3.1.0\conf\ ( For example: here we have installed maven in c:\ drive)
Copy settings.xml to C:\Users\[UserFolder]\.m2 (Your local repository)
Modify the proxy in settings.xml based on the info that you get from the above link.

or delete the repository folder from .m2 folder

and restart the eclipse with default maven setting

Ref : javahonk, Git



your install of php does not have the 'php_curl.dll' extension enabled

your install of php does not have the 'php_curl.dll' extension enabled


Open your php.ini file and set the following setting to a Windows file path:

extension_dir = "X:/path/to/your/php/ext"




Java was started but returned exit code = 1

“Java was started but returned exit code = 1”

go to the eclipse dir and edit eclipse.ini

just before -vmargs paste the following path of the jvm

ex :
...
-vm
C:\path to installed direc \Java\jre1.8.0_40\bin\server\jvm.dll


-vmargs

Wednesday, 16 November 2016

Getting started Jersey.

1. Project build and management configuration is described in the pom.xml located in the project root
directory.
REF : pom elements
2. Project sources are located under src/main/java.
3. Project resources are located under src/main/resources.
4. Project web application files are located under src/main/webapp.

5. To compile and package the application into a WAR, invoke the following maven command in your
console:

ex : mvn clean package

logs :

Packaging webapp
[INFO] Assembling webapp [simple-service-webapp] in [.../simple-service-webapp/target/[INFO] Processing war project
[INFO] Building war: .../simple-service-webapp/target/simple-service-webapp.war

Now you are ready to take the packaged WAR (located under ./target/simple-servicewebapp.
war) and deploy it to a Servlet container of your choice.

Jersey dependency maven :

1) jersey-server, jersey-json, jersey-multipart.

Spring dependency :

spring-core,context,context-support,web,aop.

spring security.

security-web,security-config,security-taglib,security-core,security-acl

spring+jersey

spring,core,web,beans,context,asm,aop.

jackson:

jackson-jaxrs-json-provider


apache commons :

utility for string manipulation

connection pool :

dbcp

Apache-commns :

Apache Commons Codec provides implementations of common encoders and decoders such as Base64, Hex, Phonetic and URLs.

Hibernate :

hibernate-core

spring-transaction:

REF : transaction   why we go for spring transaction

hibernate entity manager
table mapping

spring-orm



6. Root Resource Classes
Root resource classes are POJOs (Plain Old Java Objects) that are annotated with @Path

7. @Produces
annotation is used to specify the MIME media types of representations a resource can produce and send back to the
client.
Using multiple output MIME types
@Produces({"application/xml", "application/json"})


@Consumes
annotation is used to specify the MIME media types of representations that can be consumed by a resource.

@QueryParam
is used to extract query parameters from the Query component of the request URL.

@DefaultValue
annotation, will be assigned to the step method parameter. If the
"step" value cannot be parsed as a 32 bit signed integer then a HTTP 404
ex :
 public Response smooth(
4 @DefaultValue("2") @QueryParam("step") int step

@FormParam

it extracts information from a request representation that is of the MIME media type
"application/x-www-form-urlencoded"

@Context HttpHeaders headers,

@Singleton
annotation says that the resource
will be managed as singleton and not in request scope. The sub-resource locator method returns a class which means that the runtime will managed the resource instance and its life-cycle. If the method would return instance instead, the Singleton annotation would have no effect and the returned instance would be used.


Securiry -- done
Multipart  -- progress -- 8.3
Filters -- 9.0







Stateless Authentication with Spring Security


1) for content and format ref :
http://blog.jdriven.com/2014/10/stateless-spring-security-part-2-stateless-authentication/

2) http://www.codingpedia.org/ama/how-to-secure-jersey-rest-services-with-spring-security-and-basic-authentication/
3) http://www.codingpedia.org/ama/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring/


Sunday, 4 September 2016

Context initialization failed

Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private edu.scramjet.service.AppUserService edu.scramjet.controller.UserController.appUserService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [edu.scramjet.service.AppUserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Solution :
If you look at stack. Spring container is unable to create bean. for userController. unable to autowire the appUserService.

ex :  public class void UserController {
 
       @Autowired
private AppUserService appUserService;     ///  interface object

      @RequestMapping(value="/create",method=RequestMethod.POST,
produces=MediaType.APPLICATION_JSON_VALUE,
consumes=MediaType.APPLICATION_JSON_VALUE)
public User createAppUser(@RequestBody User user ){
System.out.println(user);

appUserService.createUser();



return user;
}

   
     }

If AppUserService  is object  interface and its autowired. We need to provide Implementation class for bean creation.


public interface AppUserService {

public void createUser();
}

@Service
public interface AppUserService implements  AppUserServiceImpl {

public void createUser() {

}

}

Saturday, 27 August 2016

Java 8 JDBC

Java 8 : The JDBC-ODBC Bridge has been removed.

There is plenty of option to try. refer the Stackoverflow for futher references. 


Java 1.8 Concurrency feature "ConcurrentHashMap as a Set"

Java 1.8 Concurrency feature "ConcurrentHashMap as a Set"

The feature will return set of key in the map as Set.

public class VoiceConcurrentHashMap {

public static void main(String[] args) {

ConcurrentHashMap<String,String> map = new ConcurrentHashMap<String, String>();
System.out.println(map);
map.put("Lnkedin", "Networking");
map.put("Microsoft", "Windows10");
map.put("facebook", "Social");
map.put("Google", "SearchEngine");

KeySetView<String,String> set = map.keySet();
System.out.println(set);
}

}

Result : [Google, facebook, Microsoft, Lnkedin] .

Image :


ref :
Java API 


Behaviour of ConcurrentHashMap when it has Duplicate key.

Behaviour of ConcurrentHashMap when it has Duplicate key.

ConcurrentHashMap will overwrite previous value for a given key in Map. The object whos reference is lost are eligible for garage collection.

public class VoiceConcurrentHashMap {

public static void main(String[] args) {

ConcurrentHashMap<String,String> map = new ConcurrentHashMap<String, String>();
System.out.println(map);
map.put("Lnkedin", "profile");
map.put("Lnkedin", "profile");
map.put("Lnkedin", "jagdeesh");

}
}

ref :
1. Java API
2. Stackoverflow


Wednesday, 24 August 2016

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

When supplying json object from postman. if Class contain a list object. Provide it as a array [].
ex :
{
    "name" : "raman",
    "employeeId" : 12345,
"orderList" : {"orderId" : 1,"orderName" : "rest json book"}
}
solution :
{
"name" : "raman",
"employeeId" : 12345,
"orderList" : [{"orderId" : 1,"orderName" : "rest json book"}]
}