Follow:
- A History Of The Combine
- Account
- Account
- All Groups
- All Posts As Of 11/25/23
- All Users
- Animal Light
- Change Password
- Create Group
- Dashboard
- Default User Group
- Edit
- Forgot Password
- Forgot Password?
- Login
- Login
- Login
- Login (Downloads)
- Messaging (ProfileGrid)
- Moon
- My Profile
- Operating Systems
- Order Received
- Password Recovery
- Payment
- Payments
- Profile
- Register
- Register (Downloads)
- Registration
- Registration Form
- Reset Password
- Search Users
- Sign-Up Form
- Submit New Blog Post
- Subscription
- Thank You
- User Blogs
- Users
- Users List Item
- by Kato MegumiI want to write a general version of gradient descent algorithm in c++ to pass the following gtest. ... #include TEST(HW6Test, TEST1) { auto min1 = q1::gradient_descent(0.01, 0.1, cos); EXPECT_NEAR(min1, 3.14, 0.1); auto min2 = q1::gradient_descent(0.01, 0.01, cos); EXPECT_NEAR(min2, 3.14, 0.01); } TEST(HW6Test, TEST2) { auto min = q1::gradient_descent(0.01, 0.01, [](double a){return sin(a)+cos(a);}); EXPECT_NEAR(min, -2.36, 0.01); } TEST(HW6Test, TEST3) { struct Func { double operator()(double a) {return cos(a);} }; auto min = q1::gradient_descent(0.01, 0.01, Func{}); EXPECT_NEAR(min, 3.14, 0.01); } TEST(HW6Test, TEST4) { struct Func { double operator()(double a) {return sin(a);} }; auto min = q1::gradient_descent(0.0, 0.01); EXPECT_NEAR(min, -1.57, 0.01); } […]
- by Mayank BansalI want to know how can I start my journey of learning C++ language and where I should start my journey, such as on YouTube or by taking a course, and what things I need to remember about learning the C++ language and which topics I should cover first so that my experience becomes better. After learning C++ for about two months, I expect to be able to answer some difficult questions about the language with ease.
- by TimI am trying to merge an array of individually sorted linked lists together to one sorted linked list (this is leetcode problem 23 btw). The linked list is defined as: struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(next) {} }; And my function look like this: ListNode* mergeKLists(vector &lists) { ListNode *head = new ListNode(-1); ListNode *current = head; while (find_if(lists.begin(), lists.end(), [](ListNode *node) { return node; }) != lists.end()) { ListNode **pSmallest = nullptr; // find smallest node value for (int i […]
- by Timur KhalikshinI'm facing a problem using mutexes in two different threads. I have two thread functions: a producer, which receives data from the user and writes it to a global variable, and a consumer, which receives this data from a global variable, processes it and returns it to the user. Therefore, I created two mutexes: "Information generated" and "Information processed". The first is in the “open” state when information has been received from the user and has already been recorded in a global variable, and in the “closed” state when this has not yet happened. The second is in the “open” […]
- by gorgomitI have a piece of code that returns an std::pair structure as below and it behaves differently on my debug and release builds std::pair: Works well in debug build, doesn’t work on release build (I get corrupted data) std::pair: Works well both in debug and release builds std::pair: reference_wrapper is created via std::cref, works well both in debug and release builds I have a logic as below (it is the version with const MyData&): std::pair MyClass::GetData() const { // MyData has some complex data and data structure in it // MyData is held in std::map myMap // Perform some searching […]
- by Sahil ShaikhHow to write a C++ program to find GCD of two numbers using object-oriented programming? I tried simple variable inputs and used a function, but I cannot understand the exact logic that is used in writing this program using object oriented programming.
- by Police DriverThe link is: https://github.com/rubbertoe98/vWeaponsToolkit Every time i try to compile this file, it gives me a buch of different errors (even when it is fresh) I was on a server asking someone for help. He said that it looks very broken, can someone help me check if it is indeed very broken? Because i youst cant get to compiling (Im new to)
- by firfghr25I am having trouble with my project. Prior to adding the light features my wall texture was loading. Now it will not load when running and is just a color instead of a wall texture. I am sure that my location of the wall.jpg is correct, as this worked on my last project and I used it as my base for this project. Below is my current code: const char* texFilename = "wall.jpg"; #include #include // GLFW library #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" // Image loading Utility functions // GLM Math Header inclusions #include #include #include #include "shader.h" #include "camera.h" // […]
- by axuI am on a MacOS (Sonoma 14.1.1) and I use VSCode to code with C++. About a week ago, the compiler unexpectedly broke, and none of my code is able to run. I tried to reinstall clang, but my terminal said it was in the folder ~/Library/Developer/CommandLineTools/usr/bin... a folder that does not exist on my computer. I can't reinstall it using xcode-select --install since my computer thinks clang already exists on my computer. I am the only person that uses this computer. Is there anything else I should try?
- by Allay466So I want to make a shared library, and testing how it works... But I just don't understand what am I doing wrong here... main.cpp: //main.cpp #include __declspec(dllimport) int foo(int); int main() { std::cout
- by czmeadI am trying to get a colored box to blit on top of a black surface that I'm using as my window background. But when I compile and run this program all I get is the black window screen: #include #include #include using namespace std; int main(int argc, char** args) { //Initializes SDL, and all subsystems if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { cout
- by Boblet67I am tying to make a 3D game in linux in c++ with GLFW and glad. But proper 3D perspective is not correctly working and I can't work out why. This should draw an orange triangle which gets smaller when you get further away and bigger when you get closer but it never changes size and only ends up reaching the clipping planes and disappearing. Plus, if this helps, if I have the triangle at a z of 0 I can't see it even if I move back or forth. Here is the code: #include #include "glad/glad.h" #include "GLFW/glfw3.h" #include […]
- by Miroslav KrajcirI have a templated Base class with 2 virtual methods begin() and end(). I also have Derived1 class, derived from Base class and Derived2 class, derived from Derived1 class. I am overriding method "begin()" in first derived class, and method "end()' in second derived class. Bud i cannot access/use the method "end()" in my first derived class. Why? #include template class Base { public: virtual T begin() = 0; virtual T end() = 0; }; template class Derived1 : public Base { public: T begin() override { return Base::end() - 10; // not working // return end() - 10; // […]
- by DemarKo Santoshelp guys, my flex sensor (this is my second attempt), doesnt work, im trying to have the flex sensor when bent at a 45 degree angle send an infared code but so far i cant even get it to turn on a light. i need help because this is my school project and im like actually about to lose my mind. code if it helps: int flexs = A0; // Flex sensor connected to analog pin A0 const int LED_PIN = 12; // LED connected to digital pin 12 void setup() { Serial.begin(9600); pinMode(LED_PIN, OUTPUT); } void loop() { int […]
- by ZebrafishI make a module file: #include export module MyModule; export void MyFunc() { std::filesystem::exists("name"); } export class Application {public: static void func() { std::filesystem::exists("name"); } }; And then in main.cpp (non-module): import MyModule; int main() { MyFunc(); // Is FINE Application::func(); // Error Cannot find 'std::partial_ordering': Please include header return 0; } What is happening? Is it related to this bug? I'm on Version 17.7.6.
- by JimI want to write a C++ class with such a definition: template struct Counter { static constexpr inline std::size_t valueOfA = A; T value; }; I want to have a member function addOne(), such that it consumes itself, e.g. Counter and returns itself but of a type where its type parameter is the sum of 1 and its previous type argument, e.g. Counter. Simply put, Counter Counter.addOne(). addOne() should also consume itself such that all variables referencing to Counter should not be valid variables after addOne() is called. GodBolt The compiler error I got this: x86-64 clang 15.0.0 x86-64 clang […]
- by Sourav Paul#include #include #include #include #include #include #include "http_server.hh" using namespace boost::asio; using ip::tcp; std::string desired_IP_address = "172.16.0.2"; // For example purposes class Session : public std::enable_shared_from_this { public: Session(ip::tcp::resolver& resolver,tcp::socket socket, tcp::socket client_socket) : socket_(std::move(socket)), resolver_(resolver), client_socket_(std::move(client_socket)) {} void start() { do_read(); } private: void do_read() { auto self(shared_from_this()); socket_.async_read_some( boost::asio::buffer(data_), [this, self](boost::system::error_code ec, std::size_t length) { if (!ec) { std::string request(data_.data(), length); path_ = extract_path(request); resolver_.async_resolve( ip::tcp::resolver::query("172.16.0.4", "5000"), [this,self](const boost::system::error_code& ec, ip::tcp::resolver::iterator it) { if (ec) { std::cout
- by Mario Rosenbohmi create in win32 c++ plugin on a *.rc-file a COMBOBOX with drop-down-list: COMBOBOX IDC_CCODE_EDT_PNR,60,18,83,27,CBS_DROPDOWN | WS_VISIBLE | CBS_SORT | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP Create the owner window by: _hSelf = ::CreateDialogParam(_hInst, MAKEINTRESOURCE(dialogID), _hParent, dlgProc, reinterpret_cast(this)); On init requester is setting the items by: ::SendMessage(cbPointCode, CB_ADDSTRING, 0, (LPARAM)StringTools::GetWString(codes->at(i)).c_str()); On open drop-down-list is resizing okay, but items is not drawing, black text on black background. Only after mouse over is draw the item. What must i do to init drawing drop-down-list on open? regards Mario (edit add create window)
- by Abdullah AkçamI am creating a mod for a game that uses il2cpp backend. I have been facing a weird phenomenon. I have been iterating the m_Items array and trying to get the objects, but the weird thing is, the key stores the value and the value is NULL. void print_entities(System_Collections_Generic_Dictionary_TKey__TValue__o* pDict) { if (pDict == nullptr) return; System_Collections_Generic_Dictionary_Entry_TKey__TValue__array* entries = pDict->fields._entries; if (entries == nullptr) return; for (uint16_t i = 0; i < entries->max_length; i++) { auto entry = entries->m_Items[i]; auto obj_key = entry.fields.key; // this stores the entry.fields.value auto obj_val = entry.fields.value; // this is null } } Here is […]
- by user3738243I'm trying to integrate ffmpeg directly into my WebAssembly-project. A friend of mine provided me link to a project https://github.com/alfg/ffmpeg-webassembly-example/tree/master which does almost exactly what I'm trying to achieve. It compiles ffmpeg and creates wasm with the necessary bindings to make it usable from Javascript. But instead of building Javascript bindings - like in that example, I would like to make a single stand-alone wasm file that contains ffmpeg. I would like to use CMake for the building process and I've been trying to use that within docker similarly to how the example is built. But I'm having difficulties linking […]
More
https://www.thesatellite.org/ Statistics
- 5
- 920
- 59
- 1,139
- 226
- 12,868
- 28,774
- 28,774
- 28,774
- 1,649
- 3,757
- 0
- 50
- 40
- 1
- 0
- 157
- 1
- 0
- 2
- December 2, 2023
Last 10 Posts…
-
Asian / China / Chinese / Dynasty Warriors / The Asians / The Chinese / The Jinping Dynasty / Xi Jinping
November 25, 2023
-
C Compiler / C++ / C++ Compiler / C++ Programming / Coding / CPP / Programming / The C Programming Language / The C++ / The C++ Programming Language
C++ Vector Of Vectors Of Objects
November 22, 2023
-
Free Energy / Free State / Light / Negative Energy / New Energy / Positive Energy
November 18, 2023
-
Coding / Light / More / Negative Energy / The Combine / The Combine Overwatch / The Negative / The Positive
November 14, 2023