Click here to Skip to main content
15,353,676 members

Comments by gggustafson (Top 200 by date)

gggustafson 2 days ago View
Are you specifically targeting a non-mouse solution?
gggustafson 1-Jun-22 10:37am View
1. Invoke "Start" the beginning of "Update" after removing duplicate code from "Update"
2. Move "panel.SetActive ( true );" to before the if statement
3. Remove "finalScore.text = score.ToString ( );" from the else block
4. Move "Cursor.lockState = CursorLockMode.None;" and "Time.timeScale = 0;" to following the if statement

You should format your code (alphabetize variable declarations, comment each method, etc.) to make it easier on following programmers.
gggustafson 21-Apr-22 14:10pm View
The story cited reads

In its second ruling on Monday, the Ninth Circuit reaffirmed its original decision and found that scraping data that is publicly accessible on the internet is not a violation of the Computer Fraud and Abuse Act, or CFAA, which governs what constitutes computer hacking under U.S. law.

The key phrase is "data that is publicly accessible;" data that is protected by a login is not publicly accessible!
gggustafson 21-Apr-22 13:34pm View
"catch" or "cache"?
gggustafson 21-Apr-22 13:18pm View
Have you looked into window.onload?
gggustafson 25-Oct-21 11:07am View
        // ****************************************************** main

        void main ( string [ ] args )

            if ( !parse_arguments ( args ) )
            else if ( !directory_processed ( directory_maybe ) )
            else if ( !image_filename_list_generated (     
                                                false ) )
            else if ( !timing_filename_retrieved ( directory ) )
            else if ( !timing_file_contents_to_dictionary ( ) )
            else if ( !file_list_generated ( ) )
                show_images ( );

            } // main

gggustafson 24-Oct-21 15:59pm View
Your code will return 0 as the max. The maximum value in arr is -1.
gggustafson 24-Oct-21 15:49pm View
Three warnings
4 Missing semicolon.
41 'destructuring binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
44 Unnecessary semicolon.
Three undefined variables
11 result
12 result
14 result
14 message
15 nessage
Two unused variables
34 yourscore
gggustafson 24-Oct-21 14:49pm View
Q0) what does the user enter into the Console ? a Directory of files ?A0. The usage for the program is <pre>OPTIONS  -D  NUM    Set delay between automatically changing slides.                    The default is ten seconds (i.e., -D 10)                    if <directory> contains a file with the                    extension '.tim', the contents of that file will                     be used to determine the delay for each slide,                     individually.                    However, any value supplied with the 'D' option                    will override the values in the timing file and                    will result in a constant delay.         -1         Run the slideshow once (do not repeat the display                    loop).  DEFAULT KEYS  h          Pause/continue slideshow   n          Go to next image  p          Go to previous image  q          Quit 

I am currently working on the default keys.

Q1) when you created this project, did you select Console as the project type /
A1. Console Application was selected.

Q2) did you make any change to the application output type (accessed by the solution property window) ?
A2. No.
Q3) i notice the show_images method is not declared static: why ?
A3. See A4.
Q4) if you would show what the Main method code is, that would be useful
A4. I do not like declaring methods and variables as static. So I use the following Main:
        // ****************************************************** main        void main ( string [ ] args )            {            if ( !parse_arguments ( args ) )                {                                }            else if ( !directory_processed ( directory_maybe ) )                {                                }            else if ( !image_filename_list_generated (                                                     directory,                                                IMAGE_FILE_FILTERS,                                                false ) )                {                                }            else if ( !timing_filename_retrieved ( directory ) )                {                                }            else if ( !timing_file_contents_to_dictionary ( ) )                {                                }            else if ( !file_list_generated ( ) )                {                                }            else                 {                show_images ( );                }            } // main        // ****************************************************** Main        static void Main ( string [ ] args )            {            Win_Feh p = new Win_Feh ( );            p.main ( args );            } // Main        }

gggustafson 24-Oct-21 14:31pm View
It's actually "Gabriel George Gustafson". In about 1966, the USCG decided that "Gabe" was too close to "Dave" (to which I did not respond as in "Watch out Dave") so my call name became "Gus".
gggustafson 24-Oct-21 14:26pm View
Why is there a close form?

"mousePosition" is not defined
gggustafson 24-Oct-21 13:53pm View
Who's George?
gggustafson 23-Oct-21 14:54pm View
Rather than dump a long listing, state specifically what you do not understand. structs and file pointers are not basic programming concepts. Suggestion: choose a simpler program with which to "learn some basic C coding"
gggustafson 23-Oct-21 14:49pm View
You're setting your minimum incorrectly. I'd initialize it to INT_MAX. Then the test would become
    if ( ( i ) < minimum )
      minimum =;

FYI "choosen" should be spelled "chosen".
gggustafson 23-Oct-21 14:41pm View
Only if OP needs to keep the values for later use. Seeing the trivial nature of the problem, I don't think OP is ready for data structures.
gggustafson 23-Oct-21 14:38pm View
First, "of many students" suggests that you need to loop over input until you've read all the data. Second, if there is a need to keep the values for later use, then you need to save the data in some data structure; I assume there is no such need.

