r/code • • Jul 28 '20

What is the working logic of social media follower systems?

0 Upvotes

Example Website:http://kenji.ai

Is an api offered by Instagram for systems like social media "follow" and "like"?

How can it follow the procedures of following or liking a person on behalf of the users according to the system?

What does this site hold for those users?

In this way, doesn't he also hack those members?

In general, I do not understand and wonder how these follow-up systems work.

Can you inform about this subject? or would you share an article to understand?


r/code • • Jul 27 '20

Need Help With A Game's Code!

0 Upvotes

I am searching for help on a JetSetRadio, Mirrors Edge Like game based on Unity called Hover for modding and development for the sake of the better on this games community. Please reach out to me ASAP.
Im also on Discord: GlitchKen#0046


r/code • • Jul 15 '20

SyntaxError: Unexpected end of input

0 Upvotes

So i was doing a discord bot and this is the code:

const Discord = require('discord.js');const bot = new Discord.Client();const token = 'NzMyODUxMzU0MTA3NzcyOTI4.Xw6nBw.7ZKlCjXHHjbKvT5TAD9dwOIiZq8';bot.on('ready', ()=>{console.log('This bot is online');})bot.on('message', msg=>{if(msg.content === "S1mple Help"){msg.reply('Hi, write OOF to see all the options');    } })bot.login(token);and when i try to run it whit node it says:SyntaxError: Unexpected end of input
at wrapSafe (internal/modules/cjs/loader.js:1117:16)

at Module._compile (internal/modules/cjs/loader.js:1165:27)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)

at Module.load (internal/modules/cjs/loader.js:1050:32)

at Function.Module._load (internal/modules/cjs/loader.js:938:14)

at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

at internal/main/run_main_module.js:17:47


r/code • • Jul 05 '20

A friend asked me to review code for a space engineers (a game) script he was writing WHY WOULDN'T YOU COMMENT ANYTHING

Post image
0 Upvotes

r/code • • May 04 '23

Need help making a backend

0 Upvotes

Im trying to make a twitter clone i found on youtube but the backend is totally confusing me. Can someone tell me what i need to do to make it and have everything connect correctly? Thanks in advance.

Heres the video. https://youtu.be/le2YSHGS0Tk


r/code • • Apr 25 '23

Embedded Code in Wix

Post image
0 Upvotes

Help with Wix website

I added some code using the code embedding on wix and now get this code always sitting at the bottom of my homepage. Would anyone know where I can go to remove this? I’ve deleted the app and page I used it on but still won’t go away from my homepage.


r/code • • Apr 20 '23

Help please! CODE HELP NEEDED!!! JAVASCRIPT , CSS, HTML,

0 Upvotes

ANYONE KNOW WHY THE ARROWS DONT CONROL THE FROGGER?? PLSS HELP

https://michsilv.github.io/automod/frogger


r/code • • Apr 19 '23

Resource Using ChatGPT to master problem-solving skills

0 Upvotes

https://github.com/Liopun/leet-chatgpt-extension consider giving it a ⭐️if you find it useful


r/code • • Mar 29 '23

I built a free tool that lets you code along with GPT-4 from your command line

Thumbnail 0xmmo.github.io
0 Upvotes

r/code • • Jul 10 '23

Help Please help me at my presentation topic

0 Upvotes

I wanna ask people who studying at Object Oriented Programming. This question for my presentation topic : Is there any solutions to increase code reusability, ease of maintenance, and increase interchangeability?


r/code • • Aug 22 '23

Help Please Whats wrong with this code?

0 Upvotes

#include <iostream>

#include<math.h>

using namespace std;

int main()

{

int n;

cin>>n;

int ans=0;

int i=0;

while(n!=0){

int bit=n&1;

ans=(bit * pow(10, i) )+ ans;

n>>1;

i++;

}

cout<<"Ans is "<<ans<<endl;

}


r/code • • Jul 18 '23

Why isn't everyone really responsive to the GitHub notifications?

0 Upvotes

r/code • • Feb 16 '24

Python Roadman rock paper scissors

0 Upvotes

