Tuesday, July 1, 2008

Automating insertion of revision number and other information with SVN

















Select all the files in which you want to update the revision number and other details.























Right click and select the Properties tab. Select the Subversion tab and click on properties.
































Set it as shown above in the figure or you may want to have particular settings.


In every file for the first time you have to put the following string

$Id:$


When you commit it to repository it will update these fields to

Ex.

* $Id: display.cpp 27 2008-06-10 08:12:35Z m.patel $


Hope this helps..


-Mihir

Tuesday, June 24, 2008

Reinstalling Ubuntu + Save bandwidth

If you want to save downloading bandwidth then copy /var/cache/apt folder and save it on a protable drive.

after reinstalling put the same folder back at this location and run update.

Monday, June 23, 2008

mkdtemp: private socket dir: Permission denied

Probelm:

/etc/gdm/Xsession: Beginning session setup... mkdtemp: private socket dir: Permission denied



Solution:

A quick

sudo chmod a+w /tmp

fixed it.

Sunday, June 22, 2008

Ubuntu 8.04 \ Error not allowed to access the system configuration

If you have problem running :

System->Administration->Services
System->Administration->Shared Folders
System->Administration->Time and Date
System->Administration->Users and Groups
System->Administration->Networking

If the 'gksu' solution doesn't work for you.

The bug is in the System Communication Bus (dbus) services

Open a terminal :

Code:
gksu synaptic
Re-install all packages with dbus
Now the services will started, everyting will work.

Run:
System->Administration->Services

check System Communication Bus (dbus) services
since re-install packages only run services
and do not re-activate it when you restart my computer.

-Mihir Patel

sudo: must be setuid root solved in Ubuntu

