October 07, 2022

[Solution for ] No main manifest attribute, in jar Maven and SpringBoot | SpringBoot no main manifest attribute (maven)

SpringBoot no main manifest attribute (maven)






Add the plugin to the pom.xml:



<plugin>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-maven-plugin</artifactId>
   <configuration>                   
      <mainClass>com.bijusapp.stockmarket.TickerApplication</mainClass>
   </configuration>
   <executions>
      <execution>
      <goals>
         <goal>repackage</goal>
      </goals>
      </execution>
   </executions>
</plugin>





Tags : No main manifest attribute, in jar Maven and SpringBoot, Unable to execute jar- file no main manifest attribute,[Fixed] no main manifest attribute, Maven "No main manifest attribute", How to fix "no main manifest attribute" error , Importance of Main Manifest Attribute in a Self-Executing JAR,It is easy to resolve this error in the Spring Boot project

September 07, 2022

nested exception is org.springframework.core.io.buffer.DataBufferLimitException | Exceeded limit on max bytes to buffer : 262144 | org.springframework.web.reactive.function.client.WebClientResponseException

Hi, While trying to implement a NSE Ticker for stockmarket analysis we encountered the below error

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.web.reactive.function.client.WebClientResponseException: 200 OK from GET https://www.bijusapp/query?f=DAILY&symbol=adhani&apikey=bijusapp; nested exception is org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
Caused by: org.springframework.web.reactive.function.client.WebClientResponseException: 200 OK from GET https://www.bijusapp/query?f=DAILY&symbol=adhani&apikey=bijusapp; nested exception is org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144


Solution


spring.codec.max-in-memory-size=50MB in application properties


Or


/**
 * 
 */


import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer;

/**
 * @author bijusapp
 *
 */
@Configuration
@EnableWebFlux
public class WebFluxConfig implements WebFluxConfigurer {
@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(16 * 1024 * 1024);
}

}

August 21, 2022

When to buy :: When to sell :: When to exit :: Swing trade | stock market explained

Hi Team

Here we explain the some best steps you can consider before start trading on any stock for short term. Our strategy is to get maxmimum profit (around 20 percentage) in a month with same capital.

  • How to pick up a stock
  • What strategies we are following
  • What all paramaters you need to analyse
  • How to analyse the graph pattern
  • When to buy , When to sell or when to exit
  • With an example (Motherson sumi wiring india ltd)

Best stock with returns huge profit


Best swing stock which may returns 10 percentage in 3 weeks, visit our stock list

How to pick up a stock


Consider breakout stocks, from any stock market websites like
chartlink  Or from telegram discussion group 

From Tickertape , Go to stock screener ( tools of the trade) apply the following filters





What strategies we are following


If you are planning to invest 1 Lakh rupees in swing trade, invest 10000 each in 10 trade. For swing trade we expect a return in 1 to 15 trade days, if any trade reached stop loss, you have 9 other stocks that achieved targets, again you can use the same capital for new swing trades.

For example

if 10 out of 5 Trade achieved target of 10 percentage in one week, you will get 5000 profit, and same capital ie 50000 can be invested in another 5 trades.

if  10 out of 3 Trade achieved target of 10 percentage in second week, you will book a profit of 3000 in coming week, again newly invested 5 trades may also book profit.

if 10 out of 2 reached stop loss in third week, you will have a small loss, even though monthly you can book a huge profit ( average more than 10 percentage with same capital of 1 Lakh)

What all paramaters you need to analyse


  • Current news on that particular stock
  • Know about the organisation, their subsidaries, their products etc. About tab in screener will help you for this https://www.screener.in/
  • Average brocker target from tredlyne
  • Forecast & Rating in tickertape (Buy siginal)
  • Strength, weekness and opportunity from tredlyne
  • Check the durability score, buyers volume etc

How to analyse the graph pattern


Usually we go with cup & handle pattern Or morning star pattern. For morning star pattern we need to analyse the stock for 3 days