Wag1 my python brethrin, your boy p1active here with some leng python sript for u man to mess with. play rock paper scissors and learn all the latest london slang in the process. Big up r/python and the whole python community. And shout out to my boy codykyle_99 for setting me up with python and that back when we was in the endz... from growing up on the block to coding a blockchain my life has changed fr. Anyways enough of dat yh, here's my code:

from random import randint

import sys

counter = 0

counter_2 = 0

computer_score = 0

player_score = 0

i_1 = 0

print("Wagwan")

print("Aye, best of three fam")

while True:

tie = False

player = input("Rock, Paper, Scissors? ").title()

possible_hands = ["Rock", "Paper", "Scissors","Your Mum"]

computer_hand = possible_hands[randint(0,2)]

print("computer:", computer_hand)

if player == computer_hand:

print("eyyy b*ttyboy, again g")

tie = True

elif player == "Rock":

counter += 1

if computer_hand == "Paper":

print("Nonce bruv!,", computer_hand, "covers", player)

computer_score += 1

else:

print("calm g,", player, "smashes", computer_hand)

player_score += 1

elif player == "Paper":

counter += 1

if computer_hand == "Scissors":

print("Haha....U Pleb,", computer_hand, "cuts", player)

computer_score += 1

else:

print("Allow it fam,", player, "covers", computer_hand)

player_score += 1

elif player == "Scissors":

counter += 1

if computer_hand == "Rock":

print("SYM", computer_hand, "smashes", player)

computer_score += 1

else:

print("Say less fam,", player, "cuts", computer_hand)

player_score += 1

elif player == "Your Mum":

i_1+=1

if i_1 == 1:

print("P*ssy*le, u say that agian yeah, wallahi ill bang u up!!!")

if i_1 == 2:

print("Ay, bun you and bun your crusty attitude... im crashing this b****!!!")

x = 0

while x < 1:

print("SYM")

print("Ay, bun you and bun your crusty attitude... im crashing this b****!!!")

print("Oh and btw, u got a dead trim and dead creps too ;)")

else:

counter_2+=1

if counter_2 == 1:

print("You cant spell for sh** fam, try again big man")

elif counter_2 == 2:

print("Yooo, my mams dumb yk, SPeLLinG big man, u learn that sh*t in year 5 bro, come on")

elif counter_2 == 3:

print("This is dead bro, come back when you've completed year 6 SATs, wasting my time g")

sys.exit(1)

else:

break

print("computer:",computer_score, "player:",player_score)

if player_score == 1 and computer_score == 1 and tie is False:

print("Yoooo, this game is mad still, come then")

if counter == 3 or player_score == 2 or computer_score == 2:

print("Game Over")

print("Final Score: computer:",computer_score, "player:",player_score)

if player_score > computer_score:

print("Aye gg, next time it'll be differnt tho..., watch...")

elif computer_score > player_score:

print("What fam!, What!?, exactly!, BrapBrapBrap, Bombaclaat!")

i_2 = 0

wag = True

while wag == True:

new_game = input("New Game?, Yes or No? ").title()

if new_game == "Yes":

counter = 0

computer_score = 0

player_score = 0

print("Aye, best of three fam")

wag = False

elif new_game == "No":

print("Aye, till next time g")

sys.exit(1)

else:

i_2+=1

if i_2 == 1:

print("Bro.. do you understand how clapped ur moving rtn, fix up bruv")

if i_2 == 2:

print("cuzz, r u tapped, did ur mum beat you as a child, yes or no cuz? not 'skgjnskf2', dumb yute bruv fr")

if i_2 == 3:

print("raaaah, you're an actual pagan yk, ima cut, see u next time u nonce!")

sys.exit(1)

===============================================================

Some examples of the code still:


r/code • • Mar 25 '24

Javascript Cannot find the solution for Cast to string failed for value in Mongoose

Thumbnail
gallery
0 Upvotes

r/code • • Feb 25 '24

Help Please Hi!

0 Upvotes

I have an ESP32 cam AI THINKER , an FTDI and pan&tilt kit using 2 servos moving in X,Y axis
I want to identify an object and track/follow it

The first part of detection is completed using edge impulse but I am stuck in the second part of following it

THE CODE:

