Submit your Rss Feed Link Below

Tuesday, October 6, 2009

ExpertCore - All Topics

The Vim Editor Cheat SheetIf you are a Linux/Unix user, chances are that you are using the well known vim editor for your casual text editing. In case you are not familiar with it, Vim is a text editor that has no GUI and is executed via the unix shell. You may be thinking that this makes it more difficult to use, but once you get to know the basics, you will begin to love the idea that you don’t have to use your mouse to change lines and will also be surprised at its efficiency.

One thing that is arguable about Vim is the fact that it has a pretty large and complicated set of commands that appear daunting to the first time user.Here is a very important reference to the most used vim commands. I suggest that you print this out and have it somewhere close to you in order to get the most out of it.


Remote Filesystem in Unix (SSHFS) sshfs is a program with which one can open(or edit) a remote filesystem in unix( i think it also can work under fat and ntfs). It’s extremely important in cases where vnc is not possible, since only console is available.

The installation process is very simple and nothing to describe anything more here. For more information check:
http://fuse.sourceforge.net/sshfs.html

sshfs creates a group under the name fuse. In order to be able to run an executable as a user, this user should have to be
inside that group, have permissions over the newly mounted file and have execute access at /usr/bin/fusermount and /etc/fuse.conf. These things happen after issuing the commands below:

Code: adduser ForTheWin fuse
mkdir mountDir
chown ForTheWin:fuse mountDir
chown ForTheWin:fuse /dev/fuse
chmod +x /usr/bin/fusermount
chmod +x /etc/fuse.conf


If you like you can also add a line at /etc/fstab :
Code:   sshfs#user@server.domain.com:/starting/path fuse user,allow_other 0

...
How to Set Yourself as Super User (Sudoer) Sudo, is a program that allows a system user to execute commands like he/she was the administrator of the system. By default, the only user of the system that is allowed to use sudo, is the root user, also called superuser. However, there is the file /etc/sudoers inside which we can add the users of the system that we allow them to use sudo.

There are aliases and more that you can use in order to determine groups of users and such, but the basic and classic usage is just to give sudo rights to a user, something that can be achieved using this line inside the /etc/sudoers file :
Code: ExpertCore  ALL = (ALL) ALL


This command gives the system user ExpertCore, the right to execute everything on the machine as any user(including root).

Some other examples could be:
Code: User_Alias PEOPLE = clare,kalvin

PEOPLE ALL=ALL

#The users in the PEOPLE group can run any command from any terminal.


Another example could be :
Code:   gregory ALL= PRINTING

# user gregory may run lpc and lprm from any machine.

...
How to Recompile Linux Kernel If you are a native linux user, you have surely been in the case where you just did not need a system with just about every package there is out there. If you always wanted to know how to upgrade your kernel manually and configure what packets you need yourself, read on.

Most people ask the reason of upgrading kernel and how to do it. The operating system’s kernel is the basic element of your operating system and is responsible for managing various tasks, like memory management, pagination and many many more. As you can understand, the kernel includes some modules that are essential for the identification of your hardware, such as your network card and more.

The disadvantage is that the default installation of the kernel includes many more elements that what you really need. For instance, if your computer has an AMD processor, you really have no apparent reason to use the modules that the kernel includes for Intel processors.

So, there comes up a need to create your own configuration
...
Biomechatronics Biomechatronics is an applied interdisciplinary science that aims to integrate mechanical elements, electronics and parts of biological organisms. Biomechatronics includes the aspects of biology, mechanics, and electronics. It also encompasses the fields of robotics and neuroscience. One example of Biomechatronics is a study done by Hugh Herr a professor at M.I.T.. Herr tore off the muscles of frog legs, to attach to a mechanical fish and by pulsing electrical current through the muscle fibers, which caused the fish to swim. The goal of these experiments is to make devices that interact with human muscle, skeleton, and nervous systems. The end result is that the devices will help with human motor control that was lost or impaired by trauma, disease or birth defects.

How it works

Biomechatronics devices have to be based on how the human body works. For example, four different steps must occur to be able to lift the foot to walk. First, impulses from the motor center of the brain are
...
Radio frequency Identification ( RF ID ) Radio Frequency identification is a technology for use in AIDC (Automatic Identification
and Data Capture). RFID systems collect accurate and real-time data and communicate it
via radio waves. A typical RFID system has three components, tags, reader and RF
unit. The RF reader sends out RF waves that are received by the RF tag within the
reader's range. The tag in turn, sends information back to the reader, also in the form of
RF waves. Then the RF reader transfers this information to RF unit.



