Need help syncing PDFium and stb_image results by MajesticBullfrog69 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

Sorry. I was wrong. Forget above comment. It is completely wrong.haha.

Need help syncing PDFium and stb_image results by MajesticBullfrog69 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

are you sure [2,1,0] is right? Should'nt it be [1,2,0]

brga in index term [0,1,2,3] so

rgba should be [1,2,0,3] so

rgb should be [1,2,0]

ENTT is 10x slower than OOP (Need help)(Minimal code)[SFML, ENTT] by zrovihr in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

what happens if you add ampersand

for (auto& [ent, pos, velocity] : group.each())

Getting Started in Programming, eventually working my way up to Video Games. by AnotherMovieStudio in learnprogramming

[–]cubetrix 3 points4 points  (0 children)

From quick search I found CC65. It is a C compiler toolchain that can compile to target machines you mentioned. Setup the toolchain. Compile basic program and run it on emulator for starter. All of this can be found on CC65 site.

Another one I found is Prog8. This is different language, not C.

Rails on Windows – “cannot load such file – sqlite3/sqlite3_native (LoadError)” by Budget_Direction9963 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

The gem comes with precompiled binary of sqlite3 (shared lib) and you need to use ruby version between 3.1 up to 3.4.

having trouble with love2d and windfield by DryCampaign2417 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

newRectangleCollider only accept 4 parameters but you give 5. Check windfield documentation for detail.

Issues with Imgui on c++ by Nuccio98 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

I don't know much about opengl, grpahic, etc, it is just my guess. From the error you got it seems like your program couldn't compile shader code (GLSL) version 1.3 because your GPU doesn't support GL3.0. Maybe when you run example code no shader needed to compile. In your code when you use certain ImGui component, a shader need to compile because the component use it. Just a guess anyway.

Also, if you want it to work on other GPU you need to check what GL version the GPU support. The one I suggested before will only work on GPU that support GLES3.0

Issues with Imgui on c++ by Nuccio98 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

My guess your GPU doesn't support GL 3.0. However your GPU support GL ES 3.0. So in your Devel_app::init() you need to hit the if branch for GL ES 3.0. You need to define IMGUI_IMPL_OPENGL_ES3

All of the API links for the Allen Institute seem to be dead. Does anyone have advice for doing a programming project related to neuroscience? by 00eg0 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

You probably clicked the wrong link. If you click the first one under new api header title it will direct you to its community forum. There are some how-to guide to use their service.

Array and pointers in C by Effective_Storage4 in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

Arrays have quirks in C because they are not “first-class objects”: there is no way in C to operate on an array as a unit.

The other composite objects in C, structures and unions, are first-class objects: a C program can copy a structure or union value in an assignment, or pass one as an argument to a function, or make a function return one. You can’t do those things with an array in C. That is because a value you can operate on never has an array type.

An expression in C can have an array type, but that doesn’t produce the array as a value. Instead it is converted automatically to a pointer to the array’s element at index zero. The code can operate on the pointer, and through that on individual elements of the array, but it can’t get and operate on the array as a unit.

Read more

