MySQL: Comparing float / double
Posted by mkhairul - October 30, 2009 at 02:10:56 am - No CommentsCategories: Development, Tips
I have not done a lot of raw SQL for quite a while. In my current job, I need to do it. Since we’re using MySQL 4, my options were quite limited as I have to be wary about any features to a specific version (especially > 5).
So I was trying to find how to exclude the amount 0.00 from the result. The obvious one would be
foo.value > 0.00
But the comparison is not precise (I googled a bunch of links, but now they’re gone, you can try to google “mysql float comparison”), I would leave the detailed explanation for you to find out.
The way that I found that fullfills the result that I need is,
ROUND(foo.value, 2) > ROUND(0, 2)
Web Services (SOAP) limits
Posted by mkhairul - October 27, 2009 at 12:10:07 am - No CommentsCategories: Tips, Troubleshoot
I’m getting swamped by the task of making an application work with a vendor’s web services. Back in Al-Madinah International University, I did some web service stuffs but that was not an issue as it only sends small amount of data for each transaction.
But now there’s a need to send a lot of data (as much as possible) in one transaction. A single record is at least 500 bytes of data (with all the XML markups), I tried to test by sending an incremental amount of data (starting with 50 records) and worked my way up there, trying to get its limit.
The data is sent back and forth using ajax, when I get a 500 error, I knew it was caused by the amount of data that have to be put in a SOAP envelope.
With 1GB of RAM, I couldn’t even reach 100 records. I tore apart an unused PC in the office and got it up to 2GB and managed to reach 140 records (actually it is 150-160 but, I chose the average limit). Went off to the local pc hardware store and bought a 2GB ram stick. With a total of 3.24GB RAM, I tried it..
I tried sending 200 in one fell swoop and it works. Hopefully tomorrow I can test it more and see how it goes. In the quest to know more about Web Services, here’s some links that I have read.
- High Performance Web Services: Tackling Scalability & Speed
- Large Data Strategies
- Web Services Performance Consideration – Best Practices
- Discover SOAP encoding’s impact on Web service performance
- Improving Web Services Performance (patterns & practices)
- Checklist: Web Services Performance
- Best Practices for Web Service: Part 7, web services infrastructure
Reflections on changing jobs
Posted by mkhairul - October 16, 2009 at 03:10:10 am - No CommentsCategories: blog
Here I am, thinking, reflecting on the past while waiting for my download to finish. Some stupid stuffs that I did a few months back.
Changing jobs. Never ever, change a job in 24 hours. Especially for an unknown company whose office you have never seen. You could think that they’re being lenient and all for meeting at a restaurant for a chat (which actually is an interview), but there’s always “udang disebalik mee”.
Think for a while (in my case I didn’t), if you had an office that you’re proud of, why the hell wouldn’t you invite a potential employee to come over for an interview? This should raise a flag (+5 suspicion).
One of my other mistake is asking a developer who is a good friend of the technical manager for an opinion on the working environment. Obviously it will be biased. Should have waited for a whole month before jumping the ship to investigate further.
There’s also other bunch of mistakes that I made:
- I did not ask about the environment in detail
- I did not ask about developer level documentation
- I did not ask about version control in detail (they used it, but there’s no comments in the commits, you’d have to diff the file to see what have been done)
- I did not ask if there’s any code review being done
- I agreed on the odd working hours (there’s no amount of money that could substitute for this, ok maybe RM10,000. You’d miss a lot in socializing with friends, cats and other stuffs). Burning out by spending too much time on work is certainly not worth it
- I got sucked into a promise of a ‘family environment’ when in reality every company is govern by a market norm (no exceptions, unless you’re one of the founders of the company, then yes it is like a family)
- I was promised that the transition will be fully paid by the company from the old one when in reality their policy only allows them to pay half.
Well that certainly was depressing to think about. Always take your time to dig deeper for more understanding on the environment and work being done at the company that you’re going to.
GimpStyle Theme design by Horacio Bella.
