Click here to Skip to main content

Comments by _Maxxx_ (Top 154 by date)

_Maxxx_ at 23-Jun-14 3:01am View
   
How does the SP perform when 40K records meet the criteria? If this is acceptable, then you could just present the first couple of hundred or so - if not, then you need to limit the Sp to returning the Top n records rather than all of them
_Maxxx_ at 8-Jun-14 5:46am View
   
As I said before I think, you need to debug the quewries and make sure they are doing what you expect with the data you have.
The dates you showed in your example are earlier than today, so as shown, neither query will return a value.
Your queries differ only by the different dates and the bool value - so try commenting out both, - they should now return a value.
Next uncomment one and see if it returns a value - if it doesn't then that line is likely to be your issue - and hopefully you can work out why!
And run it in debug - look at the returned values - see if you can figure it out.
_Maxxx_ at 6-Jun-14 10:58am View
   
Given that the dates you show in your sample data are all in 2013, that seems unlikely!
As I said, I would debug it to try to find out what is happening -
 
One thought does occur - if BOTH queries return a record, then the page you go to will depend on the order in which you run them - so perhaps run the full test first?
_Maxxx_ at 6-Jun-14 10:49am View
   
Well you have
 
<pre lang="cs">var test=$('.count').html();
test++;</pre>
 
which says 'get the element with a class of .count and increment it.
 
And you have two elements with that class
 
sorry I don't know how to get it working off the top of my head - as you plainly do't want to give each element its own Id and function///
_Maxxx_ at 6-Jun-14 10:38am View
   
Are you simply saying that passing the same username and password to each of the two methods, NewsTrial returns a record and full_test returns null?
If that is the case, I can't see anything wrong with the query, so it is likely a problem with the data
I would run in debug, break on the query and check the data at runtime.
If it still looks OK I would try removing lines from select 1 by 1 until you DO get a record, and then you know which bit is failing
_Maxxx_ at 3-Jun-14 7:51am View
   
You can do it with xamarin - and the OP has Xamarin and wants to program using it and C#, not HTML/JS
_Maxxx_ at 18-May-14 5:47am View
   
Thanks.
I forgot to mention that this is for a cross platform mobile device application - so standard C++ functions- I think the link you gave was for Windows?
Shirley, in all the years C++ has been about, there is a 'known' method of converting dates to strings and vice versa? When I write an app and someone types in a date, does everyone roll their own?
_Maxxx_ at 15-May-14 17:23pm View
   
I"m not sure why you are talking about finding data in the main form/binding to the main form.
Does the main form already have a collection of all Customers (or whatever)?
Assuming you have some sort of DAL then I would make the look up forms stand-alone. The user enters the filtering data, the form gets the dataset from the database.
When the user selects one in the lookup form, it closes and the main form accesses the selected data and does whatever it needs to with it.
If Db speed is a real issue, then you can always cache the complete record sets in your DAL and provide filtering method(s) there to return only the appropriate records.
If you are talking about pretty static data (i.e. it won't change during program execution) then caching is a good idea - why continually go to the db to get the same list of customer types, for example)
One the controls front, I haven't programmed in winforms for a while, so can't make sensible comment, other than to suggest you develop using sub-classed vanilla controls (i.e. myGridView that just inherits from GridView). This may allow you to replace the base control with another, should performance be an issue, without too many changes.
_Maxxx_ at 15-May-14 2:05am View
   
The result of what? The query?
Something like this http://stackoverflow.com/questions/1501635/how-to-get-the-return-value-and-rows-in-c-sharp-thru-stored-procedure
If it were me I would:
Run in debug, up to the call on the SP - if it doesn't get there then you need to dig in your code
If it does, then call the SP through SSMS (or even just run the sql) with the same values you're assigning in the program.
See what happens!
_Maxxx_ at 15-May-14 1:59am View
   
The only real benefit is less code to be written. Instead of having to write lots of loops to search for or sort data, Linq does it for you.
Some people think its the bees knees, and try to use it for all sorts of things it's not really good for, and create messy Linq queries that are harder to maintain because of their complexity.
 
A good example where Linq is useful (IMHO) is in filtering collections (as I mentioned in my answer) - imagine the user can also select the colour, age, whether it has tails etc. etc. A single Linq query can provide the objects required from the collection, and sort them appropriately, without a) a long trip to the database or b) writing a 'foreach' or similar loop.,
 
Beyond that, it's really personal preference.
 
In fact in many circumstances Linq can be slower than writing a simple loop yourself, so where performance is a consideration it may not be the best tool.
_Maxxx_ at 15-May-14 0:43am View
   
Is the SP running at all?
Is the DAL method run at all?
Is the BAL method run at all?
 
Why have the catch .. throw - leave the exceptions in while you are testing and it may give you a clue!
 
If you want the SP to return the number of rows affected then you need to write the SP to do so.
_Maxxx_ at 8-May-14 2:07am View
   
What do you mean by "work fine"? When it doesn't, what happens? Is it slow or does it not work at all - do they get an error message?
_Maxxx_ at 8-May-14 2:03am View
   
This is obviously a homework question and, while the gurus here are happy to aid you in learning, they won't just do the homework for you.
I suggest you make some attempt yourself, and ask specific questions should they arrive.
_Maxxx_ at 5-Apr-14 8:40am View
   
Cool - thanks.
I actually want it to be right justified so not using a pointer works for me - but I get your idea if it were a more generic solution.
but enough! I've taken enough of your time, and spent far too long just to display the PooperPig score!
 
Thanks Griff.
I owe you a beer.
_Maxxx_ at 5-Apr-14 8:24am View
   
So, I gave it a go...
 

