neverendingbooks

lieven le bruyn's blog

Archive for the ‘PPC’ tag

some smaller steps

without comments

It
always amazes me how much time I have to waste in trying to get
tech-stuff (such as this weblog) working the way I want. You will barely
notice it but again I spend too much time delving in PHP-scripts,
sometimes with minor success, most of the time almost wrecking this
weblog…

An example : it took me a day to figure out why
this page said there was just 1 visitor online whereas log files showed
otherwise. The PHP-script I used checked this by looking at the
IP-address via _REMOTE_ADDR_ which is perfectly OK on an ordinary
Mac OS 10.3 machine, but _not_ on an OS X-Server! For some reason
it gives as the REMOTE_ADDR just the IP address of the Server (that
is, www.matrix.ua.ac.be in this case) so whoever came by this page got
tagged as 143.129.75.209 and so the script thought there was just one
person around… The trivial way around it is changing every
occurence of REMOTE_ADDR by _HTTP_PC_REMOTE_ADDR_.
Easy enough but it took me a while to figure it out.

Another
example : over the week-end this weblog got a stalker! There were over
100 hits from 38.113.198.9, so whoever that is really liked this site
but didn't have time to read a thing… Again, the standard
solution is to ban the IP-address and most weblog-packages have such a
tool on their admin-page. But whathever I tried and Googled WordPress doesn't seem to have it
on board. There were a few hacks and plugins around claiming to do
something about it but none of them worked! So, I tried more drastic
actions such as editing .htaccess files which I thought would solve
everything (again, no problem under 10.3 but _not_ under
10.3-Server!). Once more, a couple of hours lost trying to figure out
how to get the firewall of a Mac-Server do what I needed. The upshot is
that I know now all dark secrets of the _ipfw_ command, so no
more stalking around this site…

In the process of
grounding my stalker, I decided that I needed better site-stats than my
homemade log-file provided. Fortunetely, this time I picked a package
that worked without too much hassle (one more time I had to make the
REMOTE_ADDR substitution but apart from that all went well). You will
see not too much of the power of this stats-package on the page (apart
from the global counter), I feel that such things are best forgotten
until something strange occurs (like stalkers, spammers and other
weirdos). A nice side-effect though was that for the first time I had a
look at _referring pages_, that is the URL leading to this weblog.
Lots of Google searches (some strange ones) but today there were also a
number of referrals from a Chinese blog. I checked it out and it turned
out to be the brand new Math is Math! Life is Life! weblog…

Another time
consuming thing was getting the BBC-news RSS feeds working in the
sidebar, so that you still get _some_ feel for reality while
being trapped here. I am not yet satisfied with the layout under
Explorer, but then everyone should move on to Safari (so I did give up
trying to work out the PHP-script).

But most time I wasted on
something that so far has left no trace whatsoever here. A plugin that
allows specific posts to be read only by registered users (of a certain
'level', that is WordPress can give users a level from 0 to 10
with specific degrees of freedom). But clearly at the same time I wanted
the rest of the world to have at least some indication of what they were
missing (such as a title with a nice padlock next to it) but so far I
didn't get it working. The only trace of a closed posting would be
in the sidebar-listing of the ten last posts but gives an error message
when an unauthorized user clicks on it. So, still a lot of
headache-sensitive work left to do, but it is about time to get back to
mathematics…

update (febr. 2007) : the
padlock-idea is abandoned.

Written by lievenlb

September 13th, 2004 at 3:52 pm

Posted in web

Tagged with , , ,

Singular via GAP on OSX

without comments

The
GAP-package is very good in working with finite
fields or Abelian extensions of the Rational numbers, but sooner or
later we will need to use the coordinate ring or function field of an
affine variety for which it is hopeless. On the other hand, there is an
excellent free package to do these calculations : Singular.
So, the ideal situation for us would be to be able to access Singular
from within GAP. Fortunately, Marco Costantini and Willem de
Graaf have written such an interface. Here is how to get in working
under OS X : One has to download two files from the Singular Mac OS X download page :
Singular-2-0-4-ppcMac-darwin.tar.gz
and
Singular-2-0-4-share.tar.gz. Once they are on your desktop you
can follow the instructions on the INSTALL.html file in the 2-0-4
Folder of the expanded Singular-2-0-4-ppcMac-darwin. Keep the
tarred version and open the INSTALL-file in your browser (to be
able to copy and paste) and open up the Terminal. Do the analog
thing to

cd /usr/local sudo tar -pxf
/Users/lieven/Desktop/Singular-2-0-4-ppcMac-darwin.tar sudo tar -pxf
/Users/lieven/Desktop/Singular-2-0-4-share.tar

Then
follow the instructions making the symbolic links and you have Singular
working. The next step is to go to the GAP Packages page and go to the
package Singular for full documentation.
To use Singular in a GAP-session, here is an example

gap>
LoadPackage("singular");
The GAP interface to Singular
true
gap> StartSingular();
I  Started Singular (version 2004)
gap> SetInfoLevel( InfoSingular, 2 );
gap> G:= SymmetricGroup( 3 );;
gap> R:= PolynomialRing( GF(2), 3 );;
gap> GeneratorsOfInvariantRing( R, G );
[ x_1 x_2 x_3, x_1*x_2 x_1*x_3 x_2*x_3, x_1*x_2*x_3 ]
gap> I:= Ideal( R, last );;
gap>GroebnerBasis( I );
I  running GroebnerBasis... I  done
GroebnerBasis. [ x_1 x_2 x_3, x_2^2 x_2*x_3 x_3^2, x_3^3 ]
gap>
 

Written by lievenlb

February 2nd, 2004 at 4:43 pm

Posted in web

Tagged with , ,