Example MSUMI (june 16 2022)

MSUMI morning star candle pattern formed on jun 16 2022

MSUMI news on june 16 2022 



When to buy , When to sell or when to exit

You can see where we set up our target and stop loss

For MSUMI, after trend reversal on jun 16 2022, the stock price increased from 64.00 to 78.00, able to book a profit of 22 percentage. 

In additon to candle graph pattern, we added MACD indicators, RSI (Relative strenght index ) & Volume graph.

We check whether there is a MACD cross over, RSI value is between 30 & 70, and a high volume of buyers in volume graph

Target and stop loss



If you want to open a account in zeroda or upstock, use the link





Thanks for reading our blog

subscribe our youtube channel for daily updates

























                                 DISCLAIMER
I AM NOT A SEBI REGISTERED ADIVISER.ALL MY VIDEOS, POST ARE RECOMMENDATIONS ARE ONLY FOR EDUCATIONAL AND MOTIVATIONAL PURPOSE.PLEASE DONT TAKE RISK ON YOUR HARD EARN MONEY ON THE BASIS OF MY RECOMMENDATION AND VIDEOS.MUST TAKE ADVICE FROM YOUR FINANCIAL ADVISER BEFORE PUTTING REAL MONEY INTO STOCK MARKET.

August 07, 2022

Given two non negative integers A and B, returns the number of bits set to 1 in java 8 | interview question

/**
 * Write a function that given two non negative integers A and B, returns the number of bits set to 1 in the binary representation of the number A * B
 */
package com.learning.leetcode;

/**
 * @author Biju perambra blogger
 * IHRD CAS kozhikode
 */
public class SolutionBijuApp {

public int solution(int A, int B) {
int count = 0;
int product = Math.multiplyExact(A, B);
while (product > 0) {
int value = product % 2;
product = product / 2;
if (value == 1)
count++;
}
return count;
}


/**
* @param args
*/
public static void main(String[] args) {

System.out.println(new SolutionBijuApp().solution(3, 7));


}

}


BijuApp on stockmarket

July 28, 2022

How to find the count of employees in each department using java 8 streams and collection | interview questions MAANG

/**
 * 
 */
package com.learning.stockmarket;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;

/**
 * @author vishnu prasad blog
 *
 */
public class MainClass {

/**
* @param args
*/
public static void main(String[] args) {
List<Employee> empList = addEmployee();
Map<Integer, Long> result = empList.stream().collect(Collectors.groupingBy(Employee:: getDeptId, Collectors.counting()));
System.out.println(result);
}

private static List<Employee> addEmployee() {
List<Employee> list = new ArrayList<>();
int id = 1;

for (int i = 0; i < 100; i++) {
byte[] array = new byte[7]; 
    new Random().nextBytes(array);
    String name = new String(array, Charset.forName("UTF-8"));
    
    int dept = new Random().nextInt(6);

Employee employee = new Employee(id, name, dept);
id = id++;
list.add(employee);

}

return list;
}

}

Employee


/**
 * 
 */
package com.learning.stockmarket;

/**
 * @author vishnu prasad blog

 * Kozhikode
 */
