Posts

Showing posts from May, 2023

Automatic start and shutdown cloud hosted VM

Image
  Most of the time our development VM running without use and that cause additional cost. We can save the cost when VM is not in use we can shutdown and when we want to use we can turn on. We have many ways to start and stop VM to save cost. One of the way I will share in this topic. using this we can schedule automatically start and stop of VM using task. A. Automatically start the VM 1.       Login https://portal.azure.com/ 2.       Go to Automation --> Tasks(Preview) --> Add task 3. Click on Start virtual machine 4. Authenticate the Azure VM and outlook(to receive the VM start/stop related notification on your outlook) 5. Click on configure and create the task name, VM start time, time zone etc. If you want outlook notification related to VM start, mark yes to Notify me option. 6. We have configured and finally click on review + create...

Language translation at run time

Image
  Sometimes we need to show data two or more languages on form/report which is not possible by any configuration and achievable only using code. Below code help us to translate data from one language to another using code at run time.       public static void main(Args args)     {         str inputStr = "Parashuram";         System.String downloadedString;         int len, extraOutputLen, commaOutputLen;         str resultActual, url =              "https://translate.googleapis.com/translate_a/single?client=gtx&sl=" + "en" + "&tl=" + "hi" + "&dt=t&q=" + inputStr; // "en" is the source language, "hi" is the target language and inputStr // is the to_be_convert string // url return the result as : https://translat...