Mika/Notes/Computer Stuff: Difference between revisions

From WikiDotMako
< Mika‎ | Notes
Line 25: Line 25:
** bin/pitivi
** bin/pitivi


=Latex=
I just started my own bsisneus in Aug 2010 and could really use this workbook and all it has to offer.  The topic I Would like for you to talk about is weddings and how to make sure you record that special day, so that when the bride opens here wedding album she feels like she is putting on her dress to walk down the isle, she feels her dads lips on her cheek kissing her before he hands her to her husband, so she sees the tears in her husbands eyes when he sees her for the first time in her wedding dress, and so she experiences her wedding night all over again when she picks up her album. I want to know how to capture those pictures that bring back that smile that so often a memory can forget ;)
 
* For debian, apt-get texlive.


=Inkscape=
=Inkscape=

Revision as of 17:10, 9 June 2012

The incidents in Mangalore has to viweed in different angles to find out the root cause. There is lot of concern amongst the people of Mangalore regarding the ill-gotten wealth of a particular section of the society through counterfeiting/ Hawala/Narcotics trade & other illegal Antinational Activities supported from across the border. The money thus accumulated by these people is spent lavishly on purchasing land which is strategically located & useful for their criminal activities, corrupting the people, funding politicians favorable to them, coercion by taking undue advantage of people to fulfill their needs, exploiting Women in distress & or poor financial status of this sensitive coastal part of the country. It is not surprising that there is an undercurrent of anger amongst a large section of people in & around Mangalore against it. As these criminal & antinational activities go unchecked, people support some Sena or Dal. This is evident by the fact that a large number of people including Women gathered to welcome & garland the people who were involved in the Pub incident when they were released. Instead of finding the root cause & addressing it, the symptoms are viweed as antisocial & sensationalized. Sending politically motivated commissions will be of no use. Another delegation of Women's commission was sent to Mangalore because the first one did not give a favorable report to be used against political opponents during the forthcoming general elections. When a commission or Political delegations of various political parties visits a town one by one the Administration & Police accompany the commission/delegation stretching the already overstretched police force, thus diverting the attention from the important real issues in these troubled times of terror from across the border.The message to the media is Dont aggravate & blow incidents out of proportion which may even lead to a riot & loss of life.The media hype over these incidences clearly shows that the hype is done to descredit the BJP before the general elections

