Category Archives: Technical

Autogenerating HTML tables – some help

Doing complex tables in HTML can be frustrating and challenging. There is quite a bit of help on the internet including tools for helping to build tables. Some of my previous posts discuss other help that is available.

In this post, I briefly discuss a tool I have written that helps to compose HTML tables. It can take quite a bit of time but the end results can be nice also.

Read more

Web scripting and web auto-generation tools. HTML table generator.

Web scripting and web auto-generation tools. HTML table generator.

I really like the art sketch that I just posted, so I will include it again to see how it works out in this table.

Web scripting and web auto-generation tools. HTML table generator.

Web scripting and web auto-generation tools. HTML table generator.

Web scripting and web auto-generation tools. HTML table generator.

Having a good cutie pie fish background is important for doing web pages with complex tables with complex attributes and style elements.

Web scripting and web auto-generation tools. HTML table generator.

Web scripting and web auto-generation tools. HTML table generator.

I have just created a tool that helps build tables. The details of setting up the td attributes in large tables can be tedious and error prone. This tool does some of these layout functions that can help reduce errors and tedium.

You can specify attributes and style attributes for 1. the entire table, 2. each table row, 3. each table column, and 4. any individual td cell. The latter values will override any former value both for attributes and for style subattributes.

Web scripting and web auto-generation tools. HTML table generator.

Well, actually this is a tool written in c/c++ which will generate a table from a given input data file. It is hard to use, is incredibly unforgiving of errors, but once you get the input file set up (properly) you can edit the individual files that are included, and not worry any more about the table details. This can be useful for example in creating a layout or design. After that, you just edit individual input files.

This is an auto-generation tool, which I also call web scripting, in that it computes the web page table layout and includes the specified files into the individual td cells.

I first created this tool is 1994 and have worked on it in an on/off fashion since then. I have recently added a set of changes pertaining to the parsing of style sub-attributes.

The style parser is what is new here. It is implemented as a single character token parser in a state machine (switch statement in c). There is one case where a single character putback is done and otherwise it is all forward scanning of character tokens. I decided to implement this in a semi-pure sense, and I debated this implementation detail a while. It involves scanning for ';' and ':' characters and building a dictionary of style attributes that match the style names.

It does not handle errors very well and an error in the input file, such as an error in a style specification, can cause the program to crash. Usually you begin with a simple file and then work incrementally, adding more items, such as style elements, in a slow fashion.

The input file for the 2 x 2 table looks like this. It begins with a table definition, the attributes for all rows, and then the attributes for all cells. Next there are two entries for row 1 and row 2, and then two entries for columnn 1 and 2. Then style elements are specified for each row/column value and after the *end* block the matrix of files to include in each cell is specified. For example, this entry, the 1,2 table entry is contained in the file wa.txt. Well, ok, it's not that hard.

2 2
border="4" cellpadding="5" cellspacing="10" style="width: 100%; background-color: #f00000; background-image: url('http://www.georgeschils.com/ph07/css/darkpurplepat.jpg');"
style="vertical-align: top;"
style="height: 30px;"
style="background-color: #aa66ff;"
style="background-color: #fa66af;"


1 1 style="background-color: #a00000; color: #ffffff;"
1 2 style="background-color: #f00000; color: #ffffff;"
2 2 style="background-image: url('http://www.georgeschils.com/w1/sty/smv_32_r1.jpg');"
*end*
1 1 one.txt
1 2 wa.txt

I'd make this tool for sale but there won't be one person on the planet who is interested. It might not be impossible to get a no cost binary windows build if you ask (send an email). I will give out a few free copies to people who ask.

If you Google for "html table generation tools" or something similar, you will find around a ba-zillion tools, many of them free, for doing this. For example, see this on-line table generator.

Take 1, update 1.

Diffraction limited resolution for digital cameras

This blog can serve as a “front end” to the rest of my web site. I can write a short introductory paragraph that introduces another web page on my site.

I just remembered a paper that is currently not linked and I mention it here. I am always reworking my site, and this link got left out. It will get put back in eventually.

