15,891,184 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by kmllev (Top 56 by date)
kmllev
28-Dec-16 1:48am
View
I was wishing to know how I could run an SQL query directly from a view.
kmllev
8-Dec-16 1:36am
View
I see. Even though I typed the correct password when trying to "log in", which is "hello", the hash returned is different after checking the $pass in password_hash(), so a successful login perhaps would never be possible. How can I fix it? Or should it be in a new post? All I do is get the input from the user and then fetch from the database the corresponding (hashed) password for that username and then use password_verify to see if they match. More like the question though is: why is hello being hashed when verified as a variable but not when it's explicitly typed?
kmllev
8-Dec-16 0:11am
View
The problem is isn't the method comparing exactly the same values? Basically I copied the value from the database and pasted it in the variable for debugging in the 1st block. In the 1st block I simply did an override of the values, to check if it's working correctly. The 2nd block of code fetches the corresponding hash from the database and returns the same hash/value as in the 1st block. What confuses me is why it returns false when the values aren't changed, as seen in the message the 2nd block returns.
Could it be I'm missing out on something since I'm fetching the value from the database? Some parsing needed?
kmllev
4-Oct-16 11:07am
View
I see. But how will I get the result or the return value of SOUNDEX and DIFFERENCE? I tried them in SQL Server and when they return the result there is no column name?
kmllev
4-Oct-16 1:57am
View
WOW.
I've never heard of this feature before, I'm extremely amazed, lol
But I wonder how I will be able to implement this in C#? How will I get the return value if there is no column name?
kmllev
4-Oct-16 1:40am
View
I will consider implementing the Autocomplete feature, thanks!
And about the panelist's question... We had to defend the system as it is a requirement for our college thesis. They were pretty insistent on that. How can we possibly argue against that? The 'inch' and 'innch' should be considered as duplicate values?
kmllev
4-Oct-16 0:51am
View
Somehow, removing the transaction block fixed it. I wonder why?
kmllev
4-Oct-16 0:51am
View
Somehow, removing the transaction block fixed it. I wonder why?
kmllev
13-May-16 8:23am
View
Thank you, I will keep those things in mind. :) I will accept Dave's solution for now. :)
kmllev
13-May-16 7:21am
View
To be honest, as of now I don't have a list yet of the specific requirements of the system since I will still have to meet with my advisers. It will however involve the basic functions of a common TPS: adding/deleting/editing data, viewing data, printing of reports, database management. There will be loads of data to be handled as this will be developed for business use. I am also planning to include an audit trail feature, so there's time-tracking involved.
kmllev
13-May-16 7:07am
View
Oh, I see. My bad. I'll move it. :)
kmllev
5-Oct-15 21:51pm
View
I can't believe this, no error was popping up so I didn't notice it, you're a lifesaver thank you!
kmllev
2-Oct-15 11:26am
View
Thank you!
kmllev
2-Oct-15 11:07am
View
What code could that possibly be? I tried to separate the query for update in a separate php file and then just set a header to redirect to the php file that will display things, but it's still not working?
kmllev
29-Jul-15 2:08am
View
So do you think I should just opt for another control, say, a ComboBox instead?
kmllev
9-Mar-15 8:39am
View
The reason why the combobox overlaps with the panel is because when the user clicks on a button, the panels are no longer necessary and they will disappear, and the combobox will take over, but to avoid having to set their location by code, I just put them on the desired locations and just made them invisible at first until they are needed.
kmllev
9-Mar-15 8:37am
View
I can't find the Document Outline. I'm using C# 2010 Express
kmllev
2-Oct-14 7:22am
View
Never mind, Dilan! I ran the debugger again and fixed the issues. Thank you so much! :) :)
kmllev
2-Oct-14 6:47am
View
Thank you for answering! However, when I runthe debugger and set a breakpoint at the first foreach loop, it doesn't run the code inside the loop. D:
kmllev
29-Sep-14 9:43am
View
Just what I've been looking for. You're the best, Bill, thank you!
kmllev
29-Sep-14 9:39am
View
I will post a separate question about that, perhaps when I've truly exhausted all of my capabilities and left with no choice but to ask for help from someone more knowledgeable in that matter, i.e. you and the rest of the programmers here. Thank you!
kmllev
29-Sep-14 6:46am
View
I'll try my best, Bill, but I really can't promise anything.
Yes, I am taking a class in school, but they only teach the fundamentals, and it's up to us to learn about the rest. We haven't done an in-depth discussion of the OOP concepts (and I don't think where going to), just an overview. I'd buy a book but I have limited budget as of the moment so it's not really an option.
Nevertheless, I'm still counting on that example! I'm pretty sure it'd help me give some ideas on how I can solve the problem with a better (and hopefully easier) approach.
kmllev
29-Sep-14 5:54am
View
Thank you, Bill!
Yes, I would greatly appreciate an example, as the one I have now confuses me (actually with the code above, I followed the pattern of the example I have, but admittedly I am confused by how some of its parts work).
And with the public utilizeLeaderboard, that's simply the constructor (as I have followed from the example I have).
And with regards to the ArrayList, thank you for that, I'm confident I will understand it much much better why I should opt for typed generic collections with the example you will give me.
kmllev
29-Sep-14 5:46am
View
Thank you!
I'm only beginning to learn C# so my instructor advised to use .txt files for now, until we get into the deeper parts of the language :)
kmllev
29-Sep-14 5:25am
View
I will look into that, thank you!
kmllev
28-Sep-14 3:37am
View
Thank you, Bill! Actually I am a little embarrassed right now, realizing it IS easy to find the answers myself, just that I didn't have the right keywords back then. Thank you!
kmllev
27-Sep-14 10:21am
View
I have .txt file ready, just waiting for scores to be written on it.
I have done it before like this (in the .txt document):
John 25
Peter 20
Warren 23
I've tried looking around again and I have a slight idea of one possible way to do it: StreamReader/Writer? But with Java, I didn't have much difficulty reading the string and int values because Java has methods for that, but based on what I've been reading so far, it'd be quite a difficult task to achieve in C#.
P.S. I don't really need to create the .txt file from code, I'd just need to load it or read its content then after sorting out the scores, append them to the .txt file.
kmllev
21-Sep-14 11:14am
View
WOW. Thank you, Bill for being so helpful, patient, and elaborate! This DOES clear up a lot of the cobwebs in my head. Thank you. I'm good with gameOver(). Hopefully, when more questions start to pile up, you'll be available to help. Thanks again, Bill!
kmllev
21-Sep-14 10:16am
View
Hello, Bill! Thank you for your time and help. I've been doing test runs, and I decided that I'd really need that MouseMove implementation, since I never realized until just then that the user can drag back and forth (if he realizes he dragged in the wrong direction) without unclicking, and that can be considered a fault, right? However, I'm not sure what would be the best approach for that.
I suppose I'd need to monitor every move now, be more restrictive, so that if the user drags to the wrong direction, he won't have a chance to drag it back to the correct one.
"Out of bounds" would be simply dragging from any location outside the PictureBox. Or if by "out of bounds" you somehow meant an invalid move, then 1) dragging outside the PictureBox 2) dragging in the wrong direction (which is the thing about which I'm trying to be as specific as possible in my program)
I hope I explained clearly enough. :)
kmllev
21-Sep-14 5:16am
View
I put it as one of the mechanics to swipe inside the arrow. If they do it outside, they don't really lose, just that it doesn't add any point. :)
I'm simply in a state of deliberation right now. For example, the arrow is horizontal, to the right. If I drag vertically and slightly to the right, as if I'm starting to form an "x", it adds a point. Should I consider that a good move? Or not?
I implemented MouseUp and MouseDown to detect the directions ( if oldX > newX, then to the right, so on and so forth). I'm just unsure if even if the move was majorly vertical but moves to the right, it should still add a point or not, as what I have stated above.
I created a (.png) file for the arrows, and loaded them in the PictureBox.
kmllev
10-Sep-14 6:03am
View
Thank you for your time and help! Much appreciated. :)
kmllev
10-Sep-14 6:01am
View
Yes, something like that, at least to maintain the exact number of the item being looked for (to make it harder for the player to locate them).
If I do post another question regarding that, can I notify you about it? :)
And yes, I will. :)
Thanks, Bill! (I barely come across people who are nice to beginners, and people here are so nice)
kmllev
9-Sep-14 18:06pm
View
Okay, I'll try my best. I'm not really good at this.
So it's a hidden object game of sorts. The game has a timer. At the beginning of the game, 63 buttons will be put on the grid, and also a random problem will be created.
Like for example: Look for 5 apples. That's the problem I'm referring to. Look for 5 apples in the grid. Somehow like this: http://goo.gl/tQhKuS and by random, for example, the program will ask you to look for 3 eggs among those items.
If you click on the wrong item, like for example, you clicked on a shoe when the problem said apples, then the button won't disappear, but 2 seconds will be deducted. If you click on an apple, it will disappear, so if the problem now is Apple (4x), then just randomly select another item to fill up the location of that previous button. But if the problem is already finished, you've looked for 5 apples, then of course, the program will create a new random problem.
Suppose the new problem is look for 2 donuts. But since mostly the happenings in the game are random, chances are, when the game was filling up the locations of the correctly clicked buttons in the previous apple problem, it might have already created 3 donuts. If that's the case, then of course, the program shouldn't generate more donuts for the problem, and just choose another random item to fill the location of the previously & correctly clicked button in the apple problem, or specifically, the last or 5th apple clicked.
Also, to confuse the player a little, the buttons shuffle every second.
If you need to see the "logic" of sorts I'm working on, let me know.
kmllev
9-Sep-14 8:26am
View
Thank you, George! I know, even now that I'm looking at the code I've posted here, I'm confused myself. But I started over and now it's working fine so far, but I'll still need to add a few more control structures. But thank you still for this.
My game is actually a hidden object game of sorts, where a problem will be posed, like look for 10 apples in the grid. :)
kmllev
9-Sep-14 8:15am
View
Thank you so much, Bill! Actually, yes, I'm using the TableLayoutControl, it makes things a lot easier.
And yes, I did start over, and it's working fine so far, but I will still need to add the check to make sure that there is only an exact number or not too many of the item being looked for. Like for example, you've solved the previous problem. The new problem is to look for 5 apples, if there are 7 apples already in the grid, then just choose another random item to create to fill up the space of the previously clicked button, if you get what I mean? And not create 5 more apples. And it's possible since every time an item disappears after being clicked because it's the correct item being looked for, a random one will replace it if the problem is not yet finished (I think I sounded pretty redundant there). Like again, for example, you're asked to look for 5 apples. You click on one in the grid, and then it's going to be replaced by another item, of course, and it goes on like that. Chances are, by random, in the previous problems, you've generated 5 donuts, but you're going to be asked only for 2 in the following problems.
I can't seem to think of a way to do this without the endless recursion :/
I'm just going to probably post that as a new question with my new code. Thank you so much for your help!
kmllev
9-Sep-14 8:05am
View
Thank you for your help! Actually it's a hidden object game of sorts, where the program will ask you to look for something in the grid. :) Like for example, look for 5 apples, etc.
I started over and so far it's working, but I still have to work on how there should only be an exact or a not too big number of the item being asked for in the grid, and I can't seem to do that without the endless recursion
kmllev
6-Sep-14 22:29pm
View
Thank you for this, I realized the error. What do you suggest I do to fix it? I'm thinking right now of storing the indices of the rows and cols in 2 arrays, shuffle the arrays, and just take the values from there. At least, for the beginning of the game.
kmllev
6-Sep-14 19:35pm
View
Hello, I have updated my code. I still get the StackOverFlowException but I just can't seem to find the reason why. Would you mind looking over my code again? I know it's logically wrong but it still seems to make sense to me, which it shouldn't
kmllev
6-Sep-14 19:32pm
View
Actually I'm not sure how I will do that because my goal in that part of the code is if the position is already occupied, then generate new random numbers again and return to the begnning of the method to go through the conditions again.
totalButtons counts the number of already created buttons (all of them, regardless of the type of item)
kmllev
6-Sep-14 12:09pm
View
Can I get back to you sir? I'm currently trying to fix my code; I think I'm getting to the real error, if I still need help I'll go back right here, thank you!
kmllev
6-Sep-14 11:24am
View
You're right about the part where I update it in two places, my bad! Must have overlooked it while I was editing my code.
I know, 63 buttons, that's a lot of buttons, but it's a 7x9 grid that must be filled, so I'm not really sure how to proceed without blowing the call stack or memory.
And I just fixed the update so it only updates in one place now, and it's frozen still :/
kmllev
31-Aug-14 0:32am
View
I can't believe it's that simple. Gah I complicate things a lot. Thank you!!!
kmllev
30-Aug-14 22:50pm
View
That's the problem, I'm just beginning to learn C# and I can't seem to find what's wrong.
kmllev
30-Aug-14 22:33pm
View
Yes, and I've tried it, but for some reason, when I type f1.startTimer(); I get an error saying 'System.Windows.Forms.Form' does not contain a definition for 'startTimer' and no extension method 'startTimer' ......
kmllev
30-Aug-14 11:01am
View
That did it! Thank you! I never came across this solution while looking at the other similar problems, or I just probably wasn't looking that thoroughly. Gonna do some quick reading on this one, thanks.
kmllev
30-Aug-14 10:57am
View
Where am I going to place the part where you're creating the child form?
I placed it in the constructor in the main form (FormA forma = new FormA(); ........) but still the application doesn't exit, only closes. Am I wrong with coding the instantiating part?
FormA by the way is the third form that pops up after a click event on second form, main form counted as the first
kmllev
30-Aug-14 10:36am
View
Oh wait wait, I ran it several times and just noticed that the application doesn't exit when you click on Yes? It closes yes, but it doesn't exit.
kmllev
30-Aug-14 10:36am
View
Oh wait wait, I ran it several times and just noticed that the application doesn't exit when you click on Yes? It closes yes, but it doesn't exit.
kmllev
30-Aug-14 10:31am
View
Yeah sorry I tried it again and it's working correctly now, thank you so much!
kmllev
30-Aug-14 10:31am
View
Thank you for your help, I've fixed it now. I just needed to get rid of the if (closing == DialogResult.Yes). I'm such a newbie. Thank you!
kmllev
30-Aug-14 10:08am
View
Deleted
Thank you! It solved the issue with the No button not functioning, but I'm stuck with the prompt appearing AGAIN when you click on Yes, so if you really want to exit, you have to click Yes twice.
kmllev
30-Aug-14 10:08am
View
Thank you! It solved the issue with the No button not functioning, but I'm stuck with the prompt appearing AGAIN when you click on Yes, so if you really want to exit, you have to click Yes twice.
kmllev
28-Aug-14 5:21am
View
Thank you! That does make things a lot clearer. Referencing was never mentioned to us so I'm glad I came across this. Thanks!
kmllev
27-Aug-14 5:26am
View
Yes, yes, thank you! I've also looked for more examples, and I get it now. Thanks for the help!
kmllev
27-Aug-14 5:10am
View
THANK YOU! Although I wish you couldve explained at least a little why it's like that, but of course I don't want to be a bother. My question probably sounded too newbie/stupid but yeah I guess that's just mostly the case for beginners. Anyway, thank you again! Learned something new today. *thumbs up*
kmllev
27-Aug-14 5:01am
View
The master form is Form1. And yes, I'm trying to hide it since it works as the main menu and after the user clicks on the button on Form2 and would want to see Form3, then of course I would need to close Form1 and Form2 so the user can focus on Form3. How exactly can I reference to it? (Reference to Form1 so I can close it).
Show More