instruction stringlengths 71 71.9k |
|---|
I got bored and decided to create a lua announcement system with the ROBLOX API.
One part is the display code, and the other part is the announcement code.
DISPLAY CODE
while true do
wait(0.2)
if script.Parent.Parent.An.Value == 0 then
script.Parent.An1.Text = "This bus terminates here"
script.P... |
Sorry, if you were looking for fresh baked pies, I only have a web client to help you sell them.
I've recently picked up server-side JavaScript and have added it to my toolbox, and while I've had a great time learning so far, I've got some code which needs another pair of eyes to review it.
A quick objective summary: ... |
import csv
import logging
import itertools
from random import choice
from string import ascii_lowercase
from collections import namedtuple
from tempfile import NamedTemporaryFile
DELIMITER = '\t'
ENCODING = 'utf-8'
def get_random_cursor_name(length=7):
return ''.join(choice(ascii_lowercase) for i in range(lengt... |
I'm seeking a code review for the following C++ implementation of Dijkstra's algorithm. I'm trying emphasize code reusability and extensibility but performance is also potentially important.
Documentation
Heap.h
This class implements the priority queue for use in Dijkstra method of Graph class.
The insertion into the... |
So this a exercise from the book COMPUTERS SYSTEMS A PROGRAMMERS PERSPECTIVE
I need to add two signed numbers and in case it overflows or underflows return TMAX (011..1b) or TMIN (100..0b) respectively. In this case we can assumed two's complement representation.
The book imposes a set of rules that the solution m... |
Recently, I ventured into the realm of C++ programming. I have extensive knowledge in C and C#, but very basic knowledge of C++. I decided to build a brief TicTacToe example to test my knowledge.
It works by typing any comma-separated value (i.e. 2,1) and decides whose turn it is by odds and evens. X always goes first.... |
I'm trying to categorize file names of anime episodes (for now) into appropriate title based categories. The Show-titles are parsed from an XML file (I got from Anime News Network).
EDIT: The passed on backgroundWorker object type variable is just to facilitate GUI update as this algorithm runs on a secondary thread.
D... |
The code is actually a TemplateBuilder.
We have 2 different templates, French and Dutch.
We need to change the template and then convert it to PDF so it can be stored in the DB later.
The main method is createBulletins().
What am I looking for?
I don't like the constantly reading the template from the byte[] for each ... |
Here are some stripped down versions of the two different programs I am deciding between.
In version one, my state machine is called within the interrupt:
void TimerInterrupt(void)
{
int battery_voltage;
StartADC();
while(ADCrunning){}
battery_voltage = ADC_value * scale_factor;
BatteryStateMach... |
I have implemented a phonebook in C using a singly linked list sorted data structure. This is my first average-major project.
I need some reviews so that I can improve my coding standards. The program consists of 3 files:
header.h: custom header
/*
* File : header.h
* Custom Header Definition
*/
#include<stdio.h>... |
Consider the following string in javascript:
var string="border-radius:90px 20px 30px 40px";
I want to extract the 4 numbers from that string and store them in an array called numbers.To do that I developed the following code:
var numbers=string.split("border-radius:");
numbers=numbers[1].split("px");
This code is wo... |
I've made a small js/css/html module which purpose is to fill a pie chart up to a given percentage. Basically it could be used for instance as a filling pie chart that keep tracks of the amount of donations for a non-profit organization.
Let's sum up briefly what it does. Basically I have two svg circles, the base col... |
I am trying to write an SQL Procedure that will calculate the Last Price paid for a certain Part.
DECLARE @ItemId int;
SET @ItemId = 1;
SELECT
SD.Price
FROM SalesOrderHeaders AS SH
INNER JOIN SalesOrderDetails AS SD
ON SH.Id = SD.HeaderId
WHERE (SD.LineItemId = @ItemId)
AND (SH.OrderDate = (SELECT
MAX(SH.OrderDat... |
This is actually a question that bugged me for 8 years or so, but just swept it under the rug.
I have a project (big, old, zend 1, etc.) that contains a decent (not high but large enough) amount of logic in views. This implies existence of conditionals there. It does not have any template system (like smarty/twig) so p... |
I'm a coder who's relatively new to Python and I wanted to spice up my console applications a bit by making animations. The code I've written works perfectly, but I just wanted to know if it was good in a pythonic way and if it follows the OO standards. If not please tell me what could be improved and why.
import subpr... |
My code is meant to update the positions and velocities of planets. There are a few methods in this class, but updatePosition and updateVelocity are the most important, as they implement the velocity verlet algorithm. Could it be shorter/more efficient?
public class Particle{
private double mass;
private PhysicsVector... |
From SICP
Exercise 2.27: Modify your deep-reverse procedure of Exercise 2.18 to produce a deep-deep-reverse procedure that takes a list as argument and returns as its value the list with its elements deep-reversed and with all sublists deep-deep-reversed as well. For example,
(define x (list (list 1 2) (list 3 4)))
... |
I am caching an image locally..That same image will be used in few screens. Steps for doing this is as follows:
Get image from cache
If not present in NSCache, get image from Cache directory
If not present in Cache Directory, download from Internet
Save downloaded image to dir
Insert the image in cache
//Helper clas... |
Here's my solution to checking if a Sudoku board is valid. The algorithm checks the following,
Rows add up to 45
Columns add up to 45
Rows have no duplicates
Cols have no duplicates
Every 3X3 sub-grid has no duplicate
Invite comments.
public class Checker {
private int size;
private int[][] board;
public... |
I wrote this Python code that plots the movement of an object under the effect of a given force function in 2D by solving the Newton's movement equation numerically. One can add other force functions, or even parameters to the draw_path function. I tried to make it as readable as I could.
I would really appreciate if ... |
I have a blog that I occasionally post to, but it's a PITA because of the fact that it has it's own WYSIWYG editor and doesn't support Markdown. So I have to switch the WYSIWYG editor to the HTML editor, and of course the HTML is garbled from the WYSIWYG editor.
So, I wrote a programme that I can feed Markdown into, an... |
I'm writing a query to get the number of sessions created each day for the past 90 days. I'm currently using a prepared statement to do this - looks something like this:
for($n = 0; $n < 90; ++$n){
$days[] = $n;
}
$st = $this->db->prepare("
SELECT *
FROM `sessions`
WHERE DATE(sessionStart) = DATE_SUB... |
I'm using RxJS 5.0.0-alpha.12 to perform some data transformations, and some of those transformations use Promises.
return observable
.flatMap(item => {
return Observable.zip(
Observable.fromPromise(fs.readFile('./config.json')),
Observable.of(item),
(s1, s2) => {
return {
config: JSON.pa... |
Since it was getting boring to always do OOP Languages I decided to dabble in the functional realm of programming.
For that I chose the narrowly missed community-challenge by Edward: Resistor Mania, since it really is a quick-to solve using recursive and functional style.
Challenge description:
In electronics, two re... |
I'm just learning how dependency injection and mocking work, but I'd like some feedback on how I'm setting up a couple of tests. I can get them to pass, but I'm not sure this is all I need.
This is an MVC application that makes Web API calls to return data. For this example I'm running queries in the Web APIs that po... |
A third follow up to the simple compression implementation.
Adopted most of @holroy's suggestions. Main changes:
Compression now uses high-bit to indicate that additional length bytes are still following
Added decompression support
Should no longer depend on CHAR_BITS == 8 which increases portability
Use of unsigned l... |
How can I make this code shorter? The code I am using is so long. Just making one simple level is taking about 100 lines of code.
public class Sister_age_guesser {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Sherlock holmes - The game");... |
A utility method StringUtils.replace to replace multiple search strings simultaneously.
I'm looking for a review of any and all aspects, but especially:
Is there's a better way to do this? (short of external libraries)
Is the parameter validation OK the way I did?
Is the way I test adequate and up to good practices in... |
Problem: Given a arbitrary string, split by a given regex and format into an R vector expression. E.g. Convert "a..,b..,c,d" into 'c("a","b","c","d")', when the given regex is "[.,]+".
Solution in haskell:
module Lib
( toRVec
) where
import Data.List (intersperse)
import Data.Maybe (from... |
My team and I have ended up creating this class, which is called directly from ASP.NET Identity as a custom password hasher. I'd like to know whether this would be "overkill"/use a lot of CPU, specially because the site is going to be hosted in Azure.
To take into account:
HashPassword is called when a new user is b... |
I'm teaching myself programming, using Python as my initial weapon of choice.
I have learnt a few basics and decided to set myself the challenge of asking the user for a list of names, adding the names to a list and then finally writing the names to a .csv file.
What would you do differently, i.e. how could this code b... |
I made this simple code which makes easy HTML tag generation. It is open-source and right now only makes tag names and replaces tags... :/
#include <iostream>
#include <fstream>
std::string makeHtmlTags(std::string tagname, std::string tagcontent) {
return "<" + tagname + ">" + tagcontent + "</" + tagname + ">";
}... |
I am working to design an object which would abstract away the use of a WebAPI. I want the developer to be able to use these objects as if they are using a traditional API.
My core problem is how to abstract the interactions with the WebAPI. I currently use an Interface which is initialized in each element to provide ... |
Here is an implementation of Dijkstra
As an rags-to-riches version of this Object oriented approach to Dijkstra's algorithm
#include <set>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <iterator>
#include <iostream>
/*
A very simple Graph object:
The graph type here ... |
I'm trying to update my skillset by learning how to write isomorphic JavaScript applications. For my stack, I've chosen React and Express - no database yet.
The problem many people seem to face when it comes to writing these kinds of applications is getting data from the server to the client so the view can be rendere... |
I have coded for the problem Code Kata 18. Provided the input dependencies, I need to come up with all the transitive dependencies. While working, I encountered various problems like Data Structure Solution, ConcurrentModificationExceptions and others.
Used HashMap of String,HashSet to represent a class along with dep... |
I've made a Pomodoro Timer application. All it does is countdown from a time in minutes given by the user to 0:00. It does this first for a session time, and then switches to a break timer and continuously loops like this until the application is paused or closed.
The time can be adjusted by clicking on a '+' or '-' be... |
I have implemented mergesort in C. Any advice on making it more compact? My merge function seems less than fully optimal.
//mergeSort in C
#include <stdio.h>
#include <stdlib.h>
void merge(int [], int[], int[], int, int);
void mergesort(int[], int);
int main()
{
int unsorted[] = {4, 1, 3, 0, 10, 2, 5, 5};
i... |
Background
Emacs on OS X by default binds several keys with the super modifier. I do not want these bindings as I switch between OS X and Windows frequently, and want a clean slate on both platforms to bind super keys for my own purposes.
Code
global-unset-all-super-key.el
(defun global-unset-all-super-key ()
"Will u... |
Please review my Parser class. Should I declare map outside of convToPosfixQueue method?
class Parser {
private final Stack<String> tempStack = new Stack<>();
private final Queue<String> postfixQueue = new LinkedList<>();
public Parser(Queue<String> infixQueue) {
convToPosfixQueue(infixQueue);
... |
I would like to receive input from more experience coders regarding the potential improvements this piece of code might have. I am new to PHP development and I am sure this code looks horrible behind the eyes of someone more competent. It works, but I think there's plenty of room for improvement.
I have an images folde... |
The below script will compare a set of arrays according to similarities between their key's values. For example, if the first 4 keys values of an array are equal to another array's first 4 keys values, they are equal and consists a cluster. Here is my code:
<?php
$arrays = [
array('a'=>1, 'b'=>2, 'c'=>3, 'd'=>4),
array... |
I have created a test login page that, as most do, takes in two values from the user (username and password) and the processes it.
For this I have opted to use jQuery and AJAX to pass the results to a separate page to be processed, checked and validated before allowing access.
My main front end uses Twitter Bootstrap v... |
I'm absolutely terrible with .bat files, but sometimes they are just needed. Right now I'm working on a project with quite some submodules, which have quite some submodules, and sometimes even those have submodules. Now, being a lazy programmer I figured I'd automate the task of committing the submodule-update in every... |
This function is part of our company's project code.
The following function updates six members of struct CpGSMTimeDelayQuery -- t14_cp, T14_au, Tdl_fib_f, Tul_fib_f, Tdl_cp_f, Tul_cp_f -- in the database.
It contains six similar blocks. These blocks do the same thing: read a specific register, calculate the member va... |
I am trying to prevent CSRF for my login page (linked from here), and for this I am going to use a random token generator to create a UUID for the session.
The function that I have so far is as such:
function UUID()
{
mt_srand((double)microtime()*10000);
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyp... |
From an exercise in Kochan's Programming in C, following a chapter on C's null-terminated strings:
Write a function called removeString to remove a specified number of
characters from a character string. The function should take three
arguments: the source string, the starting index number in the source
string, ... |
I made a small application that makes async calls to an api (local in this case). The target application will make a million of calls per day.
With maxSockets set to 1 I had a time of 45 seconds. With maxSockets = 10, the execution time has dropped to 40 seconds.
How can I make this code go faster please?
var request ... |
I know, there are a few implementations of immutable strings out there, but my focus seems to be a little different.
My goal was to have a type that provided value semantics, but didn't incur the cost of dynamic memory allocation when constructed from a string literal which is already guaranteed to exist during the w... |
I'm rebuilding a basic webpage using AngularJS, and want to implement changing languages when clicking an icon. So far I've made a service called 'langService', that has functions to set and get language. I then pass the service a value (say 'eng' or 'slo') with the set language function when clicking an icon on the pa... |
Following on from this question I have added some more functionality to Markdown Markup, and made it more WPF idiomatic.
It now supports saving data from any of the four boxes, and loading Markdown or CSS files.
Everything seems to work, so as always, any tips/pointers/critique is/are welcome.
So, first, the new MainWi... |
As a follow-up to my code's v0.1 revision, we now introduce V0.3, with capability for storage of attributes and a struct for each HTML tag. Just start the struct, call its functions, change its variables then use <fstream> to make the complete HTML file using generateHTML()!
#include <iostream>
#include <fstream>
#incl... |
I have the following class:
class MultiArray
{
private $array = array();
public function add()
{
$keys = func_get_args();
$value = array_pop($keys);
$array =& $this->array;
foreach ($keys as $key) {
if (!isset($array[$key])) {
$array[$key] = arr... |
I tried to implement Dijkstra algorithm in C++ 11. Is this a good implementation of Dijkstra algorithm in C++ or not? I have overloaded -= and += operators to make the code more easier to read. These operators are used to add and remove nodes from the object of MyList class which is inherited by vector for vector like ... |
I'm especially interested in ways to further optimize a constraint algorithm. So far I've switched to SIMD sse4 vector operations which nearly doubled the performance. I'm hoping there is more performance to squeeze out that I simply don't see.
Here is the algorithm:
FVector4 rest(REST_DISTANCE); // Set the constant si... |
This snippet is about detecting whether the carry flag is set or cleared. I work on Mac OSX, so my snippet supports Mac only.
First, we need a routine that does the job:
func.s:
global _read_carry_flag
_read_carry_flag:
mov al, 0
jnc end
mov al, 1
end:
ret
(Try nasm2 -f macho64 func.s for compiling ... |
I've created a program that will list all hung print jobs on a specified server, from there it will load them and strip the jobs down to their Job ID then cancel the jobs on that server only.
I would like a critique of my work please.
How does this look as an OOP script?
Is there anything I can do differently?
Is call... |
This is an analyzer and code fix for VSDiagnostics that detects when a doc comment on a method does not have all parameters listed. When the user tells it to provide the fix, it adds a /// <param name="{paramName}"></param> line for all missing parameter nodes.
Here is the analyzer:
private void AnalyzeNode(SyntaxNode... |
I am developing a CUDA program and I want to enhance my performance. I have a kernel function which is consuming more than 70% of execution time. The kernel calculates the distance between several spatial points and based on whether they are neighbors or not, it fills a boolean vector.
Any ideas on how to get more spee... |
Can anyone suggest a better way to implement my template code?
var $teams = $('#info');
var template = "{{#data}}<tr><td>{{teamName}} </td><td>{{playedGames}}</td><td>{{wins}}</td><td>{{draws}}</td><td>{{losses}}</td><td>{{goalDifference}}</td><td>{{points}}</td></tr>{{/data}}";
$.ajax({
headers: {
'X-Auth-To... |
I've developed the following multi-threaded code and would like a review. It is supposed to be implementing the Producer-consumer problem as defined here.
I have multiple consumers and one producer. I would like to know whether there are any problems with my use of concurrency and also if you have any suggestions on h... |
I have written my own one time pad algorithm for encryption and decryption, but I would like to listen to your opinions about its correctness and eventually how could I improve it. My idea was to keep it readable, but not so bad in terms of performance. I have also written some tests.
Here's the code:
from random impor... |
I need to pull an rss feed with links, headlines, and descriptions onto the front page of a website, and while I would like to think the source is trustworthy, you can never rule out malicious actors. I also would like to avoid iframes, since a sufficiently secure iframe sandbox would impact the browsing experience, an... |
I've written the following function on Python (3.3) to take a list of 6 integers and return the maximum score for a game of Farkle. While the results are correct I don't feel it's a very Pythonic implementation. I'd like to hear from the community on how I could make it better and more Pythonic. Any and all tips are mo... |
I would like to know if this function is correct (I know that it works, but I have not got enough knowledge so as to demonstrate that it is correct).
Indication: a colleccio is defined as a vector< int > always of size 12, so I can represent the number of banknotes and/or coins of value 50, 20, 10, 5, 2, 1, 0.50, 0.20... |
I have a problem with some remote devices at a lot of my manufacturing sites. There are two major problems:
the network is unreliable in terms of maintaining connections
machines have duplicate IP addresses
Both of these are, naturally, catastrophic. To detect these conditions, I wrote a small program that loads a li... |
I'm trying to code Python in an object-oriented style, but it just seems very forced. Can anyone give me tips on this exercise of calculating the third leg of a right triangle from the other two?
I'm not looking for input santitization help! I'm aware the project doesn't check if the input is a positive integer (or i... |
I am writing a code in Golang to execute a periodic function (every 2 second). According to documentation and an example I have written two programs. Can anybody tell which one is better? Also, is there another better solution?
Code 1:
package main
import (
"fmt"
"time"
)
func periodicFunc(tick time.Time){
... |
I use this template to lookup clients registered for data. The data is associated by name(key) and clients are shared pointers (value) to a class which will consume the data.
////////////////////////////////////////////////////////////////////
//
// Registrar Template to help manage Key to Value Registrations
//
// T... |
I am creating an Angular 2 web application using TypeScript. This application performs REST requests to a REST "service". For each REST resource in my service I create a separate "Service" class in Angular2/typescript (e.g., class ServiceA for resource A, class ServiceB for resource B, and so on. Each service class wil... |
I'm relatively new to ASP.net and working with larger data sets as a fresh graduate, and I am currently maintaining/developing for an ASP webform and T-SQL system at the moment where we have a database table with ~4000 records, but there is potential for multiple key differences leading up to 10,000 records as a rough ... |
I'm trying to create an app that is scalable. One of the main features of the app is to view images from a database to a UITableView. Here is my code:
import UIKit
class HomePageTableViewController : UITableViewController {
private var imageObjects: [ImageParseObject] = []
private var skipNumObjects = 0
private var ... |
So here is an implementation of a dynarray. Many people might not know about it, so here is a reference.
Note that I am not trying to write a 100% standard conforming implementation.
Also, this is for a library, so resist the urge to scold me on using a leading underscore for two of my variables.
#include <cstddef>
#i... |
I implemented a login system, with session, using CodeIgniter.
If the session doesn't exist, redirect to login page.
Please review, and let me know what can be done to make it better.
view (login.php)
<body>
<?php echo form_open(base_url('verify'),['id' => 'loginForm', 'name' => 'loginForm', 'method' => 'post'])?>
... |
UARTIntHandler0 interfaces to the USB UART for debugging.
UARTIntHandler1 interfaces to the SIM900 GSM module.
The purpose of UARTIntHandler0 is very simple - grab an incoming character and push it to UART1 (the GSM module).
UARTIntHandler1 is more complicated. In "talk mode," it should allow the user to talk directly... |
There is a draft of my models.py. What can I do for code quality and readability increase?
from datetime import timedelta
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
class Rule(models.Model):
start_date = models.DateField()
end_date = models.Date... |
On windows, to find out if I have write access to a directory, I found that it is easiest to just create a file in that directory.
In order to do so, I found GetTempFileName() API function to get an almost(?) unique file name in the desired directory, then I was going to create a file with that name. so if everything g... |
Is there a way to simplify this JavaScript function any further? Having to input 4 variables just for a drop-down menu seems a bit ridiculous, and it is hard to keep track of the variables when I want to have more than 1 button.
<!DOCTYPE html>
<html>
<head>
<style>
.dropbtn:hover, .dropbtn:focus {
background-colo... |
I'm drawing shapes to OpenGL using the standard commands and function calls to OpenGL. Everything works fine, however since this is a learning process I know sometimes what works in theory and using simple basic examples doesnt always work in real time situations so I wanted to ask if this is correct what I am doing he... |
In my current project, I have to deal a lot with dates, especially checking if the date entered by user is today, or max one year from today etc. As I find the datetime API of Java7 (which I regrettably still have to use) pretty confusing, in order to keep my code clean and readable, I wrote the following method:
publi... |
I'm currently trying to display a list of movies with this pill-like elements. The code below works but I guess there is a better way or a way to use elements from the twitter Bootstrap. It also bothers me that the date in the brackets isn't centered with the heading.
Please give me feedback how you like my code. I'm a... |
I have a function that looks through an array of objects and returns an array of all objects that have matching property and value pairs. This works fine but I always get the notification: "Don't make functions within a loop".
So is this a bad approach to use a function within a loop?
function where(collection, source)... |
I have to call Article.to_draft/to_archive/publish method depending on the presence of the corresponding key in the params hash.
I do, however, have no idea to implement it properly.
def update_state
method = if params[:draft].present?
:to_draft
elsif params[:archived].present?
:t... |
I want a better way to do the if statements, and if there is a better way to do it. How is it more efficient? Is there something like a switch statement in Java that would help?
import java.util.Scanner;
public class main {
private static boolean playing = false;
private static int enemyHealth = 100;
pr... |
Minesweeper in Ruby (from exercism.io):
Write a program that adds the numbers to a minesweeper board.
Minesweeper is a popular game where the user has to find the mines
using numeric hints that indicate how many mines are directly adjacent
(horizontally, vertically, diagonally) to a square.
In this exercise you ha... |
Recently, I've been trying to transform my code to be more OO and adhere to SOLID principles. I also have been trying to get into the habit of making my code more testable and have been trying to implement a TDD mindset. Here is a snippet of my code from my class ChargebackReport:
/**
* Populates the properties of thi... |
I'm an experienced C# developer trying to teach myself F#. I spent a day or 3 reading throught the F# wikibook trying to get to know the syntax and F# fundamentals.
As an exercise I'm trying to go through the Project Euler problems to get a better feeling of the syntax and working with the language.
I've just solved pr... |
I have only started working with XML files and PowerShell. I feel that while there are many ways to accomplish the same thing that I might be doing the following inefficiently.
This is all based on the following SO post which I have an answer to:
$numberOfCores = Get-WmiObject -class win32_processor numberOfCores | Se... |
I'm writing a C++ game engine and I have a scene class that I'd like to present as a code example to a team that is interested in my skills.
The scene class holds games entities, updating and rendering them using a camera.
I'm interested in the stylistic or functional improvements that could be made to improve this cla... |
I got a database with members, each member has a list of sports they do.
now I want to loop through a listbox and add every selected item to my database.
This is my database :
And this is my code :
foreach (var item in sportCheckedListBox.CheckedIndices)
{
int sportindex = Convert.ToInt32... |
So this is what I'm doing:
I have hundreds of arrays, each of them filled with a date in milliseconds in the first position, and the rest of the array is filled with user game scores.
Let's just call this array above var scoresDates
The ultimate goal is to have each of those arrays contain only the date in millisecond... |
I'm writing a C++ game engine and I have a Renderer class that I'd like to present as a code example to a team that are interested in my skills.
The renderer is used to setup the OpenGL environment and then provides a RenderMesh function that will render a mesh with a texture and shader using the transformations for th... |
I'm very new at F#, and am using Project Euler to help me learn. Question #2 kept me going for a while, as my initial attempt at an answer was very slow and inelegant. Then I learnt about Seq.unfold, and a whole new vista unfolded in front of me!
The problem statement is as follows (source):
Each new term in the Fibon... |
I have this code that helps me to paste data from an Excel file to a Datagridview:
If e.Control AndAlso e.KeyCode = Keys.V Then
DGVLookUP.Rows.Clear()
DGVLookUP.Columns.Clear()
Try
Dim Generar As Boolean = False
Dim N As Integer
For Each line As String In Clipboard.GetText.Split(vb... |
I wrote a simple tic-tac-toe program in Haskell. It runs on the command line, has a one and two player mode, and implements a minimax algorithm when you play against it.
I'm used to writing proper code in OO languages, but Haskell is new to me. This code works reasonably well, but seems hard to read (even to me!). Any ... |
The Win32 API has a so-called 'high performance counter' (QueryPerformanceCounter() and friends) but often it is neither precise enough nor reliable enough, due to high jitter.
The low resolution is no surprise since the value is often derived by shifting off the 10 low bits of the CPU's time stamp counter (TSC), after... |
I'm trying to create a canvas project inspired by this gif where colors of an image are averaged and animated.
Thus far I have all of the functionality working but it only performs well with a large cell size.
My current thinking is that it's all of the .fillRects that are causing the issue because rendering is expens... |
I recently finished the build a personal portfolio webpage project for
a free Code Camp, here, I would be very grateful if anyone would be willing to offer any advice on the design of the website or on HTML, CSS, or JavaScript coding practices.
(function($) {
$(document).ready(function() {
sticyNav()
smooth... |
I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a list. I'm then looking to open these files using the csv module and process each line for now.
My script works fine as below... |
This question is a follow-up of this one; where I present a software to plan and manage drone races. I might come with a new question about the SQL part in a few days as well.
The code can still be browsed on GitHub.
Since then, on top of the changes in documentation that I made in my own answer, I included the gettext... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.