Posts

Cache policies and its details

Source : http://web.cs.iastate.edu/~prabhu/Tutorial/CACHE/interac.html Reads dominate processor cache accesses. All instruction accesses are reads, and most instructions do not write to memory. The block can be read at the same time that the tag is read and compared, so the block read begins as soon as the block address is available. If the read is a miss, there is no benefit - but also no harm; just ignore the value read. The read policies are: 1. Read Through  -   reading a word from main memory to CPU 2. No Read Through -  reading a block from main memory to cache and then from cache to CPU Such is not the case for writes. Modifying a block cannot begin until the tag is checked to see if the address is a hit.  Also, the processor specifies the size of the write, usually between 1 and 8 bytes; only that portion of the block can be  changed. In contrast, reads can access more bytes than necessary without a problem.  The  write polici...

Use of xargs in linux

Hi all, In order to copy files from one folder to another in linux - try using the following command xargs -a <filename of file containing list of files to copy> cp -t <destination folder> This is better than using cat <filename of file containing list of files to copy> | xargs -d '\n' cp -t <destination folder>

VIM Commenting - Speed up

Hi all, Are you facing problems with commenting in code using VIM? Here's a nice little trick which proved to be very helpful in my coding experience with VIM editor. Lets say you want '#' character repeated 100 times to make your code look more neat. Then all you have to do is In the insert mode type <C-o>100i#<Esc>. C-o means you have to type CTRL + O. # is the character you want to repeat. ESC - to get your output. And you will have # repeated 100 times. This can be done for any character # - needed in bash scripting, python % - Matlab commenting // - C coding. Source : - http://stackoverflow.com/questions/5054128/repeating-characters-in-vim-insert-mode 

VIM Best tips and tricks

Original author - http://rayninfo.co.uk/vimtips.html *vimtips.txt* For Vim version 7.3. ------------------------------------------------------------------------------ " new items marked [N] , corrected items marked [C] " *best-searching* /joe/e : cursor set to End of match 3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] /joe/s-2 : cursor set to Start of match minus 2 /joe/+3 : find joe move cursor 3 lines down /^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line) /^[A-J]/ : search for lines beginning with one or more A-J /begin\_.*end : search over possible multiple lines /fred\_s*joe/ : any whitespace including newline [C] /fred\|joe : Search for FRED OR JOE /.*fred\&.*joe : Search for FRED AND JOE in any ORDER! /\<fred\>/ : search for fred but not alf...

Save power on Linux based system link Linux Mint and Ubuntu

Kernel 3.2 to 2.6 has a bug in linux Mint thus causing laptops to be frying and battery is drastically affected. It is a pcie bus issue that is running at throttle power. Advanced power management comes to our rescue. Follow the below steps --------------------------------------------------------------------------- Change grub file sudo vi /etc/default/grub Change - This line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force intel_pstate=enable" Save and close the file Then sudo update-grub Reboot the machine to see if the problem is solved. If not then apply this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 intel_pstate=enable" Now save file sudo update-grub Reboot and Enjoy a cooler machine

Edge vs Level sensitive interrupts

Edge Triggered Vs Level Triggered interrupts Discussion: Level triggered: as long as the IRQ line is asserted, you get an interrupt request. When you serve the interrupt and return, if the IRQ line is still asserted, you get the interrupt again immediately. Edge triggered: You get an interrupt when the line changes from inactive to active state, but only once. To get a new request, the line must go back to inactive and then to active again. Level triggered interrupt is like a baby. If the baby cries, you have to abandon whatever you are doing and feed the baby. You put her down. If she's still crying, you need to attend her immediately again. As long as she's crying, you serve her needs. You can get back to your work only when she's quiet. If you are in the garden (interrupt disabled) when she starts to cry, then when you get into the house (enable interrupts) the first thing you will do is to see her. However, if she starts crying ...

NUMPY for matlab users

NumPy for MATLAB users Help MATLAB/Octave Python Description doc help -i % browse with Info help() Browse help interactively help help or doc doc help Help on using help help plot help(plot) or ?plot Help for a function help splines or doc splines help(pylab) Help for a toolbox/library package demo Demonstration examples Searching available documentation MATLAB/Octave Python Description lookfor plot Search help files help help(); modules [Numeric] List available packages which plot help(plot) Locate functions Using interactively MATLAB/Octave Python Description octave -q ipython -pylab Start session TAB or M-? TAB Auto completion foo(.m) execfile('foo.py') or run foo.py Run code from file history hist -n Command history diary on [..] diary off Save command history exit or quit CTRL-D CTRL-Z # windows sys.exit() End session Operators MATLAB/Octave Python Description help - Help on operator syntax Arithmetic operators M...