RTC GetHours/seconds/minutes help?

Dec 22, 2011 at 2:41 AM

Hello everyone. I am new here, so I firstly would like to appologize if this is the wrong section or something, but anyway, I am making a very basic os that just has a TUI and a few commands. So, what i'm trying to do atm is add a clock. Well, I know how to get the hours, minutes, and seconds, but i cant figure out how to print them... if i use tostring, i get an error... I just cant figure it out.. Can anyone help me out? I am using MS4. I know I should update, but... i cant. lets just leave it that.. :P Anyway, thanks for reading, and please lemme know what to do. :) THX!

Coordinator
Dec 22, 2011 at 7:57 AM
Best to upgrade to latest, as compiler is much more mature now... Not really sure if RTC works then though....


On Thu, Dec 22, 2011 at 4:41 AM, sci4me <notifications@codeplex.com> wrote:

From: sci4me

Hello everyone. I am new here, so I firstly would like to appologize if this is the wrong section or something, but anyway, I am making a very basic os that just has a TUI and a few commands. So, what i'm trying to do atm is add a clock. Well, I know how to get the hours, minutes, and seconds, but i cant figure out how to print them... if i use tostring, i get an error... I just cant figure it out.. Can anyone help me out? I am using MS4. I know I should update, but... i cant. lets just leave it that.. :P Anyway, thanks for reading, and please lemme know what to do. :) THX!

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 22, 2011 at 9:00 PM

But I can't update b/c I cant get the updated one to work on 2010 express. So.. is there a way to get the RTC working?

Dec 25, 2011 at 11:25 PM

I appologize for bumping, and my spelling, but I would still like to know about the RTC. Also, is there any way to set the RTC's time?

Coordinator
Dec 26, 2011 at 10:21 AM
Have you had a look at the assemblies from Cosmos using a tool like ILSpy to see what classes are there? See if there's a class named RTC or Clock or something like that. If it doesn't exist, you could implement it..


On Mon, Dec 26, 2011 at 1:25 AM, sci4me <notifications@codeplex.com> wrote:

From: sci4me

I appologize for bumping, and my spelling, but I would still like to know about the RTC. Also, is there any way to set the RTC's time?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 26, 2011 at 9:41 PM

What?!?!? Dude, Cosmos.Hardware.RTC lol I just need to know how to convert that thing's output to usable string. It outputs bytes. :D

Coordinator
Dec 28, 2011 at 6:50 AM
Ok, was confused by your message saying "how to get the RTC working"
Try to do an explicit .ToString on the values instead of using WriteLine(value)...

On Mon, Dec 26, 2011 at 11:41 PM, sci4me <notifications@codeplex.com> wrote:

From: sci4me

What?!?!? Dude, Cosmos.Hardware.RTC lol I just need to know how to convert that thing's output to usable string. It outputs bytes. :D

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 28, 2011 at 2:19 PM

Oh. LOL. Anyway, I tried to do it explicit but it didn't work. I know it's possible in MS4... I saw it in a youtube video. But... I dont know...

Coordinator
Dec 28, 2011 at 2:23 PM
you have a .Minutes property, do Console.WriteLine(RTC.Minutes.ToString());
see if it works. If not, tell what happens..


On Wed, Dec 28, 2011 at 4:19 PM, sci4me <notifications@codeplex.com> wrote:

From: sci4me

Oh. LOL. Anyway, I tried to do it explicit but it didn't work. I know it's possible in MS4... I saw it in a youtube video. But... I dont know...

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 28, 2011 at 3:13 PM

Console.WriteLine(RTC.Minutes.ToString());

RTC is underlines and says it's not in the current context or something like that.

Console.WriteLine(Cosmos.Hardware.RTC.GetMinutes().ToString());

OMFG IT WORKS. That was actually a surprise... lemme try some other stuffs now...

int h = Cosmos.Hardware.RTC.GetHours();
int m = Cosmos.Hardware.RTC.GetMinutes();
int s = Cosmos.Hardware.RTC.GetSeconds();
Console.WriteLine(h.ToString() + ":" + m.ToString() + ":" + s.ToString());
It says this: 

16 smileyface male-symbol

Hmmm...? THIS:

Console.WriteLine(Cosmos.Hardware.RTC.GetHours().ToString() + ":" + Cosmos.Hardware.RTC.GetMinutes().ToString() + ":" + Cosmos.Hardware.RTC.GetSeconds().ToString());

16 smileyface male-symbol

???

Coordinator
Dec 28, 2011 at 4:44 PM
String.Concat is not (fully) implemented.

Try doing multiple .Write(string) calls..


On Wed, Dec 28, 2011 at 5:13 PM, sci4me <notifications@codeplex.com> wrote:

From: sci4me

Console.WriteLine(RTC.Minutes.ToString());

RTC is underlines and says it's not in the current context or something like that.

Console.WriteLine(Cosmos.Hardware.RTC.GetMinutes().ToString());

OMFG IT WORKS. That was actually a surprise... lemme try some other stuffs now...

int h = Cosmos.Hardware.RTC.GetHours();
int m = Cosmos.Hardware.RTC.GetMinutes();
int s = Cosmos.Hardware.RTC.GetSeconds();
Console.WriteLine(h.ToString() + ":" + m.ToString() + ":" + s.ToString());
It says this: 

16 smileyface male-symbol

Hmmm...? THIS:

Console.WriteLine(Cosmos.Hardware.RTC.GetHours().ToString() + ":" + Cosmos.Hardware.RTC.GetMinutes().ToString() + ":" + Cosmos.Hardware.RTC.GetSeconds().ToString());

16 smileyface male-symbol

