679 Posted Topics

Member Avatar for nitin1

[Bruce Eckel's book](http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html) has been a good refresher reference for me.

Member Avatar for dexblack_1
0
186
Member Avatar for jrosh

You don't need to append the whole thing at once. One way to address your problem is to append only if you have data: sb.Append("Address: "); if(!String.IsNullOrEmpty(Street1)) sb.Append(Street1 + ", "); if(!String.IsNullOrEmpty(Street2)) sb.Append(Street2 + ", "); sb.Append("{0} {1}", PostalCode, City); sb.AppendLine();

Member Avatar for gusano79
0
164
Member Avatar for Tinnin

At first glance, I'd say it's likely that the subquery is what's killing performance. Try executing that `SELECT` statement separately into a temporary table and doing the update as a `JOIN` with that table.

Member Avatar for Tinnin
0
648
Member Avatar for DavidB

Consider returning a `vector` or some other variable-length list of roots, which would also scale well to a more general root-finding algorithm.

Member Avatar for DavidB
0
336
Member Avatar for general2012

p = q = r = n = (int*)malloc(20 * sizeof(int)); Note that this statement will assign the *same address* to all four variables; there's only one call to `malloc`. If you want to allocate four *different* blocks of memory, I'm not aware of any such shortcut. Either allocate them …

Member Avatar for general2012
0
124
Member Avatar for sukhanya

By "throws error" do you mean "does not compile"? Because [`HttpPostedFile.FileName`](http://msdn.microsoft.com/en-us/library/system.web.httppostedfile.filename.aspx) is a read-only property. Which makes sense, as there hasn't been any file posted yet. Also, it's a string, not a byte array. Have a look through the [`FileUpload` control documentation](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload_properties.aspx); you might find something else you can use. …

Member Avatar for gusano79
0
182
Member Avatar for darksyderydaz

> I plugged a monitor directly to the board and recieved no signal to the monitor I don't see any onboard video for the [M4A77 on the Asus website](http://www.asus.com/Motherboards/M4A77/)... what did you plug it into? > I installed a known good GPU into the board and used that and still …

Member Avatar for gusano79
0
176
Member Avatar for jason.bennett.376258

I'd start by refactoring for concision and readability; this will make your algorithm easier to analyze. The most obvious improvement to me is with the nested `if` statements that start out looking like this: if 1<= opp_6 <= 2: These could be turned into a function that takes each of …

Member Avatar for gusano79
0
619
Member Avatar for jameslivsey

Best to avoid cursors when possible (which is almost always :). Here's a start, to sum Amounts per unique Reference and ID: SELECT Reference, ID, SUM(Amount) AS TotalAmount FROM [table] GROUP BY Reference, ID What is the purpose of the ID grouping?

Member Avatar for gusano79
0
203
Member Avatar for Narayanan87

Assuming you have random access to the input file, you could do something like this: When you read a line that represents a new member (*i.e.*, it's different than the last line's member), hang onto the data in memory for a second. Scan the file, counting lines that represent that …

Member Avatar for Narayanan87
0
195
Member Avatar for CodyOebel

You don't need the `foreach` loop. `i` is already indexing each book; you just need to call the methods on `book[i]`.

Member Avatar for gusano79
0
202
Member Avatar for pwolf

In the interest of getting your code working soon, this seems to be a problem: loadTblStaff(); loadTblCars(); con.ConnectionString = dbProvider + dbSource; You're creating the connection string *after* calling methods that need to use it. Try moving that last line above the `load`\* method calls. I think you should be …

Member Avatar for pwolf
0
262
Member Avatar for dhimanbiswas4u

In addition to Mr. Waddell's comments... An immediately obvious problem: the source has `green.png`, but you're looking for `red.png`. A less obvious problem: You have a space at the end of the first part of the regular expression, but the input looks like it has a newline there. As it's …

Member Avatar for tinstaafl
0
273
Member Avatar for davecoventry

You have double *backward* slashes, which will confuse a Windows machine. Change `\\` to `\` both places it appears. When troubleshooting batch files like this, you should remove or comment out `echo off`; then you'll be able to see exactly what commands are being executed.

Member Avatar for gusano79
0
555
Member Avatar for danimischiu

Have you looked at using the [Microsoft Office Primary Interop Assemblies](http://www.microsoft.com/en-us/download/details.aspx?id=3508)?

Member Avatar for gusano79
0
105
Member Avatar for Himanshu Chawla

[MSDN How to: Display Modal and Modeless Windows Forms](http://msdn.microsoft.com/en-us/library/39wcs2dh(v=vs.110).aspx)

Member Avatar for tinstaafl
-1
291
Member Avatar for Ravenous Wolf

Side note: Also consider [`Path.Combine`](http://msdn.microsoft.com/en-us/library/fyy7a5kt.aspx) for creating the final path.

Member Avatar for JOSheaIV
0
6K
Member Avatar for treasure2387

[Assemblies Overview on MSDN](http://msdn.microsoft.com/en-US/library/k3677y81(v=vs.80).aspx) Short version: They're how .NET applications are organized.

Member Avatar for gusano79
0
70
Member Avatar for EnriqueLandivar

Does this model have a touchpad below the spacebar? I've had similar problems with laptops before; my hands tend to brush against the touchpad, which causes all sorts of weird cursor movement.

Member Avatar for Webville312
0
133
Member Avatar for Haquo

Rather than try and guess what's wrong, let's see what SQL is getting executed. Set a breakpoint on the line `command.CommandType = System.Data.CommandType.Text` and run the project... when it stops, see what the value of `command.CommandText` actually is. That should be illuminating. Also, do get into [parameterized queries](http://msdn.microsoft.com/en-us/library/yy6y35y8.aspx) sooner rather …

Member Avatar for Haquo
0
1K
Member Avatar for Rasool Ahmed
Member Avatar for zxz

As for #1, it looks like it's supposed to be "[factorial](http://en.wikipedia.org/wiki/Factorial)"; that's what `n!` usually means. #4 makes sense that way, too.

Member Avatar for stultuske
0
283
Member Avatar for game06

Are you sure it's stopping with the first frame, or is it possible that it's looping all the way around once and stopping on the first frame? That's what your code looks like it's doing. It will always reset `currentFrame` to zero, even if we're not looping. Try changing this: …

Member Avatar for gusano79
0
180
Member Avatar for arupface

What have you tried so far? Showing us what you've tried will help us understand better where your problem is. In this case, you want `count(/library/book)`. The query `/library/book` returns all of the `book` elements, which you should pass as a parameter to the `count` function so it can do …

Member Avatar for gusano79
0
250
Member Avatar for neosonic

[Here's a discussion on a few ways to implement paging](http://stackoverflow.com/questions/548475/efficient-way-to-implement-paging); that's the closest I can think of to get what you want.

Member Avatar for gusano79
0
206
Member Avatar for nitin1

From [the Wikipedia article on digital watermarking](http://en.wikipedia.org/wiki/Digital_watermarking): > A digital watermark is a kind of marker covertly embedded in a noise-tolerant signal What algorithm you use depends on what kind of data you're watermarking. For example, if it's an image, you can usually add a watermark by replacing low bits …

Member Avatar for gusano79
0
108
Member Avatar for daniel1977

What do you mean by "can't get them to work"? Please provide specific examples of what you expect to see and what is actually happening. It makes it much easier to help you find what's wrong.

Member Avatar for daniel1977
0
296
Member Avatar for liphoso

Does `loginName` come with [quotes](http://dev.mysql.com/doc/refman/5.0/en/string-literals.html) already?

Member Avatar for gusano79
0
171
Member Avatar for ayoob22

Have you tried writing this yourself yet? Show us some work, and we'll help you get moving in the right direction.

Member Avatar for DavidB
0
233
Member Avatar for somjit{}

I use Visual Studio at my day job; it's a decent IDE (though there are a few things I'd have had it handle differently, especially around autogenerated code). Haven't used Eclipse for .NET development, so I can't comment on that. You may also want to look at [SharpDevelop](http://www.icsharpcode.net/opensource/sd/); I use …

Member Avatar for gusano79
0
223
Member Avatar for MareoRaft

1. [NSLog](http://cocoadev.com/wiki/NSLog) works much like [printf](http://www.cplusplus.com/reference/cstdio/printf/); `%d` is for integers, `%f` and `%F` work for both floating point types, and `BOOL` is [just an integer](http://stackoverflow.com/questions/3452306/objective-c-boolean-values), so use `%d`. 2. `double` [can handle more precision](http://www.techotopia.com/index.php/Objective-C_2.0_Data_Types#double_Data_Type); try a number with more digits. 3. That's how the language works; you have to write …

Member Avatar for geojia
0
167
Member Avatar for modesto916

Do you have any requirements, or are you free to design the file system however you want? I'd start with basic design (folders, files, *&c*.), and from there, design the API that consumers of your file system will use (or if you want to be more formal, start with use …

Member Avatar for gusano79
0
158
Member Avatar for savedlema

First step is to see what the console output says; open up a command window and run it manually.

Member Avatar for savedlema
0
704
Member Avatar for wilsonz91
Member Avatar for gusano79
0
243
Member Avatar for newGains

What behavior are you expecting and what are you actually seeing? It's easier to help if you give specifics. Meanwhile, here are some comments: > trying to use recursion Is there a specific requirement that you use recursion? If not, there are other approaches I'd recommend exploring first. > to …

Member Avatar for newGains
0
258
Member Avatar for Tinnin

Changing the file extension doesn't do anything to the contents of the file. It looks like this is what's causing your "corruption"--you're asking Excel to load a CSV file, but its contents are still Excel format. What you'll want to do is load the XLS or XLSX file as an …

Member Avatar for Tinnin
0
170
Member Avatar for Violet_82

I'm not familiar with the term "client" used this way; that usually indicates some kind of network connection to me. For what I think you're asking, I usually use "consumer"--that is, a consumer of class A is any class B that uses class A. If that's what we're talking about, …

Member Avatar for Violet_82
0
168
Member Avatar for ddanbe

I agree that fall-through can be handy, and I do occasionally lament its absence at my day job. But Microsoft seems to have been interested in lowering barriers to entry for a long time now, and AFAICT, this was just a decision the language designers made to prevent foot-shooting. My …

Member Avatar for ddanbe
1
366
Member Avatar for game06

Comment #1: > for(int x = i+1 but > x+=30; I don't think that will do what you think it will do... are you trying to increase an x-coordinate there? Comment #2: > but this way x+= 30 can still move enemy on top of each other. So the next …

Member Avatar for somjit{}
0
133
Member Avatar for zdneth

"Don't work" isn't enough information for us to help... please post the code you have so far.

Member Avatar for IIM
0
255
Member Avatar for wilen

To sort as part of your query, use an [`ORDER BY` clause](http://office.microsoft.com/en-us/access-help/order-by-clause-HP001032258.aspx). Does that help? If not, please post some code so we can get at specifics more easily.

Member Avatar for wilen
0
188
Member Avatar for Potgiesh

Also: [wxWidgets](http://www.wxwidgets.org/), which is supported by [various GUI designer tools](http://wiki.wxwidgets.org/Tools#Rapid_Application_Development_.2F_GUI_Builders).

Member Avatar for mike_2000_17
0
467
Member Avatar for korathualex
Member Avatar for Shania_01

You could generalize the point generation you have in `initPoints` to a method that takes an angle and returns the point at that angle; it would look something like `Point CreatePoint(double theta)`, and would make use of the code inside your `for(int theta...` loop. Then get points for 45, 235, …

Member Avatar for gusano79
0
226
Member Avatar for Asmaa_2

Have you looked at [these methods](http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week)?

Member Avatar for gusano79
0
391
Member Avatar for tony75
Member Avatar for sarathsshanker

[SQL INSERT](http://www.w3schools.com/sql/sql_insert.asp) doesn't use the WHERE clause. I'm not sure what you want to do here... can you post a "before" and "after" table to show us what you want to happen? Please include column names too.

Member Avatar for IIM
0
230
Member Avatar for nova4005

First thing that leaps to my attention is this section: if (rollTotal == 2) // for each roll of the dice. With the if { rollHist[0] += 1; // statements it calculates how many times } if (rollTotal == 3) // a certain value is produced by a roll of …

Member Avatar for JamesCherrill
1
238
Member Avatar for tumblinmonkeym

It might help to visualize the constructed tree. For your example sequence [5, 3, 9, 7], I get: 5 / \ 3 9 / 7 I'm not aware of "binary search cost" as a standard term, but it appears to be the element's tree depth plus one. This makes sense; …

Member Avatar for gusano79
0
656
Member Avatar for Counterpartz

From Wikipedia's [article on variance](http://en.wikipedia.org/wiki/Variance): > The variance of a random variable or distribution is the expectation, or mean, of the squared deviation of that variable from its expected value or mean. So you need the mean first; you're already calculating that in `Average`. So for each original number, find …

Member Avatar for Counterpartz
0
310

The End.