Sep 30, 2015

How to heal dried and chapped skin on hands

If you are living in a cold climate like me, or a high altitude place, it is likely that you experience dried skin specially on back of your hands, as I do. It can get painful and very irritating. The skin can become so crispy that it looses its flexibility and bending a finger causes cracks and blooding, which generally occurs around knuckles.

I have used many different hand lotions and hand creams, but none really worked. I found the solution  to this problem by accident. Once that my hands' skin was in that chapped condition I took a dry sauna. Surprisingly, after the sauna I found that my skin has become much better, it had healed and it was not any more crispy. I have found the main reason to this problem.
The reason is that I barely sweat in this cold weather such that my hands' skin never get wet or moisturized by sweat. However, I am used to warm climate where my skin is normally moisturized by my sweat. That's it! Sweating keeps my hands' skin soft and fresh.
To prove this to myself I have tested this further by travelling back home when my hands' skin was again in the worst condition, chapped and blooding. Result? After two days being in warm climate, my hands were brand new! Smooth and soft with no pain.

Now, to heal my dried chapped hands I tend to take dry sauna once in a while where I sit long enough that my hands sweat a lot. After the sauna I apply some normal lotion on my hands, and the result is great. Using gloves in colder periods of time and in wind is inevitable to protect the skin. This has become a good healing and also good prevention method for me.

Conclusion: If you have chapped skin on you hands make your hands sweat.

May 18, 2015

Time lapse of clouds in a sunny day

Some days clouds just look amazing, and in such a day it is so difficult not to photograph them. However this time I shoot about 1400 photos in about 1.25 hour to see how beautiful they move, change their shape and dissipate.

May 12, 2015

How to log debug data in TI CCS?

* This topic is based on experience with Texas Instruments (TI) Code Composer Studio (CCS) version 5.5

Let's say we have pressed the green bug button in order to debug our project when it is running on a target device. We add some variables of our interest, e.g. temperature sensors, to the CCS' Expressions view for watching them during the debug session. Here, assume we only use JTAG. What if we want to log these data in a file for analyzing it in a later time? Obviously to halt the program and do a copy and paste from the Expressions view to a text file manually is a burden! Good news is that there is a better way to do this, and the key is to use Scripting Console within CCS. To see the Scripting Console view follow this menu steps: "Window -> Show View -> Scripting Console". Let's denote Scripting Console by SC in the rest of this text.

Scripting Console in CCS v5.5

The scripting language of SC is JavaScript. To see the already existing functions and definitions in SC press the "Tab" button. To view help for each of the listed items type "help item_name". To serve our logging purpose the "saveData" command is the right tool for us. Let's see the help for it: 

 js:> help saveData
Description: Save a block of target memory to a data file format
Syntax: saveData(address,page,filename,length,IOFormat,append)
  address - the first address in the block
  page - the memory page, use one of the PAGE_X constant
  filename - specifies the name of the file that store the target data
  length - defines the number of words to store
  IOFormat - Specifies the format in which memory words will be written to the output file. Use one of the IOMEMORY_X constant
  append - true to append to an existing file, false to overwrite. Note: append is not supported for COFF formatted files.
 It is pretty clear what to do now. So if we stick to our example of logging temperature sensors we need to know where in memory these values exist. If the variables are in a structure and we add that structure to the Expressions view, the address of that structure is already shown under the Value column. Another way to find the address for any variable is to right click on its name in the Expressions view and select "View Memory", and voila!, you find the address highlighted in the left column, e.g. something like 0x0000BA10. Note that if you change your code which manipulates data storage, then you want to check the addresses again.

 Next in the line is 'page', and in our example we need PAGE_DATA, which is a predefined variable in the SC, just it. Then the filename is where the log file is stored. We have to give the filename as string and note that a windows path like "C:\MyProjects\hemnik\logs\temp.log" will not work, because \ (backslash) is used as escape notation in JavaScript which is used to encode special characters. Find more about JavaScript string here, and if you want to know moew about JavaScript here is a great reference. So to make this path work we need to support each \ with another \ and our example path becomes "C:\\MyProjects\\hemnik\\logs\\temp.log". Remember to keep the quotes around the string, both single or double quotes work.

 The length is dependent on the number of variables we want to store at once, let's say we have 3 temperature sensors, so we write 3. We choose IOFormat based on the data type. If we want to log data as a float value we use IOMEMORY_FLOAT, if integer we choose IOMEMORY_INT and like that. Take care about the length and IOFormat, they are interrelated. The last parameter, append, is a Boolean and based on our need we choose either true or false. All said, let's see the example command in one line:

 js:> saveData(0x0000BA10, PAGE_DATA, "C:\\MyProjects\\hemnik\\logs\\temp.log", 3, IOMEMORY_FLOAT, false)

 Press enter, and we get an error that says 'Could not open file', so we need to make the file before running the command. Now it works and we are done with the basic logging! But still it is not convenient to type this command for different variables and in different times one by one in the SC. A better choice is to use "loadJSFile" command in SC: 

 js:> help loadJSFile                                                                               
Description: Load a JavaScript file or all the JavaScript files in the directory. Example: loadJSFile c:\myDirectory\myJavaScript.js
Syntax: loadJSFile(file,store)
  file - the JavaScript file or a directory.
  store - [optional] true, store the file(s) to the preference, the script will auto reload the next time the view is open.
This is our key to a better automated logging process. We write all the desired logging commands in a JavaScript file and only by loading that file in SC all the logging process is done. This way, we can write logging commands for any number of variables we need at different memory locations with different IOFormats only once and in one file. Another great possibility is that we can even include the whole process of starting the debug session and running the code on the target in our script and control the steps. Let's see all these in a simple example script, e.g. saved as C:\MyProjects\hemnik\ccs_run_test_log.js:

Then we only need to run this script in SC as following:

js:> loadJSFile C:\MyProjects\hemnik\ccs_run_test_log.js

That's it! Good luck with your projects.

May 7, 2015

First sound here

I named this weblog 'Light and Sound', but until now all the posts are only about light. Here is the first sound here.
I have made this piece long time ago, played on piano and whistled. I am not a musician at all, actually it just happened for me to own a piano and well I sit and play what I feel.

I hope ...

Mar 18, 2015

Tronheim's smoking

A strong northern lights, Aurora Borealis, happened over Trondheim, and it was amazing, all around and moving fast. It was so beautiful.