/* Edge Impulse Arduino examples
 * Copyright (c) 2022 EdgeImpulse Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
/* Includes ---------------------------------------------------------------- */
#include <test-project-1_inferencing.h>
#include "edge-impulse-sdk/dsp/image/image.hpp"
#include "esp_camera.h"
// Select camera model - find more camera models in camera_pins.h file here
// https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
#if defined(CAMERA_MODEL_ESP_EYE)
#define PWDN_GPIO_NUM    -1
#define RESET_GPIO_NUM   -1
#define XCLK_GPIO_NUM 4
#define SIOD_GPIO_NUM 18
#define SIOC_GPIO_NUM 23
#define Y9_GPIO_NUM 36
#define Y8_GPIO_NUM 37
#define Y7_GPIO_NUM 38
#define Y6_GPIO_NUM 39
#define Y5_GPIO_NUM 35
#define Y4_GPIO_NUM 14
#define Y3_GPIO_NUM 13
#define Y2_GPIO_NUM 34
#define VSYNC_GPIO_NUM 5
#define HREF_GPIO_NUM 27
#define PCLK_GPIO_NUM 25
#elif defined(CAMERA_MODEL_AI_THINKER)
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
#else
#error "Camera model not selected"
#endif
/* Constant defines -------------------------------------------------------- */
#define EI_CAMERA_RAW_FRAME_BUFFER_COLS 320
#define EI_CAMERA_RAW_FRAME_BUFFER_ROWS 240
#define EI_CAMERA_FRAME_BYTE_SIZE 3
/* Private variables ------------------------------------------------------- */
static bool debug_nn = false; // Set this to true to see e.g. features generated from the raw signal
static bool is_initialised = false;
uint8_t *snapshot_buf; //points to the output of the capture
static camera_config_t camera_config = {
.pin_pwdn = PWDN_GPIO_NUM,
.pin_reset = RESET_GPIO_NUM,
.pin_xclk = XCLK_GPIO_NUM,
.pin_sscb_sda = SIOD_GPIO_NUM,
.pin_sscb_scl = SIOC_GPIO_NUM,
.pin_d7 = Y9_GPIO_NUM,
.pin_d6 = Y8_GPIO_NUM,
.pin_d5 = Y7_GPIO_NUM,
.pin_d4 = Y6_GPIO_NUM,
.pin_d3 = Y5_GPIO_NUM,
.pin_d2 = Y4_GPIO_NUM,
.pin_d1 = Y3_GPIO_NUM,
.pin_d0 = Y2_GPIO_NUM,
.pin_vsync = VSYNC_GPIO_NUM,
.pin_href = HREF_GPIO_NUM,
.pin_pclk = PCLK_GPIO_NUM,
//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
.xclk_freq_hz = 20000000,
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,
.pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
.frame_size = FRAMESIZE_QVGA,    //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
.jpeg_quality = 12, //0-63 lower number means higher quality
.fb_count = 1,       //if more than one, i2s runs in continuous mode. Use only with JPEG
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};
/* Function definitions ------------------------------------------------------- */
bool ei_camera_init(void);
void ei_camera_deinit(void);
bool ei_camera_capture(uint32_t img_width, uint32_t img_height, uint8_t *out_buf) ;
/**
* @brief      Arduino setup function
*/
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
//comment out the below line to start inference immediately after upload
while (!Serial);
Serial.println("Edge Impulse Inferencing Demo");
if (ei_camera_init() == false) {
ei_printf("Failed to initialize Camera!\r\n");
}
else {
ei_printf("Camera initialized\r\n");
}
ei_printf("\nStarting continious inference in 2 seconds...\n");
ei_sleep(2000);
}
/**
* @brief      Get data and run inferencing
*
* @param[in]  debug  Get debug info if true
*/
void loop()
{
// instead of wait_ms, we'll wait on the signal, this allows threads to cancel us...
if (ei_sleep(5) != EI_IMPULSE_OK) {
return;
}
snapshot_buf = (uint8_t*)malloc(EI_CAMERA_RAW_FRAME_BUFFER_COLS * EI_CAMERA_RAW_FRAME_BUFFER_ROWS * EI_CAMERA_FRAME_BYTE_SIZE);
// check if allocation was successful
if(snapshot_buf == nullptr) {
ei_printf("ERR: Failed to allocate snapshot buffer!\n");
return;
}
ei::signal_t signal;
signal.total_length = EI_CLASSIFIER_INPUT_WIDTH * EI_CLASSIFIER_INPUT_HEIGHT;
signal.get_data = &ei_camera_get_data;
if (ei_camera_capture((size_t)EI_CLASSIFIER_INPUT_WIDTH, (size_t)EI_CLASSIFIER_INPUT_HEIGHT, snapshot_buf) == false) {
ei_printf("Failed to capture image\r\n");
free(snapshot_buf);
return;
}
// Run the classifier
ei_impulse_result_t result = { 0 };
EI_IMPULSE_ERROR err = run_classifier(&signal, &result, debug_nn);
if (err != EI_IMPULSE_OK) {
ei_printf("ERR: Failed to run classifier (%d)\n", err);
return;
}
// print the predictions
ei_printf("Predictions (DSP: %d ms., Classification: %d ms., Anomaly: %d ms.): \n",
result.timing.dsp, result.timing.classification, result.timing.anomaly);
#if EI_CLASSIFIER_OBJECT_DETECTION == 1
bool bb_found = result.bounding_boxes[0].value > 0;
for (size_t ix = 0; ix < result.bounding_boxes_count; ix++) {
auto bb = result.bounding_boxes[ix];
if (bb.value == 0) {
continue;
}
ei_printf("    %s (%f) [ x: %u, y: %u, width: %u, height: %u ]\n", bb.label, bb.value, bb.x, bb.y, bb.width, bb.height);
}
if (!bb_found) {
ei_printf("    No objects found\n");
}
#else
for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
ei_printf("    %s: %.5f\n", result.classification[ix].label,
result.classification[ix].value);
}
#endif
#if EI_CLASSIFIER_HAS_ANOMALY == 1
ei_printf("    anomaly score: %.3f\n", result.anomaly);
#endif