???

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 28, 2011 at 6:38 PM

That works. :) Thanks! :D

p.s. is there a way to make String.Concat work? If not, no big deal. I'm just glad it works. :D

Developer
Dec 29, 2011 at 5:19 AM
Edited Dec 29, 2011 at 11:32 PM

I have a basic implementation of String.Concat here. Someone could turn it into a plug pretty easily.

 

static string Concat(params string[] values)
{
    char[] all_strings;
    int length = 0;
    for (int i = 0; i < values.Length; i++)
    {
        length += values[i].Length;
    }
    all_strings = new char[length];
    int offset = 0;
    for (int i = 0; i < values.Length; i++)
    {
        for (int x = 0; x < values[i].Length; x++)
        {
            all_strings[offset + x] = values[i][x];
        }
        offset += values[i].Length;
    }
    return new string(all_strings);
}

 

It probably isn't the best implementation ever, but it does the job!

EDIT: Its ten times slower than the normal .NET Framework one

Hope this helps!

--CMan332--

Coordinator
Dec 29, 2011 at 6:57 AM
Cman: If I recall correctly, you made some contributions before, right?


On Thu, Dec 29, 2011 at 7:19 AM, Cman332 <notifications@codeplex.com> wrote:

From: Cman332

I have a basic implementation of String.Concat here. Someone could turn it into a plug pretty easily.

static string Concat(params string[] values)
{
    char[] all_strings;
    int length = 0;
    for (int i = 0; i < values.Length; i++)
    {
        length += values[i].Length;
    }
    all_strings = new char[length];
    int offset = 0;
    for (int i = 0; i < values.Length; i++)
    {
        for (int x = 0; x < values[i].Length; x++)
        {
            all_strings[offset + x] = values[i][x];
        }
        offset += values[i].Length;
    }
    return new string(all_strings);
}

It probably isn't the best implementation ever, but it does the job!

Hope this helps!

--CMan332--

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Dec 29, 2011 at 10:51 AM

Hi mterwood!

I think I have made one or two contributions before. I think they were a tiny portion of the new RTC class and a plug for the Random class that won't work until the conversions are fixed (unless they already are). Why do you ask?

--CMan332--

Coordinator
Dec 29, 2011 at 10:55 AM
Interesting in joining?
If so, please join the mailinglist..


On Thu, Dec 29, 2011 at 12:52 PM, CMan332 <notifications@codeplex.com> wrote:

From: CMan332

Hi mterwood!

I think I have made one or two contributions before. I think they were a tiny portion of the new RTC class and a plug for the Random class that won't work until the conversions are fixed (unless they already are). Why do you ask?

--CMan332--

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Dec 29, 2011 at 11:26 PM

I am quite interested in joining actually! I've already joined the mailing list. The mailing list is the thing that keeps on sending me e-mails titled [Cosmos-Dev] isn't it?

Thanks

--CMan332--

Coordinator
Dec 29, 2011 at 11:44 PM
> I am quite interested in joining actually! I've already joined the
> mailing list. The mailing list is the thing that keeps on sending me
> e-mails titled [Cosmos-Dev] isn't it?

Yes. Send me your skype id and I'll add you. We also have an IRC chat
room which can be very active but it varies depending on time zones.
Developer
Dec 30, 2011 at 12:00 AM

Skype ID? I don't have one and I would rather not get one. Too many details to give to Microsoft. They already know a lot about me already. Is an e-mail fine? I've been on the IRC chat before and I'm not sure if it actually works. Can someone suggest a good IRC client?

Thanks!

--CMan332--

Coordinator
Dec 30, 2011 at 12:25 AM
> Skype ID? I don't have one and I would rather not get one. Too many

You dont have to give them anything other than an email address which
could be a dummy one.

> details to give to Microsoft. They already know a lot about me already.
> Is an e-mail fine? I've been on the IRC chat before and I'm not sure if
> it actually works. Can someone suggest a good IRC client?

xchat is the one I like the best, but it costs $20.
Developer
Dec 30, 2011 at 12:26 AM

One question. Why do we use skype anyway? And also... I might search for myself a little bit. $20 is a bit much.

Coordinator
Dec 30, 2011 at 12:27 AM
> One question. Why do we use skype anyway? And also... I might search for

Because its not full of ads and crap like all the other IMs and its the
only one that "just works"

> myself a little bit. $20 is a bit much.

There are many free ones too, and there is a web interface.
Developer
Dec 30, 2011 at 12:31 AM
kudzu wrote:
 Because its not full of ads and crap like all the other IMs and its the
only one that "just works"

Ok, got it. So Google Talk is out of the question then? Ha ha ha ha. 

kudzu wrote:
There are many free ones too, and there is a web interface

Can someone please tell me how it works? It shows a bunch of people on the side but there is nothing in the middle.

Coordinator
Dec 30, 2011 at 12:33 AM
> Can someone please tell me how it works? It shows a bunch of people on
> the side but there is nothing in the middle.

That just means they are lurking and no one is talking. Post a message
and wait.. sometimes it might take someone a few or even 20-30 minutes
to notice someone is starting a conversation. I leave myself joined all
the time but Im not always at the computer.
Developer
Dec 30, 2011 at 12:34 AM
Edited Dec 30, 2011 at 12:42 AM

Oh. Lurking. Gotcha. Now I can get it to work!

EDIT: callum715 AT gmail DOT com <--- That is my google account/email account

Developer
Dec 30, 2011 at 3:35 AM

sci4me.

I have commited a new string plug to the source. You should be able to concatenate strings with the new commit. I suggest Reinstalling from the latest source. Hope it works!

--CMan332--