Marcel's Blog

Endless experimentation

  • I am using

    Firefox Download Button
  • Readers

    • 35,475 Visits
  • Archive

  • Ce-i cu blogu’ asta ?

    Details at "About" Page. Postez pe acest blog pur si simplu fiindca imi place si sunt dornic sa impartasesc cu toata lumea experimentele mele, filmarile, chestiile DIY si multe alte lucruri. Ma simt eu mai bine daca o fac :). Blogul este in engleza, fiind o limba de circulatie internationala. Cred ca majoritatea va descurcati sa o intelegeti ;). Details at "About" Page.
  • Calendar Blog

    October 2011
    M T W T F S S
    « Sep   Nov »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • Meta

  • Visitors

    free counters Since 26th June 2010. Total visits are displayed up

Archive for October, 2011

15 Years of Download.com: Interesting Charts and Data

Posted by sjackm on 25 October 2011

The following is a cnet infographic with interesting data about download.com over the years:

 

Posted in Internet, Software | Tagged: , , , , | Leave a Comment »

Stunning Theory: Expect a second ”sun” to be seen on the sky

Posted by sjackm on 23 October 2011

2 Suns

Recently I’ve been reading some stories about getting a second ‘sun’ on the sky as soon as 2012( oh what a perfect date… is this supposed to fuel the theory of the end of the world? it is becoming increasingly ridiculous to correlate unusual natural phenomenons with a world end…

The ‘second sun’ will actually be a supernova explosion of Betelgeuse, one of the brightest and biggest stars in our vicinity. The resulting explosion will be so intense that it will outshine the moon.

Betelgeuse is only about 10 million years old(compare that to the 4 billion years of our sun), but because of its high mass it has rapidly consumed its hydrogen. This star is approaching a cataclysmic death, but scientists can’t be sure when it will happen. It can be today, or thousands of years in the future. So assigning 2012 as the date of this event is just a childish guess. Yes, it can happen then, although it’s highly improbable. And the explosion won’t damage our Earth’s ecosystems: it will just disrupt the normal day-night cycle for a couple of weeks. It’s all about observing a distant astronomical object (Betelgeuse is about 640 light years away form us- that means that the star may have already exploded!).

Here’s one of the blog posts about this I’ve read.

Betelgeuse magnitude

 

Posted in Science, Space | Tagged: , , , , , | Leave a Comment »

HTML Color Table Generator

Posted by sjackm on 20 October 2011

When I’m bored I can spend my time creating weird, pointless things. Such as this HTML Color Table generator. What does it do?

Well, it takes only 2 inputs: the number of rows and numbers of colons. It then creates (rows)*(colons) number of cells, each cell being a different color( might be even unique but I guess there’s a high chance 2 cells will have the same color). Bonus: each cell is numbered! :) )

It’s a simple console C++ program that makes use of the randomization function( well, computers have a pseudo-randomization algorithm but it works…).

Here’s how the program looks:

And here’s how the output .html file looks like for the above numbers(10 rows and 20 colons):

Meh, doesn’t have a point right? I made it just for fun :P

If you want you can download the program here (I think it only works under Windows).

And here’s the source code if you’re interested:

// uses style=”background-color:rgb(r,g,b)” and rand()%256 for generating the color

#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <fstream>
using namespace std;

int main(){

srand(time(NULL));
ofstream table(“colortable.html”);
int rows, colons; int i,j, r,g,b;
int number=0;

cout<<”WARNING! DO NOT IMPUT HIGH NUMBERS! (number of cells = rows*colons!) => Will take forever to generate…”<<endl<<endl<<”It is also recommended to avoid a big number of colons to avoid horizontal scrolling!”<<endl<<endl;

cout<<”Input the number of <<rows>> the color table will have:”<<endl; cin>>rows;
cout<<endl<<”Input the number of <<colons>> the color table will have:”<<endl; cin>>colons;
cout<<endl<<”We are ready to start!”<<endl;

table<<” <html><html><head><title>Random Color Table</title></head><body><table border=’1′ align=’center’>”;

for(i=0; i<rows; i++){
table<<”<tr>”;
for(j=0; j<colons; j++){
table<<”<td style=’background-color:rgb(“<<rand()%256<<”,”<<rand()%256<<”,”<<rand()%256<<”)’>”<<number<<”</td>”;
cout<<”Cell number”<<number<<endl;
number++;
}
}

table<<”</table></body></html>”;

return 0;}

Have fun!

Posted in Internet, Programare | Tagged: , , , , , , , | 4 Comments »

 
Follow

Get every new post delivered to your Inbox.