messages listlengths 2 2 |
|---|
[
{
"role": "user",
"content": "This is a simple C clone of the website hackertyper.net. The code can be found on Github and is reproduced below:\nMakefile\nPREFIX=/usr/local\nBINDIR=$(PREFIX)/bin\nDATAROOTDIR=$(PREFIX)/share\nDATADIR=$(DATAROOTDIR)\nMAN1DIR=$(DATAROOTDIR)/man/man1\n\nCFLAGS=-Wall -pedantic -... |
[
{
"role": "user",
"content": "I would like to submit a portion of my code for Code Review, and I have done my best to comment the code (and include essential parts that may aid understanding of the program) for your convenience! Any optimisation that would increase the speed of the running of the program wo... |
[
{
"role": "user",
"content": "This is my Mandelbrot set program - it includes Smooth Coloring, perodicity checks, and my approach to biomorphs.\nI know of Edge Detection, but I couldn't find a simple explanation that I can understand. Any help appreciated!\nHow do I optimize the Mandelbrot set plotting algo... |
[
{
"role": "user",
"content": "Following is my code for a library management system. I am pretty new to OOD and trying to learn it. I am specially looking for ways where any design patterns can be useful here. I tried to make classes so that I follow Single Responsibility principle. Would appreciate any feed... |
[
{
"role": "user",
"content": "I have a script which dynamically loads data onto a restaurant menu for printing. Could the following code could be shortened at all?\n <script>\n $(document).ready(function(){\n $('#prestarters').load('prestarters.php', '', function(response, ... |
[
{
"role": "user",
"content": "Link here\nI'll include a solution in Python and C++ and you can review one. I'm mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don't know C++ can review the Python code. Both solutions share similar logic, so the review will... |
[
{
"role": "user",
"content": "This is a calculator I've made in C#. Is there any way to improve it? Surely there is a way to get rid of all the ifs that are nested inside one another.\nnamespace CalculatorCA\n{\n using System;\n using System.Collections.Generic;\n class Program\n {\n stat... |
[
{
"role": "user",
"content": "Help me review this code:\n#include <iostream>\n#include <cassert>\nusing namespace std;\n\ntemplate <typename T>\nclass auto_ptr\n{\npublic:\n explicit auto_ptr(T* p = NULL):m_p(p){}\n auto_ptr(auto_ptr& other);\n auto_ptr& operator=(auto_ptr& other);\n T* get() co... |
[
{
"role": "user",
"content": "I wrote code to draw a circle segment, such that the segment angle will be facing the mouse.\nMy code:\n#include <SFML/Graphics.hpp>\n#include <math.h>\n\nconst float PI{ 3.14159265359f };\n\n//convert degress to radians\nfloat degToRad(float deg)\n{\n return\n deg * ... |
[
{
"role": "user",
"content": "I am trying to consume a REST endpoint by using the RestTemplate Library provided by the spring framework.\nThe endpoint also demands a Bearer Access Token as its authorization header, which is only obtained as the response from a user authentication endpoint, which in turn exp... |
[
{
"role": "user",
"content": "This code saves an DomainEntityRecord (parent) and DomainEntityDetailRecords (child), and it works. It feels odd that I get the record from the DB, then remove the entities that don't exist in the domain model version, then when I save, I save (AddOrUpdate) the domain entities,... |
[
{
"role": "user",
"content": "Let me start off by saying I am not new to PHP or PDO, but very new to OO PHP, and have been struggling to get a firm idea of best practices in my head regarding dependency injection and structuring my classes and their methods.\nThe code I am providing will clearly be built on... |
[
{
"role": "user",
"content": "So, I'm in the midst of writing a programming language interpreter in Python, and one of the problems I'm concerned about is that since I've been using a lot of recursions to implement the interpreter, I'll get a stack overflow if the size of the code is too large. For example,... |
[
{
"role": "user",
"content": "Is the below a good solution for an observer to monitor multiple subjects. My only fear is that if an observer was monitoring a wide range of subjects then the update method could get quite large checking each instance to see what type it is but I can't think of another way to ... |
[
{
"role": "user",
"content": "This is my solution to this SO question, which can formulated as\n\ntake the sequence A002260, i.e., 1, 1, 2, 1, 2, 3, ...\nconcatenate all its digits\nfind the digit at a given position (1-based)]\n\nWhat bothers me is that my solution is rather complicated and fails near Long... |
[
{
"role": "user",
"content": "How well does this code limit security problems when uploading images to the server?\n<?php\n\n$filename = $_FILE['inputfile']['name'];\n$upload_path = 'images/';\n//extract extension\n$ext = strtolower(substr($filename, strrpos($filename, '.') + 1));\n\n// return mime type ala... |
[
{
"role": "user",
"content": "This is an exercise that asks to:\nWrite a program that first asks a user to enter two words and a\n letter. Then print the first word in uppercase letters and the second\n word in lowercase letters. Print out the number of letters in both\n words, how many times the inputte... |
[
{
"role": "user",
"content": "I read up on and dived into the Repository pattern for a project I am working on.\nI have understood that the repository abstracts the actual access to any form of storage for my data model. What I was a bit hazy on was how to use everything in the context of an ordinary applic... |
[
{
"role": "user",
"content": "After asking my first question got a nice review on that. So, this is my solution for a different question checking edge cases and incorporating ideas given in that review.\n\nQuestion: Write a program to count total number of vowel and consonant characters present in an user e... |
[
{
"role": "user",
"content": "I'm not really seeing any use for a generator here, unless there's some way to hook a generator into a language dictionary.\nBut in the following code, the longhand version of the if statement (type_check()) returns a tuple (foo, bar) but to get the tuple from (my first ever) l... |
[
{
"role": "user",
"content": "I have written the following utility, as my first non-tutorial program in Go.\nThe purpose of the utility is\n\nto connect to a torque/force sensor (aka load-cell) via UDP;\nto send an initialization command; and\nto record the resulting stream of measurements.\n\nSince I am pl... |
[
{
"role": "user",
"content": "This ASP.NET MVC website is for my professor to track my progress on my Checkers app. This is the first time I have build an ASP.NET website entirely on my own, and I would like a review to make sure I am doing everything in the best way possible.\nFirst, my HomeController:\np... |
[
{
"role": "user",
"content": "The challenge is to iterate over the vector only once and return the value within the range of the zero. However, if there are no matches or more than 1 match, deliver an error. The vector is unsorted and has no guarantee on it's size or the range of data.\nMore technically, th... |
[
{
"role": "user",
"content": "I am iterating through a set of values that are in the following string format:\n69;#Statements;#44;#Clarifications;#45;#Suggestions;\n\n(fields with multiple values returned from SharePoint.)\nI've created a function that both adds these values to a list and returns them as a ... |
[
{
"role": "user",
"content": "What I'm ultimately trying to accomplish is a tool in which I pour some documents. Then I mark #x documents as desired and #y documents as undesired.\nMy tool now is to analyse and compare the documents and give me search strings that would find me many of the desired and few o... |
[
{
"role": "user",
"content": "The original question is to write a Fortran program to compute the sum of the first 20 terms in the exponential equation (for x=1,2,3,4,5):\n$$\\sum_{n=0}^\\infty \\frac{x^n}{n!} = 1 + \\frac{x^1}{1!} + \\frac{x^2}{2!} + \\frac{x^3}{3!} + \\frac{x^4}{4!} + \\frac{x^5}{5!} + \\l... |
[
{
"role": "user",
"content": "Problem statement: Write a program that takes a command-line argument n and prints all integers less than n that can be expressed as the sum of two cubes in two different ways i.e. distinct positive integers \\$a\\$, \\$b\\$, \\$c\\$, and \\$d\\$ such that \\$a^3 + b^3 = c^3 + ... |
[
{
"role": "user",
"content": "I was asked for an example of a class to wrap dynamically added controls as I suggested in this Answer. Although it is out of the context of a Code Review, I thought that it would make an interesting post.\nI'm looking for feedback on not only \"How to improve my code\" but al... |
[
{
"role": "user",
"content": "NOTE: I am not familiar with a lot of terminology. If I am naming things incorrectly, please correct me!\nMaking small game engine for learning. Mostly using inheritance, but the more my project grows, the more I feel like objects are inheriting to much. \nExample of inheriting... |
[
{
"role": "user",
"content": "I have several large numeric vectors (close to 1e6 entries each) and I need to make some computations with their values:\niters=100\niters2=100\nset.seed(91)\nsampleSubset<-sample(1:1e6, iters)\nmR12 <- mR1[sampleSubset]\nmRy2 <- mRy[sampleSubset]\nmDMDuc12 <- mDMDuc1[sampleSub... |
[
{
"role": "user",
"content": "Currently the class takes a json file and retrieves data from it, and i'd like to improve this class.\nConfigLoader.h\n#ifndef LEVELEDITOR_CONFIGLOADER_H\n#define LEVELEDITOR_CONFIGLOADER_H\n\n#include <string>\n#include <json/json.h>\n#include <stdexcept>\n#include <fstream>\n... |
[
{
"role": "user",
"content": "This code is for dispatching and handling certain events from GitHub (and also Bitbucket). Things like pushes, issues, etc. can be handled by this system, and strongly-typed objects will be returned.\nI left the XML docs out of all these, as somewhere from 2/3 to 3/4 of the fil... |
[
{
"role": "user",
"content": "This code is meant to compute the height for the tallest stack of boxes out of a given collection of boxes. A box has width, height, and depth dimensions. The height of a stack of boxes is the sum of all of the heights of the boxes in the stack. The boxes cannot be rotated. A b... |
[
{
"role": "user",
"content": "I have a select statement which is infact a subquery within a larger select statement built up programmatically. The problem is if I elect to include this subquery it acts as a bottle neck and the whole query becomes painfully slow.\nAn example of the data is as follows:\nPayme... |
[
{
"role": "user",
"content": "I have a simple static class that it's purpose is given an RDD of Point to find the median of each dimension and return that as a new Point using Spark's reduce functions.\nThis is the class:\npublic class MedianPointFinder {\n\n public static Point findMedianPoint(JavaRDD<P... |
[
{
"role": "user",
"content": "LeetCode Link\nHere is the problem statement. I came up with a code that is 36% faster than other online submissions and the memory usage is 35% less than other online submissions.\nRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.\n\n\n\n\nSymb... |
[
{
"role": "user",
"content": "The following code and test data works, but I have had to add delays between writes to MySQL otherwise it acts funny (especially on the target data set which is over 700 rows). The table is simply a number and value (the number is another table's 'foreign key(?)'.\nI am lookin... |
[
{
"role": "user",
"content": "After alot of reading and testing I've created a \"half generic\" hash table.\nWhat I mean by half generic is that the struct that I'm using have a name variable which is char * which is my key, and the second variable it contains is a pointer to void so it can be any struct.\n... |
[
{
"role": "user",
"content": "Model:\nclass Task extends Model {\n}\n\nwith fields\nprotected $fillable = ['message', 'due_time', 'status'];\n\nI've added special functions public function getEditableStateForAttributeName().\nIn my helper function I check that if method_exists($class, 'getEditableStateForFi... |
[
{
"role": "user",
"content": "I finally managed to work with socket.io namespace stuff which I'm using for building a chat module. Here, employees of multiple organizations can join and vhat with other employees of the respective organization. What I'm doing at here is creating separate namespaces for each ... |
[
{
"role": "user",
"content": "I wrote this code in Java as a \"Truth or Dare\" game where if you type \"truth\" or \"dare\", it will pick a random number from the switch and then output the truth question or dare. The code works great but what I am looking for is critique.\nI'm self taught and pretty new at... |
[
{
"role": "user",
"content": "I wrote a program to retrieve the key/messages from 10 different ciphers which were all encrypted with the same key with an xor one-time-pad method via crib dragging.\nTo do this, I wrote a python script which turns a string to test to hex code. Then it xors the 10 cipher strin... |
[
{
"role": "user",
"content": "I understand that account details should be stored using a much more secure method, but this is only a demonstration script I've made to store login credentials and remember a user wishes to remain logged in using localStorage rather than sessionStorage.\nCould anyone show me h... |
[
{
"role": "user",
"content": "I wrote a Python 2.7 script, which plays tracks from the SoundCloud Top 50.\nimport atexit\nimport os\nimport shutil\nimport subprocess\n\nimport requests\n\n\nif not os.path.exists('.tmp'):\n os.mkdir('.tmp')\n\n@atexit.register\ndef cleanup():\n shutil.rmtree('.tmp')\n\... |
[
{
"role": "user",
"content": "I'm quite novice here so apologies for any silly mistake in advance\nI've been writing a simple tic tac toe game which is a part of my course in udemy\nSince this is my first project, I want to do my best in order to learn new things besides learning how to code better. General... |
[
{
"role": "user",
"content": "Ok, so I started to build my own CMS. You can see Aleksandar Golubovic's Blog,and I need your help. Please, look at my code, and tell me is that safe? You can download current version from Twitter Bootstrap CMS. If you want to install it, just read instructions.\nSo, please, te... |
[
{
"role": "user",
"content": "I would like to ask your comments on my contest code for the following problem:\nWe're going to have a slightly more logical puzzle today. We're going to write a program that will find a path through a simple maze.\n\nFormal Inputs & Outputs\nInput Description\nThrough standard... |
[
{
"role": "user",
"content": "I've made this some time ago for an assignment and I was wondering how it could be improved both in terms of performance and best practices for C code.\n#include <stdio.h>\n#include <string.h>\n\n#define NR_ROTORS 3 /* Number of rotors */\n#define ROTORSIZE 26 /* Rotor char... |
[
{
"role": "user",
"content": "this code is counting the average protein length (number of amino acids) across the proteome of some microbes.\nAs it stands the code takes a very very long time to run, I think I'm being very inefficient somewhere but not 100% sure where.\nThe way I run the code is using a bas... |
[
{
"role": "user",
"content": "I'm working through Stanford's algorithms course on edX.\nOne of the programming assignments is to find strongly connected components using Kosaraju's algorithm, on a graph with ~875,000 vertices. My implementation is the most basic translation from the textbook's pseudo code i... |
[
{
"role": "user",
"content": "Backstory\nA little while ago I was assigned with the task of clustering some road segments using open street map data. After parsing a huge XML (maybe that should be another review) I ended up with the following data format:\nstruct node {\n std::string id;\n double lat;\n ... |
[
{
"role": "user",
"content": "I am testing a Spring boot service using JUnit 5 and Mockito. I haven't spent much time on unit testing in the past so I'm not sure if I'm accidentally implementing an anti-pattern or not following best practices.\nI read multiple times that it's good practice to have one asse... |
[
{
"role": "user",
"content": "The following is my second attempt at a basic CSV parser in Ruby. I've addressed suggestions that I've got for my previous version here.\nI have omitted all test cases - the code listing would be too long otherwise. You can look at the full code-base at GitHub if you want to.\n... |
[
{
"role": "user",
"content": "I needed to implement a way to track idle state / inactivity in a browser (Angular app), so I tried to create an observable that would trigger whenever there wasn't any user-interaction event, so the client can automatically log out:\nimport {filter, from, fromEvent, mergeAll, ... |
[
{
"role": "user",
"content": "I use JMeter for load testing and want to report error on CI pipeline when application though put is less than 1/sec. JMeter logs summary of results as - \n2017/01/17 01:57:00 INFO - jmeter.reporters.Summariser: summary + 103 in 00:00:30 = 3.4/s Avg: 2937 Min: 48 Max... |
[
{
"role": "user",
"content": "I'm writing some function tests and wrapping a Microsoft Playwright (it's similar to Selenium for those unfamiliar) IPage with a page object containing some helper functions to simplify the test code.\nThe following function reads a table on the HTML page and makes the data ava... |
[
{
"role": "user",
"content": "I have some working code, but it seems a bit clunky.\nI need to get data from a service. The service will hold the data in local storage if possible (to make it speedier), but if it's not been accessed before, it will need an http GET to a web server. The example contains only ... |
[
{
"role": "user",
"content": "I decided to play around with doing my own super-basic animation. For a previous Javascript project, I needed the ability to flash an element. The code below is the result of me attempting to generalize the main animation loop function, and learn Typescript at the same time.\nW... |
[
{
"role": "user",
"content": "I've been told that using God objects at all is a Bad Thingβ’\nIn object oriented languages, God objects know all, they control too much. I'm trying to build a game (or for the scope of this question a generic app with a GUI) and I'm using a Main object that holds all the other ... |
[
{
"role": "user",
"content": "Given a number between 1 and 7, this will display which day of the week corresponds to that number, starting with Monday. This is pretty simple and pretty easy, but it seems that there would be a much better way to do this, where I wouldn't have to write out each day of the wee... |
[
{
"role": "user",
"content": "This is a follow up from question\nhttps://stackoverflow.com/questions/45106245/net-file-random-access-recoard-locking\nI have been able to make the reading and marshalling work ok but the performance is a lot slower then using Fileget().\nThere is a few articles around e.g. ht... |
[
{
"role": "user",
"content": "A student has a book containing 411 pages.\n She read a certain number of pages on the first day and created a rule to work out how many pages she had to read on each succeeding day.\n She decided that the number of pages to be read on the next day should be equal to the squa... |
[
{
"role": "user",
"content": "This is an assignment and i have implemented the function hexasc from the description above. To run this code I'm using MARS-simulator.\nFor the sake of understanding it better i would appreciate to see different approach.\n\nWrite a small subroutine, that converts numbers in t... |
[
{
"role": "user",
"content": "I have a shell and batch script to make specific calls to a MBean on a JMX server. The shell input args are not working in windows because windows handles \" differently than linux.\nAssuming this is a bean name : bean = \"hostName=\\\"localhost\\\",name=\\\"foobar\\\"\\\"\"; a... |
[
{
"role": "user",
"content": "Motivation\nI wanted to write a simple console application to improve my vocabulary by using the Wordnik API to get words and definitions and using the SuperMemo2 spaced-repetition algorithm to schedule review sessions.\nFeatures\n\nCorrectly implement the SM2 (SuperMemo2) spac... |
[
{
"role": "user",
"content": "This works for the most part. I am very new to programming so be aware.\nimport java.util.*;\npublic class HangManP5 \n{\nprivate static Scanner k;\npublic static void main(String[] args) \n{\nint attempts = 10;\nint wordLength;\nboolean solved;\nk = new Scanner(System.in);\n\n... |
[
{
"role": "user",
"content": "For an online contest whose problem is here, I wrote some code.\n\nIn this problem the input will consist of a number of lines of English text consisting of the letters of the English alphabet, the punctuation marks ' (apostrophe), . (full stop), , (comma), ; (semicolon), : (co... |
[
{
"role": "user",
"content": "I created a little singleton-like class that gets deleted when there is no reference to it anymore (so its lifetime shall be somewhat predictable). I aimed to make it thread-safe.\n#include <memory>\n#include <mutex>\n\ntemplate< typename t_type >\nstruct shared_instance\n{\n ... |
[
{
"role": "user",
"content": "For homework, I had to write an RPN Evaluator and write the results to a text file. I've done all that, but it feels weird, like the writing to my results text file. It also doesn't feel efficient. There are some constraints, like no <vector> or <string> libraries and no other ... |
[
{
"role": "user",
"content": "I just finished a course of functional programming in uni and continued to study Haskell because I found it very interesting! I made a simple hangman game and would like to hear any of your thoughts and ideas that may arise looking at the code! What, for example, could make it ... |
[
{
"role": "user",
"content": "I didn't find an implementation on CR of the circular doubly linked list, using generators. Hence, I tried it myself.\nDescription\n\nThe class Deck represents a circular doubly linked list, only\n referencing the head node. The tail node is derived as\n head.previous. The le... |
[
{
"role": "user",
"content": "Need to merge data per column if records in the first column are the same.\nI wrote a VBA code and it works but it works very slow as it executes \"merge\" function per each row no matter if consequent cells are the same or different.\nSub DuplicateValues()\n\n'Declare All Vari... |
[
{
"role": "user",
"content": "This is simple server which basically just writes something to mongo after it accepts POST request, and then initiates a new HTTP request.\nI would appreciate feedback especially if I am doing correctly error handling etc.\nThe code does its job though.\nconst MongoClient = req... |
[
{
"role": "user",
"content": "I have created this method to do all my WebRequests.\nGenerally my question is, if this could be improved in any way.\nAs a side question, I would like to know if it be better to create methods for each type (PUT, POST, GET, UPDATE, DELETE) of a request separately?\n /// <su... |
[
{
"role": "user",
"content": "create or replace procedure upsertTrackingItemMetric(\n p_template_id number,\n p_jobDef varchar2,\n p_metric_type varchar2,\n p_metric_value varchar2\n)\nis\n PRAGMA AUTONOMOUS_TRANSACTION;\n sig_att_id number := null;\n sig_grp_id number := null;\n tim... |
[
{
"role": "user",
"content": "I have a myCon=getUnusedConnection() method that gets a connection from Connection pool. I also have a releaseConnection(myCon) method to release Connection to the pool after finishing using it.\nWhen coding, I need to select data from the database many times. I also want to r... |
[
{
"role": "user",
"content": "I haven't written anything in C++ in a couple of years, so I have both forgotten a lot and also wasn't exposed to the modern C++. I am working on a toy programming language and while other parts are pretty large, so probably hard for a review, the lexer is fairly isolated. I wo... |
[
{
"role": "user",
"content": "I created this double-ended queue using list. I supported the standard operations such as push, pop, peek for the left side and the right side.\nI used an integer mid to track the midpoint of the deque. This way elements can be inserted to the left or to the right appropriately... |
[
{
"role": "user",
"content": "In perl, is there a canonical practice or idiom for assigning value to an argument which, if \"empty\", is assigned a default value?\nHere, \"empty\" is defined as an argument value which is either undef or the null string (''). Notably, 0 (or perl false) is a valid, non-\"empt... |
[
{
"role": "user",
"content": "I am relatively new at using PHP, and I am looking for experienced PHP/HTML users to have a look at my script and offer up any advice on what could have been done better or info on any discovered errors.\n<!DOCTYPE HTML>\n<html lang=\"en\">\n<head><meta charset=\"UTF-8\">\n<tit... |
[
{
"role": "user",
"content": "Module name: database.py\nCode:\nimport sqlite3\n\nclass Database(object):\n \"\"\"sqlite3 database class that holds testers jobs\"\"\"\n DB_LOCATION = \"/root/Documents/testerJobSearch/tester_db.sqlite\"\n\n def __init__(self):\n \"\"\"Initialize db class va... |
[
{
"role": "user",
"content": "I have made two quite basic algorithms used for lossless data compression.\nThis is my RLE:\n#include <string>\n\nstd::string rle(const std::string& input) // encode (aaaaeecd -> 4a2e1c1d)\n{\n std::string output;\n\n int n = input.size();\n int i = 0;\n while(i < n... |
[
{
"role": "user",
"content": "I have a VBA script that does the following and I am trying to see if I can have it perform faster than 44 seconds:\n\nstart with ~138k rows of data on sheets(\"Data\")\nconcatenate each cell in the row into a temp string variable\n\n\ntemp string will look some like this if my... |
[
{
"role": "user",
"content": "I have been programming a simple number guessing game and I am wondering if there is any way of making my code more efficient and cleaner. I have spent some time on it implementing error checking to make it as safe as I know how. I feel as if the way's that I have done this may... |
[
{
"role": "user",
"content": "I have this piece of Java (Android) code that adds a list of brokers to a local SQLite database as one single SQL instruction.\npublic void Add(List<Broker> brokers)\n{\n if(brokers == null || brokers.size() == 0)\n return;\n\n String sql = \"INSERT INTO \" + TABLE_N... |
[
{
"role": "user",
"content": "I am putting together a fairly simple server that listens for a connection then creates this thread - textbook Java code - then accepts data on that connection.\nI am following a protocol that the manufacturer has laid out for start of message (0xfd) and EOM (0xfe) as below. ... |
[
{
"role": "user",
"content": "I've made the changes that I think best suit my application and am looking to see what people think of this implementation.\nPhishingController\n/**\n * sendEmail\n * Function mapped to Laravel route. Defines variable arrays and calls Email Class executeEmail.\n * \n * @param ... |
[
{
"role": "user",
"content": "So, I'm building export/import CSV helper. I have some performance issues in the code below. it takes me to parse CSV of 25,000 rows at 7 seconds.\nIf someone can help, it will be awesome! \npublic System.IO.Stream ParseContent<T>(IEnumerable<T> entities) where T : c... |
[
{
"role": "user",
"content": "I have built a machine that juggles. An Arduino sends signals to stepper motor drivers that drive NEMA 23 size stepper motors.\n\nVideo of the machine: https://youtu.be/-9zD_8erkck\nCurrently, each arm makes one revolution and then pauses while the other arm makes one revolutio... |
[
{
"role": "user",
"content": "There is no official WhatsApp API. Here is a simple python class which satisfies the need.\n# SWAMI KARUPPASWAMI THUNNAI\n\n#============================================================\n# Simple yet Hackable! WhatsApp API [UNOFFICIAL] for Python3\n# Note: The author gives perm... |
[
{
"role": "user",
"content": "I was given for homework to make a rock paper scissor game where I input my choice as a string either: \"@\" for rock, \"[]\" for paper or \"X\" for scissors. The computer chooses a random one and it's printed who wins. I'm worried that my code isn't good enough.\n#include <std... |
[
{
"role": "user",
"content": "I'm not sure about that if else statement in function Change(). I'm guessing there is a way to eliminate this and make better use of OOP principles. Does anyone have any suggestions? \nPS This code is functional and produces the desired result.\nusing System;\nusing System.C... |
[
{
"role": "user",
"content": "Hey I am in the process of making this game, please could I get any feedback on how to further approach this, as I find it kind of inefficient. \nimport pygame\nimport time\n\n\npygame.init()\n\n\n#Creating the Pygame window\nX = 500\nY = 500\nwin = pygame.display.set_mode((X, ... |
[
{
"role": "user",
"content": "Problem\nValidate if a given string can be interpreted as a decimal or scientific number.\nExamples:\n\"0\" => true\n\" 0.1 \" => true\n\"abc\" => false\n\"1 a\" => false\n\"2e10\" => true\n\" -90e3 \" => true\n\" 1e\" => false\n\"e3\" => false\n\" 6e-1\" => true\n\" 99e2.5 \... |
[
{
"role": "user",
"content": "For the past months I have been learning plain javascript without jquery or libraries/frameworks. So now, when I develop a website, I want to write all of the JS code by myself to fully understand what is going on and to learn the language.\nSo far so good. I tried to implement... |
[
{
"role": "user",
"content": "I am writing Python program which calculates area and perimeter of various 2d shapes. I am trying to learn about OOP and this is the first project which I wrote from scratch.\nI'm wondering how to let user now what attributes he should use in order to get the correct result fro... |
[
{
"role": "user",
"content": "This is a simple pool allocator, based (to at least some degree) on a previous answer. The basic idea is pretty simple: allow a user to allocate objects of some type quickly (in relatively large contiguous chunks) and only free objects when the allocator itself is freed, then d... |
[
{
"role": "user",
"content": "Edit: I am hoping to get some review / make sure I am understanding dynamic programming correctly.\nI am trying to print out all additive numbers up to digits n using dynamic programming. Additive numbers are those like 123, 1235, etc., where the sum of every 2 digits from lef... |
[
{
"role": "user",
"content": "I am working on a C++11 project and am migrating the underlying communications library used.\nThe original library allowed sending messages in multiple parts using a SNDMORE flag:\nsocket_->send(str_1, SNDMORE);\nsocket_->send(str_2, SNDMORE); \nsocket_->send(str_3); // The las... |
[
{
"role": "user",
"content": "I have the following table in a PostgreSQL DB (simplified for the question), where I want to select only the rows marked with *:\nuuid | status | info1 | info2\n-------------------------------\n1234 | CONF | - | 10\n1234 | START | abc | 10\n1234 | FIN | abc | 10 *... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.