A few years ago I did some studies of the diffraction limit of lenses. This paper is here. A catchy name for this paper would be something like New Year’s Resolution. This is a matter of plugging some numbers into some formulas (well maybe a bit more), but the results are somewhat interesting. This analysis is approximate and a more exact analysis would use MTF analysis, which is not done here.

I am a big fan of resolution and I still don’t have enough and can’t get enough of it. This analysis does say that eventually we will come up upon the limit. But there are so many other fancy features in the new cameras that resolution is only part of the issue. As a general rule, the larger the detector size the higher the theoretical resolution, and this depends on the f# number, as discussed.

Starting jQuery notes

I am a bit slow in "catching onto" some things, but I have just learned about jQuery. This has been out around 2 years. This short post contains a few thoughts on my initial experiences with it. And it contains some starting examples illustrating the use of jQuery. There is some associated discussion.

Read more

Freeze | toggle

More discussion is given in the sections below.

Before starting

This illustrates a collapsing section in a collapsing section.

This document (post) is a little mixed up. It illustrates more than one technique for collapsing sections, and also illustrates the link modification technique. More discussion is in the following sections.

This is a little bit of a show off post. Isn't it cute? It illustrates several techniques all in one post.

General comments ...

General comments. I have created some custom JavaScript using the jQuery library. This web page illustrates some of its use. I found jQuery to be fairly easy to learn and to use, as claimed. I believe a number of books are available, including an O'Reilly book on the subject. It appears to be a big topic and my discussions here are probably just introductory. But my initial experience with it is very positive.

Link modifications ...

Link modifications

The first use of this custom JavaScript is to make some modifications to the links on a web page. I created a JavaScript routine to modify all of the links that point outside of this site so that 1 (optionally) they contain an image indicating you are going out of site; 2 they have a popup title giving the URL where the link points to; 3 the destination URL will open in a new window if the link is clicked. You should see this effect in the above "jQuery" link.

The "link modifications" are done automatically by just including the JavaScript file, and require no other web page insertions.

Collapsing sections ...

Collapsing sections

A second application is to be able to expand and collapse a section by clicking on it. Clicking on the text followed by the "..." expands the section, and clicking on the section itself will collapse it into its smaller form.

Another example of using collapsing sections is found in this post, done a while back.

To use collapsing sections, as in this post, it is necessary to put some JavaScript in the web page itself. It is also necessary to put in <span> and <div> elements with unique id tags. These go around the "title" area and the "expand area". To see this in greater detail, look at the source html for this post. In general it takes some work to set up a document as seen here.

There are three collapsing section techniques that I have developed.

  • Method one allows sections to be collapsed by clicking on the header. When this is done the header collapses and the section to display is shown. When this content section is clicked, it disappears, and the header again appears. Clicking the freeze button will prevent collapses from occurring, and this is done for the whole web page displayed. Clicking the toggle button will expand or collapse all sections on the web page. This technique is not illustrated in this post.
  • Method two is like method one except that the toggling and the collapsing is specified for only certain specified elements. Thus you can freeze and expand/collapse only those items in a given area (such as a post) rather than the whole web page. The first two methods allow for any section to be initially opened or collapsed.
  • Method three is a technique that allows you to put collapsing sections into collapsing sections. When the title is clicked, its content expands, and when the title is clicked again, the content disappears. The title always remains. At the moment the "freeze" and "toggle" buttons do not apply to this technique. With this technique the default is that all sections are initially collapsed. This can be overridden on a per collapsing section basis, but it takes more work.

This post uses methods 2 and 3 above. Generally one would not use a hybrid technique, such as here, unless to make a point, as I am doing. Method 1 is illustrated in this post.

I use raw HTML mode in word press to paste in the JavaScript.

More discussion ...

""When programming JavaScript, it is handy to have a manual nearby. Here are some online manual references: 1, 2, 3, 4, 5, *6, 7.

The custom solution created here works quite nicely and accomplishes the objectives that I wanted to achieve. Many other effects other than what I am using here are also possible. I wanted to get some "hands on", and my general reaction is quite favorable. This is an excellent library!

It might have been easier to use the "accordion" feature of the UI library. But I wanted to try out some of the programming for myself. It works great.