Debian

  • Debian Installation
  • Debian Maintenance
  • sid = unstable but pretty stable.
  • Look at packages.qa.debian for todo's and qa.debian under my name for all the bugs and other information.
  • Popcon means popularity contest but there are people who install a package but don't use popcon.
  • dpkg -l (package name): gives the version of the package.
  • To get the system up to date:
    • apt-get update (Used to re-synchronize the package index files from their sources. And then;)
    • apt-get upgrade
  • To upgrade to Squeeze (except I wanted testing = Wheezy):
    • change lenny to squeeze in /etc/apt/source.list
    • apt-get update
    • apt-get install apt dpkg apt
    • apt-get dist-upgrade: error message telling me /var/cache/apt/archives doesn't have enough space. Ran aptitude clean and it was cleaned up.
    • I changed to Wheezy because I wanted Gnome3.2. I changed on the /etc/apt/source.list.
  • pitivi wasn't as good as dpic's. He said to do:
    • apt-get build-dep pitivi: Normally, specific headers and shared libraries need to be present in order for a source package to be compiled. All source packages have a field in their control files called 'Build-Depends:' that indicates which additional packages are needed for the package to be built from source. APT has a simple way of downloading these packages. Just run apt-get build-dep package, where `package' is the name of the package you're going to build.
    • git clone git://git.gnome.org/pitivi
    • cd pitivi
    • ./autogen.sh && ./configure && make (make is an essential program for installing much unpackaged source code software. The developers can write down all of the complex information about how to configure, compile, and install their work in make files that you usually won't have to read. Just check README or INSTALL files that come with the source code to see whether it uses this system, or has different instructions. Another program with similar functions is jhbuild.
    • bin/pitivi

I just started my own bsisneus in Aug 2010 and could really use this workbook and all it has to offer. The topic I Would like for you to talk about is weddings and how to make sure you record that special day, so that when the bride opens here wedding album she feels like she is putting on her dress to walk down the isle, she feels her dads lips on her cheek kissing her before he hands her to her husband, so she sees the tears in her husbands eyes when he sees her for the first time in her wedding dress, and so she experiences her wedding night all over again when she picks up her album. I want to know how to capture those pictures that bring back that smile that so often a memory can forget ;)

Inkscape

  • I wanted to use a landscape canvas: Go to File -> Document Property - Choose Landscape.
  • I wanted to use text: Press F8.

Bug Report

  • I have trouble using Inkscape because it crashes when I try to use text. Here's how to get a backtrace:

gdb <path to inkscape executable>

(gdb) run [parameters (optional)]
# Carry out the actions to make the program crash
(gdb) bt

R

  • expression and assignment

PHP

Problem:

Again, I was doing this tutorial. I got the update/delete working but not insert. Even when I typed in the values, it returned Missing Values.

Solution

I said name="id" in select3.php in the form part for insert3.php but I said _POST[ID] in insert3.php. I changed it to id and it works fine now.


Problem:

I was doing this tutorial. First of all, I didn't quite write down the codes right:

  • incorrect update/delete versions linked from select.php
  • <?= is good <? = is not good
  • _GET['X'] is good but _GET["X"] is not good.
  • Don't free memory in the php that is required_once

After fixing all these, I got:

"failed query" SQL:SELECT Name WHERE ID =

Solution

Since I got the same message for both update and delete, I figured that the problem was elsewhere. I looked at select3 and after update3.php? I said id= instead ID= . I capitalized the id for bother update3 and delete3 and it works fine now.

MySQL

To be sorted:

Cheat Sheet

  • command line to restart mysql: /etc/init.d/mysql start
  • check ps fax for mysqld to see if the mysql server is running.
  • mysql_connect()
  • mysql_select_db()
  • mysql_query()
  • mysql_num_rows()
  • mysql_free_result()
  • mysql_close()
  • This is for outputting mysql queries into a text file: mysql > select * from table INTO OUTFILE '/tmp/test.txt';

Problem:

I tried to write a php and connect to mysql in it but I got an error:

Fatal Error: undefined function mysql_connect()

Solution:

This page suggested that mysql isn't enabled by dafault in php5. I installed php5-mysql and restarted apache2 (don't know if that was necessary) and now it works.


Problem:

I restarted my computer because I couldn't start gimp unless I was root. Clint told me that I should sudo /etc/init.d/dbus restart , which basically restarted my whole computer. Since then, I couldn't use mysql because I kept getting this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Solution:

I followed this and restarted mysql by:

/etc/init.d/mysql restart

But it fails. It seems like I touched my.cnf and didn't restart mysql, so when my computer restarted, it incorporated the changes I made in my.cnf and mysql stopped working. I reinstalled mysql-server through apt-get, restarted mysql and now it's fine.



Problem:

I have a bunch of text files from USDA, which contain bits and pieces USDA ASCII databases. I want to put them into mysql.

Solution:

1. I found schema.sql that Erik created, so I'm going to borrow it rather than creating my own.

mysql databasename < schema.sql -p


Problem:

mysql> create database newdatabase;

ERROR 1044 (42000): Access denied for user 'user'@'localhost'...

Solution:

mysql

1. Check grants for 'user'@'localhost' in mysql:

mysql> show grants for 'user'@'localhost';

2. Log into mysql as root (has all privileges) and change grants for a specific user:

mysql> grant all privileges on *.* to 'user'@'localhost';

Query OK, 0 rows affected (0.00 sec)

3. Log back into mysql as user (now has all privileges) and try creating a new database again.


Python

To be sorted

  • TypeError: fetchone() takes exactly 1 argument (2 given)
    • This really means 1 argument given because each method comes with an argument to begin with.
  • To obtain input, I can use raw_input().
  • bpython
  • time
    • from datetime import date, timedelta (to do day calculations)
    • d=date.today()-timedelta(days=7)
    • In order to compare dates in string and dates in datetime in iso formats; n > d.isoformat():

Problem:

I wanted to create a wiki table from CIA's Infant Mortality Rate ranking data. I didn't want to change to the wiki table format, so I decided to write a python code.

Solutions:

I had to read a text file, make a list for each line, take out the words I need, and print in the wiki table format. I did the following first to change tabs to commas but that was probably not necessary:

    sed 's/\\t/,/g' Desktop/rawIMRdata.text > rawIMRdata2.text


When I forgot /g, it only outputted the last line.

Here's the python code:

    imr_data = open("rawIMRdata6.text")
    #f = file("imr_data","r")
    print {| class="wikitable" border="1" \n|- \n!  Ranking 1 \n!  Country 2 \n!  IMR \n
    for line in imr_data.readlines():
        # To make a list for each line from text file:
        a = line.split(',')
        #print a and strip the space after each word
        one = a[0].strip()
        two = a[1].strip()
        three = a[3].strip()	
        combined = '|-\n|' + one + '\n|' + two + '\n|' + three   
        print combined
    print r|}

Django


  • Tried setting up Django on my computer by following this tutorial

Problem:

It worked mostly ok but I couldn't go further than the second to the last coding box on page 4. I kept getting long error messages.

Solution:

Django tutorial about django.contrib.admin

1. Check if I typed in the correct codes.

2. Check if the output are the same everwhere:

Although the codes were correct, they didn't create all the necessary things, so it couldn't find the index.html.

  • I went to setting.py to specify:
    • the absolute path for Template_Dir. Don't forget the , after '/path/' .
    • two additional Installed_Apps: myprj_myapp (where I save my project) and django.contrib.admin . Run python manage.py syncdb afterwards.

This created myapp_post and django_admin_log in mysql database.


Javascript


JS Tutorial


HTML/CSS

Problem I couldn't put the content and the sidebar side by side.

Solution CSS: added floar:left to content.

Problem: I didn't know how to align text on both sides in html or css.

Solution: HTML: p style="text-align:justify CSS: p.special {text-align:justify;}

---

Problem:

I didn't know what meant.

Solution:

This website says: An HTML table has two kinds of cells:

   * Header cells - contains header information (created with the th element)
   * Standard cells - contains data (created with the td element)

Problem:

I didn't know what <form name="form1"> meant.

Solution:

"A form is an area that can contain form elements.

Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form." とほほのjavascript

GPG/PGP

1. Make a gpg key. 2. Register on pool.sks-keyservers.net.

  • To open a pgp signed email in mutt, first imap-fetch to my email inbox. If the encrypted message doesn't ask my passphrase, download the attachment (hit v, download no description. file (the file name) should say PGP message), and run: gpg --output (outputfile.txt) --decrypt (downloaded file name). Enter passphrase.

GNOME

  • Switch windows when a mouse moves over without a click: System -> Preference -> Windows

Wiki tricks

  • insert : to make a single indentation. Insert more for multiple indentation.
  • insert < blockquote> makes a paragraph blockquote -- couldn't find ways to insert breaks between lines within a blockquote.
  • insert < code>


Hi, I found your blog on this new directory of WordPress Blogs at batakhctbooaclmp.com/listofwordpressblogs. I dont know how your blog came up, must have been a typo, i duno. Anyways, I just clicked it and here I am. Your blog looks good. Have a nice day. James.