Click here to Skip to main content

Comments by OriginalGriff (Top 200 by date)

OriginalGriff at 5 hrs ago View
   
And what documentation did you follow to learn about the checksum?
OriginalGriff at 10 hrs ago View
   
Not normally - unless the specific device sends NAK because it doesn't like some part of your message content - but that's rare.
 
Are you sure you are using the right checksum algorithm?
Byte-wise addition is a pretty poor sumcheck...XOR is a lot more common, followed by CRC-16 and so forth.
OriginalGriff at 12 hrs ago View
   
Use a byte.
That's all you need to do - don't use integers, just use bytes.
That will "throw away" the overflow and and leave you with the byte-wise sum of the values, as a byte which you can send directly.
OriginalGriff at yesterday View
   
Oops! I'm on the tablet so I copy'n'pasted.
Got the wrong one - oh well...
Have a good Christmas Bill!
OriginalGriff at yesterday View
   
"it not working" tells us very little.
What is it doing that you didn't expect, or not doing that you did?
 

Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at yesterday View
   
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.
OriginalGriff at yesterday View
   
You do realise that this is extremely dangerous?
You are going to have to provide some library functions (or they can't even use printf) but what if they start using IO functions like "remove" and specify your website files? Or start using your email system to send spam, or...
 
There are a lot of dangers here, and if you don't know what you are doing then I suspect you are going to leave yourself wide open to a lot of them. I'd think very, very carefully before I did anything like this project.
OriginalGriff at yesterday View
   
Try using the full name in the method declaration:
 
public static object ConnectionForReports(CrystalDecisions.CrystalReports.Engine.ReportDocument objReport)
 
It may be that you have another class somewhere called ReportDocument and the system is getting confused.
OriginalGriff at yesterday View
   
I'd agree - but it's too short for the system to accept! :laugh:
OriginalGriff at yesterday View
   
Be glad your link was removed.
You were but a hair away from a "spammer" report, given the link address...
OriginalGriff at yesterday View
   
Seriously, you need to find the info - we have no idea what the API is so we would have to guess as to the data format returned: the info you show gives us teh X and Y dimensions, but is that in pixels? Bytes? Words? And if it's pixels, how many bpp are there? Is there an Alpha channel? Is the data in Y rows of X columns (as bitmaps are)? Is there any "packing data" at the end of a row? Is there any palette info?
 
They only way to find this is to locate the manufacturers, and start looking at the API documentation - sorry!
OriginalGriff at yesterday View
   
You method has a parameter called "objReport" yes?
You have said that it is of datatype "object" yes?
 
The object class has very few properties, and none of them are called "Database".
 
You need to cast it to the type of class that does have a Database property.
What class is that? I don't know - I can't see your screen. So you need to look at what you are passing to the method when you call it, and that might give you a clue. I can't do that for you!
OriginalGriff at 2 days ago View
   
Yes - the Windows API is basically just a set of DLLs (OK, a big set!) containing functions, structures, and suchlike. Some parts are easier to manipulate, others are harder - but you can use it all.
OriginalGriff at 2 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 2 days ago View
   
You can do most (if not all) of that with C# as well via DLLImport...Global hooks are a PITA (but fair's fair, they are a PITA in C++ as well - just a little easier to work with)
OriginalGriff at 2 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 2 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So, we have no idea what the error is, what you code is doing, how it is doing it, what it is supposed to do, why you think it's an error...
Use the "Improve question" widget to edit your question and provide better information.
 
And all that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
OriginalGriff at 2 days ago View
   
I added the first three words because it looked too short... :-O
OriginalGriff at 2 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 2 days ago View
   
Counts as a repost: If you want to add information to an existing question do so - you know how since you have modified this one.
But this isn't a question: so I deleted it.
OriginalGriff at 3 days ago View
   
You're welcome!
Have a good time!
OriginalGriff at 3 days ago View
   
Yes, but since we can't see your screen, we have no idea what you are doing to try and run LC.EXE...
OriginalGriff at 3 days ago View
   
I assumed you would know if you wanted it ON or OFF:
http://technet.microsoft.com/en-us/library/aa259221(v=sql.80).aspx
OriginalGriff at 3 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps the relevant code fragment would help?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 3 days ago View
   
Are you catching custom errors and redirecting them all to an error page?
If you are and it isn't working, you need to look at either using a try...catch in your C# / VB code round the request, or using HTML encode to convert them to "normal" data.
OriginalGriff at 3 days ago View
   
And?
What have you tried?
Where are you stuck?
What help do you need?
OriginalGriff at 3 days ago View
   
You're welcome!
OriginalGriff at 4 days ago View
   
Mid would do both:
http://www.w3schools.com/vbscript/func_mid.asp
Or there are Left and Right which do, well, exactly what you expect :laugh:
http://www.w3schools.com/vbscript/vbscript_ref_functions.asp
OriginalGriff at 4 days ago View
   
It's pretty simple: all you need are two substrings each time.
substring1 is the data up to (but not including) the index of the match.
substring2 is the data from (the index plus the length of the match) to the end of the data.
Then the becomes substring1 plus the new data including the number plus substring2
 
As I say, I haven't used VBScript in a long time, but it's only three lines of code per match! :laugh:
What did you try?
OriginalGriff at 4 days ago View
   
And?
Without the relevant code fragment (and having some idea what is on line 19 of New.asp would help) there is nothing we can do...
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 4 days ago View
   
No - that's 7-11!
OriginalGriff at 4 days ago View
   
It's my love, my own, my precious...
OriginalGriff at 4 days ago View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps the relevant code fragment would help us understand what you are doing, and why it is causing a problem?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 4 days ago View
   
Seriously, find the time: "pick it up as you go" works, to an extent, but it also creates a huge number of problems because you aren't aware of what you don't know! And that means you miss out on whole concepts which make your code better, easier to write, and more maintainable.
Pick a book, and work through it from cover to cover, doing all the exercises (even the really easy ones) - that way you get all the info, presented in a consistent and logical way.
 
The one I started with was:
http://www.amazon.co.uk/Pro-NET-Framework-Experts-Voice/dp/1430242337
(Well, I started with it when it was "Pro C# 2008...", but they update it each release).
It's good - as are many of the Addison Wesley books covering the same subject.
Just avoid anything with "in xxx days", "for dummies", or multiple exclamation marks in the title! :laugh:
OriginalGriff at 4 days ago View
   
I have formatted that for you, but...it's still a code dump. It doesn't have a question. And it uses goto - which in a student exercise is like waving a big flag over your head which reads "I know absolutely nothing and don't want to learn"
 
Use the "Improve question" widget to edit your question, cut that down to just the relevant bit that you are having problems with, get rid of the gotos, and explain what problem you are having.
OriginalGriff at 5 days ago View
   
You're welcome!
OriginalGriff at 5 days ago View
   
Because it's Christmas? :laugh:
OriginalGriff at 5 days ago View
   
Regex - could be good news.
I don't use VBScript any more (and it's a long time since I did) but "modern" Regex processing allows for a MatchEvaluator method to be called - which will let you replace the matched text with a variable string - but a quick check of VBScript Regex doesn't appear to include that.
It does however have an Execute method
http://msdn.microsoft.com/en-us/library/yfy6y4h1(v=vs.84).aspx
which returns a collection of matches - each match describes the start index and length of the match: which means that if you use a loop to process them, you can use substring to "break" your input around the text and insert your new stuff, allowing a variable replacement string including your number. (If you work from the end of the collection to the start it'll be easier, because you aren't changing the offsets for teh other ones).
 