char output[11]; // Allow 12,456,890/0
output[10]=0;
unsigned int pos = 0;
unsigned int index = 10;
do
{
unsigned int digit = (value % 10);
value = value / 10;
char c = '0' + digit;
if (pos++ == 3)
{
pos = 0;
output[--index] = ',';
}
output[--index] = c;
}
while (value > 0);
//
while(index > 0)
{
output[--index ] = ' ';
}
std::string s (output);
return s;
 
It;s good to have a debugger when you're doing this stuff - I kept leaving a character unchanged leading to interesting displays!
 
Naive question: With char output[11]; this allocates 11 bytes on the stack (I think) - so presumably this just gets released when it pops out of my function? i.e. I don't need to worry about releasing the memory?
_Maxxx_ at 5-Apr-14 7:56am View
   
Good spot on the do..while.
 
I figured if I really need it quick I should use plain old vanilla c strings and manipulate the characters directly - I know the maximum length the string can be (potentially whatever the maximum size of an int is, but in my game, only (say) 6 or 7 digits.
So I could set up the string to be (say)11 characters plus \0, fill it with spaces, then just use an index to update each char.
Hmmm. I think I can turn a c string into a std:;string can't I?
I might even give it a go!
_Maxxx_ at 5-Apr-14 7:39am View
   
here's what I got right now
 
if (value == 0) return "0";
unsigned int pos = 0;
std::string output = "";
while (value > 0)
{
unsigned int digit = (value % 10);
value = value / 10;
char c = '0' + digit;
if (pos++==3)
{
pos = 0;
output = ','+ output;
}
output = c + output;
}
 
return output;
 
}
 
Which works and avoids the formatString - If I cold figure how to benchmark the two methods I might give it a go, but it's working right now, and so I"m one happy little vegemite.
 
(although if you see anything in that code that's dodgy I'd appreciate the thought)
 
Thanks again !
_Maxxx_ at 5-Apr-14 7:25am View
   
