G'day fellas, This post is a quick tip if you are interested in providing a Background Image to your website and you want it be resized accordingly when a user resize his/her browser. In old days this wouldn't have been possible through CSS at all and we have to do lot of workarounds to make that happen. In CSS3 it is possible and even easier than ever. I will take you through CSS property background-size Browser support has grown for this CSS property, with the latest versions of all big browsers now support background-size, including Firefox, Chrome, Safari, Opera and yippi IE as well, without the need of browser specific properties. background-size property value can be one of these auto contain cover inherit initial We will concentrate on auto, contain and cover. background-size: auto; When you set background-size to auto (this is the default value) this means that the background image is shown at its original size. e.g. CSS to elaborate this A working example is shown here http://jsfiddle.net/upqUc/1/ background-size: auto; is equals to background-size: auto auto; bottom line is that if you do not mention second auto it is added by default. Now lets jump on to background-size: contain; If you use contain value for background-size property that means that your background image is scaled. While scaling it preserves the image’s original proportions and the aspect ratio. Image can go as large as possible as long as it is contained within the background positioning area. What I mean to say is that Image's actual width and height never exceed the viewing area. there may be some areas of the background which may not covered by the background image depending on whether or not the proportions of the background image are matching those of the background positioning area. background-size: cover; If you end up using cover value for background-size property, then the background image is … [Read more...]
PHP pass an Array to Javascript using AJAX (jquery or ExtJs) and PHP’s json_encode
Alright! so this subject has been brought to my attention to write on. There are many reasons why you will want your PHP arrays to be available at client side. One of the main reason for me is that I want to improve overall user experience when I load lot of data for the user and keep it at client side unless another server call is required. This makes application faster and responsive. But this is not the only use case why we may want PHP arrays on client side there are many others which is depends on what you are trying to achieve. One simple answer my friend was seeking was whether it is was really possible to get a PHP array at client side. My answer was Yes! Not only can you bring that array to client side but also in a nice OOPS way using JSON. If you want to know about JSON please visit http://www.json.org Lets do this step by step. First we will create a PHP page or in other words a PHP script as shown below. Save it as target.php Output of above echo will be Let's see how we can get this array in ExtJS 4 Check this code snippet to see how we can get the above array using ExtJS Above code just outputs jsonobj to Chrome's console that you can view by pressing CTRL+SHIFT+I and checking under console tab. For the sake of simplicity I've include a screenshot below As you can see a well formed PHP array in our client side Javascript function. Well from here put your thinking cap on and do whatever you want to do with this data. I heard you asking me a question that how the hell do I even get those Object values. Alright! here is how you do it. So as you can see an Array is return which has two objects. We can access it the way we access an object. i.e. like this Let's see how we can get this array using jQuery Check this code snippet out If you run the above code snippet you will get exactly the same result as shown in the Picture above. You can access the data same way as I shown you before. … [Read more...]
PHP how to convert an array to string and delimited string to an array
Hi Guys, Pretty simple but still needs to addressed for some, my friend asked me this question and I was like dude! just use core PHP functions called implode() explode() Seriously its that simple. So this one is for Tim! Lets explore how to use these functions implode() i.e. Join array elements with a given string Lets consider that we have an array as shown below God now have to make you a Superman after addressing him with so many "dear"'s :) Anyway here is a working example for above code http://ideone.com/kAE95 explode() i.e. Split a string by string and result will be an array Now lets reverse the implode effect! shall we. Above is shown in this example http://ideone.com/ggaN9 I hope concept of Ninja exploding and imploding is now clear to you. Depending on your use case you may also find regex based functions such as preg_match useful. But this post is not about that so I should keep my pen down. Cheers! … [Read more...]
FlashBuilder 4.6 for PHP released!
G'day everybody Great News, I've just noticed that Flash builder 4.6 for PHP is available for download and can be downloaded from Adobe's website. http://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder_php&loc=en_us Total size of download is more than a Gig. If you are upgrading from FB 4.5 to 4.6 your product key should work with new build I suppose. Make sure that you uninstall 4.5 completely before installing 4.6 It ships with Flex SDK 4.6 One challenge you may face is incompatible license with your existing Adobe installs such as master collection etc. Here is what I did to make it work Deactivated (Permanently) my Adobe MC suite 5.5 Activated FB 4.6 for PHP Reactivated Adobe MC 5.5 Another thing to keep in mind when installing is to check iOS support checkbox if you are going to develop iOS apps as shown below Below are few things that we've been waiting for and are delivered in this release Performance boost across all devices SplitViewNavigator gives you more power the way you navigate your App. SoftKeyboard types to launch say Numeric, URL, Email etc SpinnerList DateSpinner Dynamic spash screens and so many other thing that you can write a book on it :) but to know what new you have to download it and try it yourself Cheers! … [Read more...]
Extjs 4 JSONP requests
Hi All, Well because I am on my way to become ExtJs Fan so I will write few articles when I learn new stuff with ExtJS. We all know JSONP. If you don't know what JSONP is you can get started by reading this article on Wikipedia http://en.wikipedia.org/wiki/JSONP All major Javascript libraries support it. But this post is about how to JSONP in Extjs 4. JSONP is an essential proxy and should only be used when making requests to a domain which is different to you current domain. say for example your website runs under abc.com and you would like to get some data from def.com using javascript, default settings will not allow you to do that because of security reason. When you read above article that explains a lot. Sort of technical definition JSONP is script tag injection, passing the response from the server in to a user specified javascript function Let's find out how JSONP requests are made using ExtJS 4 library Well I am going to start with, You guessed it right "Twitter" Twitter offers a public API and support for JSON. With our example first we will include Ext JS in our page like shown below. You will need to change the path to ext files I assume you are familiar with MVC in ExtJs. MVC stands for Model, View, Controller Model is something that defines data and we are going to define one for my twitter account as below So basically I am creating a Data Model with three fields named: text - holds my tweet user_name: holds my full user name created_at: Time it was created. That's UTC time. Because twitter returns far more data, I set my fields to limit the number of fields I want and get rid of the junk. This also allows me to access these fields in a nicer manner. Then comes the important part i.e. defining a proxy. We are using JSONP proxy thus we will set proxy type to 'jsonp' and we will need URL from where we are going to get our data from. reader property is important so that I can set my root … [Read more...]
Piya bawari yeh rishta kya kehlata hai background music mp3
This song is awesome. Here are the lyrics if I got them right :) piya bawari hui bawari,piya bawari khayi bawari, kitte jau re piya kaise pau re piya baawri khayi baawri piya baawri OO khayi baawri kitte jau re nit dhoondhu re it ut puju re kasie pau re,piya tohe paun re piya ki chadriya piya ki rangi re piya ki rangi re piya ki rangi re hekk aaaaaa.... man chua tune ang ang ko rangi re kacha mann rang dhara rang dhara apne hi rang ranga piya ke hi rang diya piya baawri oo khayi baawri Getting straight to the point here is download link for this awesome song. Download Song Leave your comment if you like this song :) I hope I made your day Cheers! … [Read more...]
JCRackSpaceWindowsClient Help
Alright so I wrote this GUI for Rackspace cloud files, Couple of my friends asked me about writing help page so that they know what they are doing. Because this util is FREE to use anywhere I thought amm.. maybe I'll delay writing help files. But things turn out the other way and I have to write this help doco to explain what you can expect and what you could do with this software. Your feedback and comments are always welcomed. Ok so lets started. To download this Util please visit http://jaspreetchahal.org/free-rackspace-cloud-files-windows-client/ Because JCRackSpaceWindowsClient is a long name so I'll call this util JCRWC from here on which means off course you know :). First thing first Disclaimer. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Its completely FREE to use. Now I'll try to bore you a little so bare with me. You can jump directly to a section of your interest. I will be covering Logging into your RS CF account. Creating containers Deleting containers Check container or object information Adding Meta info Deleting a single object and selection Downloading a Container Downloading everything (this can be slow depending on the number of files you have in your RS CF account) Making container Public and Private Preferences All right I think lot of … [Read more...]
Single Click Screenshots with JC’s One Click Screen Grabber
Hi Guys, So I was doing some research and this subject was brought to my attention. With the help of few online tutorials I am proudly presenting to you a FREE tool that quietly sits in your System tray or lately called notification area. Uptil now you would've been doing the following steps to grab a screenshot Press Print screen Open Mspaint Press CTRL+V to paste it Click File Click Save Choose Filename Hit Save That's like 7 steps. Let's see what JCOneClickScreenShots can offer. Click on Notification Icon. Asks where to save screen capture file. Hit save. Done! JCOneClickScreenShots will only capture primary desktop. Prerequisite to use this util: .Net Framework 2.0 Support Only support single screens, In other words dual monitors are not supported Cost FREE Disclaimer THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Download Donations I hope that you will enjoy this util. … [Read more...]
c# how to place caret/cursor position at start or end of textbox
This question has been addressed by many but I will give you an insight on this too Say you textbox is named: txtCaret Now to move the Caret position to the end of text in txtCaret simple use the code below And If you like the Caret position at the beginning of the text Box use the following code If you would like to select all text with txtCaret use the code below So you can do pretty much select any given string in a textbox if you really know what your selection will be. I hope this helps … [Read more...]
c# replace a keystroke character with other key
How do you replace a character with other while "say" you are typing in a textbox or text area. There are couple of ways to do it. Lets consider an example. So say While I am typing a browser URL I always want people to enter '/' instead of '\' I will create an Event for Keydown for your textbox or textarea So lets say your textbox' ID is txtText [Geshi] private void txtText_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Oem5) { txtTest.AppendText("/"); e.SuppressKeyPress = true; } } [/Geshi] In the sample above most important bit is to Suppress the Key press thus we are using e.SuppressKeyPress = true Other way is pretty much the same but you will see a little flicker when replacement occurs so I prefer the above technique always but its worth to show you any way because the technique below will actually replace all source replaceable characters with the new one So this is how you can manipulate Keystokes and do whatever with them. Even though I consider it as not so user friendly but there can be many other use cases where this is acceptable, say for example only allow numerics in a text field etc I hope this helps … [Read more...]





JC WordPress Coupon Revealer Plugin Pro License
Australian Street Names with City, State and Display Names only, Single Server License
Recent Comments