See what I mean?
OriginalGriff at 5 days ago View
   
It was damn good in it's time, yes...but we though that about Mullets, and flairs, and the Bay City Rollers...
 
OK, scratch the last one. *Nobody* over the age of ten thought they were any good. :laugh:
OriginalGriff at 5 days ago View
   
So how are you doing the replace? string.Replace? Regex? IndexOf and Substring?
Or something else?
OriginalGriff at 5 days ago View
   
Trust me on this: it's the best development environment known to developers. Bar none. When you have to work in anything else after VS, you will hate it!
 
And the Express versions are free - and cover 90% of what the paid versions do :OMG:
OriginalGriff at 5 days ago View
   
Um...isn't that 20 years old?
Does it still run on modern computers? :laugh:
 
OK - do you have any idea what your course is going to use? Because there is a good chance it won't be that old...
 
Get a copy of Visual Studio (Express for C++ should do fine, and it's free from Microsoft) and I'll show you how to get it working with "just C" rather than C++.
(if you get VS2010 Express it'll be easier - I use 2010 Professional as I'm skipping at least one version this time)
You can download it here:
http://www.visualstudio.com/en-us/downloads#d-2010-express
OriginalGriff at 5 days ago View
   
And BTW: Is there a good reason why you are starting with C?
C# is a lot easier to get the hang of in many ways...
OriginalGriff at 5 days ago View
   
"btw i don't even know what a debugger is"
 
OK - that we have to fix! :laugh:
A debugger is a way to run your program so that you can stop it when you want, and look at what variables are doing.
So what are you using to compile and run this? Hopefully, it's Visual Studio (and if it isn't, then is there a reason why you are using what you are?)
OriginalGriff at 5 days ago View
   
Yes: if I change exp to a float, or change the format string to "%f,%d". Both ways I get "2,3" giving "8.0000000" which is what I expect.
 
So what do you get in num and exp?
OriginalGriff at 5 days ago View
   
And what happens when you use the debugger?
Because when I fix the format / variable type problem, "2,3" gives me "8.0000000" which is what I expect.
 
