Category: Gossip

Explanation of DMIPS

There are essentially two aspects of CPU performance:
1) How many instructions can the CPU execute in a second.
2) How much actual WORK can the CPU do in one second.

The first is controlled by CPU architecture, memory speed, and so on. The second has those as variables, and add “how effective is the instruction set at doing the sort of work I want to do.” For instance, a PIC16xxx running at 20MHz executes 5 million instructions per second, but those instructions operate on 8bit data, and don’t include things like multiply and divide. But the instructions DO include a bunch of bit manipulation and IO instructions. So if you compare the pic to, oh, the 5MHz 8088 in the original IBM PC (should be safe an inoffensive), the PIC will be faster than the 8088 at some things (in particular those things having to do with touching external hardware), and the 8088 will be faster at other things (16bit math.)
For a long time, people tended to measure CPU performance with floating point benchmarks (fortran geeks they were, every one!) There was a set of benchmarks developed (1972!) called the Whetstone benchmarks that would measure a computers floating point performance. Eventually, people started using computers for things other than math, and realized they needed a similar benchmark for non-floating-point (integer) performance. This led to the Dhrystone benchmarks (get it?)

So the PIC32 runs at 80MHz, and generally executes instructions in about 1 cycle, so it does close to 80MIPs. It also runs the Dhrystone benchmark at about 1.5DMIPS/MHz (also 1.5DMIPs/MIP), which shows a pretty efficient architecture (at the sort of application the Dhrystone measures.) It’s more than a tiny core run at very high speed.

(This is one of the reasons you may have read the messages asking about pin-toggle speed. It’s pretty common for fast CPUs to incur a lot of overhead when they have to talk to the outside world; some of the ARM7TDMI toggle rates are pretty embarassing, and a 3GHz x86 cpu can’t do IO instructions much faster than the ancient 8088 (not to mention the terrible things such instructions do to the pipeline/etc.))

read count : 6

SQL to convert all tables from MyISAM to InnoDB

This is the SQL to convert all tables to InnoDB, relace the word to your database name, then run the output again.

SELECT CONCAT('ALTER TABLE `', TABLE_SCHEMA, '`.', TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'DBNAME' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE'

read count : 12

ffmpeg and ffplay for logitech webcam

These command works on windows and capture video using my logitech C920 webcam

Save viewcam to a file, becareful, windows media play may not able to play mp4 in a very clean windows. You can save it to avi.

ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -c copy -y c:\users\peter\desktop\a.mp4

Save viewcam video and play it using ffplay, but it has few seconds delay

ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -c copy -y c:\users\peter\desktop\a.mp4 -c:v copy -copytb 1 -an -f mjpeg udp://127.0.0.1:1234/ | ffplay -f mjpeg p-rpbesize 32 udp://127.0.0.1:1234

Just play it by ffplay

ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -c:v copy -copytb 1 -an -f mjpeg udp://127.0.0.1:1234/ | ffplay -f mjpeg -probesize 32 udp://127.0.0.1:1234

https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2421

read count : 67

ELF-dependency-walker is a tool to view the dependencies of an ELF object/executable

ELF-dependency-walker is a tool to view the dependencies of an ELF object/executable, you can use it to analyst what libraries is an ELF depending to. If you are doing operating system development and trying to port a library from linux to your os, first thing you know is that you need to know how deep of that library is depending to. It is complete open source and free to use. Just download it from https://sourceforge.net/projects/elf-dependency-walker/ and run it by

java -jar elf-dependency-walker-XXX.jar

elf1

elf2

read count : 186

enable paste command in xterm for mac and linux

MAC:

enable paste command in xterm for mac, create ~/.Xdefaults

*VT100.translations: #override  Meta <KeyPress> V:  insert-selection(PRIMARY, CUT_BUFFER0) \n

Linux:
edit /etc/X11/app-defaults/XTerm , add “*selectToClipboard: true" to the bottom, highlight is copy text, shift-insert is paste.

read count : 10

Enable peter-swing theme in netbeans

Edit : /Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/etc/netbeans.conf

Change the line to:


netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true --laf com.peterswing.white.PeterSwingWhiteLookAndFeel -cp:p ~/peter-swing-20150709.jar"

read count : 84