Pseudo-code for the program is:
    read number_of_students
    for each student
        read the 3 scores
        compute the letter grade
        print the results

The for loop would expand to
    for ( int i = 0; ( i < number_of_students ); i++ )

I strongly suggest that you write three methods:
    read_scores ( )
    compute_letter_grades ( )
    print_letter_grade ( )

Your method "theGrads" should be renamed "compute_letter_grades". Also why are you using double rather than float or integer. Is there a need for such precision?
gggustafson 23-Oct-21 11:28am View
Q: What is your pc's OS, what IDE are you using?
A: First, I'm sorry for not providing environmental data in my question. I usually do.

Microsoft Windows 7 Professional SP1
Microsoft Visual Studio 2008 Professional Edition SP1
Microsoft .NET Framework Version 3.5 SP1
Microsoft Visual C# 2008

Q: Are you using the exact code shown in solution #3?
A: The code that I am running is essentially the code provided in the solution with revisions that were added to continue implementation.
        // *********************************************** show_images

        void show_images ( )
            Screen      screen = ( Screen.AllScreens.Length > 1 ) ?
                                          Screen.AllScreens [ 1 ] :

            using ( Form form = new Form ( ) )
                PictureBox pb = new PictureBox ( );

                form.FormBorderStyle = FormBorderStyle.None;
                form.Bounds = screen.Bounds;
                form.BackColor = Color.Black;

                pb.Dock = DockStyle.Fill;
                pb.SizeMode = PictureBoxSizeMode.Zoom;

                form.Controls.Add ( pb );
                form.Show ( );

                    int  i = 0;

                    while ( !terminated )
                        File_Entry  file_entry = file_list [ i ];
                        string      filename = file_entry.File_Name;
                        int         seconds = file_entry.Seconds;

                        if ( File.Exists ( filename ) )
                            pb.Load ( filename );
                            form.Refresh ( );
                            //Thread.Sleep ( 1000 * seconds );
                            Thread.Sleep ( 500 );
                        if ( i >= file_list.Count )
                            i = 0;
                    } while ( !( run_once || terminated ) );
                }  // using form
            } // show_images

Q: What do you see on the screen?
A: The display is what is desired: a black background with each slide displayed in a PictureBox with the image "zoomed". It is what Linux feh would display.

I know that I must update the software to a later .Net framework to use Mono on Linux. But that is a different issue.

Thank you for your interest and help. I hope I answered your questions.

gggustafson 22-Oct-21 23:45pm View
Bill, what is the "obvious reason"? I am using this solution and it works.
gggustafson 22-Oct-21 23:43pm View
My currently accepted answer works. It's Solution 3 by Luc Pattyn.
gggustafson 22-Oct-21 9:37am View
I will give it some thought. Will let you know.
gggustafson 21-Oct-21 23:27pm View
Recall, the program is being ported to Linux. I don't think continuously painting to the form is a particularly good way to go.
gggustafson 21-Oct-21 23:24pm View
There is only one PB and it is deleted at the end of the using block and recreated at the start. Please supply your solution
gggustafson 21-Oct-21 23:22pm View
Wish I could plead that with regard the question
gggustafson 21-Oct-21 22:33pm View
Your solution worked. I guess the old say about being to close to see the problem is true.

Thank you.
gggustafson 21-Oct-21 22:26pm View
As I stated in the Question "When executed, the program displays a full screen form with a background of Azure. But the picture box, that is intended to display each image, does not appear." There are no error messages.
gggustafson 21-Oct-21 17:35pm View
It's a real problem!
gggustafson 13-Oct-21 14:36pm View
gggustafson 5-Jul-21 17:53pm View
What is tableval ()
gggustafson 4-Jul-21 15:30pm View
This is jQuery. Please correct your tags.
gggustafson 16-Jun-21 14:50pm View
You are missing a <div> after your <input type="Submit"> Your <script> should appear within the <body>
gggustafson 16-Jun-21 14:36pm View
It appears that you updated the datagrid but not the database.
gggustafson 3-May-21 15:17pm View
I disagree with your design. Rather than allow a user to write JavaScript (very likely a source of errors), you should decide what your users are allowed to do and then develop a GUI that lets them pick and choose. You are opening a can of worms. I needed to do something like what you wanted to do (1976) and had to spend an inordinate amount of time implementing a NEW LANGUAGE to do it. Not for the squeamish. There are .NET API entries that let you do what you want, but they are beyond the scope of "Quick Answers".
gggustafson 3-May-21 15:05pm View
Are you sure you understand what "modal" means? If one modal dialog is correctly implemented and open, then another modal dialog must wait for the first to close. That's what modal is all about. You cannot leave a modal dialog without completing its requirements. So although you might have two modal dialogs on a page, the user can only access one modal dialog at a time.
gggustafson 3-May-21 14:55pm View
I'm not sure that anyone here considers a code dump as a valid "What I have tried". I'd rephrase your question; point to the references on P vs NP that you used; and submit a fraction of your code that you think is appropriate.
gggustafson 3-May-21 14:50pm View
From your reputation, I take it that you are a relatively new C# programmer. As a programmer in both C# and JavaScript, I strongly suggest that you use a C# method in place of trying to execute JavaScript from your C# code.