I've currently got a formatString method that I'm using to convert the int to a string, (e.g. s = formatString("%d",12345); then using a modified version of your solution (as of about 3 minutes ago) to convert that to put in the commas.
The formatString method uses vsprintf to format - I don't know if that is more a more efficient way of doing it that what you suggest - I'm wary of putting mod and % because this is being used in a 60fps game loop, so efficiency is important...
Although, I might give it a go just to prove I'm not as thick as I was feeling when I couldn't do this earlier on!
 
Too used to the niceties of C# etc. where you don't have to write all the damn plumbing yourself!
_Maxxx_ at 5-Apr-14 7:07am View
   
copied in your code and it works. Sort of!
Obviously your version returns 12345 as 123,45 whereas I wanted 12,345.
so i changed it to loop from length-1 to <0
and output += s[i] changes to output = s[i] + output (and same change to adding the comma
 
And it hung!
 
Oops.
I forgot to change to an unsigned int!
 
cheers Griff!
_Maxxx_ at 5-Apr-14 6:57am View
   
Baaa! I will SWEAR that your solution is almost exactly what I had (only real difference I was using i%3==0 as a test.
 
I'll give it a go right now & see what happens!
_Maxxx_ at 5-Apr-14 4:29am View
   
thanks griff - i'll never mention sheep again.
if i wanted to return a string rather than cout-ing how can i do that?
It was doing pretty much what you show, but trying to concat the chars to another string where I started to get exceptions...
_Maxxx_ at 17-Mar-14 20:04pm View
   
it's difficult to critique without knowing your level of knowledge and the teacher's expectations.
e.g. is doSomething acceptable naming or should you be commenting on it?
Is the fact that the use of ID capitalised is against MS standards something that requires comment?
_Maxxx_ at 14-Mar-14 7:24am View
   
If there is a 'dateupdated' column on every table, for example, you could use sp_foreachtable to run 'delete from ? where fromdate < @thedateyouwant
This will fail for referenced tables, but you can just keep running it until it gets rid of everything.
A brute force approach - but should work if you have a consistent method of identifying records on every table.
_Maxxx_ at 5-Feb-14 23:22pm View
   
Well, your solution could have been copied and pasted from the source code I told you to look at!
_Maxxx_ at 5-Feb-14 23:03pm View
   
It's not clear what part you are having problems with - what you have tried or, exactly, what you need to know.
Maybe you could try improving the question (there's a link at the bottom of the question) to show what you have, and what is missing / you need help with. Also, what technology (AsP, PHP, etc.) you are using.
_Maxxx_ at 5-Feb-14 17:23pm View
   
I can't even guess why that wouldn't work. I suggest
 
1. Post some relevant code here
2. Run in debug, and set up a breakpoint before you add the bracket - look at the Text property then step over the 'bracket adding code' and look again -
_Maxxx_ at 4-Feb-14 17:38pm View
   
TO be clear.
textbox1.Text & "1" works, but
textbox1.Text & "(" doesn't?
 
And by 'works' you mean the bracket doesn't appear?
_Maxxx_ at 3-Feb-14 21:42pm View
   
When you say "i tried to start by puttint txtbox.txt= txtbox.text & "(" and that didn't work " what didn't work exactly?
_Maxxx_ at 19-Jan-14 21:46pm View
   
You haven't made it clear what you want the trigger to do.
_Maxxx_ at 14-Jan-14 23:53pm View
   
Best thing to do is to post the code you have so we can look at it and (hopefully) tell you where you are going wrong!
Presumably you convert the strings to numeric - that's probably where the fault lies - but without the code it's hard to help further.
_Maxxx_ at 14-Jan-14 0:56am View
   
What aspect are you having problems with?
_Maxxx_ at 14-Jan-14 0:53am View
   
No, not from here.
_Maxxx_ at 14-Jan-14 0:50am View
   
Unhelpful, I know, but Success is spelled Success not sucees or sucess - I mention only in case you have spelled it two different ways somewhere and hence are not referencing the same thing you think you are!
 
As a debug strategy, I'd take all the sql out of the sp except for the setting the return parameter to 1 - and see if you still get the wrong return result - that way you can see if you are actually getting the returned parameter value, or the query is just failing.
The query looks a bit strange -0 like @sqlqueries isn't actually used?
_Maxxx_ at 13-Jan-14 23:11pm View
   
If it says the path isn't correct, then it isn't. It might look like it is, but it isn't.
You are using Directory.GetFiles and passing the name of a file, not the path of a directory. GetFiles returns a list of files in a directory.
_Maxxx_ at 12-Jan-14 21:17pm View
   
If you think that the code you liked to is difficult then I think you should steer clear of this sort of thing - it's hardly possible to write a more simple program!
this is a pure 'brute-force' approach to finding a prime.
There are lots of ways to find primes that are more efficient - a quick google will provide tons of examples - but the code would be more complex - and if you're finding the given example difficult you may not want to look
_Maxxx_ at 7-Jan-14 15:28pm View
   
You're right - and I think I see what you're trying to do, now.
I tend to use the Xaml code-behind for this sort of stuff (no - stop it, don't scream like that!)
So the code-behind calls a method on its VM (say SaveState()) that takes as parameters whatever is necessary(in your case maybe the docking manager and a key). The VM takes the parameters, and does what it needs to have them saved to some repository.
Then you also have a method LoadState() that would probably take the same parameters, but this time set the state of the docking manager.
This way, your VM only has to know about the Avalon State Manager object, and not a particular view.
some people squirm when they see me advising the use of code-behind, but that's what it's there for, IMHO, to do GUI work; and this is one of those cases where the boundaries between GUI and Business logic become blurred.
_Maxxx_ at 6-Jan-14 21:08pm View
   
Just answering your first question - yes, having the VM have a reference to your View is bad practice, and I would recommend not doing it.
I don't know AvalonDockingManager so can't help more than this, sorry1
_Maxxx_ at 3-Dec-13 22:15pm View
   
Difficult to follow what you are asking exactly.
From what I can tell of your code, you have two arrays containing all the values for the red pixels from both images?
Anyway,
Assuming both the images are the same width, then you just need to look at the bottom row of the top image and the top row of the bottom image.
from left to right, (i.e. from i=0 to i=width) compare the pixel values from each.
I don't really understand what you want to do with the images once you determine if the pixel values are equal, though.
Maybe try re-wording your question as a series of short steps as the English may be easier to understand.
_Maxxx_ at 3-Dec-13 22:05pm View
   
Don't be so rude and obnoxious.
_Maxxx_ at 2-Dec-13 2:01am View
   
I don't know what imegen.exe is, and a quick Google didn't give me any information. Perhaps you could explain a little more clearly what you are trying to achieve?
_Maxxx_ at 29-Nov-13 7:25am View
   
My apologies - I had assumed you were the OP so was referring to his question and not your comment.
_Maxxx_ at 29-Nov-13 7:20am View
   
If you seriously want to write your own face recognition software, then I think (based on the quality and tone of your question) you are aiming far, far too high, and certainly asking a question of the sort you did doesn't seem like you have done any work towards this yourself.
 
it is not clear, then, what you are asking for?
 
The link I gave was to open source software, so you are free to use the code rather than treat it as a library.
 
More info on this sort of thing is here - http://www.codeproject.com/Articles/39060/Face-Detection-in-C#
_Maxxx_ at 20-Nov-13 21:25pm View
   
I don't know Ruby at all - but it looks to me like you have too many 'end's?
_Maxxx_ at 20-Nov-13 18:12pm View
   
From the original post "We have already started coding with xojo, so that is more comfortable. " So they plainly are already using it. Hence my response.
If vendor lock in is your main issue, then what would you suggest to avoid it? Plainly you couldn't use .Net as that is tying you to MS. So what, entirely open source?
I think you need to look at things not just from a technical point of view, but with a sound business head; From what the OP describes, this is a very simple app, that they have already started coding in xojo, and someone is telling them they should do it in PHP - probably because they have PHP skills.
If the development tool of choice a) does the job and b) is maintainable / supportable and c) doesn't require significant cost (in retraining or tool purchase) then I think it will be fine as there is no overwhelming argument for changing.
_Maxxx_ at 20-Nov-13 18:07pm View
   
Suspicious? I don't understand what you mean.
I wouldn't develop in VB6 now - but these folk already have a VB6 application and (presumably) some expertise.
As for vendor lock in - unless you are looking at wholly open source you are going to get vendor lock in.
From your link:
"Microsoft software carries a high level of vendor lock-in, based on its extensive set of proprietary APIs. "
for example
_Maxxx_ at 20-Nov-13 5:51am View
   
While, as a professional developer, I would steer clear of something like Xojo, it has been around since 1998 in one form or anther, so probably isn't quite as awful as you fear!
Also, what's wrong with a proprietary language?
Supported platforms? From Wikipedia:
"The Xojo IDE is currently available for Microsoft Windows, Mac OS X, 32-bit x86 Linux,[11] and can compile applications for Windows (Windows XP and higher), Mac OS X (running on Intel-based Macs using the Cocoa frameworks), 32-bit x86 Linux, and the web, with support for iOS coming in December 2013. Xojo is self-hosted: the Xojo IDE is built with the current release of Xojo.[12]"
_Maxxx_ at 20-Nov-13 5:48am View
   
The OP is talking about what sounds to be a very simple app. If they already are using xojo and this is the only app they are likely to develop then I believe better to stick with what they know rather than look elsewhere.
_Maxxx_ at 29-Oct-13 23:38pm View
   
I think it might be better to show an example of what you are trying to achieve - e.g. show the rows in the table at each step of what you want to achieve - as it is hard to follow your question.
Alternatively, writing the steps as simple bullet points might help?
_Maxxx_ at 29-Oct-13 23:23pm View
   
I was intrigued so tried this out - in C# not VB - and all was well.
Are you sure there isn't some other process going on that is updating the text box?
_Maxxx_ at 29-Oct-13 23:17pm View
   
A windows form application runs natively on a computer and not in a browser - and so doesn't run 'online' at all.
You need to describe you question better
_Maxxx_ at 28-Oct-13 1:02am View
   
Your English isn't too bad - but your question is!
The folk here are generally happy to help you if you have a specific problem - have tried something and are stuck, or are getting an error you cannot figure out.
They generally aren't here to just write a program for you.
If you _have_ tried something then post the code & say what specific problems you are having - then people will be able to help you.
_Maxxx_ at 21-Oct-13 7:46am View
   
Sorry - I didn't see you addition when I posted my last comment.
That's awesome! Thanks.
 
One of my attempts was similar - but I was getting into an infinite loop of windows moving events!
 
Thanks for your help!
_Maxxx_ at 21-Oct-13 1:28am View
   
Sorry, but you aren't helping at all. I'm talking touch with WPF specifically - you're talking touchpads, which is "a separate topic"
 
WPF DOES make a difference between a touchpad and a mouse. e.g. the System.Window.DragMove(); method provided specifically drags the window while the left mouse button is down - and is not affected by touch at all (indeed, if you look at the code for it, it specifically tests for the left mouse button being down)
 
And the dragging of a window without the client area IS related specifically because of differences between mouse handling and touch.
 
As you say, it is an easy problem, would you be kind enough to supply some code to show me - as I have not found it possible to achieve despite many attempts.
_Maxxx_ at 26-Sep-13 0:09am View
   
Do you mean you want to save each line of the text box into a column of a database table?
_Maxxx_ at 8-Aug-13 6:00am View
   
I don't see what you mean. The mouse coordinates are relative to the screen while the OP wanted to convert that to the coordinates on the bitmap.
Assuming the image takes up the whole picture box then my calculation is right, isn't it?
 
I'm sure there are 57 other ways of doing it - but I think my code caters exactly for what the OP requested.
_Maxxx_ at 8-Aug-13 1:10am View
   
Perhaps the OP has good reason, perhaps not.
Surely it would be more helpful to let them know the easy answer rather than telling them not to use a PictureBox?
_Maxxx_ at 29-Jul-13 1:51am View
   
It seems quite simple to me. Perhaps you should ask your teacher for help?
If you have a specific problem with your solution, perhaps post it here so we can help/. or give your teacher's email address so I can post a solution straight to them?
_Maxxx_ at 17-Jul-13 1:15am View
   
It would REALLY help if you told us what errors you were getting, and where!
_Maxxx_ at 14-Jul-13 5:49am View
   
Reason for my vote of 2 \n This isn't a tip or trick. I'm not really sure what it is, as I'm not sure it will help anyone understand the yield keyword any better.
_Maxxx_ at 30-Jun-13 22:01pm View
   
Where you are checking for either x or o to win, it would be far easier to write that code as a function into which you pass either X or O - it can then return a boolean telling you whether that player has won or not.
 
Same with drawing the grid; put it in a function so you don't have duplicate code.
 
It might be pedantic at this level of coding, but it will save you heaps of time if you need to make changes as there's only one place to change it!
 
Oh - and there's a bug in your code as you are checking the mat array from 1 through to 9 but it is a zero based index so should be from 0 to 8 - now, if only you'd written the code in a function you'd only have one place to change it :)
_Maxxx_ at 17-Jun-13 6:11am View
   
Yes they can - can you tell us what the data types are on your table and show the SQL you are using, and the error message you are getting.
_Maxxx_ at 13-Jun-13 0:31am View
   
That's a completely different question.
YOu index an array
reader(7)
and it is telling you 7 is outside the bounds of the array
So your sql isn't returning 8 columns.
Look at your sql - it is only returning one column (i.e. count(EmployeeName))and, indeed, only one row
What are you trying to achieve?
_Maxxx_ at 13-Jun-13 0:28am View
   
What IS it giving?
select count(*) from table where condition should give you a row count (I think if you had employee names of Null your count might differ)
Have you tried hard-coding the SQL (or just running what you think should be run) to see the output
e.g. execute "Select count(*) from employee where group = 'YourGroupName'"
If that sql works, then there's probably something different being passed by your code.
If that doesn't work, then look at your table - does that group ectually exist in that column?
_Maxxx_ at 6-Jun-13 2:12am View
   
But which row?
_Maxxx_ at 6-Jun-13 1:52am View
   
Windows forms, WPF, ASP? It makes a difference!
_Maxxx_ at 4-Jun-13 17:18pm View
   
Ok - I was suggesting cookies because that's your only real option without asking the user to log in or give some information to your web app to identify themselves/ their computer.
I guess you are using it for some sort of licensing scheme so don't want users accessing from multiple machines?
Best you could do is a combination of cookie, ip address, user ID and date/time
_Maxxx_ at 13-May-13 2:57am View
   
If something like returning null is happening when you lose focus then something is wrong. My comment about rebuilding the data was not related to that - it's just that you need something to tell the child control "give me your data now" - and assuming on the child control there is a bunch of controls which the user has changed (textboxes or whatever) then the child control would have to build the object to return to the parent for it to save.
Of course you can have a write to database method in each UC - then all you need to do is to call that method on each of your child controls when the user clicks the save button on the parent control.
Personally I tend to keep any user controls small and low on functionality - so just capture the data and return it via a property. The Controller (in your case the parent control) then does the dirty work like saving it to the database.
There are arguments for doing it either way, though.
 
I was suggesting what you could do - it wasn't a synopsys.
 
_Maxxx_ at 13-May-13 0:57am View
   
What the heck software is this anyway?! ManCage?! :)
_Maxxx_ at 13-May-13 0:56am View
   
No worries. Ive looked at your code and am finding it difficult to follow what you're trying to do.
I THINK what you are asking for is simple - but I may be missing the point.
In UC2...UC99 have a public property that returns the data to be added/updated to the database.
Then in your update process you can call your WriteToDatabaseMCD() method passing that property as the parameter.
If necessary, the Getter of the property in UC2...UC99 will need to build your ManCageData object before returning it.
Another public property may be required for the IsUpdate parameter.
_Maxxx_ at 12-May-13 22:43pm View
   
No worries. It's a common mistake for new OO programmers (this isn't an XCode issue - it's normal practice for many OO languages, including Objective C).
 
An NSString is an object. So, when you have two objects, how can you compare them for equality?
 
If it was, say, a BaddySprite object in a game, or a CustomerObject in a business application, it is quite clear that saying if(object1 == object2) is open to interpretation - do we have two instances of the same baddy (or customer) or a single instance? Are they equal if their name property's match?
It is one of those things that is so easy to do wrong that, even now you know, I bet you do it wrong again (I know I still do)!
_Maxxx_ at 12-May-13 21:25pm View
   
When you say you are keeping the UCs loosely coupled - just how loose? i.e. do you have a reference to the Children in your parent?
If you do have a reference then there's no real difference between there being a user control on the other tabs and, say, a text box. When your parent saves, it needs to access the data from the child controls and save it too.
It's difficult to do step by step instructions without seeing what you've already done - because there are simply so many ways you may have implemented it already.
_Maxxx_ at 9-May-13 18:39pm View
   
Hope you will use "Bob's your uncle" in a conversation today! (Lucky I din't say "Robert's your father's brother - which is quite common as Bob's your uncle is so ubiquitous)
My ViewModels are in their own project, separate from the Views (which struck me as being the best way as it ensures separation - the views have a reference to the ViewModel project but not vice versa)
Originally my design time view models were in the view project - so moving them to their own project too seems to work quite well.
With my 'framework' I actually separate my ViewModels from ViewData (essentially the ViewModel has the functionality, and the viewmodel contains a viewdata object which is purely the data.
I'm not suggesting that's how you should go - but moving the viewModels into their own project is a sensible move I think
_Maxxx_ at 19-Apr-13 3:17am View
   
Deleted
a) try asking a proper question and b) do your own homework
_Maxxx_ at 19-Apr-13 0:33am View
   
What "answer"? The function manipulates the textbox and puts the results back in the textbox as far as I can see - so MessageBox.Show(TxtBoxInput.Text) would do what you ask - but I can't believe that's what you mean!
_Maxxx_ at 18-Apr-13 1:49am View
   
Are you serious? At leas tell someone what the freaking error is!!!!!!
_Maxxx_ at 18-Apr-13 1:48am View
   
You have my permission to do so.
_Maxxx_ at 16-Apr-13 2:27am View
   
What do you mean by "Smartcode"?
_Maxxx_ at 9-Apr-13 22:32pm View
   
Your code is bizarre - sorry, but it is. You are using .ToString all over the place when you are dealing with integers.
THen you have
If CalulateHeigestScoreArray(1).ToString = CalulateHeigestScoreArray(1).ToString
 
which is always true!
 
Essentially I think what you are asking is how to find tghe second highest value in a sorted integer array?
 
Well, if the array is 9 elements long, then the second highest (assuming it is sorted in ascending order) is the 8th element, which is at index 7 (assuming the array is zero based)
 
So second highest is in array(array.Count -2)
_Maxxx_ at 8-Apr-13 1:17am View
   
Seriously? What sort of an answer do you expect with this level of question?
If you have a particular query you need to speed up, then post it.
Or are you just wanting general advice on how to reduce processor usage when running queries?
_Maxxx_ at 27-Mar-13 2:50am View
   
Yes - and as I commented to the OP it would be a highly unlikely situation if you genuinely wanted a specific output order in an SQL table
_Maxxx_ at 27-Mar-13 2:49am View
   
Why? Not sure what you are getting at? Solution 2 does it without union but you said that 'he need result in 2 columns not single column output' My solution didn't have a single column output - I genuinely don't understand what you are saying"?
_Maxxx_ at 27-Mar-13 2:38am View
   
You seem to be mistaken over what UNION does - it does not reduce the output to a single column it joins together collections of rows.
_Maxxx_ at 27-Mar-13 1:58am View
   
Isn't 11:00:15 - 11:00:20 plus 11:00:40 - 11:00:45 only 10 seconds? Or are you looking for the difference between 11:00:20 and 11:00:40?
_Maxxx_ at 27-Mar-13 1:08am View
   
Sure - and why would you want an sql server table to be sequenced exactly? That's why you have order by clauses!
 
You could simply write the query as a hard-coded insert row by row - the question is a nonsense really
 
If you needed the sequence to be the same you would probably have to write each select with an additional constraint - and have a select for each row - which again is nonsense.
_Maxxx_ at 27-Mar-13 0:48am View
   
Are you sure you have the 89-null rows correct ? (i.e. are you sure col1 isn't null and col2 89?)
_Maxxx_ at 22-Mar-13 2:55am View
   
I don't understand how you are swapping between modal forms - only one form can be modal at a time...
 
I suggest you post some code so we can see where you are going wrong.
_Maxxx_ at 22-Mar-13 2:17am View
   
delete from table where columname = value
 
will delete all records 'simultaneously' from table where the value of columname is equal to value
_Maxxx_ at 22-Mar-13 0:31am View
   
NO I can't send you a link or example - I don't have one and can only google as well as you.
 
I don't know what accsee database is - I assume you mean Access but if you expect to get any help from forums such as this you need to be much more accurate and also at least try something yourself - not just ask others to write stuff for you.
_Maxxx_ at 19-Mar-13 5:48am View
   
I don't understand? Did you follow the link? The manual shows you how to set up replication with MySQL. Try http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html as well. Just google MySql replication - there are pages and pages of help out there
_Maxxx_ at 19-Mar-13 5:07am View
   
I just sent you the link to the manual explaining exactly how to do replication with MySql - what don't you understand?
_Maxxx_ at 19-Mar-13 5:06am View
   
sorry - I think it's boolean in Postgres? so yes, I'm suggesting you see what happens if you tell the code it's a boolean even thought he column type is an integer.
_Maxxx_ at 19-Mar-13 5:05am View
   
How about trying some yourself then asking back here when you have problems - I'm not about to do your work for you!
_Maxxx_ at 19-Mar-13 1:30am View
   
doesn't look like there's a problem assuming all is spelled correctly - I'd take out the echo off and try it - then you can see any errors
 
(and put the pause after the move)
_Maxxx_ at 19-Mar-13 0:34am View
   
Your question isn't clear. You have added two columns (Period and Subject Name) but not populated them with any values - you need to explain better what you want to achieve
_Maxxx_ at 18-Mar-13 2:30am View
   
Do you mean radiobutton or do you mean checkbox? With a radiobutton, its very nature is that only onbe of a group is selected at any one time.
_Maxxx_ at 12-Mar-13 2:10am View
   
Seems obvious what the OP wants, to me. He wants to be able to globally remap keys in the Windows OS - so while his application is running, anyone pressing , say, the 'A' key in Notepad would see an 'X' being typed.
 
I don't have a solution though ;)
_Maxxx_ at 4-Mar-13 1:40am View
   
Yes - but the point is that i is a row counter and you were using it as a column index.
_Maxxx_ at 4-Mar-13 0:57am View
   
Me too - but not on me, and it was faster to google and cut and paste than anything else.
 
It's so rare I'm smart enough to answer a question I was quite please someone had asked something so basic ;)
_Maxxx_ at 25-Feb-13 20:35pm View
   
Seems others replied recently which popped it to the top of the list - I just felt like putting a different aspect to the answers which all seemed a little formal to me:)
_Maxxx_ at 20-Feb-13 22:14pm View
   