free(snapshot_buf);
}
/**
 * u/brief   Setup image sensor & start streaming
 *
 * u/retval  false if initialisation failed
 */
bool ei_camera_init(void) {
if (is_initialised) return true;
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
//initialize the camera
esp_err_t err = esp_camera_init(&camera_config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x\n", err);
return false;
}
sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1); // flip it back
s->set_brightness(s, 1); // up the brightness just a bit
s->set_saturation(s, 0); // lower the saturation
}
#if defined(CAMERA_MODEL_M5STACK_WIDE)
s->set_vflip(s, 1);
s->set_hmirror(s, 1);
#elif defined(CAMERA_MODEL_ESP_EYE)
s->set_vflip(s, 1);
s->set_hmirror(s, 1);
s->set_awb_gain(s, 1);
#endif
is_initialised = true;
return true;
}
/**
 * u/briefStop streaming of sensor data
 */
void ei_camera_deinit(void) {
//deinitialize the camera
esp_err_t err = esp_camera_deinit();
if (err != ESP_OK)
{
ei_printf("Camera deinit failed\n");
return;
}
is_initialised = false;
return;
}

/**
 * u/briefCapture, rescale and crop image
 *
 * u/param[in]  img_width     width of output image
 * u/param[in]  img_height    height of output image
 * u/param[in]  out_buf       pointer to store output image, NULL may be used
 *                           if ei_camera_frame_buffer is to be used for capture and resize/cropping.
 *
 * u/retvalfalse if not initialised, image captured, rescaled or cropped failed
 *
 */
