Ace editor cursor position has space between expected position and the current position

Hi, I have used Ace editor a few times in my previous projects. Never did I face this problem before of having my cursor misplaced in my Ace editor. Let me guide you step by step Editor markup Here is a markup where I want my Ace editor to show up. [crayon-5563e554e28f2381298815/] Then I have this CSS that applies to the editor element CSS [crayon-5563e554e290d017547606/] Above CSS allow my editor to take entire space within the document body or relatively positioned container. Then comes the Javascript to do its magic [crayon-5563e554e291d423395514/] Now the editor will show up and I am able to do my thing. However I now have a unique issue where when I start to type the cursor position is a bit far from the text, so basically I have a gap between the expected and actual cursor position in my Ace Editor as shown below It turned out that Ace editor must use monospace font and I was setting fonts on a not so recommended way as shown below [crayon-5563e554e292f864962088/] Just to check things out and enforcing my editor to use monospace font fixed the issue instantly. This is what I changed my styles for my editor instance to which solved it. [crayon-5563e554e293f817801699/] I also ended up cleaning the way I was applying my fonts to all my elements by getting rid of * construct. I hope this helps   … [Read more...]

Online webpage to image conversion with includes API

Hi Guys, I thought I would inform that there is a new tool available for taking screenshots of webpages called Talking about features there are many Unlimited renders/month High quality renders Custom window and shot size 30 days caching for web shots Delivery over SSL Webpages are rendered to either PNG or JPEG Enforce a new web shot to override cache Up to 10 referring websites per account Free Email support Custom user agent or accept language headers Reliable Flexible Cancel anytime First 7 days free Over 3000+ fonts supported This makes it quite appealing, so if you don't want to host your own screenshoter then this tool will help you out to get started. With Free support and anytime cancellation of your subscription it can't get any better. Renders are delivered over SSLto make it even more appealing. Render time varies as renders cannot happen until full page is downloaded. Try it out I bet you will like it. Regards     … [Read more...]

CommandLine Convert WMF, EPS etc to SVG using inkscape

Hello, I thought this might be a good tip to share for people who are looking to convert their vector images to SVG format. inkscape is the right tool just for that. Get inkscape from their website for you operating system Download it and install it. Make sure that inkscape executable to environment path. I am using windows but commands to convert any of the supported format to SVG is not different in any other operating system too. Example 1 Below is command to convert an EPS file to SVG file [crayon-5563e554e4832306574372/] Above command will out test.svg file which you can view using any modern browser or SVG viewer Example 2 Command below will convert a wmf file to svg. Please note that wmf is primarily a windows format and this command will only work in Windows. [crayon-5563e554e484e719770890/] So this is just a start you can explore more command line options available with inkscape from link provided in resources section of this article If you have anything else to add please leave your comment. Let others benefit from what you've done with your work or if you know of any other tool that is capable of doing better job. I will be writing a tool based on inkscape for batch processing files. Resources Command line options for inkscape inkscape website … [Read more...]

Installing New Comodo Positive SSL Certificate on Apache and OpenSSL on Centos, Fedora and RedHat

Hello, I had to buy a certificate and install it on my new server I was issued with a new certificate by Comodo under Comodo Positive SSL. To start with I think it doesn't matter which certificate you choose, end of the day they all follow pretty much same standards and the only thing that make a certificate expensive is a company or issuing authority such as thwate (expensive). I personally always choose a cheapest certificate on market. Anyway with latest certificate I received 4 files in an archive as shown below You could just install a certificate by adding [crayon-5563e554e52db076139512/] and it will work on some browsers but you would need intermediate cert as well. Here is what always gets me. With latest PositiveSSL They give us 3 files which we need to combine and feed it to [crayon-5563e554e52f5844396186/] So to do that you will run this command [crayon-5563e554e5306674029798/] Considering that all you files are under /home/crt/2014 folder our final VirtualHost confg will look like this   [crayon-5563e554e5315585819191/] Once you made above change, don't forget to restart your apache service generally located as /etc/init.d/httpd restart on Centos and Red Hat OS If you have any comment or would like to point out any error please leave your comments. … [Read more...]