Go to recovery console (reboot, and chose recovery console in case you didn't catch on to how to do that),

fire following commands .


Code:
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
and reboot the machine by

Code:
shutdown -r now


In case if you are getting a "Sudo: /etc/sudoers is mode 0777, should be 0440" message on startup then

go to recovery console and fire following command

Code:
chmod 0440 /etc/sudoers

-Mihir Patel

$HOME/.dmrc file is being ignored solved Ubuntu

Did you install something that screwed up the permissions of your $HOME or did you change it? Boot into recovery mode from GRUB menu and at the prompt, do, assuming your log in name is xx.

Code:
sudo chmod 644 /home/xx/.dmrc
sudo chown xx/home/xx/.dmrc
sudo chmod -R 700 /home/xx
sudo chown -R xx/home/xx
You Reboot and see if you can log in again.

In case if you are getting the sudo: must be setuid root then check out the next post.

-Mihir Patel

Saturday, June 21, 2008

Installing Gnome Do on Ubuntu

Get produvtive with GENOME Do

GNOME DoscreenshotWe’re all swamped with information: emails, documents, pictures and the hundreds of websites we visit every week. There are two ways to deal with the data overload: Get organised and file everything in its right pace. Or you can use GNOME Do, a desktop launcher for Ubuntu in the style of Launchy for Windows and Katapult for KDE, which acts as your humble servant and finds exactly what you’re looking for when you’re looking for it. Sounds too good to be true? GNOME Do is still in the early stages of development but is already showing signs of becoming a desktop essential.

Using GNOME Do is simple enough. Use the meta key (usually the Windows key on most keyboards) and the spacebar to bring the search box to the front, then type in what it is you’re looking for. Looking for a directory? Type in “home” (for example) and GNOME Do will pop up your home directory. Looking for a document? Type in the name and as you’re typing GNOME Do will find documents with a similar name. When you’ve found the one you want hit the enter key and it will launch. The same is true of website URLs.

GNOME DoscreenshotAs you type in your query GNOME Do will pop up the options available to you. There is also a drop-down menu for when there is more than just one possible answer. Click elsewhere on the screen and GNOME Do goes away.

When installed GNOME Do instantly has access to Firefox favourites, applications and configuration tools on the Ubuntu desktop. There are also a good handful of plugins available for doing things such as playing music, accessing instant messaging tools and more.

Ideally Gnome Do is designed for the Gnome desktop environment but there are good reports of it working on KDE and Xubuntu as well.

Installing GNOME Do is very simple in Ubuntu:

First, add the following lines to your /etc/apt/sources.list file

deb http://ppa.launchpad.net/rharding/ubuntu gutsy main deb-src http://ppa.launchpad.net/rharding/ubuntu gutsy main

If you’re running Hardy Heron then change gutsy to hardy.

$ sudo apt-get update && sudo apt-get install gnome-do

Once that is done you’re ready to go … or Do!

Launch GNOME Do from the Applications -> Accessories menu.

[GNOME Do]

(source from : "http://www.tectonic.co.za" by Alastair Otter)

Friday, June 20, 2008

How to Reset Ubuntu 7.04 / 7.10 / 8.10 / Gnome Settings to Defaults without Re-installing

As a new user, there comes a time (or there will come a time) when you are playing around with Ubuntu/Gnome, trying different themes, different engines, different window managers, etc, and all of a sudden you run into a problem that you can’t seem to find a way to fix it.

Computer FrustrationMaybe some of your customized settings are causing your gnome-panel to crash all the time or causing your windows and applications to look ugly, even having window buttons (close, minimize) disappear. You start Googling and spending a lot of time - sometimes days - trying to find how you can fix it.

You are frustrated (sometimes hitting your monitor/tower yelling some vulgarities at it as if it understands and you will kill it if it doesn’t fix it… there’s no Valentine’s love there, that’s for sure) and are ready to go back to Microsoft Windows.

But wait!

You keep thinking, “I wish I could just reset it back to its defaults, like a clean install, without losing all my applications and data.”

Well, you’re in luck. There is a way to reset your Desktop settings back to their defaults. If you keep in mind that everything in Linux is a file, all of its settings are files. All of Gnome’s customizations are located in their own specific folders. And these settings are user specific; they are in your Home folder. If you would create another user and log in with that user, you wouldn’t have any of the problems you are having in your own account. If you remove all these folders, you essentially remove all the settings. Therefore, we will remove the folders needed to reset Ubuntu/Gnome back to its defaults.

UPDATE (2008.01.30): Keep in mind that this will only reset your Gnome-specific settings. If you are having problems with your video card, display, x-server, etc., this WILL NOT fix your problems.

If you don’t have access to your graphical (GUI) desktop to delete these folders in Nautilus or you’re stuck at the login screen, drop to a terminal by hitting CTRL + ALT + F1, login to your account, and run this command:

rm -rf .gnome .gnome2 .gconf .gconfd .metacity

Get back to your GUI desktop by hitting CTRL + ALT + F7.

Login and VOILĂ€! Just like the first time you ever logged into your Gnome desktop.

Wednesday, June 18, 2008

Microcontroller Crystals Basic

Processor Clock Crystals Microcontroller Crystals Basic

One of the most frequently asked questions about microcontrollers has to be
"What kind of crystal capacitors do I use on this chip."
Unfortunately, that's even the wrong question!
This also applies to any other common chip that uses an external crystal timebase.

  • First, the crystal determines the capacitor values, not the chip.
    Atmel's application notes correctly leave off the cap values, since they can't tell you what values to use!
  • There are two types of crystals. Series resonant, and Parallel resonant.
    Most microcontrollers use parallel resonant crystals.
  • If you use series resonant crystals in a circuit designed for parallel resonant crystals, you will never get the crystal to the right frequency.
    Why?
    Because every crystal has two resonant points, the parallel point, and the series point.
    They are very close together, but they cannot ever be on the same frequency.
    Which one you use, depends on the circuit the crystal is used in.
    Crystals are sold as parallel or series resonant, depending on which of these two points is intended to be used.
    The other point is still there, but it may not perform well.
  • All parallel resonant crystals have a specification that tells you how much loading capacitance is expected to be in the final circuit. However, you can't use that value directly.
    First, there will be some amount of parasitic capacitance in the circuit, which we'll call "CP"
    This happens in the traces, wires, and sockets.
    Second, the chip itself will have some amount of input capacitance, which we'll call "CI"
    Finally, the specified load capacitance, which we'll call "CL"
  • A key point, is that from the crystal's point of view, the capacitors are in series.
    This means that the values you need would be twice the value specified for CL.
    If your crystal wants 22pF, then you would start out with an estimated value of 44pF for each cap.
    However, you must subtract a bit for the parasitic capacitance, and the chip's input capacitance.
    The final formula comes out as C=2(CL)-(CP+CI)
  • You can estimate (CP+CI) to be about 5pF as a starting point, so our C value becomes:
    C=(44)-(5) or 39pF.

If all you wanted is to get your project going, then this is what you needed.
However, if you'd also like to minimize your EMI output, then carry on to the next section.


Microcontroller Crystals, Advanced.

So we've got the right cap values, what more could there be?

  • As it turns out, it's not quite so simple, if you care about minimising your EMI output.
    The normal sort of crystal oscillator circuit has an input pin, and an output pin. The input pin is pretty simple-minded, it basically looks like a capacitor. But what's on the other side of that capacitor?
  • Answer: Ground, and VCC. So current into or out of this pin, ends up on Ground or VCC.
    When you think about it, it makes sense. That current has got to flow, and it has got to return to the source.
    This is a key point that's often missed, or not fully understood.
  • Also, the output pin is a pair of FETs that source current alternately, from VCC, and to Ground.
    Is this taking shape yet?
  • If you really want to get it as quiet as possible, you now split your caps (39pF from the previous example) into a pair of 19pF caps on each side, one to VCC, and one to ground!
  • It is critical that these caps connect directly, and only to the processor power pins, by a separate track.
    Don't dump the ground side caps into a plane, and don't connect the VCC side caps to any other point on the VCC tracks.
    If you do, you have just created a shunt-fed antenna, driven by the microcontroller, passing the higher order odd harmonics of the crystal frequency through the caps!
    If anything else is connected to these tracks, then it's an antenna!
  • So why don't you see this technique used more frequently?
    Probably because of the extra expense of two more capacitors.
    Also, because "The other guys don't do it that way."
    Remember, when you copy the other guy's answers, you also copy his mistakes.

Sean:

The purpose in using capacitors with a crystal is two fold:

#1) The oscillator consists of the inverter inside the PIC, the crystal, and external capacitance (both parasitic and actual capacitors). The total phase shift around the loop (from one inverter terminal, through the inverter, across the crystal/capacitor network, back into the inverter) has to be either 0 or 360 (the same thing) degrees for oscillation. The capacitance adjusts the phase shift of the network to allow oscillation.

#2) Crystals are designed to "see" a certain type of load. Most are designed to see a certain, specified capacitance, referred to as the Load Capacitance. In order for your crystal to operate at the correct frequency, it must see this value of capacitance at its terminals.

The total value of capacitance at the crystal's terminals is (Ca+Cp)/2, where Ca is the actual value of capacitor, per pin, that you place at the OSC1 and OSC2 pins, and Cp is the per pin parasitic capacitance. Cp is usually about 8pF or so. So, if your crystal wants to see a 20pF load, you will need to put 32pF capacitors at both OSC1 and OSC2: (32+8)/2 = 20pF This is one of the very useful and neat things that I learned from the PICLIST :-)

In [many cases], it probably "just works" because the parasitic capacitance is enough to satisfy #1 and [the] oscillator is probably running with perhaps 0.1% frequency error, a few kHz with an xtal in the several MHz range.

[This] question is almost a FAQ, and every time it comes up, there is always a debate about the last point that you make: what is the difference between "series" and "parallel" crystals. Here is the usual consensus: there is no difference. Every crystal has a parallel resonant frequency and a series resonant frequency. They are separated by a few kHz and which one you get depends on what value of external capacitance you place on the crystal (I think it ultimately has to do with #2 and exactly what frequency gives the 0 deg phase shift through the whole network). Crystals sold as "parallel" crystals achieve their rated frequency when loaded with the recommended load capacitance. Those sold as "series" crystals achieve their rated frequency when operated in series resonant mode (determined by the external capacitance, but I'm not sure how to figure this one out numerically,since it isn't specified for xtals sold as "series").

If you need a rough frequency standard, just use the (Ca+Cp)/2 formula. If you need strict accuracy, you will have to use a trimmer cap for one of the caps and use it to adjust the frequency.


Ref: David VanHorn

Monday, June 16, 2008

how to use multiple display with one computer

MaxiVista turns any networked computer into an external monitor. MaxiVista's only
hardware requirement is that the two computers must connect to each
other across a network, so it's perfect if you can't add an extra video
adapter. I have a network adapter for my old laptop, so I connected it
to my network and installed the free MaxiVista demo. It worked and my
laptop's desktop was immediately spread across three displays, as shown
in Figure 1.

Figure 1

Figure 1: MaxiVista at work.

If
you don't have an old laptop lying around, you can buy a used laptop
for cheaper than an external monitor would cost. It doesn't need to be
fast—even very old hardware will work with MaxiVista.

Configure MaxiVista

To configure the MaxiVista demo, follow these steps:

1.

Connect
your primary PC (the one to which you'll connect your keyboard and
mouse) and your secondary PC (the one that will act as an extra
monitor) to a network. If you don't have a network yet, connect the two
computers with an Ethernet cross-over cable.

2.

Download MaxiVistaDemo.Zip and open the file in Windows Explorer.

3.

Run MaxiVista_Setup_PrimaryPC.exe on the primary PC and follow the wizard's instructions.

4.

Run MaxiVista_Setup_SecondaryPC.exe on the secondary PC and follow the wizard's instructions.

5.

Right-click the MaxiVista icon in the notification area and then click Enable Secondary Display.

MaxiVista
isn't quite as nice as having an external monitor directly attached to
my laptop, but it's close. I can't run any 3-D games on the MaxiVista
display nor can I watch DVDs on it. I can, however, keep my instant
messages, e-mail, Web browser, or word processor on the display. Though
it has its limitations, MaxVista gave me the desktop space I needed
without requiring me to buy any new hardware.


Ref :Tony Northrup