Posts

How to find the extension of a file name in coldfusion | coldfusion code to get file extension of filename

 We can use the following code to get the file extension of a filename provided. First get the file name to a variable, then using listlast ()  we can get the fille extension. <cfset file = "test.png"> <cfset FileExt=ListLast(file,".")> <cfoutput>#FileExt#</cfoutput>

how to use coldfusion variable in javascript | assigning coldfusion variable to a javascript variable

 There are some cases where we need coldfusion variable inside javascript. We may need to assign the javascript variable with coldfusion variable value. For this, we can use the script tag, as we use in HTML and can assign like given below: Please note that the entire JS code have to be inside <cfoutput> block. <cfset a="10"> <cfoutput>     <script type="text/javascript">         var test = '#a#';         alert(test);     </script> </cfoutput>

How to fix cast as numeric gives error converting data type varchar to numeric.

 While writing SQL queries, we may get Errors while doing cast(value as data_type) like below: "converting data type varchar to numeric."  Sometimes the value will be valid and still you see the error while casting. To fix this error, we can use TRY_CAST instead of CAST function. Since when the  cast fails, the  TRY_CAST()  function returns NULL while the   cast()  function gives an error. Syntax :  TRY_CAST(value  AS data_type)

How to add new line in google forms linear scale type question

Image
 Below script helps to add a new line in the linear scale type question in google forms. Follow the steps in the video given for more details: Script : function addLineBreaks() {   var form = FormApp.getActiveForm();       // find form items you need    var questions = form.getItems(FormApp.ItemType.SCALE);      for(i = 0; i < questions.length; i++)   {     var title = questions[i].getTitle();     questions[i].setTitle(title.split(". ").join("\n"));   } }

Whatsapp , Facebook and Instagram crashed globally. on october 4

 No clue on the exact reason, WhatsApp , Facebook and Instagram is down  for a while. The issue is reported globally and not servicing still. WhatsApp has acknowledged that they are working on the issue.  They mentioned  “working to get things back to normal and will send an update here as soon as possible." Users of WhatsApp have tweeted that one of the world's most popular instant messaging apps has not been working for some time now. Some Instagram users also reported that the app is down. No messages were getting delivered on WhatsApp, users tweeted, while no content could be loaded on the photo- and video-sharing app Instagram. Users can check the downdetector to see the current status: https://downdetector.com/status/whatsapp/

How to add a new line in Date type question in google forms

Image
 In Google forms, adding a new line in Date type question can be done by running the below script in the script editor. To follow the steps, please watch the video: Code to Run :  function   addLineBreaks () {    var   form  =  FormApp . getActiveForm ();        // find form items you need     var   questions  =  form . getItems ( FormApp . ItemType . DATE );       for ( i  =  0 ;  i  <  questions . length ;  i ++)   {      var   title  =  questions [ i ]. getTitle ();      questions [ i ]. setTitle ( title . split ( ". " ). join ( "\n" ));   } }

How to add a line break in file upload type question in google forms

Image
 For file upload type, add the below code in script editor in google forms and run this to add a line break for the question . Please refer the video below to see how to do: code: function   addLineBreaks () {    var   form  =  FormApp . getActiveForm ();        // find form items you need         var   questions  =  form . getItems ( FormApp . ItemType . FILE_UPLOAD );       for ( i  =  0 ;  i  <  questions . length ;  i ++)   {      var   title  =  questions [ i ]. getTitle ();      questions [ i ]. setTitle ( title . split ( ". " ). join ( "\n" ));   } }