Saturday, July 28, 2012

MAC Address


Unless you have something like Virtualbox installed (which installs its own set of virtual LAN cards), you can try typing getmac at the command prompt. It should provide you your LAN card's MAC address.
If you do have Virtualbox installed, you might consider running getmac /v instead for more verbose output. It will list down the connection name associated with the MAC address.
screenshot of getmac

Wednesday, May 30, 2012

VHDL port Array


the solution is to declare
Data Types 33
TLFeBOOK
user-defined data types in a PACKAGE, which will then be visible to the whole design
(thus including the ENTITY). An example is shown below.

------- Package: --------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
----------------------------
PACKAGE my_data_types IS
TYPE vector_array IS ARRAY (NATURAL RANGE <>) OF
STD_LOGIC_VECTOR(7 DOWNTO 0);
END my_data_types;
--------------------------------------------

Source: Circuit Design with VHDL, Volnei A. Pedroni
MIT Press





Monday, May 28, 2012

Modify VHDL Assertion Message



The clew is to edit modelsim.ini in modelsim installation folder refer to ModelSim User's Manual in the chapter explaining "modelsim.ini Variables" -> BreakOnAssertion.

Have Fun! ;)

Thursday, April 5, 2012

Ubuntu Trash on NTFS Volume

1. Edit the fstab file

kate /etc/fstab

add uid=1000 in the option part

/dev/sda3       /home/norma/Documents/data        ntfs  defaults,uid=1000    0  0 
/dev/sda2       /home/norma/Documents/refreshing  ntfs  defaults,uid=1000    0  0 



2. Create a .Trash-1000 folder in the NTFS root Volume


Sunday, January 15, 2012

Friday, January 13, 2012

Auto-Mount Hard Drives on Ubuntu

use Storage Device Manager




it is available on Ubuntu Software Center


Saturday, January 7, 2012

Sunday, January 1, 2012

Trim function for std::string

This is a simple and efficient function to trim a string class in C++

void trim(string& astring, const char t){
   string::iterator it;
   
   for (it=astring.begin() ; it < astring.end(); it++){
      if(*it==t){
           astring.erase(it);
       };
   }
}

usage example

trim (number, ' ');

I think it is quite clear.