Pages

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by default, the ImageMagic conversion is turned-off for some image file extensions. For example, I frequently convert .jpeg/.jpg to .eps. But, every time, I got an error. Here is the way how to solve it [Remember to change back the settings after converting the file in order to avoid vulnerability].

You have to change the policy.xml file in the installed ImageMagic package. 

To do that, USE:

sudo vim /etc/ImageMagick-6/policy.xml

and change the following line

<policy domain="coder" rights="none" pattern="EPS" />

to 

<policy domain="coder" rights="read | write" pattern="EPS" />

and save. Note that you should change "none" to "read | write" and then save.

Once you did this modification, you can convert using "convert" command.

Now, TRY:

convert figure.jpg figure.eps

After conversion, you may change back the line as it was before (to avoid vulnerability) which is very important.

For more information on the security issues, you can visit these links.

https://www.enisa.europa.eu/publications/info-notes/what2019s-behind-imagemagick-vulnerability

https://security.stackexchange.com/questions/122328/how-to-prevent-the-latest-imagemagick-vulnerability

Andre Geim on writing

 Andre Geim describe what he learnt from his Russian literature teacher (from the biography)

"I also learned an important lesson from my tutorials in Russian literature. My tutor said that what I was writing was good but it was clear from my essays that I tried to recall and repeat the thoughts of famous writers and literature critics, not trusting my own judgement, afraid that my own thoughts were not interesting, important or correct enough. Her advice was to try and explain my own opinions and ideas and to use those authoritative phrases only occasionally, to support and strengthen my writing. This simple advice was crucial for me – it changed the way I wrote. Years later I noticed that I was better at explaining my thoughts in writing than my fellow students."

Andre Geim on solving problems

 Andre Geim explains in his autobiography as follow.

"We solved many problems from old exam papers either from Phystech or, even harder, from international Olympiads. But even more helpful was the way he taught me to deal with physics problems: it is much easier to solve a problem if you first guess possible answers. Most problems at Phystech level require understanding of more than one area of physics and usually involve several logical steps. For example, in the case of a five-step solution, the possibilities for dealing with the problem quickly diverge and it may take many attempts before you get to the final answer. If, however, you try to solve the same problem from both ends, guessing two or three plausible answers, the space of possibilities and logical steps is much reduced. This is the way I learned to think then and I am still using it in my research every day, trying to build all the logical steps between what I have and what I think may be the end result of a particular project. After a couple of months, my tutor no longer asked me to write up a solution. Instead, I just explained verbally the way I would solve a particular problem – all the logical steps required to get to its end without describing routine details. This allowed us to go through the problems at lightning speed."


Try try try again!!!

 The other day, I saw comma.ai founder Hotz trying Jupyter Noetbook in the recenly released Apple M1. The duration of the video, I think a few hours.

In the first few minutes he encounter an error. 

He tries to solve by installing packages. But, problem unsolved.

Then, he tries to identify the cause of the problem.

Then, again, again, again, again, ....he is trying to solve the problem.

Then, he uses debugging packages.

First he try but not useful.

Then, on the live stream some suggest to use another debugging package.

He uses that.

That is also not easy. He tries again and again.

Finally he find the exact problem by identifying the function that causes, and know how to solve it.

This is the first time, how for even an expert in coding how difficult is coding.

Now, come to another situation.

The documentary "The Dawn Wall". 

The climber tries again and again and again to become successful. He fails a lot of time.

So, in order to achieve anything great you have to keep on trying. On the way, you will encounter one or more problems which are extremely difficult. But, you have to keep on trying again and again and again even after continuous failure. It will lead to success.

This can be applied to any field.

You are doing research and you did not get the required property or want to tune the property to the required level. If you didn't put this much effort, you will never get significant research results which can be influential.




Using Jupyter notebook in Apple M1: Error 2850 Segmentation fault

 In the live video stream by George Hotz titled, "Programming | tinygrad: neural engine on M1? | Science & Technology | Apple M1 | Part4"

He almost spent 1 hour to find out what causes the error and debugging.

He uses a number of installations, cloning repositories, debugging, installations, etc.

Here is the solution he found.

Install faulthandler as follo.

pip3 install faulthandler  

(if your python version is higher than 3.3, it is inbuilt)

The error is in the use_app_nope package.

Just comment out it. The problem solved.

For more detail, you can watch the full video. 

Or you may watch the video at https://youtu.be/mwmke957ki4?t=2929








Geoffrey E. Hinton's advice for students (from Coursera)

This part is taken from an Interview of Prof. Geoffrey E. Hinton by Prof. Andrew (in Coursera course)

What is your advice to students to want to pursue a career in Deep Learning?

(I thin that the answer given by Prof. Geoffrey E. Hinton is useful to any researcher irrespective of the field of research)

Here is the answer.

"Read the literature, but don't read too much of it. So this is advice I got from my advisor, which is very unlike what most people say. Most people say you should spend several years reading the literature and then you should start working on your own ideas. And that may be true for some researchers, but for creative researchers I think what you want to do is read a little bit of the literature. And notice something that you think everybody is doing wrong, I'm contrary in that sense. You look at it and it just doesn't feel right. And then figure out how to do it right. And then when people tell you, that's no good, just keep at it. And I have a very good principle for helping people keep at it, which is either your intuitions are good or they're not. If your intuitions are good, you should follow them and you'll eventually be successful. If your intuitions are not good, it doesn't matter what you do."

