“Nerds Only” Thread :)

Take that back poopy :mad::mad::mad::mad::mad::mad::mad::cool::cool::cool::cool:
look at what i just got done writing

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <list>

// Function to display the vector when we need to
void display(const std::vector<int> &vec) {
std::cout << "\n";

for(auto const &i : vec) {
std::cout << i << " ";
}

std::cout << "\n";
}

void test_1() {
std::vector<int> nums = {1, 2, 3, 4, 5};
auto it = nums.begin();

std::cout << *it << std::endl;

it++;
std::cout << *it << std::endl;

it += 2;
std::cout << *it << std::endl;

it = nums.end() - 1;
std::cout << *it << std::endl;
}

void test_2() {
std::cout << "\n========== Function 2 ==========\n" << std::endl;

std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::iterator it = nums.begin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

it = nums.begin();

while(it != nums.end()) {
*it = 0;
it++;
}

display(nums);
}

void test_3() {
std::cout << "\n========== Function 3 ==========\n" << std::endl;

// Using a constant iterator
std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::const_iterator it = nums.begin();
// Same as: auto it = nums.cbegin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

// However, attempting to mutate the vector will result in a compiler error!
}

void test_4() {
std::cout << "\n========== Function 4 ==========\n" << std::endl;

// Using a reverse iterator
std::vector<int> vec = {1, 2, 3, 4, 5};
auto it = vec.rbegin(); // 5

while(it != vec.rend()) {
std::cout << *it << std::endl;
it++;
}

std::cout << "\n";

// Const reverse iterator over a list
std::list<std::string> names = {"Larry", "Moe", "Curly"};
auto it_2 = names.crbegin();

std::cout << *it_2 << std::endl;

it++; // Points to Moe
std::cout << *it_2 << std::endl;

std::cout << "\n";

// Iterate over a map
std::map<std::string, std::string> favs;

favs.insert({"Frank", "C++"});
favs.insert({"Joma", "Python"});
favs.insert({"Jonas", "JavaScript"});

auto it_3 = favs.begin();

while(it_3 != favs.end()) {
std::cout << it_3 -> first << " likes " << it_3 -> second << std::endl;
it_3++;
}
}

void test_5() {
std::cout << "\n========== Function 5 ==========\n" << std::endl;

std::vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

// We can start and begin where desired
auto start = vec.begin() + 2; // 3
auto finish = vec.end() - 3; // 8

while(start != finish) {
std::cout << *start << std::endl;
start++;
}
}

int main() {
// 5 example functions of how iterators work
test_1();
test_2();
test_3();
test_4();
test_5();

return 0;
}
View reply.
 
look at what i just got done writing

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <list>

// Function to display the vector when we need to
void display(const std::vector<int> &vec) {
std::cout << "\n";

for(auto const &i : vec) {
std::cout << i << " ";
}

std::cout << "\n";
}

void test_1() {
std::vector<int> nums = {1, 2, 3, 4, 5};
auto it = nums.begin();

std::cout << *it << std::endl;

it++;
std::cout << *it << std::endl;

it += 2;
std::cout << *it << std::endl;

it = nums.end() - 1;
std::cout << *it << std::endl;
}

void test_2() {
std::cout << "\n========== Function 2 ==========\n" << std::endl;

std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::iterator it = nums.begin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

it = nums.begin();

while(it != nums.end()) {
*it = 0;
it++;
}

display(nums);
}

void test_3() {
std::cout << "\n========== Function 3 ==========\n" << std::endl;

// Using a constant iterator
std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::const_iterator it = nums.begin();
// Same as: auto it = nums.cbegin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

// However, attempting to mutate the vector will result in a compiler error!
}

void test_4() {
std::cout << "\n========== Function 4 ==========\n" << std::endl;

// Using a reverse iterator
std::vector<int> vec = {1, 2, 3, 4, 5};
auto it = vec.rbegin(); // 5

while(it != vec.rend()) {
std::cout << *it << std::endl;
it++;
}

std::cout << "\n";

// Const reverse iterator over a list
std::list<std::string> names = {"Larry", "Moe", "Curly"};
auto it_2 = names.crbegin();

std::cout << *it_2 << std::endl;

it++; // Points to Moe
std::cout << *it_2 << std::endl;

std::cout << "\n";

// Iterate over a map
std::map<std::string, std::string> favs;

favs.insert({"Frank", "C++"});
favs.insert({"Joma", "Python"});
favs.insert({"Jonas", "JavaScript"});

auto it_3 = favs.begin();

while(it_3 != favs.end()) {
std::cout << it_3 -> first << " likes " << it_3 -> second << std::endl;
it_3++;
}
}

