Skip to main content

Posts

Android Kotlin read rss feed xml data from url

Android Kotlin read RSS Feed XML data from URL in the most efficient way Today we learn how we can read XML data from an url by using most efficient and short code. We can use java for it but then will need to write more code compare to below code. So we will use kotlin functions to read RSS Feed from apple . In below code we will read top 5 free download apps list data of apple store rss feed  that will be in XML format. class MainActivity : AppCompatActivity() {     private val TAG = "MainActivity"     override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_main)         Log.wtf(TAG, "onCreate Called")         val downloadData = DownloadData()         downloadData.execute("http://a...

how to blink texts using pure css animation

how to blink or highlight texts using pure css animation Hello, today we will learn how to add blink effects on text by using css 3.CSS3 provides animation property that we can use for animation effects like blink with time interval. Please use below code: .blink_me {   animation: blinker 1s linear infinite; } @keyframes blinker {   50% {     opacity: 0;   } }

jQuery Datatable disable sorting for one column or multiple column

jQuery Datatable disable sorting for one column Sometimes we want to remove sorting in datatable so today we will learn how to disable sorting for any specific column in simple steps. jQuery datatable provides columnDefs option that we can use to remove sorting (asc/desc) from any column . Please use below code:   var oTable= $('#idDataTable').DataTable({               "order": [[ 3, "asc" ]],               'columnDefs': [{                     "targets": [0],                     "orderable": false                 }]           }); So in ...

Pure JS convert word or string first letter to capital

Pure JS convert word or string first letter to capital Today we learn how to convert first letter capital of a word by using pure JS. So here is the some methods that we can use to make it word captilize in js and jquery Convert first letter to capital of a string or word Method 1: function ConvertToCapital(word) {     return word.charAt(0).toUpperCase() + word.slice(1); } Method 2 function ConvertToCapital(word) { return word[0].toUpperCase() + word.substr(1); } var a = ConvertToCapital("hello"); console.log(a); //Output = Hello var a = ConvertToCapital("hello this is test"); console.log(a); //Output = Hello this is test Convert all words to capital of a string Method 2: function ConvertToCapitalStr(str) {   return str.toLowerCase().split(' ').map(x=>x[0].toUpperCase()+x.slice(1)).join(' '); } var a = ConvertToCapitalStr("hello this is test"); console.log(a); //Output = Hello This Is Test I...

Deploy and run react app on godaddy vps or shared hosting without root access

SOLUTION: How to Deploy and run react app on godaddy vps or shared hosting without root access Today we learn how to run react app on vps server or shared hosting. Main issue with godaddy servers is they do not provide you root access also they do not support node js by default, so its not good choice for latest technologies app like react apps. Ok but no issue we have a solution to install node without root access in vps or shared hosting of godaddy. So keep follow below steps to run react app in godaddy servers or any shared hosting server FOR VPS SERVER USERS for vps users please create your server first and create a cpanel and connect a domain with that, to connect domain go to dns management and change default name servers to your domain server like ns1.yourdomainname.com and ns2.yourdomainname.com now point your domain to the hosting by changing nameserver details in your domain configuration. -------------------------------------------- NOW THIS STEPS ARE SAM...

How to upgrade Cakephp 3 to Cakephp 4.x

How to upgrade Cakephp 3 to Cakephp 4.x So Cakephp 4 is released and now cakephp did major changes is that : 1. Now cakephp using more typehinting and strict mode. 2. cakephp replaced .ctp file extension with .php so now all tempalates files have .php extension . 3. Now templates folder moved from src to root folder. 4. Some functions are now deprecarted that you can check on its official website . Now today we learn how to upgrade Cakephp version to latest version. So keep follow below steps:- 1) Open terminal and go to the root directory folder 2) Then run below command to install upgrade tool       git clone git://github.com/cakephp/upgrade 3) Now above command will create upgrade folder in your root directory so change drive by using below command cd upgrade 4. Now we need to install new files of cake 4 so run below command: git checkout 4.x 5. Now run below command composer install --no-dev Ok so now we have all new updated file ...

Solution - Hide a div when user clicked outside of it using jQuery

Solution - Hide a div when user clicked outside of it using jQuery If you want to hide an element like listbox, div or dropdown or any html element when click outside of it but not hide when click inside of it then we can do this by using simple jquery code Please use below code to hide an element on outside click. $(document).mouseup(function(e)   {       var containerElem = $("#list-request-suggestion"); //YOUR ELEMENT ID OR CLASS       if (!containerElem.is(e.target) && containerElem.has(e.target).length === 0)       {           containerElem.hide();       }   });   Related Links Hide a div when clicked outside of it How do I detect a click outside an element ? How to hide div on outside click except one inside div through jquery   html - Use jQuery to hide a DIV when the user clicks out...