Here is a one hour YouTube video on advanced JQuery given by a 12 year old. I learned a lot watching this. This is one of the more inspiring videos I have seen in a while. If you want something simpler, try this simpler introduction.

Although this may be good jQuery, I can criticize my posting methodology in that both this post and the custom jQuery have been updated too often. Generally I am too anxious to "get stuff out". The minute after I put out a new version, I think of another thing.

This JavaScript is not free software but I will give a complimentary no-cost copy to people if they ask. If you want to use these techniques that I use here you can just ask. Note that there is no documentation, and free consulting does not come with this offer.

I point out that a large set of plug-ins are available and you may want to check out free and documented stuff before you try me. There is probably a better solution than what I created here.

The solution here should really be wrapped into a plug in. If I get time, I may work on this.

There are a few small bugs, either in my programming, the browser, or the JQuery.

This technique is still evolving and is likely to change in the future.

Summary

Summary. Although I spent a good amount of time achieving the desired effects discussed above, it is still much easier than the older approach involving using DOM directly. The jQuery library abstracts this nicely and makes the programming task much easier.

The "old fashioned" DOM approach in which callback functions are placed in tags as attributes is just that: really old fashioned. This is maybe why more object-oriented programmers have not used it. On the other hand, JQuery makes use of modern object-oriented design pattern concepts in its use of chaining (with the this pointer), event propagation chains (returning nil or not), the invocation of its functions in object style (using dotted function calls on jQuery objects), and in its other features. So a person who likes object-orientation is comfortable with jQuery. And JavaScript, in which it is programmed, is actually one of the fanciest object oriented (and functional) languages around. JQuery objectifies the older approach in a way that is easy and yet elegant. It has been a while since I have run into any serious programming and programmers, and it is refreshing that people still care about it and are keeping this wonderful art alive.

Update 3

Raw html via perl script and raw HTML plugin

Some technical tips on doing complex html in WordPress

I struggled a bit trying to get raw HTML into a blog post. I did some experimenting with some techniques and I searched the internet for solutions. I collected a few links and other notes below.

More ...

Some links on HTML related issues

There is really a lot of help on the internet. Here are some other links I have found.

  • Converting html to word press.
  • Word press tips.
  • This post discusses some useful tricks if you are using Word.
  • This problem of entering raw HTML into WordPress is solved by installing this "raw html" word press plug in. This post is done using this plug in using raw HTML.

Other notes - verify your web pages

  • Then it is a good idea to verify the html that you just created, so that it is free of errors. Do this before you upload the html. To do this, I use this online website validator. (Also see the word press documentation on validation.) If it passes this test, then it is good html. Miraculously, complex blog pages can pass such rigorous validation tests. For example, I have been lucky enough to have my entire main page pass this validation, which is incredible, given the complexity of the blog page.

Raw HTML in WordPress posts

Some technical tips on doing complex html (and related items) in WordPress

I struggled a bit trying to get raw HTML into a blog post. I did some experimenting with some techniques and I searched the internet for solutions. I collected a few links and other notes below.

More ...

Some links on HTML related issues

There is really a lot of help on the internet. Here are some other links I have found.

  • Converting html to word press.
  • Some chat help is available with WordPress.
  • Here is an assortment of really excellent tips and tricks. There are lots of excellent PHP methods here.
  • This post discusses some useful tricks if you are using Word.
  • This problem of entering raw HTML into WordPress is solved by installing this "raw html" word press plug in. This post is done using this plug in using raw HTML.

Other notes - verify your web pages

  • Then it is a good idea to verify the html that you just created, so that it is free of errors. Do this before you upload the html. To do this, I use this online website validator. (Also see the word press documentation on validation.) If it passes this test, then it is good html. Miraculously, complex blog pages can pass such rigorous validation tests. For example, I have been lucky enough to have my entire main page pass this validation, which is incredible, given the complexity of the blog page.

This post was updated in March, 2017. It is an amazingly popular post.

Word press layout and other online help links

Word press layout and other online help links

I have begun trying to do some simple customizations to my blog. There is really a lot of help on the internet regarding getting help with word press. Here are a few links on doing word press customizations and other things that I have found useful. Continue reading Word press layout and other online help links

