C++ :: Layout Design Matrix Calculator

Aug 26, 2013

I want to ask on how to put a layout design in the program when it is being ran. It should look like these: [URL] ....

This is a sample code:

#include<iostream>
using namespace std;
main() {
int m, n, c, d, first[10][10], second[10][10], sum[10][10],
minus[10][10], times[10][10];
char ans;

[Code] ....

View 2 Replies


ADVERTISEMENT

C# :: Cannot Place Controls On Layout

Feb 1, 2015

When I drag a control onto the Xamarin studio layout the control just slides back into the toolbox again. The only way to add controls is to edit the .axml file which is not at all ideal.

I have tried re-installing all the components again multiple times and even tried out using a different computer, still no luck. How to use the mono framework on the Visual studio IDE and build the apk using Xamarin studios?

Details -

Xamarin studio 5.7
Tested on Windows 8, 8.1 and 7

View 10 Replies View Related

C++ :: How To Open A Java Layout From Archive

Mar 14, 2014

I want to open a .xml layout in my Android project from a .cpp archive.

How can I do it?

View 2 Replies View Related

C/C++ :: Single Facility Layout (multiple FOR Loops)

Mar 15, 2015

I've been given an assignment called a Single Facility Layout Problem in which a number of machines (for the purpose of the assignment they're called machines) with an x-coordinate, y-coordinate and weighting are given/inputted. I'm using 5 machines for ease of use and reading errors.

The object of the program is to calculate the value of each set of coordinates using the Me formula, the lower the value, the better. Thus the program should output a 5 different values.

Problem: My problem is that instead of getting, say 5 unique values, I'm getting 5 of the same value much like the photo attached.