Do you want to Create a test to give to someone else, or to prepare to take the test yourself?
_Maxxx_ at 18-Feb-13 2:51am View
   
I am suggesting that as a way to learn how to write the function gernerically, rather than just have someone give you the code.
_Maxxx_ at 18-Feb-13 1:25am View
   
Just to confirm.
You want a list of the names of the tables that have a record with the value 'jquery' in the Name column?
Are these 58 tables the only tables, or if not can they be somehow identified (do all their names start with 'XXX' for example)
_Maxxx_ at 18-Feb-13 0:16am View
   
Great answer given the OP's original question!
_Maxxx_ at 14-Feb-13 6:02am View
   
You say you shouldn't be adding drums to the cymbals - then surely the answer is "then don't"
The way you are setting up our drum$ is that it is a collection that contain individual drums plus a collection of cymbals. M
_Maxxx_ at 8-Feb-13 5:41am View
   
Got an error back from CP when I posted the comment - tried to post as an answer, got an error, posted as comment, worked OK
_Maxxx_ at 8-Feb-13 5:38am View
   
My text was just an example(I said 'something like' ) typed on the fly - get the quotes right & I think you could pass one or more parameters in such a way as to inject sql
_Maxxx_ at 5-Feb-13 23:51pm View
   
Let us know how your homework goes!
_Maxxx_ at 31-Jan-13 0:26am View
   