WordPress style adjustments

Here are a few notes on Word press.

Some word press style tweaks

I have been tweaking with Word press and find that it is reasonably flexible in being able to do the kinds of renderings that one wants to do. I am doing this post in html just to see how it works. This is my first html post. I am sure that I'm still an amateur at a lot of this stuff - there are really a lot of nice looking blogs out there.

I created a few styles in the style sheet to accommodate things that I would like to do. The style sheet for this theme is called style.css. You take it off of the server and edit it to make your changes. I pasted in some of my personal styles that I use often.

This is not the first time I have tweaked styles. It seems that I have spent a good part of my life trying to get those CSS styles just right.

Indented text. I want to have the ability to indent and to highlight stuff.

Times font. It takes a bit of tweaking to get this size of the "times" font right. I want to be able to render times, since this is such a standard font.

And here is an ordinary paragraph.

  • And this is a bullet item. A fish bullet should show.
  • It took me a ton of time to try to get this fish icon working. And it's not quite right yet. Maybe it says that I prefer fish to bullets.
  • The editor that word press provides is nice and has spoiled me a bit. It is very easy to use. On the contrary, doing the "raw html", as in this post, not only puts hair on your chest, takes a lot longer, but also greatly increases the likelihood of making errors.

And here we are back out of the dotted outline section. This entry is a lot of gibberish, but I am testing some of these new styles.

About the greatest test in life is to create a table. An even greater test is to try to do it in word press.

Well I'm not going to mess with the table styles. It looks pretty complicated.

If I get bold I might mess with the hover characteristics of the table, but not now.

Well this post took well over an hour (more like two or three). There are times when it's probably worth the trouble. And it's good to know that it can be done even though you always do not want to take the time.

Well I had to update this post a number of times. I made really a lot of errors. I had an immense amount of trouble. It's never as easy as it looks.

update 9 on Dec. 26.

Digital 4×5 photography in 1986 – the Space Plane

My photography / graphics portfolio includes this computer generated and computer enhanced image. It is neat to do a graphic that appears in a major magazine like Popular Science. This same image also appeared in around 10 or so other magazines around the same time frame of 1986. Two magazines that this also appeared in are: Aviation Week and Space Technology, and Discover magazine. Sometime I may collate or take pictures of these other appearances just for the digital record.

This graphic got so much attention. It is somewhat stunning though. This work is associated with some work on holographic pattern recognition called the lock and tumbler filter. The technical work was interesting and involved signal processing, mathematical Fourier decompositions, other advanced mathematics, computer simulations, the making of state of the art holograms, and laser laboratory work. But the graphics was so stunning that it stole the show.

The graphics software was all custom code written by myself. So was the pseudo coloring software. This was before Photoshop. (You could not do this in Photoshop).

  • The simulations were written in Fortran 77, were written by myself, and were run on VAX machines (probably a VAX 780). I wrote the drivers for the color display; it used QIOW constructs – special VAX architecture I/O below the ACP.
  • The photo was a special state of the art accomplishment also. The photo was a 4×5 photo taken off the analog RGB lines of the AED 767 display screen using a custom modified Matrox camera. This was a 4×5 film photo of a digital screen. (Jim Van DeVerde (sp?) did the custom electronic modifications.)
  • I took the picture of the plane-looking image and Don took the picture below it in the Popular Science article. (This was before Ellen joined the group.) The second picture was the real hologram, and the picture is of its phase. The first picture, “the plane”, was really a double check on the codes in which 30 Fourier harmonics were recombined to reproduce the original. It is the “rotational Gibbs phenomena” that makes it look pretty when pseudo-colored.
  • If you Google “George Schils” or better yet “G F Schils” you can look at some of the associated publications on pattern recognition and rotation invariance. This was an interesting piece of work.

I became known for stunning graphics and there was other fantastic graphics besides this Popular Science appearance. (I believe some of my viewgraphs were used for presentations to Congress.) It probably cost me my career in science, unfortunately, although I was probably better at the mathematics than the graphics.