- How can I remedy this?
- Is there a limit to the amount of FOR loops that can be nested? If not why isn't my code working correctly?
- Where should I place the printf statement in order that I will output 5 unique values?

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main() {
//'h' is number of machines, objects etc.
int h=5;

[Code] .....

View 3 Replies View Related

C# :: Erase Inner Border Between 2 Columns Of Table Layout?

Oct 7, 2014

So in my winform form, I have a table layout panel and I attach Controls on the row. I make some control span multiple columns... But since I use transparent for the background of the layout panel, it show the border between 2 cells that I span.. Like this:

How do I erase the border in the middle of IDLabel?

View 14 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/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++ :: 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++ :: Design A Program For A Machine?

Jul 10, 2014

My need is that i need to design a program for a machine. The machine takes "x"qty of load, refines 30% of it and sends back the 70% to the initial position. after how many times, does the qty of the load refined will be equal to the initial load and how many times does it need tot be refined?

View 1 Replies View Related

C++ :: How To Write Algorithm / Design

Nov 16, 2013

How to write Algorithm / Design

View 7 Replies View Related

C# :: Inheritance In WinForm Design

Feb 23, 2014

I have two Form Employee and Instructor, here Employee is super class of instructor.

public class Instructor: Employee
{
//Instructor class
}

I am able to access all property of Employee inside instructor class but with these some textbox and button design inside Employee design is also getting inherited inside Instructor design and i don want this and i want to maintain the parent-child relationship between Employee and Instructor.

View 11 Replies View Related

C++ :: How To Design Optimal Style Class

Jun 8, 2014

I want to write a command line parsing library that is very flexible in terms of parsing style but I'm not able to design a mechanism that satisfies this requirements.

Generally i want to have a class that contains all the necessary information about how the command line has to be parsed.

Code:
// draft
class style {
public:
enum class type { // the basic style type

[Code] ....

Need completing the draft shown above, because for every basic style type there is an own set of extensions that applies only to this one specific style type.

Code:
// how a style object should be created
style parsing_style(style::type::posix, style::extension::gnu|style::extension::subcommand);

How to design the class. (using c++11 features like std::enable_if is fine)

View 10 Replies View Related

C++ :: Design Class That Can Be Used That Can Represent A Parabola

Apr 24, 2013

The program is supposed to design a class that can be used that can represent a parabola.

Code:

#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
#include <cstdlib>
#include <cstring>

using namespace std;
class Parabola {
public:
Parabola( double, double, double );

[Code] .....

View 3 Replies View Related

C++ :: Yahoo Finance API Design Code

Apr 22, 2014

I get a bunch of broken links and nearly nothing when I search for how to hook up Yahoo Finance with C++ api.

Is there code for Yahoo Api or a search feature?

I need to look up stock tickers, volume, and closing price.

View 17 Replies View Related

C++ :: Selecting Design Pattern For Validation

Jan 21, 2015

I am looking into some design pattern which works for validation.

I thought about using strategy but not sure whether its correct or not

View 3 Replies View Related

C++ :: Design Pattern For Function Operation

Dec 11, 2014

Any design pattern allows to describe operation like the following.

MyFunctionObject f;
//Init f...
MyFunctionObject g;
//Init g...
MyFunctionObject h = f(g) + g;

[Code] .....

I'm interested in design pattern which permits to model this kind of structure, if there's of course...

View 7 Replies View Related

C++ :: Integrating XML Read / Write Design

Jan 6, 2014

I have two designs for reading/writing my classes to XML. Which do you think is better:

This is my structure (Attributes are single class members, Elements are std::vector< T > members

Structure:
+ Calibrator
+ Attrib: readLabel (string)
+ Attrib: saveLabel (string)
+ Element: Device
+ Attrib: sourceLabel (string)
+ Attrib: destLabel (string)
+ Element: CalPoint
+ Attrib: sourceVal (double)
+ Attrib: destVal (double)

1. Design 1: Have an independent class to handle everything and "friend" it with the users.
Pro: Only 1 interface needed and we can switch interface easily.
Con: There is a lot of inter-class data which destroys encapsulation

class CalibratorXML;
class Device{
string sourceLabel;
string destLabel;
vector<CalPoint> calPoints;
friend class CalibratorXML;

[Code] .....

View 1 Replies View Related

C++ :: How To Design A Smart Pointer Class

Nov 11, 2014

smart pointer class is the one that take in charge of release allocated resource when itself destroyed.

recently,i want design a smart pointer class, it take in charge of release resource allocated by new or new[].

my problem how to design destructor, you should determine the pointer ptr is pointer an array or a single object.

the structure of this smart point class may be:

template<class T>;
class smart_pointer{
public:
smart_pointer(T* p):ptr(p){};
~smart_pointer(){

[Code] ......

View 6 Replies View Related

C# :: Running A Class At Design Time

Aug 7, 2014

I have a Class called 'DataManager' which contains a list of my 'DataItem' objects (this are created by an XML file).

I have also created some custom controls which, among other things, has a property to link it to a "DataItem" object.

My question is, is it possible to create an instance of my DataManager class at design time (which runs all the code as it would at run time to create all the DataItems from the XML)?

I want to do this so that I can update my DataItem property in my custom controls to use a UITypeEditor which then allows me to link to a DataItem at design time.

View 4 Replies View Related

C++ :: Design ID To Store Vectors For CAD Program?

Mar 3, 2012

Let's say we have entities like lines and circles. And each entity can have a pen attached. And a pen is a color and line width. All entities needs to be manipulated through a operations interface. All entities added to the program needs to be added through using a factory pattern.

So we end up something like (pseudo code)

class Line // for immutable objects {
..
..
} class MutableLine extends Line //for mutable lines {
} MutableLine line=factory->newLine(20,20,50,50); // Create a new line entity

[code]....

So, essentially I want no code to be able to operate directory on entities, unless during creation of the object (color, layer, line width etc...) so I am planning to create Mutable versions of all entities besides the immutable versions.

When requested for selected entities or all entities, I am planning to return a list of immutable objects and in fact I am planning to return a new copy so it's not possible to operate on anything directly.

The reason is that I am planning to create different storage backends swell, so I can operate on entities in a database, or shared memory... stuff like that. At least to hide the internals and provide a stable API.

My questions are:

How can I make sure that people don't do 'tricks' casts for example to a mutable version to change objects directly?

View 2 Replies View Related

C :: API Design - Handling Platform Specific Errors

Mar 6, 2015

Consider the situation where you're writing a cross-platform library that has functions for creating and manipulating windows. To create a window suitable for OpenGL rendering on Windows you need to call a bunch of different functions such as GetModuleHandle, RegisterClass, CreateWindow, SetPixelFormat, GetDC, wglCreateContextGetDC and so on. All of these functions can potentially fail in one way or another and the Windows documentation doesn't even attempt to list all the different error codes that these functions return.

Let's say your function for creating a window is called create_window(). What kind of error message should you return if any of these platform specific functions fail? It could be something as simple as MultiByteToWideChar failing for some reason when you convert the UTF-8 string your API uses internally to the UTF-16 string that the Windows API expects. I've read that you're not supposed to leak implementation details from your API but what are you suppose to return when an encoding conversion fails that is supposed to be completely transparent to the user of your library?

I've decided to simply return an error code indicating a platform specific error in those cases because there's no way I can anticipate all the different errors that the Windows API might return. The problem with that is that almost all the errors end up being platform errors and without a way to actually tell what the error is then you're basically saying that some unknown error happened. That's not very useful. You could have a function called get_platform_error() that you call to obtain the exact platform error that occurred, but I'm not a fan of such a design and I've had enough trouble with GetLastError() style error handling as it is.

An alternative to that is to create a struct that represents errors and have a field in it where you can store platform specific errors. I believe this is what Apple do with their NSError error object but I'm not sure how I feel about that approach.

Assuming you implement a way to return the platform specific error code then the next part is obtaining a string that describes the error. Your library can obviously not implement error strings for every single error code that Windows might return so you're forced to use FormatMessage. The problem with that function is that you can't force it to return error messages in a specific language and it's not even guaranteed that you can get an English translation of the error string. I don't want to display error messages that mixes English with the current language the operating system uses so how do I solve this problem?

Are there any good open source libraries I could study? The ones I've looked at so far have subpar error handling at best. Many of them don't even check the return values from platform specific functions.

View 8 Replies View Related

C# :: Program Design - Database Search Engine

Apr 12, 2014

I am building a semi-complicated program and the focus of it will be on the search engine. The current plan is for it to search an online database after keywords and receive a list of responses organized by relevance.

I want to minimize the stress on the server by handling as much of the process on the client side as possible so I wonder how best to split up the tasks.

So far my idea is to have the client send the search term to the server who then compare it with its registry. Collecting the 30 or so most relevant hits it sends it back along with additional information from each entry. Requesting additional hits will be decided by sending a simple int value telling which page its filling up.

Simple example:

"Search word" gets processed by the client to account for spelling errors, context etc (based on what I can implement by myself). An Int value gets added (0 for page 1, 1 for page 2 etc...). The request gets sent to the server who can immediately run the search without processing the search word since that was handled in the client. It locates hits and order them by relevance then send out the information batch decided by the Int.

View 2 Replies View Related

C++ :: Design Pattern For Dynamic Function Parameter

Oct 26, 2014

I need to design an interface(a function prototype) that takes an argument which is used to pass information.
The information can be passed by independent modules and third party softwares and hence can vary today and in future.

Basically, the function interface(arg1, info)caters a niche service to many independent applications and needs to process based on requirements passed by applications in the argument(info, in example).

I am looking for a design pattern for the function parameter - info.

Should I use a void pointer that can be casted to respective application specific class in the function ? will this be a good C++ design ?

or should I take this parameter to be a pointer to a generic abstract class that points to the respective application specific specialization ?

Do we have some design pattern to address this so as to handle other unforeseen challenges ?

View 1 Replies View Related

C++ :: Design Own Container With Properties Of Both Vector And List

Dec 14, 2014

How can I write my own container which has properties of both vector and list.

E.g. I can access elements directly using [] operator like vector and behave like list in terms of memory (means we don't have to shift elements if we want to insert in between like list)....

View 1 Replies View Related

C++ :: Virtual Topology Design In Optical Networks

Feb 2, 2013

Code for virtual topology design in optical networks...i have tried but it is not working

View 2 Replies View Related







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