889 Posted Topics

Member Avatar for JohnPool

So you want the GetEnumerator class to return the enumerator for your internal Stack object, varStack ? I would do this: [code] public IEnumerator<Move> GetEnumerator() { if (varStack == null) return null; else return varStack.GetEnumerator(); } [/code]

Member Avatar for darkagn
0
260
Member Avatar for lxXTaCoXxl

Check out these two links: [URL="http://msdn.microsoft.com/en-us/library/aa288471%28v=vs.71%29.aspx"]Structs Tutorial[/URL] [URL="http://msdn.microsoft.com/en-us/library/ms173109%28v=vs.80%29.aspx"]Objects, Classes and Structs[/URL] Think of a struct as a record of data. Basically a struct is similar to a class in that it groups together a bunch of data and methods that can be used by an instance. The two main differences …

Member Avatar for gusano79
0
132
Member Avatar for noamwegner

A non-unique index allows duplicates to be inserted where a duplicate is defined as having the exact same values across each of the columns in the index. A unique index will raise an error and rollback an insert or update transaction when this check is failed. If the CREATE INDEX …

Member Avatar for darkagn
0
105
Member Avatar for OmniX

In most MySQL engines the auto_increment function assigns unique IDs to new rows inserted into a table. If one is deleted, the ID has still been used, so the next one to be used is still 14 in your example because 13 and 12 have been used (although they have …

Member Avatar for iffy85
0
760
Member Avatar for lxXTaCoXxl

Check out the [URL="http://msdn.microsoft.com/en-us/library/system.io.filestream%28v=VS.100%29.aspx"]FileStream[/URL] class. It has ReadBytes and WriteBytes methods that can be used to read and write bytes to a file. The code sample on this page is a bit simple, but Google the FileStream class and you will find plenty of examples.

Member Avatar for kamilacbe
0
87
Member Avatar for navi18

Use a [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker%28v=VS.100%29.aspx"]DateTimePicker[/URL] with the Format set to Time.

Member Avatar for lxXTaCoXxl
0
5K
Member Avatar for nice_candy

This is definately possible in WCF. The beauty of WCF is that the endpoint in the server can rely on TCP, HTTP or some other communication protocol and in order to change protocols you only have to manipulate the config file rather than the code itself. But this doesn't mean …

Member Avatar for darkagn
0
202
Member Avatar for jain1.anuj

Most likely the manufacturer of the device will have some sort of API that allows you to talk to the device. Try their website or contact them directly for details.

Member Avatar for jain1.anuj
0
171
Member Avatar for ryanwebber

Check out the IComparable and IComparable<T> interfaces which can be used in conjunction with IComparer and IComparer<T> interfaces to implement a sorting class. [URL="http://support.microsoft.com/kb/320727"]Example[/URL].

Member Avatar for darkagn
0
184
Member Avatar for ryanwebber

Read the text file records into an array or some other list data structure. Let's call it myList for this example. Create a reference to the current record. Let's call it currentRecord for this example. Create a reference (int) to the current record's index in the list. Let's call it …

Member Avatar for darkagn
0
108
Member Avatar for padmaja527

Without knowing the details of your error, I would say that your connection string (conn) is incomplete. [URL="http://www.connectionstrings.com/"]Here[/URL] is a great reference site for constructing connection strings, but I would say that you may need to provide a Password or Integrated Security setting?

Member Avatar for prit005
0
121
Member Avatar for geoamins2

[URL="http://www.sqlservercentral.com/Forums/Topic482559-146-1.aspx"]Here[/URL] is a solution for you (on another forum), it appears that this error code has to do with windows permissions.

Member Avatar for geoamins2
0
192
Member Avatar for erum

I think that error code of 3241 indicates a backwards compatability issue. Are you sure the backup was created with the same or earlier version of SQL server than the one you are attempting to restore onto? Note that service packs can be applied to one instance and not the …

Member Avatar for darkagn
0
127
Member Avatar for jitendra_tcil

This error usually means that the database was created in a later version of SQL server than the one you are running. If you are running straight 2008, upgrade to 2008 R2 or 2010 and see if that solves your problem.

Member Avatar for darkagn
0
47
Member Avatar for peace_dove

The text box has a string property called Text which is the entered text in the text box. For example, if you name your text box myText, you can do the following in your mouse click event: [code] private void MouseClick(object sender, EventArgs e) { string text = myText.Text; if …

Member Avatar for darkagn
0
122
Member Avatar for Morten Brendefu

You can use a try-except block like so: [code] try begin Example(6); Example(8); Example(10); Example(15); Example(7); Example(1); end except on E: Exception do raise Exception.Create(E.Message); // raised as a new exception so will include the line calling Example(15) as the error line end; [/code]

Member Avatar for Morten Brendefu
0
588
Member Avatar for pseudorandom21

Each Control has a Parent attribute, so you could use something like the following Linq statement to get just the "top-most" controls. [code] var controls = this.Controls.Where(o => o.Parent.Equals(this)); [/code]

Member Avatar for darkagn
0
142
Member Avatar for GrimJack

Glad to hear you are enjoying Australia, almostbob! Yes cyclones have been the bane of the banana here for the past few years. 5 years ago local bananas were like $1.20 for 1 kg, now they have dropped from over $11/kg to $6/kg here in South Australia in the past …

Member Avatar for almostbob
0
207
Member Avatar for The Dude

Reading #12: [Quote] Seek out your sacred space. Let the smoke rise And hear the prophecies of destiny. [/Quote] :)

Member Avatar for darkagn
0
119
Member Avatar for nav07

If you have 2 DateTime objects, you can subtract them to get a TimeSpan object. This TimeSpan object can be expressed in TotalMinutes. MSDN documentation links: [URL="http://msdn.microsoft.com/en-us/library/1905yhe2.aspx"]DateTime.Subtraction operator[/URL] [URL="http://msdn.microsoft.com/en-us/library/system.timespan.totalminutes.aspx"]TimeSpan.TotalMinutes[/URL]

Member Avatar for nav07
0
101
Member Avatar for Acidburn

When you deal with generics, instances of the class take the type parameter and then it deals with that type. When you call [icode]controllocator.findControl(new HtmlEdit())[/icode] I assume you are creating an instance of [icode]Controller<HtmlEdit>[/icode]. Since HtmlLongEdit class doesn't extend HtmlEdit, you can't use the same object to call findControl again …

Member Avatar for darkagn
0
122
Member Avatar for noobprogrammerr

Try pinging and/or telnet'ing from that other pc to yours and see if the pc can actually see you. If it can't, could be that a firewall or other network security measure is blocking it for some reason.

Member Avatar for thines01
0
134
Member Avatar for BCJLJ

Hi BCJLJ and welcome to DaniWeb :) So what have you got so far, and where are you having trouble? Unfortunately we can't help you without some showing of effort on your part. Have a try yourself, or at least try to write some sort of algorithm, and then re-post …

Member Avatar for BCJLJ
0
229
Member Avatar for smepperson

The first thing I notice looking at your code is that the "and-ed" if-statement should be before your "or-ed" if-statement, because and's will always be false if or's are. I'm not 100% sure, but I think the statements [icode]int index3 = new int();[/icode] should be replaced by simply [icode]int index3 …

Member Avatar for smepperson
0
1K
Member Avatar for Maxipak

The best text book I used in my Mathematics and CS degree was "Linear Algebra and its Applications" by David C Lay, Published by Addison-Wesley. We used it in three of the five mathematics courses I did (including Discrete Math), and can thoroughly recommend it. I hadn't studied anything for …

Member Avatar for Chrishas
1
268
Member Avatar for laailalalaa

You can create a two-way reference when you create the object B. Like so: [code] class A { private B b; public A() { b = new B(); b.SetA(this); } public void MethodA() { // do something } } class B { private A a; public B() { a = …

Member Avatar for darkagn
0
112
Member Avatar for AQWst

Hi there shinnxennosagga, Please check the date of threads before posting a reply to them - you have just resurrected a thread that hasn't been used for three years...

Member Avatar for stultuske
0
421
Member Avatar for rotten69

There is an error in your SQL query. I would suggest printing out your query string variable to see what is actually being inserted into your where clause with the values you are adding on the fly. As an aside, a much safer approach to SQL is to use a …

Member Avatar for arunkumars
0
205
Member Avatar for calebcook

Its much easier to use decimals, however you can use "fractions" by simple addition and division. For your example, 1 1/2 = 1+(1/2) although this can also be written 1+1/2 since division takes precedence.

Member Avatar for calebcook
0
317
Member Avatar for titosd

There are plenty of datetime functions in PHP that may be useful to you. [URL="http://au.php.net/manual/en/ref.datetime.php"]Here[/URL] is a list of many of them, date_add and date_parse could both be useful to you depending on how you want to do it.

Member Avatar for diafol
0
145
Member Avatar for jovillanuev

You can use the TOP N function to retrieve the most recent if you order by shipdate. Like so: [code] SELECT TOP 1 vp.esn, us.supplierid, us.shipdate FROM Table1 AS vp WITH (nolock) LEFT OUTER JOIN TABLE2 AS us WITH (nolock) ON vp.esn = us.esn COLLATE Chinese_Taiwan_Stroke_CI_AS WHERE vp.ReceivingPO IS NOT …

Member Avatar for jovillanuev
0
162
Member Avatar for y2kshane

For part A, they are wanting a function that uses the specific fields in your table, not passes them as parameters to the function. Your function will probably look something like this: [code] -- give the function a meaningful name, and return an appropriate data type CREATE FUNCTION GetItemTotalPrice() RETURN …

Member Avatar for y2kshane
0
214
Member Avatar for coroll

[CODE]for (int i = 0; i < textBox3.Text.Length;i++ ) { c = i+1 ; if (textBox3.Text.Substring(i,c)==" ") { string word = null; word = textBox3.Text.Substring(0, i); arrayKeyword[index]=word; index = index + 1; } }[/CODE] Your for-loop here iterates from the start of the string textBox3.Text to the end of the …

Member Avatar for gusano79
0
140
Member Avatar for shahbaz13

The line: [code] echo "</tr><td style='border-style:none; border-width:medium;'>"; [/code] is at fault I think. You close the row with the [icode]</tr>[/icode] followed immediately with a [icode]<td>[/icode] node. Are you able to view the source in the browser? I think you will find that you will have cells (<td>) outside of rows …

Member Avatar for shahbaz13
0
104
Member Avatar for santhi1986

Hi there santhi1986 and welcome to Daniweb :) We have a few rules here at Daniweb that you might want to read. Probably the most important one is that we can't do your homework for you, we need to see some effort before we try to guide you. What do …

Member Avatar for srabasti
-2
179
Member Avatar for stevenbaron1

This is a static call to your function, which is fine if there is no calls to member variables or functions in the getAllRecords function (ie using $this). From a relatively early version of PHP (around PHP4 from memory) they introduced the static keyword which was supposed to be used …

Member Avatar for stevenbaron1
0
168
Member Avatar for ajst

It is possible but very prone to error. This code shows how you can switch out a form in a panel in a button click event: [code] procedure TMainStockForm.StockTakeBtnClick(Sender: TObject); begin LockWindowUpdate(Self.Handle); Panel1.Visible := true; try StockTakeBtn.Down := true; StockTakeForm.WindowState := wsMaximized; StockTakeForm.ShowForm; ShowWindow(StockTakeForm.Handle,SW_SHOWMAXIMIZED); finally Panel1.Visible := false; LockWindowUpdate(0); end; …

Member Avatar for ajst
0
138
Member Avatar for sneekula

> You know you are a geek when .... You can relate to each of the characters in The Big Bang Theory or The IT Crowd... and these are the only TV shows you watch.

Member Avatar for Netcode
0
674
Member Avatar for darkagn

Hi all, I am getting an error in my application that reads: Incorrect syntax near the keyword 'set' It only occurs in a database at a particular venue and only when the offending query/queries are run locally. I have restored the database on my PC and the queries run without …

Member Avatar for adam_k
0
125
Member Avatar for C+Marshall

[code] label2 = new JLabel ("Think",pic4, SwingConstants.RIGHT); [/code] I think you should be referencing pic2 here instead of pic4?

Member Avatar for manoglobal@gmai
0
574
Member Avatar for coroll

Resources are global, external data objects that can be used by the application from any point. [URL="http://msdn.microsoft.com/en-us/library/f45fce5x.aspx"]Here[/URL] is the MSDN description of application resources, their purpose and how to use them. In answer to your third question, you can change what type of resources you wish to view/add/delete by changing …

Member Avatar for darkagn
0
136
Member Avatar for orville
Member Avatar for samee1985
0
90
Member Avatar for danuz

A basic algorithm would be something like: [code] int temp = inputValue; string roman = String.Empty; while (temp > 999) { roman += "M"; temp -= 1000; } while (temp > 899) { roman += "CM"; temp -= 100; } while (temp > 499) { roman += "D"; temp -= …

Member Avatar for stbuchok
0
176
Member Avatar for darkagn

Hi all, I am writing a currently writing a program that needs to connect to a website via HTTPS. I am receiving the following error when I attempt to connect: [I]The procedure entry point ASN1_const_check_infinite_end could not be located in the dynamic link library libeay32.dll[/I] followed by: [I]Could not load …

Member Avatar for caperjack
0
311
Member Avatar for darkagn

Hi all, I am having an issue with regard to libeay32.dll as outlined in [URL="http://www.daniweb.com/hardware-and-software/microsoft-windows/windows-vista-and-windows-7/threads/375007"]this thread.[/URL] I am getting the error when attempting to connect via HTTPS using the following code: [code] function THttpClient.Login(const UserName, Password, URL: String): Boolean; var Client: TIdHTTP; Params: TStrings; begin Client := TIdHTTP.Create(Nil); Client.IOHandler := …

0
92
Member Avatar for berniefitz

Hi Bernie and welcome to DaniWeb :) That code looks fine, can you move the creation of your variant array outside the function and step into the Locate to see exactly where the error occurs? [code] VarArray := VarArrayOf([sPhone, sTitle, sAddLine2]); bFound := tblComp.Locate('CompPhone;Title;AddLine2', VarArray, []); // <- step in …

Member Avatar for Mikav6
0
662
Member Avatar for shelly1234

I haven't done it before but my guess would be writing an event handler for the tab control's DrawItem event that styles the tab the way you want. Anyone know of a better way?

Member Avatar for Momerath
0
151
Member Avatar for praveendasika

Declare the variables value1 and value2 before the if-statements. [code] int value1 = 0; int value2 = 0; if (checkbox1.checked) // you don't need to say == true here value1 = 1000000; if (checkbox2.checked) value2 = -392014; int value3 = value1 + value2; myFunction(value3); //... public void myFunction(int value3) { …

Member Avatar for praveendasika
0
166
Member Avatar for Saidar

Check out the [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"]BackgroundWorker[/URL] class. Basically you put all your execution handling into its DoWork event handler, then call RunWorkerAsync on the instance to set it to run. You can use the ProgressChanged event handler to report the progress back to your GUI thread, and the RunWorkerComplete event handler is …

Member Avatar for Mitja Bonca
0
997
Member Avatar for bhagawatshinde

[code] for (int k = 0; k <= dtgdisplaytest.RowCount - 1; k++) { //here checking pending test string TestDisp = dtgdisplaytest[0, k].Value.ToString(); string str_sel = "select test_no from testmark where test_no='" + TestDisp + "' and submission='Pause'"; [/code] This section of your code will run k SQL queries on the …

Member Avatar for darkagn
0
1K

The End.