Posts

How to install / Configure Mantis For Apache-PHP-PostgreSQL combination

Image
How to install / Configure Mantis For Apache-PHP-PostgreSQL combination  → I wanted to write this blog a long back, but better late than never. Three years back I was working on a project where we had used Mantis Bug Tracker for managing our bugs list, for that, I had to install it on a server from where our teams could access it to log the software bugs and update the fixes. Important learnings - with new php versions, I faced few issues with postgresql configs, then while setting up database instance for mantis I faced few issues with postgres port configs and how to give it on mantis config files, database user grant problem. I had to set up everything from scratch so learned a lot. (Note - mantisbt  →  mantis bug tracker) Why I have written this post  →  at that time I could not find any resource on web which would give me good tutorial on how to install mantisbt on Apache and PostgreSQL. So I wanted to put it on web so others could some of thei...

Math Shortcut - Squaring Any Number

Few days back when I was doing some number multiplications, I found an easy way to square any number without much of calculations, so thought of sharing it. So here is my try to explain it and extend it for more number of digits and for more complex use also. (But for larger numbers, multiplications become painstaking and this might result in more time and merely just a stunt, this works good for max 5-6 digit number, though this trick can be used for higher digits also, but use it carefully.) Squaring is basically multiplying a number by itself e.g.  (89)² =  (89) *  (89) , (111)² = (111)*(111) , etc. And if you had a basic algebra classes then you should know this equation, where a & b are non-zero  → (a + b)²  =   (a + b)* (a + b)  =  (a)²  +  ( 2*a*b) + (b)² I use the same equation for this trick. e.g. we want to square a number, say 34, then as per (a+b) logic, its a = 30 and b = 4, but fo...

Finding two biggest numbers out of three numbers efficiently

It is a simple problem, and many of us must have had such problem either in exam or exercises or math-quiz or may be in real life. There are many ways to solve this, here is one efficient way to solve it. I do not claim it is to be most efficient or the only method. I found it out so I thought its good to share. It is not programming, its just logic. Consider three numbers a, b, c First I will put the (what I think is) dumbest way - step by step, considering each scenario,  //Finding 2 biggest numbers from list of three numbers i.e. a, b, c //Considering all values are different like 12, 45, 48 if( a>c && b>c ){ "Two big numbers are a & b" }else if( b>a && c>a ){ "Two big numbers are b & c" }else if( a>b && c>b ){ "Two big numbers are a & c" } //in case any 2 values are equal like 22, 22, 1212 //so there are three cases either a=b or b=c or a=c //a=b case ...

Modified ExtJS LOVCombo (List of Values) ux plugin - with select all, deselect all, text filter, bubble up and bubble down of selection

Image
Here is one interesting modification to LOVCombo ux plugin in ExtJS 3.4. The original ExtJS ux Lovcombo i.e.Ext.ux.form.LovCombo plugin was developed by Jozef Sakáloš and can be still found at  http://lovcombo.extjs.eu/ . In Ext 4.x onwards, similar modifications can be applied to combo-box through plugin property. Following modification to Ext.ux.form.LovCombo, enables it to have "Select All", "Deselect All", "Text Filtering on values", "bubbling up and down of selection events". Its just a toolbar added in xtemplate of combo-box's dropdown list, and this toolbar has all these buttons, filter text-fields, etc. Here is how it looks like - It has five features - 1) Select All / Deselect All checkbox - to check/uncheck all values and its not part of your data, so selection / deselection logic is separate from user's data. 2) Text Filter - In case of long lists, this will be handy, to filter out values and select /deselec...