Please, try the debugger - it lets you see exactly what you code is doing - input, output, and what path the code is taking. It's a skill - and you don't develop it by getting others to fix problems! :laugh:
I'll help you look at it, but you so need to do most of the work. ;)
 
So make a note of your input, check the values in the num and exp variables are correct, and follow the code through. At what point does it get the wrong value, and where?
OriginalGriff at 5 days ago View
   
You're welcome!
 
Out of interest are you following a book, or on a course?
OriginalGriff at 5 days ago View
   
Reason for my vote of 1 \n Reason for my vote of one: plagiarised: http://www.scribd.com/doc/239760877/Limiting-a-Report-to-a-Date-Range
OriginalGriff at 5 days ago View
   
Repost: deleted.
OriginalGriff at 5 days ago View
   
Use a query which returns the number of entries with that name:
SELECT COUNT(*) FROM...
Return the count as an integer using ExecuteScalar and check it. If it is zero, you need an INSERT. If it's one, you need an UPDATE. If it isn't either of those, you have a database problem...
OriginalGriff at 5 days ago View
   
No - it's his homework and this is the second (or possibly third) time he has posted it today...
OriginalGriff at 5 days ago View
   
How are you doing the find and replace at the moment?
OriginalGriff at 5 days ago View
   
Pretty much exactly! :thumbsup:
The only differences I might make is to save the folder path for later, and hold just the files from the one folder in the folder (and consider having a list of folder instances to hold the sub-folders and their files - but that might be the advanced course :laugh:)
 
If you think about it, a folder that has no path isn't a folder - so there is no point in having a default constructor (one that takes no parameters). So passing a path to the constructor makes a lot of sense.
 
