A solr core needs so many configuration files. They look different for master and slave. Also some files like data-config.xml are different for environments when you have data sources to index from. With these permutations, you might end up with large sets of config files. Here I have explained how I managed maintain only single set for all servers and all environments.
I almost spent a day trying to understand why my unit test case was able to load a resource where as once I deploy the jar failed to load the same. In the end I came across something very basic : Some.class.getResource behaves differently than Some.class.getClassLoader.getResource. There is no simple answer like use this always. It depends on which class loaded loading that particular class. So if you are facing such issue try checking both options.
How many times have you banged your head against the monitor or seen others doing so when the poor dumb machine goes dumb literally!? Must be a lot of times for most developers. If not, you are a blessed child and you need not read further :).There is no use if you keep hitting the ENTER button or keep yelling at your machine when the machine cannot support what you want it to do… Now-a-days, companies are after new languages and technologies like RoR, Scala etc to improve developer speed. They have started following agile methodologies and hiring expensive coaches; paying a lot for agile certifications (really a lot :( ). Yes, all of these have actually improved efficiency. But in the thick of such ‘big’ things, aren’t they missing out basic stuff which will enhance developer efficiency? For instance, is it not a basic necessity to have a proper work environment, proper infrastructure that can support such ‘big’ things?
How many of you believe you have quality code because you have good test coverage? Or how many of you feel you are working with bad quality legacy code because it doesn’t have any test coverage? Recently every organization started focusing on quality especially automation. Started putting people to increase unit test coverage. But did you question : Did you gain anything out of it? Is your code quality improved? How long these test cases will be relevant ? Do you think developers would be comfortable modifying it when code changing?
When it comes to quality first thing we say is “90%” code coverage. To me whats important is 100% coverage for code that is doing some non-trivial work. For java code you can avoid trivial code and classes easily . Just use following configuration.
// This is used in the local environment. comment this when deploying to Unix box
// File propertyFile = new File("Some.properties");
// This is used when deploying in Unix this is used.
File propertyFile = new File("/home/mr.x/secrtet/prod.path/some.properties");
Above code is self explanatory. Too good code and superb documentation ;) .
If someone asks me what is the best practice to finish a software project successfully, I say “Keep it simple”. Well you heard it many times. But actually did you follow it. In fact its quite simple to keep things once you leave your ego and selfish thoughts away. If you think I am just bullshitting I can make you agree by the end of this blog. Continue reading