[Prof. Andrew Ng: I usually advise people to not just read, but replicate published papers. And maybe that puts a natural limiter on how many you could do, because replicating results is pretty time consuming.]

"Yes, it's true that when you're trying to replicate a published you discover all over little tricks necessary to make it work. The other advice I have is, never stop programming. Because if you give a student something to do, if they're botching, they'll come back and say, it didn't work. And the reason it didn't work would be some little decision they made, that they didn't realize is crucial. And if you give it to a good student, like for example. You can give him anything and he'll come back and say, it worked. I remember doing this once, and I said, but wait a minute. Since we last talked, I realized it couldn't possibly work for the following reason. And said, yeah, I realized that right away, so I assumed you didn't mean that. "

[Prof. Andrew Ng: ny other advice for people that want to break into AI and deep learning?]

"Basically, read enough so you start developing intuitions. And then, trust your intuitions and go for it, don't be too worried if everybody else says it's nonsense."

"If you think it's a really good idea, and other people tell you it's complete nonsense, then you know you're really on to something."

I think that this advice is applicable to any technical field. Some researchers spend too much time on reading and this lead to too much bias in the published results. If researchers read just enough so that they can think and work on a problem, they can contribute something new in that field. Otherwise, they will be doing just what others have done (mostly incremental work).

Another thing I understand is that students and researchers should try to replicate seminar research papers from the scratch. This help the researchers understand the process the top researchers have undertone. This often provide the skills needed to find out something new in that field and contribute novel works in that field.


Reference:

Weblink: https://www.coursera.org/learn/neural-networks-deep-learning/lecture/dcm5r/geoffrey-hinton-interview


How to add math equations in blogger using LaTeX or MathJax?

Here is the website mathjax.org website and you can find the demo here.

In the demo page, you can see following equation written in latex or mathjax equation. 

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are

If you write $x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$,


you will get follwing formatted equation.

When $$a \ne 0$$ there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
To write such beautiful equations using either mathax or LatTeX in your blogger post or blogspot domain blog, you can do following steps. This is also true for any website if you want to write a code using HTML and other programming languages.
  1. Go to this MathJaX getting started page and copy the code (or simple copy the code below)
  2. Go to Themes in your blog on blogger
  3. Chose Edit HTML
  4. Paste the code (copied from mathjax.org) just below <head> tag[The <head> tag probably will be within 10 lines of code in there]
  5. Save and you are now ready to write LaTeX code or MatJaX code in Blogger.
The code is here [If you want copy this too.

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

Now, you are ready to write beautiful math equations using either LaTeX or MathJax.

If this post is useful you can comment here for visibility of this post as well as this blog.

Do you have any other suggesstions? You can add here.

Thanks. 


They do better by going to school less!

The schools in Finland are the model for the entire world. They do better by spending less in the school.   

   

What are the languages they speak? Most students name atleast two languages.
  • English 
  • Swedish
  • Finnish
  • German
  • French

  • How these students are able to learn this may languages despite spending less time in school than many countries? 

    Strange and counter intutive points from here.

    1. Less home work
    2. Say no to multiple choice questions
    3. School is about finding your happiness finding what you know, finding what you learn and what makes you happy
    4. Teach everything to kids: music, singing, art, drawing, etc.
    5. When you move to a new city, we don't ask for the best school. It is never a question. Because all schools are same.
    5. There is nothing different from one school to another in the entire country. They are all the same. 
    6. It is illegal in Finland to set up a school and charge tution. This makes sure that the rich parents have to make sure that the public schools are great.

    The one thing i disagree in this video is about what to tell people on what they want to be. I defer from what the teacher at 7:10 says telling that you can be anything you want to be when you grow up is a lie. Even though it is a lie, at very young age (atleast 15 years old) the interest of the students should as diverse as possible. They should not be forced to focus on a single thing unless the wanted. Isn't completely different from the core idea of the video?

    What makes the students to like something or unlike something? It is entirely based on the way they are brought up, the people they meet, the environment. In such environment, it is not a correct way to focus on what the students want. I am not sure at what age the students focus should be narrowed down. 

    The end of the video says very important points.

    1. Try to teach kids to think for themselves
    2. Be critical to what you learn
    3. Try to teach student sto be happy person 
    4. Teach to respect to others and themselves.

    Another followup video (which Youtube suggested after watching the above video)

    What if Finland's great teachers taught in your schools?


    Why we need to spend more money on energy related projects?

    You can calculate the amount of money each country spends (each year) on gasonline (petrol or diesel or gas). Surely, it will be in many 10s of billions. Now, calculate last year's budget on energy research. If you compare these amounts, surely the later will be insignificant. Are the we ignorants? 

    Here is a short video by Bill Gates. 


    This is is really mind blowing. Are you satisfied with what your country spends on energy related research? Comment here.

    Working with Matplotlib and Pandas (Python package for graphs)

    import pandas as pd
    import matplotlib.pyplot as plt

    file = pd.read_excel('/full/path/to/file.xlsx')

    When you run this, you may get following error.

    ImportError: Install xlrd >= 0.9.0 for Excel support
    To proceed further, install xlrd package using
    
    pip install xlrd or pip3 install xlrd



    For mentioning the sheet number in the excel sheet import.

    df =pd.read_excel('fileName.xlsx', sheet_name='Sheet4')


    You may be interested in these posts

    Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

    This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...