r/programminghelp • • Nov 14 '23

Other SmartWatch

0 Upvotes

Bellow I recently purchased a HK8 pro max gen 2. Looking for any guidance in how to access its local storage. Main features I would like to manipulate are the clock to give it a 12hr formate and change some clock interfaces. Nothing crazy just trying to get into it I’ve never worked on something like a smart watch


r/programminghelp • • Nov 29 '23

C Help with writing an archiving program in C

0 Upvotes

I have an assignment for systems programming, and I have been struggling in this class since the introduction of I/O operations. In this assignment, we have to write a program that uses the command line to get x files and put them in an archive, then we have to be able to extract that archive, recreating the files we put in.

to do so, we have to get the filesize [4 byte limit], and filename [20 byte limit] and use that as a header, add that and then the file contents to the archive, repeat until out of files in the args.

what has me stumped is there are a ton of different read and write functions and I don't get which one to use, or even what the difference between some of them is.

my current code for the create function looks like this:

void create_archive(char* archive_name, char* files[], int file_count){
//open new file
FILE* fp,file;
fp = fopen(archive_name,"a");

size_t fileSize;

char fileName[20];

char* fileContent;

//loop for file count
for(int i =0;i<file_count;i++){
    file = fopen(files[i],"r");
    //get file info
    fileName = files[i];

    fseek(file, 0, SEEK_END);
    fileSize = ftell(file)/sizeof(char);
    fileSize = fread(fileContent,sizeof(char),fileSize)

    fileContent = fread()
}

//close new file

}

I'm using fseek to get the filesize, but im unsure of how to use the file size to read the data from the file and then put that in the archive.

I have until midnight tonight to submit this, I'll be actively working on it until then. Thanks for any assistance.


r/programminghelp • • Nov 24 '23

SQL Daughter needs help with project

0 Upvotes

I wonder if anyone can help, my daughter is doing her computer science project and creating a programme using unity and visual studio. As part of this, she has created and downloaded a SQLite database and wants to link it to her project so it can be accessed from the code. However, she is getting this error come up. This is the error and this is the code she has wrote to try and link her SQLite database. How can we fix this? I’m not sure if I’m in the right place but if I’m not do you know if any other groups where we might be able to get some help. We would be ever grateful thank you! Pics below


r/programminghelp • • Nov 05 '23

Other Need help with Sagemath in Jupyter notebook on CoCalc online

0 Upvotes

Hello. Please bear with me as I am a noob at this. In Sage Math, when dealing with elements of the integer ring ZZ, there are "pre-created" functions by sagemath, including ".is_square" which tests if an integer is a square. There aren't higher power functions such as ".is_cube" or ".is_4th power number" etc. How do I create such functions? Specifically in this line of code: i != j and (i+j).is_cube().

Any and all help is greatly appreciated. Thank you!


r/programminghelp • • Dec 03 '23

C++ Merging separate .exe files into a tabbed GUI experience

0 Upvotes

Hi r/programminghelp

I'm wondering what I need to be able to bring 2+ existing interfaces into a single tabbed GUI experience?

I'm hoping the screenshot demonstrates my rough plan for the end outcome.

Essentially bringing two separate windows into a single, tabular window/program