I'd probably add an optional bool parameter to prevent file loading if for some reasons I didn't want to read them yet:
public folder(string myPath, bool loadFiles = true)
{
if (loadFiles)
{
string[] FileArray = Directory.GetFiles(myPath, "*.*", SearchOption.AllDirectories);
...
OriginalGriff at 19-Dec-14 11:45am View
   
Don't even think about trying to validate dates with a regex: it's not a good idea at all. Think about it: if "31-01-2001" is valid, how do you write a regex that says "31-02-2001" isn't?
OriginalGriff at 19-Dec-14 11:12am View
   
Answer updated.
OriginalGriff at 19-Dec-14 5:13am View
   
Right! OK, yes - that's a little more complex, but not a lot.
Answer updated
OriginalGriff at 19-Dec-14 4:40am View
   
Replace the "4" with "\d+" in the regex string and give it a try...
If you want to keep the number in your result, that can be done too - but I need to know exactly what you want as output.
OriginalGriff at 19-Dec-14 4:29am View
   
Sorry, I don't understand what you are asking? Can you explain in better detail, perhaps with an example?
OriginalGriff at 19-Dec-14 4:22am View
   
Without seeing your code, it's difficult to tell - but it sound like you have kept most of your existing stuff and just replaced the tuple. Would you mind postign teh code, so I can see it before I comment?
OriginalGriff at 19-Dec-14 4:13am View
   
Yes? So use "\d" instead of "4" - it matches any single digit.
Or "\d+" if you want "one or more digit"
OriginalGriff at 18-Dec-14 7:44am View
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
OriginalGriff at 17-Dec-14 14:00pm View
   
No - if you can do it in SSMS then do: that's why I said "Use SSMS, or see..." in the message above.
OriginalGriff at 17-Dec-14 12:53pm View
   
Use SSMS, or see here if you want to do it in code: http://msdn.microsoft.com/en-us/library/ms176061.aspx
OriginalGriff at 17-Dec-14 12:00pm View
   
Explain which bit?
OriginalGriff at 17-Dec-14 7:39am View
   
And what part of it did you not understand?
OriginalGriff at 17-Dec-14 7:29am View
   
Did you read any of what I wrote?
OriginalGriff at 17-Dec-14 7:25am View
   
Well, you could start not using "Magic Numbers"...
This is going to depend on where you are doing what: where is the code above, and where do you load the DataGridView?
OriginalGriff at 17-Dec-14 5:48am View
   
Well, it probably does: it adds a bunch of strings to the listview, which it will display - as strings.
 
So if it doesn't add anything you need to use the debugger to see exactly what the array of paths contains once GetFiles returns, or change your code to display images...
OriginalGriff at 17-Dec-14 4:42am View
   
You're welcome!
OriginalGriff at 16-Dec-14 14:41pm View
   
Yes, just handle the Double click event on the cell, (or picture box if you are going to use those) and pass the path to the file to Process.Start
OriginalGriff at 16-Dec-14 14:12pm View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And frankly, I can't tell what the heck you are trying to do, even slightly. I've just read it again, and nope, not a clue.
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 16-Dec-14 14:01pm View
   
I've never tried - and all the documentation I've seen is clearly peppered with "ASP.NET" references. Since it's integrated with IIS, I suspect it might be a little difficult to use - it's going to want to use Session and suchlike I suspect.
OriginalGriff at 16-Dec-14 11:03am View
   
You're welcome!
OriginalGriff at 16-Dec-14 7:45am View
   
You're welcome!
OriginalGriff at 16-Dec-14 7:09am View
   
Yes - but it may not always give you what you want.
ToString will always return a string (unless the value is null, in which case you will get an exception and your app will crash) - but for some types it returns the type name instead of a human readable content: for example byte[] is one that catches a lot of people when they try to save images to databases. Using ToString on a byte[] does not return the array content, but "System.Byte[]" which is really useless later!
 
Casting is generally better because it tells you when there is a problem by throwing a cast exception so you know there has been a problem.
OriginalGriff at 16-Dec-14 6:03am View
   
What have you tried?
Where are you stuck?
What help do you need?
OriginalGriff at 16-Dec-14 3:42am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 15-Dec-14 14:13pm View
   
I haven't got a clue! :laugh:
it's been 20+ years since I least read a "C" book on anything!
OriginalGriff at 15-Dec-14 11:40am View
   
You don't know how to iterate a collection?
foreach (Control c in Controls)
OriginalGriff at 15-Dec-14 6:57am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 15-Dec-14 4:58am View
   
And while you are about it, could you also try explaining what you want rather more clearly - we can't see your screen, or read your mind!
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 14-Dec-14 6:13am View
   
And?
What does it do that you didn't expect, or not do that you did?
What help do you need?
OriginalGriff at 14-Dec-14 4:52am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 14-Dec-14 3:53am View
   
Why would you want the user to log in for a greetings card editor?
Are these particularly secure greetings? :laugh:
 
Yes it's possible - just convert it to HTML and send it as an email body - but be aware that many email systems (Outlook for example) don't show images by default...
And printing is also easy: look at the PrintDocument class.
OriginalGriff at 13-Dec-14 13:29pm View
   
Clearly, you are using a poor compiler...:laugh:
OriginalGriff at 13-Dec-14 11:57am View
   
You can login to winforms app: I have a password locker app that requires a login for example.
OriginalGriff at 13-Dec-14 9:49am View
   
No.
Assigning a value to a pointer does not, on it's own, allocate any memory.
You allocate memory, you need "new" or "malloc"
OriginalGriff at 13-Dec-14 5:42am View
   
That was last April!
Are you re-running "The Best of OriginalGriff" or something? :laugh:
OriginalGriff at 13-Dec-14 5:16am View
   
And?
What have you tried?
Where are you stuck?
OriginalGriff at 12-Dec-14 12:01pm View
   
And what have you done so far?
Where are you stuck?
What help do you need?
And why do you think "it can't be done in VB"? If it can be done in C# (and it can) it can be done in VB: they both compile to the same IL...
OriginalGriff at 12-Dec-14 11:13am View
   
If you want people to look at images on google docs, then you need to give them permission... :sigh:
 
Don't post image links (particularly ones nobody but you can look at). Instead, edit your question and demonstrate the text you want to see.
If you use the "code" widget above the edit textbox, it will preserve any formatting for you.
Don't be lazy, make it easy for us to help you!
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 12-Dec-14 10:14am View
   
You're welcome!
OriginalGriff at 11-Dec-14 14:08pm View
   
So don't make them static. Make them class level members of a "MyListener" class and create them when you do the MyListener constructor. Then each time you want a Listener, you create new instances and they don't mess about with each other. That way, the data for one client remains with the client - and if you want to share data between clients, then you pass a request back to whatever created the clients in the first place, and it handles the transfer. Clients shouldn't know about other clients unless they explicitly create them.
OriginalGriff at 11-Dec-14 10:02am View
   
Repost: deleted.
OriginalGriff at 11-Dec-14 6:44am View
   
What LED light? What ROM power? Why would it be connected to the parallel port?
 
I can't see your desk! :laugh:
OriginalGriff at 11-Dec-14 6:22am View
   
And how much of it did you actually read?
OriginalGriff at 11-Dec-14 6:13am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
"i want run application in local host lie web application" still doesn't tell us anything much: please try to explain exactly what you are trying to do, as if we were several thousand kilometres away, and don't know what your project involves at all...
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 11-Dec-14 6:10am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So quite what the ROM LED is, or how you detect the power is on or off, I have no idea.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 11-Dec-14 6:08am View
   
You're welcome!
OriginalGriff at 11-Dec-14 4:53am View
   
Answer updated.
OriginalGriff at 10-Dec-14 14:06pm View
   
We aren't going to wade through that lot looking for liens that *might* cause your error - we all have better things to do than that, given that we are not paid for this service.
 
So edit your question, remove the code, and post only the relevant code fragment - the line causing the error plus a small number of lines either side for context. You can find out which line it was very easily - the debugger will stop on the line.
 
Make it easy for us to help you, and we will see what we can do - but I for one am not going to waste my time wading through a badly written, uncommented code dump looking for the one line that you might have noticed to cause a problem. Would you?
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 10-Dec-14 9:28am View
   
You're welcome!
If you think about it, it's the only thing that *can* happen: if an error occurs on the thread, it can't continue - so there is no point at all in starting a new thread! :laugh:
Imaging if you divide by zero - the thread that did the division can't do anything useful with the result.
OriginalGriff at 10-Dec-14 7:34am View
   
And?
What have you tried?
Where are you stuck?
What help do you need?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 10-Dec-14 5:18am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And there are so vary many different things you could be trying to do...
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 10-Dec-14 5:16am View
   
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.
OriginalGriff at 10-Dec-14 4:24am View
   
No, DisplayRectangle.Height is in *pixels* not in *rows*.
But the FirstDisplayedScrollingRowIndex is in rows not pixels - and since there are 20 or 25 pixels to a DGV row... :laugh:
You need the number of rows in the DGV (which will depend on your source), not the pixel height.
OriginalGriff at 9-Dec-14 12:02pm View
   
And?
What have you tried?
Where are you stuck?
What help do you need?
And what is a "dont tap the tiles" game?
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 9-Dec-14 11:13am View
   
And you did notice this is Javascript, and not C# I assume?
OriginalGriff at 9-Dec-14 10:45am View
   
Probably a lack of caffeine error...:laugh:
OriginalGriff at 9-Dec-14 10:45am View
   
Copy and paste from his original - fixed.
OriginalGriff at 9-Dec-14 8:48am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So try to describe what you have a present, and what you want it to do.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 9-Dec-14 3:49am View
   
And?
What have you tried?
Where are you stuck?
What help do you need?
OriginalGriff at 9-Dec-14 3:41am View
   
It's a pity we can't upvote comments.
***** is the best I can do.
OriginalGriff at 8-Dec-14 15:55pm View
   
When you get an event, the sender parameter holds the class instance that raised the event. In the case of a Control event handler, it's the instance of the control that the user interacted with. All you have to do is cast it to the appropriate Control class.
OriginalGriff at 8-Dec-14 15:39pm View
   
So use the sender parameter to identify the combobox that raided the event.
OriginalGriff at 8-Dec-14 14:03pm View
   
Welcome back 'Enery!
Good to know you are still around...
 
I'd suggest you post that as a solution, possibly with a list of links - it's teh best answer he's going to get.
OriginalGriff at 8-Dec-14 6:17am View
   
Really, you should be able to fix that yourself - it's a trivial scope problem - but I've fixed the answer.
OriginalGriff at 8-Dec-14 6:03am View
   
Eee! That was stooopid of me...fixed. :thumbsup:
OriginalGriff at 8-Dec-14 5:18am View
   
It's OK - I have a fully trained Attack Cat!
OriginalGriff at 8-Dec-14 5:08am View
   
Thanks! (Stoopid software... :laugh:)
OriginalGriff at 7-Dec-14 5:36am View
   
So what is in the database? Did you check?
OriginalGriff at 7-Dec-14 4:46am View
   
What have you tried?
Where are you stuck?
What help do you need?
OriginalGriff at 6-Dec-14 15:30pm View
   
And? Did you try it?
OriginalGriff at 6-Dec-14 13:43pm View
   
Don't give up!
It's not difficult, honest.
Think about it: the method you need to write is just a simple loop and a couple of tests.
OriginalGriff at 6-Dec-14 13:40pm View
   
It allows you to send a value through to SQL (or Access, or Oracle, or ...) Without conveying out to a string. Which means that it can't be used for SQL Injection, and can't be misinterpreted by the Database. The first parameter ties the value to the position in the SQL command string.
OriginalGriff at 6-Dec-14 12:25pm View
   
Should, be pretty much, with OleDb... Instead of SQL...
 
I copy 'n' pasted it from existing code, and forgot the Access part. :blush:
OriginalGriff at 6-Dec-14 11:55am View
   
"this code not working" is not a helpful error message.
What is it doing that you didn't expect, or not doing that you did?
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
 
And why are you doing that anyway (I have a horrible idea that I really hope is not what you are trying to do)
OriginalGriff at 6-Dec-14 11:53am View
   
Are you going to ask every single thing about how to do your homework in a different question?
OriginalGriff at 6-Dec-14 11:39am View
   
"is it to hard with my code?"
Yes. Well, no, it's not *hard*. It's just a huge amount of typing... Literally.
Look at the comment I made above: "you have to check all the possible combinations"
That means you have to write a complete "if" statement for each of the sections between the commas:
if ((A1.Text == A2.Text) && (A2.Text == A3.Text) && (A3.Text == A4.Text) && (!A1.Enabled))
there_is_a_winner = true;
else if ((A2.Text == A3.Text) && (A3.Text == A4.Text) && (A4.Text == A5.Text) && (!A2.Enabled))
there_is_a_winner = true;
...
There are four of those per row (and seven rows), then there are the verticals, and the diagonals - do you see what I mean? And it's horribly easy to make a mistake and makes your eyes water trying to find it... :laugh:
 
It really is simpler to do it the "proper" way, honest!
OriginalGriff at 6-Dec-14 9:55am View
   
You would think it was harder, wouldn't you? :laugh:
But that turns out not to be the case.
Think about it: how do you check if four items in a horizontal row are the same?
With your way, you have to check all the possible combinations:
A1+A2+A3+A4, A2+A3+A4+A5, A3+A4...
B1+B2+B3+B4, B2+...
C1...
And for verticals, again you have to specify each possible combination:
A1+B1+C1+D1, B1+C1+D1+...
A2+B2+...
...
And then you have to check the diagonals as well:
A1+B2+C3+D4, A2+B3+...
B1+C2+...
...
That's a lot of combinations! And if you want to expand this to "Match 5" or an 8 x 8 grid, you have a lot of work to do.
 
Writing a method which checks four "cells" given a start point, and X & Y offsets is pretty simple!
Then it works for whatever grid size you use, and it's trivial to make it match 5, or three instead of four.
And you just call that in a loop looking for a positive.
 
Try it: it really is easier than what you are doing - even if it seems like more work. (Trust me, I'm not a doctor - but I've done this kind of thing loads of times before)
OriginalGriff at 6-Dec-14 6:49am View
   
We can;t answer that - because we have no idea what your FleetNames class is all about, or what it contains. So we have no idea where the strings you want to return are coming from.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 6-Dec-14 5:51am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 6-Dec-14 5:45am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
The second query will nor produce anything like the first, and it's not at all obvious what you want to happen.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 5-Dec-14 9:47am View
   
No problem!
OriginalGriff at 5-Dec-14 7:17am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And what does it have to do with development?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 5-Dec-14 7:16am View
   
Repost: deleted.
OriginalGriff at 5-Dec-14 6:41am View
   
Regexes are language independent, so it doesn't matter if you use it in VB, C# or Javascript.
 
Or are you saying you don't know how to use a regex?
OriginalGriff at 5-Dec-14 6:25am View
   
You wrote the code, so you know what it does and how it does it.
You know the design pattern.
So what is the problem?
OriginalGriff at 5-Dec-14 5:47am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So what is that lump of SQL there for? What does it do that you didn't expect, or not do that you did? What help do you need?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 5-Dec-14 4:09am View
   
Couple of things:
1) Don't post your code as a "solution" - add it to the question instead. Adding a solution removes this from the "unanswered" queue and makes it less likely you will get a useful response.
2) Don't just post a code dump - it's meaningless to us without some description of what your problem actually is. We cannot work out from just that what you are trying to do, and ahwt part of it is giving you a problem.
Remember that we can't see your screen, access your HDD, or read your mind.
 
