instruction stringlengths 71 95.1k |
|---|
The following script is very slow and I'm not sure why.
The script works so if you copy and paste its a typo in the question.
Sub deleteData()
Dim wb as workbook
Dim ws as worksheet
Dim myCell as range
dim myRange as Range
with Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
end with
Set wb... |
Given that I have a dataset as follows:
{ 1: ['Extremely Tall'], 2: ['Tall'], 3: ['Medium', 'Low'], 4: ['Dwarf'] }
and I receive a value (e.g. Tall or Medium) I want to determine the associated key. By the way feel free to change the dataset, i.e. it doesn't have to be a json object... so long as:
Medium -> 3
Low -> 3... |
I'm training a GRU auto-encoder and my current code is very slow.I believe it's predict_captions function that takes most the time. Any suggestion to optimize this code?
for epoch in xrange(0, 13):
print ("Starting New Epoch: %d" % epoch)
rewards = {
'sample_cider': [],
'sample_context': [],
... |
Problem statement:
Working from left-to-right if no digit is exceeded by the digit to its
left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is
called a decreasing number; for example, 66420.
We shall call a positive integer that is neither i... |
I have this simple setup for a .NET Core project which is just a very basic HttpClient usage to do some simple integration tests to a RESTful API. For now the test project remains separated from the main API project, that's why it's built on .NET Core for now, using NUnit as test framework as well. But because of that ... |
Utilizing the below relation, I am able to compute the Euler constant to great precision on a single thread quickly and simply.
My process is to compute the natural log via the AGM(utilizing Pi an the Ln(2)), and apply the result to the BMM algorithm.
\$\gamma=\lim_{n\to\infty}\mathscr{G}_n=\lim_{n\to\infty}\frac{\sum\... |
I wrote program that reads and processes xml files submitted by external users. The part of the code in question iterates over xml node's children, appends a dictionary - a future row in a table, and repeats the process for every child and its child and so on.
Exemplary xml node looks like this:
xmlstr = '<Root_Level>... |
Caeser's cipher code where there are a converter and a game part with user input. The code includes keys (settable and not settable).
import random
def change_letter(original, new_message, key_number, alpha):
for letter in original:
if letter in alpha.lower():
new_message += alpha[(alpha.lower... |
I wrote a floating-point multiplication function as an excercise. The program compares its result to the usual hardware multiplication result and for this purpose I use unspecified behavior, but the function itself should be fine. I do get warnings about XOR-ing 1-bit ints but I have no idea why.
I noticed there aren't... |
For learning purpose, I've written a simple lambda calculus interpreter (plus 'Add'). I would like it to be the cleanest and most idiomatic possible.
Bonus question: how would you use deriving (Show) for Val, just having to define show for Fun (Val -> Val)?
-- Lambda calculus interpreter example.
import qualified Dat... |
For learning purpose, I've written a simple lambda calculus interpreter (plus 'Add'). I would like it to be the cleanest and most idiomatic possible.
Can we make it as neat as the Haskell version?
# lambda interpreter example.
# Values: Num, Fun & Wrong.
# Terms: Cons, Var, Lam, App & Add.
class Num:
def __init__(... |
Well this is a basic hangman game in c++ without the classy man getting hanged animation (life is printed instead)
#include <iostream>
#include <cstdlib>
#include <string.h>
#include <time.h>
#include <fstream>
using namespace std;
string previousGuesses; //string to hold previous guesses
class movie {
priv... |
I made an implementation of atoi (ascii to integer) in Python a while ago for fun, and I'd like to know what I could do to improve it.
class CannotConvertToInteger(Exception):
"""A non-numeric character was present in the string passed to atoi"""
pass
def atoi(string : str) -> int:
sign = multiplier = 1
val =... |
Problem statement (For more detailed description (including pictures), please, visit the link):
A row measuring seven units in length has red blocks with a minimum
length of three units placed on it, such that any two red blocks
(which are allowed to be different lengths) are separated by at least
one grey squar... |
I have decent experience in programming before (mostly C++), but I am very, very, very new to Python, and I decided to try out Project Euler as an exercise. Here's the description of Problem 1:
If we list all the natural numbers below 10 that are multiples of 3 or
5, we get 3, 5, 6 and 9. The sum of these multiples... |
Description
An immutable keyed set is a readonly collection of elements without
duplicates or null values having each of the elements linked to
exactly one key.
Example
This simple example of an Exact Cover solution has a constraint
set \$\{ 1,2,3,4,5,6,7 \}\$ covered by candidates \$\{ B,D,F \}\$.
\$B: \{ 1,... |
(See the previous iteration.)
Now I have reworked my pathfinder program, and I ended up with this:
<html>
<body>
<div id="output">
</div>
<script>
function NodeSet() {
this.array = [];
}
NodeSet.prototype.clear = function() {
this.array = [];
}
NodeSet.prototype.add = function(node) {
this.array[node.id] = node... |
I've created a Java class for Android that connects to a FTP server (using the FTPClient library from commons-net-3.6) and uploads a file that is stored on an Android device. The code of the class is the following:
public class FTPHandler{
private String HOST = "ipftpserver";
private String USERNAME = "mylogi... |
I've created a component that validates an email address.
It works, but since I'm new to hooks I would like some validation of what I've done before I let what I've done loose on the rest of the components I'm creating.
In particular I'm concerned I'm not managing the state correctly, it seems verbose, and I've got a ... |
I'm trying to teach myself streaming and lambda expressions. Here's the scenario: I have a collection of 10 Thing objects each containing an int[] of 3 random number. I've written code to print out the largest number in each Thing.
I've already written two statements and an accompanying method that print the result I w... |
I have this hosted services which garbs the data from the API and save it in the database. But before saving it checks if the data already exists in the DB if not it creates the new row and if it already exists it compares updated_at from new data with DB if they are equal it ignores it if not it updates it.
Additional... |
I wrote a function to calculate the change due from a transaction. It also prints the number of twenties, tens, fives, ones, and coins required to meet the amount. I am looking for suggestions for a more simplified and pythonic approach.
def change_return(cost,paid):
change = round(paid-cost,2)
print(f'Change ... |
I have a exercise where I have to write a Stack class with the push and pop methods. The code compiles and works as it should. Are there better practices to use in my code? Is there something I should avoid doing?
public class Stack {
private final int INCREMENTSIZE = 1024;
Integer position = 0;
int[] lis... |
This is a follow up to this code and I still did not get the feedback on the drawing functions
Maze generator in Python- Gif animator-Custom colors/sizes
The code generates custom color and size mazes with optional generation of either a single full maze image or an animated GIF for the maze being created. 6 algorithms... |
By hashing together various online tutorials I've constructed my first MVVM application that lets users navigate between "tabs" and a "tab" (ColorList_Tab) that performs basic list functions such as adding, editing, deleting and saving colors.
A new tab can be addded by adding a new data context to the MainWindow res... |
It's a simple range function that works like python range and it is only a syntactic sugar for the usual for loop
if we want to operate on numbers in the range from 1 to 10 (1 ... 9) we use this code :
for (int i = 0; i < 10; ++i) { ... }
but c++ 11 came with the for range loops in which this code :
for (auto i : arra... |
The following class is set of functions I use for web development(examples below) and I was wondering how to structure it.
Examples:
//Checking if user isn't admin so that he can access login page
$helper = new Base();
if ($helper->is_admin()) {
$helper->location("index.php");
}
//Encoding output to prevent XSS
... |
I have completed this mockup eCommerce app using pure Vanilla Javascript. This version can add product into shopping cart and automatically calculate the order summary in the shopping cart. It can also delete one item and all items in the shopping cart.
Certain function like checkout,payment,login,update quantity in ca... |
I have made a little game in JS. Are there any remarks? The game asks a question through the console and accepts the answer through prompt. If the answer is correct you'll get points. To stop the game you need to write exit.
These are the game rules:
Let's build a fun quiz game in the console!
Build a function const... |
I'm trying out a new editor (CLion) and I decided to try an old well known programming problem. I also decided to try out C99 rather than C89.
This program calculates the nth term of the Fibonacci Sequence where the value of the current term is the sum of the 2 previous terms. The first 4 terms are 0, 1, 1, 2. The uppe... |
https://leetcode.com/problems/merge-k-sorted-lists/
Merge k sorted linked lists and return it as one sorted list. Analyze
and describe its complexity.
Example:
Input:
[
1->4->5,
1->3->4,
2->6
]
Output: 1->1->2->3->4->4->5->6
using System.Collections.Generic;
using Heap;
using Microsoft.VisualStudio.TestTool... |
I recently learned about backpropagation online and tried to implement it. I am not sure I have it correct yet. I am confused and would love a second pair of eyes on this code. Please help me understand how I can improve this and if this is even correct.
Implementation:
"""
Artificial Neural Network
"""
import numpy a... |
This is a LeetCode Problem
You have a pile of stones presented as an array. On each turn you must merge k consecutive piles of stones, starting from any pile you wish. You must continue merging piles until you are left with one pile only. You must do this with minimum overall cost, where the cost is the sum of the ong... |
I am working on setting up automated build and deploy jobs in jenkins for a php based project. I would like some feedback on my Jenkinsfile. Specifically regarding the parallelization, the (in my opinion) huge usage of sh and the best practices regarding the site configuration (would a bunch of included files be better... |
I wrote a program that converts a hex-encoded string to base64. It's my solution to the first of the Cryptopals challenges.
My main concerns are:
Portability. I don't want to rely on implementation-specific or non-standard behavior.
Reusability. I wrote a function to get bytes from hex and one to get base64 from bytes... |
This asks the user for the file name and the number of lines they want to remove. It then stores each line into a vector. A dynamic array is used to hold the random line numbers (generated by random generator) and the corresponding element in the vector is deleted. This vector is then copied to a new file named "temp.t... |
I wrote a simple Torrent file parser. The following program accepts a file and builds a Torrent structure based on the contents on the file. If the file is invalid, the app crashes (as intended).
It's my first time writing anything >50 lines in rust, so I'm looking for improvements :)
use std::collections::BTreeMap;
... |
One of the things that has been really exciting me in c++20 is std::bind_front. Using placeholders with std::bind and boost::bind has really bothered me and the code looked messier and messier with each call to bind. It was bad enough for me to decide to enable -std=c++2a and pray that I wouldn't have to fix the code i... |
I hava a question similiar with mege in Python but I am trying to write Java code.
Here is my code:
The input is: The first line - a number of arrays (k); Each next line - the first number is the array size, next numbers are elements.
Max k is 1024. Max array size is 10*k. All numbers between 0 and 100. Memory limit - ... |
How may I optimize the following function to write a xls file from a list of dictionaries using the openpyxl library in Python?
The current logic behind feels very very wrong
The dict list:
things = [
{
"Fruit": "Orange",
"Flavour": "Good",
"Expiration": "21May20"
},
{
"Fruit... |
So I was fiddling around with the Euler challenges. One of the things they mentioned in their discussions of the solutions is the Sieve of Eratosthenes and that you can only use it when you know an upper bound of the primes you want to generate.
I wondered whether the algorithm can be adapted to work without that upper... |
Problem Description
I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos:
Image Upload Process
This is the process that I follow for saving images. Once user drops an image on the uploader, it would get saved with a temporary prefi... |
For my research I'm working on global search methods where a candidate solution can have it's fitness (=score) evaluated in multiple fidelities (=accuracy levels). The goal of the CandidateArchive is to keep a clear overview of which candidate solutions have been evaluated under which fidelities. A candidate is an ndim... |
I write kind of UDP server. It should serves about 50 messages per second.
I would like a review about the general code 'quality' and logic. The server uses the same socket for sending and receiving messages. The messages are short - about 100 bytes (json).
The code:
public class UdpServer extends Thread {
/* Receive ... |
Extract the strings from nested arrays in Perl.
It prints: a, b, c, d, E
use strict;
use warnings;
use feature qw(say signatures current_sub);
no warnings qw(experimental::signatures);
my $nested = [1, 'a', [2, 3, 'b'], [4, [5, 6, 7, ['c']], [7, [8, 9, [10, 'd']]], 11, 'E']];
print join ', ', @{ extract_strings($nes... |
I am a C# game developer currently learning C++. I am trying to implement some simplified STL containers. Here is my implementation of vector, which does not have the allocator (because std::allocator is to Allocation what std::vector is to Vexation).
My objective is to understand the mechanics how the vector works beh... |
I have made a ChoiceField into a select and submit button and wondered if this is the correct approach.
forms.py
class PortfolioForm(forms.Form):
def __init__(self, *args, **kwargs):
super(PortfolioForm, self).__init__(*args, **kwargs)
portfolios = [('pf 1', 'pf 1'), ('pf 2', 'pf 2'), ('pf 3', ... |
I am working on a website with an animation that runs at the beginning before the content of the homepage becomes visible.
I've looked at some examples of preloaders and now use that code with some setTimeout to implement the desired effect.
The effect works the way it should but I think the code it's a bit messy. is ... |
I'm making a 2D game which wraps (when you move off the right edge, you appear on the left, etc). The game area is square, all objects are circles (with AABB smaller than the game area, and in most cases, much smaller).
I'm dividing the game area into a grid to perform collision checks. I need to determine which cell(s... |
This isn't the actual use-case I have but for simplicity, let's say I have an ActiveRecord Animal model in a Rails app. The Animals have a name (string) and rating (int). There could be animals with the same name but different ratings. In my Animal model I have a hardcoded constant like this:
SPECIAL_ANIMAL_TYPES = [
... |
The object of the code is to prompt the user with a quiz and collect the g's, y's, 0's, and 1's and if there is more than one then the user passes (else, they fail). I am a beginner and would like to know if there is a more efficient direction for this code to go in.
from time import sleep
print(pic1)
def check(name... |
Context
I'm trying to build a system in which a tool (the Client) will generate a header to be used as part of an HTTP request from the user's browser.
The user should be able to choose their own implementation of the Client.
The user should not have to install a plugin or extension to their browser.
Summary
A 3rd pa... |
I'm writing a function to generate a permutation of given []int:
// Input: [1,2,3]
// Output:
// [
// [1,2,3],
// [1,3,2],
// [2,1,3],
// [2,3,1],
// [3,1,2],
// [3,2,1]
// ]
func permute(nums []int) [][]int {
var tmp []int
var res [][]int
invalid_pos := make([]bool, len(nums))
res = backtr... |
So I have this:
And the typesetting code is here:
<html>
<head>
<style>
#step_id1 {
color: black;
}
#comment_id1 {
color: black;
}
#step_id2 {
color: brown;
}
#comment_id2 {
color: black;
}
#step_id3 {
color: black;
}
#comment_id3 {
color: blue;
}
#step_id4 {
color: brown;
}
#comment... |
I have project where I'm using BindableBase for my INotifyPropertyChanged implementation. Some of my objects however are generating a very rapid and bursty stream of INPC notifications, which is causing my UI to update unnecessarily often - to the point of making it laggy. To compensate, I'm attempting to throttle th... |
Below I created a function to format all the floats in a pandas DataFrame to a specific precision (6 d.p) and convert to string for output to a GUI (hence why I didn't just change the pandas display options). Is this the most efficient way to convert all floats in a pandas DataFrame to strings of a specified format?
im... |
Plugin is a small editor that allows to create a filter such as a price slider, checkboxes of "brands", a drop-down of "seasons".
An example of how plugin work can be seen on page: http://demo-product-filters.anexter.net/
Such plugins are used in many stores, and they need to be easily scalable.
Element classes is main... |
I am just testing how I solved simple stuff.
Goal: The aim is to expand the width of an input and collapse it.
When mouseover expand,.
When mouseout collapse.
When you have text inside the input keep it expanded.
To me it seems too much, repeating some stuff in JS.
Also thought about adding a debouncer or throttle but... |
Edit: The comments have been incorporated to this module in GitHub. The final code has been included at the end of this thread. Thanks very much for the detailed and brilliant suggestions.
Inspired in this color gradient generator, this is a gradient generator in perl6. I wonder if the code could be simplified or impr... |
I want to insert a small str into a larger one in the most pythonic way.
Maybe I missed a useful str method or function ? The function that insert the small str into the larger one is insert_tag.
I have tried something with reduce but it didn't work and it was too complex.
Code:
from random import choice, randrange
fro... |
I've been developing my first real python gui-program for a while now. Having watched some tutorials to tkinter and OOP I've gotten quite far, but now I just can't get my code to do what I want it to.
So here's my code so far:
import random
import string
import time
import datetime
import tkinter as tk
import pandas a... |
Recently, I needed a class that could execute code in a FIFO fashion in order to update parts of a WinForms or WPF UI which did not block the UI Thread and left the UI responsive to any interaction the user did on it.
To achieve that objective, I developed the following code, which meets its requirements and performs d... |
I use NodeJS along with the MongoDB NodeJS Driver to store tweets into my local MongoDB server. In the following setup, mongos insertOne method gets invoked quite often by a socket event.
const MongoClient = require('mongodb').MongoClient;
const TwitterClient = require('node-tweet-stream');
const twitter = new Twitt... |
I am new to this CompletableFuture function in Java. I have the following code below that works fine but looks quite messy IMHO.
CompletableFuture<String> cf = CompletableFuture.completedFuture(isRQMRunning_3);
if(cf.isDone()) {
System.out.println("Value- " + cf.get());
cf = CompletableFuture.completedFuture(s... |
I am using a function in a SpringBoot @RestController, with Lombok
This function is an intermediate result that permit me to do an aggregation between two classes.
This 2 classes are:
@Data
public class AchMatiereCmdCptAggDto implements Serializable {
private static final long serialVersionUID = 402215495580844718... |
As a project to better my skills in Python, I wrote a password manager. It's a website that has user login/logout functionality, the ability to add websites and passwords, and displays the websites/passwords when the user logs in. Since this is my first project integrating Python with Flask, I would like feedback conce... |
The following program calls a function, which prompts the user for input. The function then returns one of three enum constants; INPUT_SUCCESSFUL, INPUT_TOOLONG, or INPUT_FAILED. If successful, it prints the text entered by the user. Otherwise, it prints an error message, and takes the appropriate action.
The functi... |
I'd had a hard time getting this to work. I’d like to parse a file containing data and copy this data into a struct.
The data file (test.dat) looks like this:
1,"Tom","Smith"
2,"Peter","Perth Junior"
3,"Cathy","Johnson"
I use the following function.
func parseDataFile() {
struct person {
var id: Int
... |
good afternoon.
I'm learning c++ and I made this app to "manage" lockers.
I would like you to review it please, you can find the source code at my github: https://github.com/VitalZero/lockermanager
The app is made up by 3 main clases:
CDocument: Takes care of file input/output
CLockers: The lockers itself, stores it'... |
I have completed this mockup eCommerce app using Javascript. This version can add products into a shopping cart and automatically calculate the order summary in the shopping cart. It can also delete one item and all items in the shopping cart.
Checkout and login functions are not included.
Appreciate all comments and c... |
I've written this simplified code to compute Pi for educational/demonstration purposes.
These methods are based upon the generalized means: see a presentation on Pi and the AGM.
Archimedes' method gives linear convergence, which means you get two extra bits of precision per iteration.
Gauss's method gives quadratic con... |
This is my first smart contract, and it isn't finished yet, but the remaining bits are complicated enough that I'd like to make sure I'm on the right track first. My concerns are:
At line 117, is the missing division an actual division or a modular multiplicative inverse? (BigNumber provides neither; the bn_div method... |
Is there a way to improve this code? I'd like to use the enum type PaymentMethoddirectly in the angular template without renaming it to _PaymentMethod.
export enum PaymentMethod {
CreditCard,
EFT
}
@Component()
export class PaymentComponent {
// ReSharper disable once InconsistentNaming
_PaymentMethod... |
I've currently started solving some competitive programming Graph questions. But Started using adjacency list as HashMap<Integer,ArrayList<Integer>> list . But in some problems, this doesn't work. so I decided to implement class Graph other than this HashMap.
I would like a review of efficiency and general code quality... |
I need a little bit of refactor my initialize method because I think it will make initializer more flexible and readable.
class LogAdminData
DEFAULT_EXCLUDED_PARAMS = %w[
encrypted_password
reset_password_token
reset_password_sent_at
].freeze
def initialize(admin_obj:, action_type:, old_data:, new_da... |
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000?
BigInteger big = new BigInteger("2");
big = big.pow(1000);
String num = big.toString();
System.out.println(num);
int result = 0;
for(char i : num.toCharArray()) {
resul... |
I have written a cryptography NPM package called kruptein. The code is also hosted on GitHub.
Having used multiple "best practices" with regards to key management, algorithm selection, key size, iv size etc. I could use someone with experience in this area to help validate the implementation.
I could use some help det... |
I have written a small program that reads input from a text file and then writes this output to a text file. The method contains a switch which decides whether to output to the file as text or as a literal string of the bytes. How could I refactor this code to only include a single if statement block instead of two to ... |
Here is a working Python implementation of primality test. Is there something that I could change in code to achieve a better running time? For more information about algorithm see this post.
from sympy import *
from sympy.abc import x
n=int(input("Enter a number : "))
def xmat(r,n):
return Matrix([[2*x, -1], [1... |
I have this little project i am about to release.
https://github.com/holli-holzer/perl6-Win-VT
I would be happy about a code review and suggestions for a better name.
Discussion in IRC yielded Terminal::Win::VT or Terminal::Win32::VT::Enable as better alternatives. Or even Win32::Console::VT.
This is the gist of it.... |
The code takes a list of names and extracts the three letter pattern from the names. Then return the list of names as a value in the dictionary with key as a pattern. The list name has a fixed naming pattern like three letter Spp in the example. It can extent like App, Bpp, Cpp etc..
How can I improve this code?
impor... |
Challenge:
Check if a string (first argument, str) ends with the given target
string (second argument, target).
This challenge can be solved with the .endsWith() method. But for the
purpose of this challenge, do not use it.
I would like to especially have my solution critiqued.
function confirmEnding(str, target)... |
I use ADO (specifically for accessing SQL) daily at work. So, I finally decided that I was going to create a class that makes it simple for myself and other programmers on the job to use. Just the other day, I saw @MathieuGuindon's post about creating parameters on the fly, and I really liked his Idea, so I implemente... |
The script takes two input files of protein sequences and runs an external program (installed in linux/MacOS). The result provides a text output file example output.. Identity percentage is extracted from the matched keyword "Identity" in the line. Also, the script returns the result text file.
Can you help me to impr... |
I am getting started in Rust, and as a part of my first exercise, I decided to write a small program that converts a hexadecimal string to a binary string using a pattern matched lookup. I would appreciate a constructive review.
fn main() {
let binary_value = convert_to_binary_from_hex("0x39A7F8");
println!("Co... |
I wrote a test application to familiarize myself with the Tornado Python framework. The application currently generates a cookie that you can view and delete. I also created a certain file structure. I would like to know if it will comply with current coding standards. Of course, I am also open to any comments about my... |
This is my first ever Python program. I thought I would make a calculator that performs 5 operations: add, subtract, divide, multiply, power. I am aware Python has its own power function, called "pow", but I have defined my own power function for practice.
I've taken the input as a single string, and then I've tried to... |
I'm a beginning "pythonist" my current task is to write a checkers game and I need some suggestions here and there:
are the code style and literacy answering the criteria of python?
are the modules of my program correlating with each other correctly?
are the algorithms of finding possibilities (actions) for chechers ... |
Today I decided to continue refining my JavaScript skills and utilized the Stack Exchange API (v2.2) to write a "user flair" replica.
In case you don't know what the flair that SE provides is:
The process was a little tedious in places, but only because I am still learning the concept of callbacks in JavaScript and th... |
I wrote a timetabling program and I have been using a matrix to check for clashes between courses. Index (i, j) in the matrix tells us how many people are in both courses i and j.
My previous Matrix was just using nested vectors:
std::vector<std::vector<int>> clashes;
This would throw std::bad_alloc because the matri... |
I have a controller that returns data about users. I want to set the authorization such that an admin can access this controller and retrieve data for any user, and a non-admin user can access the controller and retrieve data for themselves.
I've ruled out using [Authorize (Roles = "Admin")] because this means users ca... |
Currently I'm writing something like a messaging or logging framework (I'm not really sure how you name something like that). There are different servers which have to be notified if something happens.
The servers mainly store the data e. g. for statistics. One server is an ELK stack which receives the data via a REST... |
Challenge:
Resolve git conflict by resolveGitConflict(linesArray, resolveMode), where
linesArray is an array of strings
Example:
[
"context1",
"context2",
"<<<<<<<",
"my changes1",
"=======",
"their changes1",
">>>>>>>",
"context3",
"context4",
"<<<<<<<",
"my changes2",... |
I was wondering what I could do to improve the gameplay of this game, as well as the graphics. I would like to use LWJGL, but the rendering library isn't important. I just need to find out improvements for my code, as well as things I can do to make it look better and play better.
The idea is simple. Don't hit red orbs... |
As a summer project, I have been working on a small-scale, console-based version of Mahjong (the Rummy-like hand completion game, and not the solitaire version). While having prior knowledge of the game would help in understanding the problem, I don't believe it is necessary.
Early on in the project I wrote an algorit... |
I have written some PHP to make WHOIS queries and return the retrieved WHOIS record.
The code is an excerpt from a much larger program used for monitoring domain name expiry. It's a command-line program designed to be run in a shell such as Bash or PowerShell, and has no web services involved.
Firstly, there is a funct... |
I have cardView in my android app with three child component. I set the background color for each components. Based on card INDEX I reset the background colors individually.
If it's just one cardView then its not a problem, but I have to include 16 (16 more card indexes) more cardViews exactly the same structure but on... |
I would like to aggregate rows of my dataframe together, following those rules:
Rows are grouped by "Id", and sorted by anticipation
One row can only be aggregated with rows next to it, with the same "Id"
The "Anticipation" of the new row is the weighted mean of the "Anticipation" (weighted by "Size") of aggregated r... |
I have two folders query and subject. The following function sorts alphabetically and provides the query and subject as a separate list. The file names are mixed of numbers and I found the sort function works perfectly well. Any comments to improve?
import os
import re
subject_path = "/Users/catuf/Desktop/subject_fas... |
I am making a small database and these are the following files. The scripts are working. How can I improve my scripts? Are there any places where a problem could occur? I have yet to write tests for this. Let me know if you need further details.
models.py
from django.db import models
from django.contrib import admin
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.