C++ :: How To Convert Compact Form Of Matrix Into Matrix Form

Oct 4, 2014

3 3
2 1 3 2 3
1 0 2
1 2 6

First line shows row and column number

First index of the second line tells the number of non-zero entries of the first row and second index tell the column number where the non zero entry is placed

for 1st row of matrix:

non-zero entries=2
column number=1
non-zero entry=3
column number=2
non-zero entry=2

covert this in the given form
0 3 3
2 0 0
0 0 6

View 1 Replies


ADVERTISEMENT

C :: Store Data In Binary File Then Use It To Find Inverse Of Matrix Form Of Data

Dec 6, 2013

I need to find inverse of a matrix data in binary file should be used to form matrix.its not finding inverse correctly rest is working good.

Code:
#include <stdio.h>
void createbin();
void display();
void inverse();
int main()
{
createbin();
display();
inverse();

[Code] ....

View 4 Replies View Related

C Sharp :: Create Instance Of Form Into Non Form Class To Access Button / Label

Nov 23, 2014

I have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?

View 4 Replies View Related

C# :: How To Access User Control Form One Of The Child Form

Apr 22, 2014

I hav created mdi parent form that contain one user control. I want to access that user control from one of the child form

View 4 Replies View Related

C# :: Login Then Close Form And Open Main Form

Aug 25, 2014

This is more of a Application Design question, Let's say I have Form1(Login), this is opened from Program.cs, when the user enters details, the Event Handler makes a instance of a class, adds the data and stores the instance within Program.cs class.

So the best thing to do here, is to close the Form1(Login) and open Form2(Main) via Program.cs so that I can send the List<Login> object with my Login instance objects to said form. This form will remain open throughout the applications use as it's like the main GUI for all the programs functions.

When I close this form, I may want to save some information before the application is terminated, so I may as well store the Login instances in Program.cs anyway.

Main stepping stone: Multiple (usually around 3 max) users can login this system if need be, which will mean closing Form2(Main) and then opening Form1(Login) so that once Form1 is closed it can recreate the From2(Main) form and pass the new List<Login> to that form.

What's the best way to do this, at the moment i'm creating the Form2 instance like so:

//....
//Detect the Login form being closed
loginForm.Closed += new EventHandler(OnLoginClosed);
//...
//Open the main form when the login is closed
private void OnLoginClosed(object sender, EventArgs e)

[Code] .....

This seems like it will work and do the job, but is there a better and cleaner way? The List<Login> will be passed to Forms which are created via Form2(Main) as this information will be needed. It's just that ive been told not to use Forms for too much data containment.

View 2 Replies View Related

C# :: Sharing Variables From Login Form To Another Form

Mar 10, 2015

I have a form with 2 text boxes (Email and Password)

The user fills in the text boxes and clicks on the Log in button. The code behind the log in button does the following, First connects to a table (Users) in phpmyadmin. Next runs a SQL query (SELECT * FROM `users` WHERE Email = '" + sEmail + "' AND Password = '" + sPassword + "'") sEmail being the variable created from the text entered in Email text box and the same for password.

Next if the record count == to 1 it opens up the main menu form and if the record count == 0 it fails and the user does not get to the main menu.

All of the above is fine and working however what I want to do is take over a variable from the log in form to the other forms.

The code is below for the sign in button as all my code is behind that (I think this may be where I'm going wrong).

public partial class WelcomeForm : Form{
public static string connStr = "server = localhost; " +
"database = ppw5; " +
"uid = James; " +
"pwd = buster;";

[Code] .....

And the Main menu form where I'd like to take a variable over with me, lets assume the variable is the UserID from the database table that I pull from the dTable I created.

public partial class MenuForm : Form {
//Call the CloseProgram class and create a new method called ClassClose.
CloseProgram ClassClose = new CloseProgram();
WelcomeForm User = new WelcomeForm();
public MenuForm() {
InitializeComponent();

[Code] .....

View 7 Replies View Related

C++ :: Using OOP To Implement Matrix Class That Provide Basic Matrix Operations

Mar 27, 2013

i want to know how i can solve this question? do i need to create a class or write the program codes.

View 12 Replies View Related

C++ :: Accept Matrix As Argument And Display Its Multiplication Matrix

Jun 1, 2014

I just want to know the code of the program: Write code to accept matrix as aurgument and display its multiplication matrix which return its multiplication matrix.

View 1 Replies View Related

C# :: Calling Method In One Form From Another Form?

Dec 6, 2014

I have a program which when a button is clicked on Form1 it runs a vision system operation on an image in a window on a Form1. There are also other buttons on the Form1 which can change things like threshold levels so the inspection can be run again with different settings. It all works fine but I want to change it to remove the buttons from Form1 so that when the user clicks on a button on Form1 it opens up another form, Form2, and all the buttons which were on Form1 are now on Form2 and the image analysis should run on Form1 when the buttons are used on Form2. I have taken over all the code from Form1 to Form2 and I'm trying to make this happen by creating a new oject on Form1 which calls a method on Form2 which contains the code which was in Form1 and called when the button was clicked on Form1 - not working!! I have a constructor in Form2 but I think I have become monumentally confused.

This was the code which was on Form1 when the inspection button was clicked.

private void cmdInspectOnce_Click(object sender, EventArgs e)
{
iReturn = VisionSystem.InvModeSet(IpeEngCtrlLib.I_MODE.I_EXE_MODE_ONCE);
if (_imgEngines!=null && _imgEngines[0]!=null)
_imgEngines[0].cmdInspectOnce();//InvModeSet(IpeEngCtrlLib.I_MODE.I_EXE_MODE_ONCE);
}

View 1 Replies View Related

C# :: Selection From 1 Form DatagridView On Second Form

Sep 5, 2014

I have 3 Windows Form: frmMain, frmFirstForm, and frmSecondForm.

frmMain is the form that will load when the application is started with 2 tabs to access frmFirstForm and frmSecondForm.

Here's my problem:

After making a selection from a combobox on frmFirstForm, I would like a datagridview header to change based on the selection made. Here is a list of items on one combobox: Item1, Item2, Item3, Item4. When somebody chooses Item one, the header on the datagridview on frmSecondForm should display: JohnItem1, PaulItem1, BradItem1 and so on. Those items are not part of the comboboxes, but they will be shown as header text on the datagridview on the second form either automatically or after clicking OK from frmMain. There's no OK button on frmFirstForm, but on frmMain.

The only code I have right now is the if statement on the form load on frmSecondForm. Here's what I have:

private void HeaderTextLoad() {
if(comboboxonfirstform.text = "Item1") {
datagridview1.Columns[0].HeaderText = "ItemJohn";
datagridview1.Columns[1].HeaderText = "ItemPaul";
... And so on.
}
}

View 1 Replies View Related

C/C++ :: Assign A Matrix To Submatrix Of A Bigger Matrix?

Feb 27, 2012

I want to assign a matrix to submatrix of a bigger matrix.

ublas::matrix<int> A(8,5);
ublas::matrix<int> B(2,5);
for(size_t i=0;i<A.size1();++i)
for(size_t j=0;j<A.size2();++j)
        A(i,j)=i*A.size2()+j+1;
for(size_t i=0;i<B.size1();++i)
    for(size_t j=0;j<B.size2();++j)
        B(i,j)=i*B.size2()+j+5;
ublas::matrix_range<ublas::matrix<int> > a(A,ublas::range(0,2),ublas::range(0,5));
a=B;  

and it works.

but if the matrix is compressed_matrix type, there's something with it. the error log as below:

Check failed in file boost_1_48_0/boost/numeric/ublas/detail/matrix_assign.hpp at line 1078:
detail::expression_type_check (m, cm)
terminate called after throwing an instance of 'boost::numeric::ublas::external_logic'
what(): external logic
Aborted

I'm not sure this is a bug or not.

View 2 Replies View Related

C++ :: How To Convert Large Valuge Form Single Integer To Array

Jun 3, 2013

i have mathematic operation and the result is near 70 digits....single variable cannot hold it....

View 4 Replies View Related

C++ :: Convert Input String Into A Form - Capital And Lower Case Letters

Mar 27, 2013

How can I write program that can convert an input string into a form that only the first letter of the string is a capital letter and the rest is lower-case?

View 3 Replies View Related

C++ :: Find Matrix P For A Square Matrix A

May 25, 2014

I have to prepare a project. But I don t know how can I do this. Program will find a matrix P for a square matrix A such that P^-1 A P ....

View 15 Replies View Related

C/C++ :: Gridview Won't Appear In Web Form

Jul 26, 2014

I have a gridview setup. It adds data into it no problem, but if I try and see it on the screen nothing appears?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Linq;
namespace FinalProject{
public partial class WebForm1 : System.Web.UI.Page

[Code] ....

View 11 Replies View Related

C++ :: How To Output One Particular Field In A Form

Aug 8, 2014

I need writing a program in c++ that will get the input of 50 different users for the following the fields (surname, other names, sex, status, date of birth) and after entering the data for these 50 users, it will then output only the list of all FEMALE users who were registered...

#include <iostream>
#include <string>
using namespace std;
int main () {
string surname, other_names1, other_names2, status, sex, dob;

[Code] ....

I don't really know what to do next - all my attempts have not really given me the result I want.

View 19 Replies View Related

C# :: Calling Event From Another Form

Mar 11, 2015

I want to update a label from Form2. When I click on the button on Form 2, the textbox on Form2 should update the label on Form1 and take me to a certain website. What ever URL is typed into the textbox on Form2 is what website URL the label on Form1 will take me to. The label on Form1 can say something such as You can check out my website here!!! and when they click on the saying it takes me to their website.

View 2 Replies View Related

C# :: Update A Label On Another Form?

Jun 29, 2014

I have a label on my main form. When I menu select my settings form, I make a change to the label text on the main form but the label text does not update with the new text.

So here is my code in my settings form:

MainForm frm = new MainForm();
frm.paintMainFormThemeTitle(logoText); // updates the main form label

I may not fully understand the new instantiate key word, but doesn't this create another, new copy of my main form to operate on? And isn't that why I can't see my label text change on my main form that is previously in view?

All of the examples that I have been able to find show using this new key word to be able to access a component on another form. But to my understanding, I'm creating another, new form.

View 5 Replies View Related

C# :: Keypad In Windows Form

Jan 7, 2015

How to make a keypad in my windows form? Need to finish my project at school...ATM machine app..

It is just the keypad part. Do i put 10 buttons and add a textbox...

View 2 Replies View Related

C# :: Setting Global Hot Key On Second Form?

Jun 23, 2014

I created a WinForm app in C# using VS 2013 Express.

I added code to create a Global Hot Key on the main form. This works fine. My hot key is Ctrl-T. I can press the hot key and make the main form show and hide.

Then I created a second form (ChecklistForm) and now I want to press ctrl-T and make that form show and hide. I do not need the main form to do this any more. I just used the main form to test my Global Hot Key code.

So I'm having trouble getting the second form to respond to the hot key. When I put a break on the WndProc(), there is no break.

namespace ChecklistFSX {
public partial class MainForm : Form {
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(String sClassName, String AppName);
private IntPtr thisWindow;
private GlobalHotKeys hotkey;
public MainForm()

[code]....

View 2 Replies View Related

C# :: How To Send A Command To Another Form

Oct 12, 2014

I've been trying to send a command to another form, but it didn't work. Here's what I've done:

Form1:
I have a listview.

Form2:
I have a textbox and button.

I want to write something on the textbox from Form2, click on the button and let it appear on the listview on Form 1.

Here's my code, but doesn't work />

Form1
public void UpdateListBox(string data) {
ListViewItem lvi = new ListViewItem(data);
listView1.Items.Add(lvi);
}

Form2
private void button1_Click(object sender, EventArgs e) {
Form1 frm1 = new Form1();
frm1.UpdateListBox(textBox1.Text);
}

View 14 Replies View Related

C# :: Cannot Reference Another Form In MainFrom

Jun 24, 2014

In my mainForm I instantiate my second form using 'clfrm'. How do I declare clfrm so that I can use it in my other methods?

private void ChecklistOpacity_ValueChanged(object sender, EventArgs e)
{
clfrm.Opacity = 0.20; // <---- error: The name 'clfrm' does not exist in the current context.
}
private void MainForm_Load(object sender, EventArgs e)
{
ChecklistForm clfrm = new ChecklistForm(); // <---- 'clfrm' is created here
clfrm.Show();
}

View 13 Replies View Related

Visual C++ :: Working With More Than One Form?

Sep 27, 2012

I'm currently trying to work with more than one form, but I didn't succeed yet. What I need is quite simple: Once the program runs, a small form appears first asking "what would you like to do" with corresponding buttons for each option. Each button loads a new different form for a different task. So basically I need to open and close forms, also having two forms loaded at the same time (pop-up style) would be great for certain purposes.

I still haven't figured how to do it properly. I'm currently using VC++ 2008 and my project is a Windows Forms Application.

View 5 Replies View Related

C++ :: To Form Counter Of N Element

Jun 3, 2012

How can i form a counter of say 30 elements so that to meet following requirement,

I need to access 5 elements out of 30 elements and out of these 5 elements once the one value is printed (i.e now access for remaining 4 element will be left) other one should get added immediately to this 5 element set, from remaining total 25 elements. In this way 5 element count will be there always.

I am trying this as follows, by forming vector of 30 elements accessing its 5 elements as :

for (iter = vector1.begin(); it < vector1.end();it++) {
for(int count = 5; count >= 1 ; count--) {
cout << "Print value<" <<count<<"> : "<< *it <<endl;
it++;
}
}

This displays 5 elements at a time but counter "count" waits for to finish off its remaining 4 elements however i want to maintain this counter to 5 elements always.

View 1 Replies View Related

Visual C++ :: How To Pass Value From One Form To Another

Mar 12, 2013

i am trying to create a form app with multiple forms. there is a form i'm using as "search". i want to take the value of the textbox in search-form and pass it to another form which shows the result of the search. i've tried to include search-form.h in the form of the result but it returns an error.

Code:

String ^ key;
key = searchbox->Text;
std::string ks = marshal_as<std::string>(key);
ks=ks+".bin";
ifstream sfile(ks);
if (sfile) {
PatInfo ^ form = gcnew PatInfo;
form->ShowDialog();
} else {
MessageBox::Show( "Please try again.");
}

to conclude, i want the form PatInfo to open an receive the "ks" var.

View 4 Replies View Related

C :: Implementation Of Graphs In The Form Of Program

Feb 13, 2013

How a graph can be implemented in the form of a c program?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved