instruction stringlengths 71 39k |
|---|
This is a response to this brute-force version where the algorithm was not intended for review.
In this challenge you are prompted to find the path through a large triangular set of numers, similar to:
75
13 92
43 77 12
11 55 86 7
....
The goal is to find a path from the top to the bottom while summing ... |
What's the opposite of CodeLess Questions?
Perhaps CodeOnly Answers? (Also known as code dumps.)
Inspired by the opposite question, here's the opposite query:
SELECT Id AS [Post Link], Score, CreationDate
FROM Posts
WHERE PostTypeId = 2 -- answers
AND Body LIKE '<pre><code>%'
AND CHARINDEX('</code></pre>', Body) ... |
This was a portion of a skills test given to me by a company. The task was to write a method that takes a string, reverses it, and sets the vowels as capitals and consonants to lowercase. I was also told to prove that my implementation works.
using System;
using System.Diagnostics;
namespace StringOperation
{
usi... |
I recently coded a program to stimulate Conway's Game of Life. Originally, my program just printed an array of 1's and 0's where the 1's represented the "live" cells, but I tried to teach myself some graphics programming to add graphics to the game. Currently, my program draws a black rectangle to represent a live cell... |
My JavaScript code is slow for large inputs. However, it is especially slow in IE. The browser will freeze for about a minute while the select is being reloaded. Any ideas for how to optimize this code, especially for IE?
function reloadSelectWithJSON (elementid,query){
/* It is assumed that the elementid passe... |
So, first off, a little bit of unrelated information: I am preparing for a technical interview. I was reading this article, How to Prepare for (and Ace) the Technical Interview, by Rich Hein and I decided to try to tackle the problem he uses as an example.
From the article:
We are looking for a solution that is compa... |
I am programming a graphical text adventure using python. The game is playable, but I am not sure whether the code is well-suited for newcomers (code smells / quirks / general readability).
Here's the main script:
import time
import sys
import printer
from rooms import *
from _player import Player
VER = 0.01
SCENES... |
This stream class is designed to hold data only until it is read from the stream. As opposed to the MemoryStream which holds data until the stream is closed. It was written some time ago and was based on a sample found online. I can no longer find the source, but I believe I used it as a start and cleaned it up.
I ... |
I made a simple calculator.
I would also like to write some simple unit tests for my CalculatorEngine class. I had to make some of my private methods as package-private over this. How is it usually better to do it - to enhance access modifier or to make inner test class?
And what another more complicated cases it's bet... |
I had to come up with a way to convert sqrt(#) into its actual numeric value because before I would have an array containing elements such as:
[sqrt(3), -sqrt(3), 1]
If I tried to multiply, I would get the error:
Argument "-sqrt(3)" isn't numeric in multiplication (*)
Here is my work-around, but I think there's a be... |
I've written this JQuery program for checking whenever caps lock is turned on.
$("input[type='password']").keypress(function(e) {
var kc = e.which; //get keycode
var isUp = (kc >= 65 && kc <= 90) ? true : false; // uppercase
var isLow = (kc >= 97 && kc <= 122) ? true : false; // lowercase
// event.shift... |
I wrote this code earlier to parse Chase.com's online transactions page. It's written in WinForms.
stepBtn is a button that starts this.
wb is a WebBrowser that is already navigated to the page.
Can you give me advice? I'm primarily looking for optimizations, but any other advice would be great.
private void stepBtn_... |
I have made a custom webview which is used to open a very heavy site in terms of database. The webview uses custom code for uploading files using an upload handler class. I need suggestions on how I can optimize my code for better performance.
Features necessary (current custom webview written below does it all):
The ... |
This question is a follow up in regards to the comments suggested in a previous post regarding a Ringbuffer implementation in C++ for audio processing.
Ring buffer for audio processing
template <typename T>
class Array {
public:
Array();
Array(std::size_t const& cap);
Array(Array<T> const& other);
Ar... |
I wrote this simple implementation of the sum of primes for the code eval
Challenge Description:
Write a program which determines the sum of the first 1000 prime numbers.
I would like to know of a better - more efficient - way of implementing the solution.
import java.lang.Math;
public class SumOfPrimes {
publi... |
I am creating list of dictionary from two different results. I appreciate any improvement suggested.
redditFile = urllib2.urlopen("http://www.bing.com/images?q="+word)
redditHtml = redditFile.read()
redditFile.close()
soup = BeautifulSoup(redditHtml)
productDivs = soup.findAll('div', attrs={'class' : 'dg_u'})
for div ... |
Here is my code:
#include <stdlib.h>
#include <stdio.h>
int sum(int *arr, int size) {
int sum = 0;
for (int i = 0; i < size; ++i) {
sum = sum + *arr;
arr = arr + 1;
}
return sum;
}
int sumx(int *arr, int size) {
int sum = 0;
for (int i = 0; i < size; ++i) {
sum = sum ... |
I'm working on a small library to help me format numbers easier as my current project deals with a lot of them. I want to be able to just supply the value, precision, width, and fillchar to a method and have it do all the work for me.
Based on the standard way of doing things with rjust()…
print '{:.2f}'.format(123.... |
I am making an eCommerce web application using the Laravel 5 framework.
I have created a Categories controller for the administrator and with the following actions for the categories:
Add / Delete / Update / Delete Permanently
I want to know whether the created controller matches the standards. If it doesn't, then ho... |
I need to change some array values in a 2-dimensional array for some cases. Sometimes the all values from an child array and sometimes only some values.
In this cases I should only change the variable $stamm which $stamm2.
This code is the statement of an if condition, where all relevant verbs for this changings is me... |
I want to collect my users' data as an array:
h = {}
a = [["user_3", 765], ["user_1", 2], ["user_1", 1], ["user_2", 124],["user_1", 3], ["user_2", 223], ["user_2", 334]]
# Expected output :: {"user_3"=>[765], "user_1"=>[2, 1, 3], "user_2"=>[124, 223, 334]}
a.each do |x|
if h.keys.include?(x.first)
h[x.first] = (... |
I am learning how to do object-orientated programming in JS. In particular, I am learning about the constructor pattern.
In an attempt to exercise what I have been learning, I made this:
var assert = require("assert");
var Book = (function() {
// private static variable (why this exhibits static behaviour, I have n... |
I have a simple c# mvc client that calls an external api..here is my attempt
public class ProductController : Controller
{
private readonly IProductService _productService;
public ProductController(IProductService quizService)
{
_productService = quizService;
}
public ActionResult List()... |
I'm working in MVC5/WebAPI using ASP.NET Identity, with a custom storage provider for my UserStore, custom ApplicationUser inheriting from IdentityUser, and a pretty expansive configuration in the project (both MVC5 and WebAPI endpoints in the same project).
I've been working on the user management/settings controller ... |
I'm looking for some opinions on improvement/technique of code in C# calling to a Neo4j database to perform a multi-faceted query looking for users. My goals were to lookup by first/last name, phone number, birthday, and e-mail address. I wanted case insensitivity, and I want the query to respect certain privacy settin... |
I have this Excel VBA function that takes three parameters. It is essentially a translation mechanism with the following parameters:
A sentence which has to be translated.
A range of words to look for and what to translate them to.
Shows in which column the translation is in the range (usually it's 2).
This function... |
I have following code to use timer (System.Timers.Timer) in windows service. The goal is that new time handler should not occur if previous one didn't finish its job. Here is how I achieve this:
protected override void OnStart(string[] args)
{
try
{
//
// Create ... |
I was writing code to check if any permutation of a string can make it palindrome and came up with the following logic:
anagram = [ x for x in input() ]
count_alphabets = [ anagram.count(x) for x in set(anagram) ]
middle_element = [x for x in count_alphabets if x % 2 == 1]
print("YES") if len(middle_element) == 0 or le... |
The original description of the problem can be found here, its input here and its expected output here.
The problem:
Given a integer sequence a1 ... an (-10000
\$\leq\$ ai \$\leq\$ 10000). Where n (1 \$\leq\$ n
\$\leq\$ 100),the size of the sequence, is a given number.
Find the number of increasing subsequences wi... |
I am making a 2D Java game at school, and at the movement I use a switch. The code works, however, my teacher won't sign my code until I have removed code duplication.
Short info: My Keyactionlistener sends a String of direction that is used in the switch to move. Inside that very same switch I also check the object in... |
I'm trying to solve the problems of Project Euler with Haskell within less than 10s with optimized code (ghc -O2). Unfortunately, I'm struggling to find a correct algorithm for Problem 44, which proves the correctness of the solution without setting a predefined upper limit (setting a limit and omitting the proof yield... |
In lieu with several other Facebook-esque concepts I am trying to replicate, this working code will take the span of time from a given date to now, and try to convert it into the most convenient English-friendly word. For example, if I post a comment on an article or status, and I want to show when it was posted to a u... |
In my code, when the index is 0, I am supplying the second template which contains the word as arif. With the rest I am supplying the first template which doesn't have the word arif.
I got this result as a result of a posted question, but I am not satisfied with it because of its length.
// Code goes here
"use strict";... |
This is a question in Udacity JS course. I am starting to like Javascript. I feel its a misunderstood language :)
We learned about relational operators and how they can classify the
relationship between two values. Your job is to write the function
getRelationship(x,y) function, which should return a string
rep... |
I'm just playing with Python, trying to refamiliarize myself with it since I haven't used it in a few years. I'm using Python3, but as far as I know it could easily be Python2 with a change to the print statements. What I'm generating is something similar to GitHub's Identicons.
I know of two possible issues, one is th... |
Problem Statement:
Extract the filename and read if filename has jQuery on it, put them aside.
Second step will be to check one more and see if any jQuery files has ui in the filename.
Input:
script_ref1 = """<script type="text/javascript" src="js/jquery-1.9.1.min.js"/>
<script type="text/javascript" src="js/jqu... |
I have written this code to get the input string from the spreadsheet and search the string across the text files and state whether or not it is found in the Excel sheet.
Scenario:
Excel (sheet1):
ColumnA
AAA
BBB
Drive C:
C: should be give in Column D5.
It has subfolders TEMP1, TEMP2, ...
Folder C:\TEMP1\
It has... |
I am trying to write my own implementation of indexOf for learning purposes. I have an implementation of as follows. I'm sure a more efficient and shorter implementation exists.
function _indexOf(needle, haystack) {
var n = needle.split("");
var h = haystack.split("");
var n_len = n.length;
var h_len ... |
I'm writing unit-tests for my Node.js/Express application with REST endpoints which retrieve stuff via Mongoose from db. Since I'm testing only route functions I want to mock Mongoose by providing custom request and response functions etc. I also had to mock my Person mongoose schema module with mockery.
Here is my ap... |
I've mostly completed the prototype for my city building simulation, and now I have added the meta-game mission system to the game. You see these mission systems in a great many games these days. The basic idea is that the player is assigned a mission at the start of the game, such as Build 50 Industrial buildings, an... |
Here is my Python implementation of counting neighbours of Game of Life with radius as parameter.
def neighbors_count(n2d_array, radii=1):
assert n2d_array.ndim == 2
row_len, col_len = n2d_array.shape
nbrs_count = np.zeros_like(n2d_array)
for row_idx, row_val in enumerate(n2d_array):
for col_id... |
This class is a stream designed to perform character encoding translation. So you instantiate it, pass an input stream, and specify the input encoding and desired output encoding, so that when you read from this stream, is will translate the source data from one encoding type to another.
I'm interested in a general co... |
I have a third party system that submits what I am assuming is a byte array data from OBDII port on our fleet vehicles.
I was getting values like:
AA== (bool)
AQ== (bool)
AAAaMA== (int)
AAA0IQ== (int)
Mjow (string)
UzozLTIwNA== (string)
I know what the type is for each field but the regular base64_decode() function ... |
Wrote a couple of blog articles about smart pointers.
Unique Pointer
Shared Pointer
Constructors for Smart Pointers
So I suppose it time to get the result reviewed.
This is not supposed to be a replacement for the standard smart pointers. It is more a simple place to start for people trying to learn some of the basic... |
Array of size \$(n-m)\$ with numbers from \$1..n\$ with \$m\$ of them missing. Find all of the missing numbers. The array is sorted.
Example: If arr = [1,2,4,5,6,8], result should be 3 & 7.
Here is my code which I would like to get reviewed:
import java.util.*;
class FindMissingNumsArray {
private List<Integer>... |
I've written a toy neural network in Java. I ran it several million times with the same outputs with only the randomized weights changing from run to run. The average of all of the outputs is not 0.5, as I would have expected. The code is in this Github Repository.
The Layer class:
public class Layer extends AbstractLa... |
I want to create a production-ready producer/consumer that could help me avoid thread synchronization hell. Is this thread-safe? The main issue is to be safe with exceptions that can arrive.
public class AsynchSimpleProducer<T> : IDisposable
{
private readonly Action<Exception> error;
private readonly BlockingC... |
I implemented the binary search algorithm. Input vector is sorted by < than operator implemented by type T. The less than operator is expensive so we want to use it as few times as possible.
I would like to know if there are any stupid mistakes, bad practices that I used and how I can improve the code.
template<class T... |
The problem I attempted to solve is described as:
What is the largest subset of mutually non-overlapping intervals which
can be selected from I? Where I is a set of N intervals where each
interval has the same weight per item within the interval.
I claim the algorithm runs at \$O(N \lg N)\$ and has a space comple... |
I have a flat data that represent the hierarchical relationship as below:
ID Name PID
0 A NULL
1 B 0
2 C 0
4 D 1
5 E 1
6 F 4
3 G 0
This table represents the 'data table', where PID indicates the parent element.
For example, in the first row... |
I have a Node project and am trying to make my code better, so I've created a new folder with a file like following which encapsulates the read and write file.
This is working and my question is if it's good practice since I need to use the call to read and write file in several place in my code.
var fs = require('fs')... |
Trying to solve this combinatorics problem, I wrote some functions to count the number of unordered distinct factorizations of an integer n into k distinct parts.
The following function builds up a list of unordered distinct factorizations of n with largest part at most m.
duf' :: Integer -> Integer -> [[Integer]]
duf'... |
We have a main application made of a few separate parts - Unity and Clc.
I'm writing a new tool which will be used to manage them: deploy Unity, or run some checks and a lot of other stuff. As there will be a lot of options, I want split them in to separate namespaces.
Here is my implementation, it works, but I'm not s... |
I am using the following method to validate if user has given any input or left an EditText empty. I am concerned about the return statement in particular, because my IDE keeps complaining about it.
Environment: Android Studio 1.0
public void clientsideauth() {
if (TextUtils.isEmpty(edt_name.getText().toStrin... |
I was trying to solve Project Euler Problem 78: Coin Partitions.
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7. Find the least value of n for which p(n) is divisible by one mi... |
I think that this code is very bad because it does not agree with DRY principle. Can you advise me how to improve it?
public void WhatSelected(object paramaters)
{
string ElementToProcess = BASM.FindElement(paramaters, true);
SeleсtedCurrent.Add(ElementToProcess);
int i = (from x in AssetS... |
In the pursuit of SQL enlightenment, I wrote a quick SEDE query to display Rep, Age and Overall Rank.
Sorted by Age, then Rank (Which is generated by Rep).
SELECT TOP 150
ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS Rank,
Users.Id as [User Link],
Users.Age,
Users.Reputation as Rep
FROM Users
WHERE User... |
I have some code that asynchronously loads some point in a chart when a users drag it:
private void UpdateHistoryAndReSizeWhenDrag(string param, long duration)
{
lock (Lock)
{
if (Boxes.Count() > 0)
{
BoxStruct temp = Boxes.Where(key => key.id == param).FirstO... |
I have written a program in Python 3 for the INTEST problem on Codechef (included in question). The program is taking a lot of time (55.76s) in Python 3. The same code takes almost 1/10 of the time time (4.97s) in C.
The purpose of this problem is to verify whether the method you are
using to read input data is suff... |
My goal was to create a function as performant as possible with results being:
True/False as to whether wild matches str.
Optional capture of certain patterns.
My purposes required:
Case sensitive match.
Pattern must match entire string to succeed.
Assumption that * and ? do not exist in str.
* matches zero or more ... |
I'm curious if there is a way to slim down this code either with SQL or with C#.
-- VARS
declare @iagent_id int
declare @quarter int
declare @prev_quarter_1 int
declare @prev_quarter_2 int
declare @prev_quarter_3 int
declare @year int
declare @prev_quarter_year_1 int
declare @prev_quarter_year_2 int
declare @prev_quar... |
I am trying to dynamically pick a parent class in Python 2.7:
GLOBAL_CLASS_NAME = 'b'
class A(object):
def __init__(self, bar):
print('this is A with {}'.format(bar))
class B(object):
def __init__(self, bar):
print('this is B with {}'.format(bar))
class C(object):
def __init__(self, ba... |
I am working on uploading files through Rest API. Tried my hand using single upload and works. I have modified to accommodate parallel uploads using Futures.
Will there be any chance that this code will not end during the equivalent infinite loop in checking futures's status?
Another question that I have here is that... |
Here are two models - Property and Developer:
class Property(models.Model):
property_type = models.CharField(max_length=255, default='Apartment')
specifications = models.CharField(max_length=255, default='Basic')
built_up_area = models.FloatField(max_length=6, null=False)
total_area = models.FloatField(... |
I am new to Node.js and Socket.io. I implemented a realtime chat service that has a chatroom feature. When the actual product is launched, there will be at least 200 concurrent users with 50 groups of 4 people. I would appreciate any advice on its performance and any recommendations.
Server (remote server)
var expres... |
I would like to improve my Reddit-scraping code to make it faster, but I don't know how. I am using deque instead of list to improve append performance. Otherwise my code calls the PRAW API and type checks one class attribute (I don't know why this is necessary but otherwise I get type errors). Is there a faster way to... |
It was suggested on Meta for July 2015 Community Challenge to make a bot that can find questions with bad titles. I wrote this query to help others find examples to help them make write their code.
I made it a point to document as I wrote it so that someone who is a beginner with SQL could still make changes to it eas... |
I have a class that I use to manage a list to/from an API in Swift. Using a clean code approach, I'm wondering if, how, and why I should change it when I have a class that uses it for just one or two functions.
Here's the class:
import Foundation
protocol ApiWishListManagerDelegate
{
func didFailWishList(failErr... |
I have these invoices listed:
def invoices = [
'LEDES98BI V2',
'LINE|INVOICE_DATE|INVOICE_NUMBER|INVOICE_TOTAL',
'1|20150301|INV-Error_Test1|22',
'2|20150301|INV-Error_Test1|24',
'3|20150301|INV-Error_Test2|26',
'4|20150301|INV-Error_Test2|28,']
I am trying to do groupBy on the above collection with INVOICE_NUMBER and... |
I have the following three macros all running in the same module. Each one is attached to its own button (3 buttons total). All three buttons take an average of 6-12 mins to run. As I am working on figuring out additional buttons that will check/review other criteria on the sheet, I am looking to improve this.
Could an... |
Below is a problem I encountered during an online course. There are a lot of similar questions asked on this, but I couldn't find a solution there as well as I believe my specific issue is a bit different from the rest.
Given a string s, find the first non-repeating character in the string
If there is no such charac... |
This question is related to the Cactus Text Game Engine.
For easy error handling in Cactus, we've put together this small decorator. Essentially, the decorator wraps any class method in a try-except block, which reports errors to a log file if something goes wrong. While it's a small file, I can't help but feel that i... |
I recently stumbled across this article on how to write a spelling corrector, and figured I'd try to have a go at it in C (mainly because the link at the end of the page for the C code is broken).
Here is what I would like reviewed:
Accuracy: What can I do to make the program output a more accurate prediction of what ... |
I'm implementing a Tic-Tac-Toe solver in Python. It contains two functions: assess to determine whether a given board position is a win for either side, and is_winner to traverse the game tree.
The end goal is to use this program to construct a lookup table that will be used by a JavaScript Tic-Tac-Toe frontend. But I ... |
Fairly easy way to compress a wordpress plugin (or similar) as a zip file without including all the dependencies used to create and manage the development, but which don't belong in the final product.
#!/bin/bash
# This script zips a directory, excluding specified files, types and subdirectories.
# while zipping the d... |
I am writing a c# program to build generic sort algorithm on a request to a collection of data. The data needs to be sorted based on the supplied columns.I am using Entity framework and Expression builder to achieve the required functionality.
In one of the methods I see that some code is duplicated and I am not gettin... |
The below code is placed in a method . But it seems too large and I would like to shorten it. Is there a better way to do what it does?
ImageIcon switchoffIMG = new ImageIcon("switch1.jpg");
ImageIcon switchonIMG = new ImageIcon("switch2.jpg");
JLabel switch1 = new JLabel(switchoffIMG);
JLabel switch2 = new JLabel(sw... |
This is the first JavaScript code I've ever written, alert("hello, world!"); aside.
This site is closing quite a lot of questions because people won't read the rulebook or pay attention to the How To Ask panel that's displayed as you're entering your question title - almost 60% of closed questions involve broken cod... |
The problem is from here:
The page at Wikipedia said:
Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all other nodes.
Set the initial node as current. Mark all other nodes unvisited. Create a set of all the unvisited nodes called the unvisited set.
For the cu... |
Context
In an imageprocessing project of mine, I needed to do some edge detection and implemented the Theo Pavlidis algorithm which works quite well. A problem had been to get the next "good" position. Assuming an image like this (where the 1 represent the needed pixel value)
011110
111111
111111
011110
thi... |
The code below works fine for me. Is there any way that I can improve this code more? Note: delimiter is single whitespace only for email address.
getmail.py
#!/usr/bin/python
import re
handleone = open("scratchmail.txt", "r")
f1 = handleone.readlines()
handletwo = open("mailout.txt", "a+")
match_list = [ ]
fo... |
I found myself having to implement Bresenham's line drawing algorithm.
I'm looking for feedback on effectivity and code style. Can I reduce the code somehow?
template<typename Callable>
void bresenham(Vec2i p0, Vec2i p1, Callable&& cb){
const auto swap_xy = std::abs(p1.y - p0.y) > std::abs(p1.x - p0.x);
if (swa... |
Which is best?
I have a bunch of components in my projects. It's related to Ashley (a java entity system) to libgdx (a game engine).
this components are like that:
public class SpriteComponent extends Component {
private Sprite sprite;
private SpriteComponent(Sprite sprite) {
this.sprite = sprite;
... |
I am playing with RabbitMQ and .NET and found myself duplicating the connection initialization logic in all of the consumers.
Created the Consumer in order to avoid that and add some tracing.
It's far away from anything usable, but wanted to hear ideas/opinions/alternatives.
public class Consumer
{
private static re... |
Problem Description
Receive a 5 digit number and print out in a large size.
Sample input 32145
Sample output
##### ##### # # #####
# # ## # #
# # # # #
##### ... |
I am playing around with Xamarin, because there is a good chance that I might have to start a project using it in a few months. What I am mostly looking at is Xamarin Forms as I am familiar with WPF and MVVM, so I am looking to apply the same principles if possible.
I usually use Caliburn.Micro but seeing as the versi... |
I am trying to optimize my game written in Java and I used the VisualVM launcher for profiling and monitoring my game. What caught me by surprise was that my basic utility to play sound effects was using the most CPU in my game.
I'd really appreciate some tips on improvements which I can implement, because I really do... |
We're rewriting some parts of our application. We're trying to avoid the promise anti-pattern and do things properly, but I'm not certain that we did so.
More precisely, we are rewriting the resolver of a state using ui-router.
.state( 'catalogue', {
// skipped on purpose not relevant content
resolve :
boxCrea... |
I've got a huge dataset in R which contains (among other things) 2 columns indicating "Term Code", which are "Term Code" and "Term Code1".
"Term Code" is the mostly-correct column, which usually contains a 6-digit code for year and academic term:
> head(data$Term_code)
[1] 201230 201230 201230 201230 201230 201230
how... |
I am starting a software engineering degree soon and have been practicing the last couple months. I have posted some code I wrote for a basic Tic Tac Toe game below (C++). I have read the worst thing to do is to get into bad habits early on, so please can you read over the code and tell me what I should be doing differ... |
I often create new accounts or virtual machines, and then have to load my SSH public key/signature in to the authorized keys on that account. That process can be tedious, so I created this script that pushes my authorization on the remote machine. So, typically when you ssh to a remote machine you have to enter your pa... |
Basically, this is a recursive function to generate all of the permutations of an array.
The idea is this:
recursive case: start at the specified array index, and make a case for starting the next index (incremented one) for each of the indexes that come after the specified index by swapping the index with the next if ... |
I've written a python 3 code using Bokeh. With this code you can learn howto to plot math functions and a scatter plot with regression linear functions in a webpage. The target is how to plot discontinuous functions, linear regression problems in a webpage, and how to separates the different plots in a webpage using Bo... |
I have a method that I am using to remove accents from certain characters. The problem is the massive slew of characters I am expected to work with. I have to, basically, remove accents from all Latin characters that fit within the 26 English Latin characters. (A through Z.) Performance is a very large requirement. It ... |
I want to go through each line of the a .csv file and compare to see if the first field of line 1 is the same as first field of next line and so on. If it finds a match then I would like to ignore those two lines that contains the same fields and keep the lines where there is no match.
Here is an example dataset (no_du... |
This code basically makes the dot follow a certain point on the screen. It consumes a significant amount of computing time in my game, so I'd like it to be best optimized. I wrote this code after quickly reading some pages in a high school mathematics book, so it's unlikely to be a computationally efficient solution.
T... |
I have two database table name called "tablestr table" and "restbookingtable":
tablestr:
restbooking:
I want to retrieve bookingsection_id from the booking table with a few conditiona and need to remove from tablestr. I have a query for this, but I could achieve it by using subquery, which executes very slowly.
SELE... |
I'm working on a moderately complicated (not super basic, but not a feat of programming strength) project to create a virtual tabletop for a tabletop game I play. I'm trying to conform to good design practices and patterns, specifically I'd like to keep everything as nicely MVC-oriented as possible. My problem is, I'm ... |
I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
while (ga... |
I have a large table with which I need to do some analysis. The table is a log of IPs:
+-------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------------+------+-----+---------+-------+
| src | int(10) u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.