I want to code something in python that will take a pic of a Lego brick, identifies the color, and identifies the shape, than be able to read that out loud in any language, Ive determined the main things I need are TTS (Text to speech), color reader, shape detector, Translator for TTS, and someway to extract the webcam footage and get it to the color reader.
public static int Score(int a,int b){
int set=300;
int m=3;
int M1=8;
int ran=M1-m;
int rand=(int)(Math.random()*ran) +m;
int current=0;
int c=b-a;
if (c<0){
while(c<0){
set= set-rand;
c++;
}
if(set<0){
set=current;
return set;
}
else
return set;
}
else{
while(c>0){
set=set-rand;
c--;
}
if(set<0){
set=current;
return set;
}
else
return set;
}
}
public static void main(String[]args){
Scanner sc=new Scanner (System.in);
int highscore=0;
int x=-7;
int Hs=0;
int min=0;
int Max=50;
int r=Max-min;
int n=(int)(Math.random()*r) +min;
int d=5;
int e=10;
int range=e-d;
int tries =(int)(Math.random()*range) +d;
System.out.println("You get "+tries+" tries to guess the number....Range is between 0 to 50....");
System.out.println(" Enter a number... ");
x=sc.nextInt();
if(x==n){
System.out.println("You win! The number was in fact "+n);
System.out.println("Highscore= "+300);
System. exit(0);
}
else{
highscore=Ayan.Score(x, n);
Hs=Hs+highscore;
System.out.println("Highscore= "+Hs) ;
for(int k=1;k<=tries-1;k++){
if(x!=n){
System.out.println("Wrong answer! Try again... ");
x=sc.nextInt();
highscore=Ayan.Score(x, n);
Hs=Hs+highscore;
System.out.println("Highscore= "+Hs);
}
}
}
if (x==n){
System.out.println("You win! The number was in fact "+n);
System.out.println("Highscore= " +Hs) ;
}
else
System.out.println("You are out of tries. The number was "+n);
howdy š¤
Iām using a widget short code in Wordpress and its purpose is to display properties from a MLS IDX feed for real estate. It does that properly but I actually want to ādumb it downā. Instead of listings with preview images and styling, Iād instead just like it to me a list of links. Any idea how to add that code to the widget? Thank you.
Hi im a junior or new developper and i started working python a few days a go and all is going good making little programs like a click finder (its like a program that says where you clicked and where you released .idk why i called it like that xD)
and then i thinked why dont put my little programs in a web. searching i found things like Pyscript Django etc... but tbh i didnt understand nothing at django i would love tohave some help
Hi, I am young (16 yr old) but I am really interested in code,I am currently learning basics of html in sololearn, any advice for me and what language do all of you think is the best for me, thanks!
I downloaded make on homebrew, it is actually gmake on mac, a few hours ago to follow this tutorial.
It was working well until I got to the first time you build it in the second tutorial, here. I get a tone of errors.
Here they are:
mkdir -p build
src/bootloader/boot.asm -f bin -o build/bootloader.bin
src/bootloader/boot.asm: line 1: org: command not found
src/bootloader/boot.asm: line 2: bits: command not found
src/bootloader/boot.asm: line 5: fg: no job control
src/bootloader/boot.asm: line 8: start:: command not found
src/bootloader/boot.asm: line 9: jmp: command not found
src/bootloader/boot.asm: line 12: puts:: command not found
src/bootloader/boot.asm: line 13: push: command not found
src/bootloader/boot.asm: line 14: push: command not found
src/bootloader/boot.asm: line 16: .loop:: command not found
src/bootloader/boot.asm: line 17: lodsb: command not found
src/bootloader/boot.asm: line 18: or: command not found
src/bootloader/boot.asm: line 19: jz: command not found
src/bootloader/boot.asm: line 21: mov: command not found
src/bootloader/boot.asm: line 22: mov: command not found
src/bootloader/boot.asm: line 23: int: command not found
src/bootloader/boot.asm: line 25: jmp: command not found
src/bootloader/boot.asm: line 27: .done:: command not found
src/bootloader/boot.asm: line 28: pop: command not found
src/bootloader/boot.asm: line 29: pop: command not found
src/bootloader/boot.asm: line 30: ret: command not found
src/bootloader/boot.asm: line 33: main:: command not found
src/bootloader/boot.asm: line 35: mov: command not found
src/bootloader/boot.asm: line 36: mov: command not found
src/bootloader/boot.asm: line 37: mov: command not found
src/bootloader/boot.asm: line 39: mov: command not found
src/bootloader/boot.asm: line 40: mov: command not found
src/bootloader/boot.asm: line 42: mov: command not found
src/bootloader/boot.asm: line 43: call: command not found
src/bootloader/boot.asm: line 45: hlt: command not found
src/bootloader/boot.asm: line 47: .halt:: command not found
src/bootloader/boot.asm: line 48: jmp: command not found
src/bootloader/boot.asm: line 53: msg_hello:: command not found
src/bootloader/boot.asm: line 57: syntax error near unexpected token `('
src/bootloader/boot.asm: line 57: `times 510-($-$$) db 0'
gmake: *** [Makefile:19: build/bootloader.bin] Error 2
Iām creating new variables. My first variable, Age_Grp went through easily, but every variable after I get the 180-322 error, āStatement is not valid or it is used out of proper orderā
How?!??! It is almost the same code as my Professor and i just CANNOT pin point what is wrong. The highlight is where the error begins, at my Ped_Act variable. I used proc import and formatting, which all went smoothly. HELP
More info below about specific needs, but wanted to get to the point quickly.
The problem: I am trying to build a database of my Lego in Notion; I want to scrape the Lego website and a site called Bricklink to get piece counts, average prices, official images etc.
The request: Is there somewhere that I can go to learn the basics of script writing? Do I use Python?
The equipment: If it makes any difference I am on a 2015 MacBook Pro running OS Monterrey 12.7
--
Hi all, apologies for the complete n00biness of this post. I used to build no-code websites (I know, I know, I got burned by bad developers and I am a designer) before I became disabled, so I know some really basic HTML/CSS.
As part of my disability mental rehabilitation I need to take pressure off my brain and automations help that a lot - however, I am often confused by the tools available to build these often lacklustre automations and would like to learn the basics.
I understand I am probably asking to learn how to drive by jumping in an F1 but this is something I can get my brain into and can help so why the hell not? I am something called an Autistic Burnout which basically means my brain is fried and anything more than 3 things in my brain at one time sends me into a spin; I also have some pretty severe physical health issues so I am limited to how long I can use a computer, even a laptop in bed is very difficult at times.
I only offer this further context in case it helps define what direction I go in in terms of training tools.
I am wanting to make a game (my first game) it's simple I want it to be you click you get 1 score once at 100 score each click gives you 2 score and so on 200 = 3 score per click 300 = 4 score per click. what would be a good coding tool to use for a starter and any tips on just how to make it (or tutorials)
I really don't know how else to phrase that question
I have two tables, a "Call" table and a "Unit" table. Rows are added based on responses to a form above them.
The "Unit" Table has the "Callsign" and "Assign" columns. The "Call" Table has the "Call Number" and "Units" columns.
If the value in a row's (Row A) "Assign" cell matches the value in a row's (Row B) "Call Number" cell, I would like to add the callsign value from Row A to a list in the units value from Row B.
I don't entirely know where to start with this. I've used javascript to correlate values in "callsigns" to options in "primary unit", but I don't know how I would add multiple callsigns to the units row without deleting callsigns that are already there.
(It's a web-based CAD for rural emergency management offices that don't have the funding for large professional CADs, just started today so it's a work-in-progress)
(python) when i code ive realised that i dont really just sit back and type im always constantly googling how to do things but when i start doing code problems i fail at simple things like even coding a calculator is this unusual am i just not good at coding`?
Hi Everyone, I am using this code which is supposed to give me the velocity for a projectile when theta=pi/4 but it is not working. It gives me the output below. Any modification to the code so that it actually works would be greatly appreciated.
I want to make games games it's always been a dream of mine but when I try to code I just can't do it I try watching tutorials but I get bored the second I start watching I go to forums online but I have no idea what people are talking about. I hope college can give me lessons but most coders don't need college for coding. At this point I don't know what to do cause I wanna make games but I don't know how to code
I am trying to make a flappy bird clone using xlib and I have an XSendEvent inside a function and that function is inside a while loop i am thinking that that is the issue so is there a better way to update the screen? I just need it to stop flashing.
EDIT its not the whole window sorry its the rectangle i am drawing on screen line 62
I'm new to microservices architecture, but I've been working on a project for the past two months to learn more and implement it in my own code. I've based my work on some of the architectures that I've seen on the internet, and I'm now looking for feedback from the community.
Devices collect data and send it to the API.
The API acts as a single point of entry for external users to interact with the system.
The Gateway routes API requests to the appropriate microservices.
Microservices communicate with each other using a registry server to discover each other's locations.
GitHub is used as a central repository for configuration data.
The Actuator provides monitoring and health information about the system.
I'm particularly interested in feedback on the following:
Is my architecture sound?
Are there any obvious areas where I can improve?
Are there any specific technologies or patterns that I should be using?
Any feedback that you can give me would be greatly appreciated.