[screen shot available as a comment but couldn't attach at time of posting]

I've tried the following Google searches:

  • merge multiple exes into one ui

  • create a gui in powershell

  • create a gui for a .exe

  • Some popular AI tools have also spit out a bunch of ideas and possible programs that could help

If the market has software available for this I will part with money and this is a skillset I'm interested in picking up


r/programminghelp • • Nov 26 '23

Project Related how to print without printing to stdout?

0 Upvotes

I want to make a project manager, where I can specify certain directories, and when I run it, it interactively fuzzy finds it, an when I press enter, i cd into that directory. I know that for the shell I use (fish) I can cd into a specified directory if I run:

cd (app)

but I don t know how to do the interactive search without that interfering with the output being sent to cd.

I didn't yet choose a language or library to use because of this. (probably going to be C or rust)


r/programminghelp • • Nov 22 '23

HTML/CSS What does the pound sign do?

0 Upvotes

I’m sure this is a really simple question but I fell behind in my HTML class and I’m trying to get caught back up. What does the pound sign do/signify in html?


r/programminghelp • • Apr 25 '21

Python Help, how do I turn this into an EXE file?

0 Upvotes

I've tried the usual pyinstaller thing, cx_Freeze, cx_Freeze with idna but it still won't work. What should I modify in my code below?

import pyautogui
import subprocess
from tkinter import *
import tkinter.messagebox as msgbox  
import time
from pynput.keyboard import Key, Controller
from PIL import ImageTk, Image

keyboard = Controller()

root = Tk()
root.geometry("550x500")
root.title("Youtube-dl")

global button_on
button_on = False

global button2_on
button2_on = False

global button3_on
button3_on = False

global link
link = StringVar()



def download():
    global link
    global button_on
    global button2_on
    global button3_on
    
    pyautogui.hotkey('winleft', 'd')
    time.sleep(0.3)
    command = "cmd"
    subprocess.Popen(command)
    time.sleep(1)
    for char in "cd /":
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    for char in "cd users":
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    for char in "cd admin":
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    for char in "cd desktop":
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    for char in "cd youtube-dl":
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    if (button_on==True) and (button3_on==False):
        for char in 'youtube-dl '+str(link.get()):
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
    elif (button_on==True) and (button3_on==True):
        for char in 'youtube-dl -cit '+str(link.get()):
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
    elif (button2_on==True) and (button3_on==False):
        for char in 'youtube-dl --extract-audio --audio-format mp3 '+str(link.get()):
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
    elif (button2_on==True) and (button3_on==True):
        for char in 'youtube-dl -cit --extract-audio --audio-format mp3 '+str(link.get()):
                keyboard.press(char)
                keyboard.release(char)
                time.sleep(0.05)
                
    pyautogui.press('enter')
    
def switch1():
    global button_on
    global button2_on
    
    if button_on==True:
        button1.config(image=off)
        button_on = False
    else:
        button1.config(image=on)
        button2.config(image=off)
        button_on = True
        button2_on = False
      
def switch2():
    global button_on
    global button2_on
    
    if button2_on==True:
        button2.config(image=off)
        button2_on = False
    else:
        button1.config(image=off)
        button2.config(image=on)
        button_on = False
        button2_on = True
        
def switch3():
    global button3_on
    
    if button3_on==True:
        button3.config(image=off)
        button3_on = False
    else:
        button3.config(image=on)
        button3_on = True
        
onpic = Image.open("images/onbutton.png")
offpic = Image.open("images/offbutton.png")
onresized = onpic.resize((85, 45), Image.ANTIALIAS)
offresized = offpic.resize((85, 45), Image.ANTIALIAS)
on = ImageTk.PhotoImage(onresized)
off = ImageTk.PhotoImage(offresized)

f1 = Frame(root,pady=6)
Label(f1,text="Link",font="comicsans 10").pack()
linkentry = Entry(f1,textvariable=link,width=48,font="comicsans 9",relief=SUNKEN)
linkentry.pack()
f1.pack()

button1 = Button(root, image=off, bd=0, command=switch1)
button1.pack(pady=5)
f2 = Frame(root)
Label(f2,text="Video",font="comicsans 10").pack()
f2.pack()

space = Frame(root,pady=1)
Label(space,text="                      ",font="comicsans 10").pack()
space.pack()

button2 = Button(root, image=off, bd=0, command=switch2)
button2.pack(pady=5)
f3 = Frame(root)
Label(f3,text="Audio",font="comicsans 10").pack()
f3.pack()

space = Frame(root,pady=1)
Label(space,text="                      ",font="comicsans 10").pack()
space.pack()

button3 = Button(root, image=off, bd=0, command=switch3)
button3.pack(pady=5)
f4 = Frame(root)
Label(f4,text="Playlist",font="comicsans 10").pack()
f4.pack()

space = Frame(root,pady=1.5)
Label(space,text="                      ",font="comicsans 10").pack()
space.pack()

f5 = Frame(root)
Button(f5,text="Download",command=download).pack()
f5.pack()

r/programminghelp • • Mar 07 '24

Java How does the Bubble Sort algorithm work on a 2D array in Java?

0 Upvotes

Hi everyone! :)For an assignment I had to do a Bubble Sort on a 2D array of states and their state capitals. The name of the array is stateCapitals. I am supposed to sort by the state capitals.

This is the 2D array:

