Skip to main content

Posts

Showing posts from January, 2020

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://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topfreeapplications/limit=10/xml")         Log.wtf(TAG,"OnCreate: done")     }     companion object {     

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 above code we mentioned targets as 0, that means it will disable ascending descending option for first column, you can disable sorting for multiple columns by separating them with comma(,) Source code for disable sorting for multiple column. var oTable= $('#idDataTable').DataTable({               "order": [[ 3, "asc" ]],               'columnDefs'

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