Fork me on GitHub

Sep 23, 2007

Cartasol!

Cartasol is an algorithm written in QBasic by this guy:

http://editorial.cda.ulpgc.es/ambiente/2_clima/2_soleamiento/9_anexo/index.htm

I just translated it to a better language C#:

using System;

namespace Cartasol {
public class Cartasol {
private double latitude;
private double dayOfTheYear;
private double rad;
private double decl;
private double c1;
private double c2;
private double[] asol;
private double[] zsol;

public static void Main(string[] args) {
new Cartasol();
}

public Cartasol() {
asol = new double[49];
zsol = new double[49];
Console.WriteLine("Cartasol!");

Console.Write("Latitude: "); latitude = double.Parse(Console.ReadLine());
Console.Write("Day of the year: "); dayOfTheYear = double.Parse(Console.ReadLine());

rad = Math.Atan(1) / 45;

decl = (23.45 * rad) * Math.Sin(360 * rad * ((dayOfTheYear - 81) / 365));
c1 = Math.Sin(latitude * rad) * Math.Sin(decl);
c1 = Math.Cos(latitude * rad) * Math.Cos(decl);

for(int i = 0; i <= 48; i++) {
double w = (i / (48 * 360 * 180));
double senasol = c1 + c2 * Math.Cos(w);
double cosasol = Math.Sqrt(1 - Math.Pow(senasol, 2));
asol[i] = Math.Atan(senasol / cosasol) / rad;

double coszsol = (Math.Sin(latitude * rad) * senasol - Math.Sin(decl)) / (Math.Cos(latitude * rad) * cosasol);
if(coszsol >= 1 || coszsol <= -1)
coszsol = 1;
double senzsol = Math.Sqrt(1 - Math.Pow(cosasol, 2));
zsol[i] = 90; // prevent an error

if(coszsol != 0)
zsol[i] = Math.Atan(senzsol / coszsol) / rad;
if(zsol[i] < 0)
zsol[i] = 180 + zsol[i];
if(w < 0)
zsol[i] = -zsol[i];
}

for(int i = 0; i <= 48; i += 2)
Console.WriteLine((i / 2).ToString() + ", " + asol[i].ToString() + ", " + zsol[i].ToString());
}
}
}

I have no idea of what this thing do... you can ask my friend about it: luisram06@gmail.com

Sep 22, 2007

My filesystem type is... Packman

I do get the same screenshot as this Ubuntero: http://jonathancarter.co.za/75-of-my-filesystem-represents-pacman


One of the new stuff that Gnome 2.20 bring us :)

Sep 18, 2007

New Ipods in Linux

I have been hearing(http://tirania.org/blog/archive/2007/Sep-15.html) some comments in other blogs about Apple blocking third party clients in the recently released Ipods.

The Story:

Apple added an algorithm that uses a Hash with the purpose of making Ipods compatible only with itunes, as you should know itunes only runs on Windows and MacOSX.

So, if you bought a new Ipod you can only use it with itunes, and I'm not meaning that itunes is a bad audio/video player, because it is very good, but you can't force people to use a software when they are buying hardware.

The very sad state:

We all want a free but compatible desktop, we could have a full functional desktop with 0 non-free software, but unfortunately we don't live in a free(as freedom) world, so free and open source software have to be compatible with non-free devices.

Users today use their computer for chating, email, browsing and music. When a non-geek user uses him computer with Linux he would like to do those things, and what a surprise would it be if him brand new Ipod doesn't work in him brand new operative system. A normal user would says "It sucks!!!... I would never use it again! :@".

We live in a stupid world!:

We live in a world that people buy things just because these things are from X or Y brand, being Apple so popular in this days buying an Ipod is a common choose, and that's bad for Linux.

The good news:

The hash got Hack!(http://tirania.org/blog/archive/2007/Sep-16.html)

More good news:

from ipod-sharp changelog:

2007-09-17 Aaron Bockover

* src/TrackDatabase.cs: First pass at hashing the database

* src/Hash58.cs: Implementation of the crappy hash algorithm that
Apple decided to use to lock out third party clients


Is a matter of time for Banshee get support for the new Ipods.

Sep 13, 2007

The joke of the day

From: http://bash.org/?400459

Sonium: someone speak python here?
lucky: HHHHHSSSSSHSSS
lucky: SSSSS
Sonium: the programming language

Sep 7, 2007

Software Freedom Day Nicaragua


From Software Freedom Day site: Software Freedom Day is a global, grassroots effort to educate the public about the importance of software freedom and the virtues and availability of Free and Open Source Software. Local teams from all over the world organise events on the third Saturday in September. The most recent event involved over 200 teams from all over the world.

Sep 2, 2007

Quote of the day

"You learn PHP because you need a job, you learn Java because you study a Computer Science related career, but you learn Python because you love it"

Adrian Holovaty

disclaimer



Things written in this blog are my personal thoughts or points of view, and do not represent at all the position of my employer.

Code in the website is licensed under The MIT License

Content of this blog is:
Creative Commons License
Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.