vinay basavanal

Greenhorn
+ Follow
since Dec 08, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by vinay basavanal

HI All,

I am getting http server reponse code 400 when i am running below but however it runs fine when i have proxy configured in my server
The below code does Read csv files and process it to do some sort of cacluations.This is more of small picture code , to introduce big picture. The csv file contains information of seeds of crop which have some information in number depending upon the numbers the calcuation have to be done.There are different types of calucations based on traits types. The csv file will contains hybrid numbers followed by the traits . I have recorded observations for 6 traits, now at first i will read traits used in the applicaitons some traits may have 2 ,3 or n enteries.This is stored in db so i will pull inforamtion from there , once i read traits then i will read each hybrid number and trait values once i read trait values of particular trait i will either avgerage or do some more processing for som e trait the value depends on other triats.

Please have a look at it and let me know if it has to be improveed from design/implementation point of view.





I have even entered values for TLSSG01 TLSSG02 TLSSG03 but they are not visible ,

Below is the Code:




Does this look like OO code

fred rosenberger wrote:The first step in doing optimization is always to use a profiler to determine where it is slowing down.

Sure, you can look, and you can guess...but almost every time, you will guess wrong.




populateLinks is the method which approximately takes about 70% of time i.e about 16 sec .It has recursion and iteration how can i optimize this.
12 years ago
I have written some code which will fetch contents from a resource which is actually stored in a tree format. Since it is in a tree format, there will be a parent-child relation and hence recursion.

I am facing lot of performance issue as tree is growing in size this particular piece of code takes up-to 25 sec which is very bad. This piece of code will basically read data stored in file system (just for example) each content has certain set of property which it has to read.



I know code is not complete and may be in appropriate to review but I can't paste the whole of my code hence I hope you understand and review there is recursion and iteration any way I can better write this piece of code.
12 years ago
Thank you now i have mentioned that i have two different projects , one is for service and other is backend layer , service layer interacts with backend what should be my aim actually should it be to test code or functionality, should i write test case for serviced layer alone without backend and how it must be.
12 years ago
Points Taken,

Now can you please explain me how can use stratergy pattern, each crops will have 100 of traits let say each crop has 10 different tratis where calculations differ how can i handle this so lets say traits like plantHeight, yeild ,qa_HU , tlssg need different calculations then how will i do it something like ?



and in my main code where i do caluations should be like this





HI All,

We want to use junit in our applications, the problem i am facing is , is junit used to test a piece of code or to test functionality.MY appliaction is a web applicaiton .I have get data from ui through servlet/jsf and pass the data to backedn throgh facade pattern i.e i have some service classes and then there is dao layer or a webservice layer which will persist or fetch data from backend services.We have classified our applications in to three projects one is core progject which is like api where we have helper classes like db connection and JDBC utiliity classses.THen there is serice project where basically has service and vo and the web project.NOw how can i use junit in this scenario should i use it to test end to end funcitonality or just do a piece of code testing please help
12 years ago
I am having trouble designing a module, can anybody help me?

Because it will be hard to maintain this kind of module, I also think that this can test my skill of design pattern usage.

Requirement

This is basically an agricultural project (web application). I need to design a module where some calculation takes place.

There are different crops involved like maize, tomato, okra etc. Each of these crops has different traits.

Each trait has a measurement scale which lies in integer like 200-1000. Now let's say I have planted the crop and done measurement noted down the traits. Now I want to do some sort of measurement. Some measurements are simple and some are complex.

Example

Lets take an example of crop maize. I have recorded observations for 15 traits. (We'll use trait1-trait15 as examples, the actual name can be like plt_ht, yld, etc.)

I recorded 5 observations for each trait:

trait1 trait2 trait3 trait5 trait6..... trait15
01,02,03,04 01,02,03,04 01,02,03,04
User logs into system and selects his crops and enters data for these observations. I have to calculate either average or sum of the data entered for each trait.

Complexity / centre of the problem

So far it's simple but complexity comes when I have some different formulas for some of the traits.

Example: trait YLD has a formula based on which I have to calculate its value, which may also depend on some other traits. Each different crop can have different traits.

All this I am able to do - whenever user selects crop I will check for those specific traits and do calculations (if it's not a special trait then I either average or sum it, based on db entry), but there is a lot of hard coding.
I would like to have suggestions on a better way of handling this.

My code needs to handle both simple and complex calculations.
Simple calculations are easy, I have take average of value entered for trait.
The problem comes when I have to do complex calculations, since each crop have different traits with their own formulas, so to calculate I have to check for crop and then for complex trait. So I have to hardcode the trait name of complex traits.
Can any tell me how I can design this using Java oops [?!?] so that I can make it generic?

I have about 10 different crops. Some calculations are specific to crops, so there will be lot of code like the if below:



From Desgin point and maintaininablility point which way should this be handled