No
_Maxxx_ at 31-Jan-13 0:26am View
   
Do you really mean you are inserting X - or are you updating a row with a new value of X.
If you are inserting a new row, do you mean you only want to insert the new row if the value of X is not equal to the previous row's X value? If so, what do you mean by 'previous row'? Is it the last row inserted by this user, by any user , with the next lowest key value?
explain more and I am sure someone can give you some SQL to point you in the right direction!
_Maxxx_ at 30-Jan-13 23:44pm View
   
You are an idiot
_Maxxx_ at 30-Jan-13 5:30am View
   
Do you mean that when you run the SP directly it doesn't update rows?
_Maxxx_ at 30-Jan-13 5:29am View
   
I'm not looking for help, the original poster is. "Tick" is an English word - look it up - and I fully understood what the OP meant - your comment was unhelpful and insulting - if you can't be helpful, don't post at all.
_Maxxx_ at 30-Jan-13 1:30am View
   
Your question doesn't make sense
_Maxxx_ at 30-Jan-13 1:22am View
   
You don't actually call a user control - do you mean you want to execute a method of a user control when you press a button on another user control? Or do you want to instantiate a user control when you press a button?
Perhaps if you explained a little about what you are trying to achieve?
_Maxxx_ at 30-Jan-13 0:38am View
   