So edit your question, cut down the code to just the relevant bits, and explain in English what you are trying to do, what problem you are having, what you have tried, and what you need help with. Help us to help you!
 
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 5-Dec-14 4:06am View
   
Moved into "question" - deleted.
OriginalGriff at 5-Dec-14 3:34am View
   
BTW: I was going to improve your question by formatting the code with pre tags - but there is no indentation there in the first place!
Indent your code: and post it here indented and formatted. It makes it a lot easier for us to read, and that means a better answer. Except when it's your homework and you haven't done anything yourself, of course
OriginalGriff at 4-Dec-14 10:54am View
   
You're welcome!
OriginalGriff at 4-Dec-14 9:22am View
   
You're welcome!
OriginalGriff at 4-Dec-14 6:25am View
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
OriginalGriff at 4-Dec-14 6:24am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So if you have a problem, you have to explain it to us, without assuming any knowledge of your project.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 4-Dec-14 4:33am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
What part of "fish simulation" do you need help with?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 4-Dec-14 4:32am View
   
And?
Do you have a question? And if so, what is it?
What help do you need?
OriginalGriff at 4-Dec-14 3:48am View
   
Right - so check the file executes on it's own: browse to your applications folder and double click it. Does it work? If not, then the most likely reason is that it's missing essential DLL files that it expects to be in the same folder.
So look at the folder you got the file from: and run it there to check it works.
If it does, then copy files to your app folder until you find the ones you need.
Your app Process.Start should work then.
OriginalGriff at 4-Dec-14 2:38am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
We need to know what kind of DB you are looking at, what your tables look like - and what help you need to use it.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 3-Dec-14 14:26pm View
   
