In my PHP projects, I use few global functions means can be used/accessed anywhere in the project. They are handy and reused a lot. Even you could be using them many times in a PHP program. Those are handy functions can be added easily in any project. No side effects, no library needed.. just pure […]
Technical
Blogs which is has anything / everything about technology
How to use Smarty templates in Node.js
Larger projects can lead you to use multiple technologies. Say you are using Smarty templates in PHP and want to use/share same templates in Node.js. jSmart is a way to go. jSmart is a port of the Smarty Template Engine to make it Javascript Templating Engine. jSmart can work in browsers and CommonJS environments like Node.js. […]
JavaScript library compatible with RequireJs, jQuery and Node.js
Last night, I was updating is_email JavaScript library so that it supports jQuery, RequireJS and Node.js. I found information for each library but on different blogs. I didn’t find complete set information at one place. As each of my blog says, I would be putting it here in the hope that it would be accessible […]
Want to have APC with PHP 5.5?
Today I was upgrading PHP on my production server. I went up to www.php.net and found that latest version released was PHP 5.5.1. As usual as our dev practice first thing was to look around if it had any already open bugs which affects my application. Found that JSON extension developed by Douglas Crockford was […]
is_email for JavaScript, Node, RequireJS and jQuery
Today email address are asked by many websites for signing up for there services. How do they validate email address? May be using code which ignores RFCs. Say if your ISP has issued you email address which flouts RFC conventions and it is invalid. If you can send and receive emails on that why does […]
How to cache compiled templates of Haml-js in Node.js
I recently came across Node.js technology, which is nothing but JavaScript based event driven server side platform. Further studies made me use Haml-js for templating. As of I studied, using both of them we can make good maintainable and scalable applications. For improving Haml-js performance, I had to cache the compiled templates on some location […]
In Android, How to obtain Uri of image on SD-Card
How to get URI of image stored on SD-Card? Step 1:- Read the image from SD-Card.
1 2 |
File sdCardDir = Environment.getExternalStorageDirectory(); File yourFile = new File(sdCardDir, "path/to/the/file/filename.ext"); |
Step 2:- Once you get object of image file, you can get URI of the image.
1 |
Uri imageUri = yourFile.toUri(); |
Next:- You ready to use URI wherever you want. Below e.g. shows we can use it to start intent for the […]
Android Emulator, localhost and host files on Windows
We all use emulator with comes with Android SDK to test, how app / websites behave in Android devices. While working on my applications I wanted to access my localhost which was apache server. I tired using IP address as 127.0.0.1 and typing http://localhost many times. But then I gone through the Android Developer site […]
Android ListView with separate headers and images loading from remote server
ListView is one of the commonly used widget in Android. You might have used normal ListView which is just the list of things (text/images). Sometimes you might want to use ListView which has sections or headers. There were no straight forward(easy ways) to do this in Android. Jeff Sharkeys shown us way for creating such […]