Duki 552 Nearly a Posting Virtuoso

thanks !

was that made in c#? or just a picture?

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm going to be starting on a project that communicates with a 270 degree range finder. I would like to incorporate some sort of picture to represent the data it reads. Something similar to this

Does anyone have an idea of where I could start? I'm not sure how to plot the different ranges...

Duki 552 Nearly a Posting Virtuoso

But where does it say all state electors must go to the same candidate.

Duki 552 Nearly a Posting Virtuoso

At the very least, we should keep the electoral system as a safe-guard, but divide them proportionally so that the popular vote carries more weight. If McCain won 49% of FL and Obama won 51%, McCain should get 13 electoral votes and Obama should get 14. That's fair.

Duki 552 Nearly a Posting Virtuoso

it makes sense... sort of. But it's not like the electoral votes make it any more fair. It takes 7 states to equal CA. in electoral votes.

Duki 552 Nearly a Posting Virtuoso

who cares which state they're from though. a citizen is a citizen. If 80% of Americans are in California NY and TX they would still have to convince the same number of voters if not more. It seems like we're voting as states rather than as citizens

Duki 552 Nearly a Posting Virtuoso

so how does this prevent CA and NY from stealing the country from its true rulers? under the current system, slightly more than half of the votes are all that are required to gain full support from either state.

Duki 552 Nearly a Posting Virtuoso

a federal republic? could you explain that?

Duki 552 Nearly a Posting Virtuoso

yes i understand that. and it doesn't seem fair. Why does the popular vote not count for more?

If someone wins California by 2 votes all the electoral votes are given to the candidate. But that's 49% to 51%. Why is it fair to count out the 49% of Californians who voted for the other party? Do we just throw those votes away?

Duki 552 Nearly a Posting Virtuoso

Will someone PLEASE explain to me the significance of the electoral votes? More specifically, how is the popular vote 48% - 51%, yet Obama won by more than double the electoral votes as McCain. Someone make sense of this for me. I understand according to the process, the electoral votes are what matter most, but how can it be so one-sided when the popular vote is so close? Do we as normal citizens really have that little of a say in who runs our country?

Duki 552 Nearly a Posting Virtuoso

Just for the record, I wasn't trying to do yellow journalism or anything of that sort. If the title is offensive somehow, I apologize. Actually, I expected and was rooting for C++, so I assure you I wasn't trying to make false accusations. If a Mod would like to change the title to something more appropriate, feel free. Doesn't make a difference to me.


Thanks for the replies. I can understand datetime and clock() causing a timing difference in the iterative versions, but not the recursive; not that big anyways. The differences in time was about 8 seconds. I'm sure the different timing methods didn't cause an 8 second delay.

The iteration tests were the same to whoever said they weren't (as far as the number of iterations). I posted the last code I used, but I made sure to change it before my tests so that they were fair between the two.

I wasn't aware of an optimization capability. Thanks. Where do I access that? Also, is there the same sort of capability for C#?

thanks again for everyone's help

Alex Edwards commented: Doing experiments and asking questions to find solutions besides your own is the best way to learn, so dont you dare be sorry! =) +4
christina>you commented: dun worry. +16
Duki 552 Nearly a Posting Virtuoso

Pepsi One.

christina>you commented: good choice ;) +16
Duki 552 Nearly a Posting Virtuoso

Hey Everyone,

I'm doing a little test for a presentation I'm giving on Tuesday. I wanted to show the performance difference between VB2008, C# and C++.

To do this, I have three programs. Each program performs the Fibonacci sequence X times, and can either do it iteratively or recursively. As expected both C# and C++ blow VB away. However, my test between C# (with GUI) and C++ (command line) was a little surprising.

I did 40 Fibonacci numbers, both iteratively and recursively. The iterative tests show the same time to the millisecond almost. However, when doing the recursive test, C# completed the calculation in 3.8 seconds, while it took C++ about 12.1 seconds. Is this expected? I would have thought C++, especially with it being command line, would have outperformed C#?

Here are my codes... maybe you can see an 'unfairness' that might help clear things up. Or am I wrong in thinking C++ is quicker than C#?

C++ Code:

#include <iostream>
#include <ctime>
#include <stdio.h>
#include <time.h>

using namespace std ;

unsigned long first = 0;
unsigned long second = 1 ;
unsigned long result ;

time_t start, end ;
double total ;

int x ;
int ans ;

unsigned long fib( int n ) ;