You haven't given enough information for anyone to help very much with this - and you describe your required output but are asking bout writing to the database - you need to provide much more information, I think, in order for anyone to know what you need help with.
_Maxxx_ at 30-Jan-13 0:08am View
   
I think he is talking English - what language are you talking (Out language is Unicode???)
_Maxxx_ at 21-Jan-13 23:51pm View
   
Giving him a fish allows him to eat for another day - gives him longer to survive and hopefully thrive.
 
Telling him how he's doing it all wrong, should bloody learn to fish properly and then advising him to use golf clubs, a table leg or a hari net to do his fishing, isn't what was required here (IMHO)
 
And your arrogance in saying "not have to deal with continued questions here" is, I think, the sort of thing that puts people off using CP Q&A
_Maxxx_ at 21-Jan-13 22:54pm View
   
He got the sql from me - and yes, it is dreadful (but based up on his original sql that he was having trouble with)
Rather than suggesting a complete database redesign etc. I tried to help him with his immediate problem - maybe he had an existing DB with the tables he spoke of, maybe it was homework (I suspect so) but the sql was provided to the OP in the form he was writing SQL, in the hope of helping him solve his problem, rather than a bunch of advice on why he shouldn't be doing what he was doing in the first place.
_Maxxx_ at 21-Jan-13 22:49pm View
   