Rackspace Cloud FIles Bulk Delete objects prefixed/* wildcard php sdk

Hi Guys   Rackspace cloud files is an awesome file storage system, We upload a file and can make it publicly available through their CDN. While I use Cloud files in pretty much all my projects at work or personal stuff, one thing that I did today was to delete objects with specific prefix e.g. Lets say I have these objects under container "jcorg" hello hello1 hello2 anothervaluableobject and I want to delete all objects whose name starts with hello Here is a code snippet that will be handy for you Language: PHP API link: and of course you can use equivalent code in other language SDKs too     Code Snippet [crayon-5563e554e609e905329720/] Let me give you a brief overview to you First we are creating a connection to Rackspace server, depending on which region you are in you will use either RACKSPACE_US or RACKSPACE_UK to authenticate your request. [crayon-5563e554e60b8193449884/] Then we are connection to our object store [crayon-5563e554e60c9333449298/] Then we are getting hold of object list where name or an object starts with "hello" [crayon-5563e554e60da046494389/] Finally we are iterating on objects found and deleting them. You can check object name here to just to filter them out before you process them for deletion [crayon-5563e554e60ec994338633/] I hope this makes sense, but just in case if you have a question, do leave your comment.     … [Read more...]

How to make xml_split, xml_merge, xml_pp, xml_grep, xml_spellcheck under XML-Twig tools work on Windows

Large XML files could sometimes lead to overall slowness of your program. Thus it makes sense to sometimes split them to rearrange contents within to optimize querying your XML files. This post will touch base on how to split a large XML file on windows OS and I will use a cool tool written by Michel Rodriguez. XML-twig is presumably an open source library that works on large XML files. Notable tools includes XML Grep XML merge XML pretty printer XML spell check XML split Our focus is to build this library on windows so that we can use it from windows command prompt Download XML-Twig Get this library from cpan websites. Here is the URL Download the XML-Twig-3.48.tar.gz file and extract it under c:\devtools Here is a screenshot of what it looks like on my machine   Lets leave it there for the time being and install prerequisites Pre-requisites There are a couple of pre requisites that you will want to install. Perl. As this library is written in perl so you would want to install Perl on your system. ActiveState perl is something that I sometimes use and is a good option by far on Windows computers. Download for your processor arch 32 bit or 64 bit from the URL below I installed it under c:\perl64 Visual studio Express 2010 for tool called "nmake" I've got Visual studio 2012 but you can get an express edition of "Express 2013 for Windows Desktop" from URL below Now that perl is available from command prompt You may also want to run this command ppm install MinGW64 Above will install dmake as a perl module too just in case if you want to use that. But in this article I will use name.   That's it for the pre requisites and I hope that you would have installed both of the above so that we can move on to next … [Read more...]

Google MarkerClusterer Handling Multiple Markers On Same Geo Location

When you are dealing with addresses on Google Maps there are times when you have multiple addresses for a same location. For example if you live in a building with 200+ apartments, building address remains the same but you also add apartment number to your address to precisely locate you. Here are couple of address examples 1/991 Buleen Road 2/991 Buleen Road From the example above its clear that 991 buleen road is building address, 1 and 2 are apartment numbers. I would just use InfoWindow to go with MarkerCluster to show details of multiple points. Lets check out the code below   [crayon-5563e554e7e93124098212/] And that's pretty much it. Here is a working example of above code Two things to remember while doing above code You have to instantiate MarkerClustere [crayon-5563e554e7eb4469992568/] While creating Markers, you can add any custom property to your marker, or hell of an amount of data, so when you create your info window, you have that data available. Also you can have a look at another way of handling it I hope this helps or at least gives you a pointer what you should be doing for multiple markers for same location. Cheers,   … [Read more...]

How to clear DNS Cache in Windows small business server 2011 or windows 2008 r2

G'day While I do not write on Windows server too often but here is that once in a blue moon article or you can assume a quick tip on how to clear DNS cache, Reason can be any but sometimes we have to do it. Locally we will just use [crayon-5563e554e8bd1497816874/] to flush local DNS issue but on the server side here is how its done Step 1 Goto Start > Administrative tools > DNS You will see all your zones including forwards, reverse lookups and conditional forwards. To view Cached lookup goto View > Advanced Now you will see an entry called Cached lookups appear as shown in image below Gobind is my server name. Step 2 (Clear DNS cache) From here on there are 2 ways you can clear your cache. Either select Cached lookups entry and then Goto Action > Clear cache  as shown below OR Right click on Cached lookups entry and then left click Clear cache from cotext menu as shown below   You don't have to restart your DNS service. You can then Right click > Refresh to see if caches are gone, they will :) I hope this helps, In case you would like to leave your input, do so by leaving your comments.         … [Read more...]

Google Maps How to do a KML Layer overlay fill

Hi Guys, Now that I am experimenting with Google Maps I thinks its about time to write a few articles. This is the first one in the series to follow in coming weeks. This post covers how to draw a KML Layer overlay using Google Maps. Good thing is that as of version 3 there is no external library is needed to do what we are going to do. KML that I am going to use can be downloaded from the link provided at the end of this post. Final result will look like below Code Snippet You would have a clue how to use Google Maps API to draw simple maps so I am not going to explain line by line but you can use the code snippet to extend it   [crayon-5563e554e9530636469283/]   This will produce a nice KML Layer with a polygon created from the coordinates supplied from the KML data. To change the colors of the line and highlighted area you can change color value under style element values as shown below [crayon-5563e554e9547307983534/]   Remember color property is not your typical HEX color. Its defined as aabbggrr (alpha, blue, green, red)   Download Demo KML You are able to download the KML file from the link below That's about it actually.  Most of the power is in your polygon data and GM API take care of the rest. I hope this helps Cheers, … [Read more...]

How to download JW Player flash mp4 flv movies

To start with let me tell you that this method works most of the time, and I will use our friendly browser Firefox to do the hard bit i.e. downloading. You can also utilize other browsers too, I haven't personally tried those. There are many other tools available, no doubt about that. But I love to keep things simple for myself so just sharing my approach here. Leave your comments if you think you have a better way to do this, because this will help others including myself. First of all let me touch base on the reasons why we may want to download videos Many video tutorials authors record their videos and won't publish them on Youtube so you can't really use "view it later" function like pro video sites offers. Browser bookmarking can get really messy in no time unless you use some online bookmarking sites, so its easier to maintain a video library locally on your machine You may want to keep a copy to view those when you are not connected to the Matrix, I mean Internet Or you are just a download freak. i.e. you download stuff just for the fun of downloading as your ISP offer massive amount of monthly download quota for you to consume. Anyway lets not waste more time and see what can be done Step 1: Download Firefox Just in case you don't have FireFox then get it here   Step 2: Launch Firefox Launch Firefox and goto Firefox > Addons as shown below   Now in the search field type "Flash Video Downloader" You will see a result that looks like this Click the Install button and once its installed, Restart your Firefox, do not forget this Once FF restarts you will observe that there is a new Icon next to the address bar as shown below Step 3 Goto the URL where video is hosted Type the URL which is hosting video of your interest played by JW Player. Click on the Play button, this will enable our Add-on to detect which file player is getting video data from. You will notice that the Add-on button with … [Read more...]