Haven't tried one in SqLite: but in this case string concatenation is safe anyway, since the IDs are all int.
OriginalGriff at 3-Dec-14 14:08pm View
   
Well, you already know how to sort a collection - you do it in your code.
And you know how to create a class - again, you do that in your code above.
 
So which bit is giving you problems?
OriginalGriff at 3-Dec-14 14:06pm View
   
WHERE IN works with SqLite:
http://www.tutorialspoint.com/sqlite/sqlite_where_clause.htm
OriginalGriff at 3-Dec-14 14:06pm View
   
WHERE...IN works in SQLIte:
 
string ids = string.Join(",", db.Values.Select(v => v.ToString()));
string sqlCommand = "DELETE FROM Person WHERE Id IN (" + ids + ")";
 
Under normal circumstances I wouldn't recommend concatenating strings to form SQL commands, but in this case since the source Id values are all integers, SQL injection isn't possible so it's allowed.
OriginalGriff at 3-Dec-14 12:37pm View
   
And it may be remaining null because he is swallowing any exceptions that occur around the assignment.
OriginalGriff at 3-Dec-14 12:35pm View
   
I missed that one! :blush:
OriginalGriff at 3-Dec-14 4:59am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 3-Dec-14 4:54am View
   
Repost - again - deleted.
Please stop posting the same question and read some of the previous answers you have received.
This is starting to look a lot like abuse...
OriginalGriff at 2-Dec-14 15:01pm View
   