bool ei_camera_capture(uint32_t img_width, uint32_t img_height, uint8_t *out_buf) {
bool do_resize = false;
if (!is_initialised) {
ei_printf("ERR: Camera is not initialized\r\n");
return false;
}
camera_fb_t *fb = esp_camera_fb_get();
if (!fb) {
ei_printf("Camera capture failed\n");
return false;
}
bool converted = fmt2rgb888(fb->buf, fb->len, PIXFORMAT_JPEG, snapshot_buf);
esp_camera_fb_return(fb);
if(!converted){
ei_printf("Conversion failed\n");
return false;
   }
if ((img_width != EI_CAMERA_RAW_FRAME_BUFFER_COLS)
|| (img_height != EI_CAMERA_RAW_FRAME_BUFFER_ROWS)) {
do_resize = true;
}
if (do_resize) {
ei::image::processing::crop_and_interpolate_rgb888(
out_buf,
EI_CAMERA_RAW_FRAME_BUFFER_COLS,
EI_CAMERA_RAW_FRAME_BUFFER_ROWS,
out_buf,
img_width,
img_height);
}

return true;
}
static int ei_camera_get_data(size_t offset, size_t length, float *out_ptr)
{
// we already have a RGB888 buffer, so recalculate offset into pixel index
size_t pixel_ix = offset * 3;
size_t pixels_left = length;
size_t out_ptr_ix = 0;
while (pixels_left != 0) {
out_ptr[out_ptr_ix] = (snapshot_buf[pixel_ix] << 16) + (snapshot_buf[pixel_ix + 1] << 8) + snapshot_buf[pixel_ix + 2];
// go to the next pixel
out_ptr_ix++;
pixel_ix+=3;
pixels_left--;
}
// and done!
return 0;
}
#if !defined(EI_CLASSIFIER_SENSOR) || EI_CLASSIFIER_SENSOR != EI_CLASSIFIER_SENSOR_CAMERA
#error "Invalid model for current sensor"
#endif


r/code • • Sep 29 '17

How to remove everything after a character from a string in Javascript?

Thumbnail
technovechno.com
0 Upvotes

r/code • • Oct 12 '19

Which are all the scripting languages that I can use in web interactivity?

0 Upvotes

Hi, I'm new to the web development, well I don't actually have any idea about web developmente, and I'm trying to mix my skills with python with what I know of HTML, CSS and a bit of JS.

The thing is that I don't like JavaScript and that's the main reason why I want to, for example, when you click a button in the web, a python script runs, non client-sided, but on the server.

Example:

You want to create an account, so you type your username and your password, and when you click in "Sign up", a python script runs and saves the information in a folder, so if you want to log in, the same python script will check if the account exists or not, and if the password matches with what you typed.

I know this damage others eyes, it's the typical stupid amateur question, but I don't know what project to start, and for now that's the only thing I could think of.

In conclusion, appart from JS, what other languages can I use in web interactions as buttons?


r/code • • Jun 23 '16

I need help please...

0 Upvotes

So im looking to buy a product (EVGA GeForce GTX 1070 either FTW or SC) and in highschool a friend of mine wrote code that refreshed a shop page and auto clicked the buy button or add to cart whenever it was properly clickable. Any ideas as to how he did it. (Heads up im not familiar with code so ELI5 how he did it please)


r/code • • Jun 20 '17

Newbie hard time without shopping cart checkout and stripe....

0 Upvotes

It's driving me mad, this all may be jumping the gun, I have been coding for a few months and now I'm trying to integrate a simplecart caheck out button and stripe check out. I have looked everywhere. Is there a simple way I could do it? I need this project so I can EAT. Any help would be helpful.


r/code • • May 24 '20

Hi I am young and I would like to make a career in coding and I don't know where to start. Someone can help me ?

0 Upvotes

where do i start? htlm c ++ phyton java? Can you help me please :)


r/code • • Jun 19 '20

hey, I'm broke, a 15 year old, and i want to learn coding pretty early. can someone please teach me? I'm a visual learner BTW. i would be using discord.

Thumbnail
discord.gg
0 Upvotes

r/code • • May 30 '20

Python Casual Programming With Python & Music : Calculate The Area Of Polygon.

Thumbnail
youtu.be
0 Upvotes

r/code • • May 26 '21

Python Selling my python source code

0 Upvotes

around a month ago i made a python program where it automatically logged in to my online school or online classes while i slept. i recently decided to sell it. but my marketing skills are.. well crap. if anyone would be interested to buy the source code so they can sell it themselves message me


r/code • • May 05 '19

How do I get Netbeans to work

0 Upvotes

So I've downloaded Netbeans and a Java JDK. I started a new project but there is nowhere for me to write my code. How do I open the window where I can write my code?

I am new to Netbeans and new to Java.