Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: A086865 solution in python

OEIS A086865 in python

import math

def isprime(possprime):
        """returns t/f if number is prime or not"""
        for x in range(2, int(possprime/2)+1):
                if possprime % x == 0:
                        return False
        else:
                return True

n = 0

while n < 10:
        pp = 2 * math.pow(10,n) + 11
        print "Working on ", n
        if isprime(pp):
                print n, " gives ", pp, " which is prime."
        n=n+1

Works for python up to n = 8. Then runs out of memory :-( Just means I have to rewrite it in C.

User Journal

Journal Journal: Data is Heavy...

So I've been neglecting my slashdot journal for too long.

I am moving hosting providers to save some money. Virtual data is hard to move. Sure, file copies happen fast, but directories, databases, emails all these things take work to move. Data has no mass, so why is it difficult to move? Well, it is energy so it can in theory have mass...

So moving masses of data, I spend my afternoons entwined in it.

User Journal

Journal Journal: iFolder

I created an account on the iFolder wiki to delete some casino spam on one of their developer pages. Bastards. The technology looks good though. I'm wondering how to incorporate it into some of the things we do at my current workplace...

SuSE

Journal Journal: Opensuse on Sparc

I got my Sun blade 100 in and am working on getting OpenSuSE 10 ported to it. I had to install gentoo on it first. Emerge somethings, rpm, bzip2, etc... I pulled all the rpmbuild macro files from an i586 opensuse box and replaced the /usr/lib/rpm installed macros (from redhat). That gives me something like a suse rpm build environment. I then had to fix up the /usr/lib/rpm/sparc64-linux/macros file to include some things suse sticks in the other arches and remove the redhat/gentoo things. I also had to remove the -m64 flag to the gcc opts b/c it conflicts with long_double_64 for some reason.

This has been a week long project and it's starting to actually build packages well now. The first steps were just in getting things working.

User Journal

Journal Journal: So much for writing more often...

LOL, Well I wanted to write more this week, but never did. Oh Well!

Anyway, the sun blade 100 came in like I wanted and due to my own oversight, I didn't have any ECC PC133 RAM to put in it. That sucked. So I'm getting some more on ebay and hope to have it in in the next week. Then I'll be able to get cranking with the linux. I'm resisting the urge to buy another sun blade though. I'm thinking compiler farm for linux builds. Maybe a little later on. I did get to setup the serial console from it to my linux box (using minicom, reminds me of using Telix (tellix?) in the old days). That was interesting and kinda fun. Right now it's sitting on top of my Athlon-64 linux box with a serial cable draped down the side of it going to the port on the back of the linux box... and both machines have their cases removed.

I have one friend who says that I should only install solaris on it. That it would be a waste to install linux. I choose not to listen to him. The vision is to setup linux b/c I think it would be cool. There are tons of these things floating around. I think something interesting can be done with them.

Once I had pretty well worked the sun blade to death, I put together one of my orgnial lunch box machines, a Shuttle SV25 system. The fan on the power supply is going though so I've got to replace it, which means either getting a new system or cracking the power supply... not sure about either solution.. I may try disconnecting the internal one and then putting a new one outside the power supply... we'll see though.

User Journal

Journal Journal: It's been an ebay weekend.

It's been an ebay weekend. I'm getting a Sun Blade 100 workstation and a removable hard drive caddy. I've got bids in on another hard drive caddy and a 5-bay IDE hard drive cage for ATA drives. Once I combine that with a 3ware 7500 series RAID controlled I'll be in business!! W00t! I'm sticking with ATA b/c I already have a few of the same size drives to use with it. So I've been having fun spending money on ebay.

I spent some time Sunday working on my computers. I've been trying to get http://www.opensuse.org/ working on one of my PC's that has been giving me problems and I think now that the PC is finally giving up it's ghost. The sequence that normally causes the cdrom to eject now causes the machine to reboot. I've been having problems with the USB ports on it as well and the PS/2 ports have been dead for a while. So I'm assuming that there is some issue with the Northbridge (which controls those things) and so I'm dumping the motherboard :-(

I'm gaining a new one though in the form of a Sun Blade 100 though so that makes me happy. I'm going to try to port opensuse to it. LOL that should keep me off the streets for a while. I'm going to setup my workstation to serve the sources for the suse packages so I can host them out via NFS to it and use it to recompile and test, but leaving the data on the the network.

We'll see how it goes. I'm going to try to keep my journal here updated more often too. I just need to get into the habit more often.
User Journal

Journal Journal: New 2001FP waiting for me and things to do...

When I got home I had a great surprise waiting for me. My new Dell 2001FP was waiting for my by the door. So now I have a 20" LCD monitor hooked up to my linux boxes. It's very nice and I'm typing this now on my KDE Desktop with Firefox open. It makes me very happy! :-)

In my own computer work, I've taken my primes machine and turned it into a media center in my living room. So I've gotta get it up again, I need new hardware to use my other box is just dying (I think part of the Northbridge is broken, various built-in things on the motherboard have died), luckily I can still use the PC itself. newegg.com is my usual shopping destination. I've gotta get back to work on the KJV translation. My Dream Library site is up, but not getting much traffic.
User Journal

Journal Journal: Dead DB server and OpenSUSE wtihout PostgreSQL???

Lost my home database server last night. It had been up and running for a while and I wanted to update it from FC1 to OpenSUSE 10. I've been using OpenSUSE at work for a while and really enjoying it. It seems to be a very viable desktop linux candidate. So I backed up the important data and configs and rebooted with the OpenSuSE cd in. So it took forever to boot, I'm talking like five minutes or more. It finally got to the first setup screen and I tried to use a mouse... It wasn't working so I tried by-passing my KVM switch, still dead, I tried a second mouse nothing, finally I tried a USB mouse, Success!!! I was really happy about this stupid mouse. (I also seem to have lost a small Playstation Mouse in the process. That I'm really not happy about. :-( ) I got through the next few screens clicking away and that I was trying to type in the volume group name in the LVM setup and the keyboard wasn't working, tried the same steps and darn it I had to use a USB keyboard to do things. If that means what I think it does, the PS/2 parts of the Northbridge of the are blow/corrupted. I chugged along with the USB devices, and began the actual copying files part of the install. Once it got to where it would normally ask for CD 2 it rebooted. {sigh} That blows. It now hangs while trying to boot.

So I've begun my search for another web/database server for my house. I am going cheap b/c it's not a highly loaded machine. I'm looking at a sempron 64 mobo that should do nicely, that sempron 64 2800 and a gig of RAM should not cost more that $150 or so. (newegg.com pricing) I'm just gonna have to wait until I get paid again :-(

During the install of OpenSuSE from the CD's I noticed something though. While they do include the PostgreSQL libraries for connecting to a Postgres DB, they don't actually include the Database itself. This maybe a CD vs. DVD thing. Novell is doing something funky where the packages don't match between the OSS version and the "Non-Free" version. Although they do include some OSS software in the Non-Free version. I'm wondering if it's not included b/c it's an "enterprise" DB. I'm gonna compare it with the SLES 9 version and see what's different. Hopefully I can update the OpenSUSE Wiki with the info sometime today.

User Journal

Journal Journal: LVM in linux...

If you aren't using LVM in linux by now, run to the howto, read it, and start using it on all your servers. IT ROCKS!! I needed more space for my /var partition so I lvextend'ed the partition using the free PV's in my VG and then resize2fs'ed the ext3 fs to use the new space. It's just great to be able to do these operation without having to take the box down. It's much much more flexible that having hard coded partitions. ReiserFS makes it easier b/c then I don't have to unmount the partition to grow it larger. I think XFS is the same way. Although to shrink it, the partition must be unmounted.

LVM is a good thing all around.

User Journal

Journal Journal: Captain Keys is a pain in the butt still...

I've gone back to playing Halo for a while on the harder setting. I forgot how much I disliked Captain Keys. The jerk keeps getting captured or crashing space ships and so a lot of the game is driven by rescuing him. It's a great game though. It probably has the best story behind the game of any I've ever played. It brings back good memories of playing with Bill, one of my old roommates, and seeing the guilty spark (a game character) saying, "I've got a bad feeling about this". You can't shoot the guilty spark no matter how hard you try. And while he's not evil, he is doing his job trying to destroy the solar system. Flood are still just as creepy and I still curse like a maniac as they come jumping out from everywhere. There still is an element of fear b/c I know they are coming and I know they are going to do a lot of damage before I kill them. It's a game where I'll still jump around when I hear them attacking me.

In other news I've been thinking of trying to start a tech support group for non-profit groups. Something cheaper than the other rip-offs and something more permenant than the-guy-that-knows-something-about-pc's . I don't know if it could take off, but I think it could. I don't know what kind of capital I would need either. It seems like a strange thing to do, but I can see something of a need out there.

--Donald

User Journal

Journal Journal: Trouble canceling accounts.

Crap. Trying to cancel various accounts for things online shows me just how much ppl want to keep my business. It's pretty much impossible. WoW gets kudo's for making it very easy and usefull.

--Donald

User Journal

Journal Journal: I found my hostid....

hostid

Prints a hexidecimal number globally unique to your host.

In linux (and AIX and Tru64) based on the IP address of the host. In Solaris based on the MAC address of the host and stored in the PROM. Solaris doesn't guarantee uniqueness. With NAT'ing Linux can't either anymore...

    SuSE Linux had it as part of the util-linux rpm. Looking at the HISTORY for that package hostid had been removed in 1997. Hmmm... Check the source, best resort of a linux geek, and yes, it's not there. Grab a Redhat SRC rpm for util-linux. It's not there either, but it does at least have a note that it had been moved to sh-utils. AhHA! Jump to gnu.org... sh-utils has been combined into core-utils, grab the source. Yes! It's there... but wait, hostid is pretty much a syscall to gethostid.

gethostid(2) is in unistd.h, rpm -q tells me it is in glibc, grab the glibc source. And I have it, buried five directories down is the source for gethostid. It uses the IP address of the system but splits it into two pieces and then flips each piece; so 192.168.10.1 gets changed to 168.192.1.10 before having each piece changed to hex. reading the source though, if it can't find the IP address of the system, it generates a random number...

This all came up b/c I tried to set my hexidecimal hostid to 0xDEADBEEF. The AIX freshly allocated pointer value. I also notice that while the Linux version of this command outputs hex, it requires decimal to be input on the command line. The AIX and Tru64 versions allow an ip address to be input, a much more friendly way of doing it, espcially since it uses the IP address anyway.

That was my hostid fun for yesterday.

dzc

PS. I also re-arranged my computer room some.

User Journal

Journal Journal: Message Passing....

I've just been having an interesting time with the last few bits of the cluster setup. We are almost done with the system administration part of it though. I've written a small application for testing the cluster and the MPI libraries (Message Passing Interface) behind it.

MPI is a set of libraries that give a standard way for nodes on a cluster to send data between each other. It makes cluster programming a little easier b/c you don't have worry about the details of how they communicate, you can focus on What gets communicated. I wrote a program yesterday to find the factorials of all the numbers between 1 and 200000 this way. It is actually a very bad program in that in that I just had each node do the same thing, not really what you want in a real world situation. I'm working on the next part of that today, having the master node assign each rank a number to work on and then having the node return the number to the master. Still a pretty simple project but the goal is to expand it to do two simple series expansions, 'e' the base of the natural logarithm and 'pi' the ratio of the circumfrance of a cirle to it's radius. Both of those would make decent cluster tests. 'e' directly depends on factorials so the stuff I'm doing now is my base for getting that working. I'm worried about the GMP libries that I also use though, I'm not sure they are safe for using in this kind of work. We'll see though.

User Journal

Journal Journal: not much from yesterday

after work I took a bunch of pictures from megatokyo, ascii art and other junk and decorated the men's room. fun way to celebrate finally getting exchange & Active directory working in a subdomain of a real unix system.

I posted a bad program to the linux-l@lists.ufl.edu list. a really bad way to find the data about a message.

Slashdot Top Deals

"The vast majority of successful major crimes against property are perpetrated by individuals abusing positions of trust." -- Lawrence Dalzell

Working...