The national labs are cool because just about every aspect of the problem was state of the art. (I could say a lot more about our video lab.) When a problem is in the national interest, they can muster tremendous forces, and they have tremendous capability, talent, and laboratory facilities on hand.

Some other comments about the co-workers in this article:

  • Ellen (Ph.D., Stanford, electrical engineering, nonlinear optical photo-refractive crystals) became an astronaut and flew on the Space Shuttle.
  • Don with his ability in optics (he was a full professor at Perdue and left for Sandia) worked on leading X-ray lithography techniques for next generation deep UV and X-ray semi-conductor optics, after this. The current generation of chips is due very much to him.

I still remember living in Livermore, the fresh smelling grass (not the kind in Madison – I have never smoked “pot”) while driving to work along a back country road and turning on either Vasco or Tesla Roads to get to work. I would drive alongside vineyards. I would go by Concannon Vineyards every day, for example. My commute was around 10 minutes. Then there is the Livermore Rodeo – yes they hold a yearly rodeo. At first you laugh at this but then after a while you like it. And the Danville Livery and Saloon still stands and makes you wonder what century this is, but as rich people in their Ferraris drive by it, well, you don’t laugh anymore. And girls in Livermore! Well, Jessica Simpson would be below average in Livermore! It’s a bit like a James Bond thing.

I would like to say more in my autobiography.

Are you GR insecure?

Granola street-rubbish photographer feels insecure about GR.

Coffee shop GR

On a few occasions I have had some physics discussions in the local coffee shops. We touch on topics like relativity and I have mentioned that I have actually studied GR (general relativity) and worked through by hand most of the difficult tensor formulas, such as the Bianchi identity, for example. Now computer algebra packages can work through many of the grunt tensor calculations, which can get tedious. (They were so tedious that Einstein invented a special notation, called the Einstein summation convention.) Any way students are often present and often they react as “ooooh, aaaah – wow, he gets relativity”. And actually indeed this is somewhat impressive, and it is nice that many people react this way. If you think GR is easy, try working through some of the tensor gravity formulas! And this is good stuff to know. I am definitely interested in this material. There are coffee shop regulars who will call you a super genius if you know this stuff, and this is nice, too. The support goes a long way. (I have been called a lot of other things, and some not so nice.) You can get some respect around here for knowing some of this stuff.

Indian restaurant GR

When I first moved to Madison I walked around taking pictures. (I still do this). A fellow had the same camera and we started talking, and after a short while I learned that he was a physics major, who was doing his Ph.D. and who had also earned a masters degree in physics from Cambridge in England. Well, ok.

We agreed to have dinner and had dinner at a nice Indian restaurant on State Street, and we talked physics. His Ph.D. work involves applying a martingale technique to image estimation and reconstruction problems in astronomical imaging. (He found some nice things including a new algorithm for dramatic computational complexity improvement for some restoration problems.) After that we went over to the Memorial Library, got a library booth, and he worked through the notions of GR in around 30 minutes and pointed out some interesting things he had found. He asked me to review his paper called something like “Notes on General Relativity” but I do not know how to do Lie derivatives (yet), so I said no.

I’m some guy who moves to Madison after doing some c-language debugging for manufacturing robotics and other things in Silicon Valley; and there is no interest in this physics in industry. So it was neat to see that I could still be “intelligent” in the discussions, and ask smart and hard questions. This is a bit of a shift from industry debugging to high physics. You think you have lost the ability, but it’s still there.

Other people

I have met some other people, too. I won’t give all the names.

Enter Mike Iltis

Then I meet Mike Iltis while I was walking around taking pictures. He was having an intense discussion on State Street involving U-238 and I said “cool it dude, it sounds like you’re giving away secrets.” This is sarcastic in that it is public image that matters and not truth.

Some time has passed, and well, Mike sent me another one of his usual and typical e-mail’s, which I love getting, BTW. So, ummm, here are just some fancier papers on categorical quantum gravity, space time topology, and other fancy stuff. Well, that’s Mike. One of my goals is to learn and understand all of this material.

It’s not too hard to feel dumb pretty quickly. It’s good that the students think you’re smart. So much for feeling GR secure though.