The "Post random stuff you've made" thread

vibrokatana

New Member
I write stupid things all the time like this stupid little c++ app that calculates 200,000 primes (haven't bothered to count tho :p):

Code:
#include <iostream>

using namespace std;

int main() {
	const int NUMTOCALC = 200000;
	int primes[NUMTOCALC];
	int NumPrimes = 1;
	
	primes[0] = 2;
	cout << "Generating primes..." << endl;
	
	for(int i = 2; NumPrimes < NUMTOCALC; ++i) {
		bool prime = true;
		
		for(int index = 0; index < NumPrimes; ++index) {
			int test = primes[index];
			
			if(!(i % test) || test/2 < index) {
				prime = false;
				break;
			}
		}
		
		if(prime) {
			primes[NumPrimes++] = i;
			cout << i << endl;
		}
	}
	return EXIT_SUCCESS;
}

that should compile in visual studio express if you ever want to run it, it takes about 5-10 minutes depending on the computer tho. If it fails to compile remove the const int line and replace all the variables with the number, VS is rather finicky about variables within array declarations sometimes.
 
Last edited:
2750159

I may implement a php-mysql generator for the fun of it and beable to calculate alot more if I can implement the bigint datatype properly. I may make a page that calculates 50 or so and have an object from within second life trigger it every 15 minutes and report the latest calculated primes rofl.

supposedly php has no limit to the amount of data you can store in a variable...I doubt it tho. Further reading indicates my server should beable to use values up to 9223372036854775807.

Even better mysql is also in 64bit so it can handle the modulus operation in a group by clause:
ex:
select Primes%$number
from PrimesTable
group by Primes
having Primes%$number = 0;

then you can see if any rows were returned and insert the new prime if not. This will be fun :p

o0 sql will calculate past that, now to store the numbers as strings so I can go to virtually infinity (at the cost of lots of storage and time converting :\)
 
Last edited:
Does it have to be c++, C#, etc., stuff that we've coded? Because I mess around with GIMP sometimes. Funnily enough, this image was made following instructions vibro posted a long time ago, well it was a link to some gentoo-wiki thing

 
Some photographs I've taken:







And here's my UT handle in a graffiti handstyle for a get-well-soon card we sent Chrol. (Warning: pic is print resolution and therefore huge.)

Also, I write music.

CS, that picture you posted reminds me of the time I cut open a glowstick and poured it in my sink while it was filled with water. You should try that sometime, it looks awesome.
 
c$ you should check out xara(free in linux) or inkscape. They are vector based image editing compared to bitmap and may help you get over the hump and actually making interesting stuff. If anything you can convert logos and blow them way up for people.

I made my AV starting out in photoshop by choosing two letters then throwing them onto each other.
Then I took em into illustrator and converted the bitmap to a vector image.
Then I threw it into fireworks and applied the appropriate size and put a few filters on it.

I would have hated to try that in gimp/xara/inkscape, but right now there is no native version for osx (that doesn't use x11) that I know of.

And no there is no limitation, post whatever.
 
Prime number generator using php and mysql. Now to trigger it every minute or so and kill my bandwidth. It only evaluates 1 number at a time, but I don't want to scare my webhost into slaughtering my access :p

Code:
<?php
$link = mysql_connect('localhost', $user, $password);
	
if (!$link)
	die('Could not connect: ' . mysql_error());
	
else {

	mysql_select_db($db);
	
	$query = 'SELECT `LastPrime` FROM `LastCalc` WHERE `id` = 1;';	
	$result = mysql_query($query);
	
	while ($row = mysql_fetch_assoc($result)) {
		$NewPrime = ++$row['LastPrime'];
		break;
	}
	
	mysql_select_db('sakkaku_primes');
	$query = 'SELECT ' . $NewPrime . '%`Prime` FROM `Primes` WHERE ' . $NewPrime . '%`Prime` = 0;';

	$result = mysql_query($query);
	$rows = mysql_num_rows($result);
	
	if(!$rows) {
		echo $NewPrime . "::1";
		
		$query = 'INSERT INTO `Primes` SET `Prime` =' . $NewPrime . ';';
		$result = mysql_query($query);
	}
	else
		echo $NewPrime . "::0";
	
	$query = 'UPDATE `LastCalc` SET `LastPrime` = ' . $NewPrime . ' WHERE `id` = 1;';
	$result = mysql_query($query);
}

?>

and the lsl script to trigger and display the last calculated and last 7 generated primes within second life:

Code:
list gPrimeNumbers = [];
string gLastCalculated;

TriggerHTTP() {
    key ReqID = llHTTPRequest("http://sl.vibrokatana.com/primes.php", [], "");
}

SetFloatingText() {
    string TextToSet = "Last Calculated: " + gLastCalculated + " \n New Primes: \n ";
    
    integer i;
    integer Num = (gPrimeNumbers != []);
    
    if(Num > 7) {
         gPrimeNumbers = llDeleteSubList(gPrimeNumbers, 0, 0);
         Num = 7;
    }
    
    for(i = 0; i < Num; ++i) {
        TextToSet += llList2String(gPrimeNumbers, i) + " \n ";
    }
    
    llSetText(TextToSet, <1,1,1>, .7);
}

default {
    state_entry() {
        llSetTimerEvent(30);
    }
    
    timer() {
        TriggerHTTP();
    }
    
    http_response( key request_id, integer status, list metadata, string body ) {
        
        list NewNumber = llParseString2List(body, ["::"], [""]);
        string Number = llList2String(NewNumber, 0);
        if(llList2Integer(NewNumber, 1) == 1) {
            gPrimeNumbers += Number;
        }
        
        gLastCalculated = Number;
        
        SetFloatingText();
    }
}

and an image displaying the final thingy, it's ugly but whatever:
primegen.png


The nice thing is that will trigger every 30 seconds whether im logged in or not so it is useful for redundant tasks :p
 
Last edited:
Kraniac that one of the mushroom is awesome! Can you send my a copy? Id love to play with that in PS.
 
Here's some stuff that I have made:

I made this guy on a camping trip with my knife, his name is Tyrone.

I know the pic sucks, but oh well. I made this little guy out of clay one day.
But then I accidentally stepped on him so....he looks a little deformed, his name is Phil.

I drew this in my new artpad (It's the first page) I'm going to start drawing more often, his name is Imhotep. :)

Well thats some of the random things I've made...OH my blog is in my sig>>
:D
 
c$ you should check out xara(free in linux) or inkscape. They are vector based image editing compared to bitmap and may help you get over the hump and actually making interesting stuff.anything you can convert logos and blow them way up for people.

I made my AV starting out in photoshop by choosing two letters then throwing them onto each other.
Then I took em into illustrator and converted the bitmap to a vector image.
Then I threw it into fireworks and applied the appropriate size and put a few filters on it.

I would have hated to try that in gimp/xara/inkscape, but right now there is no native version for osx (that doesn't use x11) that I know of.

yeah the closest thing I would have done on something like your avvy would have been using the letters and airbrushing the color onto it or something (there's also a method I do stuff from one of the walkthrough thingies on gimp.org, 3d floating logos, but that takes forever and I hate working with a bunch of layers), then duplicating it and making it a dark color, put it behind the original, and blur it (shadow) and anyway it woulda been bitmap
 
http://vibrokatana.com/primegen

Using the new prime number database it returns the lowest divisors (lowest common something? lol its been so long since I took anything related to that). Basically enter a number and it will return the prime numbers that divide evenly into it.

It wont do anything if you enter in a none number or something over the values calculated thus far.
 
Ah.
I wish somebody would say somthin about my drawings and stuff....:(
I want to be a concept artist when I grow up.
 
Ah.
I wish somebody would say somthin about my drawings and stuff....:(
I want to be a concept artist when I grow up.

The guy from above looks pretty good, the face is a little weird tho. Also the posture and holding of the sword is really weird, if he had the sword, say on his sholder it would look alot more natural.
 
I really like your drawing, Snakebite. Tyrone is pretty cool, too. =) I'm assuming Phil had better days.

I'll see about uploading some guitar stuff of mine.
 
Well, I guess a story has to be 'made' eh? :rolleyes:

This will make absolutely no sense if you are not familiar with both 'All your base are belong to us' and 'Star Wars Episode I'.


ALL YOUR BASEBALL


Excuse me, Meestah!

IT IS YOU

Yes sah, eesa mee sah. Isa just wondering, whosa on first?

CORRECT MISTER BINKS

No, yousa no understand whasa I mean sah. Isa asking, whosa on first, sah.

WHO ARE THE PLAYER ON FIRST BASE

Thats what Isa wondering. Yousa the manager, sah?

I ARE HAVING ALL BASE

Yes sah, so yousa must know all the players’ names. So Isa asking yousa, whosa on first?

I HAVE ALREADY TELLING YOU WHO ARE ON FIRST BASE

Look, yousa got a first baseman?

CORRECT

And yousa pay him a salary, sah?

ALL HIS SALARY ARE COME FROM ME

Ok, sah. All I want to know is, whosa on first, sah?

WHO

The player who gets a salary from you, sah.

THAT WHAT I ARE SAYING

What?

NO WHAT ARE NOT ON FIRST WHO ARE ON FIRST.

Yes. Thatsa my question, sah.

THEN I ARE HAVING ANSWERED YOU

Look, Yousa not understanding me, sah. Whassa the name of the player on first base?

WHAT ARE THE NAME OF PLAYER ON SECOND BASE

Isa not asking about second, Isa ask whosa on first!

I ALREADY TELLING YOU WHO ARE ON FIRST NOW GO AWAY OR YOU WILL BE HAVING DESTRUCTION

Look, Isa be asking you for the last time! If you no a being telling me whosa on first I will use meesa muy muy juju jedi power on you, sah!

HA HA HA HA

Yousa thinks Isa being funny!

THERE ARE THE FIRST TIME FOR EVERYTHING

Thatsa for sure! Wait, whassa meesa saying?

THAT ARE FINALLY A GOOD QUESTION

Look, Isa asking you for the last time, whosa on first!

YOU ARE NOT NEED TO KNOW WHO ARE ON FIRST

Isa no need to know whosa on first.

YOU MUST SHOOT YOU SELF WITH LASER BLASTER

Isa shoot meesa self with laser blaster. Good idea, sah! [ZAP!] AAAARGH!!
 
Back
Top