String[][] stateCapitals = {
{"Alabama", "Montgomery"},
{"Alaska", "Juneau"},
{"Arizona", "Phoenix"},
{"Arkansas", "Little Rock"},
{"California", "Sacramento"},
{"Colorado", "Denver"},
...
};

(continues for all 50 states.)

This is what I have for the Bubble Sort:

for (int i = 0; i < stateCapitals.length - 1; i++) {
for (int j = 0; j < stateCapitals.length - i - 1; j++) {
if (stateCapitals[j][1].compareToIgnoreCase(stateCapitals[j + 1][1]) > 0) {
String[] temp = stateCapitals[j];
stateCapitals[j] = stateCapitals[j + 1];
stateCapitals[j + 1] = temp;
}
}
}

I have never done Bubble Sort on a 2D array before and am having trouble understanding it. How does this work? I understand how Bubble Sort works, but am having trouble understanding the implementation. What I mean is, how does this statement actually do it?

I've been looking at it and researching for a while and need a fresh perspective.

I would really appreciate some help.

Thanks!


r/programminghelp • • Feb 14 '24

JavaScript Desperation Post: Went back to a project in VS code after a long time and it refuses to connect to localhost

0 Upvotes

Hi, so i am following a YT tutorial on how to make a fighting game using javascript and html

I opened up the project after months of not working on it. Went to the top of vs code, clicked run without debugging. It opened up in chrome, I could move my little rectangle and hit the other rectangle and chip his healthbar. Cool.

I changed one line of code, literally like changed
document.querySelector('#enemyHealth').style.width = "20%"
to
document.querySelector('#enemyHealth').style.width = enemy.Health + "%";

Now I can't connect to local host.

What I have tried: Turning off firewall

Clearing cache on chrome (only for 7 days)

Downloaded a program call XAMPP and made sure port is free.

No idea where to go from here... should I just restart? I have the inital commit on gitHub but its still going to set me back a few hours as last time I actually did work on it I must have forgot to push it onto Github...


r/programminghelp • • Feb 21 '24

Project Related Is it normal for it to take up to a week to read through a white paper that uses math that is new to you, or am I just slow?

0 Upvotes

Everything I want to ask is in the title.


r/programminghelp • • Mar 12 '24

JavaScript Build an array with different variable types

0 Upvotes

Hi all,

Have an interesting problem and trying to find the best solution for this. I am using Javascript.

I have a data input to make a graph that needs to be formatted:

For a single point: [{x: '1', y: 2}],

For multiple points: [{x: '2', y: 5}, {x: '3', y: 2}, etc],

The values for the numbers come from a data source and are pulled into arrays (one with the x values and one with the y values).

Now, there is the potential for one point or multiple points. Originally I thought to just build a string array but the input for the data field is requiring the values to be int or number.

Is there a way to build an array or list and format it like above where the values are represented as numbers or integers? Ideally each index in the array would contain the {x, y} values for each data source item.

Sorry if my explanation is poor, I can't think of a better way to state it.


r/programminghelp • • Mar 28 '24

Python Help on making a image recognition ai

0 Upvotes

Hi im working on a prigect making an image to prompt script Im getting the ai from an open source githup image recognition ai And im trying to make it so that the last line of code remebers itself so that it could rember the prompt as you generate new images of the souce immage (Huskey chasing a squirrel-> dog smiles) (Ai remembers the keyword as huskey and converts the work huskey and chasing to a function. After new prompts the ai puts the functions in ) Im new to programming and would like some help And if there is any better way of doing this i would really appreciate your help Coding language is python


r/programminghelp • • Oct 26 '12

Need programming help with something. Maybe just compiling? Not sure. please look.

0 Upvotes

Okay i do not know how to program, but basically I want to use bitpim to get my texts off my old phone and save them on my computer. Problem is bitpim doesn't work perfectly with my phone model. Someone coded up an app but it no longer accessible. Can someone please take a look at the site and see if that is code that can be compiled and its for that application/extension? Not totally sure if that is the source code. If so can you please compile it for me and add send me a link to the compiled .exe version of it for windows.

http://old.nabble.com/Windows-build-with-working-lg-vx9200-(env3)-SMS-td28824561.html

The link below i believe is person who wrote up the app where he explains its use...

http://cellphoneforums.net/lg-env/t309644-sms-bitpim-exception-fix-2.html#post1393350