public class Employee {
private int id;
private String name;
private int deptId;
public Employee(int id, String name, int deptId) {
this.id = id;
this.name = name;
this.deptId = deptId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getDeptId() {
return deptId;
}
public void setDeptId(int deptId) {
this.deptId = deptId;
}


}


July 21, 2022

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

Problem

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

This issue happens due to version mismatch between swaggerfox and spring boot framework.


Solution




/**
 * @author aswathi sajeevan
 *
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {

@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any()).build();
}
}


Pom.xml



<!--  swagger  -->

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>


Spring boot version



<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.2-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>



Swagger url


http://localhost:9090/swagger-ui/index.html




July 14, 2022

How to create a textile billing and inventory system using google spreadsheet and google app sheet

Hi 


We have created a textile inventory and billing system for Nijeeshma tailoring athanikkal kozhikode using google app sheet and google spreadsheet. Any one can develop this application with a day or two. No coding required


Please visit our git url


Video

July 07, 2022

How to use observable pattern to notify stock market breakouts entry stoploss


Created a stock market application by implementing observable pattern.
In observable pattern the subsribers will be notified when ever there is any event occured in publishers object. In our example stock is the publisher ( Observables) and we kept a list of subscribers list in NotificationManager class.



Stock.java


package com.learning.designpattern.observer;

import java.io.File;
/**
 * Stock class
 * Act as Observable or publisher
 * 
 * Where ever a change happens in Stock object (publisher), it will notifies the subscribers
 * 
 * two methods stoploss() & entry() corresponds to file opening and saving events
 * 
 *
 * 
 * 
 * @author smithesh k k
 *
 */
public class Stock {

private Breakout breakout;
public NotificationManager events;

public Stock() {
this.events = new NotificationManager(); 
}

public void stoploss(String nseTicker) {
if (!nseTicker.isEmpty()) {
this.breakout = new Breakout(nseTicker);
events.notify(Alerts.STOPLOSS.toString(), breakout);
}
}

public void entry(String nseTicker) {
if (!nseTicker.isEmpty()) {
this.breakout = new Breakout(nseTicker);
events.notify(Alerts.ENTRY.toString(), breakout);
}
}

}

NotificationManager.java


/**
 * 
 */
package com.learning.designpattern.observer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *  NotificationManager
 *  
 *  keeps the subscriber list ( watchlist), through NotificationManager you can subscribe or unsusbscribe for an event
 *  
 *  notify() helps to notify the subscribers/observer's
 * 
 * 
 * @author bijuvas
 *
 */
public class NotificationManager {

private Map<String, List<EventListener>> watchlist;
public NotificationManager() {
this.watchlist = new HashMap<>();
addEvents();
}
public void notify(String eventType, Breakout file) {
List<EventListener> users = watchlist.get(eventType);
users.forEach(user -> {
user.update(eventType, file);
});
}
public void subscribe(String eventType, EventListener listener) {
List<EventListener> users = watchlist.get(eventType);
users.add(listener);
}
public void unsubscribe(String eventType, EventListener listener) {
List<EventListener> users = watchlist.get(eventType);
users.remove(listener);
}

public void addEvents() {
final Alerts[] alerts = Alerts.values();
for (Alerts event : alerts) {
            this.watchlist.put(event.toString(), new ArrayList<>());
        }
}
}

EventListener.java


/**
 * 
 */
package com.learning.designpattern.observer;

/**
 * EventListener
 * 
 * update()
 * 
 * @author sreekumar
 *
 */
public interface EventListener {
public void update(String eventType, Breakout breakout);
}


EmailNotificationListener.java


/**
 * 
 */
package com.learning.designpattern.observer;

/**
 * EmailNotificationListener
 * 
 * @author perambra kozhikode
 *
 */
public class EmailNotificationListener implements EventListener {
private String email;
public EmailNotificationListener(String email) {
this.email = email;
}

@Override
public void update(String eventType, Breakout breakout) {
System.out.println(" email send to "+email +" for "+eventType);
}

}


MainClass.java


/**
 * 
 */
package com.learning.designpattern.observer;

/**
 * @author valiyakode
 *
 */
public class MainClass {

/**
* @param args
*/
public static void main(String[] args) {
Stock editor = new Stock();
NotificationManager event = editor.events;
event.subscribe(Alerts.STOPLOSS.toString(), new EmailNotificationListener("test@gmail.com"));
editor.stoploss("SGX");
}

}


Breakout.java


/**
 * 
 */
package com.learning.designpattern.observer;

/**
 * @author Zamorins Guruvayoorappan college
 *
 */
public class Breakout{  //implements Strategies{

public Breakout(String nseTicker) {

}


Alerts.java


/**
 * 
 */
package com.learning.designpattern.observer;

/**
 * @author lijesh
 *
 */
public enum Alerts {
TARGET1, ENTRY, TARGET2, STOPLOSS;

}


Full source code


Git url
 

June 27, 2022

Sources must not be empty | java.lang.IllegalArgumentException | Spring boot application

Issue reported


2022-06-27 16:13:04.789  INFO 6348 --- [           main] o.s.boot.SpringApplication               : Starting SpringApplication v2.6.0 using Java 11.0.7 on apple-pc with PID 6348 (E:\Aswathi\maven_repo\org\springframework\boot\spring-boot\2.6.0\spring-boot-2.6.0.jar started by aswathi in E:\Aswathi\repo\stockmaster\nyseticker)
2022-06-27 16:13:04.793  INFO 6348 --- [           main] o.s.boot.SpringApplication               : No active profile set, falling back to default profiles: default
2022-06-27 16:13:04.828 ERROR 6348 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalArgumentException: Sources must not be empty
at org.springframework.util.Assert.notEmpty(Assert.java:470) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:403) ~[spring-boot-2.6.0.jar:2.6.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) ~[spring-boot-2.6.0.jar:2.6.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.0.jar:2.6.0]
at org.springframework.boot.SpringApplication.main(SpringApplication.java:1317) ~[spring-boot-2.6.0.jar:2.6.0]

Solution

Go to class where you have your @SpringBootApplication and right click -> run as java application.



  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.0)

