Another student, in whose appliance the gedit-plugins package was missing, found that the following two commands solved the problem:
sudo apt-get install -o Dpkg::Options::="--force-overwrite" gedit-plugins
sudo apt-get install -o Dpkg::Options::="--force-overwrite" --reinstall appliance50
One issue is that both gedit-plugins and appliance50 install a file ...
The terminal in the bottom of the gedit window is termed as Embedded Terminal. To get it in gedit,
Open gedit, click View, enable Bottom Panel.
Now click Edit, go to Preferences, then Plugins.
Enable Embedded Terminal.
If you don't find that option, then try sudo apt-get install gedit-plugins in terminal, and repeat the process again.
The VirtualBox version of the appliance currently has an issue with the gedit install. Staff are aware of it and are working on a fix.
In the meantime, run this:
sudo apt-get update
sudo apt-get install --reinstall gedit
That should get it up and running again.
It sounds like you are trying to open greedy in gedit. greedy is the executable file. If you want to edit the code, you must open greedy.c, make your changes, and then run make greedy to create the updated executable file.
Then, you can run ./greedy to see the updated code in action.
Well, a debugger, as its name suggests, helps you debug your program (i.e., figure out the problems in your code so that you can fix it). The debugger we use for debugging our C programs is named gdb.
You may watch the short on gdb for more information!
That depends on the type of the variable:
As a example forn an integer (int):
int n = 25;
printf("n is equal to %d\n", n);
The %d is a placeholder for an integer, when the message inside the double cuotes is printed the %d is replaced by the actual value of the variable that is passed as argument after the coma.
Other example with an integer and a ...
The command "make" seems to be lacking some flags, try compiling it on your own with the "-lcs50" flag to link the library, i.e.
clang credit.c -o credit -lcs50
If you want "make" to behave like it should, you can export the C-flags to something like:
export CFLAGS="-ggdb3 -std=c99 -Wall -Werror"
export LDLIBS="-lcs50 -lm"
I don't know why it works in Codeblock, but the correct condition would be:
i <= x && j >= 0
i <= x, j >= 0
as you have.
So your for loop should be:
for (i = 0, j = x; i <= x && j >= 0; i++, j--
If this answers your question please accept it by clicking the gray check-mark to the left, so that it becomes green. ...
Is this a serious problem whenever I use these programs? Why might the
programmers who wrote these programs ignore the advice about
preventing memory leaks?
Check out the top Google result for the search phrase "valgrind ls leaks". It's a bug report made to the GNU project's bug-coreutils mailing list back in 2011 that makes essentially the same claim (...
The "tab size" option in gedit only changes how tabs are displayed in the editor window. It has no effect on how the tab character \t gets displayed in the terminal window when you run the program.
It seems to be possible to change the display width of a tab character in your shell environment but I wouldn't recommend it and it won't help you to ...
Kellen - if you are downloading GEdit to use in conjuction with taking the course, you would be better off following the instructions for downloading and setting up the virtual appliance. David & the CS50 staff have made some environment configurations that your personal setup may not be able to mirror completely, and that could cause trouble down the ...
You can still use gedit outside of the appliance. You can download it from here. If gedit is a bit too technical, another popular code editor to try is Sublime Text.
If you really must choose between Word or Notepad, then Notepad is the better of the two to write code with.
While you can edit source files in Word there are some reasons not to:
It is easy ...
Well, Microsoft Word and Notepad are two different kinds of applications. Microsoft Word is a word processor while Notepad is a text editor as well as gedit.
Yes, you can write programs using the three of them and this has nothing to do with compilation errors as long as you're saving your files with the correct extensions and avoiding syntax errors.
Yes, the dropdown list in the lower-right corner of the Gedit interface displays and allows for changing the currently selected syntax highlighting option. The purpose of syntax highlighting is to allow for an easier grasp of the structure of a file, and to aid in identifying syntax errors.
The same syntax highlighting options can be accessed from the File ...
If using the CS50 appliance, you will see a shortcut is already added for gedit on the taskbar.
If you directly want to open a code file, say example.c, open the terminal, navigate to its folder and type
You can also find it in the menu.
You may want to read carefully instructions posted here, but only apply those "patches" if you feel confident messing around with config files.
And always create backups first (as in cp file1 file1.bak)
Per the pset, the GTK warning is a known bug in Linux fedora. Prof. Malan instructs students encountering this error to try restarting their appliance and try the sudo command again. I had the same error and restarting the appliance and trying again worked for me.