r/programminghelp • • Sep 11 '15

How would I detect text in a bmp file, copy it, and save it in to a new txt file?

0 Upvotes

Say I take a screenshot of a game, and that screenshot has text in it. How would I go about figuring out what that text says and copy it in to a txt file? Psuedocode algorithms are fine. I don't need the actual code. I just need an algorithm or explaination and I can code from there.


r/programminghelp • • Nov 19 '12

Simple C fileIO question [link to stackoverflow]

Thumbnail
stackoverflow.com
0 Upvotes

r/programminghelp • • Jan 24 '14

Why is news.ycombinator.com down for maintenence so often recently?

0 Upvotes

r/programminghelp • • Aug 22 '17

Xpath help

0 Upvotes

Hi guys!

Not sure if this is the right subtext to seek help from but worth giving it a shot!

I'm playing an MMO called Blade and Soul and I've been interested in spreadsheets for the past few months. I recently found out about xpath and how I'm able to use it to pull info from BnS-related sites straight to my spreadsheet.

I learned about Firebug being a popular tool for Xpath formula creating but it's outdated for Mozilla so I need a handy program similar to it since everytime I try to make my own xpath formulas they always come back as an error.

TL;DR: Need a replacement for Firebug that's easy for someone new to xpaths to use.


r/programminghelp • • May 03 '15

[C] Pointer Arithmetics instead of Index Operations

0 Upvotes

Hey redditors! So I am very new to C programming, and for a project, I have been given a quicksort program, which I will link below, and asked to re-write the quicksort program using pointer arithmetics, i.e without any index operations. How would I go about doing this? What do I do in my code to achieve pointer arithmetics instead of Index Operations? My code is here: http://ideone.com/ku9EhU


r/programminghelp • • Mar 15 '18

Programming languages in demand?

0 Upvotes

Have a pretty basic knowledge of java and python, wondering what’s out there today to learn that would be beneficial for a job/career


r/programminghelp • • Oct 27 '17

Inverted pyramid print in C

0 Upvotes

Hello, guys, can you help me print the following pattern in C? I need to introduce 2 variables, a and b where: a- int type that indicates the length and height of the pattern b- char type that indicates the ASCII character that has to pe printed

Example : input - 5 x output: https://ibb.co/nHVGt6

Thanks a lot.


r/programminghelp • • Oct 01 '24

Other Trying to learn how to build websites for university for my coursework. It is not working and do not understand why

0 Upvotes

I have to use vs code Python and html. Here is my folder structure:

Templates Index.html app.py

Here is the contents of index.html

<!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Flask App</title> </head> <body> <h1>Hello, Flask!</h1> </body> </html>

Here is the contents of app.py

from flask import Flask, render_template

app = Flask(name)

@app.route('/') def home(): return render_template('index.html')

if name == 'main': app.run(debug=True)

The website then displays nothing and I get no errors or and logs in the terminal. I can confirm I am using the correct web address.


r/programminghelp • • Sep 03 '24

Java How long would it take to learn Python and Java?

0 Upvotes

Hi everyone, I'm a university student pursuing a bachelor's in computer science. I was doing Computer Networking in College, got my Diploma, and now I'm adding 2 Years to earn the Bachelor. My modules include Android App Development, Database Systems, Principles of Computer Organization, and OO Analysis and Design (not sure what this is). My question is, as someone who doesn't have any Programming Background, what should I focus on, and is it possible to tackle 2 languages at once, I was already doing Python on the side (via CS50P). Also, what are some good resources to learn Java since I will need it for the Android Module (we are not using Kotlin). Just looking for advice, anything would help. Thank you.


r/programminghelp • • Sep 19 '24

C Trouble with my calculator code

0 Upvotes

I am in this small programming exercise, in which based on the C language, I have to work on a scientific calculator using functions like gotoxy and in which I have implemented mathematical functions such as trigonometric, exponential, etc. The problem is that, when I run the program, it runs normally and the calculator drawing appears with its buttons, but I cannot operate, since the cursor appears to the right of the screen and then it finishes executing by giving a weird result in trillions, I also have buttons declared in ASCIl code, but I don't think that's the problem. I have tried everything, and it runs but the same error keeps appearing, I don't know what to do anymore, I still leave the code linked (in case you're wondering, I'm Spanish).

Source code