2022-06-27 16:19:32.454  INFO 3160 --- [           main] c.p.nyseticker.NysetickerApplication     : Starting NysetickerApplication using Java 11.0.7 on apple-pc with PID 3160 (E:\Aswathi\repo\stockmaster\nyseticker\target\classes started by apple in E:\Aswathi\repo\stockmaster\nyseticker)
2022-06-27 16:19:32.460  INFO 3160 --- [           main] c.p.nyseticker.NysetickerApplication     : No active profile set, falling back to default profiles: default
2022-06-27 16:19:34.141  INFO 3160 --- [           main] c.p.nyseticker.NysetickerApplication     : Started NysetickerApplication in 2.955 seconds (JVM running for 4.258)



June 21, 2022

How to use function interface in your application | simple example for lamba expression | Interview questions

Created a simple functional Interface

/**
 * @author Stock market swing trad
 *
 */
@functionInterface
public interface InitialStatus {
public String set();

}


Implementing the function Interface


    InitialValue soldCountInitialValue = () -> Long.valueOf(0);
    InitialValue quantityInitialValue = () -> Long.valueOf(0);
    InitialValue taxInitialValue = () -> Long.valueOf(5);
    InitialValue ratingInitialValue = () -> Long.valueOf(1);
    InitialValue ratingInitialCount = () -> Long.valueOf(1);


Using the variables

itemObj.setSoldCount(soldCountInitialValue.set());

May 14, 2022

Stock trading application source code | java code | how to get stock value of share through java code | yahoo finance

/**
 * 
 */
package com.proximotech.nyseticker.service;

import java.io.IOException;
import java.math.BigDecimal;

import org.springframework.stereotype.Service;

import com.proximotech.nyseticker.model.StockWrapper;

/**
 * @author apple
 *
 */
