1,857 Posted Topics

Member Avatar for hiteshkumar_P

This is close to impossible since that code won't compile as is and it references objects that are created elsewhere.

Member Avatar for hiteshkumar_P
0
499
Member Avatar for zakn
Re: zip

[Article](http://www.codeproject.com/Articles/28107/Zip-Files-Easy) about zip files. [Article](http://en.wikipedia.org/wiki/Resource_Description_Framework) about RDF specifications

Member Avatar for tinstaafl
0
72
Member Avatar for no123

Replacing the file stream with a memory stream should do the job: MemoryStream stream = new MemoryStream(); BinaryFormatter seri = new BinaryFormatter(); foreach (Object p1 in list) { if (!isContained(p1, toRemove)) { seri.Serialize(stream, p1); } }

Member Avatar for JerrimePatient
0
465
Member Avatar for kubura musah

A few things: - Instead of doing this - `int i=0,j=0;`, `int result,answer,x,y;`. It's much more intuitive to use descriptive names. It also helps readability to declare variables on separate lines: int result = 0; int answer = 0; int mult1 = 0; int mult2 = 0; int score = …

Member Avatar for kubura musah
0
430
Member Avatar for phony

Just an FYI, a [bitset](http://www.cplusplus.com/reference/bitset/bitset/) is specifically designed to handle this sort of thing. int main() { int num; cout<<"decimal\n\n"; cout<<"to binary\n\n"; cout<<"Enter a nonnegative integer:"; cin >> num; //provide the number of bits to use bitset<16> binNum(num); cout << binNum <<"\n"; system("pause"); return 0; }

Member Avatar for tinstaafl
0
959
Member Avatar for tgreiner

The problem appears to be that you aren't telling `filename` whether to open the file for extraction or insertion. You need to combine fstream::out with fstream:app with the bitwise OR operator: filename.open(logfilename.c_str(), fstream::out | fstream::app);

Member Avatar for tinstaafl
0
9K
Member Avatar for MrXortex

If temporary variables are also not wanted and you're only going to use integral types, you can use the additive swap method: int a = 3; int b = 5; a = a + b;//a=8,b=5 b = a - b;//a=8,b=3 a = a - b;//a=5,b=3

Member Avatar for tinstaafl
0
467
Member Avatar for Suzie999

Probably one of the simplest ways is to design the class the way you want it, then put it into a new project. Now export that project as a template(File-Export Template). Any time you want to make a project that uses that class, that template should show up in the …

Member Avatar for DaveAmour
0
235
Member Avatar for karodhill

The last error message won't display the same time as the second one, because, the second relies on radbusiness.checked being false and the third relies on it being true.

Member Avatar for karodhill
0
280
Member Avatar for Mica_1

Does the input have to be a string? If you make it an integer then you just need to check that the value(v) 999 < v < 10000

Member Avatar for rubberman
0
106
Member Avatar for HōñËy
Re: C++

Your not checking for when the file is at the end properly. Something like this should work: case 2: int b=1; //When the stream can't read any more data it returns false while(xyz>>std.id>>std.name>>std.marks) { cout<<"record no is: "<<b<<endl; cout<<"id is: "<<std.id<<endl; cout<<"name is: "<<std.name<<endl; cout<<"marks are: "<<std.marks; b++; } break;

Member Avatar for David W
0
283
Member Avatar for VengefulToast

Are you using begin() or cbegin()? begin() should be a bidirectional iterator. Basically assign it to an iterator instead of a const_iterator and you can change its value.

Member Avatar for David W
0
183
Member Avatar for overwraith

There seems to be a bug. It doesn't return the segment after the last token(e.g. "9/7/2011", returns "9" and "7" only)

Member Avatar for sepp2k
2
239
Member Avatar for buzzstpoint

Your code begs the questions: Why convert text to string when it's already text? What does the `unformat` function do? Also if the `unformat` function is necessary why isn't it returning a string?

Member Avatar for buzzstpoint
0
281
Member Avatar for dipankarnalui

One option you have is to use the TotalDays, TotalHours, TotalMinutes, TotalSeconds, or TotalMilliseconds, depending on which scale you're mainly interested in. Each of these methods returns a Double. There are equivalent From methods that will convert back to a TimeSpan object. Another option is to use the `Ticks` property …

Member Avatar for tinstaafl
0
677
Member Avatar for loldafuq

2 immediate problems I see with your `file_input` function, is the closing brace is missing and you're trying to access a variable that doesn't exist, `s1`. Aside from that and assuming the data for each stack is on separate lines in one file and that you intend for the stack …

Member Avatar for loldafuq
0
433
Member Avatar for mimi_1

You're missing the opening brace for the `watch` class. This will highlight other errors: Line 41: you have the wrong extraction operator it should be `>>`. Lines 50 & 61: You put a 1 instead of an l at the end of `endl`. Line 70: the label ED doesn't exist. …

Member Avatar for mimi_1
0
456
Member Avatar for Aaron_JY

At first glance it looks like you're missing a loop. As it is the code only runs through once. Here's a simple way to use a loop: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication2 { class TestClass1 { static void Main() { bool Continue = true; string …

Member Avatar for muhammads744
0
743
Member Avatar for LukeJWhitworth

The example on this [page](https://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.print%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1) shows how to print multiple pages.

Member Avatar for Santanu.Das
0
810
Member Avatar for DS9596

A few other things to think about: Try to avoid using global variables. On a big project it's easy to lose track of which functions are modifying the variable. A struct is probably redundant for this, since the index of an array is the number and the value can be …

Member Avatar for tinstaafl
0
163
Member Avatar for Kenneth_3

I'm thinking that part of your problem might be compiler specific. I can't get the same output from your code. However, there are some issues that I noticed. Reading the first line from each file shouldn't work right with the extraction operator(`>>`), since that will use the space as a …

Member Avatar for Kenneth_3
0
379
Member Avatar for tinstaafl

This is a very simple login form. I set it up so that the form won't close until it's cancelled or a valid username and password are entered. I chained the check for the username and the check for the password, so that if the username doesn't pass the password …

Member Avatar for tinstaafl
0
7K
Member Avatar for daniel1977

Your main problems appear to be in `func_count`. you didn't declare the return type, which in this case should be `void`, since that is how your prototype has it declared. Also,the 2 variables you have in that function are `count2` and `count5`, however your `printf` statement is trying to print …

Member Avatar for tinstaafl
0
240
Member Avatar for AQ

In addendum to that, don't be afraid to search the post archives. You'll find that most of your problems aren't unique and someone else has already asked and received and answer for it.

Member Avatar for tinstaafl
0
129
Member Avatar for Papa_Don
Member Avatar for Nandomo

I would suggest some refactoring. A class(`Board`) can help keep the calculations separate from the event handler code, simplifying it tremendously: Public Class Board Public type = "" Public hrRate = 0 Public dayRate = 0 Public hoursRented As Integer = 0 Public daysRented As Integer = 0 'This is …

Member Avatar for Reverend Jim
0
172
Member Avatar for Jazmine_1

I suspect the main problem is on line 8. However without the listing of the `unorderedArrayListType` class it's hard to say for sure.

Member Avatar for tinstaafl
0
201
Member Avatar for Joemeister

If you must use one form you can make the Admin controls unique, maybe have them in a panel. Now it's a simple matter of making the panel disabled and invisible to disable the the admin controls.

Member Avatar for Joemeister
0
180
Member Avatar for PulsarScript

You didn't follow your own example, in the default case, and add the subsequent methods to operation. Also in the default case you re-initilize operation without running it: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; delegate int OperationDelegate(int a); namespace DelegationLAB { public delegate void OperationDelegate(int a); …

Member Avatar for tinstaafl
0
152
Member Avatar for lithium112

For this LINQ probably isn't the bext choice. Since you aren't really creating a collection just modifying one, a simple `foreach` loop would probably work better. Also you would probably find it easier to work with `System.Xml.Linq.XDocument`: void SetButton1Attribute(string fileName) { XDocument xdoc = XDocument.Load(fileName); XElement rootElement = xdoc.Element("Table").Element("GroupPermissions"); foreach …

Member Avatar for lithium112
0
449
Member Avatar for phony

In C++ you either have to put the functions before Main or use prototypes at the beginning of the file. If this is new to you, you should probably review your instruction materials, as this is fairly basic to C++ programming.

Member Avatar for NathanOliver
0
488
Member Avatar for Riteman

One workaround that doesn't require registry hacks is to embed the browser itself in a container control, like tab control.

Member Avatar for iamthwee
0
989
Member Avatar for Extorza

Your code appears to work as is. You'll have to describe more fully what the specific problem is

Member Avatar for tinstaafl
0
159
Member Avatar for mdev

I would suggest that `XmlSerializer` would be the way to go here. First make sure that all the properties you want to save are public and that you have the get/set added. Next to make sure that the columns display the headers that you want for each property, add the …

Member Avatar for mdev
0
170
Member Avatar for DS9596

Another minor point, you tell the user you're using integers but you're using doubles. A side note,multiplying the second term by -1 will change the operation from addition to subtraction. This is helpful in that you can now use 1 function to do either operation.

Member Avatar for tinstaafl
0
160
Member Avatar for aundriaah

You're putting semi-colons(;) where they don't belong. They are needed in the function prototype but not in the function declaration. `if` statements don't take semi-colons either.

Member Avatar for rubberman
0
302
Member Avatar for PulsarScript

In the foreach, you're trying to use the FileStream,`footballFile`, as a collection. I think you meant to use `leagueInfo`. On a side note arraylist is not the best choice for this as it stores each object as an object not the type you want. I would suggest a `List<FootballTeam>` instead.

Member Avatar for tinstaafl
0
158
Member Avatar for PulsarScript

The FileStream hasn't closed the file yet. Therefore the length hasn't been determined. Try wrapping the Filestream block in a `using` block. This will automaitcally close the stream and the length can then be determined: using (FileStream fs = new FileStream("random.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { // has to be declared in …

Member Avatar for tinstaafl
0
159
Member Avatar for jamesrobb

When you start the external app on the desktop, are you using a shortcut? If so, is the shortcut passing a parameter to the app telling it to check for updates?

Member Avatar for jamesrobb
0
128
Member Avatar for ts1989

Assuming the text is in a standard format the [DateTime structure](https://msdn.microsoft.com/en-us/library/system.datetime%28v=vs.110%29.aspx) has a TryParse method to convert text. The DateTime structure allows you to extract any or all parts of the date and/or the time.

Member Avatar for pritaeas
0
250
Member Avatar for PulsarScript

the [BinaryReader Class](https://msdn.microsoft.com/en-us/library/vstudio/system.io.binaryreader%28v=vs.100%29.aspx) and the [BinaryWriter Class](https://msdn.microsoft.com/en-us/library/System.IO.BinaryWriter%28v=vs.71%29.aspx) help pages both have examples and/or link to pages with examples.

Member Avatar for tinstaafl
0
116
Member Avatar for PulsarScript

The Arraylist is empty, because you start with a new one each time you get input from the user. Declare it just before the start of the while loop.

Member Avatar for ddanbe
0
169
Member Avatar for tucker046
Member Avatar for coder91

probably an even more simple solution would be to replace the column headers in the second table with the values from the first. Something like this should work: var columnArray = dataset.Tables["headers"].Rows[0].ItemArray[0].ToString().Split(','); for(int i = 0; i < columnArray.Length; i++) { dataset.Tables[1].Columns[i].ColumnName = columnArray[i]; } This assumes that the number …

Member Avatar for tinstaafl
0
164
Member Avatar for 12345reasbaby

The simplest is to create a .csv file which excel is capable of reading. This way you avoid any extra API's or librairies

Member Avatar for Reverend Jim
0
51
Member Avatar for andrew mendonca

Your problem is that `div` is re-initialized each time the function runs, leading to a stack overflow error. Making `div` an optional parameter with a default value of 2 and passing the new value at each recursion, is one way around this: void printFactors(int n, int div = 2) { …

Member Avatar for tinstaafl
0
219
Member Avatar for eliamck

Visual Studio 2010 doesn't fully support C++ like the other languages. I'd suggest online tutorials to learn C++

Member Avatar for ddanbe
0
67
Member Avatar for lithium112

First you'll need a custom comparer, something like this: public class CustomComparer : IComparer<char> { public int Compare(char x, char y) { //If the leading characters are both letters or both digits //then sort normally if ((char.IsLetter(x) && char.IsLetter(y)) || (char.IsDigit(x) && char.IsDigit(y))) { return x.CompareTo(y); } //If they aren't …

Member Avatar for tinstaafl
0
196
Member Avatar for afra afzal

The error tells you exactly what is wrong. You don't tell the compiler what the code inside the braces means. You need `return type Name(arguments)`.

Member Avatar for tinstaafl
0
260
Member Avatar for DS9596

If the comments you added are supposed to be the answers you want, then no they are not all right. Line 11 gives the right answer the rest give different answers

Member Avatar for YarMak
0
250

The End.