instruction stringlengths 71 71.9k |
|---|
I'm trying to clone a Dots game with some little differences (power ups and objectives) as a school project. I have almost every objective done so now, I'm not trying to get my work done for free. I am however asking for code structure advice and to learn if you find any horrible mistake. I'm sorry that the code isn't ... |
I'm working on an API testing algorithm within the Postman REST client and I wanted a simple and elegant deep diff function to test my JSON responses. I only have access to Lodash within Postman's testing sandbox.
I couldn't find one on SO or elsewhere online so I decided to write one for myself. My goal was to write t... |
I'm new to Slim and the three layered approach I'm using below. So far I have the API, a Presentation layer (leaving out for now), a Business Logic Layer, and a Data Access Layer. The code's working, but I know it can be improved a lot. I'd really appreciate some feedback from you all.
A few things I'm questioning alre... |
I just coded a version of WaTor, a population simulation game in which fish and sharks move around, breed, and eat each other. I am wondering how I did and if there are better ways to do some of the things I am doing, specifically on the move methods for the sharks and the fish.
Animal
package WaTor;
abstract class An... |
I have this PHP function that adds custom user profile fields to WordPress. It saves the field through the WooCommerce form-edit-my-account.php file. I have a lot of repeated code, and would like to clean it up.
function save_sfirst_account_details( $user_ID ){
$sfirst = ! empty( $_POST['sfirst'] ) ? wc_clean( $_PO... |
This code does the following:
Read CSV file and determine sub_type based on series_desc.
Turn row into dictionaries new_person and new_subscriptions.
Check list people for the new_person and add the person if it is actually new.
Check each person in the list people for the new_subscription and add it if it is not ther... |
I used jQuery-UI and jQuery to create a dialog popup for help snippets on search form inputs.
HTML (Calling Page)
<a id="Help" href="#">
<img alt="help Symbol" src="Icons/helps.gif" style="border-style:none;"/>
<span>Name Search</span>
</a>
<div id="dialog-confirm" title="Name Search Help" style="display: none;... |
I created a Pandas dataframe from a MongoDB query.
c = db.runs.find().limit(limit)
df = pd.DataFrame(list(c))
Right now one column of the dataframe corresponds to a document nested within the original MongoDB document, now typed as a dictionary. The dictionary is in the run_info column.
I would like to extract some o... |
I have an array of objects that have a key attribute with the name of a country and a values attribute that is an array of values that contain data by year:
I needed the opposite: an array of objects where the key is the year and the values an array containing data for each country in the original array.
I wrote this... |
I have created an open source memory cache called cachew and can be found here:
cachew. I would like your help to make it better.
Regarding the class Cache or its dependencies:
I am thinking of removing timeoutStyle and timeout from the Cache constructor and providing default values that can be changed via public prop... |
I made a simple Blackjack game in Python 3.4.3. I'm a beginner, so it would be awesome if you could rip up my code and tell me everything I did wrong. I know there's no insurance for when the dealer has an ace (yet), and there's some other blackjack rules that I'm going to add in the future, but I wanted to get a base ... |
I wanted to share my code for others to critique. This program is something I started while struggling with homework problems in my Statistics course, and after getting the ball rolling, I decided to keep adding and perfecting it. Right now it is in a usable state, but I want to hear the opinion of other more experienc... |
I needed to implement a data structure that supports the following operations:
create from an existing collection
get the maximum item ("Alpha")
get the nearest-to-maximum item ("Beta")
get the minimum item ("Omega")
get the sum of all items ("Sum")
reduce the maximum item to a lower value
perform an arbitrary operati... |
Problem Statement:
Given a word and a text, return the count of the occurences of
anagrams of the word in the text. For eg. word is “for” and the text
is “forxxorfxdofr”, anagrams of “for” will be “ofr”, “orf”,”fro”, etc.
So the answer would be 3 for this particular example.
The above is an interview question ... |
I'm writing adapters for some MS Access database because I really didn't like that automatically generated code that Visual Studio was providing. Right now I just need to get data, not updating anything over there, but that will come later.
Here's some code that I'm using (all the adapters look the same, so that is wha... |
I coded a math quiz in PHP in which a user selects radio buttons as their answer choices. I retrieve the data of these ten radio buttons using $_POST[]; However, I have ten separate post queries for EACH radio button as well as SQL queries, and also ten separate if statements to check for each correct answer. It looks ... |
This is a userscript that simply adds the number of pages that a thread has next to its title for Flickr interface. (FWIW it's not really done because the script is only loaded at page load, but not reloaded on subsequent AJAX calls that the user may make).
I'm far from being a seasoned JS developer, so I'm looking for... |
I've created an SDL input manager for my 3D OpenGL applications. It's not finished yet, but I would like to know if I'm doing it the right way.
I really tried to optimise and compact my code, as it is for an OpenGL library.
InputHandler.h
#pragma once
#include <SDL2/SDL.h>
#include <vector>
#include <glm/glm.hpp>
#incl... |
I have two lists of objects Person and PersonResult. Both are linked through the property PersonId. I need to create a filter for the list of PersonResult that meet certain criteria for the Person (e.g. Person.Gender == "female").
Im currently using the following LINQ query to achieve this:
PersonResultList = PersonRes... |
I've written a small program that draws a vector field in R using ggplot for a given differential equation.
There is a topic on the subject here however, the proposed solutions either don't provide the same functionality as the code below or don't use ggplot.
//example differential equation: f_prime = f(x,y)
f_prime ... |
Sometimes when working with components created by a library vendor such as DevExpress you want to extend the components. Good vendors will leave plenty of virtual methods for you to put to use, but once in a while you need to hook into an interface method call in a class that implements the method explicitly. You can s... |
I've been writing a program to synchronize two or more folders. I've read that methods should be kept short. While most of mine are, one method is ~50 lines:
public void ModSync(List<mySyncFol> dirf, string logpath)
{ // Sync Everything to most recent modified
int a = 0, ac, b=-1, li = 0; // a =... |
As writing code to handle error-checked input or to present functions to execute to the user is boring and error-prone, I wrote a module to automate these tasks:
user_interface.py
def general_input(prompt="", type_=str, min_=None, max_=None,
max_length=None, set_=None, cap_sensitive=True,
... |
I'm having trouble finding a clean way to handle checked exceptions thrown by a lambda function passed as a parameter in Java.
I'm writing a Client which will interact via RMI with a Server to play a game; a Client needs to be registered on the Server to be able to login, and it needs to be logged in to play a game. It... |
I'm using a transaction statement in SQL Server 2012 for the first time.
I want to insert Table1's data in Table1_Backup before I delete everything from Table1. Same process for Table2. Should I name my transactions? Does this transaction code even look right?
DECLARE @err int
BEGIN TRANSACTION Table1
insert into [Ta... |
We have the following equation (weighted phase Laplacian):
\$c_{i,j} = U(i,j)\Delta^{^x}_{i,j} - U(i-l, j)\Delta^{x}_{i-1,j} + V(i,j)\Delta^{y}_{i,j} - V(i,j-1)\Delta^{y}_{i,j-1}\$
Where
\$U(i,j) = min(w^2_{i+1}, w^2_{i+1})V(i,j) = min(w^2_{j+1}, w^2_{j+1})\$
with \$U, V, \Delta \$ (N,N) matrices
I coded the following ... |
In an effort to understand how compilers work, I wrote a simple expression calculator in C#. A CalculatorExpression takes an infix string, converts the infix string to postfix, and finally takes the postfix to an internal BinaryExpression tree representation.
To use, simply create an expression, and then evaluate:
va... |
This post is complementary to this one
I asked the question about implementing DropBox's "Share link" functionality on the server side in the most "secure" way. Of course, real security involves at least password-based authentication, not this "security by obscurity" approach, but the guys from DropBox managed to imple... |
I was thinking about using very basic bounded (preallocated) stack to keep track of my threads IDs in correct LIFO order. I was wondering if my implementation is thread safe:
// we use maximum 8 workers
size_t idle_ids_stack[8];
// position current write happening at
std::atomic_uint_fast8_t idle_pos(0);
// this funct... |
I'm practicing by writing utilities for myself; I prefer CSS3 transitions over jQuery animations whenever possible. This is intended to be used for transitioning multiple DOM elements who's relationship to one and other is only given by the context (ie. on clicking a menu icon, hide/show, relocate, resize, etc. multipl... |
I want to create a web app that should let users remotely make a device do a variety of things simply using any other device, anywhere, without installing anything. To do that, the device which performs tasks should receive commands as fast as possible, and, possibly, using few Internet data.
This is the code I'm going... |
There was some online test where I was asked about finding all possible distinct palindromes of a string.
Here I had to give the count of all possible distinct palindromes of a given string (continuous substring). Here, a single character word is considered a palindrome.
Below is what I did. Can you please tell me if i... |
I have been working on a script that automatically checks on the state of 2 services that I require to be running 24/7 on a server that I manage.
The script works as I need, but I would really like to optimize it if possible.
Specifically, I find that I want a way to reduce the need to type the command:
$(ps -ef | grep... |
I am working on an ad form for a local newspaper. I am not familiar with the programming side of things, still learning. I was able to successfully get the form to count the words, but I need it to quote the price based on different packages/ word counts. Here is an example of the form and what the price structure e... |
I'm a beginning Python programmer, and earlier I made a simple Blackjack game in Python. The original version (which can be found here) got a lot of great feedback, so I rewrote the entire program to reflect the feedback I received. Again, any tips are appreciated.
import random
import itertools
# generates the deck a... |
Warning: I'm quite new to low-level programming and memory management so please don't mind it when I'm asking incredibly stupid things.
I'm working on a project where I need to read all the lines from a file and store them for further usage. I decided to use a linked list of untyped pointers for this which will contain... |
I wrote a method which computes the ratio of even to odd numbers in an array. I know it's a simple piece of code, but I wanted to see if you have any feedback for improving it.
public double percentEven(int[] a) {
if(a.length <= 1) {
return 0.0;
}
double even = 0.0;
for(int i = 0; i < a.length; i++) {
if(a[i] %... |
I need to refactor this class having in mind that the logic inside the call methods is not so short and it require spring dependencies to work, the base class I have is:
@Service
public class ConcurrentService{
@Autowired
private Service1 service1;
@Autowired
private Service2 service2;
public exe... |
I am creating a simple 2D canvas game engine in JavaScript. Are there any optimizations that I could make, or obvious issues (performance, semantics or otherwise) that you can see?
JS Bin here
var GameCanvas = {
// GameCanvas Variables
animation: {
requestAnimationFrame: null,
halt: false
},... |
This code addresses performance issues specific to Android running Xamarin / C# when downloading images (BMP/PNG) into a listview. The caller simply specifies the URL to fetch the image from, and the preferred dimensions.
Optimisations I could do, but haven't:
Not sure if I should use the Android or Java namespace
Sta... |
This code is for a NodeJS logging module. I created it because I wanted to find a way to log different type of things but not show them all at the same time. I also wanted to format the logs in a custom manner.
Is there anything I could do to improve this code, such as making it shorter? Are there still any bugs?
// or... |
My buddy schedules a dart tournament, and got into trouble when there were some scheduling conflicts. He has the first 3 weeks in the books, and needs to finish out the rest of the schedule. Turns out it is a pretty difficult puzzle.
So I figured I could quickly solve it with a constraint satisfaction problem. Unfortun... |
I am a beginner to Java and have just written a number guessing game which involves guessing numbers from 1 to 10. I would like to improve my code by sticking strictly to conventions, improving code efficiency and forming good coding habits from the beginning.
Main class:
public class Main {
public static void mai... |
I recently made the switch from procedural to OOP style of coding. I decided I wanted to learn how everything works before deciding to jump into a framework, follow tutorials, and becoming dependent on the tutorials/help from others. This is my take on dependency injection so far, I didn't see the appeal in a page that... |
class text_generator
{
public int getWordIndex(List<string> source, Random value)
{
return value.Next(0, source.Count - 1);
}
public bool checkListLength(List<string> source)
{
return source.Count == 0;
}
public string getText(List<string> source, List<string> backup_source, R... |
This program first displays a menu which shows some options that the user can select. Each option will the respective functions which do some things.
The user can insert a filename, read data from it, enter a regex pattern, test if each line of the file matches the given regex pattern.
Please provide feedback on how I ... |
I've got a list with tuples of variable length containing nodes, out of which I want to build a network:
node_list = [("one", "two"), ("eins", "zwei", "drei"),
("un", "deux", "trois", "quattre"), ("two", "zwei", "deux")]
Each tuple represents a subgroup in the network. I want to add each node with edges t... |
I have the following code:
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <cassert>
#include <vector>
#include <cstdlib>
#define BOOST_FILESYSTEM_NO_DEPRECATED
#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;
static ofstream Log; // For info... |
I have this project in data analysis for creating a ranking of tennis players. Currently, it takes more than 6 days to run on my computer.
Can you review the code and see where's the problem?
Project steps:
I have a database of 600,000 tennis matches called matchdatabase.The database fileds are a) winner name, b) lose... |
Here is a classical attempt to implement a lock-free stack (based on this article). I rewrote it in C++11 and also tried to add memory orders which I would like to confirm to be correct.
template<typename T>
class stack
{
struct node_t final
{
T value;
node_t *next;
};
struct head_t f... |
I have a search on a very simple spring-powered website and I want to display 10 recent inputs:
import java.util.Collection;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Exec... |
My code takes a starting position (which must be completed) and a list of updates (each element of which is optional). It then projects future positions, using the appropriate value from each update, if present, or using a formula otherwise.
I'm looking for ways to reduce code duplication, especially as the real data s... |
I've refactored my previous question finder, and added multi-tag support, and support for searching for keywords in the question titles. Essentially, what it does is find questions that could be answered based on the following parameters.
-- @MinimumQuestionVotes - The minimum amount of votes on a question.
-- @Maximum... |
So, we have this "Rubberduck Settings" window, with a number of "tabs" dedicated to each configurable feature. The "root" tab contains the application's "general settings" and, in the next release, we've found something to put there:
The display language! Credits to @SimonAndréForsberg and @Vogel612, for the Swedish a... |
I designed a framework to make the switch from procedural to OOP design. This question will contain multiple parts I will bold each question to make reading/dissecting easier. I attempted to look into these questions through Stack Overflow, Google, PHPReddit, etc. and I ran into a variety of answers, most of them bashe... |
I wrote a procedure to calculate the number of months elapsed since a sales agent' last sale. It works but runs in over 10 minutes... for 20 rows.
Sub Latency()
' this sub-routine is used to calculate the no of recent idle months by an agent
Application.ScreenUpdating = False
For Each rng In Range("BL1:BL13000")
j = 1
... |
In a table there is a number of column (chambre) and a number of row (alveole). If these matches in a list in an other sheet then it checks if it the date is between two dates on that second sheets. If it matches those 3 things, then it puts the sheet
My code works if I add DoEvents in every For, else Excel and VBA sto... |
Note: see the next iteration.
I have this tiny library for (de)serializing lists of objects. The requirement is that each object's state may be represented textually as a single line of text. Later on, the deserialization routine attempts to map each text line to the object it encodes.
Factory.java:
package net.codero... |
I am embarking on the daunting journey of learning to program on my own two feet and have created a turn-based battle simulator (think Pokémon). The idea came from here.
It's very crude and could probably use a lot of refinement, so I'm willing to listen to any criticism and advice on improvements.
# Turn Based Bat... |
I wanted to make a Stream that can wrap another stream and buffer all writes, to increase performance; comparable to the BufferedStream class.
However, while BufferedStream is strictly synchronous, and will block once its inner buffer is full, until the contents have been written to the underlying stream, this stream ... |
This is my first Java program to print out the Armstrong numbers.
An Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits.
I want to get better, so be harsh and straightforward.
public class Armstrong {
public static void main (String arg[]){
in... |
I am currently working on a re-occurring broadcast schedule. The whole idea is to setup a cron/task job that will update the broadcast flag "isLive" in a database table. Are there other options to optimize the PHP code below?
Live Table (livevent)
+----------+------------------+------------+--------+-----------+-------... |
I created this small script to strip the data out of tables that have hyperlinks as their <th /> elements. I was hoping to get input on code clarity and possibly simplification, efficiency is not much of an issue for me as there are not any huge tables on Wikipedia.
var arr = $('tbody').children('tr').map(function(idx)... |
I am developing a web crawler application. When I run the program for more than 3 hours, the program runs out of memory. I should run the program for more that 2-3 days non-stop to get the results I need. How is this program using memory inefficiently?
seeds.txt
http://www.stanford.edu
http://www.archive.org
WebCra... |
My code seems a bit sloppy to me, but I don't know how to improve it to make it cleaner and more understandable. I'm just learning Python, as well as Tkinter. I figured a Pythagorean Theorem calculator should be a simple enough jumping-off point. The code works however, I don't have any tests in place so, at the moment... |
I'm a freshwoman at Systems Information, new to Java and programming and was assigned this task by my professor.
My job is to read characters from a text file (file details in the bottom), recognizing each char as an integer. I should extend a class that will make bitwise operations to each char as to change them. For ... |
I am learning Scala still and refactoring some old code. I was hoping the community here could give me pointers to fix this code up since there are some issues I have with it visually, but don't know if there's an elegant solution for my vision.
class PhoneNumber(phonenumber:String) {
def number: String = {
phon... |
#include <iostream>
#include <memory>
using std::cout;
using std::endl;
template<typename T, int dimension = 1>
class Array
{
private:
std::unique_ptr<T[]> pointer;
int size[dimension];
int realSize;
public:
Array()
{
}
template<typename... Ns>
Array(Ns... ns)
: realSize(1)
{
... |
ALL I want to do is making binary search tree, inputting there from users, and then print out data in each node one by one according to the user's selection (whether he choose to print the data in the right node of the current node or the left). So I only define three functions: prompt(), inputData() and printOneNode()... |
I wrote a couple of basic Clojure functions (practicing a declarative style) and I was looking to get some feedback on them. You can see all the code here. Is there anything I could improve on to write more functional style code? How could I improve my tests? (Code can be run with lein test if you have Leiningen instal... |
I'm currently trying to brush up on my assembly skills and, being at the FPU section of the tutorial, I implemented a very basic version of a Monte-Carlo-Algorithm to compute pi. I deliberately use the x87 instruction set instead of SSE because that's what I'm learning at the moment. What would be the pros and cons of ... |
I had faced a interview question to find the gdc(greatest common divisor) for an integer array of element in optimised way :
Sample case :
a[] = { 10,20,19,15,13}
Result = 1
sample case :
a[]={9,21,12,15,27}
Result : 3
I have submitted following result during the interview. But he asked to optimise the same. S... |
This is a improved version of the program seen in my older question.
This program first displays a menu which shows some options that the user can select. Each option will the respective functions which do some things.
The user can insert a filename, read data from it, enter a regex pattern, test if each line of the f... |
A lottery draw consists of choosing 6 different values from 1 to 50.
I want to calculate the number of combinations with gaps of at least 3 between every pair of values.
I have used the following Python 2.7 script:
def func(array,length,min,max,gap):
if len(array) == length:
# print array
return 1
... |
I have written a multi-language software to implement an image denoising algorithm (composed of many sub algorithms) called CANDLE. I have a C program that is part of the software and would like to make sure that it is adequately optimized and safe.
It is a simple C program (no multithreading). I have ran it and everyt... |
I intend to make some changes in an HTML document, like remove, replace, append some nodes.
I have several arrays with same structure like the following example
$patterns[] = array(
'xpath' => '/html/body/div/p',
'insert' => $new_a,
'task' => 'replace'
);
...
$patterns[] = array(
'xpath' => '/... |
The exercise is:
Adapt the ideas of printd to write a recursive version of itoa; that
is, convert an integer into a string by calling a recursive routine.
I wonder if I have correctly answered the question.
# include <stdio.h>
# define MAX 100
int itoa (char s[], int n)
{
static int i = 0;
if (n < 0) {
... |
This is my forms.py for a small survey application I am developing. I previously posted some of my models.py.
I am completely self-taught and am just looking for advice on how to improve. Any advice, even things you might think should be obvious, would be much appreciated.
from django import forms
from django.forms imp... |
Here's what I managed to do. It is rather limited and I had to get help from the internet in some places.
Can you review it, give me some tips on making the code better, cleaner, faster etc.?
editor.py
import tkinter
import tkinter.ttk
import tkinter.filedialog
import tkinter.messagebox
import os
try:
import confi... |
I'm trying to solve Codeeval's The Ministry of Truth challenge, and have hit 97.5% - is anyone able to spot where my code is missing the last 2.5%? The percentage indicates that one or more of their test cases is failing.
Here's the question - I've used the original wording because I'm worried if I give my version of t... |
I have developed a small survey application in Django 1.6.2 which requires that the participants fill out a number of questions over 27 pages using a SessionWizardView.
Overview
The most unique feature of the application is that it allows the user to rate a selection of 9 images selected at random in isolation. The use... |
I am writing a Type-ahead / Autocomplete search with angular using directive and filter service. I am almost there but need your expert opinions on things which I am planning to achieve.
Git Repository
@Todos:
Look and feel
Allow navigation using keyboard
Enter and Esc key handling
Could anyone review and suggest mor... |
A while ago, someone at our office thought it'd be a great idea to start tracking a number of fairly large binary files in one of our more important repositories. We noticed our builds were slowing down (considerably) and fetching new changes from the remotes could take for up to a minute.
We eventually noticed that th... |
I am translating Matlab code to OpenCV. The code involves lots of reshaping of large matrices. As the Matlab reshape differs from OpenCV you can't just use OpenCV reshape.
Here is why: Let's suppose we have a 2x4x3 matrix such as this:
a(:,:,1) =
1 3 5 7
2 4 6 8
a(:,:,2) =
9 ... |
I am learning Haskell and as exercise I am doing Project Euler Problems. In this case PE1.
-- Sum any given finite Airthmetic Progression
sumAP :: Integer -> Integer -> Integer -> Integer
sumAP first limit step = do
let last = limit - (limit `rem` step)
let terms = (last - first) `quot` step + 1
let avg = firs... |
I myself is a Java-developer and now I'm trying to understand how to do it in the most efficient way in C++. After reading that answer I decided to write the following:
//Headers omitted
class integer_validator
{
public:
integer_validator(const char* const str);
bool is_valid();
long get_number();
private:
... |
I am filling a bag full of scrabble tiles. There should be 100 tiles in the bag of these letters:
A-9, B-2, C-2, D-4, E-12, F-2, G-3, H-2, I-9, J-1, K-1, L-4, M-2, N-6, O-8, P-2, Q-1, R-6, S-4, T-6, U-4, V-2, W-2, X-1, Y-2, Z-1 and Blanks-2.
These numbers/letters should never change. I have a working solution, but i... |
This is a generalized A* pathfinder in Go. I am new to the language and am eager for advice about best practices.
In particular, I am not sure if the type assertion I make in Heuristic is the correct way to bind the implementation to the interface.
I have stolen the PriorityQueue type from the package documentation for... |
I have developed a simple autocomplete module for search box in ecommerce website (http://www.cjcharles.com/) built over shopify. Now, as the CMS is commercial, I was forced to use its given API's only.
/*
The given function implements instant search for ecommerce websites
built on shopify platform usin... |
I decided to implement the std::vector class in C++, and was wondering if I had done everything correctly. When I mean 'correctly', I mean that the code is efficiently written and done properly. I have tested all the functions using various tests and they seem to output correct results.
I have not included every functi... |
I saw this question and thought it looked like a great opportunity to try my hand at the Strategy Pattern. I've never used it before, but I think I did pretty well. Did I?
The code below can also be found on github. I'm using C# 6.0 for this, so if there are any opportunities to use new features that I missed, I'd lik... |
Problem Statement:
You are given a function \$f(x)\$, where \$f(x)\$ is \$1\$ if the first and last characters of string \$x\$ are equal; else it is \$0\$.
You are given a string \$S\$ and you have to find the sum of \$f(x)\$ for all substrings \$x\$ of given string \$S\$.
Sample Input:
7
ababaca
Sample Output:
1... |
I began this month with trying to discover how shellcode is made. My search led me to wanting to learn assembly, so I wrote a simple bootloader with NASM:
bits 16 ; 16 bit real mode
org 0x7C00 ; loader start in memory
start: jmp main ... |
I am working on a RestService in which my URL will take lot of parameters. Below are the parameters my URL will take:
UserId: This should always be a long and a number in general.
DeviceId: This should always be a String.
PetaId: This should always be a String.
FlowId: This should be a long as well and a number in gen... |
Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way.
Consider the palindromic numbers that can be expressed as the sum of a
square and a cube, both greater than 1, in exactly 4 different ways.
For example, 5229225 is a palindromic number and it can be expressed
in e... |
I made a chat bot, that, as you talk to it, it learns to respond. But the way it speaks is strange, so if you have any ideas on how to make its response any more human, then please say so.
Anyway, you have to start a new chat bot. You'll notice that when you start his responses will be incredibly stupid. Once you talk ... |
I have to draw various instances of HeatMaps, Winds and Polylines. Each layer will have one HeatMap, 1000+ Wind arrows and 3000+ Polylines.
The websocket pushes the data into the mapData structure where the data is stored for later manipulation of objects.
Each layer takes around 400MB of memory. Since I have to draw m... |
I'm basically looking for a general critique. I'm just starting out and would like to know if I should have done anything differently to make it faster or to make it much more readable. I don't know exactly what happened but I tried it with 14 iterations and it took about 3 minutes to complete. It crashed Unity at 15 a... |
See the previous and initial iteration.
See the next iteration.
I have mainly refactored the code and made it a little bit robust (if serialization of a single object produces a string with new line character(s), an exception is thrown as the deserialization routine relies on assumption that the object string represent... |
I am building game, like Ogame, or Ikariam where you can play with other users in real-time. You train some soldiers, and build some vehicles or buildings. Every building or vehicle has some level. If a building has a higher level you must wait longer to use it etc. I will be grateful for any comments, especially about... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.