Saturday 13 August 2016

Standing on the other side of Lecture stand

It was a great experience of standing on the other side of the lecture stand. Normally i saw many people standing on the lecture stand and delivering lectures to the whole class. It seems very normal and is the routine of almost every professor to stand there and ask students to follow his instructions.

Also it was normal for me to just stand on the lecture stand and deliver the lecture. All the people stand after me in respect, some willingly and some unwillingly. But they stand still and waits for my instruction to sit down. All the faces were new to me so am i. So i started with little introduction about myself and my qualifications. All eyes ware looking at me as i am a magician who is going to open the box and a pigeon  flew out of it. But it was just my perception, i heard a sound from the last desk,"Sir we are unable to hear your voice, please speak loud". The first time i realize that it is not that easy as i thought. I just toned my throat and start from the beginning. I completed my introduction and asked them for giving the introduction.

They were the fresh undergraduate student who just started their UG. Their mind was not grown to the college level, as they were not expecting this thing. Nobody stand up for introduction. I ask a girl sitting at at the first bench for her introduction. She started with looking at her fellow classmates,"My name is...." and then stopped. I asked her about her past school and life she only uttered only 2-3 lines and then muted. This was the way of introduction of most of the students. Some were good, they explained their past life with confidence, may be the wordings was not correct but their level of confidence was much better than most of the students. 

Monday 15 February 2016

Install Apache2 from source in $HOME directory without root access

1. Download apache2 from source website.
2. Unzip
3. Make installation directory inside $HOME, i made "install" directory in my case.
4. Go inside the apache unzip directory
5. Run command ./configure --prefix=@HOME/path-to-install-directory.
6. make
7. make install
8. Then start apache by $HOME/path-to-install-directory/bin/apachectl start
     
          In my case it throws the following error:
   
          httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1               for ServerName
          (13)Permission denied: make_sock: could not bind to address [::]:80
          (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
          no listening sockets available, shutting down
          Unable to open logs
    
         So error given below is removed by changing the nameserver to localhost     
         httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1               for ServerName
 
         In my case i added ServerName localhost:80  in $HOME/path-to-install-                   directory/conf/httpd.conf 

          and again start apache by the command in step 8 the upper error disappeared but the remaining           was there. 

         so i get some ideas from this link http://askubuntu.com/questions/338218/why-am-i-getting-permission-denied-make-sock-could-not-bind-to-address-when 

         and made the following changes :  
                 I just add Listen 1025 in   $HOME/path-to-install-directory/conf/httpd.conf  file instead of 
                 Listen 80  and again start apache, this time it starts with no error.


Sunday 3 January 2016

Error on upgrading the librehatti from Django1.7 to Django1.8 with Pyhton3.4

$ mysql -u root -p librehatti < librehatti.sql

         |-ERROR 1452 (23000) at line 41792: Cannot add or update a child row: a foreign key constraint fails (`librehatti`.`#sql-3f6_f5`, CONSTRAINT `bills_quoteditem_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `catalog_product` (`id`))

$ python manage.py syncdb


        |- File "/home/aasp/LibreHatti/src/useraccounts/models.py", line 80
           return unicode(self.user)
                  ^
           TabError: inconsistent use of tabs and spaces in indentation

Solution:
         >>http://stackoverflow.com/questions/19295519/indentation-error-with-python-3-3-when-python2-7-works-well
         >>https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

$ python manage.py syncdb         
             |- File "/home/aasp/LibreHatti/src/librehatti/suspense/admin.py", line 9, in <module>
                from librehatti.suspense.forms import StaffForm
                File "/home/aasp/LibreHatti/src/librehatti/suspense/forms.py", line 3, in <module>
                from models import SuspenseClearance
                ImportError: No module named 'models'

Then use

$ python manage.py migrate           
              |- and the same error as above

Solution:
          >> so make changes in LibreHatti/src/librehatti/suspense/forms.py {in this case, "from .models import whatever" in stead of "from models import whatever"}


$ python manage.py runserver

           |- ImportError at /
               No module named 'reports'
           Solution:   
             >>{in this case, "from .models import whatever" in stead of "from models import whatever"}
     
           |- File "/home/aasp/LibreHatti/src/librehatti/urls.py", line 6, in <module>
              from .reports.register_generator import GenerateRegister
              File "/home/aasp/LibreHatti/src/librehatti/reports/register_generator.py", line 13, in                              <module>
              from helper import get_query
              ImportError: No module named 'helper'
             Solution:
             >>same chages as above in forms.py, register_generator.py, and search.py

           |- 'module' object has no attribute 'izip'
           Solution:
             >> replace "izip" with "zip_longest"
             >> http://stackoverflow.com/questions/15698427/merging-three-lists-into-into-one-dictionary
              >> http://stackoverflow.com/questions/32261698/my-idle-does-not-recognize-itertools-izip-as-a-function
             >> https://docs.python.org/3/library/itertools.html#itertools.zip_longest

            |- File "/home/aasp/LibreHatti/src/librehatti/suspense/views.py", line 5, in <module>
               from models import SuspenseClearance
               ImportError: No module named 'models'
           Solution:
              >>{in this case, "from .models import whatever" in stead of "from models import whatever"}

             |- File "/home/aasp/LibreHatti/src/librehatti/reports/views.py", line 5, in <module>
                from forms import ClientForm
                ImportError: No module named 'forms'
             Solution:
              >>{in this case, "from .models import whatever" in stead of "from models import whatever"}

               |- File "/home/aasp/.virtualenvs/py3/lib/python3.4/site-packages/django/core/urlresolvers.py", line 102, in get_callable lookup_view)
                  ImportError: Could not import 'quoted_bill'. The path must be fully qualified.
                Solution:
                   >> Commented the line url(r'^quoted_bill/', 'librehatti.prints.views.quoted_bill'), in url.py