CE103 Algorithms and Programming I

CE103 Algorithms and Programming I

Week-2

Software Development Environments

Download DOC, SLIDE, PPTX

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Outline

  • Flowgorithm
  • Introduction to Analysis of Algorithms
  • Programming Environment Setup and Configuration
    • C/C++ (DevCpp,Code Blocks,MinGW,LLVM,VsCode,VisualStudio,Notepad++,Vi/Vim,Eclipse,Netbeans,Cmake/Make)
    • Java (VsCode,Notepad++,Eclipse,Netbeans,Cmake)
    • C# (VsCode,Notepad++,VsCode,VisualStudio,Cmake)
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Outline

  • Common Tools and Platforms
    • Fatih Kalem, Notepad++,HxD, MarktextApp,Cygwin,Dependency Walker,Doxygen,Sonarlint,
      Codepen.io, Codebeautify.org, Codeshare.io,AsciiFlow.com, Freemind, Mockflow, Wireflow, PlantUML,Drawio,Putty, MobaXterm,Teamviewer,AnyDesk,Paletton.com,Colorhunt.co,Understand,JD Project,Cutter,IDA Pro / Freeware,pythontutor,godbolt,scrcpy,Travis-CI,AppVeyor,Jenkins,Vagrant,Docker / Docker Compose / Kubernetes,Nuget,SCV Cryptomanager,Addario CryptoBench,Raymond's MD5 & SHA Checksum Utility,SlavaSoft HashCalc,Portable PGP, and more ...
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Algorithm Basics

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (2)

  • Main Window

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (3)

  • Console Window
    • The classic method to interact with the computer is to use the "Console". Flowgorithm attempts to make it look like a typical instant messenger window. The "chat bubbles" are color coded to match the Input and Output shapes used in the flowchart. If you don't want to use the chat bubbles, you can also toggle between them and the classical plain text.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (4)

  • Console Window

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (5)

  • Source Code Viewer Window
    • The Source Code Viewer can convert your flowchart to several major programming languages. So, if you planning to learn a high-level language, then this feature should help you along the way.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (6)

  • Source Code Viewer Window

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (7)

  • Variable Watch Window
    • The variable watch window is used to keep track of how your variables are changing as your program executes. Each variable is color-coded based on its data type. At a glance, you can tell exactly what type of data is being stored - and catch where you may want to use a different data type.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (8)

  • Variable Watch Window

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Flowgorithm (8)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Pseudocode (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Introduction to Analysis of Algorithms

  • In this course, we will learn how to code with several development environments and next term we will see an analysis of algorithms in detail.

  • This topic is covered in the following link:

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Programming Environment Setup and Configuration

  • Programming life is not about only learning how to code. Mostly you need to use several code development environments and you need to learn how to use them efficiently.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

C / C++ Environment and Development

RTEU CE103 Week-2
CE103 Algorithms and Programming I

DevCpp (Install / Compile / Run / Debug) (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (2)
  • Open DevC++ IDE for C Project Generation Open File->New->Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (3)

Select Console Application from Basic tab and with C Project Option and write a project name such as "Hello" then press OK

Select a folder and save Hello.dev project file.

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (4)
  • You will see a sample main with an empty body

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (5)
#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, s,ystem("pause") or input loop */
int main(int argc, char *argv[]) {
    retAdd 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (6)
  • Add the following line in the main function. This will write "Hello, World!" on the screen and then wait for a keypress to exit from the application
#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
    printf("Hello, World!");
    getchar();
    return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (7)
  • Then save the file

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (8)
  • Use from menu Execute->Compile F5 to generate Hello.exe

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (9)
  • You can find the generated Hello.exe path from Compile.log as follow. Check the Output Filename
Compiling project changes...
--------
- Project Filename: E:\UgurCoruh\RTEU\Lectures\2021-2022 Güz CE103 - Algorithms and Programming I\Lectures\ce103-algorithms-and-programming-I\Week-2\devcpp-hello-world-apps\Hello.dev
- Compiler Name: TDM-GCC 4.9.2 64-bit Release

Building makefile...
--------
- Filename: E:\UgurCoruh\RTEU\Lectures\2021-2022 Güz CE103 - Algorithms and Programming I\Lectures\ce103-algorithms-and-programming-I\Week-2\devcpp-hello-world-apps\Makefile.win

Processing makefile...
--------
- Makefile Processor: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\mingw32-make.exe
- Command: mingw32-make.exe -f "E:\UgurCoruh\RTEU\Lectures\2021-2022 Güz CE103 - Algorithms and Programming I\Lectures\ce103-algorithms-and-programming-I\Week-2\devcpp-hello-world-apps\Makefile.win" all

gcc.exe -c main.c -o main.o -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"

gcc.exe main.o -o Hello.exe -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc


Compilation results...
--------
- Errors: 0
- Warnings: 0
- Output Filename: E:\UgurCoruh\RTEU\Lectures\2021-2022 Güz CE103 - Algorithms and Programming I\Lectures\ce103-algorithms-and-programming-I\Week-2\devcpp-hello-world-apps\Hello.exe
- Output Size: 128,103515625 KiB
- Compilation Time: 2,13s
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (10)
  • Then you can run with Execute->Run F10 or Directly Compile&Run F11

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (11)

for debugging operations, just change the code and add more statements as follow

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your getch, system(",pause") or input loop */

int main(int argc, char *argv[]) {

    printf("Hello, World! Step-1\n");
    printf("Hello, World! Step-2\n");
    printf("Hello, World! Step-3\n");
    printf("Hello, World! Step-4\n");
    printf("Hello, World! Step-5\n");
    printf("Hello, World! Step-6\n");

    getchar();

    return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (12)

Click on line numbers and add breakpoints for the debugger. This red point will be debugger stop points

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (13)
  • In the menu section, select the compiler with debug option

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (14)
  • Compile application with debugging setting and in Execute Section use Debug F5 to start debugging

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (15)
  • The debugger will stop at the breakpoint at the debug point (blue line)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (16)
  • Moving to the next statement can be done via control buttons or shortcuts

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (17)

-Press F8to step-by-step continue

  • Then go to Project Options -> Compiler -> Linker and set Generate debugging information to "yes", and make sure you are not using any optimization options (they're not good for debug mode). Also, check the Parameters tab, and make sure you don't have any optimization options (like -O2 or -O3, but -O0 is ok because it means no optimization) or strip option (-s).
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (18)
  • After that, do a full rebuild (Ctrl-F11), then set a breakpoint(s) where you want the debugger to stop (otherwise it will just run the program). To set a breakpoint on a line, just click on the gutter (the gray band on the left), or press Ctrl-F5.
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (19)
  • Now you are ready to launch the debugger, by pressing F8 or clicking the debug button. If everything goes well, the program will start, and then stop at the first breakpoint. Then you can step through the code, entering function calls, by pressing Shift-F7 or the "step into" button, or stepping over the function calls, by pressing F7 or the "next step" button. You can press Ctrl-F7 or the "continue" button to continue execution till the next breakpoint. At any time, you can add or remove breakpoints.
RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (20)

When the program stopped at a breakpoint and you are stepping through the code, you can display the values of various variables in your program by putting your mouse over them, or you can display variables and expressions by pressing F4or the "add watch" button and typing the expression.

RTEU CE103 Week-2
CE103 Algorithms and Programming I
DevCpp (Install / Compile / Run / Debug) (21)

How do I debug using Dev-C++

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Code Blocks (Install / Compile / Run / Debug) (1)

Download Code Blocks from the following link

Binary releases - Code::Blocks

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (2)

Open Code Blocks and

Select File->New->Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (3)

Select Console Application

Click Next from Opening Window

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (4)

Select C for Sample Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (5)

Write a project name and title also set a project folder

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (6)

Select a compiler for this project we selected GCC but you can select C compilers from the list. Set Debug and Release executable output folders.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (7)
  • After this wizard, you will have the following code
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (8)

Select Debug Build from the menu

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (9)

Run with Build and Run F9

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (10)
  • You should see the following output

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (11)
  • Add the following lines to your source code for debugging
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world! Step-1\n");
    printf("Hello world! Step-2\n");
    printf("Hello world! Step-3\n");
    printf("Hello world! Step-4\n");
    printf("Hello world! Step-5\n");
    printf("Hello world! Step-6\n");
    return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (12)
  • and add breakpoints with F5 or mouse click

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (13)
  • select Debug->Start/Continue to start debugger

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (14)
  • If you see the following error this is related to long or turkish characters including the path. Just move the project to a shorter path and try again
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0
RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (15)

You will see the following yellow pointer for the debugger

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
Code Blocks (Install / Compile / Run / Debug) (16)

You can use the following menu or shortcuts for step-by-step debugging.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

GCC/G++ Complier (MinGW) / Clang-cl (LLVM) (1)

Download and install MinGW or LLVM compiler (if you downloaded then skip this step)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

GCC/G++ Complier (MinGW) / Clang-cl (LLVM) (2)

Open a console with "cmd" and test the following commands if commands are not recognized then set the system environment variable to add gcc and g++ executable paths to the path variable (add to both system and user path variable)

gcc --version

g++ --version
C:\Users\ugur.coruh>gcc --version
gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
clang --version
RTEU CE103 Week-2
CE103 Algorithms and Programming I

GCC/G++ Complier (MinGW) / Clang-cl (LLVM) (3)

  • for gcc.exe, g++.exe and gdb.exe
C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin
  • for clang.exe, lldb.exe
C:\Program Files\LLVM\bin

This folder path changes according to your setup

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (1)

Download Visual Studio Code from the following link

Download Visual Studio Code - Mac, Linux, Windows

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (2)

In this sample, you will find MinGW and LLVM compiler combinations for C and C++

Create a folder and enter this folder then open this folder with vscode by right click

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (3)

or enter the folder via console

alt:"alt" center

write

code .
RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (4)

  • This will open vscode for the current folder, (.) dot present current folder.
  • You will see an empty folder in the right window

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (5)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (6)

  • Create a hello.c file and write the following content
#include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (7)

use CTRL+SHIFT+B (you should be on the source code section) to build a file

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (8)

Select GCC or CLANG for this sample we can use GCC

You will see the output generated `Hello.exe``

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (9)

for debugging just put a breakpoint and build again

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (10)

  • after building for debug press CTRL+SHIFT+D (you should be in the source code section)and in the right window select create launch.json

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (11)

  • from opening, window select C++ GDB/LLDB

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (12)

  • from the next opening, menu select mingw-w64 gcc.exe

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (13)

this will run the debugger and you will see debug points activated

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (14)

then you can step-by-step debug your code.

the following task.json and launch.json automatically generated with your selections

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (15)

launch.json

{
  // Olası öznitelikler hakkında bilgi edinmek için IntelliSense kullanın.
  // Mevcut özniteliklerin açıklamalarını görüntülemek için üzerine gelin.
  // Daha fazla bilgi için şu adresi ziyaret edin: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "gcc.exe - Etkin dosyayı derle ve dosyada hata ayıkla",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${fileDirname}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
      "setupCommands": [
        {
          "description": "gdb için düzgün yazdırmayı etkinleştir",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "C/C++: gcc.exe etkin dosyayı derle"
    }
  ]
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (16)

task.json

{
  "tasks": [
    {
      "type": "cppbuild",
      "label": "C/C++: gcc.exe etkin dosyayı derle",
      "command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe",
      "args": [
        "-fdiagnostics-color=always",
        "-g",
        "${file}",
        "-o",
        "${fileDirname}\\${fileBasenameNoExtension}.exe"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "problemMatcher": ["$gcc"],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "detail": "Hata Ayıklayıcısı tarafından oluşturulan görev."
    }
  ],
  "version": "2.0.0"
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (17)

  • You can do the same thing for other compilers and C++ source codes. LLVM does not support debugging on vscode now.

for C++ VsCode you can check the following links

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (18)

in the launch file if you start debugging with F5

(you can select debugger with CTRL+SHIFT+P and then write Debug and Selecting Configure Debugger Option)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (19)

  • the following line will be your debugging application path

  • if you start debugging with F5 in Hello.c file this will set <Hello.c base path>/Hello.exe

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Install / Compile / Run / Debug) (20)

You should set this correct for both LLVM and GCC configuration in launch.json

 "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",

Also you should set your installed debugger paths

for GCC

"miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",

for LLVM

"miDebuggerPath": "C:\\Program Files\\LLVM\\bin\\lldb.exe",

for more details please check the sample source codes.

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (1)

My Extension List

  • Listing Installed Extensions
PS C:\Users\ugur.coruh\Desktop> code --list-extensions | % { "code --install-extension $_" }

Following topic can help you

How can you export the Visual Studio Code extension list? - Stack Overflow

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (2)

code --install-extension 2gua.rainbow-brackets
code --install-extension aaron-bond.better-comments
code --install-extension abusaidm.html-snippets
code --install-extension ACharLuk.easy-cpp-projects
code --install-extension chris-noring.node-snippets
code --install-extension cschlosser.doxdocgen
code --install-extension csholmq.excel-to-markdown-table
code --install-extension DaChuiOpenSource.FreeMind
code --install-extension dannysteenman.cloudformation-yaml-snippets
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
code --install-extension digized.umple
code --install-extension DotJoshJohnson.xml
code --install-extension DougFinke.vscode-pandoc
code --install-extension dzhavat.bracket-pair-toggler
code --install-extension esbenp.prettier-vscode
code --install-extension formulahendry.dotnet
code --install-extension franneck94.c-cpp-runner
code --install-extension gcc.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (3)

vscode-plugin-billionbottle
code --install-extension geeklearningio.graphviz-markdown-preview
code --install-extension geyao.html-snippets
code --install-extension GitHub.copilot-nightly
code --install-extension GrapeCity.gc-excelviewer
code --install-extension Ionide.Ionide-fsharp
code --install-extension ionut-botizan.vscode-cypher-ql
code --install-extension ipedrazas.kubernetes-snippets
code --install-extension JakeWilson.vscode-picture
code --install-extension James-Yu.latex-workshop
code --install-extension JasonMejane.base64viewer
code --install-extension jasonnutter.search-node-modules
code --install-extension jebbs.plantuml
code --install-extension jeff-hykin.better-cpp-syntax
code --install-extension Katacoda.vscode
code --install-extension KenDomino.Antlrvsix-vscode
code --install-extension l7ssha.tag-inserter
code --install-extension lolkush.quickstart
code --install-extension marp-team.marp-vscode
code --install-extension mindaro-dev.file-downloader
code --install-extension mindaro.mindaro
code --install-extension ms-azuretools.vscode-docker
code --install-extension MS-CEINTL.vscode-language-pack-tr
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (4)

code --install-extension ms-dotnettools.csharp
code --install-extension ms-dotnettools.dotnet-interactive-vscode
code --install-extension ms-dotnettools.vscode-dotnet-pack
code --install-extension ms-dotnettools.vscode-dotnet-runtime
code --install-extension ms-kubernetes-tools.vscode-aks-tools
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-toolsai.jupyter
code --install-extension ms-toolsai.jupyter-keymap
code --install-extension ms-toolsai.jupyter-renderers
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode-remote.remote-ssh
code --install-extension ms-vscode-remote.remote-ssh-edit
code --install-extension ms-vscode-remote.remote-wsl
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (5)

code --install-extension ms-vscode.azure-account
code --install-extension ms-vscode.brackets-keybindings
code --install-extension ms-vscode.brackets-pack
code --install-extension ms-vscode.cmake-tools
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.cpptools-extension-pack
code --install-extension ms-vscode.cpptools-themes
code --install-extension ms-vscode.live-server
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension oleg-shilo.cs-script
code --install-extension PascalReitermann93.vscode-yaml-sort
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (6)

code --install-extension Pivotal.vscode-boot-dev-pack
code --install-extension Pivotal.vscode-concourse
code --install-extension Pivotal.vscode-manifest-yaml
code --install-extension Pivotal.vscode-spring-boot
code --install-extension PKief.material-icon-theme
code --install-extension platformio.platformio-ide
code --install-extension pranaygp.vscode-css-peek
code --install-extension redhat.fabric8-analytics
code --install-extension redhat.java
code --install-extension redhat.vscode-commons
code --install-extension redhat.vscode-xml
code --install-extension redhat.vscode-yaml
code --install-extension ritwickdey.LiveServer
code --install-extension sidthesloth.html5-boilerplate
code --install-extension TaodongWu.ejs-snippets
code --install-extension tht13.python
code --install-extension tomoki1207.pdf
code --install-extension twxs.cmake
code --install-extension vadimcn.vscode-lldb
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Code Extension List (7)

code --install-extension VisualStudioExptTeam.intellicode-api-usage-examples
code --install-extension VisualStudioExptTeam.vscodeintellicode
code --install-extension vscjava.vscode-java-debug
code --install-extension vscjava.vscode-java-dependency
code --install-extension vscjava.vscode-java-pack
code --install-extension vscjava.vscode-java-test
code --install-extension vscjava.vscode-maven
code --install-extension vscjava.vscode-spring-boot-dashboard
code --install-extension vscjava.vscode-spring-initializr
code --install-extension walkme.HTML5-extension-pack
code --install-extension webfreak.debug
code --install-extension well-ar.plantuml
code --install-extension wildboar.asn1
code --install-extension Zignd.html-css-class-completion
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (1)

  • Download and install Visual Studio Community Edition
  • Select All Development Environments from Installer.

Ücretsiz Geliştirici Yazılımları ve Hizmetleri - Visual Studio

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (2)

  • After installation open Visual Studio 2022` from the menu.

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (3)

  • The application will start...

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (4)

  • From Opening Window Select Create a new project
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (5)

  • There will be several options, you can review them.

  • Select Windows, C++, Console Application from Combobox.

  • Select Console Application

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (6)

  • Give a solution and project name.
  • Select save location
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (7)

  • You will have C++ basic Hello World application.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (8)

  • You will have C++ basic Hello World application.
// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (9)

  • We need to rename the file extension to c from cpp
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (10)

  • If you compile the source C compiler will be used.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (11)

  • We need to update our source for C as follows
// ConsoleApplication1.c : This file contains the 'main' function. Program execution begins and ends there.
//

#include <stdio.h>

int main(){
    printf("Hello World!\n");
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (12)

  • We need to update our source for C as follows
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (13)

  • Put a breakpoint by clicking the following location. Breakpoints will be stop points for our debugging operations.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (14)

  • Then select Debug configuration and according to your operating system select x64 or x86 configuration and click Local Windows Debugger
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (15)

  • Update your source code as follow
// ConsoleApplication1.c : This file contains the 'main' function. Program execution begins and ends there.
//

#include <stdio.h>

int sum(int input1, int input2);

int main(){
    int number = 5;
    printf("Before Increment : %d\n",number);
    number = sum(number, 5);
    printf("After Increment : %d\n", number);
}

int sum(int input1, int input2){
    return input1 + input2;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (16)

  • Put the following breakpoints and run the debugger. On number, the variable pins the variable to see its value in real-time.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (17)

  • Open Debug->Windows->Memory->Memory1 to see value in memory
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (18)

  • In the memory window copy variable name (number) with address operator (&) and then (&number) press enter.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (19)

  • You can see its value in memory with hexadecimal form (05 00 00 00)
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (20)

  • If you change value with pinned control your memory value and your current value will be updated. 20 in hexadecimal 0x14 (integer is 4 bytes length for this reason memory shows 14 00 00 00)

center

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (21)

  • If you close some windows such as solution explorer, and properties windows you can open them from the View menu.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (22)

  • Solution and Projects have several configurations for each setup such as Release - x86, Release-x64, Debug- x86, and Debug-x64 you need to configure all of them for your requirements. You can access configurations by right-clicking to project and then selecting properties.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (Install / Compile / Run / Debug) (23)

  • Project properties has several settings

center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (2)

Download and install MinGW or LLVM compiler (if you downloded then skip this step)

MinGW installer (gcc / g++)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (3)

LLVM installer (clang)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (4)

Open a console with "cmd" and test the following commands if commands are not recognized then set the system environment variable to add gcc and g++ executable paths to the path variable (add to both system and user path variable)

gcc --version

g++ --version
C:\Users\ugur.coruh>gcc --version
gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (5)

  • Open system environments to update path variable for gcc/g++ and clang

    alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (6)

  • Open "Environment Variables"

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (7)

  • Select path variable from user section.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (8)

  • Select path variable from system section.
    alt:"alt" center
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (9)

  • Update variables add MinGW and LLVM to path gcc.exe g++.exe clang.exe will be in bin folders. Then we can run this commands from command line.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (9)

  • Update variables add MinGW and LLVM to path gcc.exe g++.exe clang.exe will be in bin folders. Then we can run this commands from command line.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (10)

  • for gcc.exe, g++.exe and gdb.exe
C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (11)

  • for clang.exe , lldb.exe we will use the following path
C:\Program Files\LLVM\bin
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (12)

  • This folder paths changes according to your setup

  • Open NppExec extension (install from extension manager if not exist)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (13)

  • Write the following commands in the box
NPP_SAVE // save current file
cd $(CURRENT_DIRECTORY) // go to directory of the current file
gcc  -Wall -Wextra -Wpedantic -std=c++11 -o "$(NAME_PART)" "$(FILE_NAME)"

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Install / Compile ) (14)

  • Save the script as gcc-build and for more information check the following link

  • You can modify or add multiple scripts for another task.

RTEU CE103 Week-2
CE103 Algorithms and Programming I

MSYS2

  • Software Distribution and Building Platform for Windows

https://www.msys2.org/

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (2)

  • Run setup to install the application on your computer.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (4)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (5)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (6)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (7)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (8)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (9)

  • Installation steps.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (10)

  • Generated shortcuts on your desktop

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (11)

  • Run vim hello.c on your command-line to open a c file with vim editor.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (12)

  • You will have the following editor.
  • Use INSERT to change edit options.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (13)

  • Sample source code
#include <stdio.h>
int main()
{
    char name[20];
    printf("Enter Name:");
    scanf("%s",name);
    printf("Your name is %s",name);
    return 0;
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (14)

  • Write source code
  • Press the Esc button to enter command mode
  • Then type :wq. It will save the file and exit from Vim
    • w: write
    • q: quit

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (15)

  • compile source code with gcc
  • link the objects and
  • run executable

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (17)

  • In the folder, you can find your executable. hello.exe

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vi/Vim (C/C++) for Windows (16)

  • compile, link and execute flow will be as follow;
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (1)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (2)

  • Select Java Version and Installation Path

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (3)

  • After installation you can LAUNCH eclipse IDE

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (5)

  • Select a workspace that your project will be saved

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (6)

  • You can find your installation under your user folder

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (7)

  • You can create shortcut to desktop for your working eclipse version.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (8)

  • File -> New -> Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (9)

  • Select C/C++ Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (10)

  • Select C Managed Build, Eclipse CDT will do job for us.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (11)

  • Give project name and select a basic template executable with MinGW GCC.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (12)

  • Configura Basic Settings

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (13)

  • There are default Debug and Release configurations you can add your customized configurations from Advanced Settings.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (14)

  • Project settings will be C Select Debug/Release configuration and then Build Application Project->Build All (Ctrl+B)

  • HelloWorldC.exe will be generated

gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\HelloWorldC.o" "..\\src\\HelloWorldC.c"
gcc -o HelloWorldC.exe "src\\HelloWorldC.o"

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (15)

  • Before build if you want to debug application select debug configuration, put your breakpoints and then Build application again.

  • Right click the generated executable Debug As -> Local C/C++ Application

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (16)

  • Debugger will start and stop at breakpoint as follow.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (16)

  • Check debug control shortcuts and use them

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (17)

  • To watch variables use Expressions and Variables

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (18)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (19)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (20)

  • Generate CMAKE project from new Project and Select CMake Project Template

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (21)

  • Give project name

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (22)

  • This will generate default C++ Hello World project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (23)

  • Build Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (24)

  • It will give following errors, for missing configurations. This errors are generated by CMAKE

  • Then clean and rebuild again.

Errors occurred during the build.
Errors running builder 'CDT Core Builder' on project 'HelloWorldCmakeC'.
Resource '/HelloWorldCmakeC/build/cmake.debug.win32.x86_64/compile_commands.json' does not exist.
Resource '/HelloWorldCmakeC/build/cmake.debug.win32.x86_64/compile_commands.json' does not exist.
Resource '/HelloWorldCmakeC/build/cmake.debug.win32.x86_64/compile_commands.json' does not exist.
Resource '/HelloWorldCmakeC/build/cmake.debug.win32.x86_64/compile_commands.json' does not exist.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (25)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (26)

  • After this operation first Clean project from Project menu and then Build All again

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (27)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (28)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (C/C++) - Compile Only / Debugging Has Problem (29)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (1)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (2)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (5)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (6)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (7)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (C/C++) - Manuel Build/Clean/Run Command Setting Not Good Option for C/C++ Development (8)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Turbo C/C++ (1)

Download Turbo.C.3.2.zip

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Turbo C/C++ (2)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (1)

CMake (http://www.cmake.org/) is a program which generates the Makefiles used by Make.

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (2)

Why use CMake ?

  • Eases Make use
    • but the same way of thinking
    • generate the Makefile
  • Separate the compilation from the sources
  • Multi-platfoms
  • Very flexible
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (3)

  • Check if the libraries/programs are available on your system
  • File generator (configure_file)
  • Calling programs or scripts (doxygen)
  • One of the new standards
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (4) (Download and Install)

use the following link for download

Download | CMake

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (5) (WSL and Linux Environment)

Hello world with CMake

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (6) (Windows Environment)

main.c

#include <stdio.h>
int main()
{
    char name[20];
    printf("Enter name: ");
    scanf("%s", name);
    printf("Your name is %s.", name);
    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.7.2)
project(scanf-sample)
add_executable(scanf-sample main.c)
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (7) (Windows Environment)

put main.c and CMakeLists.txt file in sample-scanf folder and from command line

alt:"alt" center

run the following cmake command with dot (.) to create solution file for c project

C:\Users\ugur.coruh\Desktop\sample-scanf>cmake .
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (8) (Windows Environment)

I have Visual Studio 2022 Community Edition Installed on My Computer, for these reason build tools are selected for visual studio environment and the following outputs are generated

C:\Users\ugur.coruh\Desktop\sample-scanf>cmake .
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.30.30704.0
-- The CXX compiler identification is MSVC 19.30.30704.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30704/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30704/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/ugur.coruh/Desktop/sample-scanf

C:\Users\ugur.coruh\Desktop\sample-scanf>
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (9) (Windows Environment)

also following files are generated

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (10) (Windows Environment)

if we open scanf-sample.sln file we will have automated generated project files

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (11) (Windows Environment)

you can make scanf-sample with startup project with right click and then run on visual studio.

if you want to configure for another build tool you can use Cmake-GUI installed with setup on your computer

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (12) (Windows Environment)

Open GUI and Select File-> Delete Cache

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (13) (Windows Environment)

then you can click "Configure" to select build tool

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (14) (Windows Environment)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C++/C) (15) (Windows Environment)

if you click "Configure" twice it will generate the visual studio solution in build folder

for more detailed examples that include also docker and travis-ci sample you can check the following repo

GitHub - ttroy50/cmake-examples: Useful CMake Examples

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Make (1)

Sample

hello.c

#include <stdio.h>

int main(void)
{
    printf("hello, world\n");
}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Make (2)

Makefile

# This is the default target, which will be built when
# you invoke make
.PHONY: all
all: hello

# This rule tells make how to build hello from hello.cpp
hello: hello.c
    g++ -o hello hello.c

# This rule tells make to copy hello to the binaries subdirectory,
# creating it if necessary
.PHONY: install
install:
    mkdir -p binaries
    cp -p hello binaries

# This rule tells make to delete hello and hello.o
.PHONY: clean
clean:
    rm -f hello
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Make (3)

compile.bat

make all .

will create hello.exe

check hello-make sample

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Make (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

JAVA Environment and Development

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

JDK and JRE Setup (1)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

JDK and JRE Setup (2)

  • JDK (Java Development Kit) is a Kit that provides the environment to develop and execute(run) the Java program. JDK is a kit(or package) that includes two things

    • Development Tools(to provide an environment to develop your java programs)
    • JRE (to execute your java program).
  • JRE (Java Runtime Environment) is an installation package that provides an environment to only run(not develop) the java program(or application)onto your machine. JRE is only used by those who only want to run Java programs that are end-users of your system.

  • JVM (Java Virtual Machine) is a very important part of both JDK and JRE because it is contained or inbuilt in both. Whatever Java program you run using JRE or JDK goes into JVM and JVM is responsible for executing the java program line by line, hence it is also known as an **i*****nterpreter***.

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

System Environments and Paths for Java (1)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

System Environments and Paths for Java (2)

  • Select path variable (JDK should be set there)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

System Environments and Paths for Java (3)

  • JAVA_HOME also should be set

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (1)

  • Open New Project -> Java Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (2)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (5)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (6)

Update code and run

alt:"alt" center

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.ucoruh.mavenproject1;

/**
 *
 * @author ugur.coruh
 */
public class NewClass {

static                  //static block
{
    System.out.println("Static block");
}

public static void main(String args[])  //static method
{
    System.out.println("Static method");
}

}

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (7)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (8)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (9)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Netbeans (Java) (10)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (1)

  • Select File -> New Project

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (2)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (5)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (6)

  • Update source
package ucoruh;

public class HelloClass {

	static {
		System.out.println("Static Block");
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    System.out.println("Static Method");

	}

}
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (7)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Eclipse (Java) (8)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Intellij Idea (Jet Brains) (Java)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

VSCode (Java)

  • Java Extension Run&Debug Java Files

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Java)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (Java)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

C# Environment and Development

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Visual Studio Community Edition (C#)

//TODO//

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (C#)

c:\windows\Microsoft.NET\Framework\v3.5\
c:\windows\Microsoft.NET\Framework\v3.5\bin\csc.exe
            /t:exe /out:MyApplication.exe MyApplication.cs  ...
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cmake (C#)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Common Tools and Platforms

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Fatih Kalem

https://cdnvideo.eba.gov.tr/fatihkalem/fatihkalem_portable.zip

https://cdnvideo.eba.gov.tr/fatihkalem/fatihkalem_setup.exe

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Notepad++ (Notepad for Source Code)

Downloads | Notepad++

RTEU CE103 Week-2
CE103 Algorithms and Programming I

HxD (Hex Editor)

HxD - Freeware Hex Editor and Disk Editor | mh-nexus

RTEU CE103 Week-2
CE103 Algorithms and Programming I

MarktextApp (Markdown Syntax Editor)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cygwin (Linux environment for Windows)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Dependency Walker (32-bit or 64-bit Windows module dependency checker)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Doxygen (Code Documentation)

Doxygen: Doxygen

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Sonarlint (Code Quality and Code Security Extension)

https://www.sonarlint.org/

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Codepen.io (online code sharing)

  • https://codepen.io/

  • CodePen is a social development environment. At its heart, it allows you to write code in the browser, and see the results of it as you build.

  • A useful and liberating online code editor for developers of any skill, and particularly empowering for people learning to code. We focus primarily on front-end languages like HTML, CSS, JavaScript, and preprocessing syntaxes that turn into those things

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Codepen.io (online code sharing)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Codeshare.io (real-time code sharing)

  • https://codeshare.io/

  • Share Code in Real-time with Developers, An online code editor for interviews, troubleshooting, teaching & more…

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Codebeautify.org (online data conversion tools)

  • Has several tools for developers (Code Formatter, JSON Beautifier, XML Viewer, Hex Converters and more...)
  • https://codebeautify.org/
RTEU CE103 Week-2
CE103 Algorithms and Programming I

AsciiFlow.com (ASCII drawing tool)

  • Asciflow provides ascii based drawings that you can copy directly to textfiles and source codes. Visit the following link

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Freemind (opensource mindmap application)

  • Freemind is open source java based desktop mindmap application. Can export files to several formats

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Mockup Designers

RTEU CE103 Week-2
CE103 Algorithms and Programming I

PlantUML (software designer)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Drawio (drawing tool)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Putty (Remote Connection)

  • Commonly use for SSH connection

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I
  • We can run a SSH server with MobaXterm and can connect to same computer with Putty.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Download file over SSH Protocol

Here are some useful examples for downloading files from the remote system over SSH protocol.

  • This will connect to example.com server with user “username” and copy the /backup/file.zip file to local system directory /local/dir. To use theis command replace the values as per your environment.

    scp username@example.com:/backup/file.zip /local/dir
    
  • If the SSH is running on a non-standard port, You can specify the port using -P option with SCP command.

    scp -P 2222 username@example.com:/backup/file.zip /local/dir
    
  • If your remote server required a private key to connect server, You can use -i followed by a private key file path to connect your server using the SCP command. This can be helpful for AWS servers.

    scp -i private_key.pem username@example.com:/backup/file.zip /local/dir
    
RTEU CE103 Week-2
CE103 Algorithms and Programming I

Upload file using SSH

You can also upload files to the remote server using SSH protocol using the SCP command. Use the following example command for uploading files to the SSH server.

scp file.zip username@example.com:/remote/dir

Similarity you can use -P switch to define port of the SSH server and -i to define private key for the user authentication.

RTEU CE103 Week-2
CE103 Algorithms and Programming I
RTEU CE103 Week-2
CE103 Algorithms and Programming I
RTEU CE103 Week-2
CE103 Algorithms and Programming I

MobaXterm (Remote Connection)

  • Multip Purpose Remote Connection Toolkit

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Teamviewer (Remote Connection)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

AnyDesk

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Paletton.com and Colorhunt.co (Color Chooser)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Understand (Static Code Analysis)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

JD Project (Java Decompiler)

  • Java Decompiler for Jar and Class Files, If code is not obfuscated it recover source code from compiled files. Just drag and drop files to GUI

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Cutter (Multi-Platform Reverse Engineering Tool)

  • Cutter's goal is to be an advanced FREE and open-source reverse-engineering platform while keeping the user experience at mind. Cutter is created by reverse engineers for reverse engineers.

  • https://cutter.re/

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

IDA Pro / Freeware (Native Reverse Engineering Tool)

  • IDA Pro as a disassembler is capable of creating maps of their execution to show the binary instructions that are actually executed by the processor in a symbolic representation (assembly language). Advanced techniques have been implemented into IDA Pro so that it can generate assembly language source code from machine-executable code and make this complex code more human-readable.
RTEU CE103 Week-2
CE103 Algorithms and Programming I

IDA Pro / Freeware (Native Reverse Engineering Tool)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

IDA Pro / Freeware (Native Reverse Engineering Tool)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Code Visualization (Python, C , C++ , Java)

  • This coding tutor tool helps you learn Python, JavaScript, C, C++, and Java by visualizing code execution.

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Assembly of C Code

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Mobile Device Screen Sharing for Demo

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Travis-CI

  • Travis-CI is a continues integration platform

  • Travis-CI free option removed for this reason, its not in our scope.

  • It uses Travis.yml files for actions.

RTEU CE103 Week-2
CE103 Algorithms and Programming I

AppVeyor

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Jenkins

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Jenkins

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Jenkins

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Vagrant

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (1)

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (2)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (5)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Docker / Docker Compose / Kubernetes (6)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Nuget Packages (1)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

NuGet Tools (2)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Managing dependencies (3)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Tracking references and restoring packages (4)

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

SCV Cryptomanager

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Addario CryptoBench

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Raymond's MD5 & SHA Checksum Utility

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

SlavaSoft HashCalc

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Portable PGP

  • Portable PGP uses for the generation of PGP keys to transfer files securely via e-mail or other channels. You can encrypt or sign your documents with this tool then the receiver can open or verify your e-mail.

  • https://ppgp.sourceforge.net/

alt:"alt" center

RTEU CE103 Week-2
CE103 Algorithms and Programming I

Online Programming Envoriments

RTEU CE103 Week-2
CE103 Algorithms and Programming I

RTEU CE103 Week-2