int main()
{
	cout << endl << " Fibonacci Sequence Test -> C++ " << endl ;
	cout << "_____________________________________" << endl ;


	cout << endl << endl << endl ;

	cout << "Number of iterations to …
Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm working with a login form in my application. The easiest way I can see to do the authentication is to query a user/pass database for any rows that match the given username and password. How can I send a query when the user clicks OK?

Am I doing this the hard way? Is there something easier?

Thanks

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm trying to send a bindingitem add new item click event but i'm having problems. I've tried BindingNavigatorAddNewItem_Click(sender, e) but it doesn't work. I want to do this so I can remove the toolstrip and have my own link labels on the form. For now, I still have the toolstrip included with the database modification buttons. I can click the Add New button and add an entry fine, but I can't do it using strictly code.

Please, can anyone help?

Duki 552 Nearly a Posting Virtuoso

The icon was added automatically. I've tried raising the _click but it won't work.

Duki 552 Nearly a Posting Virtuoso

Hmm, ok. What commands can I enter to see my com ports?

Duki 552 Nearly a Posting Virtuoso

Diet Dr. Pepper.

Duki 552 Nearly a Posting Virtuoso

I'm not sure. We tried some command, can't remember what it was, and it showed ttyS0-3

Duki 552 Nearly a Posting Virtuoso

Yes.
Once I click the link label, I want to send the click event of the "AddNewItem" database binding.

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

we're still working trying to get Linux to communicate to our robot via an RS232 port. We added this code to the project in Mono:

Using System.Ports.IO
SerialPort ports = new SerialPort("ttyS0",19200,Parity.None, 8, StopBits.One);

We can't get anything sent out of our COM ports. We're not even sure if we're coding it correctly. Is ttyS0 (we've tried S0-Sf) what we should be putting in the code? Please help!!

thanks!

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I have a program using databases and I want to send a click event for the AddNewItem binding. I was able to do something similar for the "Save" icon, so that when a user modifies an entry they can click a link label that says "Apply" and it will save the entry back to the database. Now I want to have a link label that says "Add", which would allow the user to create a new database entry.

Can someone help?
Thanks!

Duki 552 Nearly a Posting Virtuoso

Oh ok. So is there code I can use to open the coms?

Duki 552 Nearly a Posting Virtuoso

Hey guys,

is there something special I need to do to access the RS232 port in Linux from C#?

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm creating some databases (new to this) and I'd like to specify the maximum number of digits allowed for a record. For example, I have a field for zip code that I would like to limit to 5 digits. Can I do this with any of the binary data types, or should I just use varchar?

Thanks

Duki 552 Nearly a Posting Virtuoso

Ok thanks. I can't get it to proportion correctly now.

Here's what I have

Dim Gr As Graphics = PictureBox1.CreateGraphics()
        Dim skyBluePen As New Pen(Brushes.DeepSkyBlue)
        Gr.DrawLine(skyBluePen, (2 * 5), Convert.ToInt16(1759 * 0.067), (103 * 5), Convert.ToInt16(1768 * 0.067 - 20))

I had to do -20 because the elevation ended up being about a pixel difference. Are there better solutions to this?

Duki 552 Nearly a Posting Virtuoso

Try something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ans As Integer = CInt(InputBox("How many textboxes do you want?"))
        Dim txtDist As Integer = 10
        Dim txtLocation As New Point(10, 10)
        Dim txtSize As New Size(100, 25)
        For x As Integer = 1 To ans
            Dim txt As New TextBox
            txt.Size = txtSize
            txt.Name = "txName" & CStr(x)
            txt.Location = txtLocation
            txt.Visible = True
            txt.Text = txt.Name
            Me.Controls.Add(txt)
            txtLocation.X += txt.Width + txtDist
            If txtLocation.X + txtSize.Width + txtDist > Me.ClientRectangle.Width Then
                txtLocation.X = 10
                txtLocation.Y += txtSize.Height + txtDist
            End If
            My.Application.DoEvents()
        Next
    End Sub

Thanks! This is working great.
Maybe you can help me with my next part. I need to draw the slope that connects the two points. I have the drawing part figured out, as far as what methods to call and whatnot (I think) but I'm having problems with drawing multiple lines. I'd like to take the textbox inputs and draw the slopes of each one.

So for example, if they chose to enter 10 points with 10 associated elevations I would like to draw a line connecting point 1 to 2, 2 to 3, 3 to 4, etc.

Can you help me with designing the for loop for this? I'm having a hard time with associating the drawline method with the appropriate textboxes.

Here's what I'm doing right now