Tags

RFID tags are in three forms.

01. Passive RFID tags - No battery power
02. Active RFID tags - Battery powered
03. Semi Passive RFID tags



RFID Frequencies

RFID systems are available in a wide range of frequencies to suit various performance
needs. Frequency is an important factor in transmission range and speed. However,
bandwidth availability is regulated by telecommunications authorities in each country,
and not all
...
Important Math functions in Visual Basic Secant
Code: Public Function Sec(X As Double) As Double
   Sec = 1 / Cos(X)
End Function


Cosecant
Code: Public Function CoSec(X As Double) As Double
   CoSec = 1 / Sin(X)
End Function


Cotangent
Code: Public Function CoTan(X As Double) As Double
   CoTan = 1 / Tan(X)
End Function


Inverse Sine
Code: Public Function ArcSin(X As Double) As Double
   ArcSin = Atn(X / Sqr(-X * X + 1))
End Function


Inverse Cosine
Code: Public Function ArcCos(X As Double) As Double
   ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function


Inverse Secant
Code: Public Function ArcSec(X As Double) As Double
   ArcSec = Atn(X / Sqr(X * X - 1)) + Sgn(X - 1) * (2 * Atn(1))
End Function


Inverse Cosecant
Code: Public Function ArcCoSec(X As Double) As Double
   ArcCoSec = Atn(X / Sqr(X * X - 1)) + (Sgn(X) - 1) * (2 * Atn(1))
End Function


Inverse Cotangent
Code: Public Function ArcCoTan(X As Double) As Double
   ArcCoTan = Atn(X) + 2 * Atn(1)
End Function


Hyperbolic Sine
[code]Public Function HSin(X As Double) As Double
HSin = (Exp(X) - Exp(-X))
...
Data Types Data Types

As you may have noticed, VB supports several data types. These are what the main 'Types' that you can declare your variables as. For example:

Dim intCount As Integer

is an Integer. You always should tell Visual Basic what sort of data the variable will hold. This will make your code easier to use, and will also save memory. Different types of variables need different amounts of memory. You need to use the smallest amount of memory. For example, if you will need to store a number from 0 - 255 in a variable, you can save memory by declaring it as a Byte (1 byte) rather than as an Integer (2 bytes). This is not really very much memory, but if you are untidy with all your variables, your application will use much more memory than it has to.

The table below lists the various Data Types, what data they can store and how many bytes they use.


...
How to check internet connection is available or not There are several methods to check Internet connection availability and in this method try to open given URL for check the connection.

Code:  