void test_5() {
std::cout << "\n========== Function 5 ==========\n" << std::endl;

std::vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

// We can start and begin where desired
auto start = vec.begin() + 2; // 3
auto finish = vec.end() - 3; // 8

while(start != finish) {
std::cout << *start << std::endl;
start++;
}
}

int main() {
// 5 example functions of how iterators work
test_1();
test_2();
test_3();
test_4();
test_5();

return 0;
}



YAY!!!!!!!!:mrgreen::mrgreen::(:(:(:(:mrgreen::mrgreen::mrgreen::p:p:p:p:p:eek::devilish::eek::eek::devilish::eek::eek::eek::eek::eek: talented who :lmao::lmao::lmao::lmao::lmao::lmao::lmao::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown:
View reply.
 
look at what i just got done writing

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <list>

// Function to display the vector when we need to
void display(const std::vector<int> &vec) {
std::cout << "\n";

for(auto const &i : vec) {
std::cout << i << " ";
}

std::cout << "\n";
}

void test_1() {
std::vector<int> nums = {1, 2, 3, 4, 5};
auto it = nums.begin();

std::cout << *it << std::endl;

it++;
std::cout << *it << std::endl;

it += 2;
std::cout << *it << std::endl;

it = nums.end() - 1;
std::cout << *it << std::endl;
}

void test_2() {
std::cout << "\n========== Function 2 ==========\n" << std::endl;

std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::iterator it = nums.begin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

it = nums.begin();

while(it != nums.end()) {
*it = 0;
it++;
}

display(nums);
}

void test_3() {
std::cout << "\n========== Function 3 ==========\n" << std::endl;

// Using a constant iterator
std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::const_iterator it = nums.begin();
// Same as: auto it = nums.cbegin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

// However, attempting to mutate the vector will result in a compiler error!
}

void test_4() {
std::cout << "\n========== Function 4 ==========\n" << std::endl;

// Using a reverse iterator
std::vector<int> vec = {1, 2, 3, 4, 5};
auto it = vec.rbegin(); // 5

while(it != vec.rend()) {
std::cout << *it << std::endl;
it++;
}

std::cout << "\n";

// Const reverse iterator over a list
std::list<std::string> names = {"Larry", "Moe", "Curly"};
auto it_2 = names.crbegin();

std::cout << *it_2 << std::endl;

it++; // Points to Moe
std::cout << *it_2 << std::endl;

std::cout << "\n";

// Iterate over a map
std::map<std::string, std::string> favs;

favs.insert({"Frank", "C++"});
favs.insert({"Joma", "Python"});
favs.insert({"Jonas", "JavaScript"});

auto it_3 = favs.begin();

while(it_3 != favs.end()) {
std::cout << it_3 -> first << " likes " << it_3 -> second << std::endl;
it_3++;
}
}

void test_5() {
std::cout << "\n========== Function 5 ==========\n" << std::endl;

std::vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

// We can start and begin where desired
auto start = vec.begin() + 2; // 3
auto finish = vec.end() - 3; // 8

while(start != finish) {
std::cout << *start << std::endl;
start++;
}
}

int main() {
// 5 example functions of how iterators work
test_1();
test_2();
test_3();
test_4();
test_5();

return 0;
}
Interesting list of functions. I found it interesting that you loaded libraries that weren't used and I also like the usage of arrays. It seems like the way in which you write comments in your code is a lot more professional than on forums. lol
View reply.
 
Interesting list of functions. I found it interesting that you loaded libraries that weren't used and I also like the usage of arrays. It seems like the way in which you write comments in your code is a lot more professional than on forums. lol
Haha yeah I like to write functions like these for future reference and stuff. How's Python anyway? I want to go into the more advanced features soon
View reply.
 
483tc7.png
View reply.
 
Haha yeah I like to write functions like these for future reference and stuff. How's Python anyway? I want to go into the more advanced features soon
Python is pretty decent. Didn't spend too much time on it although I thought it wasn't that difficult to get into and really experiment with.
View reply.
 
look at what i just got done writing

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <list>

// Function to display the vector when we need to
void display(const std::vector<int> &vec) {
std::cout << "\n";

for(auto const &i : vec) {
std::cout << i << " ";
}

std::cout << "\n";
}

void test_1() {
std::vector<int> nums = {1, 2, 3, 4, 5};
auto it = nums.begin();

std::cout << *it << std::endl;

it++;
std::cout << *it << std::endl;

it += 2;
std::cout << *it << std::endl;

it = nums.end() - 1;
std::cout << *it << std::endl;
}

void test_2() {
std::cout << "\n========== Function 2 ==========\n" << std::endl;

std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::iterator it = nums.begin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

it = nums.begin();

while(it != nums.end()) {
*it = 0;
it++;
}

display(nums);
}

void test_3() {
std::cout << "\n========== Function 3 ==========\n" << std::endl;

// Using a constant iterator
std::vector<int> nums = {1, 2, 3, 4, 5};
std::vector<int>::const_iterator it = nums.begin();
// Same as: auto it = nums.cbegin();

while(it != nums.end()) {
std::cout << *it << std::endl;
it++;
}

// However, attempting to mutate the vector will result in a compiler error!
}

void test_4() {
std::cout << "\n========== Function 4 ==========\n" << std::endl;

// Using a reverse iterator
std::vector<int> vec = {1, 2, 3, 4, 5};
auto it = vec.rbegin(); // 5

while(it != vec.rend()) {
std::cout << *it << std::endl;
it++;
}

std::cout << "\n";

// Const reverse iterator over a list
std::list<std::string> names = {"Larry", "Moe", "Curly"};
auto it_2 = names.crbegin();

std::cout << *it_2 << std::endl;

it++; // Points to Moe
std::cout << *it_2 << std::endl;

std::cout << "\n";

// Iterate over a map
std::map<std::string, std::string> favs;

favs.insert({"Frank", "C++"});
favs.insert({"Joma", "Python"});
favs.insert({"Jonas", "JavaScript"});

auto it_3 = favs.begin();

while(it_3 != favs.end()) {
std::cout << it_3 -> first << " likes " << it_3 -> second << std::endl;
it_3++;
}
}

void test_5() {
std::cout << "\n========== Function 5 ==========\n" << std::endl;

std::vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

// We can start and begin where desired
auto start = vec.begin() + 2; // 3
auto finish = vec.end() - 3; // 8

while(start != finish) {
std::cout << *start << std::endl;
start++;
}
}

int main() {
// 5 example functions of how iterators work
test_1();
test_2();
test_3();
test_4();
test_5();

return 0;
}
As a python coder and Java you need to set a variable to return the code And repeat it, this Means She is only a small nerd it’s nice knowing someone else loves coding too!

one time I hacked into the schools gogaurdian but go expelled

fun fact: I created a VPN using python websites
View reply.
 
As a python coder and Java you need to set a variable to return the code And repeat it, this Means She is only a small nerd it’s nice knowing someone else loves coding too!

one time I hacked into the schools gogaurdian but go expelled

fun fact: I created a VPN using python websites
upload_2021-2-26_7-9-12.png
View reply.
 
Agreed. Python is not the right language to program your own VPN in if you were to go ahead and do that for some reason. Also that page is designed through html.
Having a vpn does require quite a bit of specialized networking hardware as you are basically passing through networking information within your own networking equipment rather than what your internet service provider has to offer.
View reply.
 
Agreed. Python is not the right language to program your own VPN in if you were to go ahead and do that for some reason. Also that page is designed through html.
Having a vpn does require quite a bit of specialized networking hardware as you are basically passing through networking information within your own networking equipment rather than what your internet service provider has to offer.
You’re right thanks for telling me :) I will prolly need help but Tysm for the info, As I’m tryna become an app creator

I got from a yt vid that you can sue python but their wrong :/
View reply.
 

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

Back
Top