For a loop that big, it may be worth some optimisation, but it depends on how likely it is that you will have errors!
If they aren't likely at all, then probably what you have is going to be pretty much optimal, but it's worth doing some timing tests with the release version (so it gets full optimisations) to see if my minor change is worth while - it's worth losing readability to save significant time over a large loop. But not for a loop that runs one in a blue moon and only processes a couple of dozen iterations!
OriginalGriff at 2-Dec-14 14:18pm View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 2-Dec-14 6:33am View
   
This is a repost of your question yesterday: I suggest you look at the answers you go to that.
Deleted.
OriginalGriff at 2-Dec-14 5:18am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
 
[edit]Where did that come from? Deleted...[/edit]
OriginalGriff at 2-Dec-14 4:50am View
   
You're welcome!
OriginalGriff at 1-Dec-14 14:12pm View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 1-Dec-14 11:21am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So what are you trying to do? What are you "clicking" with? What code are you using?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 1-Dec-14 5:28am View
   
Again: an old question, and a not very helpful response - better than the last one, but still not helpful considering the question is 4 years old and the OP has almost certainly forgotten he asked it by now...
OriginalGriff at 1-Dec-14 5:26am View
   
Reason for my vote of one: There is no point in digging up three-year-old questions and adding a generic and frankly not particularly helpful answer to it.
This isn't about debugging, it's about the stage before that: finding out if there are any bugs in the first place.
 
This kind of behaviour looks like a rep points hunt: which is a form of abuse and can result in your account here being closed. By all means answer questions, but the answers must be relevant, and they just be "I want points, and I don't care how" type answers. OK?
OriginalGriff at 1-Dec-14 4:37am View
   
Good! Well done!
Feel free to ask, but you learn a lot better if you at least try and do it yourself.
:thumbsup:
OriginalGriff at 1-Dec-14 3:38am View
   
No, it isn't.
Try compiling exactly what you have there: and look at the errors list...
 
And if you don't show us the actual code, we are working to "something like this" - which is like taking a different car to the garage and expecting them to fix the one you left at home. It's the same manufacturer, the same model - so what does it matter?
OriginalGriff at 30-Nov-14 9:04am View
   
You know me Peter! :laugh:
Always willing to help...
OriginalGriff at 30-Nov-14 7:08am View
   
Stop and think for a minute: we can't see your code.
So we have no idea how you are saving the data - and "random access file" and "in text file" doesn't help us. and "stored in multiple lines" tells us nothing either.
 
Take a step back from the problem, and try to forget everything you know about it and your solution. Now read the question again, and see if you can solve it - because we can't.
We need to know how you are saving the data: which means we need your code.
We need to know what you expected to get, and exactly what you did get - a sample of the data would help.
And we need to know what is wrong with what you do get - and how you "know" it's wrong, because we can't see what you do: we only get the word your write here to work from.
 
Would you expect a garage to be able to fix your car if you phone them, say "It don't work" and put the phone down? :laugh:
OriginalGriff at 30-Nov-14 7:02am View
   
No anger here!
Think about it - when you paste your code into a comment, it:
1) Doesn't get formatted - so it's hard to read.
2) Doesn't engage the "auto code highlighter" - so HTML codes get examined and (if possible) obeyed instead of displayed.
 
Just look at you first comment and you will see the results of that.
 