@Service
public class StockService {

public StockWrapper findStock(final String ticker) {
try {
return new StockWrapper(yahoofinance.YahooFinance.get(ticker));
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public BigDecimal findPrice(final StockWrapper stock) throws IOException {
return stock.getStock().getQuote(true).getPrice();
}
}


Download application from git

https://javabelazy.blogspot.com/p/office.html

May 07, 2022

its never too late to try to achieve your dream | Motivational story

its never too late to try to achieve your dream!
its never too late to learn some thing new!
its never too late to experience something beautiful!
its never too late to keep on trying, no matter how may times you fail.
its never too late...

There was a man, born a long time ago, 
Bought up in a simple middle class family,
his father was a long family man and use to work in his farm.
Lost his father when he was 5 years old,
he was too young to realize what had happened.
At the age of seven he learned to cook, to feed his younger siblings and his mom away working.
At the age of ten he began working as a helper in the farmland and then took up job painting horse carriages,
At the age of thirty he established a ferry boat company the ferry was an instant success, and the venture failure.
Lost many jobs than finally started running a service station that got failed after six years of works.
Many business failed, Almost bankrupt.
Decided to sell his recipe to various restaurant,
Rejected for 1009 times
At age of 65 he tasted sucess as KFC
Founder of Kentucky Fried Chicken.
He is colonel sanders

Dont give up keep going on..




April 28, 2022

Making entire row and column of matrix to zero if one element is zero | alternative approach


Given a matrix if an element in the matrix is 0 then you will have to set its entire column and row to 0 and then return the matrix.
 



/**
 * Given a matrix if an element in the matrix is 0 then you will have to set its entire column and row to 0 and then return the matrix.
 */
package com.striver.sde.practice;

import java.util.ArrayList;
import java.util.List;

/**
 * @author apple
 *
 */
public class MatrixZero {

/**
* @param args
*/
public static void main(String[] args) {

int[][] input = { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 } };

MatrixZero m = new MatrixZero();
// m.findSolution(input);
m.findSolution2(input);

}

private void findSolution2(int[][] input) {
int len = input.length;

List rows = new ArrayList<>();
List cols = new ArrayList<>();

for (int row = 0; row < len; row++) {

for (int col = 0; col < len; col++) {

if (input[row][col] == 0) {
rows.add(row);
cols.add(col);
}

}

}
for (int row = 0; row < len; row++) {

for (int col = 0; col < len; col++) {

if(rows.contains(row)) {
input[row][col] =0;
}
if(cols.contains(col)) {
input[row][col] =0;
}

}

}
System.out.println(input);
}

private void findSolution(int[][] input) {

int[][] output = input.clone();

int len = input.length;

for (int row = 0; row < len; row++) {

for (int col = 0; col < len; col++) {

if (input[row][col] == 0) {

modifyMatrix(row, col, output, len);

}

}

}

}

private void modifyMatrix(int row, int col, int[][] output, int len) {

if (row == 0) {
int r = row;
while (r < len) {
output[r][col] = 0;
r = r + 1;
}

} else if (row == len) {
int r = row;
while (r >= 0) {
output[r][col] = 0;
r = r - 1;
}

} else {

}

}

}

April 21, 2022

Stock market trading | morning star candle stick pattern explained | How to set up an entry point | best to buy




Sample graph : Morning star candle stick pattern explained

we have taken last 3 month stock trading of SBI, in the yellow color we marked morning start candle stick pattern.

What is morning star candle stick pattern ?


Its a 3 candle stick pattern (Multiple candle stick pattern) which denotes 3 successive days.

for example apr 21 2022, apr 22 2022, apr 23 2022 in each candle.

Its a trend reversal pattern.


How and where to check morning star candle stick pattern?


Check whether the morning star candle stick pattern is formed after a downtrend.

In morning star candle pattern

1. The first candle will a bearish one

2. The second candle will be either a doji or spinning top, here the color may be green or red

if its green then its a good indicator to buy

The second candle should be a gap down opening, ie the opening value should be lesser than first candle closing value.

3. The third one must be a bulish candle and opening should be gap up opening.


What morning star candle stick says?


Its a entry point for short term or long term.











March 07, 2022

Stock market trading | candle stick pattern explained | How to set up an entry point | break out | buy or sell decision

Descending Triangle Pattern 



Represents stock consolidation, prior downtread before triangle formation.

Result : either be berish or bullish, but mostly berish.

Entry : breakout with maximum volume trying to break triangle pattern.

Target : maximum width of triangle price range.

Stop loss : 

Facebook comments