Dim Gr As Graphics = PictureBox1.CreateGraphics()
        Dim skyBluePen As New Pen(Brushes.DeepSkyBlue)
        Gr.DrawLine(skyBluePen, …
Duki 552 Nearly a Posting Virtuoso

What do you mean by grid control?

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I have a program that computes the distance between two elevations at a given point. I need to plot these lines to a picture. I'm having problems getting the lines to start in the correct spot. Here's the code I'm using:

Dim Gr As Graphics = PictureBox1.CreateGraphics()
        Dim skyBluePen As New Pen(Brushes.DeepSkyBlue)
        Gr.DrawLine(skyBluePen, 2, 1759, 103, 1768)

2 and 103 is the starting and ending distance (x1 and x2)
the 1700 values are y1 and y2.

I can't figure out a way to modify the given values to make sure they show up correctly on the picture box.

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm writing a program for work. I need to do the following:

The user inputs an unknown number of values to be processed. I want to allow them to basically click "new" and be able to add a new textbox or something that will allow them to input their data. I want to do this to keep from having 30 textboxes on the form, when only 7 are needed.

Does anyone know how I can do this?

Duki 552 Nearly a Posting Virtuoso

Ok itś working now in Ubuntu. I was trying Fedora earlier.

Is there a way to modify the form from Mono? I see the Form1.designer.cs but it brings up the code, not the layout. Do our forms need to be designed in visual studio and then imported to Mono? Or is there a form designer available?

Duki 552 Nearly a Posting Virtuoso

I transfered them via flash drive

Duki 552 Nearly a Posting Virtuoso

Created the hello world program and it ran fine

Duki 552 Nearly a Posting Virtuoso

There is

Duki 552 Nearly a Posting Virtuoso

They're both on Line 1

Using System

It says one is associated with Form1.resx and the other is Resources.resx

Duki 552 Nearly a Posting Virtuoso

I get two parsing errors (CS8025).

Duki 552 Nearly a Posting Virtuoso

now we're getting compile errors for some reason. I don't know why

Duki 552 Nearly a Posting Virtuoso

yes mono is working.
I ran the app through MoMa and it said something about one of our methods not being supported but no big deal. Just a simple cursor_clip.

But we still get compile errors that don't show up in MoMa. It has something to do with the program using system.

Here's our code if anyone with linux experience gets a chance to try it in mono.

Duki 552 Nearly a Posting Virtuoso

We're trying to get our C# program to work on linux. We just loaded into Mono, and it compiles fine but the form doesn't appear. Anyone know what? Does it have something to do with it being a "windows form"?

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

can someone tell me how to include other .cs files in my program? sort of like the .h files in C++ I guess. I want to be able to call functions from other .cs files.

Thanks

Duki 552 Nearly a Posting Virtuoso

Domain Registration is very cheap... usually only about $10 per year.

http://www.networksolutions.com/

Duki 552 Nearly a Posting Virtuoso

Diet Dr. Pepper.

Duki 552 Nearly a Posting Virtuoso

On you registrars website, did you point the servers to your static IP? If you call them, they should be able to help you with this.

Duki 552 Nearly a Posting Virtuoso

Diet Dr. Pepper.

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I need a decompiler for a VB6 application. The software was written in 2002 by a former IT admin, and he didn't leave the source code.

I've been able to use programs like VBdecompiler-Lite, but it looks like the only thing I can get is the native code?

I would be willing to pay for the code to be decompiled if there was software that could do it.

Duki 552 Nearly a Posting Virtuoso

thanks for the site. lithium-ion may be a little to pricey for us. we just wanted to make sure.

the battery we would require is around $1200.
thanks for the help.

Duki 552 Nearly a Posting Virtuoso

I need something with at least 60Ah. Also, it has to be able to sustain a robot for well over 3 hours.

Duki 552 Nearly a Posting Virtuoso

Diet PEPSI.

Duki 552 Nearly a Posting Virtuoso

What if one of the laptops was on your desk, and the other laptop was on your robot?

Something your "dual core" processor could never do.

That would be nice, but both computers have to be directly mounted to the robot. That does bring up a good point though; one that was discussed yesterday. Another pro to having dual computers would be a fail-over system.

Duki 552 Nearly a Posting Virtuoso

Which is better?

We're designing a new autonomous robot for the competition we attend during the summer and this is one of our topics for design. I want to do a dual-processor, multi-core computer to run the software. Some others want to do distributed computing (between two laptops). Am I wrong in thinking the performance of multi-threading far outweighs that of distributed computing?