When you edit your question as I said in the first place these things do work: so we get to see your code in a formatted and readable format, with all HTML code readable instead of obeyed by the browser!
Now, if you want us to help you, we have to be able to see what your code actually looks like: because there are hundreds of different ways you *could* be doing something and without the code we can't tell which...
 
So chill out, stop seeing offence where there is none, and try to consider things from the POV of the person trying to answer the question? :laugh:
OriginalGriff at 30-Nov-14 6:00am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And that makes little sense at all at present!
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 30-Nov-14 5:54am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So what help do you need here?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 30-Nov-14 5:47am View
   
Now, what did I say about the "Improve question" widget?
dump that lot, edit your question and paste the code into that so it is in pre tags and is readable instead of partially obeyed but our browsers...
And add the c# side of things as well?
OriginalGriff at 30-Nov-14 5:23am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So instead of providing links to your site - which makes it look like spam - show us the code you use to generate the images.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 30-Nov-14 4:19am View
   
Double check: make sure it'e the right table name, make sure it's the right database, and check that it's the right name = no underscores, no spaces.
Because when I use that code with the correct values locally, it works!
OriginalGriff at 30-Nov-14 3:27am View
   
And what columns do you have in your "xyz" table?
OriginalGriff at 30-Nov-14 2:48am View
   
Your code is gettign messier, and messier - and harder to read - each time you post it.
Do yourself a favour, and us: remove all the commented out, redundant code (we don't need to see that) then make sure your code compiles cleanly, then press CTRL+M, CTRL+D
Visual studio will reformat your code according to your selected indentation options, making it a low easier to see what is going on.
Then do that every time before you post it here!
OriginalGriff at 30-Nov-14 2:44am View
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
OriginalGriff at 30-Nov-14 2:37am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 30-Nov-14 2:12am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps an example of what you are trying to do would help us?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 30-Nov-14 2:11am View
   
Don't bump your question. It's rude and doesn't help you get an answer - in fact quite the reverse, as it implies you think you are far more important than anybody else here and can annoy people.
Add useful information by all means, but just editing it top bring it back to the top of the list is not a good idea.
OriginalGriff at 29-Nov-14 11:42am View
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
OriginalGriff at 29-Nov-14 11:12am View
   
No problem!
OriginalGriff at 29-Nov-14 10:52am View
   
I haven't played with C profilers for so long that I can;t suggest anything - I can't even remember the ones I used (just that they were all universally useless for one reason or another, and finding that out always took at least twice as long as doing it manually!)
If you want to look, then Google should find you some.
OriginalGriff at 29-Nov-14 10:24am View
   
:thumbsup:
OriginalGriff at 29-Nov-14 10:24am View
   
Not really - because it isn't a "Line-but-line" thing: you need to start at a high level and decide which program "chunks" to check first - and then focus in on them. And don't forget, adding timing checks will slow your code down!
 
There are profiling tools, but they generally don't help much because they don't know what it important and what isn't in you application - so they tend to generate a lot of information and make it difficult to see what you need to see.
OriginalGriff at 29-Nov-14 8:20am View
   
Because your "if" text inside the loop explicitly doesn't add it for the first two values. So what do you think you need to change to what?
OriginalGriff at 29-Nov-14 8:17am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 29-Nov-14 6:50am View
   
Works fine - and in the email notification.
OriginalGriff at 29-Nov-14 6:19am View
   
"One small question: how you managed to show exponent that nice?"
HTML tag characters don't always work too well in comments, so...
 
less-than sup greater-than exponent value less-than /sup greater-than
 
x[sup]4[/sup]
OriginalGriff at 29-Nov-14 3:34am View
   
And did you try:
 
DateTime endTime = DateTime.Parse("2:00pm");
 
No?
OriginalGriff at 29-Nov-14 2:57am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps an example of your data, and the results you want might help?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff at 29-Nov-14 2:35am View
   
Reason for my vote of one: Stop bumping your question - it's rude and it doesn't help you. By all means add useful info to help us answer a question, but editing it to "pull" it to the top of the list is just arrogant and unnecessary.
It does annoy people - and it can prevent answers.
OriginalGriff at 28-Nov-14 14:15pm View
   
Answer updated.
OriginalGriff at 28-Nov-14 11:16am View
   
That isn't your code.
I can tell, because that won't compile:
 
string query = SELECT * FROM [ + TabName + ] ORDER BY + orderBy;
 
So either you abstracted it badly, or the version you are running is an old version which probably doesn't do the update code at all.
OriginalGriff at 28-Nov-14 11:10am View
   
Caching, probably - the rep history shows an upvote at 04:02pm
So it's at the hamsters end!
OriginalGriff at 28-Nov-14 10:43am View
   
Um...no, it doesn't:
000015.16
000015.16
OriginalGriff at 28-Nov-14 10:24am View
   
It seems like a good assumption! :laugh:

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