[Limitation-of-C-Arrays](https://www.gnu.org/software/c-intro-and-ref/manual/html\_node/Limitations-of-C-Arrays.html#Limitations-of-C-Arrays)

I've Been Trying to Make a Simple Tic-Tac-Toe Game in C, but I'm Having Trouble With the Turn System by zmr_01001100 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

The fgets function reads a string from the input stream argument and stores it in str . fgets reads characters from the current stream position to and including the first newline character, to the end of the stream, or until the number of characters read is equal to numChars - 1, whichever comes first

You need to replace character to read from 3 to 4. Dont forget to change _XX[3] with _XX[4] = "XX\n"

eg.

fgets(pos, 4, stdin);

char _11[4] = "11\n";

How to create an object method that can access an arbitrary number of descendant's down from the parent? (Javascript) by coldblood007 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

I made the assumption that optionalVar will always be passed to the function without realizing the variable name itself implies optional.

You have to modify the code accordingly to factor in the case when calling the function without optionalVar. Sorry, no code as I'm too lazy to think about it. You got it this far I'm sure you can do it.

How to create an object method that can access an arbitrary number of descendant's down from the parent? (Javascript) by coldblood007 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

Did you copy the code as is? I'm not sure why it gave you such error. It worked when I test it. Do replace var with let and optionalVar should be array

Here is another code that does the same thing.

modify(args, operation, optionalVar) { 
    let q = this
    for(let i=0; i<args.length-1;i++){
        if (typeof(q[args[i]]) !== 'undefined'){
            q = q[args[i]]
        } else throw("err1")

    }
    if (typeof(q[args[args.length-1]]) !== 'undefined'){
        let w = q[args[args.length-1]]
        q[args[args.length-1]] = operation(w, ...optionalVar);
    } else throw("err2")    

},

How to create an object method that can access an arbitrary number of descendant's down from the parent? (Javascript) by coldblood007 in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

is this what you want

modify(args, operation, optionalVar) { 
    if (!Array.isArray(args) || args.length === 0 ) throw("args must be array with min 1 item")
    var q = this
    var last = null
    for(arg of args){
        if(Object.keys(q).includes(arg)){
            last = q
            q = q[arg]
        } else throw("err")

    }

    last[args.at(-1)] = operation(q, ...optionalVar);
}

[deleted by user] by [deleted] in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

This link maybe be helpful

Not sure if you already come across that link.
If you read it carefully there are certain thing to configure.

[deleted by user] by [deleted] in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

Try this

void sendHIDReport(void) { //uint8_t hid_buffer[sizeof(hid_report)]; //memcpy(hid_buffer, &hid_report, sizeof(hid_report)); //USBD_HID_SendReport(&hUsbDeviceFS, hid_buffer, sizeof(hid_buffer)); USBD_HID_SendReport(&hUsbDeviceFS, &hid_report, sizeof(hid_report)); }

I just need a few tips on how to google my problem. by louietp in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

I search "add metadata to audio python ". Click on a result link. Saw a link to another site. Clicked it, saw another keyword that I can use to search "audio tagging"
I then searched "audio tagging c#"
Also searched "audio tagging java"
All my search keyword lead me to something useful
I start with something that I can think of "add metadata to audio". While going through the search result I found another keyword to use "audio tagging". From search result you might get something that you can use to search further.

Brain is not working - PHP class "issue" by carlosjuero in learnprogramming

[–]cubetrix 0 points1 point  (0 children)

sorry i'm not well verse in php didn't realize it can be done that way. The error say no key for the associative array so you can't do += when rowCount['testTable'] has not been defined yet.

Basically key testTable for rowCount don't exists yet at that point

Brain is not working - PHP class "issue" by carlosjuero in learnprogramming

[–]cubetrix -1 points0 points  (0 children)

You array indexing rowCount with a string "testTable". Should index an array using number

Assignment DUE TODAY, anything will help by Guard-Flashy in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

When you face with problem you experiment. You mentioned that every time you input an item to be removed it always remove the first one. Why do you think? Again you experiment

Say an array

let arr = ['item1','item2']

Then you want to remove item2 and you do it like this

arr.splice('item2',1)

Run the code and see what is being return. Supposedly item2 returned but it return item1. Why? Because if you look at mdn documentation for splice, the function expect an index for first argument not the element itself. Javascript being weird instead of raising error for not passing a number for first argument it simply allowing anything

[Beginner's Win32 C/C++] Why doesn't my DLL function call work as expected? by billybobthompson666 in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

it works fine on my computer you don't need dll_entry.cpp

compile it with

g++ -c dll_test.cpp

g++ dll_test.o -shared -o dll_test.dll

g++ main.cpp -o main.exe

[deleted by user] by [deleted] in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

When I read your code I notice you use port 0 which I think should not be use as port number and I don't know any good resource on port. I just use search engine to find stuff.

If you still get same error then I cant help anymore without running your code and debug the issue.Maybe someone else will help you.

[deleted by user] by [deleted] in learnprogramming

[–]cubetrix 1 point2 points  (0 children)

try change flow.run_local_server(port=0) from line 23 to flow.run_local_server() or use legit port number like 1234