Yes - I assumed you'd want to match those and not only match exactly the words entered - without knowing the complete context, this may or not be what is required
_Maxxx_ at 21-Jan-13 22:41pm View
   
You haven't said what is wrong with the SQL given?
The first EXISTS should give orders with gizmos
The second should give those with gadgets
and the third (not exists) should give those that dont have lines that are neither gizmos nor gadgets
 
Is that now what you required?
_Maxxx_ at 21-Jan-13 22:38pm View
   
Options 6, 7 and 8 are horrible solutions relying on magic numbers which are exceedingly prone to blowing up in your face in the future. (e.g. what if you get more than 999 gizmos in case 7, what happens when you introduce Dumwhickeys, fandoogles etc. etc.
 
The op got that sql from a previous question where, I think, that sql answered the question - sure it is inefficient etc. but I don't think you really made an attempt to help with the sql
_Maxxx_ at 20-Jan-13 22:32pm View
   
Surely Gadgets and Gizmos and Neither gives you all orderitems - how can they be anything else?
_Maxxx_ at 30-Aug-12 3:02am View
   
You can convert it at http://www.developerfusion.com/tools/convert/vb-to-csharp/
_Maxxx_ at 13-Jun-12 18:55pm View
   
That's what I ended up having to do - not quite as simple as that in the 'real' situation, as the first row in the collection wasn't always detached - depending on circumstances - so I had to clone the row then add it (as you can't add a row that is attached to another table)
_Maxxx_ at 13-Jun-12 0:10am View
   
While ItemArray is a reference type, in fact assigning it causes the contents of the array to be assigned to the individual columns of the receiving row - it does NOT assign a reference to the dataRow.
You could think of it as having a setter that iterates 'value' and sets row.Item(i) for each element in the value array.
Jut to be sure I made the suggested change - no difference :(
_Maxxx_ at 13-Jun-12 0:05am View
   
It's the loop in the first three lines of code that doesn't loop - the function is just there to show what's in the List
I have output the count first - it is three, or two, or whatever.
I have commented everything out except for the loop itself - and it does not loop as expected.
"There is not enough information to answer more exactly" - I wish you would let me know what additional information I can give?
_Maxxx_ at 28-Feb-12 0:48am View
   
I'm not clear on 'where' you want to get the value from your combo into your class? Essentially, you probably need a property in the class that you set to the selected value, when the combo changes value.
_Maxxx_ at 27-Feb-12 22:48pm View
   
What does it do? Have you tried debugging the function to see where it fails?
_Maxxx_ at 17-Feb-12 0:22am View
   
You've posted this as a C# question but say you are new to javascript. Is this an ASP.Net page ? If so, are you using MVC or 'plain old' ASP.NET?
_Maxxx_ at 17-Feb-12 0:20am View
   
By writing some code? You give absolutely no clue as to what you are trying to do - many of the people responding to questions here are clever to the point of genius, but I don't think any of them are psychic.
try to give as much information as you can about what you are trying to do, and what you have tried; don't worry too much about your language, if English is a problem, use short sentences but the more (relevant) information you give, the more likely you are to receive some help.
_Maxxx_ at 14-Feb-12 23:44pm View
   
According to the docco[^], this event is only raised when one of the pager buttons is clicked...
_Maxxx_ at 14-Feb-12 23:31pm View
   
One person's attractive is another person's plain ugly - so you need to be more specific in what you are looking for; what was wrong, exactly, with the one's you have found through google?
_Maxxx_ at 7-Feb-12 17:20pm View
   
I haven't tried coalesce - I'm not interested in fixing the issue (I have fixed it) but working out why it is not working
_Maxxx_ at 2-Feb-12 23:36pm View
   
So the links under a post (here's one from the lounge)
Reply·Email·View Thread·Permalink·Bookmark | Edit·Delete
What does the 'Email' link do, exactly?
_Maxxx_ at 2-Feb-12 21:25pm View
   
You need to give a little more information. Like is this windows forms you're talking about? Are you using data binding for one or both tabs?
If the answer to both is Yes then just bind both to the same datasource
_Maxxx_ at 2-Feb-12 0:48am View
   
Its not clear what you are trying to do. Are you trying to save data to a word document? Are you trying to save the word docuement somewhere? What has having 2 forms got to do with the problem? Where is the save button?
_Maxxx_ at 27-Jan-12 1:06am View
   
I'm sorry, I really am failing to understand what you are trying to do here. It makes no sense to me.
_Maxxx_ at 25-Jan-12 18:59pm View
   
Sorry, I don't understand what you are trying to do.
Can you try to describe in simple sentences, step by step, what you want to see happen?
You seem to have introduced radio buttons and AddToList buttons- I don't know what they are meant to be used for.
If you describe step by step in simple senetences I may be able to understand the process you are trying to achieve - or at least ask sensible questions fro clarity
_Maxxx_ at 8-Sep-11 21:30pm View
   
If you want to pas multiple data items (be they integers, strings, arrays etc.) I would suggest having those items as properties of your 'Share' class. Instantiate the class in window1, and have a public property of type share in Window2.
That way you nicely encapsulate the data being shared into a single object, and avoid having many properties on which the communication between the windows depend.
_Maxxx_ at 1-Sep-11 18:34pm View
   
I don't see what the difference is, really. In fact I want to find the instance in the collection that is the same instance as my searchCustomer.
And my question isn't about the code, it is about how to debug effectively with collections
Cheerrs
_Maxxx_ at 1-Sep-11 18:31pm View
   
I like the Dump solution - I wonder if I could write a generic one where I could pass a collection and a property name... Hmm if I had more time I'd feel an article coming on!
Changing the display attribute isn't too bad, I admit, but I think I kinda felt there must be a built-in debugger tool, like a Generic Dump method. I guess attributing all objects would become habit, and defaulting to using their key values as the attribute fields would solve the issue 9 times out of 10
Oh - and thanks for actually answering the question, and not telling my why my code was wrong / could be improved!! :)
_Maxxx_ at 1-Sep-11 18:27pm View
   
Cheers John, but the code isn't the issue - I know it may be flawed - my point is I want a debugging strategy when things like this happen, so I can easily see what instances each of the members of my collection are. Maybe when I'd seen that, I would have found what was wrong.
Oh, and you're wrong - Is is telling me that both instances are the same instance (which, in the code I was looking at should have been the case) NOT that c is of type searchCustomer
_Maxxx_ at 1-Sep-11 5:31am View
   
Thanks - I just had a quick play - wasn't aware of that option, it could be useful
What I'd really like would be to be able to effectively apply that attribute to a class at run-time from within the debugger, so when I come across situations like this I don't have to stop the app, change code, and run again.
_Maxxx_ at 1-Sep-11 2:44am View
   
Yep - the reason for using that as an example was because the Is could be a problem - and so I want to check whether or not the object I am expecting to be in the collection really is in the collection, by looking at (for example) the customer ids in the collection in the debugger.
But it is just an example.
Equally as valid would have been if I had had where c.CustomerId = 27. If that isn't returning any found objects, then I want to look at my collection and determine if a) the object is genuinely not there, b) it is there, but the CustomerId isn't actually 27 or c) it is there, the CustomerId is 27 and there is something horribly wrong.
_Maxxx_ at 24-Aug-11 2:23am View
   
It's not clear what you are asking. You say the tables are created at "design time" - do you mean that you have created the tables through SQL Management Studio, or perhaps by running some "Create table" sql?
 
say the primary key value of a record in your MainTable is 123, so you have a record in table2 with a column MainTable1Key and a value of 123, and the same in table3
Then you should
Delete from table2 where Maintable1Key = 123
Delete from table2 where Maintable1Key = 123
Delete from Maintable where Key = 123
 
You asked "provide examples with screens or example site with screens"
which I completely don't understand?
_Maxxx_ at 16-Aug-11 5:37am View
   
yes http://ios.xamarin.com/Tutorials
_Maxxx_ at 5-Aug-11 8:50am View
   
No- he asks if it is possible to do the same thing in c# - presumably he means getting the correct date and time
_Maxxx_ at 5-Aug-11 0:27am View
   
I don't know what you mean? in the code you show, it appears you get the Id from a text box, and that it is zero when creating a new student - you pass that as a parameter to the stored proc.
If I am misunderstanding, maybe try rephrasing your question?
_Maxxx_ at 6-Jul-11 7:56am View
   
If you can't change the columns to acccept Null and you want to have a value that represents a null value, you have little choice but to use a 'magic' value for each field type that represents a Null value, then check for that in your code - so for int columns use -1, for exampel, for strings use an empty string (or "NULL") for dates use the minimum date value - more work in translating the magic values in your code - but nothing else you can do if you can't change the column properties
_Maxxx_ at 17-May-11 2:45am View
   
Oh well, it was worth a try!
Sorry I have no more suggestions :(
_Maxxx_ at 15-Mar-11 20:43pm View
   
IN your example, shouldn't green >= black, black >= yellow rather than the other way around?
Also your Key and Value column headings are reversed - which may cause confusion - the SortedList.Add method takes a Key followed by a Value.
_Maxxx_ at 20-Feb-11 19:22pm View
   
I think this does deserve a 1, frankly.
Passing a reference to a Form, and allowing the 2nd form to have public access to a control on that form, just ties the two together too tightly, requiring changes to both forms should anything change - for example if the list box becomes a grid.
Trying to keep individual classes somewhat self-contained is a good thing - and while your solution certainly works, with anything bigger than the simple 2 form scenario it can soon lead to all sorts of maintenance issues.
_Maxxx_ at 20-Feb-11 19:19pm View
   
This is a good way to do it assuming the button mentioned by the OP is on Form1 not on the MainForm
_Maxxx_ at 20-Feb-11 19:17pm View
   
While it is true that this will work, it's certainly not a good way of doing it - your 2 forms are now tightly coupled - any changes to one form will almost certainly require changes in the other. For example - if one of the text boxes changes to a drop-down then code in both forms will need to change.

Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid