M-x sxml2html
. The buffer will translate itself to labaffles.html. In case an error occurs, you can go to the original buffer by typing M-x sxml-to-source
.
Teaching the Art of Programming and Languages using JavaScript
Here we attempt teaching programming using JavaScript. Why JavaScript? Because it is an elegant and powerful dynamic language readily available under the skin of this web page - inside of your Web Browser. The course is a rather lengthy web page with numerous text-fields with pre-punched examples which you can change and evaluate in real time (but disable your javascript popup-stoppers, please)
Java Applet/App for finding SPICE tube parameters interactively with GIF or JPG image as input.
java -jar spice.jar <probefile.out>
. Source (Spice.java) is included in spice.jar. The source is fairly elaborate and is in fact an output of a codegen tool. The real 'source' for spice.jar is the following macro code:
/* # usage: java Spice <simdatafile> [lpr] [n] # where l:log p: power r: RMS n: load in ohms # by default: voltage amplitude, percentsh # # usage examples: # java Spice simres.out # V, amplitude, percents # java Spice simres.out l # V, amplitude, logarithmic # java Spice simres.out lrp 16 # W, RMS, logarithmic, into 16 ohm */ EXTEND Awk5; AWK FS(' '); DEF boolean rms, watts; DEF double signal, load; DEF Hashtable spectrum, signals; BEGIN String options = ARG2, type = (INDEX(options,"l") > 0 ? "log" : "%"); BEGIN int count = 0, order = 1, scale = ((type == "log") ? 1 : 100); BEGIN String ampl_t = (INDEX(options,"r") > 0 ? "RMS" : "Amplitude"), out_t = (INDEX(options,"p") > 0 ? "W" : "V"); BEGIN { rms = ampl_t == "RMS"; watts = out_t == "W"; load = (ARG3 != "" ? (DOUBLE ARG3) : 8); ARGN = 1; // only 1st command-line arg is a file } FUNCTION double rms (double v) { return rms ? .707 * v : 1 * v; } FUNCTION double power (double v) { return watts ? v * v / load : 1 * v; } if (EQ(F1,"1")) { count++; double sigVal = DOUBLE F3; signal = power(rms(sigVal)); PUT(signals,count, signal); } if (F1.length() == 1 && INDEX("123456789",F1) > 1) { int f1_int = INT F1; if (f1_int > order) order = f1_int; PUT(spectrum, signal + ":" + f1_int, (DOUBLE F4) * scale); } END { PRINT_ "TitleText: Distortion, " type; PRINT_ ""; PRINT_ "Marks: dots"; PRINT("XLabel: Output Signal,", out_t, ampl_t, (out_t == "W") ? ("into " + load + " ohm") : ""); PRINT_ "YLabel: Distortion, " type; PRINT("NumSets: ", (order-1)); if (type == "log") PRINT_ "YLog: on"; for (int j = 2; j <= order; j++) { PRINT_ ""; PRINT_ "DataSet: " j " harmonic"; for (int i = 1; i <= count; i++) { String val = (String)GET(spectrum, (GET(signals,i) + ":" + j)); if (val != "") PRINT(" ", GET(signals,i), ",", val); } } }