I have found that JavaScript and C# can be easily rewritten from one to the other.

Another thought, has the architecture you are considering been validated? You want to do something that's very complex (inter-language interfaces are quite messy and error-prone) when a simpler solution (rewrite the JavaScript) exists.

Good luck
gggustafson 1-May-21 14:25pm View
why are you closing and reopening php?
gggustafson 25-Apr-21 15:22pm View
gggustafson 25-Apr-21 15:18pm View
I do not like using "Object" as a variable. It can be confused with the System Object.

The parameter names in your AddWithValue statements are not those defined in your query. This makes your code difficult to understand. I suggest you name your parameter names the same as your DB column names.
gggustafson 4-Apr-21 11:15am View
What's the semicolon doing after void printDate(struct date); ? If the compiler had continued, it would have complained about printDate(today); because printDate is not defined.
gggustafson 27-Feb-21 14:59pm View
Worked for me. My placement was immediately after static void Main ( ) in a WinForm project. Note too to include using System.Net
gggustafson 13-May-20 23:16pm View
what's delimiter ? ? ","
gggustafson 5-May-20 10:14am View
OP probably fixed it before I read it.
gggustafson 5-May-20 10:03am View
Why do you think that?
gggustafson 9-Apr-20 13:52pm View
What is Response?
gggustafson 9-Apr-20 13:48pm View
From your code, I don't think you did the same thing! Copy the w3schools code and then modify it to fit your needs.
gggustafson 9-Apr-20 13:44pm View
gggustafson 9-Apr-20 13:41pm View
Insure that the time in xeTimeCreated is in UTC. Then use the DateTime methods to convert to the desired time zone (see
gggustafson 9-Apr-20 13:15pm View
Then your HTML should look like solution 2 below. The important thing to learn is to take small steps as you proceed to your solution. Although CSS is important, it is unnecessary at the beginning of development. I add CSS as I am building the HTML. Just like I add JavaScript. FYI, HTML semantics are falling out of favor. I'd suggest that you use <div>s instead of <section>s. Good luck. Stay Safe.
gggustafson 8-Apr-20 23:11pm View
Did you do what I told you?
gggustafson 8-Apr-20 10:59am View
Link to CSS is OK BUT you don't need CSS. Remove the <link>. Place <title> in the <head>. Why is there a <section>? Remove <section> and its closing tag. What is days? You don't need days. Change the "document.body..." to "document.body.innerHTML = dates + "/" + months + "/" + years;". Change "setInterval(printTime,1000);" to "printTime ( );". Your current code displays (not prints!) the date every second and unless you are executing near midnight the display will not change. I personally would not use setInterval.
gggustafson 8-Apr-20 0:48am View
You tagged this question as "JavaScript, CSS3, HTML5" but what your supplied is C#. I hope you know they are not the same.
gggustafson 8-Apr-20 0:43am View
You are not displaying anything on your page. In your case, the CSS file must be in the same directory as the HTML. But I don't see where CSS is being used. What are you trying to accomplish with the invocation of SetInterval?
gggustafson 2-Apr-20 23:14pm View
The date and time are provided by the DateTime class (; and there are a number of ways to get the name of the computer ( Read up on them. Good Luck
gggustafson 2-Apr-20 14:53pm View
I think you'll need some form of Reflection.
gggustafson 2-Apr-20 14:52pm View
+5, if I could
gggustafson 2-Apr-20 14:50pm View
The WebBrowser of Windows Forms does not know anything about PDF. It is using a built-in that allows the browser to view PDFs. But navigation within the PDF is not supported. You may want to search Google for "C# PDF Viewer". Good Luck.
gggustafson 29-Mar-20 16:49pm View
Where is your JavaScript?
gggustafson 29-Mar-20 13:54pm View
So the window that you want positioned is the current window?
gggustafson 29-Mar-20 13:12pm View
Never shout. You lose people who could help. Do as I say: stop, back off from the problem, then do as I ask. Did you read the article I referenced?
gggustafson 29-Mar-20 13:08pm View
First thing first. The following warning: "Consider adding a lang attribute to the html start tag to declare the language of this document"; "Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections".
gggustafson 29-Mar-20 12:27pm View
I think you are getting wrapped around the axel. You need to stop and restart by successfully doing one thing. It appear that the first thing you should do is to write a method that will determine the properties of a form supposedly displayed on a monitor. See Then we can discuss the next step.
gggustafson 28-Mar-20 23:58pm View
Have you stringified the Json?
gggustafson 28-Mar-20 23:56pm View
You are making me as confused as you are. Why the one pixel offset in the test?
gggustafson 28-Mar-20 23:51pm View
I assume that you repaint your moving item directly. Thus, as you move an item, just before you make the move test if the rightmost part of the object is overlapping the right side of the monitor. If that's the case, change the sign of the x velocity. Likewise for the other three sides.
gggustafson 28-Mar-20 23:46pm View
I'm sorry, you misunderstood me. I am in 100% agreement with your position. The problem is where you post it. If you post your response in "Solutions", then you remove the question from the category "View Unanswered Questions". If however you post your response in the "Have a question or comment" category, the OP's question remains in the "View Unanswered Questions". This makes it easier for responders to reply to only unanswered questions. Regards
gggustafson 28-Mar-20 17:20pm View
Within calculateTuition method in the class Courses, where is residency defined? I'd also suggest looking at getters/setters for part of your solution.
gggustafson 28-Mar-20 17:07pm View
Are you just putting in all the HTML tags you can think of? Any attribute you use needs quotation marks around its value, etc. Please ask a better question
gggustafson 28-Mar-20 16:31pm View
Please use the tag 'boostrap'
gggustafson 28-Mar-20 16:24pm View
You have not shown enough for us to help. Note that the debugger can interfere with execution. Normally this implies that there is some kind of timing issue in effect. What debugger are you using?
gggustafson 28-Mar-20 16:19pm View
Please don't use the solution area for this kind of comment; rather use the comment section. That way the unanswered question is not removed from the category "Unanswered Questions". (Usually, I only look at unanswered questions.)
gggustafson 28-Mar-20 16:13pm View
I am not a "gamer" however I have experience moving items around on a monitor. In my situations, not necessarily yours, I take action on the main timer tick. When the tick occurs, I move whatever objects need to be moved. I then determine if any of the objects have "hit" the screen border. If so, I revise the position (by changing the x- and y-coordinates). After all border collisions have been fixed, I update the monitor display (through the Paint event handler).
gggustafson 28-Mar-20 15:25pm View
Do the two data (post and Json) contain the same data?
gggustafson 26-Mar-20 17:18pm View
Have you tried verbatum identifiers? See
gggustafson 25-Mar-20 16:39pm View
Good point.
gggustafson 25-Mar-20 16:35pm View
Normally JavaScript is referenced as the target of an event (thus known as an event handler). Place a button in your HTML and use an attribute something like "onclick='percentageRecovered()'". By the way, I know of no HTML tag named "<p1>" do you mean "<p>"
gggustafson 25-Mar-20 13:19pm View
Why are you testing for ( e.KeyCode == Keys.Down ) in an event handler that executes on key down?
gggustafson 25-Mar-20 13:16pm View
Instead of directly assigning the "data in ng-model" to the input control; parse it into three components (year, month, day) and assign each component to its appropriate dropdown.
gggustafson 24-Mar-20 15:08pm View
As you can see from MadMyche's solution the addEvent needs to be replaced by addEventListener. However, because you are dealing with browser event handler differences, you might want a general event handler mechanism. A really complete discussion of trhe problem begins on PPK includes a number of JavaScript methods that will solve most of your problems. In my CP article the file master_page.js contains a section containing the PPK solutions. I've copied them into my solution below.
gggustafson 24-Mar-20 12:07pm View
Once you have done that, format your original code. It is impossible to read.
gggustafson 24-Mar-20 11:58am View
It appears that you have been given the whole of the FlickrViewer solution in the ZIP file. To get started, download the ZIP file to you machine to an easily remembered place (like C:\FlickrViewer\). Go to the new directory, right click on the ZIP file, and choose Extract All. Move down the directory structure until you find FlickrViewer.sln. That is the solution file. Open Visual Studio. The project was written using Visual Studio 2019. After you sign-in to Visual Studio, open the FlickrViewer.sln file. Now you are in a position to do your homework. Good Luck.
gggustafson 22-Mar-20 15:52pm View
just set the attribute to true
gggustafson 22-Mar-20 15:49pm View
The Visible attribute is a bool. if you want the object to be visible just set the attribure to true as in pictureBox2.Visible = true;
gggustafson 22-Mar-20 15:47pm View
The Visible attribute is of type bool. The ...ToString is a string. Strings dop not directly convert to bools. Use one of the Convert methods to make the conversion. However if you want to make pictureBox2 visible, then just write pictureBox2.Visible = true;
gggustafson 22-Mar-20 13:36pm View
And how would you maintain knowledge of the earlier generated values without using some form of memory storage?
gggustafson 21-Mar-20 18:15pm View
can't you just dock and anchor
gggustafson 21-Mar-20 10:16am View
It's very complicated. Check out for some details you may need. I developed a tool to create a calander. You may want to look at the code for some suggestions ( It's licensed under the Code Project Open License.
gggustafson 20-Mar-20 12:35pm View
I visited your jsFiddle site. There is a lot missing that is needed to help you. for example none of your external JavaScript files are included; I don't know what your event handlers do; etc. Have you tried developer mode (F12) to step through your application?
gggustafson 20-Mar-20 11:51am View
Are you missing a closing brace for the first if ( SSR_SetUserInfo_Result ) ?
gggustafson 18-Mar-20 20:27pm View
I think we are having a language misunderstanding. You say that you want to read but nowhere in your code do you read. You need to use a StreamReader to read the file and a StreamWriter to write the file. As I said in my original response, you are not performing the read.
gggustafson 18-Mar-20 14:10pm View
Use a MasterPage. I suggest something like and its errata The method in these articles is independent of Microsoft. And yes, it's a heavy-duty job updating an entire site, but once it's done, you find yourself well rewarded. Good luck
gggustafson 18-Mar-20 13:56pm View
ZurdoDev gave you the answer
gggustafson 18-Mar-20 13:53pm View
You have a number of problems. I suggest that you write down (on a piece of paper) what the sequence of actions are. I'd say that the first is to test of Data_ID.txt exists; if it does then read the value of num from the file and close the file; otherwise set num to its first value minus one. Do what you need to do with num++. Write the new value of num to Data_ID.txt. NOTE: in your code, you didn't read the value so num is always save as 1.
gggustafson 18-Mar-20 13:40pm View
I don't like your attitude! This site is to help, not embarrass OPs. Yes, we acknowledge that you are knowledgeable. But there is absolutely no reason to cause discomfort to an OP. A simple answer, like mine, goes a long way to improve OP's knowledge base.
gggustafson 18-Mar-20 13:37pm View
I think you are capturing using the wrong event. From Microsoft "Occurs when the Text property value changes." That's not going to allow you to test individual characters as they are entered into the TextBox. I'd suggest that you consider the KeyDown event. It provides information about the key that has been pressed BEFORE the value is displayed. Thus you can test the key and inhibit its display. Hope that helps.
gggustafson 11-Mar-20 23:41pm View
Why not use Array.BinarySearch?
gggustafson 7-Feb-20 13:24pm View
I recommend that you study JavaScript (online at and HTML (online at From what you've included, you probably need to study CSS (online at You have a mishmash of code forms in your question. In order to solve your problem you must have some programming expertise. We can help when you can call yourself a programmer. Good Luck.
gggustafson 7-Feb-20 13:06pm View
May I suggest that you rework your design. In your checkGameStatus you perform too many actions (the rule is write a statement that describes what the method does; if it includes 'and', 'when', 'after', etc., your method needs to be broken up). I'd move all localStorage actions to their own methods (e.g., get_local_storage, save_local_storage). That will make debugging much easier. That means that checkGameStatus should invoke get_local_storage, perform some comparisons, and, if needed, invoke save_local_storage. Also, use parameters, they localize values to within the invoked method.
gggustafson 7-Feb-20 12:37pm View
gggustafson 24-Jan-20 23:12pm View
"You could add a script tag with the script URL into the HTML. To avoid the overhead of jQuery, this is an ideal solution." Unfortunately this transfers the file inclusion out of the file where it is to be included. I like your LoadScript idea. Let me give it some thought. Thanks for your thoughts.
gggustafson 24-Oct-19 13:53pm View
If you "don't know squat about writing the code", then you are asking your question in the wrong forum. It's not that we don't commiserate with you, it's just that we are predominately programmers. I'd suggest you ask a programmer in your organization to help. Best of luck.
gggustafson 13-Sep-19 13:36pm View
What does point to?
gggustafson 26-Jun-19 12:00pm View
Where is the event handler for the button click?
gggustafson 26-Jun-19 11:56am View
And where is p1 declared?
gggustafson 16-Jul-18 10:50am View
Thanks for the insight.
gggustafson 16-Jul-18 10:49am View
Thanks for the insight.
gggustafson 16-Jul-18 10:26am View
Is that type of task referred to as a "C# script"?
gggustafson 15-Jul-18 13:50pm View
Se your other question. You submitted twice!
gggustafson 15-Jul-18 13:48pm View
I'm not sure what you mean by "C# script". C# is a programming language not a scripting language. Could you mean JavaScript script?
gggustafson 13-Jul-18 23:24pm View
What is DataSet1? What is App? If you want to write a DataTable to a CSV file see CSV To.From DataTable here on CP
gggustafson 8-Jul-18 12:49pm View
What is your problem?
gggustafson 8-Jul-18 12:32pm View
What have you tried? Remember we are glad to help with, but not solve, homework questions.
gggustafson 1-Jul-18 13:40pm View
I think you are getting stranded in the weeds. The basic characteristics of a computer programming language were defined by folks like Dijkstra, Hoare, Dahl, Wirth, Knuth, Parnas, Boehm, Plauger, DeMarco, Codd, and many others too numerous to enumerate in the early to late 1970's. These are some of the great men upon whose shoulders we stand. And I believe that the most interesting thing about programming is that once you learn one language, you have effectively learned them all (with few notable exceptions). In 1964, I started with RPG and AutoCoder. Today, I consider myself capable in COBOL, FORTRAN, C, Pascal, C#, and a few chip-level assembly languages. And I learned the basics from RPG (note no following numbers - it was new).

To learn programming concepts you need to read the classics. To learn to program is then rather easy.
gggustafson 1-Jul-18 13:14pm View
The concepts stay the same for everyone!
gggustafson 30-Jun-18 15:21pm View
Any source for knowledge is fine. The only thing that you'll miss out on is the syntactic sugar that Microsoft has added between the version discussed in your tutorial and what they are currently providing. I use Visual Studio 2008 and can do anything more recent versions do.
gggustafson 8-Apr-18 13:59pm View
The theory is not wrong; your precision of log base 2 is not or you accidentally throw away precision (by rounding) before taking the floor.
gggustafson 8-Apr-18 13:55pm View
Did it occur to you that log base 2 ( 9223372036854775807 ) is 62.999999999999999999843582690243 and that floor ( log base 2 ( 62.999999999999999999843582690243 ) ) is 62? Therefore you need to add 1 as the rule specifies.
gggustafson 8-Apr-18 12:53pm View
Because it does not observe the nuances of either the definitions of CSV found in RFC 4180 or in the defacto Microsoft standard.
gggustafson 5-Apr-18 22:35pm View
Although not conversant in Python, most number systems have a largest positive value that is one bit less in length than the largest negative number (the leading sign bit)
gggustafson 5-Apr-18 14:45pm View
JavaScript is supported by a browser; C# by the operating system (more like run time but close enough). So you want a browser to respond to an event triggered by a c# button click? Before we go into possible solutions to this extraordinary requirement, please look over your design. It appears flawed.
gggustafson 5-Apr-18 14:19pm View
Have you tried Filezilla? I find that simple errors can be solved by using another method.
gggustafson 13-Aug-17 13:56pm View
You mat find the contents of WebOpenFileDialog useful.
gggustafson 24-Jul-17 11:53am View
Have you tried debugging your code? Also in the future please include the using statements for your code
gggustafson 13-Jul-17 11:03am View
Has your problem been solved?
gggustafson 13-Jul-17 11:01am View
You must show code!!
gggustafson 13-Jul-17 10:59am View
I too would like an answer to Richard's question.
gggustafson 30-May-17 14:54pm View
It is far more useful to the OP for you to simply state the event name. You could also provide a link to the MSDN page. But remember, links go bad over time.
gggustafson 30-May-17 14:54pm View
It is far more useful to the OP for you to simply state the event name. You could also provide a link to the MSDN page. But remember, links go bad over time.
gggustafson 30-May-17 14:52pm View
gggustafson 30-May-17 14:40pm View
Have you received a usable response to your question. Someone closed your question (I don't know when) and I had to have it reopened. Sorry about that. Some Code Project members don't seem to understand. Anyway, I'm still here. Let me know.
gggustafson 15-May-17 16:40pm View
Someone deleted your code. Let's take this discussion offline. Send your code to me at gggustafson at gmail dot com.
gggustafson 15-May-17 16:08pm View
I see that from your question. But all that code does is write the message "You got room for 4 more items in this compartment, what would you like to add??" followed by the message "Add:" to the console (monitor); then creates a string array of four empty items; and finally displays the message "you added..." (by the way in a form that does not display the items in the array!). So what were you expecting?
gggustafson 15-May-17 15:47pm View
Slow down. Don't get frustrated. So now you are processing case 5 of a switch statement. It would appear that you want to collect things that the user wants to do. There is really a simple way to do that using Console.Write and Console.ReadLn. All you do is perform a series of ConsoleWriteln that display a number followed by an action. At the end of displaying the four items, ask the user which item he wants to perform. When the user responds perform the action. After you perform the user's desired action, redisplay the list of indices and actions (now one shorter) and again read what item he wants to perform. Continue this until either there are no more actions or the user indicates he's finished (by say entering an empty response).
gggustafson 15-May-17 15:36pm View
I don't follow what you mean by "with int instead of string." Both are primitive types in C# so what you can do with int you can do with string (of course not mathematical stuff). Somewhere in your case 5 you need to read in things to do. Where do you do that? Show me some code.
gggustafson 15-May-17 15:25pm View
First you must read in the four things to be done. That can be done in a loop. You could also add a test to allow fewer than four items (something like reading an empty line). I'd also suggest that you use a List < string > rather than an array. Lists are much more easily manipulated. So after you read in what the user wants to do, then you process those things. If you have further questions, reply to this comment.
gggustafson 9-May-17 11:31am View
I agree with kosmaskaf. If that does not work, come back.
gggustafson 9-May-17 11:26am View
If this is homework, then you need to seek help from your instructor. If not, look at the problem as a C# programming problem, using the VB code as a design. By converting the code yourself you will gain an appreciation for the C# language. Too, you will increase your knowledge regarding compatible languages. Are you in the Visual Studio environment? If so, first fix any problems in the VB code until you have a clean compile. Then, you can make the conversion. Note however that VB and C# are fully compatible in Visual Studio. The calling interfaces are the same. Good Lock.
gggustafson 21-Apr-17 10:46am View
Suggestion: you have two separate events - that suggests that you have two separate event handlers, one for MouseClick and one for MouseEnter. Remember "divide and conquer"? If processing is going to be the same, then call a common method from both handlers.
gggustafson 18-Apr-17 10:52am View
Have you read ?
gggustafson 4-Apr-17 11:24am View
What did you expect? What actually happened?
gggustafson 23-Feb-17 9:39am View
General: you need to adopt a consistant formatting style; ALWAYS use braces even if there is only one statement following the control statement (i.e., if ( condition ) { statement } ).
Questions: why are you assigning multiple onclick event handlers? have you considered using push for your parsing?
Warning: when processing the CE button, you are possibly operating against a variable (equation) that has not been initialized; it will be undefined; the value of equation.length - 1 might not exist.
Suggestion: rewrite the parsing algorithm
gggustafson 23-Feb-17 9:07am View
Google "c# fill datagridview from database". I would also set your gvDetails.DataSource to null before assigning dataTable to it.
gggustafson 29-Dec-16 13:01pm View
Have you looked at
gggustafson 23-Dec-16 9:21am View
If you are new to coding (by which I assume you mean that you are new to programming), I'd suggest that you choose a simpler project. Although the problem is not insurmountable to new programmers, it does demand a significant insight into the operating system.
gggustafson 21-Dec-16 10:36am View
You don't need jQuery for this process. When the visitor checks the "Show password" CheckBox, just change TextMode="Password" to TextMode="SingleLine". When the visitor clears the Checkbox, change the TextMode="SingleLine" back to TextMode="Password".
gggustafson 21-Dec-16 10:17am View
First, I'm using C as the reference language because it seems that's what you are providing.

The first piece of code defines a NODE, as in a list. Note that node includes a reference to itself (as a pointer). That means that the list can be traversed by moving from link to link. (I personally would have named "link" as "next"; it makes more sense.)

The create function returns a new NODE. Whatever is returned should be ready to have "info" filled; "link" made to point to some other NODE (like "start"); and some existing NODE in the list made to point to this new NODE.

The disp function would (I'm guessing) traverse the list beginning at "start". This implies that "link" should be set to nul in the last NODE of the list.

Hope that helps.
gggustafson 14-Dec-16 16:58pm View
I'd suggest that you look into PInvoke ( I use the site to determine the proper parameters for Win32 functions (such as FindWindow, etc.). You must include a "using System.Runtime.InteropServices". Look over the PInvoke site. If you have further questions, reply to this comment.
gggustafson 1-Dec-16 0:12am View
One clue, you need to either have an array of Perimeters to compare at the end of collecting the lines or keep track, on the fly, of the triangle with the smallest Perimeter.
gggustafson 1-Dec-16 0:06am View
This is not only not the answer but it is wrong in so many other ways!!!
gggustafson 25-Oct-16 14:30pm View
Have you looked at
gggustafson 21-Oct-16 8:42am View
Tried it in one (IE11) and it "loaded" just fine. Also has a very capable English translation or mirror.

Agree with you that OP should contact the site administrator. The number is available on the site.

I think that you need to understand that OP does not appear to be very experienced. So your comment may be interpreted as a criticism of him/her. I'm sure that was not intended.
gggustafson 20-Oct-16 22:45pm View
What are you trying to do?
gggustafson 20-Oct-16 22:40pm View
That's definitely not helpful!!!
gggustafson 20-Oct-16 22:38pm View
UserControl1 should have the ability to get or set properties within the control. For example, the Code Project article "PasswordEye Control" ( is a user control with a number of properties (BackColor, Font, ForeColor, Maximum_Width, MaxLength, PasswordChar, and Text). In the source code for PasswordEye.cs, you will find the declarations of each property. Note too that your user control should probably contain an event to which applications can subscribe. All of the mechanics are contained in the article.

Hope that helps.
gggustafson 20-Oct-16 18:28pm View
Are you using separate threads: one to read you emails; another to recognize "stop"?
gggustafson 20-Oct-16 18:24pm View
Where are you storing the names of the files that the user wishes to attach?
gggustafson 20-Oct-16 18:21pm View
You never create the file named pathString. Therefore both of the tests

if ( System.IO.File.Exists ( pathString ) )

fail. That means your program does nothing.

What are you trying to do?
gggustafson 20-Oct-16 18:03pm View
In what way can't they code a basic web site?
gggustafson 11-Oct-16 13:05pm View
This is the best advice. 3.5 is ubiquitous.
gggustafson 11-Oct-16 13:02pm View
Your answer was not particularly helpful
gggustafson 11-Oct-16 12:59pm View
Are you sure that you have updated the database. Your code appears to suggest that you might write but not actually update the Database.
gggustafson 11-Oct-16 12:46pm View
This is not a trivial problem. You can limit the parsing effort by defining a subset of a language. But in general I would grade the problem as one of graduate level complexity.
gggustafson 11-Oct-16 12:41pm View
Identify the line of code that either directly or indirectly caused the exception. Then place a try-catch block around the statement and set your debugger to break in the first line of the catch block. There you can determine the state of your program when the exception occurs.
gggustafson 2-Aug-16 10:07am View
It appears that you might be trying to write to the Event Log. In any case, perform a Google search for "An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Additional information: Requested registry access is not allowed. Is it because of Admin rights with the application? how to allow it only for this code section?" The search results contain pointers for correcting the problem.

gggustafson 8-Jun-16 11:52am View
Before you invest too much time with mshtml, I'd suggest that you study the Html Agility Pack.
gggustafson 27-Dec-15 17:09pm View
As Sergey suggests, you need to read MSDN documents on "user controls". Within Code Project I have written a number of articles about programmer defined controls. The article that I suggest that you read is "RoundedButton Control - Demystifying DrawArc". It is a very simple control. If you want an advanced control read "Anatomy of a UserControl (SliderControl)". Once you get started, we are here to help.
gggustafson 24-Dec-15 12:49pm View
OK, added as a solution. Regards and Happy Holidays.
gggustafson 24-Dec-15 11:49am View
I think you may be a little confused by autocomplete TextBoxes, ComboBoxes, and ListBoxes. An autocomplete TextBox does not operate the way you suggest. No KeyDown event needs to be provided; just the list of entries that autocomplete will provide. That list can be dynamic. See the MSDN article
gggustafson 27-Nov-15 23:54pm View
The state of cookies when the browser exits is usually set in the browser user preferences. In addition, whether or not cookies may even be set is also usually set in the browser user preferences.
gggustafson 17-Nov-15 10:33am View
Why is it "difficult" to add more charts?
gggustafson 17-Nov-15 10:29am View
That implies that the problem may be environmental. You should insure that the environment on the development machine is the same as the environment on the server.
gggustafson 15-Nov-15 10:39am View
I think I would have approached the problem using either a TabControl or a number of overlapping panels made visible by choosing a ContextMenu item. In the first case I would not use a ContextMenu but rather label each TabPage with the name of the chart. (I assume that the total number of charts is known and constant.)
gggustafson 14-Nov-15 15:34pm View
By the way, I'm not sure that I approve of using "outside the box" components in a WinForm application. Is there some reason that you're doing it?
gggustafson 14-Nov-15 15:30pm View
What do you mean by "this is when the issue happens"? During the conversion? When you try to open a form?
gggustafson 14-Nov-15 13:12pm View
When you are adding code, use the Improve question link. That will place your code with your question.
gggustafson 14-Nov-15 13:10pm View
May I suggest that the best way to insure closing a connection is to use a using statement.
gggustafson 14-Nov-15 11:28am View
When you opened the .sln in VS 2015, were you asked if you wanted a conversion?
gggustafson 6-Nov-15 0:22am View
You are answering the wrong person. Reply to Member 11999641. I know how to add Tooltips to controls.
gggustafson 5-Nov-15 9:03am View
It's not my question, but

Namespace: System.Windows.Forms.DataVisualization.Charting
Assembly: System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)
gggustafson 4-Nov-15 14:06pm View
It would be better for you to provide help rather than some smug answer!
gggustafson 4-Nov-15 14:02pm View
You have posted this in at least three forums. Are you going to take the average of the answers? I'm marking this a repost.
gggustafson 29-Oct-15 11:19am View
Yes. But the result is stored in imgLogo.ImageUrl

Are you in WinForms or WebForms?
gggustafson 23-Sep-15 12:21pm View
I believe that sisir is correct
gggustafson 26-Aug-15 12:35pm View
Check out
gggustafson 24-Aug-15 15:07pm View
In that case, as Henric has suggested, your implementation of stopping the game has also caused the code fragment you supplied to be skipped.

Now do what CPallini suggested - use the debugger and trace execution from the time after you press "P" and you press "Enter".
gggustafson 24-Aug-15 14:44pm View
Make sure that your code looks like

if (Input.KeyPressed(Keys.Enter))
lblGameOver.Visible = false;
gggustafson 24-Aug-15 14:41pm View
I didn't know Arabic fit in UTF-8.
gggustafson 24-Aug-15 14:39pm View
Suggest you remove the else and make if ( Input.KeyPressed ( Keys.Enter ) ) the start of a new conditional statement. Recall that the Input.Keypressed does not change between test.
gggustafson 15-Aug-15 12:52pm View
When I visit the web site I get a wsdl:definitions structure but Firefox complains about the site's security certificate (happens at most US military sites). Why are you visiting a US military web site? If you are authorized, use your AKO login and ask for help.
gggustafson 15-Aug-15 12:40pm View
What have you done? What have you tried? Add a short code fragment using Improve question.
gggustafson 13-Aug-15 12:41pm View
I'm ancient and own an ancient phone!
gggustafson 13-Aug-15 12:40pm View
Xamarin is still required in Community 2015.
gggustafson 12-Aug-15 15:48pm View
I tried that edition. Then I found out that Xamarin charges for their product after 30 days (I wanted to develop for Android and iOS as well). I removed the community edition am trying to get to VS 2010.

But thanks for the thought.
gggustafson 20-Jul-15 12:28pm View
If you are, as you say, "new to this", you have chosen an extraordinarily difficult project. "Just the image recognition I need" is a requirement that itself requires skill and experience apparently beyond your current abilities. Search the Internet for image recognition tools. Do not try to program this yourself. You will just be frustrated.
gggustafson 20-Jul-15 12:16pm View
Is your image animated?
gggustafson 10-Jul-15 11:16am View
gggustafson 9-Jul-15 6:04am View
Your problem is with the TTS WAV file generation. I would guess that there is no timing information in the file. That would mean that the file is played as fast as it can. Look into how to cause the WAV file to contain information as to how fast to play it.
gggustafson 8-Jul-15 10:12am View
It has been a long time since I was involved in TTS. Have you Googled "free text to speech software"?
gggustafson 8-Jul-15 4:29am View
It appears that your text-to-speech conversion is the culprit. Have you tried a different TTS engine? When I was working on the Improved Precision Approach Radar Trainer (IPART)<\a> project, I found that TTS engines varied gratly in performance.
gggustafson 7-Jul-15 9:40am View
Have you searched Google?
gggustafson 6-Jul-15 11:16am View

If that doesn't do, Google "c# append .wav files". There are many suggestions there.