'Declares for direct ping
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal lpszAgent As String, ByVal dwAccessType As Long, ByVal lpszProxyName As String, ByVal lpszProxyBypass As String, ByVal dwFlags As Long) As Long
Private Declare Function InternetOpenUrl Lib "wininet.dll" Alias "InternetOpenUrlA" (ByVal hInet As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Long

Private Const INTERNET_OPEN_TYPE_PRECONFIG = 0
Private Const INTERNET_FLAG_RELOAD = &H80000000
Private Const INTERNET_FLAG_KEEP_CONNECTION = &H400000
Private Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000

Private

...
C++ Programming Practice Guidelines 1 Introduction

C++ programming guidelines often mix coding style issues, good programming practice and program design issues in a somewhat confusing manner. The present document focus mainly on good C++ programming practice. For guidelines on C++ programming style refer to the C++ Programming Style Guidelines. For guidelines on programming design issues, consult writings on programming patterns, object-oriented software design etc.

1.1 Layout of the Recommendations.

The recommendations are grouped by topic and each recommendation is numbered to make it easy to refer to during code reviews.

Layout of the recommendations is as follows:


Recommendation short description
Example if applicable
Motivation, background and additional information.

[color=blue] 1.2 Recommendation Importance n is a
...
Windows Registry Files and Where to Find Them To locate your Windows Registry files you will need to know which Windows platform you have. There are currently only two Windows platforms that all versions of Windows are built on. They are both named after the earliest version of each platform.

Windows XP, 2000, 2003 and Vista are all newer versions of the Windows NT platform. They all use the NT Kernel32.dll, although the Kernel32.dll has been updated / modified for each Windows operating system.

Windows 95, 98, 98 SE, and ME use the Windows 95 Kernel32.dll and are all part of the Windows 95 platform. Here again, the Kernel32.dll has been updated / modified for each new operating system.

The Registry files cannot be read from a DOS prompt, or the Recovery Console, or even a text editor in Windows. These files are databases, and only RegEdit, Regedit32 and the Kernel32 can read them. To read them in Windows enter RegEdit in the Run window at the Start button.

Windows 95 platform
In Windows 95, 98, and 98 SE there are only
...
C Operator Precedence

Note 1:
Parentheses are also used to group expressions to force a different order of evaluation; such parenthetical expressions can be nested and are evaluated from inner to outer

Note 2:
Postfix increment/decrement have high precedence, but the actual increment or decrement of the operand is delayed (to be accomplished sometime before the statement completes execution). So in the statement y = x * z++; the current value of z is used to evaluate the expression (i.e., z++ evaluates to z) and z only incremented after all else is done.
Making a bootable CD from a bootable floppy image This document describes how to burn a floppy image file onto a CD. For this exercise we'll use /scratch/linuxinst/m91inst/images/network.img as the image to burn.

Mastering And Burning It the Easy way
Assuming the floppy image file to be turned into a bootable CD is /scratch/linuxinst/m91inst/images/network.img, master CD image /tmp/cd.iso with the following command:
mkisofs -pad -b network.img -R -o /tmp/cd.iso /scratch/linuxinst/m91inst/images/network.img
Note the following:


[tr][td]This defines the output
Command parameter or partFunctionality
-padAdd padding to the end to make it readable on all CD players
-b network.img-b tells mkisofs which *floppy image* to use for booting. If the floppy image boots as a floppy, it will boot as a CD. Note that there is no path prepender to network.img. The network.img bootable image is assumed to be relative to the file being imagized, in this case
/scratch/linuxinst/m91inst/images/network.img
-RInclude Rock-Ridge extensions for readability everywhere
-o /tmp/cd.iso

...
Converting Bootable Floppy Disks to Bootable CD ROM Here are the step by step instructions to convert single as well as double diskette bootable floppies into bootable CD.

Softwares required:
  1. WinISO [Shareware]
  2. WinImage [Shareware]
  3. burnatonce [Freeware]
  4. UBCD [Ultimate Boot CD] [Freeware]
  5. PowerQuest Partition Magic or PowerQuest Drive Image.

STEPS:

  1. Get the latest version of Ultimate Boot CD (UBCD). This file will be in ".iso" format. ISO formats are standardized formats used for direct CD burning.

    UBCD is basically a set of useful tools that can be started while booting your computer. This document will describe how to include your bootable floppy disk image into "UBCD.iso" so that the CD boots in the same manner as a regular floppy disk would.

    To accomplish this I will take examples of 1-disk bootable floppy (MS-DOS Startup disk) and 2-disk bootable floppy (PowerQuest Partition Magic)
  2. To create MS-DOS Startup Disk (Windows XP):

    • Insert 1.44" floppy into floppy disk drive.
    • Right-Click on floppy drive in Windows Explorer and select format.


    • A dialog box will appear. Select "Create an MS-DOS Startup Disk" checkbox and click "Start". Bootable MS-DOS startup Disk will get created.



      To create Powerquest Partition Magic (PQPM) 2-Disk Rescue diskettes:
    • Install Powerquest Partition Magic and when instructed insert blank floppy disks into floppy disk drives to create 2-Set bootable disks.

    ...
    System On Chip (SOC ) Intergrated Circuits

    System-on-a-chip or system on chip (SoC or SOC) refers to integrating all components of a computer or other electronic system into a single integrated circuit (chip). It may contain digital, analog, mixed-signal, and often radio-frequency functions – all on one chip. A typical application is in the area of embedded systems.

    The contrast with a microcontroller is one of degree. Microcontrollers typically have under 100K of RAM (often just a few KBytes) and often really are single-chip-systems; whereas the term SoC is typically used with more powerful processors, capable of running software such as Windows or Linux, which need external memory chips (flash, RAM) to be useful, and which are used with various external peripherals. In short, for larger systems System-on-a-chip is hyperbole, indicating technical direction more than reality: increasing chip integration to reduce manufacturing costs and to enable smaller systems. Many interesting systems are
    ...
    Hardware description language In electronics, a hardware description language or HDL is any language from a class of computer languages and/or programming languages for formal description of electronic circuits, and more specifically, digital logic. It can describe the circuit's operation, its design and organization, and tests to verify its operation by means of simulation.

    HDLs are standard text-based expressions of the spatial and temporal structure and behaviour of electronic systems. Like concurrent programming languages, HDL syntax and semantics includes explicit notations for expressing concurrency. However, in contrast to most software programming languages, HDLs also include an explicit notion of time, which is a primary attribute of hardware. Languages whose only characteristic is to express circuit connectivity between a hierarchy of blocks are properly classified as netlist languages used on electric computer-aided design (CAD).

    HDLs are used to write executable specifications of some piece of hardware.
    ...
    Semiconductor intellectual property core In electronic design a semiconductor intellectual property core, IP block, IP core, or logic core is a reusable unit of logic, cell, or chip layout design and is also the intellectual property of one party. IP cores may be licensed to another party or can also be owned and used by a single party alone. The term is derived from the licensing of the patent and source code copyright intellectual property rights that subsist in the design. IP cores can be used as building blocks within ASIC chip designs or FPGA logic designs.

    In digital-logic applications, IP cores are typically offered as generic gate netlists. The netlist is a boolean-algebra representation (gates, standard cells) of the IP's logical-function, analogous to an assembly-code listing for a high-level program application. The netlist protects the vendor against reverse-engineering, while maintaining portability to multiple foundry targets. Some vendors also offer synthesizable versions of their IP cores. Synthesizable cores
    ...
    Application Specific Integrated Circuits An application-specific integrated circuit (ASIC) is an integrated circuit (IC) customized for a particular use, rather than intended for general-purpose use. For example, a chip designed solely to run a cell phone is an ASIC. Intermediate between ASICs and industry standard integrated circuits, like the 7400 or the 4000 series, are application specific standard products (ASSPs).

    As feature sizes have shrunk and design tools improved over the years, the maximum complexity (and hence functionality) possible in an ASIC has grown from 5,000 gates to over 100 million. Modern ASICs often include entire 32-bit processors, memory blocks including ROM, RAM, EEPROM, Flash and other large building blocks. Such an ASIC is often termed a SoC (system-on-a-chip). Designers of digital ASICs use a hardware description language (HDL), such as Verilog or VHDL, to describe the functionality of ASICs.

    Field-programmable gate arrays (FPGA) are the modern-day technology for building a breadboard or prototype
    ...
    Direct Digital Control Direct digital control (DDC) is the automated control of a condition or process by a digital device (computer)

    In HVAC

    DDC is often used to control HVAC (heating, ventilating, and air conditioning) devices such as valves via microprocessors using software to perform the control logic. Such systems receive analog and digital inputs from the sensors and devices installed in the HVAC system and, according to the control logic, provide analog or digital outputs to control the HVAC system devices.

    These systems may be mated with a software package that graphically allows operators to monitor, control, alarm and diagnose building equipment remotely.

    A very early example of a DDC system meeting the above requirements was completed by the Australian business Midac in 1981-1982 using R-Tec Australian designed hardware. The system installed at the University of Melbourne used a serial communications network, connecting campus buildings back to a control room "front end" system in
    ...
    Distributed Control Systems A distributed control system (DCS) refers to a control system usually of a manufacturing system, process or any kind of dynamic system, in which the controller elements are not central in location (like the brain) but are distributed throughout the system with each component sub-system controlled by one or more controllers. The entire system of controllers is connected by networks for communication and monitoring.

    DCS is a very broad term used in a variety of industries, to monitor and control distributed equipment.
    Electrical power grids and electrical generation plants
    Environmental control systems
    Traffic signals
    Water management systems
    Oil refining plants
    Chemical plants
    Pharmaceutical manufacturing
    Sensor networks
    Dry cargo and bulk oil carrier ship

    Elements

    A DCS typically uses custom designed processors as controllers and uses both proprietary interconnections and Communications protocol for communication. Input & output modules form component parts of the DCS. The
    ...

No comments:

Post a Comment