nuSOAP problem – Method not allowed
Posted by mkhairul - February 3, 2010 at 10:02:39 am - No CommentsCategories: Tips, Troubleshoot
I got a call from a friend working at the previous company that I worked for. I did the integration between their flagship application with a 3rd party payment gateway involving SOAP.
As usual, people call me expecting me to troubleshoot problem on the phone. At first I was a little bit confused as to what the problem is, but then I remembered that I had already solved it and went through my notes.
The web service client is calling the web service on SSL, it requires the use of cURL. Enable php_curl extension and everything should work fine.
Listing non alphabet records – MySQL
Posted by mkhairul - January 7, 2010 at 12:01:18 pm - No CommentsCategories: Tips
I know this is rather simple, but I thought I’d just put it here because I haven’t been posting quite as often as I would like.
There’s this application, where it needs to list companies by alphabets. Click on ‘A’ it displays all companies that starts with ‘A’ or ‘a’.
So there’s this ‘Others’. Companies that starts their name with other symbols.
A simple regex will do the job.
SELECT * FROM table WHERE column NOT REGEXP '^[a-zA-Z]'
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
Writing a To-Do List for my future self
Posted by mkhairul - September 22, 2009 at 12:09:21 pm - No CommentsCategories: Tips, management
Its hard to keep a consistent writing style and mindset when life throws a curveball thats spins in loops. Even more when I have not mastered it yet. It usually throws me off course making which makes me struggle back to get on course.
It is suggested that, it helps to write down tasks as though you’re delegating them to someone you know in order to write succinct but complete tasks.
The secret to all this is that, when you are writing down your deferred tasks “normally,” in truth you’re actually delegating but you just don’t realize it. You are simply delegating to your future self. The problem is that, in our present-self state of mind when planning tasks, we are filling in the gaps in our writing with present-knowledge.
This knowledge fades quickly and by the time our future-self picks up the work, the mortar of that transient information has dissolved, turning what seemed to be a solid, actionable task into an unclear jumble of words.
So, I guess, instead of “Do this..”, I should write “Do this … so that .. etc”.
Source
Write Specific Yet Concise To-Dos for Your Future Self
Long-term memory
Posted by mkhairul - September 15, 2009 at 08:09:10 am - 1 CommentCategories: Tips, rants
An article about SuperMemo and the story behind it, Want to Remember Everything You’ll Ever Learn? Surrender to This Algorithm. Quite an interesting read.
One of the interesting thing is about long-term memory can be characterized by two components, storage strength and retrieval strength.
- Retrieval strength measures how likely you are to recall something right now, how close it is to the surface of your mind.
- Storage strength measures how deeply the memory is rooted.
Some memories may have high storage strength but low retrieval strength.
Take an old address or phone number. Try to think of it; you may feel that it’s gone. But a single reminder could be enough to restore it for months or years.
Conversely, some memories have high retrieval strength but low storage strength.
Perhaps you’ve recently been told the names of the children of a new acquaintance. At this moment they may be easily accessible, but they are likely to be utterly forgotten in a few days, and a single repetition a month from now won’t do much to strengthen them at all.
For this, I’m going to give SpicyElephant a try (I went there before and couldn’t understand what its suppose to do, now I got the picture) and see how it goes.
Refresh Desktop without restarting windows
Posted by mkhairul - September 12, 2009 at 06:09:18 am - No CommentsCategories: Tips, Troubleshoot, blog
I’ve been having this problem lately, when I leave my applications open too long (IDE, Browsers, etc) or open too many applications, my desktop starts to go insane. The icons are messed up, when I open explorer it doesn’t automatically display the left pane.
I need to refresh my desktop. Open up task manager, go to the processes tab, search for ‘explorer’ and end it. After the desktop is blank, no icons, just the wallpaper and the task manager, click on the File menu, new task (Run) and type in explorer.
And the desktop is restored!
Running IE6 and IE7 simultaneously for testing
Posted by mkhairul - August 17, 2009 at 06:08:56 am - No CommentsCategories: Tips, blog
Apparently, the a government organisation that I’m working with is still using IE6. As much as I hate IE6, I’d have to bear with it.
I don’t use IE as much (why bother?), since Chrome and Firefox are far better which results in me still using IE6. I still need to test the stuff on IE7 and see how it looks. For that I downloaded and installed IE7 standalone which is a blessing since I don’t want to install IE7 and replace a bunch of stuffs and have to restart my PC.
In other news, IE6 supported by Microsoft till 2014.
Those arrogant fucks, how dare they provide long-term support for their software!
Multiple icons (or buttons) in one image
Posted by mkhairul - August 15, 2009 at 01:08:47 am - No CommentsCategories: Development, Tips
That’s what I searched using google. Didn’t get much, had to browse a few links to see whether it rings a bell. The term that I’m looking for is CSS Sprites.
I’m not gonna reiterate whatever that’s available in the web right now, I’m just too tired. So here’s a list of links for you all to read about it.
- CSS Sprites: What They Are, Why They’re Cool, and How To Use Them
- CSS Sprites: Image Slicing’s Kiss of Death
Its not a new thing, its been around for quite some time but there aren’t many people that I’ve met have actually the need to do it (where performance is crucial for the web site/application). I’m preparing an app for facebook, so these sort of things have to be kept in mind when there’s a possibility (not big, but just in case..) of millions (most probably a few thousand) joins in and beat the crap out of the server.
Here’s an example of a company you’re already familiar with thats using this technique.
Anchoring an estimation
Posted by mkhairul - July 23, 2009 at 03:07:58 am - No CommentsCategories: Tips
Just read that there’s a simple decision theory trick that is being used by marketers to justify prices on products that is being sold, by using an anchor.
Although its faster than doing a detailed estimation its accuracy is questionable (like all other estimates, Haha!). Still it is an important technique to keep in mind like one of those linguistic skills like argumentum ad hominem, presupposition, cognitive dissonance, etc.
Very handy to have in your utility belt (apart from grappling hook, bat boomerang and tazer guns).
GimpStyle Theme design by Horacio Bella.



